Scripts/Scarlet Enclave: Stable Master Kitrik's spell Repo (#23023)

(cherry picked from commit f0f4d0280d)
This commit is contained in:
Sorikoff
2019-02-16 12:28:31 +00:00
committed by Shauren
parent 2f21c11979
commit ee0662ca3d
2 changed files with 32 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
DELETE FROM `spell_script_names` WHERE `ScriptName`="spell_stable_master_repo";
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(52265, "spell_stable_master_repo");

View File

@@ -780,6 +780,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);
@@ -1218,6 +1246,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();