Exemplo n.º 1
0
 internal static void Death(C3Player killer, C3Player killed, string gametype, bool pvpkill)
 {
     DeathArgs e = new DeathArgs();
     e.Killer = killer;
     e.Killed = killed;
     e.GameType = gametype;
     e.PvPKill = pvpkill;
     if (OnPvPDeath != null)
         OnPvPDeath(e);
 }
Exemplo n.º 2
0
        internal static void Death(C3Player killer, C3Player killed, string gametype, bool pvpkill)
        {
            DeathArgs e = new DeathArgs();

            e.Killer   = killer;
            e.Killed   = killed;
            e.GameType = gametype;
            e.PvPKill  = pvpkill;
            if (OnPvPDeath != null)
            {
                OnPvPDeath(e);
            }
        }
Exemplo n.º 3
0
 private static void OnPvPdeath(C3Mod.DeathArgs e)
 {
     if (e.PvPKill)
     {
         if (e.Killer.TSPlayer.IsLoggedIn && e.Killed.TSPlayer.IsLoggedIn)
         {
             EPRPlayer EKiller   = ServerPointSystem.ServerPointSystem.GetEPRPlayerByIndex(e.Killer.TSPlayer.Index);
             EPRPlayer EKilled   = ServerPointSystem.ServerPointSystem.GetEPRPlayerByIndex(e.Killed.TSPlayer.Index);
             int       killerbal = EKiller.DisplayAccount;
             int       killedbal = EKilled.DisplayAccount;
             if (InPointRange(killerbal, killedbal))
             {
                 float gain = (killedbal * (100 - ServerPointSystem.ServerPointSystem.DeathToll) / 100) + PvPKillReward;
                 e.Killer.TSPlayer.SendMessage("You gained " + ((int)gain).ToString() + " " + ServerPointSystem.ServerPointSystem.currname + "(s)!", Color.Green);
                 EPREvents.PointOperate(EKiller, (int)gain, PointOperateReason.PVP);
             }
         }
     }
 }
Exemplo n.º 4
0
        private static void OnPvPdeath(C3Mod.DeathArgs e)
        {
            if (e.PvPKill)
            {
                if (e.Killer.TSPlayer.IsLoggedIn && e.Killed.TSPlayer.IsLoggedIn)
                {
                    EPRPlayer EKiller = ServerPointSystem.ServerPointSystem.GetEPRPlayerByIndex(e.Killer.TSPlayer.Index);
                    EPRPlayer EKilled = ServerPointSystem.ServerPointSystem.GetEPRPlayerByIndex(e.Killed.TSPlayer.Index);

                    int killerbal = EKiller.DisplayAccount;

                    int killedbal = EKilled.DisplayAccount;

                    float gain = (killedbal * ((100f - CEConfig.PVPDeathToll) / 100f));
                    float max  = (killerbal * ((100f - CEConfig.MaxPVPGain) / 100f));

                    int actual = (int)Math.Min(gain, max);

                    int killergets = actual + CEConfig.PvPKillReward;

                    e.Killer.TSPlayer.SendMessage(String.Format("You gained {0} {1}(s)!", (killergets),
                                                                ServerPointSystem.ServerPointSystem.currname), Color.Green);

                    EPREvents.PointOperate(EKiller, killergets, PointOperateReason.PVP);

                    if (!e.Killed.TSPlayer.Group.HasPermission("ignoredeathtax"))
                    {
                        e.Killed.TSPlayer.SendMessage(String.Format("You lost {0} {1}(s)!", actual,
                                                                    ServerPointSystem.ServerPointSystem.currname), Color.Green);
                        EPREvents.PointOperate(EKilled, -((int)actual), PointOperateReason.PVP);
                    }

                    string log = string.Format("{0} killed {1}. {0} received {2} {3}(s) and {1} lost {4} {3}(s)",
                                               e.Killer.PlayerName, e.Killed.PlayerName, killergets,
                                               ServerPointSystem.ServerPointSystem.currname,
                                               (e.Killed.TSPlayer.Group.HasPermission("ignoredeathtax") ? 0 : -actual));

                    Log.ConsoleInfo(log);
                }
            }
        }