RuneHive-Game
Loading...
Searching...
No Matches
DoubleExperienceEvent.java
Go to the documentation of this file.
1package com.runehive.game.task.impl;
2
3import com.runehive.content.WellOfGoodwill;
4import com.runehive.game.task.Task;
5import com.runehive.game.world.World;
6
7/**
8 * An randomevent which starts double experience for 1 hour.
9 *
10 * @author Daniel | Obey
11 */
12public class DoubleExperienceEvent extends Task {
13
15 super(100);
16 }
17
18 @Override
19 public void execute() {
20 if (!WellOfGoodwill.isActive()) {
21 cancel();
22 return;
23 }
24
26
27 if (WellOfGoodwill.activeTime == 15) {
28 World.sendMessage("<col=2b58a0>WOG</col>: 15 Minutes left until the well is expired.");
29 } else if (WellOfGoodwill.activeTime == 25) {
30 World.sendMessage("<col=2b58a0>WOG</col>: 5 Minutes left until the well is expired.");
31 } else if (WellOfGoodwill.activeTime == 30) {
32 cancel();
33 }
34 }
35
36 @Override
37 protected void onCancel(boolean logout) {
38 World.sendMessage("<col=2b58a0>WOG</col>: The well has expired and needs replenishing!");
41 }
42
43}
Handles contribution towards the well of goodwill.
static int CONTRIBUTION
The current contribution amount for the well.
synchronized final void cancel()
Cancels all subsequent executions.
Definition Task.java:113
Task(boolean instant, int delay)
Creates a new Task.
Definition Task.java:41
void onCancel(boolean logout)
A function executed on cancellation.
void execute()
A function representing the unit of work that will be carried out.
Represents the game world.
Definition World.java:46
static void sendMessage(String... messages)
Sends a global message.
Definition World.java:396