Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Segue:
- action itemid="IDDASTONE" event="script" value="mega stone.lua" allowfaruse="1"/>
- e o script:
- local evo = {["Charizard"] = {"Mega Charizard", QUANTIANECESSARIADESTONES},
- }
- local balls = {
- [IDDAPOKEBALL] = {newBall = IDDAPOKEBALL},
- }
- function onUse(cid, item, fromPosition, itemEx, toPosition)
- if isMonster(itemEx.uid) and getCreatureMaster(itemEx.uid) == cid then
- local monster = getCreatureName(itemEx.uid)
- if evo[monster] then
- if getPlayerItemCount(cid, item.itemid) >= evo[monster][2] then
- doPlayerSendTextMessage(cid, 27, "Parabens! Seu "..getPokeName(itemEx.uid).." evoluiu para "..evo[monster][1].."!")
- local health, maxHealth = getCreatureHealth(itemEx.uid), getCreatureMaxHealth(itemEx.uid)
- doSendMagicEffect(getThingPos(itemEx.uid), 18)
- doRemoveCreature(itemEx.uid)
- doPlayerRemoveItem(cid, item.itemid, evo[monster][2]-1)
- doRemoveItem(item.uid, 1)
- doSummonMonster(cid,evo[monster][1])
- local pokeball = getPlayerSlotItem(cid, 8)
- doItemSetAttribute(pokeball.uid, "poke", evo[monster][1])
- doItemSetAttribute(pokeball.uid, "level", pokes[evo[monster][1]].level)
- doItemSetAttribute(ball, "hp", 1)
- doItemSetAttribute(ball, "happy", 110)
- local pk = getCreatureSummons(cid)[1]
- local getMegaPokeballs = balls[getPlayerSlotItem(cid, 8).itemid]
- doTransformItem(getPlayerSlotItem(cid, 8).uid, getMegaPokeballs.newBall)
- adjustStatus(pk, pokeball.uid, true, false, true)
- return TRUE
- else
- return doPlayerSendTextMessage(cid, 27, "Voce precisa de ".. evo[monster][2] .." stones para isso!")
- end
- end
- end
- return FALSE
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement