mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-04 16:49:04 +00:00
committed by
Daniel Ginovker
parent
68013f3498
commit
aaf0a48140
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user