Merge branch 'waterbirth-fixes' into 'master'

Waterbirth Dungeon is cannonable, Spinolyps only drain prayer if they hit, and...

See merge request 2009scape/2009scape!388
This commit is contained in:
Ryan 2022-01-18 08:38:11 +00:00
commit 79f864048a
4 changed files with 11 additions and 3 deletions

View file

@ -111,3 +111,5 @@
- Removed regular bones from wolf drop table - Lethimyr
- Fix Gertrude's Cat quest not completing - ryannathans
- Fix missing special attack damage modifiers for range and melee attacks - vk
- Waterbirth Dungeon is now cannonable - aweinstock
- Spinolyps only drain prayer if they hit, and always target ranged defence (plus null reference fix) - aweinstock

View file

@ -122,6 +122,12 @@ public final class SpinolypNPC extends AbstractNPC {
return 12;
}
@Override
public int calculateDefence(Entity v, Entity e) {
// Spinolyps' attack always targets ranged defence
return CombatStyle.RANGE.getSwingHandler().calculateDefence(v, e);
}
@Override
public void visualize(Entity entity, Entity victim, BattleState state) {
super.visualize(entity, victim, state);
@ -137,7 +143,7 @@ public final class SpinolypNPC extends AbstractNPC {
@Override
public void impact(Entity entity, Entity victim, BattleState state) {
super.impact(entity, victim, state);
if (super.getType() == CombatStyle.MAGIC) {
if (super.getType() == CombatStyle.MAGIC && state.getEstimatedHit() > 0) {
victim.getSkills().decrementPrayerPoints(1);
} else {
if (RandomFunction.random(20) == 5) {

View file

@ -48,7 +48,7 @@ public final class WaterBirthDungeonZone extends MapZone implements Plugin<Objec
* Constructs a new {@code WaterBirthDungeonZone} {@code Object}.
*/
public WaterBirthDungeonZone() {
super("Water birth dungeon", true, ZoneRestriction.CANNON, ZoneRestriction.RANDOM_EVENTS);
super("Water birth dungeon", true, ZoneRestriction.RANDOM_EVENTS);
PluginManager.definePlugin(new DagannothKingNPC());
PluginManager.definePlugin(new DoorSupportNPC());
PluginManager.definePlugin(new DungeonOptionHandler());

View file

@ -154,7 +154,7 @@ open class RangeSwingHandler
Projectile.ranged(entity, victim, g.id, g.height, 36, 41, 5).send()
}
}
val weapon: RangeWeapon? = RangeWeapon.get(state.weapon.id)
val weapon: RangeWeapon? = state.weapon?.let { RangeWeapon.get(it.id) }
val anim = entity.properties.attackAnimation.id
weapon?.let {
if ((anim == 422 || anim == 423)) {