Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local corpos = {
- [17378] = {11931, pokeshiny = "Shiny Cubone"},
- [17379] = {11940, pokeshiny = "Shiny Pidgey"},
- [17380] = {11953, pokeshiny = "Shiny Rattata"},
- }
- function onUse(cid, item, frompos, item2, topos)
- local corpse = getTopCorpse(topos).uid
- local b = corpos[item.itemid]
- if not b then return true end
- if(getDistanceBetween(getCreaturePosition(cid), topos) > 3) then
- doPlayerSendTextMessage(cid, 27, "Você está muito longe para fazer isso.")
- return true
- end
- local owner = getItemAttribute(item2.uid, "corpseowner")
- local playerParty, ownerParty = getPlayerParty(cid), getPlayerParty(owner)
- local partyConditions = false
- if playerParty and isPlayer(owner) and ownerParty then
- if playerParty == ownerParty then
- partyConditions = true
- end
- end
- if owner and isCreature(owner) and isPlayer(owner) and cid ~= owner and not partyConditions then
- doPlayerSendTextMessage(cid, 27, "Desculpe, você não pode usar o card em um pokemon derrotado por outra pessoa.")
- return true
- end
- if(b[1] ~= corpse) then
- doPlayerSendCancel(cid, "Pokemon não compativel com este card.")
- return true
- end
- doRemoveItem(corpse, 1)
- doRemoveItem(item.uid, 1)
- doSendMagicEffect(topos, 18)
- doCreateMonster(b.pokeshiny,topos)
- doPlayerSendTextMessage(cid, 27, "Incrivel! Você encontrou um ".. b.pokeshiny .."!")
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement