Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local msgs = {
- back = {"Come back, poke!", "Thanks for helping, poke!", "That's enough, come back!", "You were great, poke!", "Excellent work, poke!", "Well done, poke!"}
- }
- function onDeath(cid)
- local owner = getCreatureMaster(cid)
- if isPlayer(owner) then
- doTransformItem(getPlayerSlotItem(owner, 8).uid, getItemInfo(getPlayerSlotItem(owner, 8).itemid).ballDischarged)
- doPlayerSendTextMessage(owner, 22, "Your pokemon fainted.")
- doCreatureSay(owner, msgs.back[math.random(1, #msgs.back)]:gsub("poke", getCreatureName(cid)), TALKTYPE_ORANGE_1)
- doItemSetAttribute(getPlayerSlotItem(owner, 8).uid, "pokeHealth", "0")
- end
- return true
- end
- function onStatsChange(cid, attacker, type, combat, value)
- if type == STATSCHANGE_HEALTHLOSS then
- if isCreature(attacker) then
- if isMonster(cid) then
- local multiplier = 0
- if getMonsterInfo(getCreatureName(cid)).pokeEffective:find(getCombatName(combat)) then
- multiplier = 2
- elseif getMonsterInfo(getCreatureName(cid)).pokeIneffective:find(getCombatName(combat)) then
- multiplier = 0.5
- elseif getMonsterInfo(getCreatureName(cid)).pokeNormal:find(getCombatName(combat)) then
- multiplier = 1
- end
- doTargetCombatHealth(attacker, cid, combat, - (value * multiplier), - (value * multiplier), 255)
- end
- end
- end
- return true
- end
- function onSpawn(cid)
- local gainHealth = (getMonsterInfo(getCreatureName(cid)).health * getMonsterInfo(getCreatureName(cid)).wildLevel)
- setCreatureMaxHealth(cid, (getCreatureMaxHealth(cid) + gainHealth))
- doCreatureAddHealth(cid, (getCreatureMaxHealth(cid) - getCreatureHealth(cid)))
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement