Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package core.game.interaction.inter;
|
package core.game.interaction.inter;
|
||||||
|
|
||||||
|
import api.ContentAPI;
|
||||||
import core.cache.def.impl.CS2Mapping;
|
import core.cache.def.impl.CS2Mapping;
|
||||||
import core.cache.def.impl.ItemDefinition;
|
import core.cache.def.impl.ItemDefinition;
|
||||||
import core.game.component.Component;
|
import core.game.component.Component;
|
||||||
@@ -19,6 +20,7 @@ import core.net.packet.context.ContainerContext;
|
|||||||
import core.net.packet.out.ContainerPacket;
|
import core.net.packet.out.ContainerPacket;
|
||||||
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.ge.PlayerGrandExchange;
|
import rs09.game.ge.PlayerGrandExchange;
|
||||||
import rs09.game.interaction.npc.BogrogPouchSwapper;
|
import rs09.game.interaction.npc.BogrogPouchSwapper;
|
||||||
@@ -333,17 +335,13 @@ public class GrandExchangeInterface extends ComponentPlugin {
|
|||||||
setOfferAmount(player, offer, amount + 1000);
|
setOfferAmount(player, offer, amount + 1000);
|
||||||
return true;
|
return true;
|
||||||
case 170: // value x
|
case 170: // value x
|
||||||
player.setAttribute("runscript", new RunScript() {
|
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
||||||
@Override
|
if (player.getInterfaceManager().getChatbox().getId() == 389) {
|
||||||
public boolean handle() {
|
player.getPlayerGrandExchange().openSearch();
|
||||||
if (player.getInterfaceManager().getChatbox().getId() == 389) {
|
|
||||||
player.getPlayerGrandExchange().openSearch();
|
|
||||||
}
|
|
||||||
setOfferAmount(player, offer, (int) value);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
setOfferAmount(player, offer, (int) value);
|
||||||
|
return Unit.INSTANCE;
|
||||||
});
|
});
|
||||||
player.getDialogueInterpreter().sendInput(false, "Enter the amount.");
|
|
||||||
return false;
|
return false;
|
||||||
case 180:
|
case 180:
|
||||||
if (offer != null) {
|
if (offer != null) {
|
||||||
@@ -370,17 +368,13 @@ public class GrandExchangeInterface extends ComponentPlugin {
|
|||||||
player.getPacketDispatch().sendMessage("Please select an offer first.");
|
player.getPacketDispatch().sendMessage("Please select an offer first.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
player.setAttribute("runscript", new RunScript() {
|
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
||||||
@Override
|
if (player.getInterfaceManager().getChatbox().getId() == 389) {
|
||||||
public boolean handle() {
|
player.getPlayerGrandExchange().openSearch();
|
||||||
if (player.getInterfaceManager().getChatbox().getId() == 389) {
|
|
||||||
player.getPlayerGrandExchange().openSearch();
|
|
||||||
}
|
|
||||||
setOfferValue(player, offer, (int) value);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
setOfferValue(player, offer, (int) value);
|
||||||
|
return Unit.INSTANCE;
|
||||||
});
|
});
|
||||||
player.getDialogueInterpreter().sendInput(false, "Enter the amount.");
|
|
||||||
return false;
|
return false;
|
||||||
case 195:
|
case 195:
|
||||||
player.getInterfaceManager().close();
|
player.getInterfaceManager().close();
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package core.game.interaction.inter;
|
package core.game.interaction.inter;
|
||||||
|
|
||||||
|
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;
|
||||||
@@ -13,6 +14,7 @@ import core.game.node.item.Item;
|
|||||||
import core.plugin.Plugin;
|
import core.plugin.Plugin;
|
||||||
import core.plugin.Initializable;
|
import core.plugin.Initializable;
|
||||||
import core.tools.StringUtils;
|
import core.tools.StringUtils;
|
||||||
|
import kotlin.Unit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the interface plugin used for jewellery crafting.
|
* Represents the interface plugin used for jewellery crafting.
|
||||||
@@ -178,14 +180,10 @@ public final class JewelleryInterface extends ComponentPlugin {
|
|||||||
break;
|
break;
|
||||||
case 199:
|
case 199:
|
||||||
final JewelleryItem d = data;
|
final JewelleryItem d = data;
|
||||||
player.setAttribute("runscript", new RunScript() {
|
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
||||||
@Override
|
JewelleryCrafting.make(player, d, (int) value);
|
||||||
public boolean handle() {
|
return Unit.INSTANCE;
|
||||||
JewelleryCrafting.make(player, d, (int) getValue());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
player.getDialogueInterpreter().sendInput(false, "Enter amount:");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if(!player.getSlayer().getLearned()[1] && data.equals(JewelleryItem.SLAYER_RING)){
|
if(!player.getSlayer().getLearned()[1] && data.equals(JewelleryItem.SLAYER_RING)){
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -10,6 +11,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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the leather crafting interface.
|
* Represents the leather crafting interface.
|
||||||
@@ -43,14 +45,10 @@ public final class LeatherCraftInterface extends ComponentPlugin {
|
|||||||
amount = player.getInventory().getAmount(new Item(LeatherCrafting.LEATHER));
|
amount = player.getInventory().getAmount(new Item(LeatherCrafting.LEATHER));
|
||||||
break;
|
break;
|
||||||
case 199:
|
case 199:
|
||||||
player.setAttribute("runscript", new RunScript() {
|
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
||||||
@Override
|
ContentAPI.submitIndividualPulse(player, new SoftCraftPulse(player, new Item(LeatherCrafting.LEATHER), soft, (int) value));
|
||||||
public boolean handle() {
|
return Unit.INSTANCE;
|
||||||
player.getPulseManager().run(new SoftCraftPulse(player, new Item(LeatherCrafting.LEATHER), soft, (int) getValue()));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
player.getDialogueInterpreter().sendInput(false, "Enter amount:");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
player.getPulseManager().run(new SoftCraftPulse(player, null, soft, amount));
|
player.getPulseManager().run(new SoftCraftPulse(player, null, soft, amount));
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -9,6 +10,7 @@ import core.game.node.entity.player.link.diary.DiaryType;
|
|||||||
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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the component handler for the interface 403.
|
* Represents the component handler for the interface 403.
|
||||||
@@ -64,14 +66,10 @@ public class SawmillPlankInterface extends ComponentPlugin {
|
|||||||
}
|
}
|
||||||
if (amount == 69) {
|
if (amount == 69) {
|
||||||
final Plank plankk = plank;
|
final Plank plankk = plank;
|
||||||
player.setAttribute("runscript", new RunScript() {
|
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
||||||
@Override
|
create(player, plankk, (int) value);
|
||||||
public boolean handle() {
|
return Unit.INSTANCE;
|
||||||
create(player, plankk, (int) super.getValue());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
player.getDialogueInterpreter().sendInput(false, "Enter the amount:");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (plank != null) {
|
if (plank != null) {
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ import core.game.node.item.Item;
|
|||||||
import core.net.packet.in.ExaminePacket;
|
import core.net.packet.in.ExaminePacket;
|
||||||
import core.plugin.Initializable;
|
import core.plugin.Initializable;
|
||||||
import core.plugin.Plugin;
|
import core.plugin.Plugin;
|
||||||
|
import kotlin.Unit;
|
||||||
|
import kotlin.jvm.functions.Function1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the plugin used to handle the shopping interface.
|
* Represents the plugin used to handle the shopping interface.
|
||||||
@@ -113,20 +115,17 @@ public final class ShoppingPlugin extends ComponentPlugin {
|
|||||||
* @return the script.
|
* @return the script.
|
||||||
* @param slot the slot.
|
* @param slot the slot.
|
||||||
*/
|
*/
|
||||||
private RunScript getRunScript(final ShopViewer viewer, final int slot, final int componentId) {
|
private Function1 getRunScript(final ShopViewer viewer, final int slot, final int componentId) {
|
||||||
return new RunScript() {
|
return (value) -> {
|
||||||
@Override
|
switch (componentId){
|
||||||
public boolean handle() {
|
|
||||||
switch (componentId){
|
|
||||||
case 620:
|
case 620:
|
||||||
viewer.getShop().buy(viewer.getPlayer(), slot, (int) getValue(), viewer.getTabIndex());
|
viewer.getShop().buy(viewer.getPlayer(), slot, (int) value, viewer.getTabIndex());
|
||||||
break;
|
break;
|
||||||
case 621:
|
case 621:
|
||||||
viewer.getShop().sell(viewer.getPlayer(), slot, (int) getValue(), viewer.getTabIndex());
|
viewer.getShop().sell(viewer.getPlayer(), slot, (int) value, viewer.getTabIndex());
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
return Unit.INSTANCE;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -53,20 +54,6 @@ public final class SkillTabInterface extends ComponentPlugin {
|
|||||||
p.sendMessage("You must be inside Edgeville bank to set levels.");
|
p.sendMessage("You must be inside Edgeville bank to set levels.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
p.getDialogueInterpreter().sendInput(true, "Enter the target level: ");
|
|
||||||
p.setAttribute("runscript", new RunScript() {
|
|
||||||
@Override
|
|
||||||
public boolean handle() {
|
|
||||||
final int target_level = Integer.parseInt((String) getValue());
|
|
||||||
if (target_level > 99 || target_level == -1) {
|
|
||||||
player.getPacketDispatch().sendMessage("Invalid target level.");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
p.getSkills().setStaticLevel(config.getSkillId(), target_level);
|
|
||||||
p.getSkills().setLevel(config.getSkillId(), target_level);
|
|
||||||
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;
|
||||||
@@ -9,6 +10,7 @@ import core.game.node.entity.skill.smithing.smelting.SmeltingPulse;
|
|||||||
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.Plugin;
|
import core.plugin.Plugin;
|
||||||
|
import kotlin.Unit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author 'Vexia
|
* @author 'Vexia
|
||||||
@@ -29,16 +31,11 @@ public class SmeltingInterface extends ComponentPlugin {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (barType.getAmount() == -1) {
|
if (barType.getAmount() == -1) {
|
||||||
player.setAttribute("runscript", new RunScript() {
|
|
||||||
@Override
|
|
||||||
public boolean handle() {
|
|
||||||
int ammount = (int) value;
|
|
||||||
player.getPulseManager().run(new SmeltingPulse(player, null, barType.getBar(), ammount));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
player.getInterfaceManager().closeChatbox();
|
player.getInterfaceManager().closeChatbox();
|
||||||
player.getDialogueInterpreter().sendInput(false, "Enter the amount:");
|
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
||||||
|
ContentAPI.submitIndividualPulse(player, new SmeltingPulse(player, null, barType.getBar(), (int) value));
|
||||||
|
return Unit.INSTANCE;
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
player.getPulseManager().run(new SmeltingPulse(player, null, barType.getBar(), barType.getAmount()));
|
player.getPulseManager().run(new SmeltingPulse(player, null, barType.getBar(), barType.getAmount()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.node.entity.player.Player;
|
|||||||
import core.game.node.entity.player.link.RunScript;
|
import core.game.node.entity.player.link.RunScript;
|
||||||
import core.game.node.item.Item;
|
import core.game.node.item.Item;
|
||||||
import core.plugin.Plugin;
|
import core.plugin.Plugin;
|
||||||
|
import kotlin.Unit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author 'Vexia
|
* @author 'Vexia
|
||||||
@@ -36,15 +38,10 @@ public class SmithingInterface extends ComponentPlugin {
|
|||||||
p.getGameAttributes().setAttribute("smith-bar", bar);
|
p.getGameAttributes().setAttribute("smith-bar", bar);
|
||||||
p.getGameAttributes().setAttribute("smith-item", item);
|
p.getGameAttributes().setAttribute("smith-item", item);
|
||||||
if (amount == -1) {
|
if (amount == -1) {
|
||||||
p.setAttribute("runscript", new RunScript() {
|
ContentAPI.sendInputDialogue(p, true, "Enter the amount:", (value) -> {
|
||||||
@Override
|
p.getPulseManager().run(new SmithingPulse(p, new Item((int) p.getGameAttributes().getAttribute("smith-item"), (int) value), (Bars) p.getGameAttributes().getAttribute("smith-bar"), (int) value));
|
||||||
public boolean handle() {
|
return Unit.INSTANCE;
|
||||||
final int ammount = (int) value;
|
|
||||||
p.getPulseManager().run(new SmithingPulse(p, new Item((int) p.getGameAttributes().getAttribute("smith-item"), ammount), (Bars) p.getGameAttributes().getAttribute("smith-bar"), ammount));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
p.getDialogueInterpreter().sendInput(false, "Enter the amount.");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
p.getPulseManager().run(new SmithingPulse(p, new Item(item, amount), Bars.forId(item), amount));
|
p.getPulseManager().run(new SmithingPulse(p, new Item(item, amount), Bars.forId(item), amount));
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package core.game.interaction.inter;
|
package core.game.interaction.inter;
|
||||||
|
|
||||||
|
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;
|
||||||
@@ -11,6 +12,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;
|
||||||
|
|
||||||
@Initializable
|
@Initializable
|
||||||
public class SpinningInterface extends ComponentPlugin {
|
public class SpinningInterface extends ComponentPlugin {
|
||||||
@@ -43,15 +45,10 @@ public class SpinningInterface extends ComponentPlugin {
|
|||||||
amt = p.getInventory().getAmount(new Item(spin.getNeed()));
|
amt = p.getInventory().getAmount(new Item(spin.getNeed()));
|
||||||
break;
|
break;
|
||||||
case 199:
|
case 199:
|
||||||
p.setAttribute("runscript", new RunScript() {
|
ContentAPI.sendInputDialogue(p, true, "Enter the amount:", (value) -> {
|
||||||
@Override
|
ContentAPI.submitIndividualPulse(p, new SpinningPulse(p, new Item(spin.getNeed(), 1), (int) value, spin));
|
||||||
public boolean handle() {
|
return Unit.INSTANCE;
|
||||||
int ammount = (int) value;
|
|
||||||
p.getPulseManager().run(new SpinningPulse(p, new Item(spin.getNeed(), 1), ammount, spin));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
p.getDialogueInterpreter().sendInput(false, "Enter the amount.");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (opcode == 199) {
|
if (opcode == 199) {
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Vexia
|
* @author Vexia
|
||||||
@@ -73,15 +75,10 @@ public class TanningInterface extends ComponentPlugin {
|
|||||||
case 124:
|
case 124:
|
||||||
amount = 10;
|
amount = 10;
|
||||||
case 199:
|
case 199:
|
||||||
player.setAttribute("runscript", new RunScript() {
|
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
||||||
@Override
|
TanningProduct.tan(player, (int) value, deff);
|
||||||
public boolean handle() {
|
return Unit.INSTANCE;
|
||||||
int amt = (int) getValue();
|
|
||||||
TanningProduct.tan(player, amt, deff);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
player.getDialogueInterpreter().sendInput(false, "Enter amount:");
|
|
||||||
break;
|
break;
|
||||||
case 234:
|
case 234:
|
||||||
amount = player.getInventory().getAmount(new Item(def.getItem(), 1));
|
amount = player.getInventory().getAmount(new Item(def.getItem(), 1));
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -8,6 +9,7 @@ import core.game.node.entity.player.link.RunScript;
|
|||||||
import core.game.node.entity.player.link.request.trade.TradeModule;
|
import core.game.node.entity.player.link.request.trade.TradeModule;
|
||||||
import core.plugin.Initializable;
|
import core.plugin.Initializable;
|
||||||
import core.plugin.Plugin;
|
import core.plugin.Plugin;
|
||||||
|
import kotlin.Unit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the interface plugin used to handle all trade related functions.
|
* Represents the interface plugin used to handle all trade related functions.
|
||||||
@@ -66,14 +68,10 @@ public final class TradeInterfacePlugin extends ComponentPlugin {
|
|||||||
module.getContainer().withdraw(slot, module.getContainer().getAmount(module.getContainer().get(slot)));
|
module.getContainer().withdraw(slot, module.getContainer().getAmount(module.getContainer().get(slot)));
|
||||||
break;
|
break;
|
||||||
case 234:
|
case 234:
|
||||||
player.setAttribute("runscript", new RunScript() {
|
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
||||||
@Override
|
module.getContainer().withdraw(slot, (int) value);
|
||||||
public boolean handle() {
|
return Unit.INSTANCE;
|
||||||
module.getContainer().withdraw(slot, (int) getValue());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
player.getDialogueInterpreter().sendInput(false, "Enter the amount:");
|
|
||||||
break;
|
break;
|
||||||
case 9:// examine.
|
case 9:// examine.
|
||||||
if (TradeModule.getExtension(button == 32 ? module.getTarget() : player) == null) {
|
if (TradeModule.getExtension(button == 32 ? module.getTarget() : player) == null) {
|
||||||
@@ -98,14 +96,10 @@ public final class TradeInterfacePlugin extends ComponentPlugin {
|
|||||||
module.getContainer().offer(slot, player.getInventory().getAmount(player.getInventory().get(slot)));
|
module.getContainer().offer(slot, player.getInventory().getAmount(player.getInventory().get(slot)));
|
||||||
break;
|
break;
|
||||||
case 234:
|
case 234:
|
||||||
player.setAttribute("runscript", new RunScript() {
|
ContentAPI.sendInputDialogue(player, true, "Enter the amount:", (value) -> {
|
||||||
@Override
|
module.getContainer().offer(slot, (int) value);
|
||||||
public boolean handle() {
|
return Unit.INSTANCE;
|
||||||
module.getContainer().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());
|
||||||
|
|||||||
@@ -446,16 +446,11 @@ public final class BankingPlugin extends OptionHandler {
|
|||||||
p.getBank().addItem(slot, p.getBank().getLastAmountX());
|
p.getBank().addItem(slot, 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().addItem(slot, (int) value);
|
||||||
public boolean handle() {
|
p.getBank().updateLastAmountX((int) value);
|
||||||
int amount = (int) value;
|
return Unit.INSTANCE;
|
||||||
p.getBank().addItem(slot, amount);
|
|
||||||
p.getBank().updateLastAmountX(amount);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
p.getDialogueInterpreter().sendInput(false, "Enter the amount.");
|
|
||||||
break;
|
break;
|
||||||
case 168:
|
case 168:
|
||||||
p.getBank().addItem(slot, p.getInventory().getAmount(item));
|
p.getBank().addItem(slot, p.getInventory().getAmount(item));
|
||||||
|
|||||||
Reference in New Issue
Block a user