Hi all, this is a script i released some time ago in other forum, i hope you like it.
Description:
When you die your corpse will become a zombie (or other monster, u can configure that at table "monsters"), that monster will has ur outfit and hp. Something like this:
now go to your data/creaturescripts/creaturescripts.xml and add this:
goto creaturescripts/scripts/ and create a new script called zombie.lua
inside it put this:
now go to creaturescripts/scripts/login.lua and paste this at the end of the file:
That's all
Description:
When you die your corpse will become a zombie (or other monster, u can configure that at table "monsters"), that monster will has ur outfit and hp. Something like this:
now go to your data/creaturescripts/creaturescripts.xml and add this:
XML:
<event type="death" name="Zombie" event="script" value="zombie.lua"/>
<event type="look" name="ZombieLook" event="script" value="zombie.lua"/>
goto creaturescripts/scripts/ and create a new script called zombie.lua
inside it put this:
Lua:
local monsters = {"zombie", "ghoul", "ghost", "spectre"} --Here you can configure the monsters
local storage = 325
function onDeath(cid, corpse, deathList)
local outfit = getCreatureOutfit(cid)
local health = getCreatureMaxHealth(cid)
local pos = getThingPos(cid)
local name = getCreatureName(cid)
local sex = getPlayerSex(cid)
local voc = getPlayerVocationName(cid)
doRemoveItem(corpse.uid)
x = doCreateMonster(monsters[math.random(#monsters)], pos)
doPlayerSetStorageValue(x, storage, name.."'s "..getCreatureName(x)..". "..(sex == 0 and "She" or "He").." was a "..voc)
setCreatureMaxHealth(x, health)
doCreatureAddHealth(x, health - getCreatureHealth(x))
doSendMagicEffect(pos, CONST_ME_SMALLCLOUDS)
doCreatureChangeOutfit(x, outfit)
return false
end
function onLook(cid, thing, position, lookDistance)
if (isMonster(thing.uid) and getPlayerStorageValue(thing.uid, storage) ~= -1) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see "..getPlayerStorageValue(thing.uid, storage))
return false
end
return true
end
now go to creaturescripts/scripts/login.lua and paste this at the end of the file:
Lua:
registerCreatureEvent(cid, "Zombie")
registerCreatureEvent(cid, "ZombieLook")
That's all