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

[C++] Gamemaster Amulet

pepek1995

New Member
Joined
Nov 8, 2008
Messages
4
Reaction score
0
Hey, i wrote mine first script for gamemaster amulet. If you has it, your inventory and skills aren't down.
Code:
bool Player::onDeath()
{
        ...

	Item* AmuletGM = getInventoryItem(SLOT_NECKLACE);

	if(AmuletGM->getID() == 1) // if player have a amulet with "model" 1
	{
		if(AmuletGM->getAttribute("charges") > 1)
			AmuletGM->setAttribute("charges", AmuletGM->getAttribute("charges")-1);
		else // charges == 1
			AmuletGM->onRemoved(); //delete it
		
		setDropLoot(LOOT_DROP_NONE);
		setLossSkill(false);
	}

        ...
}
What is incorrect? Sorry for mine english ;<
 
Back
Top