Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- login.lua: registerCreatureEvent(cid, "deathArena")
- -- creaturescripts.xml: <event type="preparedeath" name="deathArena" event="script" value="deathArena.lua"/>
- function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) -- By Byerne XTibia
- local fromPos, toPos, leaveBody = {x=x,y=y,z=z},{x=x,y=y,z=z}, true
- if isInRange(getThingPos(cid), fromPos, toPos) then
- if leaveBody then
- local body, heorshe = doCreateItemEx(getThingPos(cid), getPlayerSex(cid) == 0 and 3064 or 3058), getPlayerSex(cid) == 0 and "She" or "He"
- doSetItemSpecialDescription(body.uid, "You recognize "..getPlayerName(cid)..". "..heorshe.." was killed by "..getCreatureName(lastHitKiller)..".")
- end
- doPlayerAddItem(lastHitKiller, 11192, 10)
- if doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) then
- doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid), TRUE)
- doSendMagicEffect(getThingPos(cid), 10)
- end
- return false
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement