aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/3.3.5/2016_05_09_01_world.sql21
-rw-r--r--sql/updates/world/3.3.5/2016_05_09_02_world.sql41
-rw-r--r--src/server/game/Entities/Object/Object.h8
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp5
-rw-r--r--src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp4
-rw-r--r--src/server/game/Spells/Spell.cpp26
-rw-r--r--src/server/game/Spells/Spell.h8
-rw-r--r--src/server/scripts/Northrend/zone_grizzly_hills.cpp254
8 files changed, 335 insertions, 32 deletions
diff --git a/sql/updates/world/3.3.5/2016_05_09_01_world.sql b/sql/updates/world/3.3.5/2016_05_09_01_world.sql
new file mode 100644
index 00000000000..b75eb63dd2b
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_09_01_world.sql
@@ -0,0 +1,21 @@
+DELETE FROM creature_text WHERE `entry` in(28116,28115);
+INSERT INTO creature_text (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `comment`) VALUES
+(28115, 0, 0, 'You feel a massive jolt of energy as your body binds with that of Soo-holu.', 42, 0, 100, 0, 0, 0, 29003, 'Soo-holu to Player'),
+(28116, 0, 0, 'You feel rage rise within you as your body binds with Kartak.', 42, 0, 100, 0, 0, 0, 29005, 'Kartak the Abominable to Player');
+
+UPDATE `creature_template` SET `spell1`=52316, `spell2`=52271, `spell3`=52311, `spell4`=52272, `spell5`=52274, `VehicleId`=257 WHERE `entry`=28116;
+UPDATE `creature_template` SET `spell1`=52331, `spell2`=52358, `spell3`=53032, `spell4`=52321, `spell5`=0, `VehicleId`=257 WHERE `entry`=28115;
+
+UPDATE `creature_template` SET `ainame`='SmartAI', `scriptname`='' WHERE `entry` IN(28115,28116);
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(28115,28116) AND `source_type`=0;
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(28115, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Soo-holu <Will of the Titans> - On Just Summoned - Set Passive'),
+(28115, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Soo-holu <Will of the Titans> - On Just Summoned - Say'),
+(28116, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Kartak the Abominable - On Just Summoned - Set Passive'),
+(28116, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Kartak the Abominable - On Just Summoned - Say');
+
+UPDATE `gameobject` SET `position_x`=5110.322754, `position_y`=5466.666504, `position_z`=-91.836319 WHERE `guid`=99745;
+UPDATE `creature_text` SET `BroadcastTextId`=29247 WHERE `entry`=29043 AND `groupid`=4 AND `id`=0;
+UPDATE `creature_text` SET `BroadcastTextId`=29248 WHERE `entry`=29043 AND `groupid`=5 AND `id`=0;
+UPDATE `creature_text` SET `BroadcastTextId`=29249 WHERE `entry`=29043 AND `groupid`=6 AND `id`=0;
diff --git a/sql/updates/world/3.3.5/2016_05_09_02_world.sql b/sql/updates/world/3.3.5/2016_05_09_02_world.sql
new file mode 100644
index 00000000000..968ac92561e
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_05_09_02_world.sql
@@ -0,0 +1,41 @@
+UPDATE `creature_template` SET `ScriptName`='npc_rocket_propelled_warhead' WHERE `entry`=27593;
+
+DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_z_check', 'spell_vehicle_warhead_fuse', 'spell_warhead_detonate','spell_warhead_fuse');
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(61678, 'spell_z_check'),
+(49107, 'spell_vehicle_warhead_fuse'),
+(49250, 'spell_warhead_detonate'),
+(49181, 'spell_warhead_fuse');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=49332;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13,1,49332,0,1,31,0,3,27702,0,0,0,0,'',"Spell 'Warhead Seeking Mine' can hit 'Horde Lumberboat'"),
+(13,1,49332,0,2,31,0,3,27688,0,0,0,0,'',"Spell 'Warhead Seeking Mine' can hit 'Alliance Lumberboat'");
+
+-- Warhead Explosion Bunny SAI
+UPDATE `creature_template` SET `InhabitType`=4, `AIName`='SmartAI' WHERE `entry`=27663;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=27663 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(27663,0,0,0,54,0,100,0,0,0,0,0,11,49290,0,0,0,0,0,1,0,0,0,0,0,0,0,'Warhead Explosion Bunny - Just Summoned - Cast \'Torpedo Explosion\'');
+
+-- Alliance Lumberboat Explosions SAI
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=27689;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=27689 AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=2768900 AND `source_type`=9;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(27689,0,0,0,8,0,100,0,49290,0,0,0,80,2768900,0,0,0,0,0,1,0,0,0,0,0,0,0,'Alliance Lumberboat Explosions - On SpellHit \'Warhead Seeking Mine\' - Cast \'Horde Boat to Torpedo\''),
+(2768900,9,0,0,0,0,100,0,0,0,0,0,11,42344,0,0,0,0,0,1,0,0,0,0,0,0,0,'Alliance Lumberboat Explosions - ActionList - Cast \'Cosmetic - Flame Patch 0.5\''),
+(2768900,9,1,0,0,0,50,0,11000,11000,0,0,11,42345,0,0,0,0,0,1,0,0,0,0,0,0,0,'Alliance Lumberboat Explosions - ActionList - Cast \'Cosmetic - Flame Patch\''),
+(2768900,9,2,0,0,0,50,0,11000,11000,0,0,11,42346,0,0,0,0,0,1,0,0,0,0,0,0,0,'Alliance Lumberboat Explosions - ActionList - Cast \'Cosmetic - Flame Patch 2.0\'');
+
+-- Horde Lumberboat SAI
+UPDATE `creature_template` SET `InhabitType`=4, `AIName`='SmartAI' WHERE `entry`=27702;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=27702 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(27702,0,0,0,8,0,100,0,49332,0,0,0,11,49372,0,0,0,0,0,9,27593,0,100,0,0,0,0,'Horde Lumberboat - On SpellHit \'Warhead Seeking Mine\' - Cast \'Horde Boat to Torpedo\'');
+
+-- Alliance Lumberboat SAI
+UPDATE `creature_template` SET `InhabitType`=4, `AIName`='SmartAI' WHERE `entry`=27688;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=27688 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(27688,0,0,0,8,0,100,0,49332,0,0,0,11,49257,0,0,0,0,0,9,27593,0,100,0,0,0,0,'Alliance Lumberboat - On SpellHit \'Warhead Seeking Mine\' - Cast \'Alliance Boat to Torpedo\'');
diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h
index d4c8fc35451..f406b354293 100644
--- a/src/server/game/Entities/Object/Object.h
+++ b/src/server/game/Entities/Object/Object.h
@@ -584,14 +584,6 @@ class TC_GAME_API WorldObject : public Object, public WorldLocation
template<class NOTIFIER> void VisitNearbyGridObject(float const& radius, NOTIFIER& notifier) const { if (IsInWorld()) GetMap()->VisitGrid(GetPositionX(), GetPositionY(), radius, notifier); }
template<class NOTIFIER> void VisitNearbyWorldObject(float const& radius, NOTIFIER& notifier) const { if (IsInWorld()) GetMap()->VisitWorld(GetPositionX(), GetPositionY(), radius, notifier); }
-#ifdef MAP_BASED_RAND_GEN
- int32 irand(int32 min, int32 max) const { return int32 (GetMap()->mtRand.randInt(max - min)) + min; }
- uint32 urand(uint32 min, uint32 max) const { return GetMap()->mtRand.randInt(max - min) + min;}
- int32 rand32() const { return GetMap()->mtRand.randInt();}
- double rand_norm() const { return GetMap()->mtRand.randExc();}
- double rand_chance() const { return GetMap()->mtRand.randExc(100.0);}
-#endif
-
uint32 LastUsedScriptID;
// Transports
diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
index 108276c951a..6f6a8037d47 100755
--- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp
@@ -23,11 +23,6 @@
#include "MoveSpline.h"
#include "Player.h"
-#ifdef MAP_BASED_RAND_GEN
-#define rand_norm() unit.rand_norm()
-#define urand(a, b) unit.urand(a, b)
-#endif
-
template<class T>
void ConfusedMovementGenerator<T>::DoInitialize(T* unit)
{
diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
index 2e013c44ae8..421678ded17 100644
--- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
@@ -26,10 +26,6 @@
#define RUNNING_CHANCE_RANDOMMV 20 //will be "1 / RUNNING_CHANCE_RANDOMMV"
-#ifdef MAP_BASED_RAND_GEN
-#define rand_norm() creature.rand_norm()
-#endif
-
template<>
void RandomMovementGenerator<Creature>::_setRandomLocation(Creature* creature)
{
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 166eff139f4..60554e0717c 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -1302,18 +1302,30 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici
}
default:
{
- float dist;
+ float dist = m_spellInfo->Effects[effIndex].CalcRadius(m_caster);
float angle = targetType.CalcDirectionAngle();
float objSize = m_caster->GetObjectSize();
- if (targetType.GetTarget() == TARGET_DEST_CASTER_SUMMON)
- dist = PET_FOLLOW_DIST;
- else
- dist = m_spellInfo->Effects[effIndex].CalcRadius(m_caster);
if (dist < objSize)
dist = objSize;
- else if (targetType.GetTarget() == TARGET_DEST_CASTER_RANDOM)
- dist = objSize + (dist - objSize) * float(rand_norm());
+
+ switch (targetType.GetTarget())
+ {
+ case TARGET_DEST_CASTER_SUMMON:
+ dist = PET_FOLLOW_DIST;
+ break;
+ case TARGET_DEST_CASTER_RANDOM:
+ dist = objSize + (dist - objSize) * float(rand_norm());
+ break;
+ case TARGET_DEST_CASTER_FRONT_LEFT:
+ case TARGET_DEST_CASTER_BACK_LEFT:
+ case TARGET_DEST_CASTER_FRONT_RIGHT:
+ case TARGET_DEST_CASTER_BACK_RIGHT:
+ dist = dist + objSize;
+ break;
+ default:
+ break;
+ }
Position pos = dest._position;
m_caster->MovePositionToFirstCollision(pos, dist, angle);
diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h
index e634aa62a1c..b7134283ccb 100644
--- a/src/server/game/Spells/Spell.h
+++ b/src/server/game/Spells/Spell.h
@@ -694,14 +694,6 @@ class TC_GAME_API Spell
ByteBuffer * m_effectExecuteData[MAX_SPELL_EFFECTS];
-#ifdef MAP_BASED_RAND_GEN
- int32 irand(int32 min, int32 max) { return int32 (m_caster->GetMap()->mtRand.randInt(max - min)) + min; }
- uint32 urand(uint32 min, uint32 max) { return m_caster->GetMap()->mtRand.randInt(max - min) + min; }
- int32 rand32() { return m_caster->GetMap()->mtRand.randInt(); }
- double rand_norm() { return m_caster->GetMap()->mtRand.randExc(); }
- double rand_chance() { return m_caster->GetMap()->mtRand.randExc(100.0); }
-#endif
-
Spell(Spell const& right) = delete;
Spell& operator=(Spell const& right) = delete;
};
diff --git a/src/server/scripts/Northrend/zone_grizzly_hills.cpp b/src/server/scripts/Northrend/zone_grizzly_hills.cpp
index 59802165a94..4eafc1cd94e 100644
--- a/src/server/scripts/Northrend/zone_grizzly_hills.cpp
+++ b/src/server/scripts/Northrend/zone_grizzly_hills.cpp
@@ -22,6 +22,7 @@
#include "Player.h"
#include "SpellScript.h"
#include "CreatureTextMgr.h"
+#include "CombatAI.h"
/*######
## Quest 12027: Mr. Floppy's Perilous Adventure
@@ -854,6 +855,254 @@ class spell_infected_worgen_bite : public SpellScriptLoader
}
};
+/*######
+## Quest: Riding the Red Rocket
+######*/
+
+enum RedRocket
+{
+ SPELL_VEHICLE_WARHEAD_FUSE = 49107,
+ SPELL_ALLIANCE_KILL_CREDIT_TORPEDO = 49510,
+ SPELL_HORDE_KILL_CREDIT_TORPEDO = 49340,
+ NPC_HORDE_LUMBERBOAT = 27702,
+ NPC_ALLIANCE_LUMBERBOAT = 27688,
+ SPELL_DETONATE = 49250
+};
+
+class npc_rocket_propelled_warhead : public CreatureScript
+{
+public:
+ npc_rocket_propelled_warhead() : CreatureScript("npc_rocket_propelled_warhead") { }
+
+ struct npc_rocket_propelled_warheadAI : public VehicleAI
+ {
+ npc_rocket_propelled_warheadAI(Creature* creature) : VehicleAI(creature)
+ {
+ _finished = false;
+ _faction = ALLIANCE;
+ }
+
+ void PassengerBoarded(Unit* who, int8 /*seatId*/, bool apply) override
+ {
+ if (apply && who->ToPlayer())
+ {
+ DoCast(me, SPELL_VEHICLE_WARHEAD_FUSE);
+ _faction = who->ToPlayer()->GetTeam();
+ }
+ }
+
+ void JustReachedHome() override
+ {
+ _finished = false;
+ me->SetVisible(true);
+ me->GetMotionMaster()->Clear(true);
+ }
+
+ void DoAction(int32 /*action*/) override
+ {
+ FinishQuest(false, _faction);
+ }
+
+ void SpellHit(Unit* caster, SpellInfo const* /*spellInfo*/) override
+ {
+ if (caster->GetEntry() == NPC_HORDE_LUMBERBOAT || caster->GetEntry() == NPC_ALLIANCE_LUMBERBOAT)
+ FinishQuest(true, _faction);
+ }
+
+ void FinishQuest(bool success, uint32 faction)
+ {
+ if (_finished)
+ return;
+
+ _finished = true;
+
+ if (success)
+ DoCast(me, faction == ALLIANCE ? SPELL_ALLIANCE_KILL_CREDIT_TORPEDO : SPELL_HORDE_KILL_CREDIT_TORPEDO);
+
+ DoCast(me, SPELL_DETONATE);
+ me->RemoveAllAuras();
+ me->SetVisible(false);
+ me->GetMotionMaster()->MoveTargetedHome();
+ }
+
+ private:
+ uint32 _faction;
+ bool _finished;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return new npc_rocket_propelled_warheadAI(creature);
+ }
+};
+
+enum WarheadSpells
+{
+ SPELL_WARHEAD_Z_CHECK = 61678,
+ SPELL_WARHEAD_SEEKING_LUMBERSHIP = 49331,
+ SPELL_WARHEAD_FUSE = 49181
+};
+// 49107 - Vehicle: Warhead Fuse
+class spell_vehicle_warhead_fuse : public SpellScriptLoader
+{
+public:
+ spell_vehicle_warhead_fuse() : SpellScriptLoader("spell_vehicle_warhead_fuse") { }
+
+ class spell_vehicle_warhead_fuse_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_vehicle_warhead_fuse_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_WARHEAD_Z_CHECK) || !sSpellMgr->GetSpellInfo(SPELL_WARHEAD_SEEKING_LUMBERSHIP) || !sSpellMgr->GetSpellInfo(SPELL_WARHEAD_FUSE))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+
+ caster->CastSpell(caster, SPELL_WARHEAD_Z_CHECK, true);
+ caster->CastSpell(caster, SPELL_WARHEAD_SEEKING_LUMBERSHIP, true);
+ caster->CastSpell(caster, SPELL_WARHEAD_FUSE, true);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_vehicle_warhead_fuse_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_vehicle_warhead_fuse_SpellScript();
+ }
+};
+
+enum WarheadDenonate
+{
+ SPELL_PARACHUTE = 66154,
+ SPELL_TORPEDO_EXPLOSION = 49290,
+ NPC_ALLIANCE_LUMBERBOAT_EXPLOSIONS = 27689
+};
+// 49250 - Detonate
+class spell_warhead_detonate : public SpellScriptLoader
+{
+public:
+ spell_warhead_detonate() : SpellScriptLoader("spell_warhead_detonate") { }
+
+ class spell_warhead_detonate_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_warhead_detonate_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_PARACHUTE) || !sSpellMgr->GetSpellInfo(SPELL_TORPEDO_EXPLOSION))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ Player* player = GetHitPlayer();
+ if (!player)
+ return;
+
+ player->ExitVehicle();
+ float horizontalSpeed = 3.0f;
+ float verticalSpeed = 40.0f;
+ player->KnockbackFrom(caster->GetPositionX(), caster->GetPositionY(), horizontalSpeed, verticalSpeed);
+ caster->CastSpell(player, SPELL_PARACHUTE, true);
+
+ std::list<Creature*> explosionBunnys;
+ caster->GetCreatureListWithEntryInGrid(explosionBunnys, NPC_ALLIANCE_LUMBERBOAT_EXPLOSIONS, 90.0f);
+ for (std::list<Creature*>::const_iterator itr = explosionBunnys.begin(); itr != explosionBunnys.end(); ++itr)
+ (*itr)->CastSpell((*itr), SPELL_TORPEDO_EXPLOSION, true);
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_warhead_detonate_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_warhead_detonate_SpellScript();
+ }
+};
+
+// 61678 - Z Check
+class spell_z_check : public SpellScriptLoader
+{
+public:
+ spell_z_check() : SpellScriptLoader("spell_z_check") { }
+
+ class spell_z_check_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_z_check_AuraScript);
+
+ void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ _posZ = GetTarget()->GetPositionZ();
+ }
+
+ void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
+ {
+ PreventDefaultAction();
+
+ if (_posZ != GetTarget()->GetPositionZ())
+ if (Creature* target = GetTarget()->ToCreature())
+ target->AI()->DoAction(0);
+ }
+
+ private:
+ float _posZ;
+
+ void Register() override
+ {
+ OnEffectApply += AuraEffectApplyFn(spell_z_check_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_z_check_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_z_check_AuraScript();
+ }
+};
+
+// 49181 - Warhead Fuse
+class spell_warhead_fuse : public SpellScriptLoader
+{
+public:
+ spell_warhead_fuse() : SpellScriptLoader("spell_warhead_fuse") { }
+
+ class spell_warhead_fuse_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_warhead_fuse_AuraScript);
+
+ void HandleOnEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* rocketUnit = GetTarget()->GetVehicleBase())
+ if (Creature* rocketCrea = rocketUnit->ToCreature())
+ rocketCrea->AI()->DoAction(0);
+ }
+
+ void Register() override
+ {
+ OnEffectRemove += AuraEffectRemoveFn(spell_warhead_fuse_AuraScript::HandleOnEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_warhead_fuse_AuraScript();
+ }
+};
+
void AddSC_grizzly_hills()
{
new npc_emily();
@@ -866,4 +1115,9 @@ void AddSC_grizzly_hills()
new npc_lake_frog();
new spell_shredder_delivery();
new spell_infected_worgen_bite();
+ new npc_rocket_propelled_warhead();
+ new spell_z_check();
+ new spell_warhead_detonate();
+ new spell_vehicle_warhead_fuse();
+ new spell_warhead_fuse();
}