diff --git a/src/org/apollo/game/event/impl/FirstNpcActionEvent.java b/src/org/apollo/game/event/impl/FirstNpcActionEvent.java index b0cf28ad..ea26e8af 100644 --- a/src/org/apollo/game/event/impl/FirstNpcActionEvent.java +++ b/src/org/apollo/game/event/impl/FirstNpcActionEvent.java @@ -10,10 +10,10 @@ public class FirstNpcActionEvent extends NpcActionEvent { /** * Creates a new first npc action event. * - * @param npcIndex The index of the npc. + * @param index The index of the npc. */ - public FirstNpcActionEvent(int npcIndex) { - super(1, npcIndex); + public FirstNpcActionEvent(int index) { + super(1, index); } } \ No newline at end of file diff --git a/src/org/apollo/game/event/impl/NpcActionEvent.java b/src/org/apollo/game/event/impl/NpcActionEvent.java index 405aea74..c27fdc20 100644 --- a/src/org/apollo/game/event/impl/NpcActionEvent.java +++ b/src/org/apollo/game/event/impl/NpcActionEvent.java @@ -17,17 +17,17 @@ public class NpcActionEvent extends Event { /** * The npc index. */ - private final int npcIndex; + private final int index; /** * Creates a new npc action event. * * @param action The action number. - * @param npcIndex The index of the npc. + * @param index The index of the npc. */ - public NpcActionEvent(int action, int npcIndex) { + public NpcActionEvent(int action, int index) { this.action = action; - this.npcIndex = npcIndex; + this.index = index; } /** @@ -45,7 +45,7 @@ public class NpcActionEvent extends Event { * @return The npc index. */ public int getNpcIndex() { - return npcIndex; + return index; } } \ No newline at end of file diff --git a/src/org/apollo/game/event/impl/SecondNpcActionEvent.java b/src/org/apollo/game/event/impl/SecondNpcActionEvent.java index afbc268b..d27a45fe 100644 --- a/src/org/apollo/game/event/impl/SecondNpcActionEvent.java +++ b/src/org/apollo/game/event/impl/SecondNpcActionEvent.java @@ -10,10 +10,10 @@ public class SecondNpcActionEvent extends NpcActionEvent { /** * Creates a new second npc action event. * - * @param npcIndex The index of the npc. + * @param index The index of the npc. */ - public SecondNpcActionEvent(int npcIndex) { - super(2, npcIndex); + public SecondNpcActionEvent(int index) { + super(2, index); } } \ No newline at end of file diff --git a/src/org/apollo/game/event/impl/ThirdNpcActionEvent.java b/src/org/apollo/game/event/impl/ThirdNpcActionEvent.java index 42328b5a..8cc45896 100644 --- a/src/org/apollo/game/event/impl/ThirdNpcActionEvent.java +++ b/src/org/apollo/game/event/impl/ThirdNpcActionEvent.java @@ -10,10 +10,10 @@ public class ThirdNpcActionEvent extends NpcActionEvent { /** * Creates a new third npc action event. * - * @param npcIndex The index of the npc. + * @param index The index of the npc. */ - public ThirdNpcActionEvent(int npcIndex) { - super(3, npcIndex); + public ThirdNpcActionEvent(int index) { + super(3, index); } } \ No newline at end of file diff --git a/src/org/apollo/game/model/InterfaceConstants.java b/src/org/apollo/game/model/InterfaceConstants.java index 53dfa5a2..1a5f47f2 100644 --- a/src/org/apollo/game/model/InterfaceConstants.java +++ b/src/org/apollo/game/model/InterfaceConstants.java @@ -31,11 +31,6 @@ public class InterfaceConstants { */ public static final int QUEST_SCROLL_PANE = 8143; - /** - * The quest title widget id. - */ - public static final int QUEST_TITLE = 8144; - /** * The array of widgets that display the text. */ @@ -47,6 +42,11 @@ public class InterfaceConstants { 12201, 12202, 12203, 12204, 12205, 12206, 12207, 12208, 12209, 12210, 12211, 12212, 12213, 12214, 12215, 12216, 12217, 12218, 12219, 12220, 12221, 12222, 12223 }; + /** + * The quest title widget id. + */ + public static final int QUEST_TITLE = 8144; + /** * Prevent instantiation. */ diff --git a/src/org/apollo/game/model/Player.java b/src/org/apollo/game/model/Player.java index f2a1cf43..3ce364ae 100644 --- a/src/org/apollo/game/model/Player.java +++ b/src/org/apollo/game/model/Player.java @@ -108,11 +108,6 @@ public final class Player extends Character { */ private boolean designedCharacter = false; - /** - * The player's run energy. - */ - private int runEnergy = 100; - /** * A flag which indicates there are npcs that couldn't be added. */ @@ -163,6 +158,11 @@ public final class Player extends Character { */ private boolean regionChanged = false; + /** + * The player's run energy. + */ + private int runEnergy = 100; + /** * A flag indicating if this player is running. */ @@ -299,6 +299,15 @@ public final class Player extends Character { return privilegeLevel; } + /** + * Gets the player's run energy. + * + * @return The run energy. + */ + public int getRunEnergy() { + return runEnergy; + } + /** * Gets the game session. * @@ -619,6 +628,15 @@ public final class Player extends Character { this.regionChanged = regionChanged; } + /** + * Sets the player's run energy. + * + * @param runEnergy The energy. + */ + public void setRunEnergy(int runEnergy) { + this.runEnergy = runEnergy; + } + /** * Sets the player's {@link GameSession}. * @@ -665,22 +683,4 @@ public final class Player extends Character { + privilegeLevel + "]"; } - /** - * Gets the player's run energy. - * - * @return The run energy. - */ - public int getRunEnergy() { - return runEnergy; - } - - /** - * Sets the player's run energy. - * - * @param runEnergy The energy. - */ - public void setRunEnergy(int runEnergy) { - this.runEnergy = runEnergy; - } - } \ No newline at end of file diff --git a/src/org/apollo/net/release/r317/FirstNpcActionEventDecoder.java b/src/org/apollo/net/release/r317/FirstNpcActionEventDecoder.java new file mode 100644 index 00000000..d0b1cdba --- /dev/null +++ b/src/org/apollo/net/release/r317/FirstNpcActionEventDecoder.java @@ -0,0 +1,24 @@ +package org.apollo.net.release.r317; + +import org.apollo.game.event.impl.FirstNpcActionEvent; +import org.apollo.net.codec.game.DataTransformation; +import org.apollo.net.codec.game.DataType; +import org.apollo.net.codec.game.GamePacket; +import org.apollo.net.codec.game.GamePacketReader; +import org.apollo.net.release.EventDecoder; + +/** + * The {@link EventDecoder} for the {@link FirstNpcActionEvent}. + * + * @author Major + */ +public class FirstNpcActionEventDecoder extends EventDecoder { + + @Override + public FirstNpcActionEvent decode(GamePacket packet) { + GamePacketReader reader = new GamePacketReader(packet); + int index = (int) reader.getUnsigned(DataType.SHORT, DataTransformation.ADD); + return new FirstNpcActionEvent(index); + } + +} \ No newline at end of file diff --git a/src/org/apollo/net/release/r317/SecondNpcActionEventDecoder.java b/src/org/apollo/net/release/r317/SecondNpcActionEventDecoder.java new file mode 100644 index 00000000..e37dde9b --- /dev/null +++ b/src/org/apollo/net/release/r317/SecondNpcActionEventDecoder.java @@ -0,0 +1,24 @@ +package org.apollo.net.release.r317; + +import org.apollo.game.event.impl.SecondNpcActionEvent; +import org.apollo.net.codec.game.DataOrder; +import org.apollo.net.codec.game.DataType; +import org.apollo.net.codec.game.GamePacket; +import org.apollo.net.codec.game.GamePacketReader; +import org.apollo.net.release.EventDecoder; + +/** + * The {@link EventDecoder} for the {@link SecondNpcActionEvent}. + * + * @author Major + */ +public class SecondNpcActionEventDecoder extends EventDecoder { + + @Override + public SecondNpcActionEvent decode(GamePacket packet) { + GamePacketReader reader = new GamePacketReader(packet); + int index = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE); + return new SecondNpcActionEvent(index); + } + +} \ No newline at end of file diff --git a/src/org/apollo/net/release/r317/ThirdNpcActionEventDecoder.java b/src/org/apollo/net/release/r317/ThirdNpcActionEventDecoder.java new file mode 100644 index 00000000..fcd87bd6 --- /dev/null +++ b/src/org/apollo/net/release/r317/ThirdNpcActionEventDecoder.java @@ -0,0 +1,25 @@ +package org.apollo.net.release.r317; + +import org.apollo.game.event.impl.ThirdNpcActionEvent; +import org.apollo.net.codec.game.DataOrder; +import org.apollo.net.codec.game.DataTransformation; +import org.apollo.net.codec.game.DataType; +import org.apollo.net.codec.game.GamePacket; +import org.apollo.net.codec.game.GamePacketReader; +import org.apollo.net.release.EventDecoder; + +/** + * The {@link EventDecoder} for the {@link ThirdNpcActionEvent}. + * + * @author Major + */ +public class ThirdNpcActionEventDecoder extends EventDecoder { + + @Override + public ThirdNpcActionEvent decode(GamePacket packet) { + GamePacketReader reader = new GamePacketReader(packet); + int index = (int) reader.getUnsigned(DataType.SHORT, DataOrder.LITTLE, DataTransformation.ADD); + return new ThirdNpcActionEvent(index); + } + +} \ No newline at end of file diff --git a/src/org/apollo/util/plugin/PluginManager.java b/src/org/apollo/util/plugin/PluginManager.java index c2ccc821..e19c7b2f 100644 --- a/src/org/apollo/util/plugin/PluginManager.java +++ b/src/org/apollo/util/plugin/PluginManager.java @@ -44,15 +44,6 @@ public final class PluginManager { initAuthors(); } - /** - * Creates an unmodifiable {@link Set} containing the authors. - * - * @return The set. - */ - public Set getAuthors() { - return Collections.unmodifiableSortedSet(authors); - } - /** * Creates a plugin map from a collection. * @@ -98,6 +89,15 @@ public final class PluginManager { return Collections.unmodifiableCollection(plugins); } + /** + * Creates an unmodifiable {@link Set} containing the authors. + * + * @return The set. + */ + public Set getAuthors() { + return Collections.unmodifiableSortedSet(authors); + } + /** * Populates the list with the authors of the Apollo core. */