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

Solved Monsters get experience and kill other monsters. TFS 0,4

Nekiro

Legendary OT User
TFS Developer
Joined
Sep 7, 2015
Messages
2,677
Solutions
126
Reaction score
2,112
Hello, I want to disable monsters getting experience...
I mean:
f9c792ee30ac1fb9741a743b8c22c4e5.gif


They get experience instead of player so player is getting much less exp than he should.

How to fix that or disable?
 
Solution
creature.cpp
change
Code:
void Creature::addDamagePoints(Creature* attacker, int32_t damagePoints)
{
   uint32_t attackerId = 0;
   if(attacker)
     attackerId = attacker->getID();
   
   
   CountMap::iterator it = damageMap.find(attackerId);
   if(it != damageMap.end())
   {
     it->second.ticks = OTSYS_TIME();
     if(damagePoints > 0)
       it->second.total += damagePoints;
   }
   else
     damageMap[attackerId] = CountBlock_t(damagePoints);

   if(damagePoints > 0)
     lastHitCreature = attackerId;
}

To
Code:
void Creature::addDamagePoints(Creature* attacker, int32_t damagePoints)
{
   uint32_t attackerId = 0;
   if(attacker)
     attackerId = attacker->getID();
   
   if(attacker->getMonster())
     return;
   
   CountMap::iterator...
creature.cpp
change
Code:
void Creature::addDamagePoints(Creature* attacker, int32_t damagePoints)
{
   uint32_t attackerId = 0;
   if(attacker)
     attackerId = attacker->getID();
   
   
   CountMap::iterator it = damageMap.find(attackerId);
   if(it != damageMap.end())
   {
     it->second.ticks = OTSYS_TIME();
     if(damagePoints > 0)
       it->second.total += damagePoints;
   }
   else
     damageMap[attackerId] = CountBlock_t(damagePoints);

   if(damagePoints > 0)
     lastHitCreature = attackerId;
}

To
Code:
void Creature::addDamagePoints(Creature* attacker, int32_t damagePoints)
{
   uint32_t attackerId = 0;
   if(attacker)
     attackerId = attacker->getID();
   
   if(attacker->getMonster())
     return;
   
   CountMap::iterator it = damageMap.find(attackerId);
   if(it != damageMap.end())
   {
     it->second.ticks = OTSYS_TIME();
     if(damagePoints > 0)
       it->second.total += damagePoints;
   }
   else
     damageMap[attackerId] = CountBlock_t(damagePoints);

   if(damagePoints > 0)
     lastHitCreature = attackerId;
}
 
Solution
Is it mean monsters will help the player and player will get all experience?
This is a bugfix for monsters gaining xp if they hit eachother with something (such as an AoE). So yes in a way if the monster hits another the player will still get all of the experience.
 
Back
Top