Scripts/Underrot: Implement Sporecaller Zancha encounter (#30705)

This commit is contained in:
Aqua Deus
2025-04-09 20:00:24 +02:00
committed by GitHub
parent 94da768138
commit 6c374c56b2
5 changed files with 865 additions and 11 deletions

View File

@@ -0,0 +1,151 @@
SET @ATSPAWNID := 199;
SET @ATID := 105;
SET @ATPROPERTIESID := 100;
-- Creatures
UPDATE `creature_template_difficulty` SET `StaticFlags1`=0x10000000, `VerifiedBuild`=58911 WHERE (`Entry`=144306 AND `DifficultyID`=23); -- 144306 (Bloodsworn Defiler) - CanSwim
UPDATE `creature_template_difficulty` SET `StaticFlags1`=0x10000000, `VerifiedBuild`=58911 WHERE (`Entry`=138740 AND `DifficultyID`=23); -- 138740 (Musashitake) - CanSwim
UPDATE `creature_template_difficulty` SET `StaticFlags1`=0x10000000, `VerifiedBuild`=58911 WHERE (`Entry`=131383 AND `DifficultyID`=23); -- 131383 (Sporecaller Zancha) - CanSwim
DELETE FROM `creature_template_difficulty` WHERE (`DifficultyID`=23 AND `Entry` IN (139127,131597));
INSERT INTO `creature_template_difficulty` (`Entry`, `DifficultyID`, `LevelScalingDeltaMin`, `LevelScalingDeltaMax`, `ContentTuningID`, `StaticFlags1`, `StaticFlags2`, `StaticFlags3`, `StaticFlags4`, `StaticFlags5`, `StaticFlags6`, `StaticFlags7`, `StaticFlags8`, `VerifiedBuild`) VALUES
(139127, 23, 0, 0, 502, 0x20000100, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 58911), -- 139127 (Volatile Pod) - Sessile, Floating
(131597, 23, 0, 0, 502, 0x20000100, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 58911); -- 131597 (Spore Pod) - Sessile, Floating
UPDATE `creature_template_difficulty` SET `HealthScalingExpansion`=7, `CreatureDifficultyID`=145910 WHERE `Entry`=139127; -- Volatile Pod
UPDATE `creature_template_difficulty` SET `HealthScalingExpansion`=7, `CreatureDifficultyID`=137515, `StaticFlags1`=0x20000100 WHERE `Entry`=131597; -- Spore Pod
UPDATE `creature_template` SET `unit_flags3`=0x41000001, `AIName`='SmartAI' WHERE `entry`=139127; -- Volatile Pod
UPDATE `creature_template` SET `faction`=16, `BaseAttackTime`=2000, `unit_flags`=0x2000200, `unit_flags2`=0x800, `unit_flags3`=0x41080001, `AIName`='SmartAI' WHERE `entry`=131597; -- Spore Pod
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=144306; -- Bloodsworn Defiler
UPDATE `creature_template` SET `ScriptName`='boss_sporecaller_zancha' WHERE `entry`=131383;
UPDATE `creature_template` SET `ScriptName`='npc_sporecaller_zancha_musashitake' WHERE `entry`=138740;
DELETE FROM `creature_template_addon` WHERE `entry` IN (131597);
INSERT INTO `creature_template_addon` (`entry`, `PathId`, `mount`, `StandState`, `AnimTier`, `VisFlags`, `SheathState`, `PvpFlags`, `emote`, `aiAnimKit`, `movementAnimKit`, `meleeAnimKit`, `visibilityDistanceType`, `auras`) VALUES
(131597, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, '259727'); -- 131597 (Spore Pod) - Boundless Rot
-- Conditions
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (272104, 259720, 272511, 272457, 259732);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `ConditionStringValue1`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(13, 1, 272104, 0, 0, 51, 0, 5, 131383, 0, '', 0, 0, 0, '', 'Spell \'Infusion\' can only hit \'Sporecaller Zancha\''),
(13, 4, 259720, 0, 0, 51, 0, 5, 131597, 0, '', 0, 0, 0, '', 'Spell \'Upheaval\' can only hit \'Spore Pod\''),
(13, 4, 259720, 0, 1, 51, 0, 5, 138740, 0, '', 0, 0, 0, '', 'Spell \'Upheaval\' can only hit \'Musashitake\''),
(13, 1, 272511, 0, 0, 51, 0, 5, 131383, 0, '', 0, 0, 0, '', 'Spell \'Upheaval\' can only hit \'Sporecaller Zancha\''),
(13, 2, 272457, 0, 0, 51, 0, 5, 131597, 0, '', 0, 0, 0, '', 'Spell \'Shockwave\' can only hit \'Spore Pod\''),
(13, 2, 272457, 0, 1, 51, 0, 5, 138740, 0, '', 0, 0, 0, '', 'Spell \'Shockwave\' can only hit \'Musashitake\''),
(13, 1, 259732, 0, 0, 51, 0, 5, 131597, 0, '', 0, 0, 0, '', 'Spell \'Festering Harvest\' can only hit \'Spore Pod\'');
-- Areatriggers
-- INTRO
DELETE FROM `areatrigger` WHERE `SpawnId`=@ATSPAWNID;
INSERT INTO `areatrigger` (`SpawnId`, `AreaTriggerCreatePropertiesId`, `IsCustom`, `MapId`, `SpawnDifficulties`, `PosX`, `PosY`, `PosZ`, `Orientation`, `PhaseUseFlags`, `PhaseId`, `PhaseGroup`, `ScriptName`, `Comment`, `VerifiedBuild`) VALUES
(@ATSPAWNID, @ATPROPERTIESID, 1, 1841, '1,2,8,23', 1032.939941, 1058.290039, 33.330898, 4.695440, 0, 0, 0, '', 'The Underrot - Sporecaller Zancha Intro', 56647);
DELETE FROM `areatrigger_create_properties` WHERE `Id`=@ATPROPERTIESID AND `IsCustom`=1;
INSERT INTO `areatrigger_create_properties` (`Id`, `IsCustom`, `AreaTriggerId`, `IsAreatriggerCustom`, `Flags`, `MoveCurveId`, `ScaleCurveId`, `MorphCurveId`, `FacingCurveId`, `AnimId`, `AnimKitId`, `DecalPropertiesId`, `SpellForVisuals`, `TimeToTargetScale`, `Speed`, `Shape`, `ShapeData0`, `ShapeData1`, `ShapeData2`, `ShapeData3`, `ShapeData4`, `ShapeData5`, `ShapeData6`, `ShapeData7`, `ScriptName`, `VerifiedBuild`) VALUES
(@ATPROPERTIESID, 1, @ATID, 1, 0, 0, 0, 0, 0, -1, 0, 0, NULL, 0, 0, 0, 25, 25, 0, 0, 0, 0, 0, 0, 'at_sporecaller_zancha_intro', 0);
DELETE FROM `areatrigger_template` WHERE `Id`=@ATID AND `IsCustom`=1;
INSERT INTO `areatrigger_template` (`Id`, `IsCustom`, `Flags`, `ActionSetId`, `ActionSetFlags`, `VerifiedBuild`) VALUES
(@ATID, 1, 1, 0, 0, 0);
-- SPELLS
DELETE FROM `areatrigger_template` WHERE (`IsCustom`=0 AND `Id` IN (18227, 16966));
INSERT INTO `areatrigger_template` (`Id`, `IsCustom`, `Flags`, `ActionSetFlags`, `VerifiedBuild`) VALUES
(18227, 0, 0, 0x0800, 58911),
(16966, 0, 0, 0, 49343);
DELETE FROM `areatrigger_create_properties` WHERE (`IsCustom`=0 AND `Id` IN (12266, 13726));
INSERT INTO `areatrigger_create_properties` (`Id`, `IsCustom`, `AreaTriggerId`, `IsAreatriggerCustom`, `Flags`, `MoveCurveId`, `ScaleCurveId`, `MorphCurveId`, `FacingCurveId`, `AnimId`, `AnimKitId`, `DecalPropertiesId`, `SpellForVisuals`, `TimeToTargetScale`, `Speed`, `Shape`, `ShapeData0`, `ShapeData1`, `ShapeData2`, `ShapeData3`, `ShapeData4`, `ShapeData5`, `ShapeData6`, `ShapeData7`, `ScriptName`, `VerifiedBuild`) VALUES
(13726, 0, 18227, 0, 0, 0, 0, 0, 0, -1, 0, 0, NULL, 10000, 7.500002384185791015, 4, 2, 2, 10, 10, 3, 3, 0, 0, 'at_sporecaller_zancha_volatile_pod', 58911), -- Spell: 273300 (Volatile Pods)
(12266, 0, 16966, 0, 4, 0, 0, 0, 0, -1, 0, 0, NULL, 0, 0, 4, 1, 1, 3, 3, 0.300000011920928955, 0.300000011920928955, 0, 0, 'at_sporecaller_zancha_boundless_rot', 49343); -- Spell: 259727 (Boundless Rot)
-- Conversation
DELETE FROM `conversation_actors` WHERE (`Idx`=0 AND `ConversationId` IN (9671, 8358));
INSERT INTO `conversation_actors` (`ConversationId`, `ConversationActorId`, `Idx`, `CreatureId`, `CreatureDisplayInfoId`, `NoActorObject`, `ActivePlayerObject`, `VerifiedBuild`) VALUES
(9671, 51642, 0, 119889, 26353, 0, 0, 58911),
(8358, 64741, 0, 138740, 83603, 0, 0, 49343); -- Full: 0x204250E620877D0000613D000050E907 Creature/0 R4244/S24893 Map: 1841 (The Underrot) Entry: 138740 (Musashitake) Low: 5302535
DELETE FROM `conversation_line_template` WHERE `Id` IN (22107, 18916);
INSERT INTO `conversation_line_template` (`Id`, `UiCameraID`, `ActorIdx`, `Flags`, `ChatType`, `VerifiedBuild`) VALUES
(22107, 90, 0, 0, 0, 58911),
(18916, 0, 0, 0, 0, 49343);
DELETE FROM `conversation_template` WHERE `Id` IN (9671, 8358);
INSERT INTO `conversation_template` (`Id`, `FirstLineID`, `TextureKitId`, `VerifiedBuild`) VALUES
(9671, 22107, 0, 58911),
(8358, 18916, 0, 49343);
-- Summon groups
DELETE FROM `creature` WHERE `guid` IN (850863, 850860, 850857, 850855, 850842);
DELETE FROM `creature_summon_groups` WHERE `summonerId`=131383;
INSERT INTO `creature_summon_groups` (`summonerId`, `summonerType`, `groupId`, `entry`, `position_x`, `position_y`, `position_z`, `orientation`, `summonType`, `summonTime`, `Comment`) VALUES
(131383, 0, 0, 144306, 1041.1, 1051.63, 33.536, 2.44391, 8, 0, 'Sporecaller Zancha - Group 0 - Bloodsworn Defiler'),
(131383, 0, 0, 144306, 1040.15, 1066.87, 33.4068, 3.99352, 8, 0, 'Sporecaller Zancha - Group 0 - Bloodsworn Defiler'),
(131383, 0, 0, 144306, 1024.94, 1050.99, 33.4707, 0.8341, 8, 0, 'Sporecaller Zancha - Group 0 - Bloodsworn Defiler'),
(131383, 0, 0, 144306, 1025.44, 1066.86, 33.3309, 5.471, 8, 0, 'Sporecaller Zancha - Group 0 - Bloodsworn Defiler'),
(131383, 0, 1, 138740, 987.078, 1089.9, 33.2575, 2.76614, 8, 0, 'Sporecaller Zancha - Group 1 - Musashitake'),
(131383, 0, 2, 139127, 1029.8716, 1034.783, 33.64273, 1.443644, 8, 0, 'Sporecaller Zancha - Group 2 - Volatile Pods'),
(131383, 0, 2, 139127, 1013.9844, 1074.3785, 33.120163, 5.567163, 8, 0, 'Sporecaller Zancha - Group 2 - Volatile Pods'),
(131383, 0, 2, 139127, 1007.908, 1051.2622, 32.986603, 0.226441, 8, 0, 'Sporecaller Zancha - Group 2 - Volatile Pods'),
(131383, 0, 2, 139127, 1052.5226, 1072.8438, 32.91686, 3.785604, 8, 0, 'Sporecaller Zancha - Group 2 - Volatile Pods'),
(131383, 0, 2, 139127, 1049.1493, 1043.3004, 33.95835, 2.441261, 8, 0, 'Sporecaller Zancha - Group 2 - Volatile Pods'),
(131383, 0, 2, 139127, 1035.6615, 1082.0781, 32.738506, 4.595758, 8, 0, 'Sporecaller Zancha - Group 2 - Volatile Pods');
-- SAI
DELETE FROM `smart_scripts` WHERE `entryorguid`=144306 AND `id`=0;
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `Difficulties`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param_string`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `action_param7`, `action_param_string`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_param_string`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(144306, 0, 0, 0, '', 63, 0, 100, 0, 0, 0, 0, 0, 0, '', 85, 272104, 2, 0, 0, 0, 0, 0, NULL, 1, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 'Bloodsworn Defiler - On Created - Cast Self: Infusion');
DELETE FROM `smart_scripts` WHERE `entryorguid`=131597 AND `source_type`=0;
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `Difficulties`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param_string`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `action_param7`, `action_param_string`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_param_string`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(131597, 0, 0, 0, '', 63, 0, 100, 0, 0, 0, 0, 0, 0, '', 8, 0, 0, 0, 0, 0, 0, 0, NULL, 1, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 'Spore Pod - On Just Created - Set ReactState Passive'),
(131597, 0, 1, 4, '', 8, 0, 100, 0, 272457, 0, 0, 0, 0, '', 85, 259862, 0, 0, 0, 0, 0, 0, NULL, 1, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 'Spore Pod - On Spellhit - Cast \'Spore Pod hit by Boss Ability\''),
(131597, 0, 2, 4, '', 8, 0, 100, 0, 259720, 0, 0, 0, 0, '', 85, 259862, 0, 0, 0, 0, 0, 0, NULL, 1, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 'Spore Pod - On Spellhit - Cast \'Spore Pod hit by Boss Ability\''),
(131597, 0, 3, 4, '', 8, 0, 100, 0, 259732, 0, 0, 0, 0, '', 85, 259958, 0, 0, 0, 0, 0, 0, NULL, 1, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 'Spore Pod - On Spellhit - Cast \'BIG Spore Pod Detonation\''),
(131597, 0, 4, 0, '', 61, 0, 100, 0, 0, 0, 0, 0, 0, '', 41, 100, 0, 0, 0, 0, 0, 0, NULL, 1, 0, 0, 0, 0, NULL, 0, 0, 0, 0, 'Spore Pod - On Linked Event - Despawn');
-- Volatile Pod smart ai
SET @ENTRY := 139127;
UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = @ENTRY;
DELETE FROM `smart_scripts` WHERE `source_type` = 0 AND `entryOrGuid` = @ENTRY;
DELETE FROM `smart_scripts` WHERE `source_type` = 9 AND `entryOrGuid` IN (13912700);
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`, `action_param7`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`, `Difficulties`) VALUES
(@ENTRY, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 0, 80, 13912700, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'On respawn - Self: Start timed action list id #Volatile Pod #0 (13912700) (update always) // -inline', ''),
(@ENTRY * 100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'After 0 seconds - Self: Set react state to Passive', ''),
(@ENTRY * 100, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 128, 7687, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'After 0 seconds - Self: Plays Anim with ID 7687', ''),
(@ENTRY * 100, 9, 2, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 0, 85, 273285, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'After 4 seconds - Self: Cast spell 273285 on self', ''),
(@ENTRY * 100, 9, 3, 0, 0, 0, 100, 0, 100, 100, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'After 0.1 seconds - Self: Despawn instantly', '');
-- Texts
DELETE FROM `creature_text` WHERE `CreatureID` IN (131383, 138740);
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
(131383, 0, 0, 'Rot must spread!', 14, 0, 50, 0, 0, 109964, 143938, 0, 'Sporecaller Zancha'),
(131383, 0, 1, 'Harvest!', 14, 0, 50, 0, 0, 109965, 143939, 0, 'Sporecaller Zancha'),
(131383, 1, 0, '|TInterface\\Icons\\ABILITY_EARTHEN_PILLAR.BLP:20|t %s targets you with |cFFFF0000|Hspell:259720|h[Upheaval]|h|r!', 42, 0, 100, 0, 0, 0, 161956, 0, 'Sporecaller Zancha'),
(131383, 2, 0, 'Grow!', 14, 0, 50, 0, 0, 109960, 143951, 0, 'Sporecaller Zancha'), -- BroadcastTextID: 86442 - 143951
(131383, 2, 1, 'Corruption blooms!', 14, 0, 50, 0, 0, 109962, 143953, 0, 'Sporecaller Zancha'),
(131383, 3, 0, 'Such fertile soil.', 14, 0, 100, 0, 0, 109969, 143948, 0, 'Sporecaller Zancha'),
(131383, 4, 0, 'Must feed!', 14, 0, 100, 0, 0, 109968, 143955, 0, 'Sporecaller Zancha'),
(131383, 5, 0, 'Everything... decays...', 14, 0, 100, 0, 0, 109966, 143960, 0, 'Sporecaller Zancha'),
(138740, 0, 0, 'Nothing personal.', 12, 0, 100, 0, 0, 0, 157014, 0, 'Musashitake to Player'); -- BroadcastTextID: 31808 - 157014
-- Spells
DELETE FROM `spell_script_names` WHERE `spell_id` IN (273285, 273271, 272511, 259888, 259845, 259732, 259718, 273226, 259717, 272786, 272787);
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(273285, 'spell_sporecaller_zancha_volatile_pods_explosion'),
(273271, 'spell_sporecaller_zancha_volatile_pods'),
(272511, 'spell_sporecaller_zancha_upheaval_script_effect'),
(259888, 'spell_sporecaller_zancha_festering_harvest'),
(259845, 'spell_sporecaller_zancha_boundless_rot'),
(259732, 'spell_sporecaller_zancha_festering_harvest_pods_selector'),
(259718, 'spell_sporecaller_zancha_upheaval_marker'),
(259717, 'spell_sporecaller_zancha_upheaval_selector'),
(272786, 'spell_sporecaller_zancha_musashitake_teleport_selector'),
(272787, 'spell_sporecaller_zancha_musashitake_teleport');
DELETE FROM `creature_template_addon` WHERE `entry`=139127;
INSERT INTO `creature_template_addon` (`entry`, `AnimTier`) VALUES
(139127, 0);

