• 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!

Forever aol (mod maybe?)

Darad

New Member
Joined
Jun 23, 2009
Messages
119
Reaction score
1
Hey guys,

I need a forever aol for latest version of TFS, been trying a lot of things with ondeath events but all it resulted in was either have loot drop or a player running around with 0 hp.

Any idea's?

ID of the amulet is 2196

creatureEvent script
PHP:
function onDeath(cid)
	doSendAnimatedText(getCreaturePosition(cid), "DEADED!", TEXTCOLOR_YELLOW)

	if getPlayerSlotItem(cid, 2) == 2196 then
		for i = PLAYERLOSS_CONTAINERS, PLAYERLOSS_ITEMS do
			doPlayerSetLossPercent(cid, i, 0)
		end
	end
	return TRUE

end

(putting this code in preparedeath resulted into an invincible character)
 
Didn't work for me =( should I add it in movevents too?

By the way, I have another problem... this appears in my gui:
Code:
[18/08/2009 00:07:57] mysql_real_query(): SELECT `vip_id` FROM `player_viplist` WHERE `player_id` = 1522 - MYSQL ERROR: Table '.\otserv\player_viplist' is marked as crashed and should be repaired (145)
 
Seems like a player got deleted but didn't get removed very well.

Anyway, better start a new topic for it and keep this one on it's own.
 
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Saints Amulet" version="1.0" author="Syntax" contact="[email protected]" enabled="yes">
	<description>
		This mod adds an infinite Aol to your server.
	</description>
	<item id="2196" article="a" name="Saints amulet" override="yes">
                <attribute key="weight" value="420"/>
	        <attribute key="slotType" value="necklace"/>
	        <attribute key="preventDrop" value="1"/>
	</item>
</mod>

the aol is not forever, disapears after death

edit: making forever aol with preventdrop in items.xml requires source edit, since its bad coded.. it ignores if the item has charges or not.
 
Last edited:
@up

creaturescripts.xml:

PHP:
<event type="preparedeath" name="forever_aol" event="script" value="forever_aol.lua"/>

forever_aol.lua:

PHP:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
    if isPlayer(cid) == true then
        if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE) == 2196 then
			doCreatureSetDropLoot(cid, false)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
            return true
        end
    end
    return true
end

how it works? players lose exp, lose skills, don't lose any eq(even with red\black skull), don't lose amulet.

and add this line to login.lua
PHP:
registerCreatureEvent(cid, "forever_aol")

Thank you!, Works very Well!
 
Back
Top