Scripts/Quest: Update 'Through the Eye' (13121) (#28043)

(cherry picked from commit 5512cf8a99)
This commit is contained in:
offl
2022-06-20 20:04:05 +03:00
committed by Shauren
parent 6f3406a825
commit a2e68ccabf
2 changed files with 82 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
--
DELETE FROM `spell_scripts` WHERE `id` = 57884;
DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = 57889;
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_icecrown_through_the_eye_the_eye_of_the_lk','spell_icecrown_through_the_eye_kill_credit_to_master');
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(25732,'spell_icecrown_through_the_eye_the_eye_of_the_lk'),
(57884,'spell_icecrown_through_the_eye_kill_credit_to_master');
DELETE FROM `creature_text` WHERE `CreatureID` = 23837 AND `GroupID` = 0;
DELETE FROM `smart_scripts` WHERE `entryorguid` = -121192 AND `source_type` = 0;
DELETE FROM `smart_scripts` WHERE `entryorguid` = 192861 AND `source_type` = 1 AND `id` IN (1,2);
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`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(192861,1,1,0,61,0,100,0,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,"Eye of the Lich King - On Gossip Option 0 Selected - Close Gossip");

View File

@@ -17,6 +17,7 @@
#include "ScriptMgr.h"
#include "CombatAI.h"
#include "DB2Stores.h"
#include "MotionMaster.h"
#include "ObjectAccessor.h"
#include "Player.h"
@@ -844,6 +845,70 @@ class spell_icecrown_chum_the_water : public SpellScript
}
};
/*######
## Quest 13121: Through the Eye
######*/
enum ThroughTheEye
{
SPELL_SUMMON_IMAGE_OF_VARDMADRA = 57891,
SPELL_SUMMON_IMAGE_OF_SHADOW_CULTIST = 57885,
SPELL_USING_THE_EYE_OF_THE_LK = 57889,
TEXT_USING_THE_EYE_OF_THE_LK = 31493
};
// 25732 - Through the Eye: Eye of the Lich King
class spell_icecrown_through_the_eye_the_eye_of_the_lk : public AuraScript
{
PrepareAuraScript(spell_icecrown_through_the_eye_the_eye_of_the_lk);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_SUMMON_IMAGE_OF_VARDMADRA, SPELL_SUMMON_IMAGE_OF_SHADOW_CULTIST }) &&
sBroadcastTextStore.LookupEntry(TEXT_USING_THE_EYE_OF_THE_LK);
}
void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Player* target = GetTarget()->ToPlayer())
target->Unit::Whisper(TEXT_USING_THE_EYE_OF_THE_LK, target, true);
}
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
target->CastSpell(target, SPELL_SUMMON_IMAGE_OF_VARDMADRA, true);
target->CastSpell(target, SPELL_SUMMON_IMAGE_OF_SHADOW_CULTIST, true);
}
void Register() override
{
AfterEffectApply += AuraEffectApplyFn(spell_icecrown_through_the_eye_the_eye_of_the_lk::AfterApply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectApplyFn(spell_icecrown_through_the_eye_the_eye_of_the_lk::AfterRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
}
};
// 57884 - Through the Eye: Kill Credit to Master
class spell_icecrown_through_the_eye_kill_credit_to_master : public SpellScript
{
PrepareSpellScript(spell_icecrown_through_the_eye_kill_credit_to_master);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_USING_THE_EYE_OF_THE_LK });
}
void HandleScript(SpellEffIndex /*effIndex*/)
{
GetHitUnit()->RemoveAurasDueToSpell(SPELL_USING_THE_EYE_OF_THE_LK);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_icecrown_through_the_eye_kill_credit_to_master::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
void AddSC_icecrown()
{
RegisterCreatureAI(npc_argent_valiant);
@@ -855,4 +920,6 @@ void AddSC_icecrown()
RegisterSpellScript(spell_icecrown_summon_tualiq_proxy);
RegisterSpellScript(spell_icecrown_pound_drum);
RegisterSpellScript(spell_icecrown_chum_the_water);
RegisterSpellScript(spell_icecrown_through_the_eye_the_eye_of_the_lk);
RegisterSpellScript(spell_icecrown_through_the_eye_kill_credit_to_master);
}