Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package core.game.content.activity.duel;
|
package core.game.content.activity.duel;
|
||||||
|
|
||||||
|
import api.ContentAPI;
|
||||||
import core.game.component.CloseEvent;
|
import core.game.component.CloseEvent;
|
||||||
import core.game.component.Component;
|
import core.game.component.Component;
|
||||||
import core.game.component.ComponentDefinition;
|
import core.game.component.ComponentDefinition;
|
||||||
@@ -16,6 +17,7 @@ import core.game.node.item.Item;
|
|||||||
import core.game.system.monitor.PlayerMonitor;
|
import core.game.system.monitor.PlayerMonitor;
|
||||||
import core.plugin.Plugin;
|
import core.plugin.Plugin;
|
||||||
import core.tools.RandomFunction;
|
import core.tools.RandomFunction;
|
||||||
|
import kotlin.Unit;
|
||||||
import rs09.game.content.global.action.EquipHandler;
|
import rs09.game.content.global.action.EquipHandler;
|
||||||
import rs09.game.system.config.ItemConfigParser;
|
import rs09.game.system.config.ItemConfigParser;
|
||||||
|
|
||||||
@@ -567,14 +569,10 @@ public final class DuelSession extends ComponentPlugin {
|
|||||||
amount = c.getAmount(c.get(slot));
|
amount = c.getAmount(c.get(slot));
|
||||||
break;
|
break;
|
||||||
case 234:
|
case 234:
|
||||||
player.setAttribute("runscript", new RunScript() {
|
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
||||||
@Override
|
c.withdraw(slot, (int) value);
|
||||||
public boolean handle() {
|
return Unit.INSTANCE;
|
||||||
c.withdraw(slot, (int) getValue());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
player.getDialogueInterpreter().sendInput(false, "Enter the amount:");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
c.withdraw(slot, amount);
|
c.withdraw(slot, amount);
|
||||||
@@ -688,14 +686,10 @@ public final class DuelSession extends ComponentPlugin {
|
|||||||
c1.offer(slot, player.getInventory().getAmount(player.getInventory().get(slot).getId()));
|
c1.offer(slot, player.getInventory().getAmount(player.getInventory().get(slot).getId()));
|
||||||
break;
|
break;
|
||||||
case 234:
|
case 234:
|
||||||
player.setAttribute("runscript", new RunScript() {
|
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
||||||
@Override
|
c1.offer(slot, (int) value);
|
||||||
public boolean handle() {
|
return Unit.INSTANCE;
|
||||||
c1.offer(slot, (int) getValue());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
player.getDialogueInterpreter().sendInput(false, "Enter the amount:");
|
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
player.getPacketDispatch().sendMessage(player.getInventory().get(slot).getDefinition().getExamine());
|
player.getPacketDispatch().sendMessage(player.getInventory().get(slot).getDefinition().getExamine());
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import api.ContentAPI;
|
||||||
import core.cache.def.impl.ObjectDefinition;
|
import core.cache.def.impl.ObjectDefinition;
|
||||||
import core.game.component.Component;
|
import core.game.component.Component;
|
||||||
import core.game.component.ComponentDefinition;
|
import core.game.component.ComponentDefinition;
|
||||||
@@ -21,6 +22,7 @@ import core.game.node.item.Item;
|
|||||||
import core.game.node.object.Scenery;
|
import core.game.node.object.Scenery;
|
||||||
import core.game.node.object.SceneryBuilder;
|
import core.game.node.object.SceneryBuilder;
|
||||||
import core.game.system.task.Pulse;
|
import core.game.system.task.Pulse;
|
||||||
|
import kotlin.Unit;
|
||||||
import rs09.game.world.GameWorld;
|
import rs09.game.world.GameWorld;
|
||||||
import core.game.world.map.Location;
|
import core.game.world.map.Location;
|
||||||
import core.game.world.update.flag.context.Animation;
|
import core.game.world.update.flag.context.Animation;
|
||||||
@@ -315,15 +317,10 @@ public final class PartyRoomPlugin extends OptionHandler {
|
|||||||
viewer.getContainer().addItem(slot, ammount);
|
viewer.getContainer().addItem(slot, ammount);
|
||||||
break;
|
break;
|
||||||
case 234:
|
case 234:
|
||||||
player.setAttribute("runscript", new RunScript() {
|
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
||||||
@Override
|
viewer.getContainer().addItem(slot, (int) value);
|
||||||
public boolean handle() {
|
return Unit.INSTANCE;
|
||||||
int ammount = (int) value;
|
|
||||||
viewer.getContainer().addItem(slot, ammount);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
player.getDialogueInterpreter().sendInput(false, "Enter the amount.");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -351,15 +348,10 @@ public final class PartyRoomPlugin extends OptionHandler {
|
|||||||
viewer.getContainer().takeItem(slot, ammount);
|
viewer.getContainer().takeItem(slot, ammount);
|
||||||
break;
|
break;
|
||||||
case 234:
|
case 234:
|
||||||
player.setAttribute("runscript", new RunScript() {
|
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
||||||
@Override
|
viewer.getContainer().takeItem(slot, (int) value);
|
||||||
public boolean handle() {
|
return Unit.INSTANCE;
|
||||||
int ammount = (int) value;
|
|
||||||
viewer.getContainer().takeItem(slot, ammount);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
player.getDialogueInterpreter().sendInput(false, "Enter the amount.");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import core.plugin.PluginManifest;
|
|||||||
import core.plugin.PluginType;
|
import core.plugin.PluginType;
|
||||||
import rs09.game.content.dialogue.DialogueFile;
|
import rs09.game.content.dialogue.DialogueFile;
|
||||||
import rs09.game.content.dialogue.EmptyPlugin;
|
import rs09.game.content.dialogue.EmptyPlugin;
|
||||||
|
import rs09.game.system.SystemLogger;
|
||||||
import rs09.game.system.config.ItemConfigParser;
|
import rs09.game.system.config.ItemConfigParser;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package core.game.content.dialogue;
|
package core.game.content.dialogue;
|
||||||
|
|
||||||
|
import api.ContentAPI;
|
||||||
import core.plugin.Initializable;
|
import core.plugin.Initializable;
|
||||||
import core.game.node.entity.skill.runecrafting.Altar;
|
import core.game.node.entity.skill.runecrafting.Altar;
|
||||||
import core.game.node.entity.skill.runecrafting.EnchantTiaraPulse;
|
import core.game.node.entity.skill.runecrafting.EnchantTiaraPulse;
|
||||||
@@ -8,6 +9,7 @@ import core.game.interaction.NodeUsageEvent;
|
|||||||
import core.game.node.entity.player.Player;
|
import core.game.node.entity.player.Player;
|
||||||
import core.game.node.entity.player.link.RunScript;
|
import core.game.node.entity.player.link.RunScript;
|
||||||
import core.game.node.object.Scenery;
|
import core.game.node.object.Scenery;
|
||||||
|
import kotlin.Unit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the enchant tiara dialogue.
|
* Represents the enchant tiara dialogue.
|
||||||
@@ -75,15 +77,10 @@ public final class EnchantTiaraDialogue extends DialoguePlugin {
|
|||||||
amt = 5;
|
amt = 5;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
player.setAttribute("runscript", new RunScript() {
|
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
||||||
@Override
|
player.getPulseManager().run(new EnchantTiaraPulse(player, event.getUsedItem(), Talisman.forItem(event.getUsedItem()).getTiara(), (int) value));
|
||||||
public boolean handle() {
|
return Unit.INSTANCE;
|
||||||
int ammount = (int) value;
|
|
||||||
player.getPulseManager().run(new EnchantTiaraPulse(player, event.getUsedItem(), (Talisman.forItem(event.getUsedItem()).getTiara()), ammount));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
player.getDialogueInterpreter().sendInput(false, "Enter the amount");
|
|
||||||
return true;
|
return true;
|
||||||
case 3:
|
case 3:
|
||||||
amt = player.getInventory().getAmount(event.getUsedItem());
|
amt = player.getInventory().getAmount(event.getUsedItem());
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package core.game.content.dialogue;
|
package core.game.content.dialogue;
|
||||||
|
|
||||||
|
import api.ContentAPI;
|
||||||
import core.cache.def.impl.ItemDefinition;
|
import core.cache.def.impl.ItemDefinition;
|
||||||
import core.game.component.Component;
|
import core.game.component.Component;
|
||||||
|
import kotlin.Unit;
|
||||||
import rs09.game.system.SystemLogger;
|
import rs09.game.system.SystemLogger;
|
||||||
import core.game.node.entity.skill.crafting.armour.DragonCraftPulse;
|
import core.game.node.entity.skill.crafting.armour.DragonCraftPulse;
|
||||||
import core.game.node.entity.skill.crafting.armour.HardCraftPulse;
|
import core.game.node.entity.skill.crafting.armour.HardCraftPulse;
|
||||||
@@ -109,15 +111,10 @@ public final class LeatherCraftDialogue extends DialoguePlugin {
|
|||||||
amt = 5;
|
amt = 5;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
player.setAttribute("runscript", new RunScript() {
|
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
||||||
@Override
|
player.getPulseManager().run(new HardCraftPulse(player, null, (int) value));
|
||||||
public boolean handle() {
|
return Unit.INSTANCE;
|
||||||
int ammount = (int) value;
|
|
||||||
player.getPulseManager().run(new HardCraftPulse(player, null, ammount));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
player.getDialogueInterpreter().sendInput(false, "Enter the amount");
|
|
||||||
return true;
|
return true;
|
||||||
case 2:
|
case 2:
|
||||||
amt = player.getInventory().getAmount(new Item(LeatherCrafting.HARD_LEATHER));
|
amt = player.getInventory().getAmount(new Item(LeatherCrafting.HARD_LEATHER));
|
||||||
@@ -208,14 +205,10 @@ public final class LeatherCraftDialogue extends DialoguePlugin {
|
|||||||
if (hidee == null) {
|
if (hidee == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
player.setAttribute("runscript", new RunScript() {
|
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
||||||
@Override
|
player.getPulseManager().run(new DragonCraftPulse(player, null, hidee, (int) value));
|
||||||
public boolean handle() {
|
return Unit.INSTANCE;
|
||||||
player.getPulseManager().run(new DragonCraftPulse(player, null, hidee, (int) getValue()));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
player.getDialogueInterpreter().sendInput(false, "Enter amount:");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (hide == null) {
|
if (hide == null) {
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
package core.game.content.dialogue;
|
package core.game.content.dialogue;
|
||||||
|
|
||||||
|
import api.ContentAPI;
|
||||||
import core.game.node.entity.player.Player;
|
import core.game.node.entity.player.Player;
|
||||||
import core.game.node.entity.player.link.RunScript;
|
import core.game.node.entity.player.link.RunScript;
|
||||||
import core.plugin.Initializable;
|
import core.plugin.Initializable;
|
||||||
|
import kotlin.Unit;
|
||||||
import rs09.game.content.dialogue.SkillDialogueHandler;
|
import rs09.game.content.dialogue.SkillDialogueHandler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -56,13 +58,9 @@ public class SkillDialoguePlugin extends DialoguePlugin {
|
|||||||
if (amount != -1) {
|
if (amount != -1) {
|
||||||
handler.create(amount, index);
|
handler.create(amount, index);
|
||||||
} else {
|
} else {
|
||||||
player.getDialogueInterpreter().sendInput(false, "Enter the amount:");
|
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
||||||
player.setAttribute("runscript", new RunScript() {
|
handler.create((int) value, index);
|
||||||
@Override
|
return Unit.INSTANCE;
|
||||||
public boolean handle() {
|
|
||||||
handler.create((int) getValue(), index);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package core.game.interaction.city;
|
package core.game.interaction.city;
|
||||||
|
|
||||||
|
import api.ContentAPI;
|
||||||
import core.cache.def.impl.NPCDefinition;
|
import core.cache.def.impl.NPCDefinition;
|
||||||
import core.cache.def.impl.ObjectDefinition;
|
import core.cache.def.impl.ObjectDefinition;
|
||||||
import core.game.component.Component;
|
import core.game.component.Component;
|
||||||
@@ -35,6 +36,7 @@ import core.plugin.Initializable;
|
|||||||
import core.plugin.Plugin;
|
import core.plugin.Plugin;
|
||||||
import core.tools.RandomFunction;
|
import core.tools.RandomFunction;
|
||||||
import core.tools.StringUtils;
|
import core.tools.StringUtils;
|
||||||
|
import kotlin.Unit;
|
||||||
import rs09.game.content.global.travel.EssenceTeleport;
|
import rs09.game.content.global.travel.EssenceTeleport;
|
||||||
import rs09.game.world.GameWorld;
|
import rs09.game.world.GameWorld;
|
||||||
import rs09.plugin.PluginManager;
|
import rs09.plugin.PluginManager;
|
||||||
@@ -686,14 +688,9 @@ public final class WizardTowerPlugin extends OptionHandler {
|
|||||||
}
|
}
|
||||||
final int amount = getAmt(buttonId);
|
final int amount = getAmt(buttonId);
|
||||||
if (amount == -1) {// rscript.
|
if (amount == -1) {// rscript.
|
||||||
player.getDialogueInterpreter().sendInput(false, "Enter amount:");
|
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
||||||
player.setAttribute("runscript", new RunScript() {
|
make(bark, (int) value);
|
||||||
@Override
|
return Unit.INSTANCE;
|
||||||
public boolean handle() {
|
|
||||||
final int amt = (int) getValue();
|
|
||||||
make(bark, amt);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package core.game.interaction.inter;
|
package core.game.interaction.inter;
|
||||||
|
|
||||||
|
import api.ContentAPI;
|
||||||
import core.game.component.Component;
|
import core.game.component.Component;
|
||||||
import core.game.component.ComponentDefinition;
|
import core.game.component.ComponentDefinition;
|
||||||
import core.game.component.ComponentPlugin;
|
import core.game.component.ComponentPlugin;
|
||||||
@@ -12,6 +13,7 @@ import core.net.amsc.WorldCommunicator;
|
|||||||
import core.plugin.Initializable;
|
import core.plugin.Initializable;
|
||||||
import core.plugin.Plugin;
|
import core.plugin.Plugin;
|
||||||
import core.tools.StringUtils;
|
import core.tools.StringUtils;
|
||||||
|
import kotlin.Unit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the plugin used to handle the clan interfaces.
|
* Represents the plugin used to handle the clan interfaces.
|
||||||
@@ -93,27 +95,23 @@ public final class ClanInterfacePlugin extends ComponentPlugin {
|
|||||||
clan.clean(true);
|
clan.clean(true);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
player.setAttribute("runscript", new RunScript() {
|
ContentAPI.sendInputDialogue(player, false, "Enter clan prefix:", (value) -> {
|
||||||
@Override
|
String name = StringUtils.formatDisplayName((String) value);
|
||||||
public boolean handle() {
|
ContentAPI.setInterfaceText(player, name, 590, 22);
|
||||||
String name = StringUtils.formatDisplayName((String) value);
|
if(WorldCommunicator.isEnabled()){
|
||||||
player.getPacketDispatch().sendString(name, 590, 22);//30
|
MSPacketRepository.sendClanRename(player, name);
|
||||||
if (WorldCommunicator.isEnabled()) {
|
|
||||||
MSPacketRepository.sendClanRename(player, name);
|
|
||||||
clan.setName(name);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (clan.getName().equals("Chat disabled")) {
|
|
||||||
player.getPacketDispatch().sendMessage("Your clan channel has now been enabled!");
|
|
||||||
player.getPacketDispatch().sendMessage("Join your channel by clicking 'Join Chat' and typing: " + player.getUsername());
|
|
||||||
}
|
|
||||||
clan.setName(name);
|
clan.setName(name);
|
||||||
player.getCommunication().setClanName(name);
|
return Unit.INSTANCE;
|
||||||
clan.update();
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
if (clan.getName().equals("Chat disabled")) {
|
||||||
|
player.getPacketDispatch().sendMessage("Your clan channel has now been enabled!");
|
||||||
|
player.getPacketDispatch().sendMessage("Join your channel by clicking 'Join Chat' and typing: " + player.getUsername());
|
||||||
|
}
|
||||||
|
clan.setName(name);
|
||||||
|
player.getCommunication().setClanName(name);
|
||||||
|
clan.update();
|
||||||
|
return Unit.INSTANCE;
|
||||||
});
|
});
|
||||||
player.getDialogueInterpreter().sendInput(true, "Enter clan prefix:");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package core.game.interaction.inter;
|
package core.game.interaction.inter;
|
||||||
|
|
||||||
|
import api.ContentAPI;
|
||||||
import core.game.component.Component;
|
import core.game.component.Component;
|
||||||
import core.game.component.ComponentDefinition;
|
import core.game.component.ComponentDefinition;
|
||||||
import core.game.component.ComponentPlugin;
|
import core.game.component.ComponentPlugin;
|
||||||
@@ -12,6 +13,7 @@ import core.game.system.task.Pulse;
|
|||||||
import core.game.world.update.flag.context.Animation;
|
import core.game.world.update.flag.context.Animation;
|
||||||
import core.plugin.Initializable;
|
import core.plugin.Initializable;
|
||||||
import core.plugin.Plugin;
|
import core.plugin.Plugin;
|
||||||
|
import kotlin.Unit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the glass making interface plugin.
|
* Represents the glass making interface plugin.
|
||||||
@@ -72,15 +74,10 @@ public final class GlassInterface extends ComponentPlugin {
|
|||||||
real = p.getInventory().getAmount(MOLTEN_GLASS);
|
real = p.getInventory().getAmount(MOLTEN_GLASS);
|
||||||
break;
|
break;
|
||||||
case 211:
|
case 211:
|
||||||
p.setAttribute("runscript", new RunScript() {
|
ContentAPI.sendInputDialogue(p, true, "Enter the amount:", (value) -> {
|
||||||
@Override
|
make(p, def, (int) value);
|
||||||
public boolean handle() {
|
return Unit.INSTANCE;
|
||||||
int ammount = (int) value;
|
|
||||||
make(p, def, ammount);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
p.getDialogueInterpreter().sendInput(false, "Enter the amount.");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (opcode == 211) {
|
if (opcode == 211) {
|
||||||
|
|||||||
@@ -1,122 +0,0 @@
|
|||||||
package core.game.interaction.inter;
|
|
||||||
|
|
||||||
import core.cache.def.impl.ItemDefinition;
|
|
||||||
import core.game.component.Component;
|
|
||||||
import core.game.component.ComponentDefinition;
|
|
||||||
import core.game.component.ComponentPlugin;
|
|
||||||
import core.game.node.entity.player.link.diary.DiaryType;
|
|
||||||
import core.game.world.map.Location;
|
|
||||||
import core.plugin.Initializable;
|
|
||||||
import core.game.node.entity.skill.Skills;
|
|
||||||
import core.game.node.entity.skill.crafting.SilverProduct;
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
import core.game.node.entity.player.link.RunScript;
|
|
||||||
import core.game.node.item.Item;
|
|
||||||
import core.game.system.task.Pulse;
|
|
||||||
import rs09.game.world.GameWorld;
|
|
||||||
import core.game.world.update.flag.context.Animation;
|
|
||||||
import core.plugin.Plugin;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the silver crafting making interface.
|
|
||||||
* @author 'Vexia
|
|
||||||
*/
|
|
||||||
@Initializable
|
|
||||||
public final class SilverInterface extends ComponentPlugin {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the silver bar item.
|
|
||||||
*/
|
|
||||||
private static final Item SILVER_BAR = new Item(2355);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
|
||||||
ComponentDefinition.put(438, this);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handle(final Player p, Component component, int opcode, int button, int slot, int itemId) {
|
|
||||||
final SilverProduct silver = SilverProduct.forId(button);
|
|
||||||
if (silver == null) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (!p.getInventory().contains(silver.getNeeded(), 1)) {
|
|
||||||
p.getPacketDispatch().sendMessage("You need a " + ItemDefinition.forId(silver.getNeeded()).getName().toLowerCase() + " to make this item.");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (silver == SilverProduct.SILVTHRIL_ROD) {
|
|
||||||
p.getPacketDispatch().sendMessage("You can't do that yet.");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (p.getSkills().getLevel(Skills.CRAFTING) < silver.getLevel()) {
|
|
||||||
p.getPacketDispatch().sendMessage("You need a crafting level of " + silver.getLevel() + " to make this.");
|
|
||||||
}
|
|
||||||
int amt = -1;
|
|
||||||
switch (opcode) {
|
|
||||||
case 155:
|
|
||||||
amt = 1;
|
|
||||||
break;
|
|
||||||
case 196:
|
|
||||||
amt = 5;
|
|
||||||
break;
|
|
||||||
case 124:
|
|
||||||
amt = p.getInventory().getAmount(new Item(2355));
|
|
||||||
break;
|
|
||||||
case 199:
|
|
||||||
p.setAttribute("runscript", new RunScript() {
|
|
||||||
@Override
|
|
||||||
public boolean handle() {
|
|
||||||
int ammount = (int) value;
|
|
||||||
make(p, silver, ammount);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
p.getDialogueInterpreter().sendInput(false, "Enter the amount.");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
make(p, silver, amt);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void make(final Player player, final SilverProduct def, final int ammount) {
|
|
||||||
if (!player.getInventory().containsItem(SILVER_BAR)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
player.getInterfaceManager().close();
|
|
||||||
GameWorld.getPulser().submit(new Pulse(1, player) {
|
|
||||||
int amt = ammount;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean pulse() {
|
|
||||||
if (amt < 1) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (!player.getInventory().contains(def.getNeeded(), 1)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (player.getInventory().containsItem(SILVER_BAR) && player.getInventory().contains(def.getNeeded(), 1)) {
|
|
||||||
player.animate(new Animation(899));
|
|
||||||
if (player.getInventory().remove(SILVER_BAR)) {
|
|
||||||
player.getInventory().add(new Item(def.getProduct(), def == SilverProduct.SILVER_BOLTS ? 10 : 1));
|
|
||||||
player.getSkills().addExperience(Skills.CRAFTING, def.getExp(), true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Craft a holy symbol in the Lumbridge furnace
|
|
||||||
if (def == SilverProduct.UNBLESSED && player.getLocation().withinDistance(Location.create(3226, 3254, 0))) {
|
|
||||||
player.getAchievementDiaryManager().finishTask(player, DiaryType.LUMBRIDGE, 2, 8);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
amt--;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void stop() {
|
|
||||||
player.animate(new Animation(-1));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
package core.game.interaction.item.withitem;
|
package core.game.interaction.item.withitem;
|
||||||
|
|
||||||
|
import api.ContentAPI;
|
||||||
import core.game.component.Component;
|
import core.game.component.Component;
|
||||||
import core.plugin.Initializable;
|
import core.plugin.Initializable;
|
||||||
|
import kotlin.Unit;
|
||||||
import org.rs09.consts.Items;
|
import org.rs09.consts.Items;
|
||||||
import core.game.content.dialogue.DialoguePlugin;
|
import core.game.content.dialogue.DialoguePlugin;
|
||||||
import core.game.interaction.NodeUsageEvent;
|
import core.game.interaction.NodeUsageEvent;
|
||||||
@@ -220,15 +222,10 @@ public final class FruitCuttingPlugin extends UseWithHandler {
|
|||||||
amount = 5;
|
amount = 5;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
player.setAttribute("runscript", new RunScript() {
|
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
||||||
@Override
|
cut(player, (int) value, slice);
|
||||||
public boolean handle() {
|
return Unit.INSTANCE;
|
||||||
int ammount = (int) value;
|
|
||||||
cut(player, ammount, slice);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
player.getDialogueInterpreter().sendInput(false, "Enter the amount");
|
|
||||||
return true;
|
return true;
|
||||||
case 3:
|
case 3:
|
||||||
amount = player.getInventory().getAmount(fruit.getBase());
|
amount = player.getInventory().getAmount(fruit.getBase());
|
||||||
|
|||||||
@@ -325,7 +325,7 @@ public final class ZaffPlugin extends OptionHandler {
|
|||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
end();
|
end();
|
||||||
player.setAttribute("runscript", new RunScript() {
|
/*player.setAttribute("runscript", new RunScript() {
|
||||||
@Override
|
@Override
|
||||||
public boolean handle() {
|
public boolean handle() {
|
||||||
int amt = (int) value;
|
int amt = (int) value;
|
||||||
@@ -357,7 +357,8 @@ public final class ZaffPlugin extends OptionHandler {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
interpreter.sendInput(false, "Zaff has " + ammount + " battlestaves...");
|
interpreter.sendInput(false, "Zaff has " + ammount + " battlestaves...");
|
||||||
break;
|
*/ break;
|
||||||
|
//TODO: Come back and fix this later when achievement diaries can actually be completed kekkekekeke
|
||||||
case 2:
|
case 2:
|
||||||
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Oh, okay then. I'll try again another time.");
|
interpreter.sendDialogues(player, FacialExpression.HALF_GUILTY, "Oh, okay then. I'll try again another time.");
|
||||||
stage = 3;
|
stage = 3;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package core.game.interaction.object;
|
package core.game.interaction.object;
|
||||||
|
|
||||||
|
import api.ContentAPI;
|
||||||
import core.cache.def.impl.NPCDefinition;
|
import core.cache.def.impl.NPCDefinition;
|
||||||
import core.cache.def.impl.ObjectDefinition;
|
import core.cache.def.impl.ObjectDefinition;
|
||||||
import core.game.component.CloseEvent;
|
import core.game.component.CloseEvent;
|
||||||
@@ -29,6 +30,7 @@ import core.game.world.map.RegionManager;
|
|||||||
import core.game.world.update.flag.context.Animation;
|
import core.game.world.update.flag.context.Animation;
|
||||||
import core.plugin.Initializable;
|
import core.plugin.Initializable;
|
||||||
import core.plugin.Plugin;
|
import core.plugin.Plugin;
|
||||||
|
import kotlin.Unit;
|
||||||
import rs09.game.ge.GrandExchangeOffer;
|
import rs09.game.ge.GrandExchangeOffer;
|
||||||
import rs09.game.world.GameWorld;
|
import rs09.game.world.GameWorld;
|
||||||
|
|
||||||
@@ -370,16 +372,11 @@ public final class BankingPlugin extends OptionHandler {
|
|||||||
amount = p.getBank().getLastAmountX();
|
amount = p.getBank().getLastAmountX();
|
||||||
break;
|
break;
|
||||||
case 234:
|
case 234:
|
||||||
p.setAttribute("runscript", new RunScript() {
|
ContentAPI.sendInputDialogue(p, true, "Enter the amount:", (value) -> {
|
||||||
@Override
|
p.getBank().takeItem(slot, (int) value);
|
||||||
public boolean handle() {
|
p.getBank().updateLastAmountX((int) value);
|
||||||
int amount = (int) value;
|
return Unit.INSTANCE;
|
||||||
p.getBank().takeItem(slot, amount);
|
|
||||||
p.getBank().updateLastAmountX(amount);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
p.getDialogueInterpreter().sendInput(false, "Enter the amount.");
|
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
p.sendMessage(p.getBank().get(slot).getDefinition().getExamine());
|
p.sendMessage(p.getBank().get(slot).getDefinition().getExamine());
|
||||||
@@ -520,16 +517,11 @@ public final class BankingPlugin extends OptionHandler {
|
|||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
case 234:
|
case 234:
|
||||||
p.setAttribute("runscript", new RunScript() {
|
ContentAPI.sendInputDialogue(p, true, "Enter the amount:", (value) -> {
|
||||||
@Override
|
p.getBank().addItem(slot, (int) value);
|
||||||
public boolean handle() {
|
InterfaceContainer.generateItems(p, p.getInventory().toArray(), new String[]{"Examine", "Deposit-X", "Deposit-All", "Deposit-10", "Deposit-5", "Deposit-1",}, 11, 15, 5, 7);
|
||||||
int ammount = (int) value;
|
return Unit.INSTANCE;
|
||||||
p.getBank().addItem(slot, ammount);
|
|
||||||
InterfaceContainer.generateItems(p, p.getInventory().toArray(), new String[]{"Examine", "Deposit-X", "Deposit-All", "Deposit-10", "Deposit-5", "Deposit-1",}, 11, 15, 5, 7);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
p.getDialogueInterpreter().sendInput(false, "Enter the amount.");
|
|
||||||
break;
|
break;
|
||||||
case 168:
|
case 168:
|
||||||
p.sendMessage(item.getDefinition().getExamine());
|
p.sendMessage(item.getDefinition().getExamine());
|
||||||
|
|||||||
@@ -1,64 +0,0 @@
|
|||||||
package core.game.interaction.object;
|
|
||||||
|
|
||||||
import core.game.component.Component;
|
|
||||||
import core.game.interaction.NodeUsageEvent;
|
|
||||||
import core.game.interaction.UseWithHandler;
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
import core.plugin.Initializable;
|
|
||||||
import core.plugin.Plugin;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author 'Vexia
|
|
||||||
*/
|
|
||||||
@Initializable
|
|
||||||
public class SilverCastingInterfacePlugin extends UseWithHandler {
|
|
||||||
|
|
||||||
public SilverCastingInterfacePlugin() {
|
|
||||||
super(2355);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handle(NodeUsageEvent event) {
|
|
||||||
final Player player = event.getPlayer();
|
|
||||||
event.getPlayer().getInterfaceManager().open(new Component(438));
|
|
||||||
player.getPacketDispatch().sendItemOnInterface(1718, 1, 438, 17);
|
|
||||||
player.getPacketDispatch().sendItemOnInterface(1724, 1, 438, 24);
|
|
||||||
player.getPacketDispatch().sendItemOnInterface(2961, 1, 438, 31);
|
|
||||||
player.getPacketDispatch().sendItemOnInterface(4201, 1, 438, 38);
|
|
||||||
player.getPacketDispatch().sendItemOnInterface(5525, 1, 438, 45);
|
|
||||||
player.getPacketDispatch().sendItemOnInterface(7637, 1, 438, 53);
|
|
||||||
player.getPacketDispatch().sendItemOnInterface(6748, 1, 438, 60);
|
|
||||||
player.getPacketDispatch().sendItemOnInterface(9382, 10, 438, 67);
|
|
||||||
player.getPacketDispatch().sendItemOnInterface(13154, 10, 438, 74);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
|
||||||
addHandler(2966, OBJECT_TYPE, this);
|
|
||||||
addHandler(3044, OBJECT_TYPE, this);
|
|
||||||
addHandler(3294, OBJECT_TYPE, this);
|
|
||||||
addHandler(4304, OBJECT_TYPE, this);
|
|
||||||
addHandler(6189, OBJECT_TYPE, this);
|
|
||||||
addHandler(11009, OBJECT_TYPE, this);
|
|
||||||
addHandler(11010, OBJECT_TYPE, this);
|
|
||||||
addHandler(11666, OBJECT_TYPE, this);
|
|
||||||
addHandler(12100, OBJECT_TYPE, this);
|
|
||||||
addHandler(12809, OBJECT_TYPE, this);
|
|
||||||
addHandler(18497, OBJECT_TYPE, this);
|
|
||||||
addHandler(18525, OBJECT_TYPE, this);
|
|
||||||
addHandler(18526, OBJECT_TYPE, this);
|
|
||||||
addHandler(21879, OBJECT_TYPE, this);
|
|
||||||
addHandler(22721, OBJECT_TYPE, this);
|
|
||||||
addHandler(26814, OBJECT_TYPE, this);
|
|
||||||
addHandler(28433, OBJECT_TYPE, this);
|
|
||||||
addHandler(28434, OBJECT_TYPE, this);
|
|
||||||
addHandler(30021, OBJECT_TYPE, this);
|
|
||||||
addHandler(30510, OBJECT_TYPE, this);
|
|
||||||
addHandler(36956, OBJECT_TYPE, this);
|
|
||||||
addHandler(37651, OBJECT_TYPE, this);
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
+26
-28
@@ -1,6 +1,7 @@
|
|||||||
package core.game.node.entity.skill.construction;
|
package core.game.node.entity.skill.construction;
|
||||||
|
|
||||||
|
|
||||||
|
import api.ContentAPI;
|
||||||
import core.cache.def.impl.ObjectDefinition;
|
import core.cache.def.impl.ObjectDefinition;
|
||||||
import core.game.content.dialogue.DialogueInterpreter;
|
import core.game.content.dialogue.DialogueInterpreter;
|
||||||
import core.game.content.dialogue.DialoguePlugin;
|
import core.game.content.dialogue.DialoguePlugin;
|
||||||
@@ -13,6 +14,7 @@ import core.plugin.Initializable;
|
|||||||
import core.plugin.Plugin;
|
import core.plugin.Plugin;
|
||||||
import core.plugin.PluginManifest;
|
import core.plugin.PluginManifest;
|
||||||
import core.plugin.PluginType;
|
import core.plugin.PluginType;
|
||||||
|
import kotlin.Unit;
|
||||||
import rs09.game.world.repository.Repository;
|
import rs09.game.world.repository.Repository;
|
||||||
import rs09.plugin.PluginManager;
|
import rs09.plugin.PluginManager;
|
||||||
|
|
||||||
@@ -118,35 +120,31 @@ public final class PortalOptionPlugin extends OptionHandler {
|
|||||||
player.getHouseManager().enter(player, buttonId == 2, true);
|
player.getHouseManager().enter(player, buttonId == 2, true);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
player.getDialogueInterpreter().sendInput(true, "Enter friend's name:");
|
ContentAPI.sendInputDialogue(player, false, "Enter friend's name:", (value) -> {
|
||||||
player.setAttribute("runscript", new RunScript() {
|
Player p = Repository.getPlayerByName((String) value);
|
||||||
@Override
|
if (p == null || !p.isActive()) {
|
||||||
public boolean handle() {
|
player.getPacketDispatch().sendMessage("This player is not online.");
|
||||||
Player p = Repository.getPlayerByName((String) getValue());
|
return Unit.INSTANCE;
|
||||||
if (p == null || !p.isActive()) {
|
|
||||||
player.getPacketDispatch().sendMessage("This player is not online.");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (p.getUsername().equals(player.getUsername())) {
|
|
||||||
player.getPacketDispatch().sendMessage("You aren't a friend of yourself!");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (!p.getHouseManager().isLoaded()) {
|
|
||||||
player.getPacketDispatch().sendMessage("This player is not at home right now.");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (p.getHouseManager().isBuildingMode()) {
|
|
||||||
player.getPacketDispatch().sendMessage("This player is in building mode.");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (p.getHouseManager().isLocked()) {
|
|
||||||
player.getPacketDispatch().sendMessage("The other player has locked their house.");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
p.setAttribute("poh_owner", getValue());
|
|
||||||
p.getHouseManager().enter(player, false, false);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
if (p.getUsername().equals(player.getUsername())) {
|
||||||
|
player.getPacketDispatch().sendMessage("You aren't a friend of yourself!");
|
||||||
|
return Unit.INSTANCE;
|
||||||
|
}
|
||||||
|
if (!p.getHouseManager().isLoaded()) {
|
||||||
|
player.getPacketDispatch().sendMessage("This player is not at home right now.");
|
||||||
|
return Unit.INSTANCE;
|
||||||
|
}
|
||||||
|
if (p.getHouseManager().isBuildingMode()) {
|
||||||
|
player.getPacketDispatch().sendMessage("This player is in building mode.");
|
||||||
|
return Unit.INSTANCE;
|
||||||
|
}
|
||||||
|
if (p.getHouseManager().isLocked()) {
|
||||||
|
player.getPacketDispatch().sendMessage("The other player has locked their house.");
|
||||||
|
return Unit.INSTANCE;
|
||||||
|
}
|
||||||
|
p.setAttribute("poh_owner", (String) value);
|
||||||
|
p.getHouseManager().enter(player, false, false);
|
||||||
|
return Unit.INSTANCE;
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-7
@@ -1,5 +1,6 @@
|
|||||||
package core.game.node.entity.skill.summoning;
|
package core.game.node.entity.skill.summoning;
|
||||||
|
|
||||||
|
import api.ContentAPI;
|
||||||
import core.cache.def.impl.ItemDefinition;
|
import core.cache.def.impl.ItemDefinition;
|
||||||
import core.game.component.Component;
|
import core.game.component.Component;
|
||||||
import core.game.component.ComponentDefinition;
|
import core.game.component.ComponentDefinition;
|
||||||
@@ -10,6 +11,7 @@ import core.game.node.entity.player.Player;
|
|||||||
import core.game.node.entity.player.link.RunScript;
|
import core.game.node.entity.player.link.RunScript;
|
||||||
import core.plugin.Initializable;
|
import core.plugin.Initializable;
|
||||||
import core.plugin.Plugin;
|
import core.plugin.Plugin;
|
||||||
|
import kotlin.Unit;
|
||||||
import rs09.plugin.PluginManager;
|
import rs09.plugin.PluginManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -47,14 +49,10 @@ public final class SummoningCreationPlugin extends ComponentPlugin {
|
|||||||
SummoningCreator.create(player, getItemAmount(opcode), component.getId() == 669 ? SummoningPouch.forSlot(slot > 50 ? slot -1 : slot) : SummoningScroll.forId(slot > 50 ? slot -1 : slot));
|
SummoningCreator.create(player, getItemAmount(opcode), component.getId() == 669 ? SummoningPouch.forSlot(slot > 50 ? slot -1 : slot) : SummoningScroll.forId(slot > 50 ? slot -1 : slot));
|
||||||
break;
|
break;
|
||||||
case 234:
|
case 234:
|
||||||
player.setAttribute("runscript", new RunScript() {
|
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
||||||
@Override
|
SummoningCreator.create(player, (int) value, component.getId() == 669 ? SummoningPouch.forSlot(slot > 50 ? slot -1 : slot) : SummoningScroll.forId(slot > 50 ? slot -1 : slot));
|
||||||
public boolean handle() {
|
return Unit.INSTANCE;
|
||||||
SummoningCreator.create(player, (int) getValue(), component.getId() == 669 ? SummoningPouch.forSlot(slot > 50 ? slot -1 : slot) : SummoningScroll.forId(slot > 50 ? slot -1 : slot));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
player.getDialogueInterpreter().sendInput(false, "Enter the amount:");
|
|
||||||
return true;
|
return true;
|
||||||
case 166:
|
case 166:
|
||||||
SummoningCreator.list(player, SummoningPouch.forSlot(slot > 50 ? slot -1 : slot));
|
SummoningCreator.list(player, SummoningPouch.forSlot(slot > 50 ? slot -1 : slot));
|
||||||
|
|||||||
+5
-7
@@ -1,5 +1,6 @@
|
|||||||
package core.game.node.entity.skill.summoning.familiar;
|
package core.game.node.entity.skill.summoning.familiar;
|
||||||
|
|
||||||
|
import api.ContentAPI;
|
||||||
import core.game.component.Component;
|
import core.game.component.Component;
|
||||||
import core.game.component.ComponentDefinition;
|
import core.game.component.ComponentDefinition;
|
||||||
import core.game.component.ComponentPlugin;
|
import core.game.component.ComponentPlugin;
|
||||||
@@ -9,6 +10,7 @@ import core.game.node.entity.player.link.RunScript;
|
|||||||
import core.game.node.item.Item;
|
import core.game.node.item.Item;
|
||||||
import core.plugin.Initializable;
|
import core.plugin.Initializable;
|
||||||
import core.plugin.Plugin;
|
import core.plugin.Plugin;
|
||||||
|
import kotlin.Unit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles the beast of burden interface.
|
* Handles the beast of burden interface.
|
||||||
@@ -54,14 +56,10 @@ public final class BurdenInterfacePlugin extends ComponentPlugin {
|
|||||||
beast.transfer(item, container.getAmount(item), withdraw);
|
beast.transfer(item, container.getAmount(item), withdraw);
|
||||||
return true;
|
return true;
|
||||||
case 234:
|
case 234:
|
||||||
player.setAttribute("runscript", new RunScript() {
|
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
||||||
@Override
|
beast.transfer(item, (int) value, withdraw);
|
||||||
public boolean handle() {
|
return Unit.INSTANCE;
|
||||||
beast.transfer(item, (int) getValue(), withdraw);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
player.getDialogueInterpreter().sendInput(false, "Enter the amount:");
|
|
||||||
break;
|
break;
|
||||||
case 168:
|
case 168:
|
||||||
player.getPacketDispatch().sendMessage(item.getDefinition().getExamine());
|
player.getPacketDispatch().sendMessage(item.getDefinition().getExamine());
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import core.game.node.entity.player.link.RunScript;
|
|||||||
import core.net.packet.IncomingPacket;
|
import core.net.packet.IncomingPacket;
|
||||||
import core.net.packet.IoBuffer;
|
import core.net.packet.IoBuffer;
|
||||||
import core.tools.StringUtils;
|
import core.tools.StringUtils;
|
||||||
|
import kotlin.jvm.functions.Function1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the incoming packet to handle a run script.
|
* Represents the incoming packet to handle a run script.
|
||||||
@@ -14,7 +15,7 @@ public class RunScriptPacketHandler implements IncomingPacket {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void decode(Player player, int opcode, IoBuffer buffer) {
|
public void decode(Player player, int opcode, IoBuffer buffer) {
|
||||||
final RunScript script = player.getAttribute("runscript", null);
|
final Function1 script = player.getAttribute("runscript", null);
|
||||||
if (script == null || player.getLocks().isInteractionLocked()) {
|
if (script == null || player.getLocks().isInteractionLocked()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -28,9 +29,7 @@ public class RunScriptPacketHandler implements IncomingPacket {
|
|||||||
} else {
|
} else {
|
||||||
value = buffer.getInt();
|
value = buffer.getInt();
|
||||||
}
|
}
|
||||||
script.setValue(value);
|
script.invoke(value);
|
||||||
script.setPlayer(player);
|
|
||||||
player.removeAttribute("runscript");
|
player.removeAttribute("runscript");
|
||||||
script.handle();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import core.game.node.entity.impl.Animator
|
|||||||
import core.game.node.entity.impl.Projectile
|
import core.game.node.entity.impl.Projectile
|
||||||
import core.game.node.entity.npc.NPC
|
import core.game.node.entity.npc.NPC
|
||||||
import core.game.node.entity.player.Player
|
import core.game.node.entity.player.Player
|
||||||
|
import core.game.node.entity.player.link.RunScript
|
||||||
import core.game.node.entity.player.link.TeleportManager
|
import core.game.node.entity.player.link.TeleportManager
|
||||||
import core.game.node.entity.player.link.audio.Audio
|
import core.game.node.entity.player.link.audio.Audio
|
||||||
import core.game.node.entity.player.link.emote.Emotes
|
import core.game.node.entity.player.link.emote.Emotes
|
||||||
@@ -127,12 +128,11 @@ object ContentAPI {
|
|||||||
else -> throw IllegalStateException("Invalid value passed for item")
|
else -> throw IllegalStateException("Invalid value passed for item")
|
||||||
}
|
}
|
||||||
|
|
||||||
when(container){
|
return when(container){
|
||||||
Container.INVENTORY -> player.inventory.remove(it)
|
Container.INVENTORY -> player.inventory.remove(it)
|
||||||
Container.BANK -> player.bank.remove(it)
|
Container.BANK -> player.bank.remove(it)
|
||||||
Container.EQUIPMENT -> player.equipment.remove(it)
|
Container.EQUIPMENT -> player.equipment.remove(it)
|
||||||
}
|
}
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -918,4 +918,30 @@ object ContentAPI {
|
|||||||
fun clearLogoutListener(player: Player, key: String){
|
fun clearLogoutListener(player: Player, key: String){
|
||||||
player.logoutListeners.remove(key)
|
player.logoutListeners.remove(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sends an item to a specific child on an interface
|
||||||
|
* @param player the player to send the packet to
|
||||||
|
* @param iface the ID of the interface to send the item onto
|
||||||
|
* @Param child the index of the child on the interface to send the item onto
|
||||||
|
* @param item the ID of the item to send
|
||||||
|
* @param amount the amount of the item to send - defaults to 1
|
||||||
|
*/
|
||||||
|
@JvmStatic
|
||||||
|
fun sendItemOnInterface(player: Player, iface: Int, child: Int, item: Int, amount: Int = 1){
|
||||||
|
player.packetDispatch.sendItemOnInterface(item,amount,iface,child)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send an input dialogue to retrieve a specified value from the player
|
||||||
|
* @param player the player to send the input dialogue to
|
||||||
|
* @param numeric whether or not the input is numeric
|
||||||
|
* @param prompt what to prompt the player
|
||||||
|
* @param handler the method that handles the value gained from the input dialogue
|
||||||
|
*/
|
||||||
|
@JvmStatic
|
||||||
|
fun sendInputDialogue(player: Player, numeric: Boolean, prompt: String, handler: (value: Any) -> Unit){
|
||||||
|
player.dialogueInterpreter.sendInput(!numeric, prompt)
|
||||||
|
player.setAttribute("runscript",handler) //Handled in RunScriptPacketHandler
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
package rs09.game.interaction.inter
|
||||||
|
|
||||||
|
import api.ContentAPI
|
||||||
|
import core.game.node.entity.player.Player
|
||||||
|
import core.game.node.entity.player.link.diary.DiaryType
|
||||||
|
import core.game.node.entity.skill.Skills
|
||||||
|
import core.game.node.entity.skill.crafting.SilverProduct
|
||||||
|
import core.game.system.task.Pulse
|
||||||
|
import org.rs09.consts.Components
|
||||||
|
import org.rs09.consts.Items
|
||||||
|
import rs09.game.interaction.InteractionListener
|
||||||
|
import rs09.game.interaction.InterfaceListener
|
||||||
|
import rs09.game.system.SystemLogger
|
||||||
|
|
||||||
|
class SilverInterface : InterfaceListener() {
|
||||||
|
|
||||||
|
val IFACE = Components.CRAFTING_SILVER_CASTING_438
|
||||||
|
val ANIM = ContentAPI.getAnimation(899)
|
||||||
|
|
||||||
|
override fun defineListeners() {
|
||||||
|
onOpen(IFACE){player, _ ->
|
||||||
|
ContentAPI.sendItemOnInterface(player, IFACE, 17, 1718)
|
||||||
|
ContentAPI.sendItemOnInterface(player, IFACE, 24, 1724)
|
||||||
|
ContentAPI.sendItemOnInterface(player, IFACE, 31, 2961)
|
||||||
|
ContentAPI.sendItemOnInterface(player, IFACE, 38, 4201)
|
||||||
|
ContentAPI.sendItemOnInterface(player, IFACE, 45, 5525)
|
||||||
|
ContentAPI.sendItemOnInterface(player, IFACE, 53, 7637)
|
||||||
|
ContentAPI.sendItemOnInterface(player, IFACE, 60, 6748)
|
||||||
|
ContentAPI.sendItemOnInterface(player, IFACE, 67, 9382)
|
||||||
|
ContentAPI.sendItemOnInterface(player, IFACE, 74, 13154)
|
||||||
|
return@onOpen true
|
||||||
|
}
|
||||||
|
|
||||||
|
on(IFACE){player, _, opcode, buttonID, _, _ ->
|
||||||
|
val product = SilverProduct.forId(buttonID) ?: return@on true
|
||||||
|
|
||||||
|
if(!ContentAPI.inInventory(player, product.needed)){
|
||||||
|
ContentAPI.sendMessage(player, "You need a ${ContentAPI.itemDefinition(product.needed).name.toLowerCase()} to make this item.")
|
||||||
|
return@on true
|
||||||
|
}
|
||||||
|
|
||||||
|
if(product == SilverProduct.SILVTHRIL_ROD || product == SilverProduct.SILVTHRIL_CHAIN){
|
||||||
|
ContentAPI.sendMessage(player, "You can't do that yet.")
|
||||||
|
return@on true
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!ContentAPI.hasLevelDyn(player, Skills.CRAFTING, product.level)){
|
||||||
|
ContentAPI.sendMessage(player, "You need a Crafting level of ${product.level} to make this.")
|
||||||
|
return@on true
|
||||||
|
}
|
||||||
|
|
||||||
|
val amt = when(opcode){
|
||||||
|
155 -> 1
|
||||||
|
196 -> 5
|
||||||
|
124 -> ContentAPI.amountInInventory(player, Items.SILVER_BAR_2355)
|
||||||
|
199 -> -1 //Make X
|
||||||
|
else -> return@on true
|
||||||
|
}
|
||||||
|
|
||||||
|
if(amt == -1) ContentAPI.sendInputDialogue(player, true, "Enter the amount:"){value ->
|
||||||
|
make(player,product,value as Int)
|
||||||
|
} else make(player, product, amt)
|
||||||
|
return@on true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun make(player: Player, product: SilverProduct, amount: Int){
|
||||||
|
var amt = amount
|
||||||
|
ContentAPI.closeInterface(player)
|
||||||
|
ContentAPI.submitWorldPulse(object : Pulse(){
|
||||||
|
override fun pulse(): Boolean {
|
||||||
|
if(amt < 1) return true
|
||||||
|
if(!ContentAPI.inInventory(player, product.needed) || !ContentAPI.inInventory(player, Items.SILVER_BAR_2355)) return true;
|
||||||
|
ContentAPI.animate(player, ANIM)
|
||||||
|
|
||||||
|
if(ContentAPI.removeItem(player, Items.SILVER_BAR_2355, api.Container.INVENTORY)){
|
||||||
|
ContentAPI.addItem(player, product.product, if(product == SilverProduct.SILVER_BOLTS) 10 else 1)
|
||||||
|
ContentAPI.rewardXP(player, Skills.CRAFTING, product.exp)
|
||||||
|
|
||||||
|
if(product == SilverProduct.UNBLESSED && player.location.withinDistance(ContentAPI.location(3226,3254,0))){
|
||||||
|
player.achievementDiaryManager.finishTask(player, DiaryType.LUMBRIDGE, 2, 8)
|
||||||
|
}
|
||||||
|
delay = 3
|
||||||
|
} else return true
|
||||||
|
|
||||||
|
amt--
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class SilverBarUseWith : InteractionListener() {
|
||||||
|
val FURNACES = intArrayOf(2966, 3044, 3294, 4304, 6189, 11009, 11010, 11666, 12100, 12809, 18497, 18525, 18526, 21879, 22721, 26814, 28433, 28434, 30021, 30510, 36956, 37651)
|
||||||
|
override fun defineListeners() {
|
||||||
|
onUseWith(OBJECT, Items.SILVER_BAR_2355, *FURNACES){ player, _, _ ->
|
||||||
|
ContentAPI.openInterface(player, Components.CRAFTING_SILVER_CASTING_438)
|
||||||
|
return@onUseWith true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package rs09.game.interaction.npc
|
package rs09.game.interaction.npc
|
||||||
|
|
||||||
|
import api.ContentAPI
|
||||||
import core.game.component.Component
|
import core.game.component.Component
|
||||||
import core.game.node.entity.player.Player
|
import core.game.node.entity.player.Player
|
||||||
import core.game.node.entity.player.link.RunScript
|
import core.game.node.entity.player.link.RunScript
|
||||||
@@ -37,13 +38,9 @@ object BogrogPouchSwapper {
|
|||||||
OP_SWAP_5 -> swap(player, 5, player.inventory.get(slot).id)
|
OP_SWAP_5 -> swap(player, 5, player.inventory.get(slot).id)
|
||||||
OP_SWAP_10 -> swap(player,10,player.inventory.get(slot).id)
|
OP_SWAP_10 -> swap(player,10,player.inventory.get(slot).id)
|
||||||
OP_SWAP_X -> true.also{
|
OP_SWAP_X -> true.also{
|
||||||
player.dialogueInterpreter.sendInput(false, "Enter the amount:")
|
ContentAPI.sendInputDialogue(player, true, "Enter the amount:"){value ->
|
||||||
player.setAttribute("runscript", object : RunScript() {
|
swap(player, value as Int, player.inventory.get(slot).id)
|
||||||
override fun handle(): Boolean {
|
}
|
||||||
swap(player,getValue() as Int, player.inventory.get(slot).id)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
else -> false
|
else -> false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package rs09.game.node.entity.skill.cooking
|
package rs09.game.node.entity.skill.cooking
|
||||||
|
|
||||||
|
import api.ContentAPI
|
||||||
import core.cache.def.impl.ItemDefinition
|
import core.cache.def.impl.ItemDefinition
|
||||||
import core.game.node.`object`.Scenery
|
import core.game.node.`object`.Scenery
|
||||||
import core.game.node.entity.player.link.RunScript
|
import core.game.node.entity.player.link.RunScript
|
||||||
@@ -53,14 +54,9 @@ class CookingDialogue(vararg val args: Any) : DialogueFile(){
|
|||||||
val amount = getAmount(buttonID)
|
val amount = getAmount(buttonID)
|
||||||
when (amount) {
|
when (amount) {
|
||||||
-1 -> {
|
-1 -> {
|
||||||
player!!.setAttribute("runscript", object : RunScript() {
|
ContentAPI.sendInputDialogue(player!!, true, "Enter the amount:"){value ->
|
||||||
override fun handle(): Boolean {
|
cook(player!!, `object`, initial, product, value as Int)
|
||||||
val amount = value as Int
|
}
|
||||||
cook(player, `object`, initial, product, amount)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
player!!.dialogueInterpreter.sendInput(false, "Enter an amount:")
|
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
end()
|
end()
|
||||||
|
|||||||
+31
-38
@@ -1,5 +1,6 @@
|
|||||||
package rs09.game.node.entity.skill.farming
|
package rs09.game.node.entity.skill.farming
|
||||||
|
|
||||||
|
import api.ContentAPI
|
||||||
import core.game.component.Component
|
import core.game.component.Component
|
||||||
import core.game.node.entity.player.Player
|
import core.game.node.entity.player.Player
|
||||||
import core.game.node.entity.player.link.RunScript
|
import core.game.node.entity.player.link.RunScript
|
||||||
@@ -135,26 +136,22 @@ class ToolLeprechaunInterface : InterfaceListener() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(amount == -2){
|
if(amount == -2){
|
||||||
player.setAttribute("runscript", object : RunScript() {
|
ContentAPI.sendInputDialogue(player, true, "Enter the amount:"){value ->
|
||||||
override fun handle(): Boolean {
|
var amt = value as Int
|
||||||
var amt = getValue().toString().toInt()
|
if(amt > hasAmount){
|
||||||
if(amt > hasAmount){
|
amt = hasAmount
|
||||||
amt = hasAmount
|
|
||||||
}
|
|
||||||
if(amt > spaceLeft){
|
|
||||||
amt = spaceLeft
|
|
||||||
}
|
|
||||||
if(amt == 0){
|
|
||||||
player.dialogueInterpreter.sendDialogue("You don't have any of those to store.")
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
player.inventory.remove(Item(item,amt))
|
|
||||||
updateQuantityMethod.invoke(player,amt)
|
|
||||||
player.varpManager.get(varp).send(player)
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
})
|
if(amt > spaceLeft){
|
||||||
player.dialogueInterpreter.sendInput(false, "Enter amount:")
|
amt = spaceLeft
|
||||||
|
}
|
||||||
|
if(amt == 0){
|
||||||
|
player.dialogueInterpreter.sendDialogue("You don't have any of those to store.")
|
||||||
|
return@sendInputDialogue
|
||||||
|
}
|
||||||
|
player.inventory.remove(Item(item,amt))
|
||||||
|
updateQuantityMethod.invoke(player,amt)
|
||||||
|
player.varpManager.get(varp).send(player)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(amount == -1){
|
if(amount == -1){
|
||||||
@@ -191,26 +188,22 @@ class ToolLeprechaunInterface : InterfaceListener() {
|
|||||||
player.dialogueInterpreter.sendDialogue("You don't have any of those stored.")
|
player.dialogueInterpreter.sendDialogue("You don't have any of those stored.")
|
||||||
} else {
|
} else {
|
||||||
if(amount == -2){
|
if(amount == -2){
|
||||||
player.setAttribute("runscript", object : RunScript() {
|
ContentAPI.sendInputDialogue(player, true, "Enter the amount:"){value ->
|
||||||
override fun handle(): Boolean {
|
var amt = value as Int
|
||||||
var amt = getValue().toString().toInt()
|
if(amt > hasAmount){
|
||||||
if(amt > hasAmount){
|
amt = hasAmount
|
||||||
amt = hasAmount
|
|
||||||
}
|
|
||||||
if(amt > player.inventory.freeSlots()){
|
|
||||||
amt = player.inventory.freeSlots()
|
|
||||||
}
|
|
||||||
if(amt <= 0){
|
|
||||||
player.dialogueInterpreter.sendDialogue("You don't have enough inventory space for that.")
|
|
||||||
} else {
|
|
||||||
player.inventory.add(Item(item, amt))
|
|
||||||
updateQuantityMethod.invoke(player, -amt)
|
|
||||||
player.varpManager.get(varp).send(player)
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
})
|
if(amt > player.inventory.freeSlots()){
|
||||||
player.dialogueInterpreter.sendInput(false, "Enter amount:")
|
amt = player.inventory.freeSlots()
|
||||||
|
}
|
||||||
|
if(amt <= 0){
|
||||||
|
player.dialogueInterpreter.sendDialogue("You don't have enough inventory space for that.")
|
||||||
|
} else {
|
||||||
|
player.inventory.add(Item(item, amt))
|
||||||
|
updateQuantityMethod.invoke(player, -amt)
|
||||||
|
player.varpManager.get(varp).send(player)
|
||||||
|
}
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(amount == -1){
|
if(amount == -1){
|
||||||
|
|||||||
+17
-32
@@ -1,5 +1,6 @@
|
|||||||
package rs09.game.system.command.rottenpotato
|
package rs09.game.system.command.rottenpotato
|
||||||
|
|
||||||
|
import api.ContentAPI
|
||||||
import core.game.content.dialogue.DialoguePlugin
|
import core.game.content.dialogue.DialoguePlugin
|
||||||
import core.game.node.entity.npc.NPC
|
import core.game.node.entity.npc.NPC
|
||||||
import core.game.node.entity.player.Player
|
import core.game.node.entity.player.Player
|
||||||
@@ -37,17 +38,13 @@ class RottenPotatoExtraDialogue(player: Player? = null) : DialoguePlugin(player)
|
|||||||
//Send Player Notification
|
//Send Player Notification
|
||||||
1 -> {
|
1 -> {
|
||||||
end()
|
end()
|
||||||
player.setAttribute("runscript", object : RunScript() {
|
ContentAPI.sendInputDialogue(player, false, "Enter the notification message:"){value ->
|
||||||
override fun handle(): Boolean {
|
val message = value as String
|
||||||
val message = getValue().toString()
|
for (p in Repository.players) {
|
||||||
for (p in Repository.players) {
|
p ?: continue
|
||||||
p ?: continue
|
p.packetDispatch.sendString(colorize("%Y${message.replace("_", " ").capitalize()}"), 754, 5)
|
||||||
p.packetDispatch.sendString(colorize("%Y${message.replace("_", " ").capitalize()}"), 754, 5)
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
player.dialogueInterpreter.sendLongInput("Enter the notification message:")
|
|
||||||
}
|
}
|
||||||
//Targeted AME
|
//Targeted AME
|
||||||
2 -> {
|
2 -> {
|
||||||
@@ -64,16 +61,12 @@ class RottenPotatoExtraDialogue(player: Player? = null) : DialoguePlugin(player)
|
|||||||
//Force Area NPC Chat
|
//Force Area NPC Chat
|
||||||
4 -> {
|
4 -> {
|
||||||
end()
|
end()
|
||||||
player.setAttribute("runscript", object : RunScript() {
|
ContentAPI.sendInputDialogue(player, false,"Enter the chat message:"){value ->
|
||||||
override fun handle(): Boolean {
|
val msg = value as String
|
||||||
val msg = getValue().toString()
|
RegionManager.getLocalNpcs(player).forEach {
|
||||||
RegionManager.getLocalNpcs(player).forEach {
|
it.sendChat(msg)
|
||||||
it.sendChat(msg)
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
player.dialogueInterpreter.sendLongInput("Enter the chat message:")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Kill all nearby NPCs
|
//Kill all nearby NPCs
|
||||||
@@ -88,20 +81,12 @@ class RottenPotatoExtraDialogue(player: Player? = null) : DialoguePlugin(player)
|
|||||||
//AME Spawning
|
//AME Spawning
|
||||||
100 -> {
|
100 -> {
|
||||||
end()
|
end()
|
||||||
player.setAttribute("runscript", object : RunScript() {
|
ContentAPI.sendInputDialogue(player, false, "Enter player name:"){value ->
|
||||||
override fun handle(): Boolean {
|
val other = Repository.getPlayerByName(value.toString().toLowerCase().replace(" ", "_"))
|
||||||
val other = Repository.getPlayerByName(getValue().toString().toLowerCase().replace(" ", "_"))
|
if (other == null) {
|
||||||
if (other == null) {
|
player.sendMessage(colorize("%RInvalid player name."))
|
||||||
player.sendMessage(colorize("%RInvalid player name."))
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
//other?.antiMacroHandler?.fireEvent(AMEs[buttonId - 1])
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
player.dialogueInterpreter.sendInput(true, "Enter player name:")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Spawn boss
|
//Spawn boss
|
||||||
|
|||||||
+18
-25
@@ -1,5 +1,6 @@
|
|||||||
package rs09.game.system.command.rottenpotato
|
package rs09.game.system.command.rottenpotato
|
||||||
|
|
||||||
|
import api.ContentAPI
|
||||||
import core.game.content.dialogue.DialoguePlugin
|
import core.game.content.dialogue.DialoguePlugin
|
||||||
import core.game.node.entity.player.Player
|
import core.game.node.entity.player.Player
|
||||||
import core.game.node.entity.player.info.login.PlayerParser
|
import core.game.node.entity.player.info.login.PlayerParser
|
||||||
@@ -52,37 +53,29 @@ class RottenPotatoRSHDDialogue(player: Player? = null) : DialoguePlugin(player)
|
|||||||
//View Bank
|
//View Bank
|
||||||
4 -> {
|
4 -> {
|
||||||
end()
|
end()
|
||||||
player.setAttribute("runscript", object : RunScript() {
|
ContentAPI.sendInputDialogue(player, false, "Enter player name:"){value ->
|
||||||
override fun handle(): Boolean {
|
val other = Repository.getPlayerByName(value.toString().toLowerCase().replace(" ","_"))
|
||||||
val other = Repository.getPlayerByName(getValue().toString().toLowerCase().replace(" ","_"))
|
if(other == null){
|
||||||
if(other == null){
|
player.sendMessage(colorize("%RInvalid player name."))
|
||||||
player.sendMessage(colorize("%RInvalid player name."))
|
return@sendInputDialogue
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
other.bank.open(player)
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
player.dialogueInterpreter.sendInput(true, "Enter the player name:")
|
other.bank.open(player)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//View Inventory
|
//View Inventory
|
||||||
5 -> {
|
5 -> {
|
||||||
end()
|
end()
|
||||||
player.setAttribute("runscript", object : RunScript() {
|
ContentAPI.sendInputDialogue(player, false, "Enter player name:"){value ->
|
||||||
override fun handle(): Boolean {
|
val other = Repository.getPlayerByName(value.toString().toLowerCase().replace(" ","_"))
|
||||||
val other = Repository.getPlayerByName(getValue().toString().toLowerCase().replace(" ","_"))
|
if(other == null){
|
||||||
if(other == null){
|
player.sendMessage(colorize("%RInvalid player name."))
|
||||||
player.sendMessage(colorize("%RInvalid player name."))
|
return@sendInputDialogue
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
player.inventory.clear()
|
|
||||||
player.inventory.addAll(other.inventory)
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
})
|
|
||||||
player.dialogueInterpreter.sendInput(true, "Enter the player name:")
|
player.inventory.clear()
|
||||||
|
player.inventory.addAll(other.inventory)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package rs09.game.system.command.sets
|
package rs09.game.system.command.sets
|
||||||
|
|
||||||
|
import api.ContentAPI
|
||||||
import core.cache.def.impl.ItemDefinition
|
import core.cache.def.impl.ItemDefinition
|
||||||
import core.cache.def.impl.NPCDefinition
|
import core.cache.def.impl.NPCDefinition
|
||||||
import core.cache.def.impl.ObjectDefinition
|
import core.cache.def.impl.ObjectDefinition
|
||||||
@@ -201,14 +202,10 @@ class MiscCommandSet : CommandSet(Command.Privilege.ADMIN){
|
|||||||
if (player.attributes.containsKey("replyTo")) {
|
if (player.attributes.containsKey("replyTo")) {
|
||||||
player.setAttribute("keepDialogueAlive", true)
|
player.setAttribute("keepDialogueAlive", true)
|
||||||
val replyTo = player.getAttribute("replyTo", "").replace("_".toRegex(), " ")
|
val replyTo = player.getAttribute("replyTo", "").replace("_".toRegex(), " ")
|
||||||
player.setAttribute("runscript", object : RunScript() {
|
ContentAPI.sendInputDialogue(player, false ,StringUtils.formatDisplayName(replyTo)){value ->
|
||||||
override fun handle(): Boolean {
|
CommunicationInfo.sendMessage(player, replyTo.toLowerCase(), value as String)
|
||||||
CommunicationInfo.sendMessage(player, replyTo.toLowerCase(), getValue() as String)
|
player.removeAttribute("keepDialogueAlive")
|
||||||
player.removeAttribute("keepDialogueAlive")
|
}
|
||||||
return true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
player.dialogueInterpreter.sendMessageInput(StringUtils.formatDisplayName(replyTo))
|
|
||||||
} else {
|
} else {
|
||||||
reject(player, "<col=3498db>You have not recieved any recent messages to which you can reply.")
|
reject(player, "<col=3498db>You have not recieved any recent messages to which you can reply.")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user