Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.81 KB | None | 0 0
  1. local monster = "el monster"
  2.  
  3. function onPrepareDeath(cid, deathList)
  4.     if isMonster(deathList[1]) and string.lower(getCreatureName(deathList[1])) == monster then
  5.         doCreatureSetDropLoot(cid, false)
  6.         doCreatureAddHealth(cid,getCreatureMaxHealth(cid))
  7.         doCreatureAddMana(cid,getCreatureMaxMana(cid))
  8.         doItemSetAttribute(doCreateItem(corpse[getPlayerSex(cid)], 1, getThingPos(cid)), "description", "You recognize " .. getCreatureName(cid) .. ". He was killed by " .. (isMonster(deathList[1]) and "a " .. string.lower(getCreatureName(deathList[1])) or isCreature(deathList[1]) and getCreatureName(deathList[1]) or "a field item") .. ".\nHis soul was protected.")
  9.        
  10.         doTeleportThing(cid,getTownTemplePosition(getPlayerTown(cid)))
  11.         return false
  12.     end
  13.     return true
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement