Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[TUTORIAL] Kill and not gain reputation

Junior Spellweaver
Joined
Jan 19, 2014
Messages
137
Reaction score
126
Google Translate.

It may seem like something stupid. But some people suffer from this protection when someone shoots you and you retaliate and gain no reputation. Do not HATE it if it does not help you, but I'm sure it will help someone.

Search for:
Code:
if(diffRep < 0 && (r3dGetTime() < targetPlr->m_AggressionTimeUntil))if(diffRep < 0 && (r3dGetTime() < targetPlr->m_AggressionTimeUntil))

Leave like this:
Code:
/*if(diffRep < 0 && (r3dGetTime() < targetPlr->m_AggressionTimeUntil))
            {
                  // do not do anything to fromPlr reputation. Target player had aggression timer on him, so our player is OK killing him without penalty
            }
            else*/
            //{
                  fromPlr->loadout_->Stats.Reputation = newRep;
                  if(diffRep != 0)
                  {
                        PKT_S2C_AddScore_s n;
                        n.ID = 0;
                        n.XP = 0;
                        n.GD = 0;
                        n.Rep = diffRep;
                        p2pSendToPeer(fromPlr->peerId_, fromPlr, &n, sizeof(n));
                  }
            //}

Now, search:

Code:
// agro effect. if player agroed neutral or good player, he will get flagged and that will allow

Change all for:
Code:
  // agro effect. if player agroed neutral or good player, he will get flagged and that will allow anyone to kill him without penalty to their reputation
  /*if(IsServerPlayer(fromObj) && damage > 0 && r3dGetTime() > m_AggressionTimeUntil) // and player doesn't have agro timer on him already
  {
        int AgroRepEffect = 0;
        {
              int newRep = gServerLogic.getReputationKillEffect(IsServerPlayer(fromObj)->loadout_->Stats.Reputation, loadout_->Stats.Reputation);
              if((newRep - IsServerPlayer(fromObj)->loadout_->Stats.Reputation)<0) // negative effect
              {
                    IsServerPlayer(fromObj)->m_AggressionTimeUntil = r3dGetTime() + 15*60.0f; // 15 min timer
              }
        }
  }*/
  //r3dOutToLog("%s damaged by %s by %.1f points, %.1f left\n", userName, fromObj->Name.c_str(), damage, m_Health);

Comment all code:
Code:
if(IsServerPlayer(fromObj) && damage > 0 && r3dGetTime() > m_AggressionTimeUntil) // and player doesn't have agro timer on him already
  {
        int AgroRepEffect = 0;
        {
              int newRep = gServerLogic.getReputationKillEffect(IsServerPlayer(fromObj)->loadout_->Stats.Reputation, loadout_->Stats.Reputation);
              if((newRep - IsServerPlayer(fromObj)->loadout_->Stats.Reputation)<0) // negative effect
              {
                    IsServerPlayer(fromObj)->m_AggressionTimeUntil = r3dGetTime() + 15*60.0f; // 15 min timer
              }
        }
  }

Like This
Code:
/*if(IsServerPlayer(fromObj) && damage > 0 && r3dGetTime() > m_AggressionTimeUntil) // and player doesn't have agro timer on him already
  {
        int AgroRepEffect = 0;
        {
              int newRep = gServerLogic.getReputationKillEffect(IsServerPlayer(fromObj)->loadout_->Stats.Reputation, loadout_->Stats.Reputation);
              if((newRep - IsServerPlayer(fromObj)->loadout_->Stats.Reputation)<0) // negative effect
              {
                    IsServerPlayer(fromObj)->m_AggressionTimeUntil = r3dGetTime() + 15*60.0f; // 15 min timer
              }
        }
  }
*/

Comment on all searches:

Code:
m_AggressionTimeUntil = 0;

Comment:
Code:
float       m_AggressionTimeUntil; // time until player has aggresion timer on him (means anyone can kill him without reputation penalty)

Search for
Code:
if(diffRep < 0 && (r3dGetTime() < targetPlr->m_AggressionTimeUntil))

Like this:

Code:
/*if(diffRep < 0 && (r3dGetTime() < targetPlr->m_AggressionTimeUntil))
            {
                  // do not do anything to fromPlr reputation. Target player had aggression timer on him, so our player is OK killing him without penalty
            }
            else
            {*/
                  fromPlr->loadout_->Stats.Reputation = newRep;
                  if(diffRep != 0)
                  {
                        PKT_S2C_AddScore_s n;
                        n.ID = 0;
                        n.XP = 0;
                        n.GD = 0;
                        n.Rep = diffRep;
                        p2pSendToPeer(fromPlr->peerId_, fromPlr, &n, sizeof(n));
                  }
            //}
 
Newbie Spellweaver
Joined
Jul 25, 2017
Messages
35
Reaction score
1
hey man, do you have new code to fast change backpack complete ?
 
Newbie Spellweaver
Joined
Jan 4, 2016
Messages
65
Reaction score
29
There is several diffrent source releases on here that have the code in it.
 
Newbie Spellweaver
Joined
Jul 25, 2017
Messages
35
Reaction score
1
That code I posted from the backpack works for me in every src I tested, EDUCATION v1, V2 untouched and warzthv2
that tutorial is not complete, but i fixed... thanks...
 
Back
Top