Hello, I have problem with corpse owner duration because a person which killed monster is owner of this corpse forever :/
tfs 0.3.6pl96r
config.lua
function which create corpse and set owner
monster.cpp
tfs 0.3.6pl96r
config.lua
PHP:
fieldOwnershipDuration = 5 * 1000 --60
function which create corpse and set owner
monster.cpp
PHP:
Item* Monster::createCorpse(DeathList deathList)
{
Item* corpse = Creature::createCorpse(deathList);
if(!corpse)
return NULL;
if(mType->corpseUnique)
corpse->setUniqueId(mType->corpseUnique);
if(mType->corpseAction)
corpse->setActionId(mType->corpseAction);
DeathEntry ownerEntry = deathList[0];
if(ownerEntry.isNameKill())
return corpse;
Creature* owner = ownerEntry.getKillerCreature();
if(!owner)
return corpse;
uint32_t ownerId = 0;
if(owner->getPlayer())
ownerId = owner->getID();
else if(owner->getMaster() && owner->getPlayerMaster())
ownerId = owner->getMaster()->getID();
if(ownerId)
corpse->setCorpseOwner(ownerId);
return corpse;
}