Darad
New Member
- Joined
- Jun 23, 2009
- Messages
- 119
- Reaction score
- 1
Forever aol script. Placed it under creatureEvent cause that seemed most logical.
To prevent loss from players with red skull the wearer is teleported to temple instead of dying. This way he doesn't loose experience. But this can be built in of course, if you wish to.
items.xml
add to login.lua in creaturescripts/scripts
add to creatureEvents.xml
add to creaturescript/scripts/preparedeaths.lua
Credit: igorbr for the teleport script
To prevent loss from players with red skull the wearer is teleported to temple instead of dying. This way he doesn't loose experience. But this can be built in of course, if you wish to.
items.xml
PHP:
<item id="2196" article="a" name="forever aol">
<attribute key="weight" value="420"/>
<attribute key="slotType" value="necklace"/>
</item>
add to login.lua in creaturescripts/scripts
Lua:
registerCreatureEvent(cid, "onPrepareDeath")
add to creatureEvents.xml
PHP:
<event type="preparedeath" name="onPrepareDeath" event="script" value="preparedeath.lua"/>
add to creaturescript/scripts/preparedeaths.lua
Lua:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if isPlayer(cid) == true then
if getPlayerSlotItem(cid, 2).itemid == 2196 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, getPlayerExperience(cid))
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true)
doCreatureAddHealth(cid, (getCreatureMaxHealth(cid) - getCreatureHealth(cid)), true)
doCreatureAddMana(cid, (getCreatureMaxMana(cid) - getCreatureMana(cid)))
doPlayerRemoveAllConditions(cid)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
return false
end
end
return true
end
function doPlayerRemoveAllConditions(cid)
for i = 1, 45 do
if getCreatureCondition(cid, i) == true then
doRemoveCondition(cid, i)
end
end
doRemoveConditions(cid)
end