Bom, Primeiramente se o seu itens.xml não tem as potions estou disponibilizando um itens.xml que vem atualizado( ja ta anexado).
Vamos Começar pela Great Mana Potion:
Crie um Arquivo great mana potion.lua em data\actions\scripts, e coloque:
local greatEmptyPot = 7635
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), "Up =)...", TEXTCOLOR_RED)
if(doTargetCombatMana(0, cid, 300, 600, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
doTransformItem(item.uid, greatEmptyPot)
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
É o mínimo e o Máximo de Mana que irá aumentar(Pode Alterar a vontade)
------------------------------------------------------------------------------------------------------
Agora Vamos ao Greath Health Potion:
crie um arquivo great health potion.lua em data\actions\scripts e coloque:
local greatEmptyPot = 7635
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) == 4 or getPlayerVocation(cid) == 8 then
doSendAnimatedText(getPlayerPosition(cid), "Heal =)...", TEXTCOLOR_RED)
if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 800, 1500, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
doTransformItem(item.uid, greatEmptyPot)
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
É o mínimo e o Máximo de Vida que irá aumentar(Pode Alterar a vontade)
------------------------------------------------------------------------------------------------
Agora vamos ao Strong Mana Potion:
Faça um arquivo strong mana potion.lua em data\actions\scripts e coloque dentro:
local strongEmptyPot = 7634
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), "Up =)...", TEXTCOLOR_RED)
if(doTargetCombatMana(0, cid, 200, 400, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
doTransformItem(item.uid, strongEmptyPot)
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
É o mínimo e o Máximo de Vida que irá aumentar(Pode Alterar a vontade)
-----------------------------------------------------------------------------------------------------
Strong Health Potion:
Crie um arquivo strong health potion.lua em data\actions\scripts e coloque:
local strongEmptyPot = 7634
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), "Heal =)...", TEXTCOLOR_RED)
if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 350, 600, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
return FALSE
end
doTransformItem(item.uid, strongEmptyPot)
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
É o mínimo e o Máximo de Vida que irá aumentar(Pode Alterar a vontade)
---------------------------------------------------------------------------------------------------------
Agora no Actions.xml em Data\Actions adicione:
No Data\Actions\Actions.xml coloque:-- Life potions
<action itemid="7588" exhaustion="2" script="strong health potion.lua" />
<action itemid="7591" exhaustion="2" script="great health potion.lua" />
-- Mana potions
<action itemid="7589" exhaustion="2" script="strong mana potion.lua" />
<action itemid="7590" exhaustion="2" script="/great mana potion.lua" />
Créditos 100% Special_Forces, espero que gostem