View File

@@ -4806,6 +4806,15 @@ void SpellMgr::LoadSpellInfoCorrections()
});
});
ApplySpellFix({
260566, // Wildfire Missile
260570 // Wildfire Missile Impact
}, [](SpellInfo* spellInfo)
{
spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
spellInfo->AttributesEx9 |= SPELL_ATTR9_FORCE_DEST_LOCATION;
});
// ENDOF WAYCREST MANOR SPELLS
//
@@ -4937,19 +4946,19 @@ void SpellMgr::LoadSpellInfoCorrections()
//
//
// WAYCREST MANOR SPELLS
// UNDERROT SPELLS
//
ApplySpellFix({
260566, // Wildfire Missile
260570 // Wildfire Missile Impact
}, [](SpellInfo* spellInfo)
// Boundless Rot
ApplySpellFix({ 259845 }, [](SpellInfo* spellInfo)
{
spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
spellInfo->AttributesEx9 |= SPELL_ATTR9_FORCE_DEST_LOCATION;
ApplySpellEffectFix(spellInfo, EFFECT_0, [](SpellEffectInfo* spellEffectInfo)
{
spellEffectInfo->TargetA = SpellImplicitTargetInfo(TARGET_DEST_DEST);
});
});
// ENDOF WAYCREST MANOR SPELLS
// ENDOF UNDERROT SPELLS
//
//

View File

@@ -0,0 +1,691 @@
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "AreaTrigger.h"
#include "AreaTriggerAI.h"
#include "CellImpl.h"
#include "Containers.h"
#include "Conversation.h"
#include "Creature.h"
#include "GridNotifiersImpl.h"
#include "InstanceScript.h"
#include "ObjectAccessor.h"
#include "PathGenerator.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "SpellAuraEffects.h"
#include "SpellAuras.h"
#include "SpellMgr.h"
#include "SpellScript.h"
#include "underrot.h"
enum SporecallerZanchaSpells
{
// Intro
SPELL_BOSS_3_INTRO = 280683,
SPELL_INFUSION = 272104,
SPELL_FESTERING_HARVEST = 259888,
SPELL_FESTERING_HARVEST_DAMAGE = 259732,
SPELL_BOUNDLESS_ROT = 259830,
SPELL_SHOCKWAVE = 272457,
SPELL_UPHEAVAL_SELECTOR = 259717,
SPELL_UPHEAVAL_AURA = 259718,
SPELL_UPHEAVAL_SCRIPT_EFFECT = 272511,
SPELL_UPHEAVAL_MISSILE = 274213,
SPELL_UPHEAVAL_DAMAGE = 259720,
SPELL_DECAYING_SPORES = 259714,
SPELL_SPORE_POD_BEAM = 259968,
SPELL_VOLATILE_PODS = 273271,
SPELL_VOLATILE_PODS_VISUAL = 273285,
SPELL_VOLATILE_PODS_AREATRIGGER = 273300,
// Musashitake
SPELL_ACHIEVEMENT_VISUAL = 272773,
SPELL_TELEPORT_BEHIND_YOU_SELECTOR = 272786,
SPELL_TELEPORT = 272787,
SPELL_THOUSAND_FOLD_BLADE = 272864
};
enum SporecallerZanchaEvents
{
EVENT_CHECK_ENERGY = 1,
EVENT_SHOCKWAVE,
EVENT_UPHEAVAL,
EVENT_VOLATILE_PODS,
EVENT_BOUNDLESS_ROT,
// Musashitake
EVENT_TELEPORT
};
enum SporecallerZanchaTexts
{
SAY_AGGRO = 0,
SAY_UPHEAVAL = 1,
SAY_FESTERING_HARVEST = 2,
SAY_WIPE = 3,
SAY_KILL = 4,
SAY_DEATH = 5,
// Musashitake
SAY_PERSONAL = 0
};
enum SporecallerZanchaSummonGroups
{
SUMMON_GROUP_ZANCHA_INTRO = 0,
SUMMON_GROUP_MUSASHITAKE = 1,
SUMMON_GROUP_VOLATILE_PODS = 2
};
enum SporecallerZanchaActions
{
ACTION_INTRO = 1
};
enum SporecallerZanchaCreatures
{
NPC_SPORE_POD = 131597
};
enum MusashitakeMisc
{
CONVERSATION_START = 8358
};
// 131383 - Sporecaller Zancha
struct boss_sporecaller_zancha : public BossAI
{
boss_sporecaller_zancha(Creature* creature) : BossAI(creature, DATA_SPORECALLER_ZANCHA), _shockwaveCount(1), _upheavalCount(1), _volatilePodsCount(1) { }
void JustAppeared() override
{
me->SummonCreatureGroup(SUMMON_GROUP_MUSASHITAKE);
me->SetPowerType(POWER_ENERGY);
me->SetPower(POWER_ENERGY, 0);
}
void KilledUnit(Unit* victim) override
{
if (!victim->IsPlayer())
return;
Talk(SAY_KILL);
}
void JustDied(Unit* /*killer*/) override
{
_JustDied();
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
Talk(SAY_DEATH);
}
void Reset() override
{
_Reset();
_shockwaveCount = 1;
_upheavalCount = 1;
_volatilePodsCount = 1;
}
void EnterEvadeMode(EvadeReason /*why*/) override
{
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
summons.DespawnAll();
Talk(SAY_WIPE);
_EnterEvadeMode();
_DespawnAtEvade();
}
void JustEngagedWith(Unit* who) override
{
BossAI::JustEngagedWith(who);
instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me, 1);
Talk(SAY_AGGRO);
DoCastSelf(SPELL_BOUNDLESS_ROT);
DoCastSelf(SPELL_FESTERING_HARVEST);
events.ScheduleEvent(EVENT_CHECK_ENERGY, 500ms);
if (IsHeroicOrHigher() || IsMythicPlus())
{
events.ScheduleEvent(EVENT_SHOCKWAVE, 10600ms);
events.ScheduleEvent(EVENT_UPHEAVAL, 16600ms);
events.ScheduleEvent(EVENT_VOLATILE_PODS, 21600ms);
}
else
{
events.ScheduleEvent(EVENT_SHOCKWAVE, 10500ms);
events.ScheduleEvent(EVENT_UPHEAVAL, 16s);
}
}
void DoAction(int32 action) override
{
if (action != ACTION_INTRO)
return;
for (ObjectGuid summonGUID : summons)
{
if (Creature* defiler = ObjectAccessor::GetCreature(*me, summonGUID))
{
defiler->KillSelf();
defiler->DespawnOrUnsummon(20s);
}
}
me->SummonCreatureGroup(SUMMON_GROUP_MUSASHITAKE);
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch (events.ExecuteEvent())
{
case EVENT_CHECK_ENERGY:
{
if (me->GetPower(POWER_ENERGY) >= 100)
{
Talk(SAY_FESTERING_HARVEST);
DoCastSelf(SPELL_FESTERING_HARVEST_DAMAGE);
events.ScheduleEvent(EVENT_BOUNDLESS_ROT, 9s);
events.RescheduleEvent(EVENT_CHECK_ENERGY, 10s);
}
events.Repeat(500ms);
break;
}
case EVENT_SHOCKWAVE:
{
DoCastSelf(SPELL_SHOCKWAVE);
_shockwaveCount++;
if (IsHeroicOrHigher() || IsMythicPlus())
{
if (_shockwaveCount == 2)
events.Repeat(14600ms);
else if (_shockwaveCount == 3)
events.Repeat(45100ms);
else if (_shockwaveCount % 2 == 0)
events.Repeat(20700ms);
else
events.Repeat(30400ms);
}
else
{
if (_shockwaveCount == 2)
events.Repeat(14600ms);
else if (_shockwaveCount == 4)
events.Repeat(30400ms);
else if (_shockwaveCount % 2 == 0)
events.Repeat(40100ms);
else
events.Repeat(15800ms);
}
break;
}
case EVENT_UPHEAVAL:
{
DoCastSelf(SPELL_UPHEAVAL_SELECTOR);
_upheavalCount++;
if (IsHeroicOrHigher() || IsMythicPlus())
{
if (_upheavalCount == 3)
events.Repeat(24300ms);
else if (_upheavalCount % 2 == 0)
events.Repeat(20700ms);
else
events.Repeat(30400ms);
}
else
{
if (_upheavalCount == 3)
events.Repeat(30400ms);
else if (_upheavalCount % 3 == 0)
events.Repeat(24300ms);
else
events.Repeat(15800ms);
}
break;
}
case EVENT_VOLATILE_PODS:
{
DoCastSelf(SPELL_VOLATILE_PODS);
_volatilePodsCount++;
if (_volatilePodsCount == 4)
events.Repeat(27900ms);
else
events.Repeat(25500ms);
break;
}
case EVENT_BOUNDLESS_ROT:
{
DoCastSelf(SPELL_BOUNDLESS_ROT);
break;
}
default:
break;
}
}
private:
uint32 _shockwaveCount;
uint32 _upheavalCount;
uint32 _volatilePodsCount;
};
// 138740 - Musashitake
struct npc_sporecaller_zancha_musashitake : public ScriptedAI
{
npc_sporecaller_zancha_musashitake(Creature* creature) : ScriptedAI(creature) { }
void JustAppeared() override
{
me->SetReactState(REACT_PASSIVE);
}
void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
{
if ((spellInfo->Id == SPELL_SHOCKWAVE || spellInfo->Id == SPELL_UPHEAVAL_DAMAGE) && me->HasReactState(REACT_PASSIVE))
{
if (IsHeroicOrHigher() || IsMythicPlus())
{
me->RemoveAurasDueToSpell(SPELL_ACHIEVEMENT_VISUAL);
Conversation::CreateConversation(CONVERSATION_START, me, me->GetPosition(), ObjectGuid::Empty);
me->SetUninteractible(false);
me->RemoveUnitFlag2(UNIT_FLAG2_UNTARGETABLE_BY_CLIENT);
me->SetReactState(REACT_AGGRESSIVE);
_events.ScheduleEvent(EVENT_TELEPORT, 3s);
}
}
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
_events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch (_events.ExecuteEvent())
{
case EVENT_TELEPORT:
{
Talk(SAY_PERSONAL);
DoCastSelf(SPELL_TELEPORT_BEHIND_YOU_SELECTOR);
_events.Repeat(20s);
break;
}
default:
break;
}
}
private:
EventMap _events;
};
// 259717 - Upheaval
class spell_sporecaller_zancha_upheaval_selector : public SpellScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_UPHEAVAL_AURA });
}
void HandleHitTarget(SpellEffIndex /*effIndex*/) const
{
if (Creature* creatureCaster = GetCaster()->ToCreature())
{
creatureCaster->CastSpell(GetHitUnit(), SPELL_UPHEAVAL_AURA, CastSpellExtraArgsInit{
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
.TriggeringSpell = GetSpell()
});
creatureCaster->AI()->Talk(SAY_UPHEAVAL, GetHitUnit());
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_sporecaller_zancha_upheaval_selector::HandleHitTarget, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
// 259718 - Upheaval
class spell_sporecaller_zancha_upheaval_marker : public AuraScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_UPHEAVAL_SCRIPT_EFFECT });
}
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) const
{
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
return;
Unit* target = GetTarget();
target->CastSpell(target, SPELL_UPHEAVAL_SCRIPT_EFFECT, CastSpellExtraArgsInit{
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
.TriggeringAura = aurEff
});
}
void Register() override
{
AfterEffectRemove += AuraEffectRemoveFn(spell_sporecaller_zancha_upheaval_marker::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
// 272511 - Upheaval
class spell_sporecaller_zancha_upheaval_script_effect : public SpellScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_UPHEAVAL_MISSILE });
}
void HandleHitTarget(SpellEffIndex /*effIndex*/) const
{
GetHitUnit()->CastSpell(GetCaster(), SPELL_UPHEAVAL_MISSILE, TRIGGERED_IGNORE_CAST_TIME);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_sporecaller_zancha_upheaval_script_effect::HandleHitTarget, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
// 259888 - Festering Harvest
class spell_sporecaller_zancha_festering_harvest : public AuraScript
{
static constexpr std::array<uint8, 5> SporecallerEnergizeCycle = { 2, 2, 2, 2, 3 };
void PeriodicTick(AuraEffect const* aurEff) const
{
uint8 cycleIdx = aurEff->GetTickNumber() % SporecallerEnergizeCycle.size();
GetTarget()->ModifyPower(POWER_ENERGY, SporecallerEnergizeCycle[cycleIdx]);
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_sporecaller_zancha_festering_harvest::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
}
};
// 259732 - Festering Harvest
class spell_sporecaller_zancha_festering_harvest_pods_selector : public SpellScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_SPORE_POD_BEAM });
}
void OnPrecast() override
{
std::list<Creature*> sporePods;
Trinity::AllCreaturesOfEntryInRange checker(GetCaster(), NPC_SPORE_POD, 200.0f);
Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(GetCaster(), sporePods, checker);
Cell::VisitAllObjects(GetCaster(), searcher, 200.0f);
if (sporePods.empty())
return;
for (Creature* spore : sporePods)
{
spore->CastSpell(spore, SPELL_SPORE_POD_BEAM, CastSpellExtraArgsInit{
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
.TriggeringSpell = GetSpell()
});
}
}
void Register() override { }
};
// 259845 - Boundless Rot
class spell_sporecaller_zancha_boundless_rot : public SpellScript
{
static constexpr Position CenterPosition = { 1032.9444f, 1058.2899f, 33.330894f };
static void SetDest(SpellDestination& dest)
{
dest.Relocate(CenterPosition);
}
void Register() override
{
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_sporecaller_zancha_boundless_rot::SetDest, EFFECT_0, TARGET_DEST_DEST);
}
};
// 273271 - Volatile Pods
class spell_sporecaller_zancha_volatile_pods : public SpellScript
{
void HandleHitTarget(SpellEffIndex /*effIndex*/) const
{
if (Creature* creatureCaster = GetCaster()->ToCreature())
creatureCaster->SummonCreatureGroup(SUMMON_GROUP_VOLATILE_PODS);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_sporecaller_zancha_volatile_pods::HandleHitTarget, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
// 273285 - Volatile Pods
class spell_sporecaller_zancha_volatile_pods_explosion : public SpellScript
{
static constexpr uint8 MAX_VOLATILE_PODS = 6;
void HandleHitTarget(SpellEffIndex /*effIndex*/) const
{
Unit* target = GetHitUnit();
for (uint8 i = 0; i < MAX_VOLATILE_PODS; ++i)
{
float angle = target->GetOrientation() + float(M_PI) / 6.0f + i * float(M_PI) / 3.0f;
Position dest(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), angle);
target->CastSpell(dest, SPELL_VOLATILE_PODS_AREATRIGGER, CastSpellExtraArgsInit{
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
.TriggeringSpell = GetSpell()
});
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_sporecaller_zancha_volatile_pods_explosion::HandleHitTarget, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
// 272786 - Teleport Behind You
class spell_sporecaller_zancha_musashitake_teleport_selector : public SpellScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_TELEPORT });
}
void HandleHitTarget(SpellEffIndex /*effIndex*/) const
{
GetCaster()->CastSpell(GetHitUnit(), SPELL_TELEPORT, CastSpellExtraArgsInit{
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
.TriggeringSpell = GetSpell()
});
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_sporecaller_zancha_musashitake_teleport_selector::HandleHitTarget, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
// 272787 - Teleport
class spell_sporecaller_zancha_musashitake_teleport : public SpellScript
{
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_THOUSAND_FOLD_BLADE });
}
void HandleTeleport(SpellEffIndex /*effIndex*/) const
{
GetCaster()->CastSpell(GetCaster(), SPELL_THOUSAND_FOLD_BLADE, CastSpellExtraArgsInit{
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
.TriggeringSpell = GetSpell()
});
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_sporecaller_zancha_musashitake_teleport::HandleTeleport, EFFECT_0, SPELL_EFFECT_TELEPORT_UNITS);
}
};
// 259727 - Boundless Rot
// ID - 12266
struct at_sporecaller_zancha_boundless_rot : AreaTriggerAI
{
using AreaTriggerAI::AreaTriggerAI;
void OnUnitEnter(Unit* unit) override
{
Player* player = unit->ToPlayer();
if (!player || player->IsGameMaster())
return;
Unit* caster = at->GetCaster();
if (!caster)
return;
player->CastSpell(player, SPELL_DECAYING_SPORES, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR);
if (Creature* creatureCaster = caster->ToCreature())
creatureCaster->DespawnOrUnsummon();
}
};
// 273300 - Volatile Pods
// ID - 13726
struct at_sporecaller_zancha_volatile_pod : AreaTriggerAI
{
using AreaTriggerAI::AreaTriggerAI;
void OnInitialize() override
{
Position destPos = at->GetPosition();
at->MovePositionToFirstCollision(destPos, 200.0f, 0.0f);
PathGenerator path(at);
path.CalculatePath(destPos.GetPositionX(), destPos.GetPositionY(), destPos.GetPositionZ(), true);
at->InitSplines(path.GetPath());
}
void OnDestinationReached() override
{
at->Remove();
}
void OnUnitEnter(Unit* unit) override
{
if (!unit->IsPlayer())
return;
Unit* caster = at->GetCaster();
if (!caster)
return;
caster->CastSpell(unit, SPELL_DECAYING_SPORES, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR);
}
};
// Id 100 - Areatrigger
struct at_sporecaller_zancha_intro : AreaTriggerAI
{
using AreaTriggerAI::AreaTriggerAI;
void OnCreate(Spell const* /*creatingSpell*/) override
{
InstanceScript* instance = at->GetInstanceScript();
if (!instance)
return;
if (Creature* zancha = instance->GetCreature(DATA_SPORECALLER_ZANCHA))
{
if (zancha->IsAlive())
zancha->SummonCreatureGroup(SUMMON_GROUP_ZANCHA_INTRO);
}
}
void OnUnitEnter(Unit* unit) override
{
Player* player = unit->ToPlayer();
if (!player || player->IsGameMaster())
return;
InstanceScript* instance = at->GetInstanceScript();
if (!instance)
return;
Creature* zancha = instance->GetCreature(DATA_SPORECALLER_ZANCHA);
if (!zancha || !zancha->IsAlive())
return;
zancha->AI()->DoAction(ACTION_INTRO);
zancha->CastSpell(unit, SPELL_BOSS_3_INTRO);
at->Remove();
}
};
void AddSC_boss_sporecaller_zancha()
{
RegisterUnderrotCreatureAI(boss_sporecaller_zancha);
RegisterUnderrotCreatureAI(npc_sporecaller_zancha_musashitake);
RegisterSpellScript(spell_sporecaller_zancha_upheaval_selector);
RegisterSpellScript(spell_sporecaller_zancha_upheaval_marker);
RegisterSpellScript(spell_sporecaller_zancha_upheaval_script_effect);
RegisterSpellScript(spell_sporecaller_zancha_festering_harvest);
RegisterSpellScript(spell_sporecaller_zancha_festering_harvest_pods_selector);
RegisterSpellScript(spell_sporecaller_zancha_boundless_rot);
RegisterSpellScript(spell_sporecaller_zancha_volatile_pods);
RegisterSpellScript(spell_sporecaller_zancha_volatile_pods_explosion);
// Musashitake
RegisterSpellScript(spell_sporecaller_zancha_musashitake_teleport_selector);
RegisterSpellScript(spell_sporecaller_zancha_musashitake_teleport);
RegisterAreaTriggerAI(at_sporecaller_zancha_boundless_rot);
RegisterAreaTriggerAI(at_sporecaller_zancha_volatile_pod);
RegisterAreaTriggerAI(at_sporecaller_zancha_intro);
}

