Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void KillDetected(PlayerDeathEvent p, ZonePlayer attacker, ZonePlayer victim, Queue<EventArgs> reply)
- {
- // -------------------------------Victim goes first - gets updated reguardless if its team kill or not
- victim.PubStats.TotalDeaths++;
- // Own bounty ave when you die
- victim.PubStats.DeathAve = victim.PubStats.TotalDeaths == 1 ?
- victim.PubStats.DeathAve = p.Bounty :
- (victim.PubStats.DeathAve * victim.PubStats.TotalDeaths + p.Bounty) / victim.PubStats.TotalDeaths;
- //#points
- victim.PubStats.PublicPoints =
- (victim.PubStats.PublicPoints + m_PointsAwarded[2]) >= 0 ?
- victim.PubStats.PublicPoints + m_PointsAwarded[2] : 0;
- // Adding this to maybe delay instawarp and
- //allow time to update player info
- victim.BeginWarp();
- // Your own bounty when you kill someone -- Should there be a penalty for Teamkill here??
- attacker.PubStats.AveBtyOnKill = attacker.PubStats.Kills == 1 ?
- attacker.PubStats.AveBtyOnKill = attacker.PubStats.Bounty :
- (attacker.PubStats.AveBtyOnKill * attacker.PubStats.Kills + attacker.PubStats.Bounty) / attacker.PubStats.Kills;
- // Check to see if its a team kill
- if (attacker.Frequency == victim.Frequency)
- {
- // Add to teamkill count
- attacker.PubStats.TeamKills++;
- // Bounty ave for person you kill - add 0bty to ave
- attacker.PubStats.KillAve = attacker.PubStats.Kills == 1 ?
- attacker.PubStats.KillAve = 0 :
- (attacker.PubStats.KillAve * attacker.PubStats.Kills) / attacker.PubStats.Kills;
- //#points
- attacker.PubStats.PublicPoints =
- (attacker.PubStats.PublicPoints + m_PointsAwarded[3]) >= 0 ?
- attacker.PubStats.PublicPoints + m_PointsAwarded[3] : 0;
- return;
- }
- // If not we update like usual
- attacker.PubStats.Kills++;
- attacker.PubStats.PublicPoints += m_PointsAwarded[1];
- // Bounty ave for person you kill
- attacker.PubStats.KillAve = attacker.PubStats.Kills == 1 ?
- attacker.PubStats.KillAve = p.Bounty :
- (attacker.PubStats.KillAve * attacker.PubStats.Kills + p.Bounty) / attacker.PubStats.Kills;
- //#points
- attacker.PubStats.PublicPoints += m_PointsAwarded[1];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement