86 List<Npc> snakes =
new ArrayList<>();
89 List<CustomGameObject> clouds =
new ArrayList<>();
102 ZulrahActivity activity =
new ZulrahActivity(
player,
player.playerAssistant.instance());
104 activity.resetCooldown();
105 player.gameRecord.start();
106 player.dialogueFactory.sendStatement(
"Welcome to Zulrah's shrine.").execute();
118 zulrah.getCombat().reset();
126 int next = RandomUtils.randomExclude(ZulrahConstants.ZULRAH_IDS,
zulrah.id);
129 }
else if (next == 2043) {
131 }
else if (next == 2044) {
138 ZulrahPhase nextPhase() {
140 return ZulrahPhase.ATTACKING;
142 Set<ZulrahPhase> states =
new HashSet<>();
143 states.add(ZulrahPhase.ATTACKING);
144 if (clouds.size() < ZulrahConstants.MAXIMUM_CLOUDS) {
145 states.add(ZulrahPhase.POISONOUS_CLOUD);
147 if (snakes.size() < ZulrahConstants.MAXIMUM_SNAKELINGS) {
148 states.add(ZulrahPhase.SNAKELINGS);
150 return Utility.randomElement(states);
154 Position getSnakelingPosition() {
155 Set<Position> positions =
new HashSet<>(Arrays.asList(ZulrahConstants.SNAKELINGS_POSITIONS));
156 for (Npc snake : snakes) {
157 if (positions.contains(snake.getPosition())) {
158 positions.remove(snake.getPosition());
161 return Utility.randomElement(positions);
165 Position getCloudPosition() {
166 Set<Position> positions =
new HashSet<>(Arrays.asList(ZulrahConstants.CLOUD_POSITIONS));
167 for (GameObject cloud : clouds) {
168 if (positions.contains(cloud.getPosition())) {
169 positions.remove(cloud.getPosition());
172 return Utility.randomElement(positions);
176 private void cloudEffect() {
177 for (CustomGameObject cloud : clouds) {
178 if (Utility.inside(cloud.getPosition(), 2, 2,
player.getPosition(), 1, 1))
179 player.damage(
new Hit(RandomUtils.inclusive(1, 5), Hitsplat.VENOM));
187 boolean valid =
zulrah !=
null;
189 if (valid &&
zulrah.isDead()) {
196 zulrah.getCombat().cooldown(2);
216 for (
Npc snakeling : snakes) {
240 Npc npc = mob.getNpc();
246 if (snakes.contains(npc)) {
275 protected Optional<? extends ActivityListener<? extends Activity>>
getListener() {
276 return Optional.of(LISTENER);
Activity(int cooldown, int instance)
boolean canTeleport(Player player)
static ZulrahActivity create(Player player)
Optional<? extends ActivityListener<? extends Activity > > getListener()
void onRegionChange(Player player)