diff --git a/Server/src/plugin/interaction/object/BrokenCartBypass.java b/Server/src/plugin/interaction/object/BrokenCartBypass.java new file mode 100644 index 000000000..9be0a7c2c --- /dev/null +++ b/Server/src/plugin/interaction/object/BrokenCartBypass.java @@ -0,0 +1,54 @@ +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.game.system.task.Pulse; +import org.crandor.game.world.GameWorld; +import org.crandor.game.world.map.Location; +import org.crandor.game.world.update.flag.context.Animation; +import org.crandor.plugin.InitializablePlugin; +import org.crandor.plugin.Plugin; + + +/** + * Temporarily fix to allow people into shilo village by foot until the Shilo Village quest is added + * addresses #92 + * @author ceik + */ +@InitializablePlugin +public class BrokenCartBypass extends OptionHandler { + public Plugin newInstance(Object arg) throws Throwable { + ObjectDefinition.forId(2216).getConfigurations().put("option:look-at",this); + return this; + } + + public final void jumpOver(Player player, String options, final Location location){ + player.lock(); + player.animate(new Animation(839)); + player.getImpactHandler().setDisabledTicks(4); + GameWorld.submit(new Pulse(1, player) { + @Override + public boolean pulse() { + player.unlock(); + player.getProperties().setTeleportLocation(location); + player.getAnimator().reset(); + return true; + } + }); + } + public final boolean handle(Player player, Node node, String options){ + Location location = new Location(0,0); + Location playerloc = new Location(player.getLocation().getX(),player.getLocation().getY()); + if(options.equals("look-at")) { + if (playerloc.getX() == 2880 && playerloc.getY() >= 2951 && playerloc.getY() <= 2953) { + location = new Location(2876, 2952); + } else if (playerloc.getX() == 2876 && playerloc.getY() >= 2951 && playerloc.getY() <= 2953) { + location = new Location(2880, 2952); + } + } + jumpOver(player,options,location); + return true; + } +} diff --git a/Server/src/plugin/npc/Student.java b/Server/src/plugin/npc/Student.java new file mode 100644 index 000000000..16f4118c2 --- /dev/null +++ b/Server/src/plugin/npc/Student.java @@ -0,0 +1,30 @@ +package plugin.npc; + +import org.crandor.cache.def.impl.NPCDefinition; +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; + +/** + * Handles interactions with exam center students, to address #106 + * @author ceik + */ +@InitializablePlugin +public class Student extends OptionHandler { + public Plugin newInstance(Object arg) throws Throwable { + NPCDefinition.forId(7153).getConfigurations().put("option:talk-to",this); + NPCDefinition.forId(7154).getConfigurations().put("option:talk-to",this); + NPCDefinition.forId(7155).getConfigurations().put("option:talk-to",this); + NPCDefinition.forId(7156).getConfigurations().put("option:talk-to",this); + NPCDefinition.forId(7157).getConfigurations().put("option:talk-to",this); + return this; + } + public final boolean handle(Player player, Node node, String options){ + if(options.equals("talk-to")){ + player.getPacketDispatch().sendMessage("This student is trying to focus on their work."); + } + return true; + } +}