Esempio n. 1
0
 private void Hooks_OnNPCKilled(Fougerite.Events.DeathEvent de)
 {
     if (de.Attacker != null && de.Victim != null && de.AttackerIsPlayer)
     {
         NPC npc = (NPC)de.Victim;
         if (npc.Name == "MutantBear" || npc.Name == "MutantWolf")
         {
             Fougerite.Player killer = (Fougerite.Player)de.Attacker;
             AddMoney(killer, 1);
             killer.Message("[color#99FF]成功击杀一个异兽,获得1斩仙币 /zxsc 查询斩仙商店");
         }
     }
 }
Esempio n. 2
0
 private void Hooks_OnPlayerKilled(Fougerite.Events.DeathEvent de)
 {
     if (de.Attacker != null && de.AttackerIsPlayer && de.VictimIsPlayer && de.Victim != null)
     {
         //Example to add 1 money to the killer
         Fougerite.Player killer = (Fougerite.Player)de.Attacker;
         if (killer.SteamID != "")
         {
             if (de.Attacker != de.Victim)
             {
                 AddMoney(killer, 1);
                 killer.Message("[color#99FF]成功击杀一个剑客,获得1斩仙币 /zxsc 查询斩仙商店");
             }
         }
     }
 }
Esempio n. 3
0
        private void PlayerKilled(DeathEvent deathEvent)
        {
            try
            {
                if (!(deathEvent.Attacker is Fougerite.Player))
                    return;

                Fougerite.Player player = (Fougerite.Player) deathEvent.Attacker;
                Fougerite.Player victim = (Fougerite.Player) deathEvent.Victim;

                string weapon = deathEvent.WeaponName;
                if ((deathEvent.DamageType == "Bullet"
                     &&
                     (weapon == "HandCannon" && weapon == "Pipe Shotgun" && weapon == "Revolver" &&
                      weapon == "9mm Pistol" &&
                      weapon == "P250" && weapon == "Shotgun" && weapon == "Bolt Action Rifle" && weapon == "M4" &&
                      weapon == "MP5A4"))
                    || (deathEvent.DamageType == "Melee" && (int) (Math.Round(deathEvent.DamageAmount)) == 75
                        && string.IsNullOrEmpty(weapon)))
                {
                    Vector3 attacker_location = player.Location;
                    Vector3 victim_location = ((Fougerite.Player) deathEvent.Victim).Location;
                    float distance =
                        (float) Math.Round(Util.GetUtil().GetVectorsDistance(attacker_location, victim_location));
                    if (distance > RangeOf(weapon) && RangeOf(weapon) > 0)
                    {
                        player.Kill();
                        BanCheater(player, "AutoAIM. Gun: " + weapon + " Dist: " + distance);
                        Server.GetServer()
                            .BroadcastFrom(EchoBotName,
                                player.Name + " shooted " + victim.Name + " from " + distance + "m.");
                        Log("AutoAIM: " + player.Name + ". Gun: " + weapon + " Dist: " + distance);
                        player.Disconnect();
                        victim.TeleportTo(attacker_location.x, attacker_location.y, attacker_location.z);
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
        }
Esempio n. 4
0
 void PlayerKilled(DeathEvent deathEvent)
 {
 }
Esempio n. 5
0
 public void OnNPCKilled(DeathEvent evt)
 {
     Invoke("On_NPCKilled", evt);
 }
Esempio n. 6
0
 public void OnPlayerKilled(DeathEvent evt)
 {
     Invoke("On_PlayerKilled", evt);
 }
Esempio n. 7
0
        private void Hooks_OnPlayerKilled(DeathEvent de)
        {
            Contract.Requires(de != null);

            try
            {
                Fougerite.Player victim = de.Victim as Fougerite.Player;
                if (victim.GameID == this.GameID)
                {
                    this.justDied = true;
                }
            }
            catch (Exception ex)
            {
                this.invError = true;
                Logger.LogException(ex);
            }
        }
Esempio n. 8
0
 void PlayerKilled(DeathEvent event2)
 {
     event2.DropItems = !RustPP.Hooks.KeepItem();
     if (!(event2.Attacker is NPC)) // Not NPC
     {
         Fougerite.Player attacker = event2.Attacker as Fougerite.Player;
         Fougerite.Player victim = event2.Victim as Fougerite.Player;
         if ((attacker.Name != victim.Name) && (Fougerite.Server.GetServer().FindPlayer(attacker.Name) != null))
             RustPP.Hooks.broadcastDeath(victim.Name, attacker.Name, event2.WeaponName);
     }
 }
Esempio n. 9
0
        public static bool PlayerKilled(ref DamageEvent de)
        {
            try
            {
                DeathEvent event2 = new DeathEvent(ref de);
                if (OnPlayerKilled != null)
                    OnPlayerKilled(event2);

                return event2.DropItems;
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
                return false;
            }
        }
Esempio n. 10
0
 public static void NPCKilled(ref DamageEvent e)
 {
     try
     {
         DeathEvent de = new DeathEvent(ref e);
         if (OnNPCKilled != null)
             OnNPCKilled(de);
     }
     catch (Exception ex)
     {
         Logger.LogException(ex);
     }
 }
Esempio n. 11
0
 void OnPlayerKilled(DeathEvent param0)
 {
     foreach (KeyValuePair<string, V8Plugin> plugin in plugins)
     {
         plugin.Value.Invoke("On_PlayerKilled", param0); // Deprecated
         plugin.Value.Invoke("OnPlayerKilled", param0);
     }
 }