diff --git a/2006Redone Server/src/redone/game/content/combat/npcs/NpcAggressive.java b/2006Redone Server/src/redone/game/content/combat/npcs/NpcAggressive.java index b9b8830c..4c8c5542 100644 --- a/2006Redone Server/src/redone/game/content/combat/npcs/NpcAggressive.java +++ b/2006Redone Server/src/redone/game/content/combat/npcs/NpcAggressive.java @@ -16,19 +16,10 @@ public class NpcAggressive { 110, 1611, 83, 941, 49, 117, 111, 125, 1154, 107, 1342, 1338, 447, 448, 449, 917 }; for (int element : data) { - if (NpcHandler.npcs[i].npcType == element) { + if ((NpcHandler.npcs[i].npcType == element || PestControl.npcIsPCMonster(NpcHandler.npcs[i].npcType) || FightCaves.isFightCaveNpc(i)) && NpcHandler.npcs[i].MaxHP > 0) { return true; } } - if (PestControl.npcIsPCMonster(NpcHandler.npcs[i].npcType)) { - return true; - } - if (NpcHandler.npcs[i].inWild() && NpcHandler.npcs[i].MaxHP > 0) { - return true; - } - if (FightCaves.isFightCaveNpc(i)) { - return true; - } return false; } diff --git a/2006Redone Server/src/redone/game/npcs/NpcHandler.java b/2006Redone Server/src/redone/game/npcs/NpcHandler.java index 4d0213a9..6200fe08 100644 --- a/2006Redone Server/src/redone/game/npcs/NpcHandler.java +++ b/2006Redone Server/src/redone/game/npcs/NpcHandler.java @@ -413,21 +413,14 @@ public class NpcHandler { continue; } - /** - * Attacking player - **/ - Client client = (Client) PlayerHandler.players[NpcData.getCloseRandomPlayer(i)]; if (client != null) { - boolean aggressive = NpcAggressive.isAggressive(i) || getNpcListCombat(npcs[i].npcType) * 2 > client.combatLevel; - if (aggressive && !npcs[i].underAttack && !npcs[i].isDead && !switchesAttackers(i)) { - npcs[i].killerId = NpcData.getCloseRandomPlayer(i); - } else if (aggressive && !npcs[i].underAttack && !npcs[i].isDead && switchesAttackers(i)) { + boolean aggressive = (NpcAggressive.isAggressive(i) && getNpcListCombat(npcs[i].npcType) * 2 > client.combatLevel) || npcs[i].inWild(); + if (aggressive && !npcs[i].underAttack && !npcs[i].isDead) { npcs[i].killerId = NpcData.getCloseRandomPlayer(i); } } - if (System.currentTimeMillis() - npcs[i].lastDamageTaken > 5000) { npcs[i].underAttackBy = 0; }