From dfbd7a820b6f577d7a38bc88e6152903571b3dd1 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Fri, 1 Jun 2012 12:23:55 -0230 Subject: [PATCH] Core/scripts: Add generic script to prevent cannon movement. --- .../2012_06_01_01_world_creature_script.sql | 2 ++ src/server/scripts/World/npcs_special.cpp | 27 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 sql/updates/world/2012_06_01_01_world_creature_script.sql diff --git a/sql/updates/world/2012_06_01_01_world_creature_script.sql b/sql/updates/world/2012_06_01_01_world_creature_script.sql new file mode 100644 index 00000000000..d90800bd1af --- /dev/null +++ b/sql/updates/world/2012_06_01_01_world_creature_script.sql @@ -0,0 +1,2 @@ +-- Add Generic Harpoon gun script to prevent movement +UPDATE `creature_template` SET `ScriptName`= 'npc_generic_harpoon_cannon' WHERE `entry` IN (27714,30066,30337); diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index ecd1a439a58..bfe4ac07bdc 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -2988,6 +2988,32 @@ public: }; }; +/*###### +## npc_generic_harpoon_cannon +######*/ + +class npc_generic_harpoon_cannon : public CreatureScript +{ +public: + npc_generic_harpoon_cannon() : CreatureScript("npc_generic_harpoon_cannon") { } + + struct npc_generic_harpoon_cannonAI : public ScriptedAI + { + npc_generic_harpoon_cannonAI(Creature* creature) : ScriptedAI(creature) {} + + void Reset() + { + me->SetUnitMovementFlags(MOVEMENTFLAG_ROOT); + me->SetExtraUnitMovementFlags(MOVEMENTFLAG2_NO_STRAFE | MOVEMENTFLAG2_NO_JUMPING | MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING); + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_generic_harpoon_cannonAI(creature); + } +}; + void AddSC_npcs_special() { new npc_air_force_bots(); @@ -3020,4 +3046,5 @@ void AddSC_npcs_special() new npc_earth_elemental(); new npc_firework(); new npc_spring_rabbit(); + new npc_generic_harpoon_cannon(); }