From 0002a014f22ff00ca1dae5ad383e79ae1439281c Mon Sep 17 00:00:00 2001 From: Ceikry Date: Tue, 10 Mar 2020 14:17:12 -0500 Subject: [PATCH 1/4] Fixed an issue where Hans lost dialogue --- Server/server.sql | 1 + Server/src/plugin/npc/HansNPC.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Server/server.sql b/Server/server.sql index 7943b601c..6f27e30cc 100644 --- a/Server/server.sql +++ b/Server/server.sql @@ -19627,6 +19627,7 @@ CREATE TABLE `npc_spawns` ( -- INSERT INTO `npc_spawns` (`npc_id`, `loc_data`) VALUES +(0, '{3217,3215,0,1,0}'), (4474, '{3214,3252,0,0,0}-{3214,3253,0,0,0}-{3214,3254,0,0,0}'), (7891, '{3207,3250,0,0,0}-{3208,3250,0,0,0}-{3209,3250,0,0,0}'), (4400, '{3018,10313,0,1,4}-{3016,10315,0,1,4}-{3018,10322,0,1,4}-{3024,10326,0,1,3}-{3030,10332,0,1,4}-{3029,10337,0,1,6}-{3034,10342,0,1,3}-{2072,5200,0,1,7}-{2130,5267,0,1,7}-{2140,5252,0,1,5}-{2141,5252,0,1,1}-{2142,5252,0,1,0}-{2148,5255,0,1,3}-{2125,5270,0,1,1}-{2148,5257,0,1,1}-{2117,5274,0,1,4}-{2146,5307,0,1,2}-{2145,5305,0,1,5}-{2152,5307,0,1,4}-{2148,5252,0,1,0}-{2142,5262,0,1,3}-{2124,5275,0,1,4}-{2121,5276,0,1,3}-{2148,5304,0,1,0}-{2146,5305,0,1,5}-{2148,5304,0,1,1}-{2151,5304,0,1,6}-{2145,5306,0,1,3}-{2134,5272,0,1,6}'), diff --git a/Server/src/plugin/npc/HansNPC.java b/Server/src/plugin/npc/HansNPC.java index 0a89e6716..e01f2fdb9 100644 --- a/Server/src/plugin/npc/HansNPC.java +++ b/Server/src/plugin/npc/HansNPC.java @@ -9,7 +9,8 @@ import org.crandor.plugin.Plugin; * Handles the Hans NPC. * @author Emperor */ -@InitializablePlugin +//REMOVING INITIALIZABLE PLUGIN, DO NOT LET THIS RUN, IT PREVENTS HANS FROM HAVING ANY DIALOGUE. -Ceikry +//@InitializablePlugin public final class HansNPC extends AbstractNPC { /** From 6aade22f33ef6d6b2ccf2683318667e069d75e14 Mon Sep 17 00:00:00 2001 From: Ceikry Date: Tue, 10 Mar 2020 16:29:49 -0500 Subject: [PATCH 2/4] Closes #106 --- Server/src/plugin/npc/Student.java | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Server/src/plugin/npc/Student.java 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; + } +} From 398630e6a276b80fa2522184aae6dd42f120b66d Mon Sep 17 00:00:00 2001 From: Ceikry Date: Tue, 10 Mar 2020 17:30:49 -0500 Subject: [PATCH 3/4] closes #92 --- .../interaction/object/BrokenCartBypass.java | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 Server/src/plugin/interaction/object/BrokenCartBypass.java 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; + } +} From efd72b909cfe3680fbee34e3906eaf4cc112a561 Mon Sep 17 00:00:00 2001 From: Ceikry Date: Tue, 10 Mar 2020 18:01:59 -0500 Subject: [PATCH 4/4] Revert "Fixed an issue where Hans lost dialogue" This reverts commit 0002a014f22ff00ca1dae5ad383e79ae1439281c. --- Server/server.sql | 1 - Server/src/plugin/npc/HansNPC.java | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Server/server.sql b/Server/server.sql index 6f27e30cc..7943b601c 100644 --- a/Server/server.sql +++ b/Server/server.sql @@ -19627,7 +19627,6 @@ CREATE TABLE `npc_spawns` ( -- INSERT INTO `npc_spawns` (`npc_id`, `loc_data`) VALUES -(0, '{3217,3215,0,1,0}'), (4474, '{3214,3252,0,0,0}-{3214,3253,0,0,0}-{3214,3254,0,0,0}'), (7891, '{3207,3250,0,0,0}-{3208,3250,0,0,0}-{3209,3250,0,0,0}'), (4400, '{3018,10313,0,1,4}-{3016,10315,0,1,4}-{3018,10322,0,1,4}-{3024,10326,0,1,3}-{3030,10332,0,1,4}-{3029,10337,0,1,6}-{3034,10342,0,1,3}-{2072,5200,0,1,7}-{2130,5267,0,1,7}-{2140,5252,0,1,5}-{2141,5252,0,1,1}-{2142,5252,0,1,0}-{2148,5255,0,1,3}-{2125,5270,0,1,1}-{2148,5257,0,1,1}-{2117,5274,0,1,4}-{2146,5307,0,1,2}-{2145,5305,0,1,5}-{2152,5307,0,1,4}-{2148,5252,0,1,0}-{2142,5262,0,1,3}-{2124,5275,0,1,4}-{2121,5276,0,1,3}-{2148,5304,0,1,0}-{2146,5305,0,1,5}-{2148,5304,0,1,1}-{2151,5304,0,1,6}-{2145,5306,0,1,3}-{2134,5272,0,1,6}'), diff --git a/Server/src/plugin/npc/HansNPC.java b/Server/src/plugin/npc/HansNPC.java index e01f2fdb9..0a89e6716 100644 --- a/Server/src/plugin/npc/HansNPC.java +++ b/Server/src/plugin/npc/HansNPC.java @@ -9,8 +9,7 @@ import org.crandor.plugin.Plugin; * Handles the Hans NPC. * @author Emperor */ -//REMOVING INITIALIZABLE PLUGIN, DO NOT LET THIS RUN, IT PREVENTS HANS FROM HAVING ANY DIALOGUE. -Ceikry -//@InitializablePlugin +@InitializablePlugin public final class HansNPC extends AbstractNPC { /**