Core/scripts: Add generic script to prevent cannon movement.

This commit is contained in:
Malcrom
2012-06-01 12:23:55 -02:30
parent 99b23429db
commit dfbd7a820b
2 changed files with 29 additions and 0 deletions

View File

@@ -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);

View File

@@ -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();
}