View File

@@ -23,7 +23,8 @@
BossBoundaryData const boundaries =
{
{ DATA_ELDER_LEAXA, new CircleBoundary(Position(869.502014f, 1230.199951f), 58.0f) },
{ DATA_CRAGMAW_THE_INFESTED, new CircleBoundary(Position(852.797974f, 982.133545f), 90.0f) }
{ DATA_CRAGMAW_THE_INFESTED, new CircleBoundary(Position(852.797974f, 982.133545f), 90.0f) },
{ BOSS_SPORECALLER_ZANCHA, new ZRangeBoundary(35.240f, 26.790f) }
};
ObjectData const creatureData[] =
@@ -44,8 +45,8 @@ DoorData const doorData[] =
DungeonEncounterData const encounters[] =
{
{ DATA_ELDER_LEAXA, {{ 2111 }} },
{ DATA_CRAGMAW_THE_INFESTED, {{ 2112 }} },
{ DATA_SPORECALLER_ZANCHA, {{ 2118 }} },
{ DATA_CRAGMAW_THE_INFESTED, {{ 2118 }} },
{ DATA_SPORECALLER_ZANCHA, {{ 2112 }} },
{ DATA_UNBOUND_ABOMINATION, {{ 2123 }} },
};

View File

@@ -27,6 +27,7 @@ void AddSC_boss_priestess_alun_za();
void AddSC_instance_underrot();
void AddSC_boss_elder_leaxa();
void AddSC_boss_cragmaw_the_infested();
void AddSC_boss_sporecaller_zancha();
// KingsRest
void AddSC_instance_kings_rest();
@@ -47,6 +48,7 @@ void AddZandalarScripts()
AddSC_instance_underrot();
AddSC_boss_elder_leaxa();
AddSC_boss_cragmaw_the_infested();
AddSC_boss_sporecaller_zancha();
//KingsRest
AddSC_instance_kings_rest();