mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-20 21:40:27 -07:00
Changed Bork to use daily reset.
This commit is contained in:
parent
95c38775b2
commit
d60644511c
1 changed files with 12 additions and 2 deletions
|
|
@ -13,6 +13,8 @@ import core.game.node.entity.Entity;
|
||||||
import core.game.node.entity.npc.NPC;
|
import core.game.node.entity.npc.NPC;
|
||||||
import core.game.node.entity.player.Player;
|
import core.game.node.entity.player.Player;
|
||||||
import core.game.node.object.Scenery;
|
import core.game.node.object.Scenery;
|
||||||
|
import org.json.simple.JSONObject;
|
||||||
|
import rs09.ServerStore;
|
||||||
import rs09.game.world.GameWorld;
|
import rs09.game.world.GameWorld;
|
||||||
import core.game.world.map.Location;
|
import core.game.world.map.Location;
|
||||||
import core.game.world.map.zone.MapZone;
|
import core.game.world.map.zone.MapZone;
|
||||||
|
|
@ -261,13 +263,13 @@ public final class ChaosTunnelZone extends MapZone implements Plugin<Object> {
|
||||||
* @param player The player.
|
* @param player The player.
|
||||||
*/
|
*/
|
||||||
private void commenceBorkBattle(Player player) {
|
private void commenceBorkBattle(Player player) {
|
||||||
if ((System.currentTimeMillis() - player.getSavedData().getActivityData().getLastBorkBattle()) < 24 * 60 * 60_000 && GameWorld.getSettings().isHosted()) {
|
if (ServerStore.INSTANCE.getBoolean(getStoreFile(), player.getUsername().toLowerCase()) && GameWorld.getSettings().isHosted()) {
|
||||||
player.getPacketDispatch().sendMessage("The portal's magic is too weak to teleport you right now.");
|
player.getPacketDispatch().sendMessage("The portal's magic is too weak to teleport you right now.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
player.lock(10);
|
player.lock(10);
|
||||||
player.graphics(Graphics.create(110));
|
player.graphics(Graphics.create(110));
|
||||||
player.getSavedData().getActivityData().setLastBorkBattle(System.currentTimeMillis());
|
getStoreFile().put(player.getUsername().toLowerCase(), true);
|
||||||
ActivityManager.start(player, "Bork cutscene", false);
|
ActivityManager.start(player, "Bork cutscene", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -352,4 +354,12 @@ public final class ChaosTunnelZone extends MapZone implements Plugin<Object> {
|
||||||
PORTALS.put(location, loc);
|
PORTALS.put(location, loc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Server Store file for Bork being killed for the day
|
||||||
|
* @return The JSONObject containing the boolean of whether Bork has been killed
|
||||||
|
*/
|
||||||
|
private JSONObject getStoreFile() {
|
||||||
|
return ServerStore.getArchive("daily-bork-killed");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue