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

Nekiro

Support Team
Support Team
Joined
Sep 7, 2015
Messages
1,835
Best answers
80
Reaction score
590
Hello, I want to disable monsters getting experience...
I mean:


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

How to fix that or disable?
 
OP
Nekiro

Nekiro

Support Team
Support Team
Joined
Sep 7, 2015
Messages
1,835
Best answers
80
Reaction score
590
Oh i forgot. Tfs 0.4
 

tetra20

DD
Joined
Jan 17, 2009
Messages
1,304
Best answers
3
Reaction score
285
Location
Egypt
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;
}
 
OP
Nekiro

Nekiro

Support Team
Support Team
Joined
Sep 7, 2015
Messages
1,835
Best answers
80
Reaction score
590
Works. thank you.
 

Activity

Member
Joined
Apr 7, 2016
Messages
182
Best answers
0
Reaction score
21
Is it mean monsters will help the player and player will get all experience?
 

Stigma

Veteran OT User
Joined
Feb 14, 2015
Messages
4,698
Best answers
413
Reaction score
2,259
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.
 
Top