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!