Advertisement
PsyOps

KillSectionCode

Nov 2nd, 2015
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.62 KB | None | 0 0
  1.         public void KillDetected(PlayerDeathEvent p, ZonePlayer attacker, ZonePlayer victim, Queue<EventArgs> reply)
  2.         {
  3.             // -------------------------------Victim goes first - gets updated reguardless if its team kill or not
  4.             victim.PubStats.TotalDeaths++;
  5.  
  6.             // Own bounty ave when you die
  7.             victim.PubStats.DeathAve = victim.PubStats.TotalDeaths == 1 ?
  8.                 victim.PubStats.DeathAve = p.Bounty :
  9.                     (victim.PubStats.DeathAve * victim.PubStats.TotalDeaths + p.Bounty) / victim.PubStats.TotalDeaths;
  10.  
  11.             //#points
  12.             victim.PubStats.PublicPoints =
  13.                 (victim.PubStats.PublicPoints + m_PointsAwarded[2]) >= 0 ?
  14.                     victim.PubStats.PublicPoints + m_PointsAwarded[2] : 0;
  15.  
  16.             // Adding this to maybe delay instawarp and
  17.             //allow time to update player info
  18.             victim.BeginWarp();
  19.  
  20.             // Your own bounty when you kill someone -- Should there be a penalty for Teamkill here??
  21.             attacker.PubStats.AveBtyOnKill = attacker.PubStats.Kills == 1 ?
  22.                 attacker.PubStats.AveBtyOnKill = attacker.PubStats.Bounty :
  23.                     (attacker.PubStats.AveBtyOnKill * attacker.PubStats.Kills + attacker.PubStats.Bounty) / attacker.PubStats.Kills;
  24.  
  25.             // Check to see if its a team kill
  26.             if (attacker.Frequency == victim.Frequency)
  27.             {
  28.                 // Add to teamkill count
  29.                 attacker.PubStats.TeamKills++;
  30.  
  31.                 // Bounty ave for person you kill - add 0bty to ave
  32.                 attacker.PubStats.KillAve = attacker.PubStats.Kills == 1 ?
  33.                     attacker.PubStats.KillAve = 0 :
  34.                         (attacker.PubStats.KillAve * attacker.PubStats.Kills) / attacker.PubStats.Kills;
  35.                 //#points
  36.                 attacker.PubStats.PublicPoints =
  37.                     (attacker.PubStats.PublicPoints + m_PointsAwarded[3]) >= 0 ?
  38.                         attacker.PubStats.PublicPoints + m_PointsAwarded[3] : 0;
  39.                 return;
  40.             }
  41.  
  42.             // If not we update like usual
  43.             attacker.PubStats.Kills++;
  44.             attacker.PubStats.PublicPoints += m_PointsAwarded[1];
  45.  
  46.             // Bounty ave for person you kill
  47.             attacker.PubStats.KillAve = attacker.PubStats.Kills == 1 ?
  48.                 attacker.PubStats.KillAve = p.Bounty :
  49.                     (attacker.PubStats.KillAve * attacker.PubStats.Kills + p.Bounty) / attacker.PubStats.Kills;
  50.  
  51.             //#points
  52.             attacker.PubStats.PublicPoints += m_PointsAwarded[1];
  53.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement