Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onLogout(cid)
- if getPlayerStorageValue(cid, 888) >= 1 then
- doPlayerSendCancel(cid, "You cant logout during control mind.")
- return false
- end
- local summon = getCreatureSummons(cid)[1]
- local thisitem = getPlayerSlotItem(cid, 8)
- local btype = getPokeballType(thisitem.itemid)
- if #getCreatureSummons(cid) == 1 and thisitem.uid > 1 then
- doItemSetAttribute(thisitem.uid, "hp", getCreatureHealth(summon) / getCreatureMaxHealth(summon))
- doTransformItem(thisitem.uid, pokeballs[btype].on)
- doSendMagicEffect(getThingPos(summon), pokeballs[btype].effect)
- doRemoveCreature(summon)
- end
- if getCreatureOutfit(cid).lookType == 814 then
- doPlayerStopWatching(cid)
- end
- if getPlayerStorageValue(cid, 17000) >= 1 then
- markFlyingPos(cid, getThingPos(cid))
- end
- return TRUE
- end
- local deathtexts = {"Oh no! POKENAME, come back!", "Come back, POKENAME!", "That's enough, POKENAME!", "You did well, POKENAME!",
- "You need to rest, POKENAME!", "Nice job, POKENAME!", "POKENAME, you are too hurt!"}
- function onDeath(cid, deathList)
- local owner = getCreatureMaster(cid)
- local thisball = getPlayerSlotItem(owner, 8)
- local btype = getPokeballType(thisball.itemid)
- doSendMagicEffect(getThingPos(cid), pokeballs[btype].effect)
- doTransformItem(thisball.uid, pokeballs[btype].off)
- doPlayerSendTextMessage(owner, 22, "Your pokemon fainted.")
- local say = deathtexts[math.random(#deathtexts)]
- say = string.gsub(say, "POKENAME", getCreatureName(cid))
- if getPlayerStorageValue(cid, 33) <= 0 then
- doCreatureSay(owner, say, TALKTYPE_SAY)
- end
- doItemSetAttribute(thisball.uid, "hp", 0)
- doItemSetAttribute(thisball.uid, "happy", getPlayerStorageValue(cid, 1008) - happyLostOnDeath)
- doItemSetAttribute(thisball.uid, "hunger", getPlayerStorageValue(cid, 1009))
- doRemoveCreature(cid)
- return false
- end
Advertisement
Add Comment
Please, Sign In to add comment