For some reason the switch statement won't work for all of them, so we need a plugin too

This commit is contained in:
dginovker 2020-03-29 15:06:04 -04:00
parent 5fad3b5b2f
commit 5c6273036c
2 changed files with 1692 additions and 1626 deletions

View file

@ -0,0 +1,27 @@
package plugin.interaction.object;
import org.crandor.cache.def.impl.ObjectDefinition;
import org.crandor.game.interaction.OptionHandler;
import org.crandor.game.node.Node;
import org.crandor.game.node.entity.player.Player;
import org.crandor.plugin.InitializablePlugin;
import org.crandor.plugin.Plugin;
@InitializablePlugin
public class LookAtOptionPlugin extends OptionHandler {
@Override
public Plugin<Object> newInstance(Object arg) throws Throwable {
for (int i = 18877; i <= 18900; i++)
{
ObjectDefinition.forId(i).getConfigurations().put("option:look at", this);
}
return this;
}
@Override
public boolean handle(Player player, Node node, String option) {
player.getPacketDispatch().sendMessage("The " + node.getName().toLowerCase() + " seem to be going south-west.");
return true;
}
}

View file

@ -40,6 +40,7 @@ import plugin.quest.touristrap.TouristTrapPlugin.BedabinAnvilHandler.AnnaWinchHa
/** /**
* Represents the plugin used to handle interactions for tourist trap. * Represents the plugin used to handle interactions for tourist trap.
*
* @author 'Vexia * @author 'Vexia
* @version 1.0 * @version 1.0
*/ */
@ -396,10 +397,20 @@ public final class TouristTrapPlugin extends OptionHandler {
case 18959: case 18959:
player.getDialogueInterpreter().sendDialogue("A sturdy looking cart for carrying barrels of rocks out of ", "the mining camp."); player.getDialogueInterpreter().sendDialogue("A sturdy looking cart for carrying barrels of rocks out of ", "the mining camp.");
break; break;
case 18900:
case 18899: case 18899:
case 18898: case 18898:
case 18878: case 18887:
case 18886:
case 18885:
case 18884:
case 18883:
case 18882:
case 18881:
case 18880:
case 18879: case 18879:
case 18878:
case 18877:
player.getDialogueInterpreter().sendDialogue("This looks like some disturbed sand. Footseps seem to be heading off", "towards the South."); player.getDialogueInterpreter().sendDialogue("This looks like some disturbed sand. Footseps seem to be heading off", "towards the South.");
break; break;
} }
@ -505,6 +516,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/** /**
* Checks if the player contains an item. * Checks if the player contains an item.
*
* @param player the player. * @param player the player.
* @param item the item. * @param item the item.
* @return the item. * @return the item.
@ -515,6 +527,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/** /**
* The winch dialogue plugin. * The winch dialogue plugin.
*
* @author 'Vexia * @author 'Vexia
* @version 1.0 * @version 1.0
*/ */
@ -531,6 +544,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/** /**
* Constructs a new {@code WinchDialogue} {@code Object}. * Constructs a new {@code WinchDialogue} {@code Object}.
*
* @param player the player. * @param player the player.
*/ */
public WinchDialogue(final Player player) { public WinchDialogue(final Player player) {
@ -662,13 +676,14 @@ public final class TouristTrapPlugin extends OptionHandler {
@Override @Override
public int[] getIds() { public int[] getIds() {
return new int[] { DialogueInterpreter.getDialogueKey("winch dialogue") }; return new int[]{DialogueInterpreter.getDialogueKey("winch dialogue")};
} }
} }
/** /**
* The use with handler for anna on the cart. * The use with handler for anna on the cart.
*
* @author 'Vexia * @author 'Vexia
* @version 1.0 * @version 1.0
*/ */
@ -724,6 +739,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/** /**
* The ana cart cutscene plugin. * The ana cart cutscene plugin.
*
* @author 'Vexia * @author 'Vexia
* @version 1.0 * @version 1.0
*/ */
@ -732,7 +748,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/** /**
* The paths. * The paths.
*/ */
private static final Location[][] PATHS = new Location[][] { { Location.create(3315, 9417, 0), Location.create(3317, 9417, 0), Location.create(3318, 9418, 0), Location.create(3318, 9428, 0) }, { Location.create(3318, 9430, 0), Location.create(3318, 9418, 0), Location.create(3317, 9417, 0), Location.create(3316, 9417, 0), Location.create(3314, 9417, 0), Location.create(3303, 9417, 0) } }; private static final Location[][] PATHS = new Location[][]{{Location.create(3315, 9417, 0), Location.create(3317, 9417, 0), Location.create(3318, 9418, 0), Location.create(3318, 9428, 0)}, {Location.create(3318, 9430, 0), Location.create(3318, 9418, 0), Location.create(3317, 9417, 0), Location.create(3316, 9417, 0), Location.create(3314, 9417, 0), Location.create(3303, 9417, 0)}};
/** /**
* Constructs a new {@code AnnaCartCutscene} {@code Object}. * Constructs a new {@code AnnaCartCutscene} {@code Object}.
@ -743,6 +759,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/** /**
* Constructs a new {@code AnnaCartCutscene} {@code Object}. * Constructs a new {@code AnnaCartCutscene} {@code Object}.
*
* @param player the player. * @param player the player.
*/ */
public AnnaCartCutscene(final Player player) { public AnnaCartCutscene(final Player player) {
@ -827,6 +844,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/** /**
* The cart dialogue plugin. * The cart dialogue plugin.
*
* @author 'Vexia * @author 'Vexia
* @version 1.0 * @version 1.0
*/ */
@ -834,6 +852,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/** /**
* Constructs a new {@code CartDialogue} {@code Object}. * Constructs a new {@code CartDialogue} {@code Object}.
*
* @param player the player. * @param player the player.
*/ */
public CartDialogue(final Player player) { public CartDialogue(final Player player) {
@ -913,13 +932,14 @@ public final class TouristTrapPlugin extends OptionHandler {
@Override @Override
public int[] getIds() { public int[] getIds() {
return new int[] { DialogueInterpreter.getDialogueKey("ana cart dialogue") }; return new int[]{DialogueInterpreter.getDialogueKey("ana cart dialogue")};
} }
} }
/** /**
* The minecart dialogue plugin. * The minecart dialogue plugin.
*
* @author 'Vexia * @author 'Vexia
* @version 1.0 * @version 1.0
*/ */
@ -951,6 +971,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/** /**
* Constructs a new {@code MineCartDialogue} {@code Object}. * Constructs a new {@code MineCartDialogue} {@code Object}.
*
* @param player the player. * @param player the player.
*/ */
public MineCartDialogue(final Player player) { public MineCartDialogue(final Player player) {
@ -1011,6 +1032,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/** /**
* Method used to enter the cart. * Method used to enter the cart.
*
* @param player the player. * @param player the player.
*/ */
public void enterCart(final Player player) { public void enterCart(final Player player) {
@ -1033,6 +1055,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/** /**
* The mining cart cutscene plugin. * The mining cart cutscene plugin.
*
* @author 'Vexia * @author 'Vexia
* @version 1.0 * @version 1.0
*/ */
@ -1041,7 +1064,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/** /**
* The paths. * The paths.
*/ */
private static final Location[][] PATHS = new Location[][] { { Location.create(3303, 9417, 0), Location.create(3316, 9417, 0), Location.create(3317, 9417, 0), Location.create(3318, 9418, 0), Location.create(3318, 9430, 0) }, { Location.create(3318, 9430, 0), Location.create(3318, 9418, 0), Location.create(3317, 9417, 0), Location.create(3303, 9417, 0) } }; private static final Location[][] PATHS = new Location[][]{{Location.create(3303, 9417, 0), Location.create(3316, 9417, 0), Location.create(3317, 9417, 0), Location.create(3318, 9418, 0), Location.create(3318, 9430, 0)}, {Location.create(3318, 9430, 0), Location.create(3318, 9418, 0), Location.create(3317, 9417, 0), Location.create(3303, 9417, 0)}};
/** /**
* The path index. * The path index.
@ -1057,6 +1080,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/** /**
* Constructs a new {@code MiningCartCutscene} {@code Object}. * Constructs a new {@code MiningCartCutscene} {@code Object}.
*
* @param player the player. * @param player the player.
*/ */
public MiningCartCutscene(final Player player) { public MiningCartCutscene(final Player player) {
@ -1134,6 +1158,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/** /**
* Gets the path index. * Gets the path index.
*
* @return the location. * @return the location.
*/ */
public Location[] getPath() { public Location[] getPath() {
@ -1143,13 +1168,14 @@ public final class TouristTrapPlugin extends OptionHandler {
@Override @Override
public int[] getIds() { public int[] getIds() {
return new int[] { DialogueInterpreter.getDialogueKey("cart dialogue") }; return new int[]{DialogueInterpreter.getDialogueKey("cart dialogue")};
} }
} }
/** /**
* The winch cutscene plugin. * The winch cutscene plugin.
*
* @author 'Vexia * @author 'Vexia
* @version 1.0 * @version 1.0
*/ */
@ -1164,6 +1190,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/** /**
* Constructs a new {@code WinchCutscene} {@code Object}. * Constructs a new {@code WinchCutscene} {@code Object}.
*
* @param player the player. * @param player the player.
*/ */
public WinchCutscene(final Player player) { public WinchCutscene(final Player player) {
@ -1214,6 +1241,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/** /**
* The use with handler on the chest. * The use with handler on the chest.
*
* @author 'Vexia * @author 'Vexia
* @version 1.0 * @version 1.0
*/ */
@ -1243,6 +1271,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/** /**
* The barrel dialogue plugin. * The barrel dialogue plugin.
*
* @author 'Vexia * @author 'Vexia
* @version 1.0 * @version 1.0
*/ */
@ -1269,6 +1298,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/** /**
* Constructs a new {@code BarrelDialogue} {@code Object}. * Constructs a new {@code BarrelDialogue} {@code Object}.
*
* @param player the player. * @param player the player.
*/ */
public BarrelDialogue(final Player player) { public BarrelDialogue(final Player player) {
@ -1351,13 +1381,14 @@ public final class TouristTrapPlugin extends OptionHandler {
@Override @Override
public int[] getIds() { public int[] getIds() {
return new int[] { DialogueInterpreter.getDialogueKey("barrel dialogue") }; return new int[]{DialogueInterpreter.getDialogueKey("barrel dialogue")};
} }
} }
/** /**
* The use with handler for the bedabin anvil. * The use with handler for the bedabin anvil.
*
* @author 'Vexia * @author 'Vexia
* @version 1.0 * @version 1.0
*/ */
@ -1393,6 +1424,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/** /**
* The handler used to handle the anna barrel on the winch. * The handler used to handle the anna barrel on the winch.
*
* @author 'Vexia * @author 'Vexia
* @version 1.0 * @version 1.0
*/ */
@ -1429,6 +1461,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/** /**
* The prototype dart creation handler. * The prototype dart creation handler.
*
* @author 'Vexia * @author 'Vexia
* @version 1.0 * @version 1.0
*/ */
@ -1457,6 +1490,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/** /**
* The prototype dialogue plugin. * The prototype dialogue plugin.
*
* @author 'Vexia * @author 'Vexia
* @version 1.0 * @version 1.0
*/ */
@ -1469,6 +1503,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/** /**
* Constructs a new {@code ProtoTypeDialogue} {@code Object}. * Constructs a new {@code ProtoTypeDialogue} {@code Object}.
*
* @param player the player. * @param player the player.
*/ */
public ProtoTypeDialogue(final Player player) { public ProtoTypeDialogue(final Player player) {
@ -1526,7 +1561,7 @@ public final class TouristTrapPlugin extends OptionHandler {
@Override @Override
public int[] getIds() { public int[] getIds() {
return new int[] { DialogueInterpreter.getDialogueKey("prototype dart") }; return new int[]{DialogueInterpreter.getDialogueKey("prototype dart")};
} }
} }
@ -1534,6 +1569,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/** /**
* The bedabin dialogue plugin handler. * The bedabin dialogue plugin handler.
*
* @author 'Vexia * @author 'Vexia
* @version 1.0 * @version 1.0
*/ */
@ -1550,6 +1586,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/** /**
* Constructs a new {@code BedabinAnvilDialogue} {@code Object}. * Constructs a new {@code BedabinAnvilDialogue} {@code Object}.
*
* @param player the player. * @param player the player.
*/ */
public BedabinAnvilDialogue(final Player player) { public BedabinAnvilDialogue(final Player player) {
@ -1595,6 +1632,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/** /**
* The skill pulse used to make a prototype dart. * The skill pulse used to make a prototype dart.
*
* @author 'Vexia * @author 'Vexia
* @version 1.0 * @version 1.0
*/ */
@ -1612,6 +1650,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/** /**
* Constructs a new {@code ProtoTypePulse} {@code Object}. * Constructs a new {@code ProtoTypePulse} {@code Object}.
*
* @param player the player. * @param player the player.
*/ */
public ProtoTypePulse(Player player) { public ProtoTypePulse(Player player) {
@ -1666,7 +1705,7 @@ public final class TouristTrapPlugin extends OptionHandler {
@Override @Override
public int[] getIds() { public int[] getIds() {
return new int[] { DialogueInterpreter.getDialogueKey("bedabin-anvil") }; return new int[]{DialogueInterpreter.getDialogueKey("bedabin-anvil")};
} }
} }