• 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

swordman

Member
Joined
Jun 5, 2011
Messages
394
Reaction score
7
Hello,
I tryed to find a forever aol script.
The forever aol have to be like this:
When u die at Redskull or blackskull, u will still lose everything.
Only on Whiteskull and NO skull u wont lose anything.

I have tested out this script, It seems like its working, but when he die with that script,
he doesn't get a dead body under him. It's like, he's dieing in temple and respawning in temple.
creaturescript (aol.lua)
PHP:
Lua Code:
local AMULET = 2196
function onPrepareDeath(cid, deathList)
if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == AMULET then
if isInArray({SKULL_WHITE, SKULL_NONE}, getCreatureSkullType(cid)) then
doSetCreatureDropLoot(cid, false)
end
end

return true
end

Repp+ for the helper!
 
LUA:
local AMULET = 2196 
function onPrepareDeath(cid, deathList) 
if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == AMULET then 
if isInArray({SKULL_WHITE, SKULL_NONE}, getCreatureSkullType(cid)) then 
doSetCreatureDropLoot(cid, true) 
end 
end 

return true 
end

Haven't tested, but it's a guess.
Don't know how the function really works.

So, try that.

not working :P
 
What's wrong with the items.xml option?

LUA:
	<item id="2173" article="an" name="amulet of loss">
		<attribute key="weight" value="420"/>
		<attribute key="slotType" value="necklace"/>
		<attribute key="charges" value="1"/>
		<attribute key="preventDrop" value="1"/>
	</item>

to

LUA:
	<item id="2173" article="an" name="amulet of loss">
		<attribute key="weight" value="420"/>
		<attribute key="slotType" value="necklace"/>
		<attribute key="preventDrop" value="1"/>
	</item>

Then delete the script
 
What's wrong with the items.xml option?

LUA:
	<item id="2173" article="an" name="amulet of loss">
		<attribute key="weight" value="420"/>
		<attribute key="slotType" value="necklace"/>
		<attribute key="charges" value="1"/>
		<attribute key="preventDrop" value="1"/>
	</item>

to

LUA:
	<item id="2173" article="an" name="amulet of loss">
		<attribute key="weight" value="420"/>
		<attribute key="slotType" value="necklace"/>
		<attribute key="preventDrop" value="1"/>
	</item>

Then delete the script

I already got that
 
Works?
LUA:
local AMULET = 3013
function onPrepareDeath(cid, deathList)
	if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == AMULET then
		if getCreatureSkullType(cid, 1) or getCreatureSkullType (cid, 4) or getCreatureSkullType (cid, 5) or getCreatureSkullType (cid, 6) then
			doSetCreatureDropLoot(cid, false)
		end
	end
 
	return true
end
 
Works?
LUA:
local AMULET = 3013
function onPrepareDeath(cid, deathList)
	if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == AMULET then
		if getCreatureSkullType(cid, 1) or getCreatureSkullType (cid, 4) or getCreatureSkullType (cid, 5) or getCreatureSkullType (cid, 6) then
			doSetCreatureDropLoot(cid, false)
		end
	end
 
	return true
end


Not working:

PHP:
[22:25:05.965] [Error - CreatureScript Interface]
[22:25:05.965] data/creaturescripts/scripts/aol.lua:onPrepareDeath
[22:25:05.965] Description:
[22:25:05.965] (luaGetCreatureSkullType) Creature not found
 
lol man why u just set in sql samples loss_items = 0?

i think is it u need the characters will only loss items when they are red or black skull and dont need to use aol anymore
 
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Red Skull Amulet" version="1.0" author="--" contact="--" enabled="yes">
        <description><![CDATA[
                This Is Will Protect Your Items Even If You Have Red Skull.
        ]]></description>

        <item id="2196" article="a" name="Red Skull Amulet" 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)
                                end
                        end
                        return true
                end
        ]]></event>
</mod>
 
Not working:

PHP:
[22:25:05.965] [Error - CreatureScript Interface]
[22:25:05.965] data/creaturescripts/scripts/aol.lua:onPrepareDeath
[22:25:05.965] Description:
[22:25:05.965] (luaGetCreatureSkullType) Creature not found

Try this script instead, I tested it and it worked on my server
LUA:
local AMULET = 3013
function onPrepareDeath(cid, deathList)
	if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == AMULET then
		if isInArray({SKULL_WHITE, SKULL_YELLOW, SKULL_GREEN, SKULL_NONE}, getCreatureSkullType(cid)) then
			doSetCreatureDropLoot(cid, false)
		end
	end
 
	return true
end
 
Last edited:
try tihs..

add in items.xml
LUA:
<attribute key="preventDrop" value="1"/>
now.
creaturescripts.xml
add
LUA:
<event type="preparedeath" name="forever amulet" event="script" value="Infiniteaol.lua"/>
Infiniteaol.lua
LUA:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if (getCreatureSkullType(cid)  >= 4) then
	if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2196) then
		doCreatureSetDropLoot(cid, false)      
	end
	return true
	end
	return true
	end

login.lua
LUA:
registerCreatureEvent(cid, "forever amulet")
 
Back
Top