• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

CreatureEvent Forever aol

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
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
Credit: igorbr for the teleport script
 
add to creaturescript/scripts/preparedeaths.lua[/I]
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
Credit: igorbr for the teleport script

Don't understand the "doRemoveConditions(cid)" at the end ;/.
 
Last edited:
It removes poison, fire, drunk etc. Things you shouldn't have after death. :)
 
It removes poison, fire, drunk etc. Things you shouldn't have after death. :)

Yeah i know, but..
Lua:
    for i = 1, 45 do
        if getCreatureCondition(cid, i) == true then
            doRemoveCondition(cid, i)
        end
    end
Perhaps it make the same..?
 
@Up,

All Conditions? :eek:
PHP:
for i = 1, 45 do
 
Lua:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
    if isPlayer(cid) == true then
        if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2196) then
		doCreatureSetDropLoot(cid, false)	
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA) 
        return true
        end
    end
    return true
end
a bit simplier?
 
@Chris, yea he posted it in another thread and I'm actually using it right now :)

Important reminder: If you use other onPrepareDeath events, make sure you execute them before this one.
 
Lua:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
    if isPlayer(cid) == true then
        if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2196) then
		doCreatureSetDropLoot(cid, false)	
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA) 
        return true
        end
    end
    return true
end
a bit simplier?

There you go. Read a bit please.
 
This thread must release forver aol 100% working why?
Becaouse all forever aols scripts doesnt work they dont count frags, ppl will love it becaouse isnt relased yet. Working 100%
 
Back
Top