mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Scripts/StormwindCity: Implement quest "The King's Command" (29547) (#30459)
This commit is contained in:
@@ -27,9 +27,19 @@
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "Spell.h"
|
||||
#include "SpellScript.h"
|
||||
#include "TemporarySummon.h"
|
||||
|
||||
namespace StormwindCity
|
||||
{
|
||||
namespace Spells
|
||||
{
|
||||
static constexpr uint32 MOPAllianceIntroMoviePlay = 130805;
|
||||
static constexpr uint32 FadeToBlack = 130411;
|
||||
}
|
||||
}
|
||||
|
||||
enum TidesOfWarData
|
||||
{
|
||||
QUEST_TIDES_OF_WAR = 46727,
|
||||
@@ -494,6 +504,56 @@ private:
|
||||
EventMap _events;
|
||||
};
|
||||
|
||||
// 130804 - The King's Command Movie Aura
|
||||
class spell_the_kings_command_movie_aura : public SpellScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({
|
||||
StormwindCity::Spells::FadeToBlack
|
||||
});
|
||||
}
|
||||
|
||||
void HandleHitTarget(SpellEffIndex /*effIndex*/) const
|
||||
{
|
||||
Unit* hitUnit = GetHitUnit();
|
||||
|
||||
hitUnit->CastSpell(hitUnit, StormwindCity::Spells::FadeToBlack, CastSpellExtraArgsInit{
|
||||
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
|
||||
.OriginalCastId = GetSpell()->m_castId
|
||||
});
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_the_kings_command_movie_aura::HandleHitTarget, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_the_kings_command_movie_aura_aura : public AuraScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({
|
||||
StormwindCity::Spells::MOPAllianceIntroMoviePlay
|
||||
});
|
||||
}
|
||||
|
||||
void HandleAfterEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
|
||||
target->CastSpell(target, StormwindCity::Spells::MOPAllianceIntroMoviePlay, CastSpellExtraArgsInit{
|
||||
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR
|
||||
});
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_the_kings_command_movie_aura_aura::HandleAfterEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_stormwind_city()
|
||||
{
|
||||
// Creature
|
||||
@@ -515,4 +575,5 @@ void AddSC_stormwind_city()
|
||||
// Spells
|
||||
RegisterSpellScript(spell_despawn_sailor_memory);
|
||||
RegisterSpellScript(spell_kultiras_skip_intro);
|
||||
RegisterSpellAndAuraScriptPair(spell_the_kings_command_movie_aura, spell_the_kings_command_movie_aura_aura);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user