• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Forever Aol Doesnt work

GOD Wille

Excellent OT User
Joined
Jan 11, 2010
Messages
2,826
Solutions
2
Reaction score
815
Location
Sweden
Hello otland , this is my forever aol script but it doesnt work.

When a player dies the aol removes.

LUA:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
        if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2138) then 
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
                doCreatureSay(cid, "Forever Amulet!", TALKTYPE_ORANGE_1)
        end
        return true
        end

XML:
<event type="preparedeath" name="Forever Aol" event="script" value="Forever Aol.lua"/>

login.lua

XML:
registerCreatureEvent(cid, "Forever Amulet")

Im using tfs 0.4 r3777
 
XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Enchanted Amulet of Loss" version="1.0" author="--" contact="--" enabled="yes">
        <description><![CDATA[
                This will protect your belongings even when you have a black skull!
        ]]></description>

        <item id="2196" article="a" name="Enchanted Amulet of Loss" override="yes"/>

        <event type="login" name="RedSkullAmulet_Login" event="buffer"><![CDATA[
                registerCreatureEvent(cid, "RedSkullAmulet_Login")
        ]]></event>

        <event type="death" name="RedSkullAmulet_Login" event="script"><![CDATA[
                function onDeath(cid, corpse, deathList)
                        if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2196) then
                                if (getCreatureSkullType(cid) == SKULL_RED) then
                                        doCreatureSetDropLoot(cid, false)
                                elseif (getCreatureSkullType(cid) == SKULL_BLACK) then
                                        doCreatureSetDropLoot(cid, false)
                                end
                        end
                        return true
                end
        ]]></event>
</mod>

That's my script, tested and works properly in 0.3.6pl1 so it should work on 0.4.
 
LOL
LUA:
if isInarray({SKULL_RED, SKULL_BLACK}, getCreatureSkullType(cid)) then
    doCreatureSetDropLoot(cid, false)
end
not better?
 
or will work in that case:
LUA:
if (getCreatureSkullType(cid) == SKULL_RED) or (getCreatureSkullType(cid) == SKULL_BLACK) then
    doCreatureSetDropLoot(cid, false)
end
but that up is more cute :D
 
Still not working, i loose aol

i have
<attribute key="charges" value="1" />
<attribute key="preventDrop" value="1" />
 
try this
LUA:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
local amulet = getPlayerSlotItem(cid, CONST_SLOT_NECKLACE)
	if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2138) then 
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
		doCreatureSay(cid, "Forever Amulet!", TALKTYPE_ORANGE_1)
		if amulet.type <= 2 then
		doChangeTypeItem(amulet.uid, amulet.type+1)   
		end
	end
return true
end
 
no this don't work since max is 99 in xml
Setting the charges to 0 didn't work for me either, just set it ridiculously high. I used "9999999999999" lol. Now it doesn't break and no one is going to die 9 trillion times.

For you lazy people:

<item id="2196" article="a" name="amulet of never-ending loss">
<attribute key="weight" value="420" />
<attribute key="slotType" value="necklace" />
<attribute key="preventDrop" value="1"/>
<attribute key="charges" value="9999999999999"/>
</item>

Rep if this helped please.
 
Back
Top