Potions 8.1 Com Level E Vocações

cigarretts
em Actions e Talkactions

cigarretts

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 13/03/06Posts: 14Char no Tibia: Lord Magnamite

Gente .. aki vou ensinar como fazer os potions sem bugar as hotkeys .. pra aparecer empty flask !

 

>.<

 

Prestem Atenção!

 

Façam uma pasta em data/actions/scripts Chamada :

 

MP HP Potions

 

e dentro dela vc cria um arquivo chamado

 

OBS: TODOS OS POTIONS ABAIXO SÂO NA MESMA PASTA MP HP POTIONS!!!!

health potion.lua

 

e dentro do health potion.lua coloque isto

 

function onUse(cid, item, frompos, item2, topos)
mag = getPlayerMagLevel(cid)
if mag >= 1 then
	doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
	doPlayerAddHealth(cid, math.random(80, 200))
	doSendMagicEffect(topos, 12)

	if item.type > 1 then
		doChangeTypeItem(item.uid,item.type-1)
	else
		doRemoveItem(item.uid,1)
	end
else
	doSendMagicEffect(frompos,2)
	doPlayerSendCancel(cid,"You don't have the required level to use that 

potion.")
end

return 1
end

 

Helath potion OK!

 

Agora vamos pro strong health potion!

 

Faça a mesma coisa.. Crie um arquivo chamado strong health potion.lua

 

abra-o e coloque isto:

function onUse(cid, item, frompos, item2, topos)
mag = getPlayerMagLevel(cid)

	if getPlayerLevel(cid) < 50 then
	doSendMagicEffect(frompos,2)
	doPlayerSendCancel(cid,"This potion can only be consumed by paladins and knights of level 50 or higher.")

	return 1
	end

if getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 7 or getPlayerVocation(cid) == 8 then
	doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
	doPlayerAddHealth(cid, math.random(200, 400))
	doSendMagicEffect(topos, 12)

	if item.type > 1 then
		doChangeTypeItem(item.uid,item.type-1)
	else
		doRemoveItem(item.uid,1)
	end
else
	doSendMagicEffect(frompos,2)
	doPlayerSendCancel(cid,"This potion can only be consumed by paladins and knights of level 50 or higher.")
end

return 1
end

 

Agora vamos pro Great Health potion!

 

Crie um arquivo chamado great health potion.lua

 

e dentro dele coloque:

 

function onUse(cid, item, frompos, item2, topos)
mag = getPlayerMagLevel(cid)

	if getPlayerLevel(cid) < 80 then
	doSendMagicEffect(frompos,2)
	doPlayerSendCancel(cid,"This potion can only be consumed by paladins and knights of level 80 or higher.")

	return 1
	end

if getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 4 or getPlayerVocation(cid) == 7 or getPlayerVocation(cid) == 8 then
	doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
	doPlayerAddHealth(cid, math.random(200, 400))
	doSendMagicEffect(topos, 12)

	if item.type > 1 then
		doChangeTypeItem(item.uid,item.type-1)
	else
		doRemoveItem(item.uid,1)
	end

else
	doSendMagicEffect(frompos,2)
	doPlayerSendCancel(cid,"This potion can only be consumed by paladins and knights of level 80 or higher.")
end

return 1
end

 

Agora Vamos Para os Mana Potions!!!

 

Crie um arquivo na mesma pasta MP HP Potions.> chamado mana potion.lua

 

e dentro dele coloque:

 

function onUse(cid, item, frompos, item2, topos)
mag = getPlayerMagLevel(cid)
if mag >= 1 then
	doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
	doPlayerAddMana(cid, math.random(50, 100))
	doSendMagicEffect(topos, 12)

	if item.type > 1 then
		doChangeTypeItem(item.uid,item.type-1)
	else
		doRemoveItem(item.uid,1)
	end
else
	doSendMagicEffect(frompos,2)
	doPlayerSendCancel(cid,"You don't have the required level to use that potion.")
end

return 1
end

 

Agora vamos para o Strong mana potion !!

 

Crie um arquivo chamado strong mana potion.lua

 

e dentro dele coloque:

 

function onUse(cid, item, frompos, item2, topos)
mag = getPlayerMagLevel(cid)

	if getPlayerLevel(cid) < 50 then
	doSendMagicEffect(frompos,2)
	doPlayerSendCancel(cid,"This potion can only be consumed by paladins, druids and sorcerers of level 50 or higher.")

	return 1
	end

if getPlayerVocation(cid) == 3 or getPlayerVocation(cid)  == 7 or getPlayerVocation(cid)  == 1 or getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 6 then
	doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
	doPlayerAddHealth(cid, math.random(200, 400))
	doSendMagicEffect(topos, 12)

	if item.type > 1 then
		doChangeTypeItem(item.uid,item.type-1)
	else
		doRemoveItem(item.uid,1)
	end
else
	doSendMagicEffect(frompos,2)
	doPlayerSendCancel(cid,"This potion can only be consumed by sorcerers, paladins and druids of level 50 or higher.")
end

return 1
end

function onUse(cid, item, frompos, item2, topos)
mag = getPlayerMagLevel(cid)

	if getPlayerLevel(cid) < 80 then
	doSendMagicEffect(frompos,2)
	doPlayerSendCancel(cid,"This potion can only be consumed by paladins, druids and sorcerers of level 80 or higher.")

	return 1
	end

if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 6 then
	doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
	doPlayerAddMana(cid, math.random(250, 500))
	doSendMagicEffect(topos, 12)

	if item.type > 1 then
		doChangeTypeItem(item.uid,item.type-1)
	else
		doRemoveItem(item.uid,1)
	end
else
	doSendMagicEffect(frompos,2)
	doPlayerSendCancel(cid,"This potion can only be consumed by sorcerers and druids of level 80 or higher.")
end

return 1
end

 

Pronto !

 

Agora va em actions.xml na pasta data/actions e cole isso\/

 

Agora o Ultimo !!!

 

Great Mana Potion!!

 

Crie um arquivo chamado great mana potion.lua

 

e dentro dele coloque:

 

 

function onUse(cid, item, frompos, item2, topos)
mag = getPlayerMagLevel(cid)

	if getPlayerLevel(cid) < 80 then
	doSendMagicEffect(frompos,2)
	doPlayerSendCancel(cid,"This potion can only be consumed by paladins, druids and sorcerers of level 80 or higher.")

	return 1
	end

if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 6 then
	doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
	doPlayerAddMana(cid, math.random(250, 500))
	doSendMagicEffect(topos, 12)

	if item.type > 1 then
		doChangeTypeItem(item.uid,item.type-1)
	else
		doRemoveItem(item.uid,1)
	end
else
	doSendMagicEffect(frompos,2)
	doPlayerSendCancel(cid,"This potion can only be consumed by sorcerers and druids of level 80 or higher.")
end

return 1
end

 

Agora va em actions.xml na pasta data/actions e cole isto lá

 

<!-- Potions -->
-- Life potions
<action itemid="7618" exhaustion="1" script="MP HP Potions/health potion.lua" /> 
<action itemid="7588" exhaustion="1" script="MP HP Potions/strong health potion.lua" /> 
<action itemid="7591" exhaustion="3" script="MP HP Potions/great health potion.lua" /> 

-- Mana potions
<action itemid="7620" exhaustion="1" script="MP HP Potions/mana potion.lua" />
<action itemid="7589" exhaustion="1" script="MP HP Potions/strong mana potion.lua" />
<action itemid="7590" exhaustion="1" script="MP HP Potions/great mana potion.lua" /> 

 

Pronto !!!

 

ta feito suas potions !!!

 

CREDITOS 100% By Cigarretts

 

 

Cya !!

 

espero ter ajudado !!

 

ByE!


Até Jesus tem bot agora ...
_____________________________________

EU ACREDITO !
Orc Spearman foi lurado no centro da cidade de rookgaard dentro de uma bag e solto por um jogador.

DaNDaNrOxX

oi mosso
avatar
Marquês
Marquês

INFOS

Grupo: MarquêsRegistrado: 18/01/08Posts: 1455Char no Tibia: Saint Claire

Vlw aqui funfou sertinho :D

 

 

Entrada na equipe: 23/10/2008 Cargo: Estagiário

Promoção: 25/11/2008 Cargo: Moderador

Promoção: 21/10/2009 Cargo: Coordenador

Remoção: 09/05/2010 Motivo: Estudos

Retorno: 15/11/2010 Cargo: Moderador

Remoção: 20/12/2012.

 

 

sfmlarl

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 04/09/07Posts: 42Gênero: Masculino

Legal, parabens.

 

Dandanrox>> sertinho? LOLLLLLLLLL Perola :X

gorno

God Gorno
avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 21/12/07Posts: 121Char no Tibia: Jhonye Runner

Cara... valew msm... funcionou :smile_positivo:

você é bom nisso :icon1:

 

 

Só tem um problema... nao ficam os viais vasios na bp :icon2:

Att,

Gorno.

 

 

e7bd2e64bd.gif

 

- Você é meu fã? Então use minha Fã Bar!

6eb71bf385.png

Shadow Knight

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 17/06/07Posts: 35

põe um exausted :x

isto aí tá lagando d+ o ot

cigarretts

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 13/03/06Posts: 14Char no Tibia: Lord Magnamite

pow entao gente .. c alguem souber colocar os vial sem aparecer no hotkeys.(empty potions) agradeço!

 

enquanto ao exausted é só mudar no config lua pra tira um pouco o intervalo de actions

 

dexa 1000 q fica bom...

 

lags com isso axo q num da pra ocorrer :\

 

qlquer coisa ou duvida.. criticas.. etc.. msg aki ;D


Até Jesus tem bot agora ...
_____________________________________

EU ACREDITO !
Orc Spearman foi lurado no centro da cidade de rookgaard dentro de uma bag e solto por um jogador.

capeta7

avatar
Barão
Barão

INFOS

Grupo: BarãoRegistrado: 22/04/06Posts: 238

no meu ot n funfo :S

meu ot eh edron pvp enforced

n tah funfando n

 

acho q eh pq nesse ot n existe os potions em lugar nenhum

nem no items.xml

como add isso lah ??

QUOTE
21:51 Gabriel Stoll [12]: aki é thais?
21:51 Gabriel Stoll [12]: ?
21:51 Gabriel Stoll [12]: ?
21:52 Djinn Middow [20]: n.. eh northport ^.-

-----------------
mithi_9@hotmail.com
-----------------
----> Bars <----

matheusbm

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 29/01/08Posts: 71Char no Tibia: Knight of Fortune

Gostei ficou legal mesmo.

Gostou de min use meu fan bar


Meu Ot

ip:otbm.no-ip.org
rate:1000
skill:1000
mana:1000


Minhas metas


[x]1post
[x]5 posts SERVO
[x]10 posts CAMPONÊS
[x]25 posts CAÇADOR
[x]50 posts CAVALEIRO
[x]100 posts BARONETE
[ ]200 posts BARÃO
[ ]300 posts VISCONDE
[ ]400 posts DUQUE
[ ]600 posts ARQUEDUQUE
[ ]800 posts ARISTOCRATA
[ ]1000 posts REGENTE
[ ]1400 posts SÁBIO
[ ]1800 posts SACERDOTE
[ ]2500 posts PRÍNCIPE


Meus trabalhos

Felipets

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 13/11/05Posts: 19

Mto bom vo colok certo nu meu ot pq aki funfou direitinho.

Vlw :smile_positivo:

É meu fan? Use isto \/

Sou fan:


Skulls

Coordenador de Eventos
avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 26/02/07Posts: 859Gênero: Masculino
Cara... valew msm... funcionou :smile_positivo:

você é bom nisso :icon1:

 

 

Só tem um problema... nao ficam os viais vasios na bp :icon2:

 

Bom primeiramente isso vai ocorrer por causa de:

doRemoveItem(item.uid,1)

e porque a funcao que ele fez o player somente usa o vial (na verdade teria de usar o vial em si mesmo)

eu nao testei, pois nao tenho ot 8.1, mas voce tambem nao colocou exhausted.

 

Bom eu estou fazendo as pocoes para um amigo que me pediu..

quando eu acabar eu posto.. quem quiser vai tar na minha fan bar.

 

__

 

Sobre o tutorial.

 

A great health potion nao pode ser usadas por paladinos e no seu script pd.

Voce repetiu (sem querer creio eu) o script da great mana potion.

E a quantia de recuperacao das pocoes estao equivocadas (nas de health nem tanto, mas nas de mana estao muito elevadas).

 

fora isso esta bom.

 

e quero so exclarecer uma coisa

eu nao estou denegrindo nem diminuindo a importancia de seu trabalho apontando esses erros/informacoes...

sao criticas positivas, para que voce va aprimorando e que em trabalhos proximos corriga esses erros ja citados

espero que compreenda.

 

fui,

skulls