• 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

Joined
Jun 19, 2009
Messages
1,852
Reaction score
5
Hello!

I need a Forever AOL script for TFS 0.3.6

I searched, found MANY many scripts but none of them worked.. :S


repping,


thanks
 
player.cpp, remove this:
Code:
	if(preventDrop && preventDrop != preventLoss)
	{
		if(preventDrop->getCharges() > 1) //weird, but transform failed to remove for some hosters
			g_game.transformItem(preventDrop, preventDrop->getID(), std::max(0, ((int32_t)preventDrop->getCharges() - 1)));
		else
			g_game.internalRemoveItem(NULL, preventDrop);
	}
Can also be done with onDeath creaturescript.
 
In the creturescript make file calle forever aol.lua
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

then in the creature script.xml paste this line
Code:
<event type="preparedeath" name="onPrepareDeath" event="script" value="forever aol.lua"/>


then go to creaturescript-->scripts-->login.lua and paste this line in the end of the script over "return true"
LUA:
registerCreatureEvent(cid, "onPrepareDeath")
 
LUA:
function doSetItemSpecialDescription(uid, description)
     return doItemSetAttribute(uid, "specialdescription", description)
end 

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
local corpse_ids = {
        3065, -- famale
        3058  -- male
}
    if isPlayer(cid) == true then
        if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2196) then
                doCreatureSetDropLoot(cid, false)      
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
				local corpse = doCreateItem((corpse_ids[getPlayerSex(cid)+1]), 1, getPlayerPosition(cid))
				local msg = ""
				if getPlayerSex(cid) == 0 then msg = "She" else msg = "He" 
				doSetItemSpecialDescription(corpse, "You recognize "..getCreatureName(cid)..". "..msg.." was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
				end
        return true
        end
    end
    return true
end
 
Last edited:
Code:
local corpse_ids = {
	[0] = 3065, -- female
	[1] = 3058  -- male
}
function onPrepareDeath(cid, deathList)
	if getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2196 then
		doCreatureSetDropLoot(cid, false)
		doSendMagicEffect(getThingPos(cid), CONST_ME_HOLYAREA)
		local corpse, killers = doCreateItem(corpse_ids[getPlayerSex(cid)], 1, getThingPos(cid)), ""		
		for i = 1, math.min(getConfigInfo('deathAssistCount') + 1, #deathList) do
			killers = killers .. (i == 1 and "" or ", ") .. (isMonster(deathList[i]) and "a " or "") .. getCreatureName(deathList[i])
		end
		doItemSetAttribute(corpse, "specialdescription", "You recognize " .. getCreatureName(cid) .. ". " .. (getPlayerSex(cid) == 0 and "She" or "He") .. " was killed by " .. killers .. ".")
	end
	return true
end
 
no errors

Have I done it right now?

creaturescripts/creaturescripts.xml

Code:
	<event type="preparedeath" name="onPrepareDeath" event="script" value="forever aol.lua"/>

creaturescripts/scripts/forever aol.lua

Code:
function doSetItemSpecialDescription(uid, description)
     return doItemSetAttribute(uid, "specialdescription", description)
end

function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
local corpse_ids = {
        3065, -- famale
        3058  -- male
}
    if isPlayer(cid) == true then
        if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2196) then
                doCreatureSetDropLoot(cid, false)      
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
                                local corpse = doCreateItem((corpse_ids[getPlayerSex(cid)+1]), 1, getPlayerPosition(cid))
                                local msg = ""
                                if getPlayerSex(cid) == 0 then msg = "She" else msg = "He"
                                doSetItemSpecialDescription(corpse, "You recognize "..getCreatureName(cid)..". "..msg.." was killed by "..(isMonster(attacker) and "a "..string.lower(getCreatureName(attacker)) or isCreature(attacker) and getCreatureName(attacker) or "a field item")..".")
                                end
        return true
        end
    end
    return true
end

login.lua

Code:
	registerCreatureEvent(cid, "onPrepareDeath")
 
that script is a bit bugdS because StreamSide made a little mistake
why don't you try mine, or is mine the one that's bugged?
 
I haven't tried yours :O but, mind explaining what happens if I remove that code from player.cpp?

Can't see any id like 2196, broken amulet's ID.. I mean, if I remove that code, would it work automatically?

thanks

edit: lol, didn't read the code carefully, but if i understood it right: in items.xml, if i put charges > 1, will it be forever? XD
 
I haven't tried yours :O but, mind explaining what happens if I remove that code from player.cpp?

Can't see any id like 2196, broken amulet's ID.. I mean, if I remove that code, would it work automatically?
Yes, it would.
edit: lol, didn't read the code carefully, but if i understood it right: in items.xml, if i put charges > 1, will it be forever? XD
It won't be forever, it'll just decrease charges. It's still better to remove the code.
 
Back
Top