RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
SkotizoEvent.java
1package com.osroyale.game.world.entity.combat.strategy.npc.boss.skotizo;
2
3import com.osroyale.game.task.Task;
4import com.osroyale.game.world.World;
5import com.osroyale.util.Stopwatch;
6
7import java.util.concurrent.TimeUnit;
8
29
30public class SkotizoEvent extends Task {
31 private boolean initial;
32 private final Stopwatch stopwatch = Stopwatch.start();
33
34 public SkotizoEvent() {
35 super(false, 100);
36 this.initial = true;
37 }
38
39 @Override
40 public void execute() {
41 if ((SkotizoUtility.skotizo == null || !SkotizoUtility.skotizo.isRegistered()) && !initial) {
42 initial = true;
43 stopwatch.reset();
44 }
45
46 if (initial) {
47 if (stopwatch.elapsedTime(TimeUnit.MINUTES) >= 120) {
48 SkotizoUtility.skotizo = SkotizoUtility.generateSpawn();
49 initial = false;
50 stopwatch.reset();
51 }
52 return;
53 }
54
55 if (stopwatch.elapsedTime(TimeUnit.MINUTES) >= 20) {
56 initial = true;
57 stopwatch.reset();
58 if (SkotizoUtility.skotizo != null) {
59 SkotizoUtility. skotizo.speak("Pathetic humans could not kill me! Muhahaha");
60 World.schedule(2, () -> SkotizoUtility.skotizo.unregister());
61 }
62 World.sendMessage("<icon=6><col=8714E6> Skotizo has disappeared! He will return in 60 minutes.");
63 }
64 }
65}
Task(boolean instant, int delay)
Definition Task.java:75
static void sendMessage(String... messages)
Definition World.java:433
static void schedule(Task task)
Definition World.java:284