Add npc configs entry for ignoring tolerance
This commit is contained in:
@@ -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()}")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user