Advertisement
Uissu

[X-TIBIA][CREATURESCRIPT] Arena Dead

Feb 4th, 2012
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.97 KB | None | 0 0
  1. -- login.lua: registerCreatureEvent(cid, "deathArena")
  2. -- creaturescripts.xml: <event type="preparedeath" name="deathArena" event="script" value="deathArena.lua"/>
  3.  
  4. function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) -- By Byerne XTibia
  5.     local fromPos, toPos, leaveBody = {x=x,y=y,z=z},{x=x,y=y,z=z}, true
  6.     if isInRange(getThingPos(cid), fromPos, toPos) then
  7.         if leaveBody then
  8.             local body, heorshe = doCreateItemEx(getThingPos(cid), getPlayerSex(cid) == 0 and 3064 or 3058), getPlayerSex(cid) == 0 and "She" or "He"
  9.             doSetItemSpecialDescription(body.uid, "You recognize "..getPlayerName(cid)..". "..heorshe.." was killed by "..getCreatureName(lastHitKiller)..".")
  10.         end
  11.         doPlayerAddItem(lastHitKiller, 11192, 10)
  12.         if doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) then
  13.             doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid), TRUE)
  14.             doSendMagicEffect(getThingPos(cid), 10)
  15.         end
  16.     return false
  17.     end
  18. return true
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement