mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-09 16:45:44 -07:00
Implemented Hunters' Crossbow
This commit is contained in:
parent
93890769e1
commit
6c386e6ed2
10 changed files with 180 additions and 466 deletions
|
|
@ -72370,6 +72370,11 @@
|
||||||
"name": "Eclectic Impling",
|
"name": "Eclectic Impling",
|
||||||
"id": "1033"
|
"id": "1033"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"examine": "He seems to be making odd sucking noises with his teeth.",
|
||||||
|
"name": "Leon",
|
||||||
|
"id": "5111"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"examine": "A very stealthy impling.",
|
"examine": "A very stealthy impling.",
|
||||||
"name": "Ninja Impling",
|
"name": "Ninja Impling",
|
||||||
|
|
|
||||||
|
|
@ -2177,5 +2177,14 @@
|
||||||
"id": "255",
|
"id": "255",
|
||||||
"title": "Castle Wars Ticket Exchange",
|
"title": "Castle Wars Ticket Exchange",
|
||||||
"stock": "{4068,1,100}-{4069,1,100}-{4070,1,100}-{4071,1,100}-{4072,1,100}-{4503,1,100}-{4504,1,100}-{4505,1,100}-{4506,1,100}-{4507,1,100}-{4508,1,100}-{4509,1,100}-{4510,1,100}-{4511,1,100}-{4512,1,100}-{4513,1,100}-{4514,1,100}-{4515,1,100}-{4516,1,100}"
|
"stock": "{4068,1,100}-{4069,1,100}-{4070,1,100}-{4071,1,100}-{4072,1,100}-{4503,1,100}-{4504,1,100}-{4505,1,100}-{4506,1,100}-{4507,1,100}-{4508,1,100}-{4509,1,100}-{4510,1,100}-{4511,1,100}-{4512,1,100}-{4513,1,100}-{4514,1,100}-{4515,1,100}-{4516,1,100}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"npcs": "5111",
|
||||||
|
"high_alch": "0",
|
||||||
|
"currency": "995",
|
||||||
|
"general_store": "false",
|
||||||
|
"id": "256",
|
||||||
|
"title": "Leon's Prototype Crossbow",
|
||||||
|
"stock": "{10156,2,100}"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
@ -1,51 +0,0 @@
|
||||||
/*
|
|
||||||
package core.game.node.entity.skill.fletching;
|
|
||||||
|
|
||||||
import core.game.dialogue.SkillDialogueHandler;
|
|
||||||
import core.game.dialogue.SkillDialogueHandler.SkillDialogue;
|
|
||||||
import core.game.node.entity.skill.fletching.items.bolts.Bolt;
|
|
||||||
import core.game.node.entity.skill.fletching.items.bolts.BoltPulse;
|
|
||||||
import org.crandor.game.interaction.NodeUsageEvent;
|
|
||||||
import org.crandor.game.interaction.UseWithHandler;
|
|
||||||
import org.crandor.game.node.entity.player.Player;
|
|
||||||
import org.crandor.net.packet.PacketRepository;
|
|
||||||
import org.crandor.net.packet.context.ChildPositionContext;
|
|
||||||
import org.crandor.net.packet.out.RepositionChild;
|
|
||||||
import org.crandor.plugin.InitializablePlugin;
|
|
||||||
import org.crandor.plugin.Plugin;
|
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Represents the bolt creating plugin.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @version 1.0
|
|
||||||
*//*
|
|
||||||
|
|
||||||
@InitializablePlugin
|
|
||||||
public final class BoltCreatePlugin extends UseWithHandler {
|
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code BoltCreatePlugin} {@code Object}.
|
|
||||||
*//*
|
|
||||||
|
|
||||||
public BoltCreatePlugin() {
|
|
||||||
super(314);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
|
||||||
for (Bolt bolt : Bolt.values()) {
|
|
||||||
addHandler(bolt.getItem().getId(), ITEM_TYPE, this);
|
|
||||||
}
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handle(final NodeUsageEvent event) {
|
|
||||||
final Player player = event.getPlayer();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
@ -1,45 +0,0 @@
|
||||||
//package core.game.node.entity.skill.fletching;
|
|
||||||
//
|
|
||||||
//import core.game.dialogue.SkillDialogueHandler;
|
|
||||||
//import core.game.dialogue.SkillDialogueHandler.SkillDialogue;
|
|
||||||
//import core.game.node.entity.skill.fletching.items.gem.GemBolt;
|
|
||||||
//import core.game.node.entity.skill.fletching.items.gem.GemBoltPulse;
|
|
||||||
//import org.crandor.game.interaction.NodeUsageEvent;
|
|
||||||
//import org.crandor.game.interaction.UseWithHandler;
|
|
||||||
//import org.crandor.game.node.entity.player.Player;
|
|
||||||
//import org.crandor.net.packet.PacketRepository;
|
|
||||||
//import org.crandor.net.packet.context.ChildPositionContext;
|
|
||||||
//import org.crandor.net.packet.out.RepositionChild;
|
|
||||||
//import org.crandor.plugin.InitializablePlugin;
|
|
||||||
//import org.crandor.plugin.Plugin;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * Represents the plugin used to handle gem bolt making.
|
|
||||||
// * @author 'Vexia
|
|
||||||
// * @version 1.0
|
|
||||||
// */
|
|
||||||
//@InitializablePlugin
|
|
||||||
//public class BoltGemPlugin extends UseWithHandler {
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * Constructs a new {@code BoltGemPlugin} {@code Object}.
|
|
||||||
// */
|
|
||||||
// public BoltGemPlugin() {
|
|
||||||
// super(45, 46, 9187, 9188, 9189, 9190, 9191, 9192, 9193, 9194);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public Plugin<Object> newInstance(Object arg) throws Throwable {
|
|
||||||
// for (GemBolt bolt : GemBolt.values()) {
|
|
||||||
// addHandler(bolt.getBase().getId(), ITEM_TYPE, this);
|
|
||||||
// }
|
|
||||||
// return this;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public boolean handle(final NodeUsageEvent event) {
|
|
||||||
// final Player player = event.getPlayer();
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//}
|
|
||||||
|
|
@ -1,49 +0,0 @@
|
||||||
/*
|
|
||||||
package core.game.node.entity.skill.fletching;
|
|
||||||
|
|
||||||
import core.game.node.entity.skill.fletching.items.darts.Dart;
|
|
||||||
import org.crandor.game.interaction.NodeUsageEvent;
|
|
||||||
import org.crandor.game.interaction.UseWithHandler;
|
|
||||||
import org.crandor.plugin.InitializablePlugin;
|
|
||||||
import org.crandor.plugin.Plugin;
|
|
||||||
import core.game.content.quest.touristrap.TouristTrap;
|
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Represents the plugin used to create a dart.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @version 1.0
|
|
||||||
*//*
|
|
||||||
|
|
||||||
@InitializablePlugin
|
|
||||||
public final class DartCreatePlugin extends UseWithHandler {
|
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code DartCreatePlugin} {@code Object}.
|
|
||||||
*//*
|
|
||||||
|
|
||||||
public DartCreatePlugin() {
|
|
||||||
super(314);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
|
||||||
for (Dart dart : Dart.values()) {
|
|
||||||
addHandler(dart.getItem().getId(), ITEM_TYPE, this);
|
|
||||||
}
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handle(NodeUsageEvent event) {
|
|
||||||
if (event.getPlayer().getQuestRepository().getQuest(TouristTrap.NAME).getStage(event.getPlayer()) < 60) {
|
|
||||||
event.getPlayer().getPacketDispatch().sendMessage("You need to start Tourist Trap in order to do this.");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
event.getPlayer().getDialogueInterpreter().open(328933, event.getUsedItem(), event.getBaseItem());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
@ -1,137 +0,0 @@
|
||||||
/*
|
|
||||||
package core.game.node.entity.skill.fletching;
|
|
||||||
|
|
||||||
import org.crandor.game.node.item.Item;
|
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Represents a fletching item to make.
|
|
||||||
* @author 'Vexia
|
|
||||||
*//*
|
|
||||||
|
|
||||||
public enum FletchItem {
|
|
||||||
ARROW_SHAFT(FletchType.LOG, new Item(52, 15), 1, 5), SHORTBOW(FletchType.LOG, new Item(50), 5, 5),
|
|
||||||
LONGBOW(FletchType.LOG, new Item(48), 10, 10),
|
|
||||||
OAK_SHORTBOW(FletchType.OAK, new Item(54), 20, 16.5),
|
|
||||||
OAK_LONGBOW(FletchType.OAK, new Item(56), 25, 25),
|
|
||||||
WILLOW_SHORTBOW(FletchType.WILLOW, new Item(60), 35, 33.3),
|
|
||||||
WILLOW_LONGBOW(FletchType.WILLOW, new Item(58), 40, 41.5),
|
|
||||||
MAPLE_SHORTBOW(FletchType.MAPLE, new Item(64), 50, 50),
|
|
||||||
MAPLE_LONGBOW(FletchType.MAPLE, new Item(62), 55, 58.3),
|
|
||||||
YEW_SHORTBOW(FletchType.YEW, new Item(68), 65, 55),
|
|
||||||
YEW_LONGBOW(FletchType.YEW, new Item(66), 70, 75),
|
|
||||||
MAGIC_SHORTBOW(FletchType.MAGIC, new Item(72), 80, 83.3),
|
|
||||||
MAGIC_LONGBOW(FletchType.MAGIC, new Item(70), 85, 91.5),
|
|
||||||
WOODEN_STOCK(FletchType.LOG, new Item(9440), 9, 6),
|
|
||||||
OAK_STOCK(FletchType.OAK, new Item(9442), 24, 16),
|
|
||||||
WILLOW_STOCK(FletchType.WILLOW, new Item(9444), 39, 22),
|
|
||||||
TEAK_STOCK(FletchType.TEAK, new Item(9446), 46, 27),
|
|
||||||
MAPLE_STOCK(FletchType.MAPLE, new Item(9448), 54, 32),
|
|
||||||
MAHOGANY_STOCK(FletchType.MAHOGANY, new Item(9450), 61, 41),
|
|
||||||
YEW_STOCK(FletchType.YEW, new Item(9452), 69, 50);
|
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code FletchItem.java} {@code Object}.
|
|
||||||
* @param type the type.
|
|
||||||
* @param product the product.
|
|
||||||
* @param level the level.
|
|
||||||
* @param experience the experience.
|
|
||||||
*//*
|
|
||||||
|
|
||||||
FletchItem(final FletchType type, final Item product, final int level, final double experience) {
|
|
||||||
this.type = type;
|
|
||||||
this.product = product;
|
|
||||||
this.level = level;
|
|
||||||
this.experience = experience;
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Represents the type this item pertaint o.
|
|
||||||
*//*
|
|
||||||
|
|
||||||
private FletchType type;
|
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Represents the product of this item.
|
|
||||||
*//*
|
|
||||||
|
|
||||||
private Item product;
|
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Represents the level.
|
|
||||||
*//*
|
|
||||||
|
|
||||||
private final int level;
|
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Represents the experience.
|
|
||||||
*//*
|
|
||||||
|
|
||||||
private final double experience;
|
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Gets the type.
|
|
||||||
* @return The type.
|
|
||||||
*//*
|
|
||||||
|
|
||||||
public FletchType getType() {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Sets the type.
|
|
||||||
* @param type The type to set.
|
|
||||||
*//*
|
|
||||||
|
|
||||||
public void setType(FletchType type) {
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Gets the product.
|
|
||||||
* @return The product.
|
|
||||||
*//*
|
|
||||||
|
|
||||||
public Item getProduct() {
|
|
||||||
return product;
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Sets the product.
|
|
||||||
* @param product The product to set.
|
|
||||||
*//*
|
|
||||||
|
|
||||||
public void setProduct(Item product) {
|
|
||||||
this.product = product;
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Gets the level.
|
|
||||||
* @return The level.
|
|
||||||
*//*
|
|
||||||
|
|
||||||
public int getLevel() {
|
|
||||||
return level;
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Gets the experience.
|
|
||||||
* @return The experience.
|
|
||||||
*//*
|
|
||||||
|
|
||||||
public double getExperience() {
|
|
||||||
return experience;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
@ -1,88 +0,0 @@
|
||||||
/*
|
|
||||||
package core.game.node.entity.skill.fletching;
|
|
||||||
|
|
||||||
import org.crandor.game.component.Component;
|
|
||||||
import org.crandor.game.node.item.Item;
|
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Represents the multiple fletching types(log types)
|
|
||||||
* @author 'Vexia
|
|
||||||
*//*
|
|
||||||
|
|
||||||
public enum FletchType {
|
|
||||||
LOG(new Item(1511), FletchItem.ARROW_SHAFT, FletchItem.SHORTBOW, FletchItem.LONGBOW, FletchItem.WOODEN_STOCK), OAK(new Item(1521), FletchItem.OAK_SHORTBOW, FletchItem.OAK_LONGBOW, FletchItem.OAK_STOCK), WILLOW(new Item(1519), FletchItem.WILLOW_SHORTBOW, FletchItem.WILLOW_LONGBOW, FletchItem.WILLOW_STOCK), MAPLE(new Item(1517), FletchItem.MAPLE_SHORTBOW, FletchItem.MAPLE_LONGBOW, FletchItem.MAPLE_STOCK), TEAK(new Item(6333), FletchItem.TEAK_STOCK), MAHOGANY(new Item(6332), FletchItem.MAHOGANY_STOCK), YEW(new Item(1515), FletchItem.YEW_SHORTBOW, FletchItem.YEW_LONGBOW, FletchItem.YEW_STOCK), MAGIC(new Item(1513), FletchItem.MAGIC_SHORTBOW, FletchItem.MAGIC_LONGBOW);
|
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code FletchType} {@code Object}.
|
|
||||||
* @param log the log.
|
|
||||||
* @param items the item.s
|
|
||||||
*//*
|
|
||||||
|
|
||||||
FletchType(final Item log, final FletchItem... items) {
|
|
||||||
this.log = log;
|
|
||||||
this.items = items;
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Represents the log of this type.
|
|
||||||
*//*
|
|
||||||
|
|
||||||
private final Item log;
|
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Represents the fletching items of this type.
|
|
||||||
*//*
|
|
||||||
|
|
||||||
private FletchItem[] items;
|
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Gets the items.
|
|
||||||
* @return The items.
|
|
||||||
*//*
|
|
||||||
|
|
||||||
public FletchItem[] getItems() {
|
|
||||||
return items;
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Gets the log.
|
|
||||||
* @return The log.
|
|
||||||
*//*
|
|
||||||
|
|
||||||
public Item getLog() {
|
|
||||||
return log;
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Method used to get the component based on type.
|
|
||||||
* @return the component.
|
|
||||||
*//*
|
|
||||||
|
|
||||||
public Component getComponent() {
|
|
||||||
return items.length > 1 ? new Component(301 + items.length) : new Component(309);
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Method used to get the <code>FletchType</code> based on the log item.
|
|
||||||
* @param item the item.
|
|
||||||
* @return the fletch type.
|
|
||||||
*//*
|
|
||||||
|
|
||||||
public static FletchType forItem(final Item item) {
|
|
||||||
for (FletchType type : FletchType.values()) {
|
|
||||||
if (type.getLog().getId() == item.getId()) {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
@ -6,6 +6,7 @@ import content.global.skill.fletching.items.arrow.ArrowHeadPulse
|
||||||
import content.global.skill.fletching.items.arrow.HeadlessArrowPulse
|
import content.global.skill.fletching.items.arrow.HeadlessArrowPulse
|
||||||
import content.global.skill.fletching.items.bow.StringPulse
|
import content.global.skill.fletching.items.bow.StringPulse
|
||||||
import content.global.skill.fletching.items.crossbow.LimbPulse
|
import content.global.skill.fletching.items.crossbow.LimbPulse
|
||||||
|
import core.api.*
|
||||||
import core.game.node.item.Item
|
import core.game.node.item.Item
|
||||||
import core.net.packet.PacketRepository
|
import core.net.packet.PacketRepository
|
||||||
import core.net.packet.context.ChildPositionContext
|
import core.net.packet.context.ChildPositionContext
|
||||||
|
|
@ -21,6 +22,7 @@ import org.rs09.consts.Items.YELLOW_FEATHER_10090
|
||||||
import core.game.dialogue.SkillDialogueHandler
|
import core.game.dialogue.SkillDialogueHandler
|
||||||
import core.game.interaction.InteractionListener
|
import core.game.interaction.InteractionListener
|
||||||
import core.game.interaction.IntType
|
import core.game.interaction.IntType
|
||||||
|
import core.game.node.entity.player.Player
|
||||||
|
|
||||||
class FletchingListeners : InteractionListener {
|
class FletchingListeners : InteractionListener {
|
||||||
|
|
||||||
|
|
@ -134,6 +136,36 @@ class FletchingListeners : InteractionListener {
|
||||||
return@onUseWith true
|
return@onUseWith true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* (Long) Kebbit bolts don't need feathers and go 6 at a time so use their own interaction
|
||||||
|
*/
|
||||||
|
fun makeKebbitBolt(player : Player, ingredient : Item) : Boolean{
|
||||||
|
val longBolts = when(ingredient.id){
|
||||||
|
Items.KEBBIT_SPIKE_10105 -> false
|
||||||
|
Items.LONG_KEBBIT_SPIKE_10107 -> true
|
||||||
|
else -> return false
|
||||||
|
}
|
||||||
|
val level = if(longBolts) 42 else 26
|
||||||
|
if (getDynLevel(player, Skills.FLETCHING) < level){
|
||||||
|
sendMessage(player, "You need a fletching level of $level to create ${if (longBolts) "long " else ""}kebbit bolts.")
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
val finalProduct = if(longBolts) Items.LONG_KEBBIT_BOLTS_10159 else Items.KEBBIT_BOLTS_10158
|
||||||
|
val xp = if(longBolts) 47.7 else 28.6 // source https://runescape.wiki/w/Fletching?oldid=1069981#Bolts_2
|
||||||
|
if(removeItem(player, ingredient.id)){
|
||||||
|
addItem(player, finalProduct, 6)
|
||||||
|
player.skills.addExperience(Skills.FLETCHING, xp)
|
||||||
|
animate(player, 885)
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
onUseWith(IntType.ITEM, Items.CHISEL_1755, Items.KEBBIT_SPIKE_10105) { player, used, with ->
|
||||||
|
return@onUseWith makeKebbitBolt(player, with as Item)
|
||||||
|
}
|
||||||
|
|
||||||
|
onUseWith(IntType.ITEM, Items.CHISEL_1755, Items.LONG_KEBBIT_SPIKE_10107) { player, used, with ->
|
||||||
|
return@onUseWith makeKebbitBolt(player, with as Item)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,96 +0,0 @@
|
||||||
package content.region.kandarin.yanille.dialogue;
|
|
||||||
|
|
||||||
import core.game.dialogue.DialoguePlugin;
|
|
||||||
import core.game.dialogue.FacialExpression;
|
|
||||||
import core.game.node.entity.npc.NPC;
|
|
||||||
import core.plugin.Initializable;
|
|
||||||
import core.game.node.entity.player.Player;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the dialogue plugin used for the leon npc.
|
|
||||||
* @author 'Vexia
|
|
||||||
* @version 1.0
|
|
||||||
*/
|
|
||||||
@Initializable
|
|
||||||
public final class LeonDialogue extends DialoguePlugin {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code LeonDialogue} {@code Object}.
|
|
||||||
*/
|
|
||||||
public LeonDialogue() {
|
|
||||||
/**
|
|
||||||
* empty.
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructs a new {@code LeonDialogue} {@code Object}.
|
|
||||||
* @param player the player.
|
|
||||||
*/
|
|
||||||
public LeonDialogue(Player player) {
|
|
||||||
super(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public DialoguePlugin newInstance(Player player) {
|
|
||||||
return new LeonDialogue(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean open(Object... args) {
|
|
||||||
npc = (NPC) args[0];
|
|
||||||
interpreter.sendOptions("Select an Option", "What is this place?", "Can I have a go with your crossbow?", "What are you holding there?");
|
|
||||||
stage = 1;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean handle(int interfaceId, int buttonId) {
|
|
||||||
switch (stage) {
|
|
||||||
case 1:
|
|
||||||
switch (buttonId) {
|
|
||||||
case 1:
|
|
||||||
interpreter.sendDialogues(player, FacialExpression.ASKING, "What is this place?");
|
|
||||||
stage = 10;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
interpreter.sendDialogues(player, FacialExpression.FRIENDLY, "Can I have a go with your crossbow?");
|
|
||||||
stage = 20;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
interpreter.sendDialogues(player, FacialExpression.ASKING, "What are you holding there?");
|
|
||||||
stage = 30;
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 10:
|
|
||||||
interpreter.sendDialogues(npc, FacialExpression.HAPPY, "This is Aleck's Hunter Emporium. Basically, it's just a", "shop with fancy name; you can buy various weapons", "and traps here.");
|
|
||||||
stage = 11;
|
|
||||||
break;
|
|
||||||
case 11:
|
|
||||||
end();
|
|
||||||
break;
|
|
||||||
case 20:
|
|
||||||
interpreter.sendDialogues(npc, FacialExpression.HALF_GUILTY, "I'm afraid with it being a prototype, I've only got a few", "for my own testing purposes.");
|
|
||||||
stage = 21;
|
|
||||||
break;
|
|
||||||
case 21:
|
|
||||||
end();
|
|
||||||
break;
|
|
||||||
case 30:
|
|
||||||
interpreter.sendDialogues(npc, FacialExpression.HAPPY, "This? This is a prototype for a new type of crossbow", "I've been designing.");
|
|
||||||
stage = 31;
|
|
||||||
break;
|
|
||||||
case 31:
|
|
||||||
end();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] getIds() {
|
|
||||||
return new int[] { 5111 };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,134 @@
|
||||||
|
package content.region.kandarin.yanille.dialogue
|
||||||
|
|
||||||
|
import core.api.*
|
||||||
|
import core.game.dialogue.DialoguePlugin
|
||||||
|
import core.game.dialogue.FacialExpression
|
||||||
|
import core.game.dialogue.IfTopic
|
||||||
|
import core.game.dialogue.Topic
|
||||||
|
import core.game.node.entity.npc.NPC
|
||||||
|
import core.game.node.entity.player.Player
|
||||||
|
import core.game.node.item.Item
|
||||||
|
import core.plugin.Initializable
|
||||||
|
import core.tools.END_DIALOGUE
|
||||||
|
import org.rs09.consts.Items
|
||||||
|
import org.rs09.consts.NPCs
|
||||||
|
|
||||||
|
@Initializable
|
||||||
|
class LeonDialogue (player: Player? = null) : DialoguePlugin(player) {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
const val WHAT_IS_THIS_PLACE = 10
|
||||||
|
const val BUY_GEAR = 20
|
||||||
|
const val ABOUT_CBOW = 30
|
||||||
|
const val ABOUT_AMMO = 40
|
||||||
|
const val BYE = 50
|
||||||
|
const val CRAZY = 60
|
||||||
|
const val TRADE = 70
|
||||||
|
const val MAKE_OWN_AMMO = 80
|
||||||
|
const val CRAFT_AMMO = 90
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun open(vararg args: Any?): Boolean {
|
||||||
|
npc = args[0] as NPC
|
||||||
|
if (hasAnItem(player, Items.HUNTERS_CROSSBOW_10156).exists()) npcl(FacialExpression.HAPPY, "Oh, hey, you have one of my crossbows! How's it working for you?")
|
||||||
|
else sendItemDialogue(player, Items.HUNTERS_CROSSBOW_10156,"Leon is gazing intently at the crossbow in his hands.")
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
override fun handle(interfaceId: Int, buttonId: Int): Boolean {
|
||||||
|
when(stage){
|
||||||
|
0 -> showTopics(
|
||||||
|
IfTopic("It's okay, thanks.", 0, hasAnItem(player, Items.HUNTERS_CROSSBOW_10156).exists()),
|
||||||
|
Topic("What is this place?", WHAT_IS_THIS_PLACE),
|
||||||
|
Topic("Can you tell me about your crossbow?", ABOUT_CBOW),
|
||||||
|
Topic("Tell me about the ammo for your crossbow.", ABOUT_AMMO),
|
||||||
|
Topic("I'll be off now, excuse me.", BYE),
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
WHAT_IS_THIS_PLACE -> npcl(FacialExpression.NEUTRAL, "This is Aleck's Hunter Emporium. Basically, it's just a shop with a fancy name; you can buy various weapons and traps here.").also { stage++ }
|
||||||
|
WHAT_IS_THIS_PLACE + 1 -> showTopics(
|
||||||
|
Topic("Can I buy some equipment from the shop then?", BUY_GEAR),
|
||||||
|
Topic("Can you tell me about your crossbow?", ABOUT_CBOW),
|
||||||
|
Topic("Tell me about the ammo for your crossbow.", ABOUT_AMMO),
|
||||||
|
Topic("I'll be off now, excuse me.", BYE)
|
||||||
|
)
|
||||||
|
|
||||||
|
BUY_GEAR -> npcl(FacialExpression.NEUTRAL, "Oh, this isn't my shop; the owner is Aleck over there behind the counter.").also { stage++ }
|
||||||
|
BUY_GEAR + 1 -> npcl(FacialExpression.NEUTRAL, "I experiment with weapon designs. I'm here because I've been trying to convince people to back my research and maybe sell some of my products - like this one I'm holding - in their shops.").also { stage++ }
|
||||||
|
BUY_GEAR + 2 -> npcl(FacialExpression.SAD, "Aleck doesn't seem to be interested, though.").also { stage++ }
|
||||||
|
BUY_GEAR + 3 -> showTopics(
|
||||||
|
Topic("Can you tell me about your crossbow?", ABOUT_CBOW),
|
||||||
|
Topic("Tell me about the ammo for your crossbow.", ABOUT_AMMO),
|
||||||
|
Topic("I'll be off now, excuse me.", BYE)
|
||||||
|
)
|
||||||
|
|
||||||
|
ABOUT_CBOW -> npcl(FacialExpression.HAPPY, "It's good, isn't it? I designed it to incorporate the bones of various animals in its construction.").also { stage++ }
|
||||||
|
ABOUT_CBOW + 1 -> npcl(FacialExpression.HAPPY, "It's a fair bit faster than an ordinary crossbow too; it'll take you far less time to reload between shots.").also { stage++ }
|
||||||
|
ABOUT_CBOW + 2 -> showTopics(
|
||||||
|
Topic("That's crazy, it'll never work!", CRAZY),
|
||||||
|
Topic("That sounds good. Let's trade.", TRADE)
|
||||||
|
)
|
||||||
|
|
||||||
|
CRAZY -> npcl(FacialExpression.HALF_THINKING, "That's what they said about my wind-powered mouse traps, too.").also { stage++ }
|
||||||
|
CRAZY + 1 -> playerl(FacialExpression.HALF_WORRIED, "And did they work?").also { stage++ }
|
||||||
|
CRAZY + 2 -> npcl(FacialExpression.HALF_THINKING, "Well, they only ran into problems because people kept insisting on trying to use them indoors.").also { stage++ }
|
||||||
|
CRAZY + 3 -> npcl(FacialExpression.HAPPY, "Anyway, I think my crossbow invention is showing a lot more promise.").also { stage = 0 }
|
||||||
|
|
||||||
|
TRADE -> {
|
||||||
|
end()
|
||||||
|
openNpcShop(player, npc.id)
|
||||||
|
}
|
||||||
|
|
||||||
|
ABOUT_AMMO -> npcl(FacialExpression.NEUTRAL, "Ah, I admit as a result of its... er... unique construction, it won't take just any old bolts.").also { stage++ }
|
||||||
|
ABOUT_AMMO + 1 -> npcl(FacialExpression.NEUTRAL, "If you can supply the materials and a token fee, I'd be happy to make some for you.").also { stage++ }
|
||||||
|
ABOUT_AMMO + 2 -> npcl(FacialExpression.NEUTRAL, "I need kebbit spikes, lots of 'em. Not all kebbits have spikes, mind you. You'll be wanting prickly kebbits or, even better, razor-backed kebbits to get material hard enough.").also { stage++ }
|
||||||
|
ABOUT_AMMO + 3 -> showTopics(
|
||||||
|
Topic("Can't I just make my own?", MAKE_OWN_AMMO),
|
||||||
|
Topic("Okay, can you make ammo for me?", CRAFT_AMMO)
|
||||||
|
)
|
||||||
|
|
||||||
|
MAKE_OWN_AMMO -> npcl(FacialExpression.HALF_THINKING, "Yes, I suppose you could, although you'll need a steady hand with a knife and a chisel.").also { stage++ }
|
||||||
|
MAKE_OWN_AMMO + 1 -> npcl(FacialExpression.HALF_THINKING, "The bolts have an unusual diameter, but basically you'll just need to be able to carve kebbit spikes into straight shafts.").also { stage++ }
|
||||||
|
MAKE_OWN_AMMO + 2 -> npcl(FacialExpression.NEUTRAL, "Meanwhile, since you're here, I can make some for you if you have the materials.").also { stage = 0 }
|
||||||
|
|
||||||
|
// OSRS suggests this may be inauthentic and there should be a make x interface.
|
||||||
|
// No 2009 sources found saying that though
|
||||||
|
CRAFT_AMMO -> npcl(FacialExpression.NEUTRAL, "Sure what type of bolts do you want?").also { stage++ }
|
||||||
|
CRAFT_AMMO + 1 -> showTopics(
|
||||||
|
Topic("Kebbit bolts.", CRAFT_AMMO + 2),
|
||||||
|
Topic("Long kebbit bolts.", CRAFT_AMMO + 3)
|
||||||
|
)
|
||||||
|
CRAFT_AMMO + 2 -> {
|
||||||
|
if (hasAnItem(player!!, Items.KEBBIT_SPIKE_10105).exists() && inInventory(player, Items.COINS_995, 20)){
|
||||||
|
if(removeItem(player, Items.KEBBIT_SPIKE_10105) && removeItem(player, Item(Items.COINS_995, 20))){
|
||||||
|
addItem(player, Items.KEBBIT_BOLTS_10158, 6)
|
||||||
|
sendItemDialogue(player, Items.KEBBIT_BOLTS_10158, "You hand the weapon designer one spike and 20 coins. In return he presents you with 6 bolts.").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
sendItemDialogue(player, Items.KEBBIT_SPIKE_10105, "You need 1 kebbit spike and 20 coins to make 6 kebbit bolts.").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CRAFT_AMMO + 3 -> {
|
||||||
|
if (hasAnItem(player!!, Items.LONG_KEBBIT_SPIKE_10107).exists() && inInventory(player, Items.COINS_995, 24)){
|
||||||
|
if(removeItem(player, Items.LONG_KEBBIT_SPIKE_10107) && removeItem(player, Item(Items.COINS_995, 40))){
|
||||||
|
addItem(player, Items.LONG_KEBBIT_BOLTS_10159, 6)
|
||||||
|
sendItemDialogue(player, Items.LONG_KEBBIT_BOLTS_10159, "You hand the weapon designer one long spike and 40 coins. In return he presents you with 6 long bolts.").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
sendItemDialogue(player, Items.LONG_KEBBIT_SPIKE_10107, "You need 1 long kebbit spike and 40 coins to make 6 kebbit bolts.").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BYE -> npcl(FacialExpression.NEUTRAL, "Well, if you ever find yourself in need of that innovative edge, you can always find me here.").also { stage++ }
|
||||||
|
BYE + 1 -> playerl(FacialExpression.HALF_ROLLING_EYES, "...thanks").also { stage = END_DIALOGUE }
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getIds(): IntArray {
|
||||||
|
return intArrayOf(NPCs.LEON_5111)
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue