• Sign up for May Mapping Competition! The prize includes Otland Premium time.
  • 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

Excellent OT User
TFS Developer
Support Team
Joined
Sep 7, 2015
Messages
2,091
Best answers
93
Reaction score
914
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

Excellent OT User
TFS Developer
Support Team
Joined
Sep 7, 2015
Messages
2,091
Best answers
93
Reaction score
914
Oh i forgot. Tfs 0.4
 

tetra20

DD
Joined
Jan 17, 2009
Messages
1,305
Best answers
4
Reaction score
289
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

Excellent OT User
TFS Developer
Support Team
Joined
Sep 7, 2015
Messages
2,091
Best answers
93
Reaction score
914
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?
 

Infernum

Asshole
Support Team
Joined
Feb 14, 2015
Messages
5,442
Best answers
537
Reaction score
3,276
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