aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSorikoff <46191832+Sorikoff@users.noreply.github.com>2019-02-16 12:28:31 +0000
committerGiacomo Pozzoni <giacomopoz@gmail.com>2019-02-16 13:28:31 +0100
commitf0f4d0280daf81a841c30332f608f7acdfb1f374 (patch)
treead6499187b66581c82a9d9f2fe754b66914143d9 /src
parent7dc893fcf228b09eba789c7e48c41e1b64019b29 (diff)
Scripts/Scarlet Enclave: Stable Master Kitrik's spell Repo (#23023)
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
index e914695d4f7..fe2204b0354 100644
--- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp
@@ -775,6 +775,34 @@ public:
}
};
+enum HorseSeats
+{
+ SEAT_ID_0 = 0
+};
+
+class spell_stable_master_repo : public AuraScript
+{
+ PrepareAuraScript(spell_stable_master_repo);
+
+ void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ Creature* creature = GetTarget()->ToCreature();
+ if (!creature)
+ return;
+
+ if (Vehicle* vehicleKit = creature->GetVehicleKit())
+ if (Unit* passenger = vehicleKit->GetPassenger(SEAT_ID_0))
+ GetCaster()->EngageWithTarget(passenger);
+
+ creature->DespawnOrUnsummon(1s);
+ }
+
+ void Register() override
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_stable_master_repo::AfterApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+};
+
class spell_deliver_stolen_horse : public SpellScript
{
PrepareSpellScript(spell_deliver_stolen_horse);
@@ -1220,6 +1248,7 @@ void AddSC_the_scarlet_enclave_c1()
new npc_death_knight_initiate();
RegisterCreatureAI(npc_dark_rider_of_acherus);
new npc_salanar_the_horseman();
+ RegisterAuraScript(spell_stable_master_repo);
RegisterSpellScript(spell_deliver_stolen_horse);
new npc_ros_dark_rider();
new npc_dkc1_gothik();