• 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 Decrease the dmg players vs players

mRefaat

Marketing and Coding
Joined
Jan 18, 2014
Messages
854
Solutions
3
Reaction score
141
Location
Egypt
Hello

I am trying to find how to decrease the damage dealt from players to players.

versions
Tfs 1.3
Tfs 0.3.7
 
 
tell me how u want it work?
Players dmg vs monsters = 100% and players dmg vs players = 50% ( normal thing )
I wanna to change players vs players to be 25% instead of 50%
i tried to make onStatsChange script but i got overstack flow problem.
So where i get this?
 
Players dmg vs monsters = 100% and players dmg vs players = 50% ( normal thing )
I wanna to change players vs players to be 25% instead of 50%
i tried to make onStatsChange script but i got overstack flow problem.
So where i get this?
in game.cpp that will decrease all coming damage to target player
Lua:
if (target && target->getPlayer())
           {
              damage = static_cast<int32_t>(damage /2); // you can use /2 or *0.50
           }

if you want it work if target player have x storage
Code:
if(target && target->getPlayer())
        {
            std::string value;
            target->getPlayer()->getStorage(xxxx, value);
      int32_t tmp = (int32_t)(atoi(value.c_str()));
               if(tmp > 0 )
              damage = static_cast<int32_t>(damage/2);
        }

if you want it work for combat

Code:
if(target && target->getPlayer())
        {
               if( params.combatType == COMBAT_PHYSICALDAMAGE)
              damage = static_cast<int32_t>(damage /2);
        }
 
in game.cpp that will decrease all coming damage to target player
Lua:
if (target && target->getPlayer())
           {
              damage = static_cast<int32_t>(damage /2); // you can use /2 or *0.50
           }

if you want it work if target player have x storage
Code:
if(target && target->getPlayer())
        {
            std::string value;
            target->getPlayer()->getStorage(xxxx, value);
      int32_t tmp = (int32_t)(atoi(value.c_str()));
               if(tmp > 0 )
              damage = static_cast<int32_t>(damage/2);
        }

if you want it work for combat

Code:
if(target && target->getPlayer())
        {
               if( params.combatType == COMBAT_PHYSICALDAMAGE)
              damage = static_cast<int32_t>(damage /2);
        }
Thanks, i will test it and give you feedback.
 
in game.cpp that will decrease all coming damage to target player
Lua:
if (target && target->getPlayer())
           {
              damage = static_cast<int32_t>(damage /2); // you can use /2 or *0.50
           }

if you want it work if target player have x storage
Code:
if(target && target->getPlayer())
        {
            std::string value;
            target->getPlayer()->getStorage(xxxx, value);
      int32_t tmp = (int32_t)(atoi(value.c_str()));
               if(tmp > 0 )
              damage = static_cast<int32_t>(damage/2);
        }

if you want it work for combat

Code:
if(target && target->getPlayer())
        {
               if( params.combatType == COMBAT_PHYSICALDAMAGE)
              damage = static_cast<int32_t>(damage /2);
        }
nothing of this inside game.cpp
 
Back
Top