Poison corrections

::poison command (admin) will now automatically remove poison immunity timers for faster testing
Poison will no longer give an inauthentic warning when it is about to expire
Newly applied poison timers will only overwrite old poison timers if they are greater in severity
Fixed up some logic for monster examine checking poison immunity
Fixed numerous poison stats
This commit is contained in:
Syndromeramo
2025-09-23 13:35:52 +00:00
committed by Ryan
parent 676397f3fd
commit 6d8ef4247c
12 changed files with 219 additions and 233 deletions
@@ -21,6 +21,7 @@ import core.game.node.scenery.Scenery
import core.game.system.command.Privilege
import core.game.system.config.NPCConfigParser
import core.game.system.task.Pulse
import core.game.system.timer.impl.PoisonImmunity
import core.game.world.map.Location
import core.game.world.map.RegionManager
import core.game.world.repository.Repository
@@ -379,7 +380,7 @@ class LunarListeners : SpellListener("lunar"), Commands {
setInterfaceText(player, "Hitpoints : ${npc.definition.handlers[NPCConfigParser.LIFEPOINTS] ?: 0}", Components.DREAM_MONSTER_STAT_522, 2)
setInterfaceText(player, "Max hit : ${npc.getSwingHandler(false).calculateHit(npc, player, 1.0)}", Components.DREAM_MONSTER_STAT_522, 3)
val poisonStatus = if(npc.definition.handlers.getOrDefault(NPCConfigParser.POISON_IMMUNE,false) == true){
val poisonStatus = if(npc.isPoisonImmune){
"This creature is immune to poison."
} else "This creature is not immune to poison."
@@ -818,7 +819,10 @@ class LunarListeners : SpellListener("lunar"), Commands {
return@define
}
if(dmg != null) {
p.let { applyPoison(it, it, dmg) }
p.let {
removeTimer<PoisonImmunity>(it)
applyPoison(it, it, dmg)
}
} else {
sendMessage(player, "Damage must be an integer. Format:")
sendMessage(player, "::poison username damage")
@@ -73,7 +73,7 @@ public final class GWDTsutsarothSwingHandler extends CombatSwingHandler {
hit = RandomFunction.random(max);
state.setMaximumHit(max);
if (style == CombatStyle.MELEE) {
applyPoison(victim, entity, 16);
applyPoison(victim, entity, 80);
}
if (special) {
((Player) victim).getSkills().decrementPrayerPoints((double) hit / 2);
@@ -1,48 +0,0 @@
package content.region.karamja.handlers;
import core.game.node.entity.npc.AbstractNPC;
import core.game.world.map.Location;
import core.plugin.Initializable;
import core.game.system.config.NPCConfigParser;
/**
* Represents the tribesamn npc.
* @author 'Vexia
* @version 1.0
*/
@Initializable
public final class TribesmanNPC extends AbstractNPC {
/**
* Represents the npc ids.
*/
private static final int[] IDS = new int[] { 191, 2496, 2497 };
/**
* Constructs a new {@code TribesmanNPC} {@code Object}.
* @param id the id.
* @param location the location.
*/
public TribesmanNPC(int id, Location location) {
super(id, location, true);
getDefinition().getHandlers().put(NPCConfigParser.POISONOUS, true);
}
/**
* Constructs a new {@code TribesmanNPC} {@code Object}.
*/
public TribesmanNPC() {
super(0, null);
}
@Override
public AbstractNPC construct(int id, Location location, Object... objects) {
return new TribesmanNPC(id, location);
}
@Override
public int[] getIds() {
return IDS;
}
}
@@ -74,8 +74,10 @@ public class RevenantCombatHandler extends MultiSwingHandler {
}
}
}
if (!isPoisoned(victim) && (WildernessZone.getWilderness(entity) >= 50 || entity.getId() == 6998)) {
applyPoison(victim, entity, 6);
if (entity.getId() == 6998) {
applyPoison(victim, entity, 40);
} else if (WildernessZone.getWilderness(entity) >= 50) {
applyPoison(victim, entity, 30);
}
super.impact(entity, victim, state);
}