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.
*
* @author 'Vexia
* @version 1.0
*/
@ -396,10 +397,20 @@ public final class TouristTrapPlugin extends OptionHandler {
case 18959:
player.getDialogueInterpreter().sendDialogue("A sturdy looking cart for carrying barrels of rocks out of ", "the mining camp.");
break;
case 18900:
case 18899:
case 18898:
case 18878:
case 18887:
case 18886:
case 18885:
case 18884:
case 18883:
case 18882:
case 18881:
case 18880:
case 18879:
case 18878:
case 18877:
player.getDialogueInterpreter().sendDialogue("This looks like some disturbed sand. Footseps seem to be heading off", "towards the South.");
break;
}
@ -505,6 +516,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/**
* Checks if the player contains an item.
*
* @param player the player.
* @param item the item.
* @return the item.
@ -515,6 +527,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/**
* The winch dialogue plugin.
*
* @author 'Vexia
* @version 1.0
*/
@ -531,6 +544,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/**
* Constructs a new {@code WinchDialogue} {@code Object}.
*
* @param player the player.
*/
public WinchDialogue(final Player player) {
@ -669,6 +683,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/**
* The use with handler for anna on the cart.
*
* @author 'Vexia
* @version 1.0
*/
@ -724,6 +739,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/**
* The ana cart cutscene plugin.
*
* @author 'Vexia
* @version 1.0
*/
@ -743,6 +759,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/**
* Constructs a new {@code AnnaCartCutscene} {@code Object}.
*
* @param player the player.
*/
public AnnaCartCutscene(final Player player) {
@ -827,6 +844,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/**
* The cart dialogue plugin.
*
* @author 'Vexia
* @version 1.0
*/
@ -834,6 +852,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/**
* Constructs a new {@code CartDialogue} {@code Object}.
*
* @param player the player.
*/
public CartDialogue(final Player player) {
@ -920,6 +939,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/**
* The minecart dialogue plugin.
*
* @author 'Vexia
* @version 1.0
*/
@ -951,6 +971,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/**
* Constructs a new {@code MineCartDialogue} {@code Object}.
*
* @param player the player.
*/
public MineCartDialogue(final Player player) {
@ -1011,6 +1032,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/**
* Method used to enter the cart.
*
* @param player the player.
*/
public void enterCart(final Player player) {
@ -1033,6 +1055,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/**
* The mining cart cutscene plugin.
*
* @author 'Vexia
* @version 1.0
*/
@ -1057,6 +1080,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/**
* Constructs a new {@code MiningCartCutscene} {@code Object}.
*
* @param player the player.
*/
public MiningCartCutscene(final Player player) {
@ -1134,6 +1158,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/**
* Gets the path index.
*
* @return the location.
*/
public Location[] getPath() {
@ -1150,6 +1175,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/**
* The winch cutscene plugin.
*
* @author 'Vexia
* @version 1.0
*/
@ -1164,6 +1190,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/**
* Constructs a new {@code WinchCutscene} {@code Object}.
*
* @param player the player.
*/
public WinchCutscene(final Player player) {
@ -1214,6 +1241,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/**
* The use with handler on the chest.
*
* @author 'Vexia
* @version 1.0
*/
@ -1243,6 +1271,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/**
* The barrel dialogue plugin.
*
* @author 'Vexia
* @version 1.0
*/
@ -1269,6 +1298,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/**
* Constructs a new {@code BarrelDialogue} {@code Object}.
*
* @param player the player.
*/
public BarrelDialogue(final Player player) {
@ -1358,6 +1388,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/**
* The use with handler for the bedabin anvil.
*
* @author 'Vexia
* @version 1.0
*/
@ -1393,6 +1424,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/**
* The handler used to handle the anna barrel on the winch.
*
* @author 'Vexia
* @version 1.0
*/
@ -1429,6 +1461,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/**
* The prototype dart creation handler.
*
* @author 'Vexia
* @version 1.0
*/
@ -1457,6 +1490,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/**
* The prototype dialogue plugin.
*
* @author 'Vexia
* @version 1.0
*/
@ -1469,6 +1503,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/**
* Constructs a new {@code ProtoTypeDialogue} {@code Object}.
*
* @param player the player.
*/
public ProtoTypeDialogue(final Player player) {
@ -1534,6 +1569,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/**
* The bedabin dialogue plugin handler.
*
* @author 'Vexia
* @version 1.0
*/
@ -1550,6 +1586,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/**
* Constructs a new {@code BedabinAnvilDialogue} {@code Object}.
*
* @param player the 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.
*
* @author 'Vexia
* @version 1.0
*/
@ -1612,6 +1650,7 @@ public final class TouristTrapPlugin extends OptionHandler {
/**
* Constructs a new {@code ProtoTypePulse} {@code Object}.
*
* @param player the player.
*/
public ProtoTypePulse(Player player) {