1package com.runehive.content.skill.impl.agility;
3import com.google.gson.Gson;
4import com.google.gson.GsonBuilder;
5import com.google.gson.JsonIOException;
6import com.google.gson.JsonSyntaxException;
7import com.runehive.Config;
8import com.runehive.content.skill.impl.agility.obstacle.Obstacle;
9import com.runehive.game.world.entity.mob.player.Player;
10import com.runehive.game.world.entity.skill.Skill;
11import com.runehive.game.world.items.Item;
12import com.runehive.game.world.position.Position;
15import java.util.HashMap;
16import java.util.function.Consumer;
27 public static final HashMap<Position, Obstacle>
obstacles =
new HashMap<>();
31 Obstacle[] loaded =
new Gson().fromJson(
new BufferedReader(
new FileReader(
"./data/content/skills/agility.json")),
Obstacle[].
class);
33 if (
obstacle.getObjectPosition() ==
null) {
37 System.out.println(
obstacle +
" No object type found. FIX MUST FIX");
41 }
catch (JsonSyntaxException | JsonIOException | FileNotFoundException e) {
50 Consumer<Player> onClick =
null;
75 onClick = p -> p.inventory.addOrDrop(
new Item(3049, 1));
79 onClick = p -> p.inventory.addOrDrop(
new Item(3051, 1));
83 onClick = p -> p.inventory.addOrDrop(
new Item(2997, 1));
89 onClick.accept(player);
93 player.
message(
"You do not have enough agility tickets to purchase that.");
100 public static void main(String[] args) {
110 try (FileWriter
writer =
new FileWriter(
new File(
"./data/def/skills/agility1.json"))) {
111 Gson builder =
new GsonBuilder().setPrettyPrinting().create();
113 writer.write(builder.toJson(
obstacles.values()).replaceAll(
"\\{\n \"x\"",
"\\{ \"x\"").replaceAll(
",\n \"y\"",
", \"y\"").replaceAll(
",\n \"z\"",
", \"z\"").replaceAll(
"\n \\},",
" \\},"));
114 }
catch (Exception e) {
The class that contains setting-related constants for the server.
static final double AGILITY_MODIFICATION
The experience modification for agility.
Created by Daniel on 2017-11-02.
static boolean clickButton(Player player, int button)
static final double TICKET_EXPERIENCE
static final int ARDOUGNE_FLAGS
static final HashMap< Position, Obstacle > obstacles
static final int WILDERNESS_FLAGS
static final int SEERS_FLAGS
static final int BARBARIAN_FLAGS
static void main(String[] args)
static final int GNOME_FLAGS
void close(int interfaceId)
This class represents a character controlled by a player.
final Inventory inventory
void message(String message)
final InterfaceManager interfaceManager
Represents a trainable and usable skill.
static final int AGILITY
The agility skill id.
The container class that represents an item that can be interacted with.
boolean remove(Item item)
Attempts to withdraw item from this container.
boolean contains(int id)
Determines if this container contains id.