• 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 Get monster storage on sources

sabodden

Member
Joined
Sep 27, 2019
Messages
138
Reaction score
18
I want to finish this script:

That make players and monsters with storage 668 recive more damage

Searching on forum examples i manage to do on game.cpp


Code:
        int32_t damage = -healthChange;
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------
        // def debuff
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------
        if(target && target->getPlayer())
        {
            std::string value;
            target->getPlayer()->getStorage(668, value);
            int32_t buffPercent = (int32_t)(atoi(value.c_str()));
            if(buffPercent > 0) {
                damage = (int64_t)std::floor (damage + damage * buffPercent /100);
            }
        }
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------
        if(damage != 0)
        {

But it only get player storage...
How also get monsters storage to do the same thing?
 
Solution
So that is script is not working?

Because monsters are saying "Cursed!"
They saying cursed is not related because it's another function. But I was looking your sources and indeed it's a creature method, on TFS 1.x it's player only.

Try to replace getPlayer for getCreature on both lines it appears and see if it runs.
So that is script is not working?

Because monsters are saying "Cursed!"
They saying cursed is not related because it's another function. But I was looking your sources and indeed it's a creature method, on TFS 1.x it's player only.

Try to replace getPlayer for getCreature on both lines it appears and see if it runs.
 
Solution
They saying cursed is not related because it's another function. But I was looking your sources and indeed it's a creature method, on TFS 1.x it's player only.

Try to replace getPlayer for getCreature on both lines it appears and see if it runs.

runs ;)
ty!!
 
Back
Top