Pocoes 8.1.
Bem a pedido de um amigo criei poções 8.1 (health, strong health, great health, mana, strong mana, great mana.)
Então aí vai:
Primeiro Va na pasta actions/script, copie 6 vezes qualquer arquivo de lá e Renomeie-os para:
1ª Copia- Health Potion
2ª Copia- Strong Health Potion
3ª Copia- Great Health Potion
4ª Copia- Mana Potion
5ª Copia- Strong Mana Potion
6ª Copia-Great mana potion
Pronto, os arquivos estao criados agora vamos editá-los.
Abra o arquivo health Potion.lua e dentro dele cole:
-- Health potion By skulls function onUse(cid, item, frompos, item2, topos) playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253} player = getThingfromPos(playerpos) ml = getPlayerMagLevel(cid) lvl = getPlayerLevel(cid) voc = getPlayerVocation(cid) ex = getPlayerStorageValue(cid,4862) r1 = math.random(100,300) params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml } if item2.itemid == 1 then if item.itemid == 7636 then doPlayerSendCancel(cid,"It is empty.") else if item2.uid == cid then if ex == -1 then doPlayerAddHealth(cid,r1) doSendMagicEffect(playerpos,12) addEvent(ums,1000,params) setPlayerStorageValue(cid,4862, 1) doTransformItem(item.uid,7636) doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE) else doPlayerSendCancel(cid,'You are exhausted!') doSendMagicEffect(playerpos,2) end else splash = doCreateItem(1903,item.type,topos) doTransformItem(item.uid,7636) doDecayItem(splash) end end else if item.itemid == 7636 then doPlayerSendCancel(cid,"It is empty.") else splash = doCreateItem(1903,item.type,topos) doTransformItem(item.uid,7636) doDecayItem(splash) end end return 1 end function ums(params) cid = params[1] setPlayerStorageValue(cid,4862, -1) end
Pronto, Sua Health Potion esta criada.
__
Agora Abra strong health potion.lua e cole isso dentro:
-- Strong Health potion By skulls function onUse(cid, item, frompos, item2, topos) playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253} player = getThingfromPos(playerpos) ml = getPlayerMagLevel(cid) lvl = getPlayerLevel(cid) voc = getPlayerVocation(cid) ex = getPlayerStorageValue(cid,4862) r1 = math.random(200,600) params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml } if item2.itemid == 1 then if item.itemid == 7634 then doPlayerSendCancel(cid,"It is empty.") else if item2.uid == cid then if lvl >= 50 then if voc == 4 or voc == 3 or voc == 7 or voc == 8 then if ex == -1 then doPlayerAddHealth(cid,r1) doSendMagicEffect(playerpos,12) addEvent(ums,1000,params) setPlayerStorageValue(cid,4862, 1) doTransformItem(item.uid,7634) doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE) else doPlayerSendCancel(cid,'You are exhausted!') doSendMagicEffect(playerpos,2) end else doPlayerSendCancel(cid, 'This potion can only be consumed by paladins and knights of level 50 or higher.') end else doPlayerSendCancel(cid,'This potion can only be consumed by paladins and knights of level 50 or higher.') end else splash = doCreateItem(1903,item.type,topos) doTransformItem(item.uid,7634) doDecayItem(splash) end end else if item.itemid == 7634 then doPlayerSendCancel(cid,"It is empty.") else splash = doCreateItem(1903,item.type,topos) doTransformItem(item.uid,7634) doDecayItem(splash) end end return 1 end function ums(params) cid = params[1] setPlayerStorageValue(cid,4862, -1) end
Pronto, Sua Strong Health Potion esta criada.
__
Agora abra o Great Health Potion.lua e cole isso dentro:
-- Great Health potion By skulls function onUse(cid, item, frompos, item2, topos) playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253} player = getThingfromPos(playerpos) ml = getPlayerMagLevel(cid) lvl = getPlayerLevel(cid) voc = getPlayerVocation(cid) ex = getPlayerStorageValue(cid,4862) r1 = math.random(400,800) params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml } if item2.itemid == 1 then if item.itemid == 7635 then doPlayerSendCancel(cid,"It is empty.") else if item2.uid == cid then if lvl >= 80 then if voc == 4 or voc == 8 then if ex == -1 then doPlayerAddHealth(cid,r1) doSendMagicEffect(playerpos,12) addEvent(ums,1000,params) setPlayerStorageValue(cid,4862, 1) doTransformItem(item.uid,7635) doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE) else doPlayerSendCancel(cid,'You are exhausted!') doSendMagicEffect(playerpos,2) end else doPlayerSendCancel(cid, 'This potion can only be consumed by knights of level 80 or higher.') end else doPlayerSendCancel(cid,'This potion can only be consumed by knights of level 80 or higher.') end else splash = doCreateItem(1903,item.type,topos) doTransformItem(item.uid,7635) doDecayItem(splash) end end else if item.itemid == 7635 then doPlayerSendCancel(cid,"It is empty.") else splash = doCreateItem(1903,item.type,topos) doTransformItem(item.uid,7635) doDecayItem(splash) end end return 1 end function ums(params) cid = params[1] setPlayerStorageValue(cid,4862, -1) end
Pronto sua Great Health Potion está criada.
__
Agora abra o Mana Potion.lua e cole isso:
-- Mana potion By skulls function onUse(cid, item, frompos, item2, topos) playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253} player = getThingfromPos(playerpos) ml = getPlayerMagLevel(cid) lvl = getPlayerLevel(cid) voc = getPlayerVocation(cid) ex = getPlayerStorageValue(cid,4862) r1 = math.random(50,150) params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml } if item2.itemid == 1 then if item.itemid == 7636 then doPlayerSendCancel(cid,"It is empty.") else if item2.uid == cid then if ex == -1 then doPlayerAddMana(cid,r1) doSendMagicEffect(playerpos,12) addEvent(ums,1000,params) setPlayerStorageValue(cid,4862, 1) doTransformItem(item.uid,7636) doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE) else doPlayerSendCancel(cid,'You are exhausted!') doSendMagicEffect(playerpos,2) end else splash = doCreateItem(1903,item.type,topos) doTransformItem(item.uid,7636) doDecayItem(splash) end end else if item.itemid == 7636 then doPlayerSendCancel(cid,"It is empty.") else splash = doCreateItem(1903,item.type,topos) doTransformItem(item.uid,7636) doDecayItem(splash) end end return 1 end function ums(params) cid = params[1] setPlayerStorageValue(cid,4862, -1) end
Mana potion criada.
__
Agora Abra Strong Mana potion.lua e cole isso dentro:
function onUse(cid, item, frompos, item2, topos) playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253} player = getThingfromPos(playerpos) ml = getPlayerMagLevel(cid) lvl = getPlayerLevel(cid) voc = getPlayerVocation(cid) ex = getPlayerStorageValue(cid,4862) r1 = math.random(100,300) params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml } if item2.itemid == 1 then if item.itemid == 7634 then doPlayerSendCancel(cid,"It is empty.") else if item2.uid == cid then if lvl >= 50 then if voc == 1 or voc == 2 or voc == 3 or voc == 5 or voc == 6 or voc == 7 then if ex == -1 then doPlayerAddMana(cid,r1) doSendMagicEffect(playerpos,12) addEvent(ums,1000,params) setPlayerStorageValue(cid,4862, 1) doTransformItem(item.uid,7634) doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE) else doPlayerSendCancel(cid,'You are exhausted!') doSendMagicEffect(playerpos,2) end else doPlayerSendCancel(cid, 'This potion can only be consumed by paladins, druids and sorcerers of level 50 or higher.') end else doPlayerSendCancel(cid,'This potion can only be consumed by paladins, druids and sorcerers of level 50 or higher.') end else splash = doCreateItem(1903,item.type,topos) doTransformItem(item.uid,7634) doDecayItem(splash) end end else if item.itemid == 7634 then doPlayerSendCancel(cid,"It is empty.") else splash = doCreateItem(1903,item.type,topos) doTransformItem(item.uid,7634) doDecayItem(splash) end end return 1 end function ums(params) cid = params[1] setPlayerStorageValue(cid,4862, -1) end
Sua Strong Mana Potion Esta Criada.
__
Agora abra o Great Mana Potion.lua e cole isso:
-- Great Mana potion By skulls function onUse(cid, item, frompos, item2, topos) playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253} player = getThingfromPos(playerpos) ml = getPlayerMagLevel(cid) lvl = getPlayerLevel(cid) voc = getPlayerVocation(cid) ex = getPlayerStorageValue(cid,4862) r1 = math.random(150,450) params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml } if item2.itemid == 1 then if item.itemid == 7635 then doPlayerSendCancel(cid,"It is empty.") else if item2.uid == cid then if lvl >= 80 then if voc == 1 or voc == 2 or voc == 5 or voc == 6 then if ex == -1 then doPlayerAddMana(cid,r1) doSendMagicEffect(playerpos,12) addEvent(ums,1000,params) setPlayerStorageValue(cid,4862, 1) doTransformItem(item.uid,7635) doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE) else doPlayerSendCancel(cid,'You are exhausted!') doSendMagicEffect(playerpos,2) end else doPlayerSendCancel(cid, 'This potion can only be consumed by druids and sorcerers of level 80 or higher.') end else doPlayerSendCancel(cid,'This potion can only be consumed by druids and sorcerers of level 80 or higher.') end else splash = doCreateItem(1903,item.type,topos) doTransformItem(item.uid,7635) doDecayItem(splash) end end else if item.itemid == 7635 then doPlayerSendCancel(cid,"It is empty.") else splash = doCreateItem(1903,item.type,topos) doTransformItem(item.uid,7635) doDecayItem(splash) end end return 1 end function ums(params) cid = params[1] setPlayerStorageValue(cid,4862, -1) end
Pronto Sua Great Mana Potion está criada.
Com todas as potions criadas só precisamos criar as tags.
Abra seu actions.xml e cole essa tag la:
--- Potions -- -- Life potions <action itemid="7618" script="health potion.lua" /> <action itemid="7588" script="strong health potion.lua" /> <action itemid="7591" script="great health potion.lua" /> --- Mana potions <action itemid="7620" script="mana potion.lua" /> <action itemid="7589" script="strong mana potion.lua" /> <action itemid="7590" script="great mana potion.lua" />
Pronto Suas Potions estao Prontas e Perfeitas.
Bom eu só tenho um detalhe a acrescentar:
Eu fiz essas Potions em ot 8.0 (so mudei o id dos "vials") então eu não tenho os id's dos "vials" vazios. Eu tive entao que usar o id do liquido (1=wather, 2=blood... 7=mana fluid). Nas manas Potion usei id do mana fluid, Mas na health potion eu usei o id do sangue (blood), entao pode ser que voce tenha que alterar o id do liquido de todas as health potions em: (if item.type == 2 then) e [doChangeTypeItem(item.uid,2] (é só substituir o numero 2 pelo id do life fluid, mas se eu nao me engano o id é sangue mesmo, e meu colega usou no ot 8.1 e funcionou direitinho.
Bom é isso.
Espero que Gostem.
Creditos 50% meus (Skulls) por ter criado.Creditos 50% by Genoma, Sem o pedido dele eu nao teria tido um porque criar a potion.
Agradecimentos:
Maximusot -> por testar as potions
Jeanjc -> pelo id dos empty flasks
Capeta7 -> pelo bug do doPlayerAddMana(cid,r1) (tava addhealth antes nas mana potion auhehuae)
Sem mais.
Ps: Nao Reclamem de pouca explicação afinal não é um tutorial, são só as actions.