diff --git a/src/main/java/io/blert/challenges/mokhaiotl/DelveDataTracker.java b/src/main/java/io/blert/challenges/mokhaiotl/DelveDataTracker.java index a23013e..5903f05 100644 --- a/src/main/java/io/blert/challenges/mokhaiotl/DelveDataTracker.java +++ b/src/main/java/io/blert/challenges/mokhaiotl/DelveDataTracker.java @@ -23,12 +23,9 @@ package io.blert.challenges.mokhaiotl; -import com.google.common.collect.ImmutableSet; import io.blert.core.*; -import io.blert.events.NpcAttackEvent; import io.blert.events.mokhaiotl.*; import io.blert.util.ChatText; -import io.blert.util.Location; import io.blert.util.Tick; import java.util.*; import java.util.regex.Matcher; @@ -41,47 +38,13 @@ @Slf4j public class DelveDataTracker extends DataTracker { - private static final int MOKHAIOTL_AUTO_ANIMATION_ID = 12406; - private static final int MOKHAIOTL_BALL_ANIMATION_ID = 12407; - private static final int MOKHAIOTL_CHARGE_ANIMATION_ID = 12409; - private static final int MOKHAIOTL_BLAST_ANIMATION_ID = 12411; - private static final int MOKHAIOTL_MELEE_ANIMATION_ID = 12416; - private static final int MOKHAIOTL_RACECAR_ANIMATION_ID = 12417; - - private static final int MOKHAIOTL_RANGED_BALL_PROJECTILE_ID = 3384; - private static final int MOKHAIOTL_MAGE_BALL_PROJECTILE_ID = 3385; - - private static final Set SHOCKWAVE_GRAPHICS_IDs = ImmutableSet.of(3405, 3406, 3407); - - private static final int[] HITPOINTS_BY_DELVE = new int[] { - -1, // 1-indexed - 525, // Delve 1 - 550, // Delve 2 - 575, // Delve 3 - 600, // Delve 4 - 625, // Delve 5 - 650, // Delve 6 - 650, // Delve 7 - 675, // Delve 8+ - }; - private static final int SHIELD_HITPOINTS = 500; - - private enum PhaseChange { - NONE, - SHIELD_START, - SHIELD_END, - } + private static final Set MOKHAIOTL_IDS = Set.of(14707, 14708, 14709); + private static final Set LARVA_IDS = Set.of(14710, 14711, 14712, 14713, 14788, 14789); private final Pattern delveEndRegex; private final int delve; - private BasicTrackedNpc mokhaiotl = null; - PhaseChange phaseChange; - private int hitpointsBeforeShield; - private int unidentifiedAttackTick; - private int lastRacecarTick; - private final Map activeOrbs = new HashMap<>(); - private boolean shockwaveThisTick; + private @Nullable NPC mokhaiotl = null; private final Queue healsThisTick = new LinkedList<>(); private final Queue larvaeLeakedThisTick = new LinkedList<>(); @@ -103,9 +66,6 @@ public DelveDataTracker( this.delveEndRegex = Pattern.compile("Delve level: " + delve + " duration: (" + Tick.TIME_STRING_REGEX + ")"); } - this.unidentifiedAttackTick = -1; - this.lastRacecarTick = -1; - this.phaseChange = PhaseChange.NONE; } protected void start() { @@ -117,15 +77,6 @@ protected void start() { protected void onTick() { final int tick = getTick(); - checkForNewOrbs(tick); - - if (phaseChange == PhaseChange.SHIELD_START) { - hitpointsBeforeShield = mokhaiotl.getHitpoints().getCurrent(); - mokhaiotl.setHitpoints(new Hitpoints(SHIELD_HITPOINTS)); - } else if (phaseChange == PhaseChange.SHIELD_END) { - mokhaiotl.setHitpoints(new Hitpoints(hitpointsBeforeShield, HITPOINTS_BY_DELVE[Math.min(delve, 8)])); - } - while (!healsThisTick.isEmpty()) { Hitsplat hitsplat = healsThisTick.remove(); TrackedNpc larva = larvaeLeakedThisTick.poll(); @@ -136,17 +87,8 @@ protected void onTick() { dispatchEvent(new MokhaiotlLarvaLeakEvent(getStage(), tick, larva.getRoomId(), hitsplat.getAmount())); } - if (shockwaveThisTick) { - boolean isSlam = mokhaiotl.getNpc().getId() == MokhaiotlNpc.MOKHAIOTL_BURROWED.getId() - || lastRacecarTick >= tick - 12; - NpcAttack attack = isSlam ? NpcAttack.MOKHAIOTL_SLAM : NpcAttack.MOKHAIOTL_SHOCKWAVE; - dispatchEvent(new NpcAttackEvent(getStage(), tick, getWorldLocation(mokhaiotl), attack, mokhaiotl)); - } - - shockwaveThisTick = false; healsThisTick.clear(); larvaeLeakedThisTick.clear(); - phaseChange = PhaseChange.NONE; } @Override @@ -168,25 +110,15 @@ protected void onMessage(ChatMessage event) { @Override protected Optional onNpcSpawn(NpcSpawned event) { NPC npc = event.getNpc(); - Optional maybeNpc = MokhaiotlNpc.withId(npc.getId()); - if (maybeNpc.isEmpty()) { - return Optional.empty(); - } - - MokhaiotlNpc mokhaiotlNpc = maybeNpc.get(); - if (mokhaiotlNpc.isMokhaiotl()) { + if (MOKHAIOTL_IDS.contains(npc.getId())) { if (getState() == State.NOT_STARTED) { start(); } - if (mokhaiotl == null) { - int hitpoints = HITPOINTS_BY_DELVE[Math.min(delve, 8)]; - mokhaiotl = new BasicTrackedNpc(npc, generateRoomId(npc), new Hitpoints(hitpoints)); - } - return Optional.of(mokhaiotl); + mokhaiotl = npc; } - return Optional.of(new BasicTrackedNpc(npc, generateRoomId(npc), new Hitpoints(mokhaiotlNpc.getHitpoints()))); + return Optional.empty(); } @Override @@ -195,16 +127,10 @@ protected boolean onNpcDespawn(NpcDespawned event, @Nullable TrackedNpc trackedN return false; } - Optional maybeNpc = MokhaiotlNpc.withId(event.getNpc().getId()); - if (maybeNpc.isEmpty()) { - return false; - } - - MokhaiotlNpc mokhaiotlNpc = maybeNpc.get(); - if (mokhaiotlNpc.isLarva() && mokhaiotl != null && mokhaiotl.getNpc() != null) { + if (LARVA_IDS.contains(event.getNpc().getId()) && mokhaiotl != null) { NPC larva = trackedNpc.getNpc(); WorldPoint mokhaiotlSouthwest = getWorldLocation(mokhaiotl); - int mokhaiotlSize = mokhaiotl.getNpc().getComposition().getSize(); + int mokhaiotlSize = mokhaiotl.getComposition().getSize(); WorldPoint mokhaiotlCenter = new WorldPoint( mokhaiotlSouthwest.getX() + mokhaiotlSize / 2, mokhaiotlSouthwest.getY() + mokhaiotlSize / 2, @@ -218,27 +144,9 @@ protected boolean onNpcDespawn(NpcDespawned event, @Nullable TrackedNpc trackedN return true; } - @Override - protected void onNpcChange(NpcChanged event) { - Optional maybeBefore = MokhaiotlNpc.withId(event.getOld().getId()); - Optional maybeAfter = MokhaiotlNpc.withId(event.getNpc().getId()); - if (maybeBefore.isEmpty() || maybeAfter.isEmpty()) { - return; - } - - MokhaiotlNpc before = maybeBefore.get(); - MokhaiotlNpc after = maybeAfter.get(); - - if (before == MokhaiotlNpc.MOKHAIOTL && after == MokhaiotlNpc.MOKHAIOTL_SHIELDED) { - phaseChange = PhaseChange.SHIELD_START; - } else if (before == MokhaiotlNpc.MOKHAIOTL_SHIELDED) { - phaseChange = PhaseChange.SHIELD_END; - } - } - @Override protected void onHitsplat(HitsplatApplied hitsplatApplied) { - if (hitsplatApplied.getActor() != mokhaiotl.getNpc()) { + if (hitsplatApplied.getActor() != mokhaiotl) { return; } @@ -247,131 +155,4 @@ protected void onHitsplat(HitsplatApplied hitsplatApplied) { healsThisTick.add(hitsplat); } } - - @Override - protected void onAnimation(AnimationChanged event) { - if (event.getActor() != mokhaiotl.getNpc()) { - return; - } - - final int tick = getTick(); - NpcAttack attack; - - switch (event.getActor().getAnimation()) { - case MOKHAIOTL_AUTO_ANIMATION_ID: - attack = NpcAttack.MOKHAIOTL_AUTO; - unidentifiedAttackTick = tick; - break; - case MOKHAIOTL_BALL_ANIMATION_ID: - attack = NpcAttack.MOKHAIOTL_BALL; - unidentifiedAttackTick = tick; - break; - case MOKHAIOTL_CHARGE_ANIMATION_ID: - attack = NpcAttack.MOKHAIOTL_CHARGE; - break; - case MOKHAIOTL_MELEE_ANIMATION_ID: - attack = NpcAttack.MOKHAIOTL_MELEE; - break; - case MOKHAIOTL_BLAST_ANIMATION_ID: - attack = NpcAttack.MOKHAIOTL_BLAST; - break; - case MOKHAIOTL_RACECAR_ANIMATION_ID: - if (lastRacecarTick > tick - 5) { - return; - } - attack = NpcAttack.MOKHAIOTL_RACECAR; - lastRacecarTick = tick; - break; - default: - log.debug("Unhandled Mokhaiotl animation: {}", event.getActor().getAnimation()); - return; - } - - WorldPoint location = getWorldLocation(mokhaiotl); - dispatchEvent(new NpcAttackEvent(getStage(), tick, location, attack, mokhaiotl)); - } - - @Override - protected void onProjectile(ProjectileMoved event) { - Projectile projectile = event.getProjectile(); - int elapsed = projectile.getEndCycle() - projectile.getStartCycle() - projectile.getRemainingCycles(); - - MokhaiotlAttackStyleEvent.Style style; - - switch (projectile.getId()) { - case Orb.MELEE_PROJECTILE_ID: - style = MokhaiotlAttackStyleEvent.Style.MELEE; - break; - case Orb.RANGED_PROJECTILE_ID: - case MOKHAIOTL_RANGED_BALL_PROJECTILE_ID: - style = MokhaiotlAttackStyleEvent.Style.RANGED; - break; - case Orb.MAGE_PROJECTILE_ID: - case MOKHAIOTL_MAGE_BALL_PROJECTILE_ID: - style = MokhaiotlAttackStyleEvent.Style.MAGE; - break; - default: - return; - } - - if (elapsed == 0 && mokhaiotl != null && mokhaiotl.getNpc() != null) { - boolean fromMokhaiotl = mokhaiotl.getNpc().getWorldArea().contains(projectile.getSourcePoint()); - - if (fromMokhaiotl && unidentifiedAttackTick != -1) { - dispatchEvent(new MokhaiotlAttackStyleEvent(getStage(), getTick(), style, unidentifiedAttackTick)); - unidentifiedAttackTick = -1; - } - } else if (projectile.getRemainingCycles() <= 3) { - Orb orb = activeOrbs.get(projectile); - if (orb != null && orb.isActive()) { - orb.setLanded(getTick()); - WorldPoint sourcePoint = Location.getWorldLocation(client, projectile.getSourcePoint()); - dispatchEvent(new MokhaiotlOrbEvent(getStage(), orb.getLandedTick(), orb, sourcePoint)); - } - } - } - - @Override - protected void onGraphicsObjectCreation(GraphicsObjectCreated event) { - if (SHOCKWAVE_GRAPHICS_IDs.contains(event.getGraphicsObject().getId())) { - shockwaveThisTick = true; - } - } - - @Override - protected boolean npcIgnoresCooldown(NPC npc) { - return MokhaiotlNpc.withId(npc.getId()) - .map(m -> { - if (m.isLarva() || m == MokhaiotlNpc.VOLATILE_EARTH) { - return true; - } - - if (m == MokhaiotlNpc.MOKHAIOTL && mokhaiotl != null && mokhaiotl.getNpc() == npc) { - // Charging regular (non-shielded) Mokhaiotl can be interrupted off cooldown. - return npc.getAnimation() == MOKHAIOTL_CHARGE_ANIMATION_ID; - } - - return false; - }) - .orElse(false); - } - - void checkForNewOrbs(int tick) { - if (mokhaiotl == null) { - return; - } - - for (Projectile projectile : client.getProjectiles()) { - if (!Orb.isOrb(projectile.getId())) { - continue; - } - - if (!activeOrbs.containsKey(projectile)) { - boolean fromMokhaiotl = mokhaiotl.getNpc().getWorldArea().contains(projectile.getSourcePoint()); - - Orb.Source source = fromMokhaiotl ? Orb.Source.MOKHAIOTL : Orb.Source.BALL; - activeOrbs.put(projectile, new Orb(projectile, source, tick)); - } - } - } } diff --git a/src/main/java/io/blert/challenges/mokhaiotl/MokhaiotlNpc.java b/src/main/java/io/blert/challenges/mokhaiotl/MokhaiotlNpc.java deleted file mode 100644 index 7733e6c..0000000 --- a/src/main/java/io/blert/challenges/mokhaiotl/MokhaiotlNpc.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2025 Alexei Frolov - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the “Software”), to deal in - * the Software without restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the - * Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -package io.blert.challenges.mokhaiotl; - -import java.util.Optional; -import lombok.Getter; - -@Getter -public enum MokhaiotlNpc { - MOKHAIOTL(14707), - MOKHAIOTL_SHIELDED(14708), - MOKHAIOTL_BURROWED(14709), - DEMONIC_LARVA(14710, 2), - DEMONIC_RANGE_LARVA(14711, 2), - DEMONIC_MAGIC_LARVA(14712, 2), - DEMONIC_MELEE_LARVA(14713, 2), - VOLATILE_EARTH(14714, 1), - EARTHEN_SHIELD(14715, 0), - GIANT_DEMONIC_RANGE_LARVA(14788, 4), - GIANT_DEMONIC_MAGIC_LARVA(14789, 4); - - private final int id; - private final int hitpoints; - - public static Optional withId(int id) { - for (MokhaiotlNpc npc : values()) { - if (npc.id == id) { - return Optional.of(npc); - } - } - return Optional.empty(); - } - - public boolean isMokhaiotl() { - return this == MOKHAIOTL || this == MOKHAIOTL_SHIELDED || this == MOKHAIOTL_BURROWED; - } - - public boolean isLarva() { - return this == DEMONIC_LARVA - || this == DEMONIC_RANGE_LARVA - || this == DEMONIC_MAGIC_LARVA - || this == DEMONIC_MELEE_LARVA - || this == GIANT_DEMONIC_RANGE_LARVA - || this == GIANT_DEMONIC_MAGIC_LARVA; - } - - MokhaiotlNpc(int id) { - this(id, -1); - } - - MokhaiotlNpc(int id, int hitpoints) { - this.id = id; - this.hitpoints = hitpoints; - } -} diff --git a/src/main/java/io/blert/challenges/mokhaiotl/Orb.java b/src/main/java/io/blert/challenges/mokhaiotl/Orb.java deleted file mode 100644 index 89ac996..0000000 --- a/src/main/java/io/blert/challenges/mokhaiotl/Orb.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2025 Alexei Frolov - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the “Software”), to deal in - * the Software without restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the - * Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -package io.blert.challenges.mokhaiotl; - -import lombok.Getter; -import net.runelite.api.Projectile; - -@Getter -public class Orb { - public static final int MELEE_PROJECTILE_ID = 3378; - public static final int MAGE_PROJECTILE_ID = 3379; - public static final int RANGED_PROJECTILE_ID = 3380; - - public static boolean isOrb(int projectileId) { - return projectileId == MELEE_PROJECTILE_ID - || projectileId == RANGED_PROJECTILE_ID - || projectileId == MAGE_PROJECTILE_ID; - } - - public enum Source { - MOKHAIOTL(1), - BALL(2); - - @Getter - private final int id; - - Source(int id) { - this.id = id; - } - } - - public enum Style { - MELEE(0), - RANGE(1), - MAGE(2); - - @Getter - private final int id; - - Style(int id) { - this.id = id; - } - } - - private final Projectile projectile; - private final Source source; - private final int spawnTick; - private int landedTick; - - public Orb(Projectile projectile, Source source, int spawnTick) { - if (!isOrb(projectile.getId())) { - throw new IllegalArgumentException("Invalid projectile ID for Orb: " + projectile.getId()); - } - this.projectile = projectile; - this.source = source; - this.spawnTick = spawnTick; - this.landedTick = -1; - } - - public boolean isActive() { - return landedTick == -1; - } - - public void setLanded(int tick) { - if (isActive()) { - this.landedTick = tick; - } - } - - public Style getStyle() { - switch (projectile.getId()) { - case MELEE_PROJECTILE_ID: - return Style.MELEE; - case RANGED_PROJECTILE_ID: - return Style.RANGE; - case MAGE_PROJECTILE_ID: - return Style.MAGE; - default: - throw new IllegalArgumentException("Unknown projectile ID: " + projectile.getId()); - } - } -} diff --git a/src/main/java/io/blert/core/DataTracker.java b/src/main/java/io/blert/core/DataTracker.java index 23a3014..f87d4f8 100644 --- a/src/main/java/io/blert/core/DataTracker.java +++ b/src/main/java/io/blert/core/DataTracker.java @@ -366,18 +366,6 @@ protected void onItemSpawn(ItemSpawned event) {} */ protected void onItemDespawn(ItemDespawned event) {} - /** - * Returns whether attacking the NPC with the given ID ignores the player's - * attack cooldown. - * Should be overriden by implementations which require special handling. - * - * @param npc The NPC. - * @return {@code true} if the NPC ignores cooldown, {@code false} otherwise. - */ - protected boolean npcIgnoresCooldown(NPC npc) { - return false; - } - /** * Implementation-specific equivalent of the {@code onVarbitChanged} Runelite event handler. * Should be overriden by implementations which require special handling. @@ -744,8 +732,6 @@ private void checkForPlayerAttack(@NonNull Raider raider, @NonNull Player player Optional target = raider.getTarget(); boolean isNewAnimation = raider.getAnimationTick() == tick; - boolean ignoreCooldown = target.map(this::npcIgnoresCooldown).orElse(false); - if (!isNewAnimation && !raider.stoppedBlowpiping()) { return; } @@ -778,7 +764,7 @@ private void checkForPlayerAttack(@NonNull Raider raider, @NonNull Player player finalAttack = adjustForProjectile(registry, attack, player, weaponId); } - raider.recordAttack(tick, finalAttack, ignoreCooldown); + raider.recordAttack(tick, finalAttack); TrackedNpc roomTarget = target.flatMap(trackedNpcs::getByNpc).orElse(null); int distanceToNpc = target.map(npc -> npc.getWorldArea().distanceTo2D(player.getWorldArea())) diff --git a/src/main/java/io/blert/core/Raider.java b/src/main/java/io/blert/core/Raider.java index 5d53627..8f9293e 100644 --- a/src/main/java/io/blert/core/Raider.java +++ b/src/main/java/io/blert/core/Raider.java @@ -263,11 +263,9 @@ public void updateState(Client client, AttackRegistry attackRegistry, Player pla lastUpdateTick = tick; } - public void recordAttack(int tick, @NonNull AttackDefinition attack, boolean ignoreCooldown) { + public void recordAttack(int tick, @NonNull AttackDefinition attack) { lastAttack = attack; - if (!ignoreCooldown) { - offCooldownTick = tick + attack.getCooldown(); - } + offCooldownTick = tick + attack.getCooldown(); if (attack.isContinuousAnimation()) { blowpiping = BlowpipeState.PIPING; diff --git a/src/main/java/io/blert/events/EventType.java b/src/main/java/io/blert/events/EventType.java index 0c7f5a3..5bd6bbe 100644 --- a/src/main/java/io/blert/events/EventType.java +++ b/src/main/java/io/blert/events/EventType.java @@ -79,8 +79,6 @@ public enum EventType { COLOSSEUM_SOL_POOLS(206), COLOSSEUM_SOL_LASERS(207), - MOKHAIOTL_ATTACK_STYLE(250), - MOKHAIOTL_ORB(251), MOKHAIOTL_LARVA_LEAK(253), INFERNO_WAVE_START(300), diff --git a/src/main/java/io/blert/events/mokhaiotl/MokhaiotlAttackStyleEvent.java b/src/main/java/io/blert/events/mokhaiotl/MokhaiotlAttackStyleEvent.java deleted file mode 100644 index 845b4df..0000000 --- a/src/main/java/io/blert/events/mokhaiotl/MokhaiotlAttackStyleEvent.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2025 Alexei Frolov - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the “Software”), to deal in - * the Software without restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the - * Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -package io.blert.events.mokhaiotl; - -import io.blert.core.Stage; -import io.blert.events.Event; -import io.blert.events.EventType; -import lombok.Getter; - -@Getter -public class MokhaiotlAttackStyleEvent extends Event { - public enum Style { - MELEE, - RANGED, - MAGE, - } - - private final Style style; - private final int attackTick; - - public MokhaiotlAttackStyleEvent(Stage stage, int tick, Style style, int attackTick) { - super(EventType.MOKHAIOTL_ATTACK_STYLE, stage, tick, null); - this.style = style; - this.attackTick = attackTick; - } - - @Override - protected String eventDataString() { - return "style=" + style.name() + ", attackTick=" + attackTick; - } -} diff --git a/src/main/java/io/blert/events/mokhaiotl/MokhaiotlOrbEvent.java b/src/main/java/io/blert/events/mokhaiotl/MokhaiotlOrbEvent.java deleted file mode 100644 index bb04ca2..0000000 --- a/src/main/java/io/blert/events/mokhaiotl/MokhaiotlOrbEvent.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2025 Alexei Frolov - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the “Software”), to deal in - * the Software without restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the - * Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - */ - -package io.blert.events.mokhaiotl; - -import io.blert.challenges.mokhaiotl.Orb; -import io.blert.core.Stage; -import io.blert.events.Event; -import io.blert.events.EventType; -import lombok.Getter; -import net.runelite.api.coords.WorldPoint; - -@Getter -public class MokhaiotlOrbEvent extends Event { - private final Orb.Source source; - private final WorldPoint sourcePoint; - private final Orb.Style style; - private final int startTick; - private final int endTick; - - public MokhaiotlOrbEvent(Stage stage, int tick, Orb orb, WorldPoint sourcePoint) { - super(EventType.MOKHAIOTL_ORB, stage, tick, null); - this.source = orb.getSource(); - this.sourcePoint = sourcePoint; - this.style = orb.getStyle(); - this.startTick = orb.getSpawnTick(); - this.endTick = tick; - } - - @Override - protected String eventDataString() { - return String.format( - "source=%s, sourcePoint=%s, style=%s, startTick=%d, endTick=%d", - source, sourcePoint, style, startTick, endTick); - } -} diff --git a/src/main/java/io/blert/json/Event.java b/src/main/java/io/blert/json/Event.java index eb9ae66..ffc6913 100644 --- a/src/main/java/io/blert/json/Event.java +++ b/src/main/java/io/blert/json/Event.java @@ -73,8 +73,6 @@ public class Event { public ColosseumSolLasers colosseumSolLasers; // Mokhaiotl event-specific fields - public AttackStyle mokhaiotlAttackStyle; - public MokhaiotlOrb mokhaiotlOrb; public MokhaiotlLarvaLeak mokhaiotlLarvaLeak; // Inferno event-specific fields @@ -225,11 +223,6 @@ public static class XarpusSplat { public Coords bounceFrom; } - public static class AttackStyle { - public int style; - public int npcAttackTick; - } - public static class VerzikBounce { public int npcAttackTick; public int playersInRange; @@ -252,14 +245,6 @@ public static class VerzikDawnDrop { public boolean dropped; } - public static class MokhaiotlOrb { - public int source; - public Coords sourcePoint; - public int style; - public int startTick; - public int endTick; - } - public static class MokhaiotlLarvaLeak { public long roomId; public int healAmount; diff --git a/src/main/java/io/blert/json/JsonEventTranslator.java b/src/main/java/io/blert/json/JsonEventTranslator.java index 4f819c2..60df9a7 100644 --- a/src/main/java/io/blert/json/JsonEventTranslator.java +++ b/src/main/java/io/blert/json/JsonEventTranslator.java @@ -486,26 +486,6 @@ public static Event toJson(io.blert.events.Event event, @Nullable String challen break; } - case MOKHAIOTL_ATTACK_STYLE: { - MokhaiotlAttackStyleEvent mokhaiotlAttackStyleEvent = (MokhaiotlAttackStyleEvent) event; - json.mokhaiotlAttackStyle = new Event.AttackStyle(); - json.mokhaiotlAttackStyle.style = - mokhaiotlAttackStyleEvent.getStyle().ordinal(); - json.mokhaiotlAttackStyle.npcAttackTick = mokhaiotlAttackStyleEvent.getAttackTick(); - break; - } - - case MOKHAIOTL_ORB: { - MokhaiotlOrbEvent mokhaiotlOrbEvent = (MokhaiotlOrbEvent) event; - json.mokhaiotlOrb = new Event.MokhaiotlOrb(); - json.mokhaiotlOrb.source = mokhaiotlOrbEvent.getSource().getId(); - json.mokhaiotlOrb.sourcePoint = worldPointToCoords(mokhaiotlOrbEvent.getSourcePoint()); - json.mokhaiotlOrb.style = mokhaiotlOrbEvent.getStyle().getId(); - json.mokhaiotlOrb.startTick = mokhaiotlOrbEvent.getStartTick(); - json.mokhaiotlOrb.endTick = mokhaiotlOrbEvent.getEndTick(); - break; - } - case MOKHAIOTL_LARVA_LEAK: { MokhaiotlLarvaLeakEvent mokhaiotlLarvaLeakEvent = (MokhaiotlLarvaLeakEvent) event; json.mokhaiotlLarvaLeak = new Event.MokhaiotlLarvaLeak(); diff --git a/src/main/resources/recording_config.json b/src/main/resources/recording_config.json index 6225264..ff527ae 100644 --- a/src/main/resources/recording_config.json +++ b/src/main/resources/recording_config.json @@ -78,7 +78,31 @@ "ids": [3405, 3406, 3407], "onCreation": true } - ] + ], + "npcDefinitions": [ + { + "ids": [14707, 14708, 14709] + }, + { + "ids": [14710, 14711, 14712, 14713], + "hitpoints": [2] + }, + { + "ids": [14788, 14789], + "hitpoints": [4] + }, + { + "ids": [14714], + "hitpoints": [1] + }, + { + "ids": [14715], + "hitpoints": [0] + } + ], + "varbits": [6099, 6100], + "varps": [1683], + "projectiles": [3378, 3379, 3380, 3384, 3385] } }, { @@ -178,7 +202,9 @@ { "ids": [16668] } - ] + ], + "varbits": [6099, 6100, 16570, 16571], + "varps": [1683] } } ]