Warriors Guild
- Fixed Exploit, 10 tokens are taken upon entering the cyclops room.
This commit is contained in:
@@ -144,6 +144,7 @@ public final class CyclopesRoom extends MapZone implements Plugin<Object> {
|
|||||||
public boolean handle(Player player, Node node, String option) {
|
public boolean handle(Player player, Node node, String option) {
|
||||||
if (player.getLocation().getX() <= 2846) {
|
if (player.getLocation().getX() <= 2846) {
|
||||||
Item tokens = new Item(8851, 100);
|
Item tokens = new Item(8851, 100);
|
||||||
|
Item tokens10 = new Item(8851, 10);
|
||||||
if (!player.getInventory().containsItem(tokens)) {
|
if (!player.getInventory().containsItem(tokens)) {
|
||||||
player.getDialogueInterpreter().sendItemMessage(tokens, "You don't have enough Warrior Guild Tokens to enter", "the cyclopes enclosure yet, collect at least 100 then", "come back.");
|
player.getDialogueInterpreter().sendItemMessage(tokens, "You don't have enough Warrior Guild Tokens to enter", "the cyclopes enclosure yet, collect at least 100 then", "come back.");
|
||||||
return true;
|
return true;
|
||||||
@@ -153,6 +154,8 @@ public final class CyclopesRoom extends MapZone implements Plugin<Object> {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
player.removeAttribute("sent_dialogue");
|
player.removeAttribute("sent_dialogue");
|
||||||
|
player.getInventory().remove(tokens10);
|
||||||
|
player.sendMessages("10 tokens are taken as you enter the room.");
|
||||||
enter(player);
|
enter(player);
|
||||||
} else {
|
} else {
|
||||||
leave(player);
|
leave(player);
|
||||||
@@ -188,13 +191,8 @@ public final class CyclopesRoom extends MapZone implements Plugin<Object> {
|
|||||||
* @param player The player.
|
* @param player The player.
|
||||||
*/
|
*/
|
||||||
private static void enter(Player player) {
|
private static void enter(Player player) {
|
||||||
Item tokens = new Item(8851, 10);
|
if (!PLAYERS.contains(player)) {
|
||||||
if (!PLAYERS.contains(player) && player.getInventory().contains(8851, 10)) {
|
|
||||||
player.getInventory().remove(tokens);
|
|
||||||
player.getPacketDispatch().sendMessage("10 of your tokens crumble away as you enter the room.");
|
|
||||||
PLAYERS.add(player);
|
PLAYERS.add(player);
|
||||||
}else{
|
|
||||||
player.getPacketDispatch().sendMessage("You do not have the tokens to enter.");
|
|
||||||
}
|
}
|
||||||
if (!PULSE.isRunning()) {
|
if (!PULSE.isRunning()) {
|
||||||
PULSE.restart();
|
PULSE.restart();
|
||||||
|
|||||||
Reference in New Issue
Block a user