Hey, i wrote mine first script for gamemaster amulet. If you has it, your inventory and skills aren't down.
What is incorrect? Sorry for mine english ;<
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);
}
...
}