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

TFS 0.X Add onPrepareDeath in player class

jestem pro

That is the question
Joined
Apr 20, 2013
Messages
650
Solutions
14
Reaction score
87
Hello homies,
I need your advices and pointments.
I use 0.3.6 8.6 source, but can be for any.

GOAL: Add a prepareDeath method to source like onDeath/death is.

Why?: I have a script in creaturescripts, but it acts very weird. Not like it will suppouse to be.

Question: Is it possible to declare prepareDeath in the player class(player.cpp) and can work while a player is under dying?

I do not know how to join it into sources. I think about something like this:

for example dunno :D
C++:
bool Player::onPrepareDeath()
{
    player->internalAddItem(this, 2160)
    for (CreatureEvent* deathEvent : getCreatureEvents(CREATURE_EVENT_PREPAREDEATH)) {
            deathEvent->executeOnPrepareDeath(this, nullptr);
        }
    return true
}
 
Back
Top