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

AOL fix 0.3

SirTitan

Member
Joined
May 4, 2008
Messages
262
Reaction score
9
Location
Germany/Dortmund
with the newest trunk version of the tfs the AOL dident worked.
Nor the preventLoss atribute in the items.xml.
I just copyed some parts from another tfs version.
here is the fix:

open const.h
and add after:
Code:
ITEM_LABEL		= 2599,

Code:
	ITEM_AMULETOFLOSS	= 2173,

in player.cpp find corpse drop function

Code:
if(corpse && lootDrop)
	{
and add after it
Code:
	if(inventory[SLOT_NECKLACE] && inventory[SLOT_NECKLACE]->getID() == ITEM_AMULETOFLOSS &&
getSkull() != SKULL_RED && g_game.getWorldType() != WORLD_TYPE_PVP_ENFORCED)
		{
	g_game.internalRemoveItem(inventory[SLOT_NECKLACE], 1);
		}
		else
{
add at end of this function another }
look here:
Code:
						sendRemoveInventoryItem((slots_t)i, inventory[(slots_t)i]);
					}
				}
			}
		}
	}
}

the credits goes to tfs development team i just used ther code.


add to movements.xml

Code:
	<movevent event="Equip" itemid="2173" slot="necklace" function="onEquipItem"/>
	<movevent event="DeEquip" itemid="2173" slot="necklace" function="onDeEquipItem"/>
Ty @Elf, cuz i forgot about movements :p
 
Last edited:
Its not enough to set preventLoss at items.xml.
You need a move event (movements.xml) -> onEquip and onDeEquip. Take a look at movements.xml at repository.
 
Back
Top