Implemented Maze random event

This commit is contained in:
Oven Bread
2025-02-11 13:03:30 +00:00
committed by Ryan
parent b5784c5782
commit 612ccc6776
5 changed files with 348 additions and 1 deletions
@@ -115,7 +115,9 @@ public final class DoorActionHandler {
if (object.getCharge() == IN_USE_CHARGE) {
return false;
}
final Scenery second = (object.getId() == 3) ? null : getSecondDoor(object, entity);
// TODO: Maybe have this passed in as an optional parameter or overload handleAutowalkDoor?
boolean ignoreSecondDoor = (object.getId() == 3628 || object.getId() == 3629 || object.getId() == 3630 || object.getId() == 3631|| object.getId() == 3632); // Ignore second door for Maze Random
final Scenery second = (object.getId() == 3 || ignoreSecondDoor) ? null : getSecondDoor(object, entity);
entity.lock(4);
final Location loc = entity.getLocation();
if (entity instanceof Player) {
@@ -15,6 +15,7 @@ import core.game.node.entity.player.info.Rights
import core.game.node.entity.player.info.login.LoginConfiguration
import core.game.node.entity.player.link.SpellBookManager
import core.game.node.entity.combat.spell.MagicSpell
import content.global.ame.events.maze.MazeInterface
import content.global.skill.summoning.familiar.FamiliarSpecial
import core.game.node.item.GroundItemManager
import core.game.node.item.Item
@@ -670,6 +671,11 @@ object PacketProcessor {
if (pkt.id == 6899)
scenery = Scenery(6899, Location(3221, 9618))
// Random Event Maze chests are overridden by the walls, which needs to be hacked in.
if ((scenery?.id == 3626 || scenery?.id == 3635) && (objId in 3635..3636)) {
scenery = MazeInterface.overrideScenery(scenery, objId)
}
// Family crest levers don't have varps associated with them, so their state is validated with attributes
// instead, and they always appear as their down/odd variant in the server's map
if (objId in 2421..2426 && objId % 2 == 0) {