Bugfixes + client logo
This commit is contained in:
@@ -1,39 +0,0 @@
|
|||||||
package core.game.interaction.item;
|
|
||||||
|
|
||||||
import core.cache.def.impl.ItemDefinition;
|
|
||||||
import core.game.interaction.OptionHandler;
|
|
||||||
import core.game.node.Node;
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
import core.plugin.Initializable;
|
|
||||||
import core.plugin.Plugin;
|
|
||||||
import rs09.game.interaction.Listeners;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the plugin used for the quest cape and hood item.
|
|
||||||
* @author 'Vexia
|
|
||||||
*/
|
|
||||||
@Initializable
|
|
||||||
public final class QuestCapePlugin extends OptionHandler {
|
|
||||||
final int MAX_QP = 72;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
|
||||||
ItemDefinition.forId(9813).getHandlers().put("option:wear", this);
|
|
||||||
ItemDefinition.forId(9814).getHandlers().put("option:wear", this);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handle(Player player, Node node, String option) {
|
|
||||||
if (!(player.getQuestRepository().getPoints() >= MAX_QP)) {
|
|
||||||
player.getPacketDispatch().sendMessage("You cannot wear this " + node.getName().toLowerCase() + " yet.");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return Listeners.run(node.getId(),0,"equip",player,node);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isWalk() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -330,7 +330,6 @@ public final class SummoningTrainingRoom extends OptionHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(int interfaceId, int buttonId) {
|
public boolean handle(int interfaceId, int buttonId) {
|
||||||
player.sendMessage("ButtonId=" + buttonId + ", stage=" + stage);
|
|
||||||
switch (quest.getStage(player)) {
|
switch (quest.getStage(player)) {
|
||||||
case 10:
|
case 10:
|
||||||
switch (stage) {
|
switch (stage) {
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package rs09.game.interaction.item
|
||||||
|
|
||||||
|
import core.game.node.entity.player.link.quest.QuestRepository
|
||||||
|
import rs09.game.interaction.InteractionListener
|
||||||
|
import rs09.game.interaction.Listeners.run
|
||||||
|
|
||||||
|
class QuestCapeListener : InteractionListener() {
|
||||||
|
|
||||||
|
val IDs = intArrayOf(9813,9814)
|
||||||
|
|
||||||
|
override fun defineListeners() {
|
||||||
|
on(IDs,ITEM,"wear"){ player, item ->
|
||||||
|
val MAX_QP = QuestRepository.getQuests().values.sumBy { it.questPoints }
|
||||||
|
if (player.questRepository.points < MAX_QP) {
|
||||||
|
player.packetDispatch.sendMessage("You cannot wear this " + item.name.toLowerCase() + " yet.")
|
||||||
|
return@on true
|
||||||
|
}
|
||||||
|
return@on run(item.id, 0, "equip", player, item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user