diff --git a/data/sql/updates/db_world/2025_11_30_03.sql b/data/sql/updates/db_world/2025_11_30_03.sql new file mode 100644 index 0000000000..a59af90568 --- /dev/null +++ b/data/sql/updates/db_world/2025_11_30_03.sql @@ -0,0 +1,8 @@ +-- DB update 2025_11_30_02 -> 2025_11_30_03 + +-- Add SmartAI +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 26523; + +DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 26523); +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`, `event_param6`, `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 +(26523, 0, 0, 0, 28, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 6000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Forsaken Blight Spreader - On Passenger Removed - Despawn In 6000 ms'); diff --git a/data/sql/updates/db_world/2025_11_30_04.sql b/data/sql/updates/db_world/2025_11_30_04.sql new file mode 100644 index 0000000000..f2462e6997 --- /dev/null +++ b/data/sql/updates/db_world/2025_11_30_04.sql @@ -0,0 +1,4 @@ +-- DB update 2025_11_30_03 -> 2025_11_30_04 +-- +UPDATE `creature_template` SET `lootid` = 29605 WHERE `entry` = 30291; +DELETE FROM `creature_loot_template` WHERE `Entry` = 30291; diff --git a/data/sql/updates/db_world/2025_11_30_05.sql b/data/sql/updates/db_world/2025_11_30_05.sql new file mode 100644 index 0000000000..a8f2539156 --- /dev/null +++ b/data/sql/updates/db_world/2025_11_30_05.sql @@ -0,0 +1,4 @@ +-- DB update 2025_11_30_04 -> 2025_11_30_05 +-- +-- Remove the RewardNextQuest, previously: 12070 (Rallying the Troops), link from 12249 (Ursoc, the Bear God) +UPDATE `quest_template` SET `RewardNextQuest` = 0 WHERE (`ID` = 12249); diff --git a/data/sql/updates/db_world/2025_11_30_06.sql b/data/sql/updates/db_world/2025_11_30_06.sql new file mode 100644 index 0000000000..83b9493be3 --- /dev/null +++ b/data/sql/updates/db_world/2025_11_30_06.sql @@ -0,0 +1,8 @@ +-- DB update 2025_11_30_05 -> 2025_11_30_06 +-- +-- Judgment Day Comes! should not be available if Honor Above All Else is taken/complete/rewarded +-- Uses CONDITION_QUESTSTATE (47) with state_mask 74 (2+8+64 = Completed+InProgress+Rewarded) +DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 19) AND (`SourceEntry` IN (13226, 13227)) AND (`ConditionTypeOrReference` = 47) AND (`ConditionValue1` = 13036); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(19, 0, 13226, 0, 0, 47, 0, 13036, 74, 0, 1, 0, 0, '', 'Judgment Day Comes! - NOT have Honor Above All Else (taken/complete/rewarded)'), +(19, 0, 13227, 0, 0, 47, 0, 13036, 74, 0, 1, 0, 0, '', 'Judgment Day Comes! - NOT have Honor Above All Else (taken/complete/rewarded)'); diff --git a/data/sql/updates/db_world/2025_11_30_07.sql b/data/sql/updates/db_world/2025_11_30_07.sql new file mode 100644 index 0000000000..fa6fe98c34 --- /dev/null +++ b/data/sql/updates/db_world/2025_11_30_07.sql @@ -0,0 +1,90 @@ +-- DB update 2025_11_30_06 -> 2025_11_30_07 +-- +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=-43351 AND `spell_effect`=50167 AND `type`=0; + +DELETE FROM `spell_script_names` WHERE (`spell_id` = 43365 AND `ScriptName` = 'spell_the_cleansing_shrine_cast'); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 43351 AND (`ScriptName` = 'spell_the_cleansing_cleansing_soul' OR `ScriptName` = 'spell_q11322_q11317_the_cleansing')); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 50217 AND `ScriptName` = 'spell_the_cleansing_mirror_image_script_effect'); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 50238 AND `ScriptName` = 'spell_the_cleansing_on_death_cast_on_master'); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 39823 AND `ScriptName` = 'spell_gen_whisper_to_controller'); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 39825 AND `ScriptName` = 'spell_gen_whisper_to_controller'); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 40201 AND `ScriptName` = 'spell_gen_whisper_to_controller'); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 40203 AND `ScriptName` = 'spell_gen_whisper_to_controller'); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 40204 AND `ScriptName` = 'spell_gen_whisper_to_controller'); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 40205 AND `ScriptName` = 'spell_gen_whisper_to_controller'); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 40206 AND `ScriptName` = 'spell_gen_whisper_to_controller'); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 40207 AND `ScriptName` = 'spell_gen_whisper_to_controller'); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 40208 AND `ScriptName` = 'spell_gen_whisper_to_controller'); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 40210 AND `ScriptName` = 'spell_gen_whisper_to_controller'); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 40213 AND `ScriptName` = 'spell_gen_whisper_to_controller'); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 40217 AND `ScriptName` = 'spell_gen_whisper_to_controller'); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 40218 AND `ScriptName` = 'spell_gen_whisper_to_controller'); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 40233 AND `ScriptName` = 'spell_gen_whisper_to_controller'); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 40252 AND `ScriptName` = 'spell_gen_whisper_to_controller'); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 40352 AND `ScriptName` = 'spell_gen_whisper_to_controller'); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 50014 AND `ScriptName` = 'spell_gen_whisper_to_controller'); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 50023 AND `ScriptName` = 'spell_gen_whisper_to_controller'); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 50219 AND `ScriptName` = 'spell_gen_whisper_to_controller'); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 50221 AND `ScriptName` = 'spell_gen_whisper_to_controller'); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 50222 AND `ScriptName` = 'spell_gen_whisper_to_controller'); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 50223 AND `ScriptName` = 'spell_gen_whisper_to_controller'); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 53374 AND `ScriptName` = 'spell_gen_whisper_to_controller'); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 60807 AND `ScriptName` = 'spell_gen_whisper_to_controller'); +DELETE FROM `spell_script_names` WHERE (`spell_id` = 60811 AND `ScriptName` = 'spell_gen_whisper_to_controller'); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(43365, 'spell_the_cleansing_shrine_cast'), +(43351, 'spell_the_cleansing_cleansing_soul'), +(50217, 'spell_the_cleansing_mirror_image_script_effect'), +(50238, 'spell_the_cleansing_on_death_cast_on_master'), +(39823, 'spell_gen_whisper_to_controller'), +(39825, 'spell_gen_whisper_to_controller'), +(40201, 'spell_gen_whisper_to_controller'), +(40203, 'spell_gen_whisper_to_controller'), +(40204, 'spell_gen_whisper_to_controller'), +(40205, 'spell_gen_whisper_to_controller'), +(40206, 'spell_gen_whisper_to_controller'), +(40207, 'spell_gen_whisper_to_controller'), +(40208, 'spell_gen_whisper_to_controller'), +(40210, 'spell_gen_whisper_to_controller'), +(40213, 'spell_gen_whisper_to_controller'), +(40217, 'spell_gen_whisper_to_controller'), +(40218, 'spell_gen_whisper_to_controller'), +(40233, 'spell_gen_whisper_to_controller'), +(40252, 'spell_gen_whisper_to_controller'), +(40352, 'spell_gen_whisper_to_controller'), +(50014, 'spell_gen_whisper_to_controller'), +(50023, 'spell_gen_whisper_to_controller'), +(50219, 'spell_gen_whisper_to_controller'), +(50221, 'spell_gen_whisper_to_controller'), +(50222, 'spell_gen_whisper_to_controller'), +(50223, 'spell_gen_whisper_to_controller'), +(53374, 'spell_gen_whisper_to_controller'), +(60807, 'spell_gen_whisper_to_controller'), +(60811, 'spell_gen_whisper_to_controller'); + +DELETE FROM `creature_text` WHERE `CreatureID` = 27959; + +UPDATE `creature_template` SET `ScriptName` = '', `AIName` = 'SmartAI' WHERE `entry` = 27959; +DELETE FROM `smart_scripts` WHERE `entryorguid` = 27959 AND `source_type` = 0; +DELETE FROM `smart_scripts` WHERE `entryorguid` = 2795900 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`,`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 +(27959, 0, 0, 0, 37, 0, 100, 0, 0, 0, 0, 0, 0, 116, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Your Inner Turmoil - On Initialize - Set Corpse Delay to 2s'), +(27959, 0, 1, 0, 11, 0, 100, 0, 0, 0, 0, 0, 0, 80, 2795900, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Your Inner Turmoil - On Respawn - Run Script'), +(27959, 0, 2, 0, 2, 0, 100, 1, 0, 50, 0, 0, 0, 11, 50222, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Your Inner Turmoil - Between 0-50% Health - Cast \'The Cleansing: Your Inner Turmoil`s Whisper to Controller - On Health 50%\' (No Repeat)'), +(27959, 0, 3, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 11, 50223, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Your Inner Turmoil - On Just Died - Cast \'The Cleansing: Your Inner Turmoil`s Whisper to Controller - On Death\''), +(27959, 0, 4, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 11, 50238, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Your Inner Turmoil - On Just Died - Cast \'The Cleansing: Your Inner Turmoil`s On Death Cast on Master\''), +-- It has SPELL_ATTR3_DEATH_PERSISTENT but actually is removed after death, maybe not manually +-- Kinda odd because it makes creature invisible, but Copy Weapon auras are not removed, so only weapons are visible without body +(27959, 0, 5, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 28, 50218, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Your Inner Turmoil - On Just Died - Remove Aura \'The Cleansing: Your Inner Turmoil`s Mirror Image Aura\''), +(2795900, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 11, 50217, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 'Your Inner Turmoil - Actionlist - Cast \'The Cleansing: Script Effect Player Cast Mirror Image\''), +(2795900, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 11, 41408, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Your Inner Turmoil - Actionlist - Cast \'Shadowform\''), +(2795900, 9, 2, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 'Your Inner Turmoil - Actionlist - Set Orientation Owner Or Summoner'), +(2795900, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 11, 50219, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Your Inner Turmoil - Actionlist - Cast \'The Cleansing: Your Inner Turmoil`s Whisper to Controller - Spawn 01\''), +(2795900, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 5, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Your Inner Turmoil - Actionlist - Play Emote 1'), +(2795900, 9, 5, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 'Your Inner Turmoil - Actionlist - Set Orientation Owner Or Summoner'), +(2795900, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 11, 50221, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Your Inner Turmoil - Actionlist - Cast \'The Cleansing: Your Inner Turmoil`s Whisper to Controller - Spawn 02\''), +(2795900, 9, 7, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 5, 25, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Your Inner Turmoil - Actionlist - Play Emote 25'), +-- Yes, again +(2795900, 9, 8, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 0, 11, 50217, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 'Your Inner Turmoil - Actionlist - Cast \'The Cleansing: Script Effect Player Cast Mirror Image\''), +(2795900, 9, 9, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 19, 512, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Your Inner Turmoil - Actionlist - Remove Flags Immune To NPC\'s'), +(2795900, 9, 10, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 'Your Inner Turmoil - Actionlist - Start Attacking'); diff --git a/data/sql/updates/db_world/2025_11_30_08.sql b/data/sql/updates/db_world/2025_11_30_08.sql new file mode 100644 index 0000000000..babbf5e14b --- /dev/null +++ b/data/sql/updates/db_world/2025_11_30_08.sql @@ -0,0 +1,18 @@ +-- DB update 2025_11_30_07 -> 2025_11_30_08 +SET @ITEM = 6995; +SET @ENTRY = 1055; + +-- Creates a reference loot for "Corrupted Kor Gem" +DELETE FROM `reference_loot_template` WHERE `Entry` = @ENTRY AND `Item` = @ITEM; +INSERT INTO `reference_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES +(@ENTRY, @ITEM, 0, 100, 1, 1, 1, 1, 1, 'Corrupted Kor Gem'); + +-- Deletes "Corrupted Kor Gem" from every creature's loot +DELETE FROM `creature_loot_template` WHERE `item` = @ITEM; + +-- Adds reference loot for "Corrupted Kor Gem" for each creature below +DELETE FROM `creature_loot_template` WHERE `Reference` = @ENTRY AND `Entry` IN (4802, 4803, 4805); +INSERT INTO `creature_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES +(4802, @ITEM, @ENTRY, 80, 0, 1, 0, 1, 1, 'Blackfathom Tide Priestess - Corrupted Kor Gem'), +(4803, @ITEM, @ENTRY, 80, 0, 1, 0, 1, 1, 'Blackfathom Oracle - Corrupted Kor Gem'), +(4805, @ITEM, @ENTRY, 80, 0, 1, 0, 1, 1, 'Blackfathom Sea Witch - Corrupted Kor Gem'); diff --git a/src/server/scripts/Northrend/zone_howling_fjord.cpp b/src/server/scripts/Northrend/zone_howling_fjord.cpp index fc28598ec2..928a0a71e8 100644 --- a/src/server/scripts/Northrend/zone_howling_fjord.cpp +++ b/src/server/scripts/Northrend/zone_howling_fjord.cpp @@ -66,109 +66,6 @@ public: } }; -// The cleansing -enum TurmoilTexts -{ - SAY_TURMOIL_0 = 0, - SAY_TURMOIL_1 = 1, - SAY_TURMOIL_HALF_HP = 2, - SAY_TURMOIL_DEATH = 3, -}; - -class npc_your_inner_turmoil : public CreatureScript -{ -public: - npc_your_inner_turmoil() : CreatureScript("npc_your_inner_turmoil") { } - - struct npc_your_inner_turmoilAI : public ScriptedAI - { - npc_your_inner_turmoilAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 timer; - short phase; - bool health50; - - void Reset() override - { - timer = 0; - phase = 0; - health50 = false; - } - - void UpdateAI(uint32 diff) override - { - if (timer >= 6000 && phase < 2) - { - phase++; - setphase(phase); - timer = 0; - } - - timer += diff; - - DoMeleeAttackIfReady(); - } - - void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType /*damagetype*/, SpellSchoolMask /*damageSchoolMask*/) override - { - if (HealthBelowPct(50) && !health50) - { - if (TempSummon const* tempSummon = me->ToTempSummon()) - { - if (WorldObject* summoner = tempSummon->GetSummonerUnit()) - { - Talk(SAY_TURMOIL_HALF_HP, summoner); - } - } - - health50 = true; - } - } - - void JustDied(Unit* /*killer*/) override - { - if (TempSummon const* tempSummon = me->ToTempSummon()) - { - if (WorldObject* summoner = tempSummon->GetSummonerUnit()) - { - Talk(SAY_TURMOIL_DEATH, summoner); - } - } - } - - void setphase(short newPhase) - { - Unit* summoner = me->ToTempSummon() ? me->ToTempSummon()->GetSummonerUnit() : nullptr; - if (!summoner || !summoner->IsPlayer()) - return; - - switch (newPhase) - { - case 1: - Talk(SAY_TURMOIL_0, summoner->ToPlayer()); - return; - case 2: - { - Talk(SAY_TURMOIL_1, summoner->ToPlayer()); - me->SetLevel(summoner->GetLevel()); - me->SetFaction(FACTION_MONSTER); - if (me->GetExactDist(summoner) < 50.0f) - { - me->UpdatePosition(summoner->GetPositionX(), summoner->GetPositionY(), summoner->GetPositionZ(), 0.0f, true); - summoner->CastSpell(me, 50218, true); // clone caster - AttackStart(summoner); - } - } - } - } - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_your_inner_turmoilAI(creature); - } -}; - /*###### ## npc_apothecary_hanes ######*/ @@ -457,13 +354,145 @@ class spell_hawk_hunting : public SpellScript } }; +/*###### +## Quest 11317, 11322: The Cleansing +######*/ + +enum TheCleansing +{ + SPELL_CLEANSING_SOUL = 43351, + SPELL_SUMMON_INNER_TURMOIL = 50167, + SPELL_RECENT_MEDITATION = 61720, + SPELL_MIRROR_IMAGE_AURA = 50218, + + QUEST_THE_CLEANSING_H = 11317, + QUEST_THE_CLEANSING_A = 11322 +}; + +// 43365 - The Cleansing: Shrine Cast +class spell_the_cleansing_shrine_cast : public SpellScript +{ + PrepareSpellScript(spell_the_cleansing_shrine_cast); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_RECENT_MEDITATION, SPELL_CLEANSING_SOUL }) && + sObjectMgr->GetQuestTemplate(QUEST_THE_CLEANSING_H) && + sObjectMgr->GetQuestTemplate(QUEST_THE_CLEANSING_A); + } + + SpellCastResult CheckCast() + { + // Error is correct for quest check but may be not correct for aura and this may be a wrong place to send error + if (Player* target = GetExplTargetUnit()->ToPlayer()) + { + if (target->HasAura(SPELL_RECENT_MEDITATION) || (!(target->GetQuestStatus(QUEST_THE_CLEANSING_H) == QUEST_STATUS_INCOMPLETE || + target->GetQuestStatus(QUEST_THE_CLEANSING_A) == QUEST_STATUS_INCOMPLETE))) + { + Spell::SendCastResult(target, GetSpellInfo(), 0, SPELL_FAILED_FIZZLE); + return SPELL_FAILED_FIZZLE; + } + } + return SPELL_CAST_OK; + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetHitUnit()->CastSpell(GetHitUnit(), SPELL_CLEANSING_SOUL, true); + } + + void Register() override + { + OnCheckCast += SpellCheckCastFn(spell_the_cleansing_shrine_cast::CheckCast); + OnEffectHitTarget += SpellEffectFn(spell_the_cleansing_shrine_cast::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + +// 43351 - Cleansing Soul +class spell_the_cleansing_cleansing_soul : public AuraScript +{ + PrepareAuraScript(spell_the_cleansing_cleansing_soul); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_SUMMON_INNER_TURMOIL, SPELL_RECENT_MEDITATION }); + } + + void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + GetTarget()->SetStandState(UNIT_STAND_STATE_SIT); + } + + void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + target->SetStandState(UNIT_STAND_STATE_STAND); + target->CastSpell(target, SPELL_SUMMON_INNER_TURMOIL, true); + target->CastSpell(target, SPELL_RECENT_MEDITATION, true); + } + + void Register() override + { + AfterEffectApply += AuraEffectApplyFn(spell_the_cleansing_cleansing_soul::AfterApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_the_cleansing_cleansing_soul::AfterRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } +}; + +// 50217 - The Cleansing: Script Effect Player Cast Mirror Image +class spell_the_cleansing_mirror_image_script_effect : public SpellScript +{ + PrepareSpellScript(spell_the_cleansing_mirror_image_script_effect); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_MIRROR_IMAGE_AURA }); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetHitUnit()->CastSpell(GetHitUnit(), SPELL_MIRROR_IMAGE_AURA, true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_the_cleansing_mirror_image_script_effect::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + +// 50238 - The Cleansing: Your Inner Turmoil's On Death Cast on Master +class spell_the_cleansing_on_death_cast_on_master : public SpellScript +{ + PrepareSpellScript(spell_the_cleansing_on_death_cast_on_master); + + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()) }); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (Unit* caster = GetCaster()) + if (TempSummon* casterSummon = caster->ToTempSummon()) + if (Unit* summoner = casterSummon->GetSummonerUnit()) + summoner->CastSpell(summoner, GetSpellInfo()->Effects[EFFECT_0].CalcValue(), true); + } + + void Register() override + { + OnEffectHit += SpellEffectFn(spell_the_cleansing_on_death_cast_on_master::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + void AddSC_howling_fjord() { new npc_attracted_reef_bull(); - new npc_your_inner_turmoil(); new npc_apothecary_hanes(); new npc_plaguehound_tracker(); new npc_razael_and_lyana(); RegisterCreatureAI(npc_rodin_lightning_enabler); RegisterSpellScript(spell_hawk_hunting); + RegisterSpellScript(spell_the_cleansing_shrine_cast); + RegisterSpellScript(spell_the_cleansing_cleansing_soul); + RegisterSpellScript(spell_the_cleansing_mirror_image_script_effect); + RegisterSpellScript(spell_the_cleansing_on_death_cast_on_master); } diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index f36f2d2234..38f669693f 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -5673,6 +5673,29 @@ class spell_gen_bm_on : public SpellScript } }; +class spell_gen_whisper_to_controller : public SpellScript +{ + PrepareSpellScript(spell_gen_whisper_to_controller); + + bool Validate(SpellInfo const* spellInfo) override + { + return sObjectMgr->GetBroadcastText(uint32(spellInfo->GetEffect(EFFECT_0).CalcValue())); + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (Unit* caster = GetCaster()) + if (TempSummon* casterSummon = caster->ToTempSummon()) + if (Player* target = casterSummon->GetSummonerUnit()->ToPlayer()) + casterSummon->Unit::Whisper(uint32(GetEffectValue()), target, false); + } + + void Register() override + { + OnEffectHit += SpellEffectFn(spell_gen_whisper_to_controller::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + void AddSC_generic_spell_scripts() { RegisterSpellScript(spell_silithyst); @@ -5846,4 +5869,5 @@ void AddSC_generic_spell_scripts() RegisterSpellScript(spell_gen_invis_on); RegisterSpellScript(spell_gen_bm_on); RegisterSpellScript(spell_gen_bm_off); + RegisterSpellScript(spell_gen_whisper_to_controller); } diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 870cc73850..4e1b563333 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -247,28 +247,6 @@ class spell_q10525_vision_guide : public AuraScript } }; -class spell_q11322_q11317_the_cleansing : public AuraScript -{ - PrepareAuraScript(spell_q11322_q11317_the_cleansing) - - void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - Unit* ar = GetCaster(); - if (ar && ar->ToPlayer()) - { - if (ar->ToPlayer()->GetQuestStatus(11317) == QUEST_STATUS_INCOMPLETE || ar->ToPlayer()->GetQuestStatus(11322) == QUEST_STATUS_INCOMPLETE) - ar->SummonCreature(27959, 3032.0f, -5095.0f, 723.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - - ar->SetStandState(UNIT_STAND_STATE_SIT); - } - } - - void Register() override - { - OnEffectApply += AuraEffectApplyFn(spell_q11322_q11317_the_cleansing::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); - } -}; - class spell_q10714_on_spirits_wings : public SpellScript { PrepareSpellScript(spell_q10714_on_spirits_wings); @@ -2499,7 +2477,6 @@ void AddSC_quest_spell_scripts() RegisterSpellScript(spell_q12014_steady_as_a_rock); RegisterSpellAndAuraScriptPair(spell_q11026_a11051_banish_the_demons, spell_q11026_a11051_banish_the_demons_aura); RegisterSpellScript(spell_q10525_vision_guide); - RegisterSpellScript(spell_q11322_q11317_the_cleansing); RegisterSpellScript(spell_q10714_on_spirits_wings); RegisterSpellScript(spell_q10720_the_smallest_creature); RegisterSpellScript(spell_q13086_last_line_of_defence);