mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-19 21:10:17 -07:00
Add npc configs entry for ignoring tolerance
This commit is contained in:
parent
9f05db7e6c
commit
d4082c60f7
3 changed files with 9 additions and 2 deletions
|
|
@ -25923,7 +25923,8 @@
|
||||||
"aggressive": "true",
|
"aggressive": "true",
|
||||||
"bonuses": "0,0,0,0,0,30,40,100,90,100,0,0,0,0,0",
|
"bonuses": "0,0,0,0,0,30,40,100,90,100,0,0,0,0,0",
|
||||||
"range_level": "1",
|
"range_level": "1",
|
||||||
"attack_level": "140"
|
"attack_level": "140",
|
||||||
|
"can_tolerate": "false"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"examine": "Digging.",
|
"examine": "Digging.",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package core.game.node.entity.npc.agg;
|
package core.game.node.entity.npc.agg;
|
||||||
|
|
||||||
|
import core.game.node.entity.npc.NPC;
|
||||||
import rs09.ServerConstants;
|
import rs09.ServerConstants;
|
||||||
import core.game.node.entity.Entity;
|
import core.game.node.entity.Entity;
|
||||||
import core.game.node.entity.combat.DeathTask;
|
import core.game.node.entity.combat.DeathTask;
|
||||||
|
|
@ -187,7 +188,11 @@ public final class AggressiveHandler {
|
||||||
* @return The allowTolerance.
|
* @return The allowTolerance.
|
||||||
*/
|
*/
|
||||||
public boolean isAllowTolerance() {
|
public boolean isAllowTolerance() {
|
||||||
return allowTolerance;
|
boolean configSetting = true;
|
||||||
|
if(entity instanceof NPC){
|
||||||
|
configSetting = ((NPC) entity).getDefinition().getConfiguration("can_tolerate", true);
|
||||||
|
}
|
||||||
|
return allowTolerance && configSetting;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -257,6 +257,7 @@ NPCConfigParser {
|
||||||
"poisonous",
|
"poisonous",
|
||||||
"poison_immune",
|
"poison_immune",
|
||||||
"facing_booth",
|
"facing_booth",
|
||||||
|
"can_tolerate",
|
||||||
"water_npc"-> configs.put(it.key.toString(), it.value.toString().toBoolean())
|
"water_npc"-> configs.put(it.key.toString(), it.value.toString().toBoolean())
|
||||||
else -> SystemLogger.logWarn("Unhandled key for npc config: ${it.key.toString()}")
|
else -> SystemLogger.logWarn("Unhandled key for npc config: ${it.key.toString()}")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue