Commit f46fc071 authored by Brian Foster's avatar Brian Foster

Merge branch '2.0.0' of github.com:Open-RSC/Game into 2.0.0

parents 5b736c39 81b57ed5
This diff is collapsed.
......@@ -1046,7 +1046,7 @@ public final class Admins implements CommandListener {
final Npc n = new Npc(id, baseX + x, baseY + y, baseX + x - 20, baseX + x + 20, baseY + y - 20, baseY + y + 20);
n.setShouldRespawn(false);
World.getWorld().registerNpc(n);
Server.getServer().getEventHandler().add(new SingleEvent(null, duration * 60000) {
Server.getServer().getEventHandler().add(new SingleEvent(null, duration * 60000, "Spawn Multi NPC Command") {
@Override
public void action() {
n.remove();
......@@ -1573,7 +1573,7 @@ public final class Admins implements CommandListener {
player.getInventory().add(new Item(ItemId.A_GLOWING_RED_CRYSTAL.id()));
sleep(Constants.GameServer.GAME_TICK);
player.message("You summon your pet.");
Server.getServer().getEventHandler().add(new ShortEvent(player) {
Server.getServer().getEventHandler().add(new ShortEvent(player, "Spawn Pet Dragon Command") {
public void action() {
player.setBusy(true);
final Npc petDragon = spawnNpc(NpcId.BABY_BLUE_DRAGON.id(), player.getX() + 1, player.getY(), 1000 * 60 * 24, player); // spawns for 5 hours and then poof!
......@@ -1593,7 +1593,7 @@ public final class Admins implements CommandListener {
player.getInventory().add(new Item(ItemId.A_GLOWING_RED_CRYSTAL.id()));
sleep(Constants.GameServer.GAME_TICK);
player.message("You summon your pet.");
Server.getServer().getEventHandler().add(new ShortEvent(player) {
Server.getServer().getEventHandler().add(new ShortEvent(player, "Spawn Pet Archer Command") {
public void action() {
player.setBusy(true);
final Npc petArcher = spawnNpc(NpcId.ADVENTURER_ARCHER.id(), player.getX() + 1, player.getY(), 1000 * 60 * 24, player); // spawns for 5 hours and then poof!
......@@ -1897,7 +1897,7 @@ public final class Admins implements CommandListener {
player.getY() - radius, player.getY() + radius);
n.setShouldRespawn(false);
World.getWorld().registerNpc(n);
Server.getServer().getEventHandler().add(new SingleEvent(null, time * 60000) {
Server.getServer().getEventHandler().add(new SingleEvent(null, time * 60000, "Spawn NPC Command") {
@Override
public void action() {
n.remove();
......
......@@ -2,6 +2,8 @@ package com.openrsc.server.plugins.commands;
import com.openrsc.server.Constants;
import com.openrsc.server.Server;
import com.openrsc.server.event.DelayedEvent;
import com.openrsc.server.event.DelayedEventNpc;
import com.openrsc.server.event.rsc.GameTickEvent;
import com.openrsc.server.external.EntityHandler;
import com.openrsc.server.model.Point;
......@@ -15,8 +17,7 @@ import com.openrsc.server.plugins.listeners.action.CommandListener;
import com.openrsc.server.sql.DatabaseConnection;
import com.openrsc.server.util.rsc.DataConversions;
import java.util.HashMap;
import java.util.Map;
import java.util.*;
public final class Development implements CommandListener {
public void onCommand(String cmd, String[] args, Player player) {
......@@ -389,27 +390,82 @@ public final class Development implements CommandListener {
else
player.message(messagePrefix + "Invalid name or player is not online");
}
else if (cmd.equalsIgnoreCase("events")) {
player.message("Total amount of events running: " + Server.getServer().getGameEventHandler().getEvents().size());
else if (cmd.equalsIgnoreCase("events") || cmd.equalsIgnoreCase("serverstats")) {
String total = "Total Events: " + (Server.getServer().getGameEventHandler().getEvents().size() + Server.getServer().getEventHandler().getEvents().size() + Server.getServer().getEventHandlerNpc().getEvents().size());
player.message(messagePrefix + total);
HashMap<String, Integer> events = new HashMap<String, Integer>();
for (Map.Entry<String, GameTickEvent> stringGameTickEventEntry : Server.getServer().getGameEventHandler().getEvents().entrySet()) {
GameTickEvent e = stringGameTickEventEntry.getValue();
String eventName = e.getClass().getName();
if (e.getOwner() != null && e.getOwner().isUnregistering()) {
if (!events.containsKey(eventName)) {
events.put(eventName, 1);
} else {
events.put(eventName, events.get(eventName) + 1);
}
// Show info for game tick events
for (Map.Entry<String, GameTickEvent> eventEntry : Server.getServer().getGameEventHandler().getEvents().entrySet()) {
GameTickEvent e = eventEntry.getValue();
String eventName = e.getDescriptor();
//if (e.getOwner() != null && e.getOwner().isUnregistering()) {
if (!events.containsKey(eventName)) {
events.put(eventName, 1);
} else {
events.put(eventName, events.get(eventName) + 1);
}
//}
}
// Show info for general server events
for (Map.Entry<String, DelayedEvent> eventEntry : Server.getServer().getEventHandler().getEvents().entrySet()) {
DelayedEvent e = eventEntry.getValue();
String eventName = e.getDescriptor();
//if (e.getOwner() != null && e.getOwner().isUnregistering()) {
if (!events.containsKey(eventName)) {
events.put(eventName, 1);
} else {
events.put(eventName, events.get(eventName) + 1);
}
//}
}
// Show info for game NPC events
for (Map.Entry<String, DelayedEventNpc> eventEntry : Server.getServer().getEventHandlerNpc().getEvents().entrySet()) {
DelayedEventNpc e = eventEntry.getValue();
String eventName = e.getDescriptor();
//if (e.getOwner() != null && e.getOwner().isUnregistering()) {
if (!events.containsKey(eventName)) {
events.put(eventName, 1);
} else {
events.put(eventName, events.get(eventName) + 1);
}
//}
}
// Sort the Events Hashmap
List list = new LinkedList(events.entrySet());
Collections.sort(list, new Comparator() {
public int compare(Object o1, Object o2) {
return ((Comparable) ((Map.Entry) (o2)).getValue())
.compareTo(((Map.Entry) (o1)).getValue());
}
});
HashMap sortedHashMap = new LinkedHashMap();
for (Iterator it = list.iterator(); it.hasNext();) {
Map.Entry entry = (Map.Entry) it.next();
sortedHashMap.put(entry.getKey(), entry.getValue());
}
events = sortedHashMap;
int i = 0;
StringBuilder s = new StringBuilder();
for (Map.Entry<String, Integer> entry : events.entrySet()) {
if(i >= 18) // Only display first 18 elements of the hashmap
break;
String name = entry.getKey();
Integer value = entry.getValue();
s.append(name).append(": ").append(value).append("%");
}
ActionSender.sendBox(player, s.toString(), true);
ActionSender.sendBox(player,
total + ", NPCs: " + World.getWorld().getNpcs().size() + ", Players: " + World.getWorld().getPlayers().size() + ", Shops: " + World.getWorld().getShops().size() + "%" +
"Player Atk Map: " + World.getWorld().getPlayersUnderAttack().size() + ", NPC Atk Map: " + World.getWorld().getNpcsUnderAttack().size() + ", Quests: " + World.getWorld().getQuests().size() + ", Mini Games: " + World.getWorld().getMiniGames().size() + "%" +
s,
true
);
}
}
}
......@@ -440,7 +440,7 @@ public final class Event implements CommandListener {
} else {
GameObject newObject = new GameObject(objectLoc, 18, 0, 0);
World.getWorld().registerGameObject(newObject);
Server.getServer().getEventHandler().add(new SingleEvent(null, time * 60000) {
Server.getServer().getEventHandler().add(new SingleEvent(null, time * 60000, "Unregister Seers Party Hall") {
@Override
public void action() {
World.getWorld().unregisterGameObject(newObject);
......
......@@ -263,7 +263,7 @@ public final class Moderator implements CommandListener {
GameLogging.addQuery(new StaffLog(player, 13, newStr.toString()));
newStr.insert(0, player.getStaffName() + ": ");
for (Player p : World.getWorld().getPlayers()) {
ActionSender.sendMessage(p, player, 1, MessageType.GLOBAL_CHAT, "ANNOUNCEMENT: " + newStr.toString(), player.getIcon());
ActionSender.sendMessage(p, player, 1, MessageType.GLOBAL_CHAT, "ANNOUNCEMENT: @whi@" + newStr.toString(), player.getIcon());
}
}
}
......
......@@ -560,7 +560,7 @@ public class DoorAction {
npcTalk(p, masterFisher, "Hello only the top fishers are allowed in here");
}
Server.getServer().getEventHandler().add(
new ShortEvent(p) {
new ShortEvent(p, "Fishing Guild Door") {
public void action() {
p.setBusy(false);
p.message(
......@@ -1129,7 +1129,7 @@ public class DoorAction {
npcTalk(player, forester, "Hello only the top woodcutters are allowed in here");
}
Server.getServer().getEventHandler().add(
new ShortEvent(player) {
new ShortEvent(player, "Woodcutting Guild Door") {
public void action() {
owner.setBusy(false);
owner.message(
......
......@@ -145,7 +145,7 @@ public class Ladders {
} else {
npcTalk(player, abbot, "No I feel you are not devout enough");
Server.getServer().getEventHandler().add(
new ShortEvent(player) {
new ShortEvent(player, "Prayer Guild Ladder") {
public void action() {
owner.setBusy(false);
owner.message(
......@@ -175,7 +175,7 @@ public class Ladders {
"Sorry only the top miners are allowed in there");
}
Server.getServer().getEventHandler().add(
new ShortEvent(player) {
new ShortEvent(player, "Mining Guild Ladder") {
public void action() {
owner.setBusy(false);
owner.message(
......
package com.openrsc.server.plugins.itemactions;
import static com.openrsc.server.plugins.Functions.showBubble;
import com.openrsc.server.Server;
import com.openrsc.server.event.ShortEvent;
import com.openrsc.server.event.SingleEvent;
import com.openrsc.server.external.ItemId;
import com.openrsc.server.model.Point;
import com.openrsc.server.model.Skills;
import com.openrsc.server.model.container.Item;
import com.openrsc.server.model.entity.GameObject;
import com.openrsc.server.model.entity.player.Player;
import com.openrsc.server.model.world.World;
import com.openrsc.server.plugins.listeners.action.InvUseOnObjectListener;
import com.openrsc.server.plugins.listeners.executive.InvUseOnObjectExecutiveListener;
import com.openrsc.server.util.rsc.Formulae;
public class Cactus implements InvUseOnObjectListener,
InvUseOnObjectExecutiveListener {
/**
* World instance
*/
public static final World world = World.getWorld();
@Override
public boolean blockInvUseOnObject(GameObject obj, Item item, Player player) {
return obj.getID() == 35 && item.getID() == ItemId.KNIFE.id();
}
@Override
public void onInvUseOnObject(GameObject object, final Item item, Player player) {
if (item.getID() != ItemId.KNIFE.id()) {
player.message("Nothing interesting happens");
return;
}
player.message("You use your woodcutting skill to extract some water from the cactus.");
int[] skins = {ItemId.WATER_SKIN_MOSTLY_FULL.id(), ItemId.WATER_SKIN_MOSTLY_EMPTY.id(),
ItemId.WATER_SKIN_MOUTHFUL_LEFT.id(), ItemId.EMPTY_WATER_SKIN.id()};
showBubble(player, item);
player.setBusy(true);
Server.getServer().getEventHandler()
.add(new ShortEvent(player) {
public void action() {
for (int s : skins) {
if (owner.getInventory().remove(s, 1) > -1) {
boolean fail = Formulae.cutCacti();
if (fail) {
owner.message("You make a mistake and fail to fill your waterskin.");
owner.incExp(Skills.WOODCUT, 4, true);
owner.getInventory().add(new Item(s, 1));
owner.setBusy(false);
return;
}
owner.message("You collect some precious water in your waterskin.");
// Add new skin to inventory
int newSkin = ItemId.EMPTY_WATER_SKIN.id();
if (s == ItemId.WATER_SKIN_MOSTLY_FULL.id()) newSkin = ItemId.FULL_WATER_SKIN.id();
else newSkin = s - 1; // More full is one less id number
owner.getInventory().add(new Item(newSkin, 1));
// Add dried cacti
Point loc = object.getLocation();
final GameObject cacti = new GameObject(loc, 1028, 0, 0);
world.registerGameObject(cacti);
// Remove healthy cacti
world.unregisterGameObject(object);
owner.incExp(Skills.WOODCUT, 100, true); // Woodcutting XP
// Swap cacti back after 30 seconds.
Server.getServer().getEventHandler().add(
new SingleEvent(null, 30000) {
@Override
public void action() {
if (cacti != null) {
World.getWorld().registerGameObject(new GameObject(loc, 35, 0, 0));
World.getWorld().unregisterGameObject(cacti);
}
}
}
);
} else continue; // None of this skin in the inventory, try next.
owner.setBusy(false);
return; // Completed action
}
owner.message("You need to have a non-full waterskin to contain the fluid.");
owner.setBusy(false);
return;
}
});
}
}
package com.openrsc.server.plugins.itemactions;
import com.openrsc.server.Server;
import com.openrsc.server.event.ShortEvent;
import com.openrsc.server.event.SingleEvent;
import com.openrsc.server.external.ItemId;
import com.openrsc.server.model.Point;
import com.openrsc.server.model.Skills;
import com.openrsc.server.model.container.Item;
import com.openrsc.server.model.entity.GameObject;
import com.openrsc.server.model.entity.player.Player;
import com.openrsc.server.model.world.World;
import com.openrsc.server.plugins.listeners.action.InvUseOnObjectListener;
import com.openrsc.server.plugins.listeners.executive.InvUseOnObjectExecutiveListener;
import com.openrsc.server.util.rsc.Formulae;
import static com.openrsc.server.plugins.Functions.showBubble;
public class Cactus implements InvUseOnObjectListener,
InvUseOnObjectExecutiveListener {
/**
* World instance
*/
public static final World world = World.getWorld();
@Override
public boolean blockInvUseOnObject(GameObject obj, Item item, Player player) {
return obj.getID() == 35 && item.getID() == ItemId.KNIFE.id();
}
@Override
public void onInvUseOnObject(GameObject object, final Item item, Player player) {
if (item.getID() != ItemId.KNIFE.id()) {
player.message("Nothing interesting happens");
return;
}
player.message("You use your woodcutting skill to extract some water from the cactus.");
int[] skins = {ItemId.WATER_SKIN_MOSTLY_FULL.id(), ItemId.WATER_SKIN_MOSTLY_EMPTY.id(),
ItemId.WATER_SKIN_MOUTHFUL_LEFT.id(), ItemId.EMPTY_WATER_SKIN.id()};
showBubble(player, item);
player.setBusy(true);
Server.getServer().getEventHandler()
.add(new ShortEvent(player, "Cactus Fill Waterskin") {
public void action() {
for (int s : skins) {
if (owner.getInventory().remove(s, 1) > -1) {
boolean fail = Formulae.cutCacti();
if (fail) {
owner.message("You make a mistake and fail to fill your waterskin.");
owner.incExp(Skills.WOODCUT, 4, true);
owner.getInventory().add(new Item(s, 1));
owner.setBusy(false);
return;
}
owner.message("You collect some precious water in your waterskin.");
// Add new skin to inventory
int newSkin = ItemId.EMPTY_WATER_SKIN.id();
if (s == ItemId.WATER_SKIN_MOSTLY_FULL.id()) newSkin = ItemId.FULL_WATER_SKIN.id();
else newSkin = s - 1; // More full is one less id number
owner.getInventory().add(new Item(newSkin, 1));
// Add dried cacti
Point loc = object.getLocation();
final GameObject cacti = new GameObject(loc, 1028, 0, 0);
world.registerGameObject(cacti);
// Remove healthy cacti
world.unregisterGameObject(object);
owner.incExp(Skills.WOODCUT, 100, true); // Woodcutting XP
// Swap cacti back after 30 seconds.
Server.getServer().getEventHandler().add(
new SingleEvent(null, 30000, "Cactus Respawn") {
@Override
public void action() {
if (cacti != null) {
World.getWorld().registerGameObject(new GameObject(loc, 35, 0, 0));
World.getWorld().unregisterGameObject(cacti);
}
}
}
);
} else continue; // None of this skin in the inventory, try next.
owner.setBusy(false);
return; // Completed action
}
owner.message("You need to have a non-full waterskin to contain the fluid.");
owner.setBusy(false);
return;
}
});
}
}
......@@ -88,7 +88,7 @@ public class InvUseOnItem implements InvUseOnItemListener, InvUseOnItemExecutive
if (player.getInventory().remove(new Item(ItemId.DAMP_STICKS.id())) > -1) {
player.message("you hold the glass to the sun");
player.message("above the damp sticks");
Server.getServer().getEventHandler().add(new ShortEvent(player) {
Server.getServer().getEventHandler().add(new ShortEvent(player, "Dry Sticks with Lens") {
public void action() {
owner.message("the glass acts like a lens");
owner.message("and drys the sticks out");
......
......@@ -34,7 +34,7 @@ public class Refill implements InvUseOnObjectListener,
if (REFILLABLE[i] == item.getID()) {
final int itemID = item.getID();
final int refilledID = REFILLED[i];
player.setBatchEvent(new BatchEvent(player, 600, player.getInventory().countId(itemID), false) {
player.setBatchEvent(new BatchEvent(player, 600, "Refill Water Jug", player.getInventory().countId(itemID), false) {
@Override
public void action() {
if (removeItem(owner, itemID, 1)) {
......
package com.openrsc.server.plugins.itemactions;
import static com.openrsc.server.plugins.Functions.addItem;
import static com.openrsc.server.plugins.Functions.removeItem;
import static com.openrsc.server.plugins.Functions.showBubble;
import static com.openrsc.server.plugins.Functions.sleep;
import com.openrsc.server.event.custom.BatchEvent;
import com.openrsc.server.external.ItemId;
import com.openrsc.server.model.container.Item;
import com.openrsc.server.model.entity.GameObject;
import com.openrsc.server.model.entity.player.Player;
import com.openrsc.server.plugins.listeners.action.InvUseOnObjectListener;
import com.openrsc.server.plugins.listeners.executive.InvUseOnObjectExecutiveListener;
public class SandPit implements InvUseOnObjectListener,
InvUseOnObjectExecutiveListener {
@Override
public boolean blockInvUseOnObject(GameObject obj, Item item, Player player) {
return obj.getID() == 302 && item.getID() == ItemId.BUCKET.id();
}
@Override
public void onInvUseOnObject(GameObject obj, final Item item, Player player) {
final int itemID = item.getID();
final int refilledID = ItemId.SAND.id();
if (item.getID() != ItemId.BUCKET.id()) {
player.message("Nothing interesting happens");
return;
}
player.setBatchEvent(new BatchEvent(player, 600, player.getInventory().countId(itemID), true) {
@Override
public void action() {
if (removeItem(owner, itemID, 1)) {
showBubble(owner, item);
sleep(300);
owner.message("you fill the bucket with sand");
addItem(owner, refilledID, 1);
} else {
interrupt();
}
}
});
}
}
package com.openrsc.server.plugins.itemactions;
import com.openrsc.server.event.custom.BatchEvent;
import com.openrsc.server.external.ItemId;
import com.openrsc.server.model.container.Item;
import com.openrsc.server.model.entity.GameObject;
import com.openrsc.server.model.entity.player.Player;
import com.openrsc.server.plugins.listeners.action.InvUseOnObjectListener;
import com.openrsc.server.plugins.listeners.executive.InvUseOnObjectExecutiveListener;
import static com.openrsc.server.plugins.Functions.*;
public class SandPit implements InvUseOnObjectListener,
InvUseOnObjectExecutiveListener {
@Override
public boolean blockInvUseOnObject(GameObject obj, Item item, Player player) {
return obj.getID() == 302 && item.getID() == ItemId.BUCKET.id();
}
@Override
public void onInvUseOnObject(GameObject obj, final Item item, Player player) {
final int itemID = item.getID();
final int refilledID = ItemId.SAND.id();
if (item.getID() != ItemId.BUCKET.id()) {
player.message("Nothing interesting happens");
return;
}
player.setBatchEvent(new BatchEvent(player, 600, "Fill Bucket with Sand", player.getInventory().countId(itemID), true) {
@Override
public void action() {
if (removeItem(owner, itemID, 1)) {
showBubble(owner, item);
sleep(300);
owner.message("you fill the bucket with sand");
addItem(owner, refilledID, 1);
} else {
interrupt();
}
}
});
}
}
......@@ -36,7 +36,7 @@ public class SeersPartyChest implements InvUseOnObjectExecutiveListener, InvUseO
}
ActionSender.sendMessage(player, null, 0, MessageType.QUEST, "You place the item into the chest...", 0);
Server.getServer().getEventHandler().add(new SingleEvent(player, DataConversions.random(0,5000), true) {
Server.getServer().getEventHandler().add(new SingleEvent(player, DataConversions.random(0,5000), "Seers Party Hall Drop Delay", true) {
@Override
public void action() {
Random rand = DataConversions.getRandom();
......
......@@ -57,7 +57,7 @@ public class SpinningWheel implements InvUseOnObjectListener,
if (produce == -1 || requirement == -1 || exp == -1) {
return;
}
player.setBatchEvent(new BatchEvent(player, 600, Formulae
player.setBatchEvent(new BatchEvent(player, 600, "Spinning Wheel", Formulae
.getRepeatTimes(player, Skills.CRAFTING), false) {
@Override
public void action() {
......
......@@ -66,7 +66,7 @@ public class BabyBlueDragonCrystal implements InvActionListener, InvActionExecut
player.getInventory().add(new Item(ItemId.A_GLOWING_RED_CRYSTAL.id()));
sleep(Constants.GameServer.GAME_TICK);
player.message("You summon your pet.");
Server.getServer().getEventHandler().add(new ShortEvent(player) {
Server.getServer().getEventHandler().add(new ShortEvent(player, "Baby Blue Dragon Crystal Pet") {
public void action() {
player.setBusy(true);
final Npc petDragon = spawnNpc(NpcId.BABY_BLUE_DRAGON.id(), player.getX() + 1, player.getY(), 1000 * 60 * 24, player); // spawns for 5 hours and then poof!
......
package com.openrsc.server.plugins.minigames.mage_arena;
import com.openrsc.server.Constants;
import com.openrsc.server.Server;
import com.openrsc.server.event.DelayedEvent;
import com.openrsc.server.event.rsc.impl.ObjectRemover;
......@@ -15,14 +16,15 @@ import com.openrsc.server.model.entity.player.Player;
import com.openrsc.server.model.world.World;
import com.openrsc.server.net.rsc.ActionSender;
import com.openrsc.server.plugins.MiniGameInterface;
import com.openrsc.server.plugins.listeners.action.*;
import com.openrsc.server.plugins.listeners.action.ObjectActionListener;
import com.openrsc.server.plugins.listeners.action.PickupListener;
import com.openrsc.server.plugins.listeners.action.PlayerKilledNpcListener;
import com.openrsc.server.plugins.listeners.action.TalkToNpcListener;
import com.openrsc.server.plugins.listeners.executive.*;
import static com.openrsc.server.plugins.Functions.*;
import java.util.Optional;
import com.openrsc.server.Constants;
import static com.openrsc.server.plugins.Functions.*;
public class MageArena implements MiniGameInterface, TalkToNpcExecutiveListener, TalkToNpcListener, PlayerKilledNpcListener,
PlayerKilledNpcExecutiveListener, PlayerAttackNpcExecutiveListener, PlayerDeathExecutiveListener,
......@@ -206,7 +208,7 @@ public class MageArena implements MiniGameInterface, TalkToNpcExecutiveListener,
public void learnSpellEvent(Player p) {
DelayedEvent mageArena = p.getAttribute("mageArenaEvent", null);
DelayedEvent mageArenaEvent = new DelayedEvent(p, 1900) {
DelayedEvent mageArenaEvent = new DelayedEvent(p, 1900, "Mage Arena Learn Spell Event") {
@Override
public void run() {
/* Player logged out. */
......@@ -269,7 +271,7 @@ public class MageArena implements MiniGameInterface, TalkToNpcExecutiveListener,
private void startKolodionEvent(Player p) {
DelayedEvent kolE = p.getAttribute("kolodionEvent", null);
DelayedEvent kolodionEvent = new DelayedEvent(p, 650) {
DelayedEvent kolodionEvent = new DelayedEvent(p, 650, "Mage Arena Kolodion Event") {
@Override
public void run() {
Npc npc = owner.getAttribute("spawned_kolodion");
......
......@@ -12,13 +12,7 @@ import com.openrsc.server.net.rsc.ActionSender;
import com.openrsc.server.plugins.listeners.action.InvUseOnNpcListener;
import com.openrsc.server.plugins.listeners.executive.InvUseOnNpcExecutiveListener;
import static com.openrsc.server.plugins.Functions.addItem;
import static com.openrsc.server.plugins.Functions.getMultipleNpcsInArea;
import static com.openrsc.server.plugins.Functions.message;
import static com.openrsc.server.plugins.Functions.npcYell;
import static com.openrsc.server.plugins.Functions.random;
import static com.openrsc.server.plugins.Functions.removeItem;
import static com.openrsc.server.plugins.Functions.showBubble;
import static com.openrsc.server.plugins.Functions.*;
public class AceArcher implements InvUseOnNpcListener, InvUseOnNpcExecutiveListener {
......@@ -43,7 +37,7 @@ public class AceArcher implements InvUseOnNpcListener, InvUseOnNpcExecutiveListe
player.message("You attempt to put the baby blue dragon in the crystal.");
npc.setBusyTimer(1600);
Server.getServer().getEventHandler().add(new ShortEvent(player) {
Server.getServer().getEventHandler().add(new ShortEvent(player, "Ace Archer Pet") {
public void action() {
if (npc.getPetOwnerA2() != player) {
//player.message("That's someone elses pet!");
......
......@@ -12,13 +12,7 @@ import com.openrsc.server.net.rsc.ActionSender;
import com.openrsc.server.plugins.listeners.action.InvUseOnNpcListener;
import com.openrsc.server.plugins.listeners.executive.InvUseOnNpcExecutiveListener;
import static com.openrsc.server.plugins.Functions.addItem;
import static com.openrsc.server.plugins.Functions.getMultipleNpcsInArea;
import static com.openrsc.server.plugins.Functions.message;