mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-13 03:32:28 -04:00
Scripts/EcoDomeAldani: Implement Azhiccar encounter (#31364)
Co-authored-by: ModoX <moardox@gmail.com>
This commit is contained in:
103
sql/updates/world/master/2026_04_11_00_world.sql
Normal file
103
sql/updates/world/master/2026_04_11_00_world.sql
Normal file
@@ -0,0 +1,103 @@
|
||||
SET @ATSPAWNID := 286;
|
||||
SET @ATPROP := 176;
|
||||
SET @ATID := 185;
|
||||
|
||||
-- Creature
|
||||
UPDATE `creature_template` SET `faction`=16, `BaseAttackTime`=2000, `unit_flags2`=0x800, `unit_flags3`=0x80000, `AIName`='SmartAI' WHERE `entry`=236190; -- Frenzied Mite
|
||||
UPDATE `creature_template` SET `faction`=16, `BaseAttackTime`=2000, `unit_flags`=33555264, `unit_flags3`=1073741824, `ScriptName`='boss_azhiccar' WHERE `entry`=234893;
|
||||
UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=237454;
|
||||
UPDATE `creature_template` SET `ScriptName`='npc_azhiccar_intro_creature' WHERE `entry` IN (245411, 245412);
|
||||
|
||||
DELETE FROM `creature_template_addon` WHERE `entry`=234893;
|
||||
INSERT INTO `creature_template_addon` (`entry`, `PathId`, `mount`, `MountCreatureID`, `StandState`, `AnimTier`, `VisFlags`, `SheathState`, `PvPFlags`, `emote`, `aiAnimKit`, `movementAnimKit`, `meleeAnimKit`, `visibilityDistanceType`, `auras`) VALUES
|
||||
(234893, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, '422356');
|
||||
|
||||
DELETE FROM `creature_addon` WHERE `guid`=10006776;
|
||||
INSERT INTO `creature_addon` (`guid`, `PathId`, `mount`, `MountCreatureID`, `StandState`, `AnimTier`, `VisFlags`, `SheathState`, `PvPFlags`, `emote`, `aiAnimKit`, `movementAnimKit`, `meleeAnimKit`, `visibilityDistanceType`, `auras`) VALUES
|
||||
(10006776, 0, 0, 0, 0, 0, 0, 1, 0, 0, 19254, 0, 0, 0, '');
|
||||
|
||||
DELETE FROM `creature_template_difficulty` WHERE (`DifficultyID`=23 AND `Entry` =236190);
|
||||
INSERT INTO `creature_template_difficulty` (`Entry`, `DifficultyID`, `HealthScalingExpansion`, `HealthModifier`, `ManaModifier`, `CreatureDifficultyID`, `TypeFlags`, `TypeFlags2`, `TypeFlags3`) VALUES
|
||||
(236190, 23, 10, 0.5, 1, 315019, 0x200048, 128, 0); -- Frenzied Mite
|
||||
|
||||
UPDATE `creature_template_difficulty` SET `ContentTuningID`=1279, `StaticFlags1`=0x10000000 WHERE (`Entry`=236190 AND `DifficultyID`=23); -- 236190 (Frenzied Mite) - CanSwim
|
||||
|
||||
-- SAI
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=237454 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
|
||||
(237454, 0, 0, 0, '', 63, 0, 100, 0, 0, 0, 0, 0, 0, '', 85, 1217720, 0, 0, 0, 0, 0, 0, NULL, 1, 0, 0, 0, 0, NULL, 0, 0, 0, 0, '[DNT] Stalker - On Just Summoned - Cast self [DNT] Spawn');
|
||||
|
||||
UPDATE `creature_template` SET `AIName`='', `ScriptName`='npc_azhiccar_frenzied_mite' WHERE `entry`=236190;
|
||||
|
||||
-- Instance
|
||||
DELETE FROM `instance_template` WHERE `map`=2830;
|
||||
INSERT INTO `instance_template` (`map`, `parent`, `script`) VALUES
|
||||
(2830, 0, 'instance_ecodome_aldani');
|
||||
|
||||
-- Conditions
|
||||
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (1217255, 1233147, 1233116);
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `ConditionStringValue1`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
|
||||
(13, 1, 1217255, 0, 0, 51, 0, 5, 236190, 0, '', 0, 0, 0, '', 'Spell \'Devour\' can only hit \'Frenzied Mite\''),
|
||||
(13, 2, 1217255, 0, 0, 51, 0, 5, 236190, 0, '', 0, 0, 0, '', 'Spell \'Devour\' can only hit \'Frenzied Mite\''),
|
||||
(13, 2, 1233147, 0, 0, 51, 0, 5, 234893, 0, '', 0, 0, 0, '', 'Spell \'Devour\' can only hit \'Azhiccar\''),
|
||||
(13, 4, 1233147, 0, 0, 51, 0, 5, 234893, 0, '', 0, 0, 0, '', 'Spell \'Devour\' can only hit \'Azhiccar\''),
|
||||
(13, 1, 1233116, 0, 1, 51, 0, 5, 245411, 0, '', 0, 0, 0, '', 'Spell \'Devour\' can only hit \'Ravaging Scavenger\''),
|
||||
(13, 1, 1233116, 0, 0, 51, 0, 5, 245412, 0, '', 0, 0, 0, '', 'Spell \'Devour\' can only hit \'Voracious Gorger\'');
|
||||
|
||||
-- Areatrigger
|
||||
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, @ATPROP, 1, 2830, '1,2,23,8,205', 526.473, -747.901, 999.682, 6.1991, 0, 0, 0, 'at_azhiccar_intro', 'Eco-Dome Aldani - Azhiccar intro', 0);
|
||||
|
||||
DELETE FROM `areatrigger_create_properties` WHERE `Id`=@ATPROP AND `IsCustom`=1;
|
||||
INSERT INTO `areatrigger_create_properties` (`Id`, `IsCustom`, `AreaTriggerId`, `IsAreatriggerCustom`, `Flags`, `MoveCurveId`, `ScaleCurveId`, `MorphCurveId`, `FacingCurveId`, `AnimId`, `AnimKitId`, `DecalPropertiesId`, `SpellForVisuals`, `TimeToTargetScale`, `Speed`, `SpeedIsTime`, `Shape`, `ShapeData0`, `ShapeData1`, `ShapeData2`, `ShapeData3`, `ShapeData4`, `ShapeData5`, `ShapeData6`, `ShapeData7`, `ScriptName`, `VerifiedBuild`) VALUES
|
||||
(@ATPROP, 1, @ATID, 1, 0, 0, 0, 0, 0, -1, 0, 0, NULL, 0, 0, 0, 1, 20, 10, 5, 20, 10, 5, 0, 0, '', 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);
|
||||
|
||||
DELETE FROM `areatrigger_create_properties` WHERE (`IsCustom`=0 AND `Id` IN (36165, 36166, 38667, 36181, 38379));
|
||||
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
|
||||
(36165, 0, 38189, 0, 0, 0, 0, 0, 0, -1, 0, 0, 1217240, 18000, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 'at_azhiccar_devour', 63305), -- SpellForVisuals: 1217240 (Devour)
|
||||
(36166, 0, 38188, 0, 0, 0, 0, 0, 0, -1, 0, 0, 1217240, 18000, 0, 0, 108, 108, 0, 0, 0, 0, 0, 0, 'at_azhiccar_devour_force', 63305), -- SpellForVisuals: 1217240 (Devour)
|
||||
(38667, 0, 34184, 0, 0, 0, 0, 0, 0, -1, 0, 0, 1217240, 18000, 0, 0, 20, 20, 0, 0, 0, 0, 0, 0, '', 63305), -- SpellForVisuals: 1217240 (Devour)
|
||||
(36181, 0, 38204, 0, 4, 0, 81441, 0, 0, -1, 0, 690, NULL, 180000, 0, 0, 10, 10, 0, 0, 0, 0, 0, 0, 'at_azhiccar_digestive_spittle', 63305), -- Spell: 1217441 (Digestive Spittle)
|
||||
(38379, 0, 6197, 0, 2, 0, 0, 0, 0, -1, 0, 0, NULL, 6000, 0, 0, 108, 108, 0, 0, 0, 0, 0, 0, '', 63305);
|
||||
|
||||
DELETE FROM `areatrigger_template` WHERE (`IsCustom`=0 AND `Id` IN (38189, 38188, 34184, 38204));
|
||||
INSERT INTO `areatrigger_template` (`Id`, `IsCustom`, `VerifiedBuild`) VALUES
|
||||
(38189, 0, 63305),
|
||||
(38188, 0, 63305),
|
||||
(34184, 0, 63305),
|
||||
(38204, 0, 63305);
|
||||
|
||||
UPDATE `areatrigger_template` SET `VerifiedBuild`=63305 WHERE (`Id`=6197 AND `IsCustom`=0);
|
||||
|
||||
-- Texts
|
||||
DELETE FROM `creature_text` WHERE `CreatureID` = 234893;
|
||||
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
|
||||
(234893, 0, 0, '|TInterface\\ICONS\\Spell_Shadow_DevouringPlague..blp:20|t %s prepares to |cFFFF0000|Hspell:1217232|h[Devour]|h|r!', 41, 0, 100, 0, 0, 283865, 285972, 0, 'Azhiccar');
|
||||
|
||||
-- Spells
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_azhiccar_energy_controller', 'spell_azhiccar_feast', 'spell_azhiccar_devour_selector', 'spell_azhiccar_devour', 'spell_azhiccar_player_detection', 'spell_azhiccar_invading_shriek_dummy', 'spell_azhiccar_toxic_regurgitation_cast', 'spell_azhiccar_toxic_regurgitation_selector', 'spell_azhiccar_devour_intro_selector', 'spell_azhiccar_invading_shriek');
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(1217202, 'spell_azhiccar_energy_controller'),
|
||||
(1217436, 'spell_azhiccar_toxic_regurgitation_selector'),
|
||||
(1227745, 'spell_azhiccar_toxic_regurgitation_cast'),
|
||||
(1233116, 'spell_azhiccar_devour_intro_selector'),
|
||||
(1217330, 'spell_azhiccar_invading_shriek_dummy'),
|
||||
(1217758, 'spell_azhiccar_player_detection'),
|
||||
(1217232, 'spell_azhiccar_devour'),
|
||||
(1217255, 'spell_azhiccar_devour_selector'),
|
||||
(1217241, 'spell_azhiccar_feast'),
|
||||
(1217252, 'spell_azhiccar_feast'),
|
||||
(1217327, 'spell_azhiccar_invading_shriek');
|
||||
|
||||
DELETE FROM `serverside_spell` WHERE `Id`=1217758 AND `DifficultyID`=0;
|
||||
INSERT INTO `serverside_spell` (`Id`, `DifficultyID`, `CategoryId`, `Dispel`, `Mechanic`, `Attributes`, `AttributesEx`, `AttributesEx2`, `AttributesEx3`, `AttributesEx4`, `AttributesEx5`, `AttributesEx6`, `AttributesEx7`, `AttributesEx8`, `AttributesEx9`, `AttributesEx10`, `AttributesEx11`, `AttributesEx12`, `AttributesEx13`, `AttributesEx14`, `AttributesEx15`, `Stances`, `StancesNot`, `Targets`, `TargetCreatureType`, `RequiresSpellFocus`, `FacingCasterFlags`, `CasterAuraState`, `TargetAuraState`, `ExcludeCasterAuraState`, `ExcludeTargetAuraState`, `CasterAuraSpell`, `TargetAuraSpell`, `ExcludeCasterAuraSpell`, `ExcludeTargetAuraSpell`, `CasterAuraType`, `TargetAuraType`, `ExcludeCasterAuraType`, `ExcludeTargetAuraType`, `CastingTimeIndex`, `RecoveryTime`, `CategoryRecoveryTime`, `StartRecoveryCategory`, `StartRecoveryTime`, `InterruptFlags`, `AuraInterruptFlags1`, `AuraInterruptFlags2`, `ChannelInterruptFlags1`, `ChannelInterruptFlags2`, `ProcFlags`, `ProcFlags2`, `ProcChance`, `ProcCharges`, `ProcCooldown`, `ProcBasePPM`, `MaxLevel`, `BaseLevel`, `SpellLevel`, `DurationIndex`, `RangeIndex`, `Speed`, `LaunchDelay`, `StackAmount`, `EquippedItemClass`, `EquippedItemSubClassMask`, `EquippedItemInventoryTypeMask`, `ContentTuningId`, `SpellName`, `ConeAngle`, `ConeWidth`, `MaxTargetLevel`, `MaxAffectedTargets`, `SpellFamilyName`, `SpellFamilyFlags1`, `SpellFamilyFlags2`, `SpellFamilyFlags3`, `SpellFamilyFlags4`, `DmgClass`, `PreventionType`, `AreaGroupId`, `SchoolMask`, `ChargeCategoryId`) VALUES
|
||||
(1217758, 0, 0, 0, 0, 0x20000180, 0x00000400, 0x10400004, 0x00070300, 0x00800000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0, 'Player Detection', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0);
|
||||
|
||||
DELETE FROM `serverside_spell_effect` WHERE `SpellID`=1217758 AND `EffectIndex`=0 AND `DifficultyID`=0;
|
||||
INSERT INTO `serverside_spell_effect` (`SpellID`, `EffectIndex`, `DifficultyID`, `Effect`, `EffectAura`, `EffectAmplitude`, `EffectAttributes`, `EffectAuraPeriod`, `EffectBonusCoefficient`, `EffectChainAmplitude`, `EffectChainTargets`, `EffectItemType`, `EffectMechanic`, `EffectPointsPerResource`, `EffectPosFacing`, `EffectRealPointsPerLevel`, `EffectTriggerSpell`, `BonusCoefficientFromAP`, `PvpMultiplier`, `Coefficient`, `Variance`, `ResourceCoefficient`, `GroupSizeBasePointsCoefficient`, `EffectBasePoints`, `EffectMiscValue1`, `EffectMiscValue2`, `EffectRadiusIndex1`, `EffectRadiusIndex2`, `EffectSpellClassMask1`, `EffectSpellClassMask2`, `EffectSpellClassMask3`, `EffectSpellClassMask4`, `ImplicitTarget1`, `ImplicitTarget2`) VALUES
|
||||
(1217758, 0, 0, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 0, 0, 0, 0, 22, 15);
|
||||
770
src/server/scripts/Karesh/EcoDomeAldani/boss_azhiccar.cpp
Normal file
770
src/server/scripts/Karesh/EcoDomeAldani/boss_azhiccar.cpp
Normal file
@@ -0,0 +1,770 @@
|
||||
/*
|
||||
* 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 "AreaTriggerAI.h"
|
||||
#include "CellImpl.h"
|
||||
#include "Containers.h"
|
||||
#include "GameObject.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellScript.h"
|
||||
#include "ecodome_aldani.h"
|
||||
|
||||
enum AzhiccarSpells
|
||||
{
|
||||
// Intro
|
||||
SPELL_DEVOUR_INTRO = 1233112,
|
||||
SPELL_DEVOUR_INTRO_SELECTOR = 1233116,
|
||||
SPELL_DEVOUR_INSTAKILL = 1233147,
|
||||
SPELL_KNOCKBACK = 1222792,
|
||||
|
||||
// Combat
|
||||
SPELL_DEVOUR = 1217232,
|
||||
SPELL_DEVOUR_AREATRIGGER = 1217240,
|
||||
SPELL_DEVOUR_SELECTOR = 1217255,
|
||||
SPELL_DEVOURER_VORTEX = 1227068,
|
||||
SPELL_DIGESTIVE_SPITTLE = 1217446,
|
||||
SPELL_DIGESTIVE_SPITTLE_NPC_SLOW = 1217526,
|
||||
SPELL_ENERGY_CONTROLLER = 1217202,
|
||||
SPELL_FEAST = 1217241,
|
||||
SPELL_FEAST_HEAL = 1217247,
|
||||
SPELL_FEAST_INSTAKILL = 1217252,
|
||||
SPELL_INVADING_SHRIEK_DAMAGE = 1231850,
|
||||
SPELL_INVADING_SHRIEK_DUMMY = 1217330,
|
||||
SPELL_INVADING_SHRIEK_PERIODIC = 1217327,
|
||||
SPELL_INVADING_SHRIEK_SUMMON = 1217331,
|
||||
SPELL_PLAYER_DETECTION = 1217757,
|
||||
SPELL_THRASH = 1217664,
|
||||
SPELL_TOXIC_REGURGITATION_CAST = 1227745,
|
||||
SPELL_TOXIC_REGURGITATION_MARKER = 1227748,
|
||||
SPELL_TOXIC_REGURGITATION_MISSILE = 1217438,
|
||||
SPELL_TOXIC_REGURGITATION_SELECTOR = 1217436,
|
||||
|
||||
// Mites
|
||||
SPELL_UNCONTROLLED = 1231811,
|
||||
SPELL_STUNNED = 1235707,
|
||||
};
|
||||
|
||||
enum AzhiccarEvents
|
||||
{
|
||||
EVENT_INVADING_SHRIEK = 1,
|
||||
EVENT_TOXIC_REGURGITATION,
|
||||
EVENT_CHECK_ENERGY
|
||||
};
|
||||
|
||||
enum AzhiccarActions
|
||||
{
|
||||
ACTION_START_INTRO = 1
|
||||
};
|
||||
|
||||
enum AzhiccarTexts
|
||||
{
|
||||
SAY_DEVOUR = 0
|
||||
};
|
||||
|
||||
enum AzhiccarMisc
|
||||
{
|
||||
ANIMKIT_NONE = 0,
|
||||
ANIMKIT_EMERGE = 21290,
|
||||
ANIMKIT_MITE_DEVOUR_BIRTH = 11428,
|
||||
|
||||
SPELL_VISUALKIT_ALARM = 222521,
|
||||
|
||||
POINT_AZHICCAR = 0,
|
||||
|
||||
SPELL_VISUAL_DEVOURED = 155836,
|
||||
|
||||
NPC_PORTAL_STALKER = 237454,
|
||||
NPC_FRENZIED_MITE = 236190,
|
||||
};
|
||||
|
||||
static constexpr Position AzhiccarPosition = { 436.8889f, -746.0f, 1002.0926f };
|
||||
static constexpr Position OrphanSpellVisualPosition = { 436.8889f, -746.0f, 1018.0926f };
|
||||
|
||||
// 234893 - Azhiccar
|
||||
struct boss_azhiccar : public BossAI
|
||||
{
|
||||
boss_azhiccar(Creature* creature) : BossAI(creature, DATA_AZHICCAR), _invadingShriekCount(1), _toxicRegurgitationCount(1) { }
|
||||
|
||||
void JustAppeared() override
|
||||
{
|
||||
if (instance->GetData(DATA_AZHICCAR_INTRO) == DONE)
|
||||
{
|
||||
me->SetUninteractible(false);
|
||||
me->SetImmuneToAll(false);
|
||||
me->SetAIAnimKitId(ANIMKIT_NONE);
|
||||
me->PlayOneShotAnimKitId(ANIMKIT_EMERGE);
|
||||
}
|
||||
|
||||
me->SetPowerType(POWER_ENERGY);
|
||||
me->SetPower(POWER_ENERGY, 0);
|
||||
|
||||
DoCastSelf(SPELL_DEVOURER_VORTEX);
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
BossAI::Reset();
|
||||
|
||||
_invadingShriekCount = 1;
|
||||
_toxicRegurgitationCount = 1;
|
||||
|
||||
_lastPortalPositions.clear();
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* who) override
|
||||
{
|
||||
BossAI::JustEngagedWith(who);
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me, 1);
|
||||
|
||||
DoCastSelf(SPELL_PLAYER_DETECTION);
|
||||
DoCastSelf(SPELL_ENERGY_CONTROLLER);
|
||||
|
||||
events.ScheduleEvent(EVENT_TOXIC_REGURGITATION, 15400ms);
|
||||
events.ScheduleEvent(EVENT_INVADING_SHRIEK, 5200ms);
|
||||
|
||||
if (IsHeroicOrHigher())
|
||||
events.ScheduleEvent(EVENT_CHECK_ENERGY, 500ms);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
_JustDied();
|
||||
|
||||
summons.DespawnAll();
|
||||
me->RemoveAllAreaTriggers();
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
|
||||
}
|
||||
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
|
||||
|
||||
summons.DespawnAll();
|
||||
me->RemoveAllAreaTriggers();
|
||||
_EnterEvadeMode();
|
||||
_DespawnAtEvade();
|
||||
}
|
||||
|
||||
void OnSpellStart(SpellInfo const* spellInfo) override
|
||||
{
|
||||
switch (spellInfo->Id)
|
||||
{
|
||||
case SPELL_DEVOUR:
|
||||
{
|
||||
Talk(SAY_DEVOUR);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void DoAction(int32 actionId) override
|
||||
{
|
||||
switch (actionId)
|
||||
{
|
||||
case ACTION_START_INTRO:
|
||||
{
|
||||
me->SetAIAnimKitId(ANIMKIT_NONE);
|
||||
me->PlayOneShotAnimKitId(ANIMKIT_EMERGE);
|
||||
|
||||
scheduler.Schedule(2s + 170ms, [this](TaskContext context)
|
||||
{
|
||||
DoCastSelf(SPELL_KNOCKBACK);
|
||||
DoCastSelf(SPELL_DEVOUR_INTRO);
|
||||
|
||||
context.Schedule(7s, [this](TaskContext)
|
||||
{
|
||||
me->SetUninteractible(false);
|
||||
me->SetImmuneToAll(false);
|
||||
instance->SetData(DATA_AZHICCAR_INTRO, DONE);
|
||||
});
|
||||
});
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
scheduler.Update(diff);
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_INVADING_SHRIEK:
|
||||
{
|
||||
std::vector<float> portalAngles =
|
||||
{
|
||||
float(M_PI / 4.0f),
|
||||
-float(M_PI / 4.0f),
|
||||
-(3.0f * float(M_PI / 4.0f)),
|
||||
(3.0f * float(M_PI / 4.0f))
|
||||
};
|
||||
|
||||
Trinity::Containers::RandomResize(portalAngles, 3);
|
||||
|
||||
static constexpr float PORTAL_STALKER_DIST = 30.0f;
|
||||
|
||||
_lastPortalPositions.clear();
|
||||
for (float angle : portalAngles)
|
||||
{
|
||||
angle += me->GetOrientation();
|
||||
Position pos = me->GetPosition();
|
||||
me->MovePosition(pos, PORTAL_STALKER_DIST, angle);
|
||||
me->SummonCreature(NPC_PORTAL_STALKER, pos, TEMPSUMMON_TIMED_DESPAWN, 4100ms);
|
||||
|
||||
_lastPortalPositions.push_back(pos);
|
||||
}
|
||||
|
||||
DoCastSelf(SPELL_INVADING_SHRIEK_PERIODIC);
|
||||
|
||||
_invadingShriekCount++;
|
||||
if (_invadingShriekCount % 2 == 0)
|
||||
events.Repeat(37200ms);
|
||||
else
|
||||
events.Repeat(48500ms);
|
||||
break;
|
||||
}
|
||||
case EVENT_TOXIC_REGURGITATION:
|
||||
{
|
||||
DoCastSelf(SPELL_TOXIC_REGURGITATION_SELECTOR);
|
||||
_toxicRegurgitationCount++;
|
||||
if (_toxicRegurgitationCount % 2 == 0)
|
||||
events.Repeat(18200ms);
|
||||
else
|
||||
events.Repeat(67500ms);
|
||||
break;
|
||||
}
|
||||
case EVENT_CHECK_ENERGY:
|
||||
{
|
||||
if (me->GetPower(POWER_ENERGY) >= 100)
|
||||
{
|
||||
DoCastSelf(SPELL_DEVOUR);
|
||||
|
||||
if (IsMythic())
|
||||
{
|
||||
for (Position const& lastPos : _lastPortalPositions)
|
||||
{
|
||||
me->SummonCreature(NPC_PORTAL_STALKER, lastPos, TEMPSUMMON_TIMED_DESPAWN, 2s);
|
||||
for (uint8 i = 0; i < 3; i++)
|
||||
{
|
||||
Position pos(lastPos);
|
||||
me->MovePosition(pos, 3.0f, frand(0, 2 * float(M_PI)));
|
||||
|
||||
me->m_Events.AddEventAtOffset([caster = me, pos]()
|
||||
{
|
||||
caster->CastSpell(pos, SPELL_INVADING_SHRIEK_SUMMON, CastSpellExtraArgsInit{
|
||||
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR
|
||||
});
|
||||
}, 2100ms);
|
||||
}
|
||||
}
|
||||
}
|
||||
events.Repeat(25s);
|
||||
}
|
||||
else
|
||||
events.Repeat(500ms);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _invadingShriekCount;
|
||||
uint32 _toxicRegurgitationCount;
|
||||
std::vector<Position> _lastPortalPositions;
|
||||
};
|
||||
|
||||
// 236190 - Frenzied Mite
|
||||
struct npc_azhiccar_frenzied_mite : public ScriptedAI
|
||||
{
|
||||
npc_azhiccar_frenzied_mite(Creature* creature) : ScriptedAI(creature) {}
|
||||
|
||||
void JustAppeared() override
|
||||
{
|
||||
Creature* azhiccar = me->GetInstanceScript()->GetCreature(DATA_AZHICCAR);
|
||||
if (!azhiccar)
|
||||
return;
|
||||
|
||||
if (azhiccar->GetPower(POWER_ENERGY) >= 100)
|
||||
{
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
DoCastSelf(SPELL_STUNNED);
|
||||
me->PlayOneShotAnimKitId(ANIMKIT_MITE_DEVOUR_BIRTH);
|
||||
}
|
||||
else
|
||||
DoCastSelf(SPELL_UNCONTROLLED);
|
||||
}
|
||||
};
|
||||
|
||||
// 1217202 - Energy Controller
|
||||
class spell_azhiccar_energy_controller : public AuraScript
|
||||
{
|
||||
static constexpr std::array<uint8, 3> AzhiccarEnergizeCycle = { 1, 2, 2 };
|
||||
|
||||
void PeriodicTick(AuraEffect const* aurEff) const
|
||||
{
|
||||
if (GetTarget()->HasAura(SPELL_DEVOUR))
|
||||
return;
|
||||
|
||||
uint8 cycleIdx = aurEff->GetTickNumber() % AzhiccarEnergizeCycle.size();
|
||||
GetTarget()->ModifyPower(POWER_ENERGY, AzhiccarEnergizeCycle[cycleIdx]);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_azhiccar_energy_controller::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
// 1217436 - Toxic Regurgitation
|
||||
class spell_azhiccar_toxic_regurgitation_selector : public SpellScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_TOXIC_REGURGITATION_MARKER, SPELL_TOXIC_REGURGITATION_CAST });
|
||||
}
|
||||
|
||||
void HandleHitTarget(SpellEffIndex /*effIndex*/) const
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
|
||||
CastSpellExtraArgs args;
|
||||
args.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR;
|
||||
args.TriggeringSpell = GetSpell();
|
||||
|
||||
caster->CastSpell(caster, SPELL_TOXIC_REGURGITATION_CAST, args);
|
||||
caster->CastSpell(GetHitUnit(), SPELL_TOXIC_REGURGITATION_MARKER, args);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_azhiccar_toxic_regurgitation_selector::HandleHitTarget, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
// 1227745 - Toxic Regurgitation
|
||||
class spell_azhiccar_toxic_regurgitation_cast : public SpellScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_TOXIC_REGURGITATION_MARKER, SPELL_TOXIC_REGURGITATION_MISSILE });
|
||||
}
|
||||
|
||||
void HandleOnHit() const
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
|
||||
std::list<Player*> players;
|
||||
Trinity::UnitAuraCheck check(true, SPELL_TOXIC_REGURGITATION_MARKER);
|
||||
Trinity::PlayerListSearcher<Trinity::UnitAuraCheck> searcher(caster, players, check);
|
||||
Cell::VisitWorldObjects(caster, searcher, 200.0f);
|
||||
|
||||
for (Player* player : players)
|
||||
{
|
||||
caster->CastSpell(player, SPELL_TOXIC_REGURGITATION_MISSILE, CastSpellExtraArgsInit{
|
||||
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
|
||||
.TriggeringSpell = GetSpell()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnHit += SpellHitFn(spell_azhiccar_toxic_regurgitation_cast::HandleOnHit);
|
||||
}
|
||||
};
|
||||
|
||||
// 1217327 - Invading Shriek
|
||||
class spell_azhiccar_invading_shriek : public SpellScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo ({ SPELL_INVADING_SHRIEK_DAMAGE });
|
||||
}
|
||||
|
||||
void HandleAfterCast() const
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
caster->CastSpell(caster, SPELL_INVADING_SHRIEK_DAMAGE, CastSpellExtraArgsInit{
|
||||
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
|
||||
.TriggeringSpell = GetSpell()
|
||||
});
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterCast += SpellCastFn(spell_azhiccar_invading_shriek::HandleAfterCast);
|
||||
}
|
||||
};
|
||||
|
||||
// 1217327 - Invading Shriek
|
||||
class spell_azhiccar_invading_shriek_aura : public AuraScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo ({ SPELL_INVADING_SHRIEK_DAMAGE });
|
||||
}
|
||||
|
||||
void OnApply(AuraEffect const* /*auraEffect*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
std::vector<Creature*> stalkers;
|
||||
GetCaster()->GetCreatureListWithEntryInGrid(stalkers, NPC_PORTAL_STALKER, 150.0f);
|
||||
Trinity::Containers::RandomShuffle(stalkers);
|
||||
|
||||
for (Creature* creature : stalkers)
|
||||
_stalkerList.push(creature->GetGUID());
|
||||
}
|
||||
|
||||
void OnPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
if (aurEff->GetTickNumber() <= 1)
|
||||
return;
|
||||
|
||||
Unit* caster = GetCaster();
|
||||
ObjectGuid guid = _stalkerList.front();
|
||||
_stalkerList.pop();
|
||||
|
||||
if (Creature* stalker = ObjectAccessor::GetCreature(*caster, guid))
|
||||
{
|
||||
caster->CastSpell(stalker->GetPosition(), SPELL_INVADING_SHRIEK_DUMMY, CastSpellExtraArgsInit{
|
||||
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
|
||||
.TriggeringAura = aurEff
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_azhiccar_invading_shriek_aura::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_azhiccar_invading_shriek_aura::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
|
||||
private:
|
||||
std::queue<ObjectGuid> _stalkerList;
|
||||
};
|
||||
|
||||
// 1217330 - Invading Shriek
|
||||
class spell_azhiccar_invading_shriek_dummy : public SpellScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_INVADING_SHRIEK_SUMMON });
|
||||
}
|
||||
|
||||
void HandleHit(SpellEffIndex /*effIndex*/) const
|
||||
{
|
||||
GetCaster()->CastSpell(GetHitDest()->GetPosition(), SPELL_INVADING_SHRIEK_SUMMON, CastSpellExtraArgsInit{
|
||||
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
|
||||
.TriggeringSpell = GetSpell()
|
||||
});
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHit += SpellEffectFn(spell_azhiccar_invading_shriek_dummy::HandleHit, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
// 1217758 - Player Detection (SERVERSIDE)
|
||||
class spell_azhiccar_player_detection : public SpellScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_DEVOUR, SPELL_THRASH });
|
||||
}
|
||||
|
||||
void HandlePlayerDetection() const
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
int64 const targetsHit = GetUnitTargetCountForEffect(EFFECT_0);
|
||||
if (targetsHit > 0)
|
||||
return;
|
||||
|
||||
Spell* currentChanneledSpell = caster->GetCurrentSpell(CURRENT_CHANNELED_SPELL);
|
||||
if (currentChanneledSpell && (currentChanneledSpell->GetSpellInfo()->Id == SPELL_DEVOUR))
|
||||
return;
|
||||
|
||||
if (caster->HasAura(SPELL_DEVOUR))
|
||||
return;
|
||||
|
||||
caster->CastSpell(caster, SPELL_THRASH, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterCast += SpellCastFn(spell_azhiccar_player_detection::HandlePlayerDetection);
|
||||
}
|
||||
};
|
||||
|
||||
// 1217232 - Devour
|
||||
class spell_azhiccar_devour : public AuraScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_DEVOUR_AREATRIGGER, SPELL_DEVOUR_SELECTOR });
|
||||
}
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
caster->CastSpell(caster, SPELL_DEVOUR_AREATRIGGER, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR);
|
||||
caster->CastSpell(caster, SPELL_DEVOUR_SELECTOR, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectApply += AuraEffectRemoveFn(spell_azhiccar_devour::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
// 1217255 - Devour
|
||||
class spell_azhiccar_devour_selector : public SpellScript
|
||||
{
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if([](WorldObject* target) {
|
||||
return !target->IsPlayer() && target->GetEntry() != NPC_FRENZIED_MITE;
|
||||
});
|
||||
}
|
||||
|
||||
void HandleHitTarget(SpellEffIndex /*effIndex*/) const
|
||||
{
|
||||
Unit* target = GetHitUnit();
|
||||
std::function<void(Movement::MoveSplineInit&)> initializer = [](Movement::MoveSplineInit& init)
|
||||
{
|
||||
init.SetBackward();
|
||||
init.MoveTo(AzhiccarPosition.GetPositionX(), AzhiccarPosition.GetPositionY(), AzhiccarPosition.GetPositionZ(), false);
|
||||
};
|
||||
target->SendPlaySpellVisualKit(SPELL_VISUALKIT_ALARM, 4, 9000);
|
||||
target->GetMotionMaster()->LaunchMoveSpline(std::move(initializer), POINT_AZHICCAR, MOTION_PRIORITY_NORMAL, POINT_MOTION_TYPE);
|
||||
target->SetSpeed(MOVE_RUN_BACK, 12.0f);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_azhiccar_devour_selector::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENTRY);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_azhiccar_devour_selector::HandleHitTarget, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
// 1217241 - Feast
|
||||
// 1217252 - Feast
|
||||
class spell_azhiccar_feast : public SpellScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_FEAST_HEAL });
|
||||
}
|
||||
|
||||
void HandleHit(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
caster->CastSpell(caster, SPELL_FEAST_HEAL, CastSpellExtraArgsInit{
|
||||
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
|
||||
.TriggeringSpell = GetSpell()
|
||||
});
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_azhiccar_feast::HandleHit, EFFECT_0, SPELL_EFFECT_ANY);
|
||||
}
|
||||
};
|
||||
|
||||
// 1217441 - Digestive Spittle
|
||||
// Id - 36181
|
||||
struct at_azhiccar_digestive_spittle : AreaTriggerAI
|
||||
{
|
||||
using AreaTriggerAI::AreaTriggerAI;
|
||||
|
||||
void OnUnitEnter(Unit* unit) override
|
||||
{
|
||||
Unit* caster = at->GetCaster();
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
caster->CastSpell(unit, (unit->IsPlayer() ? SPELL_DIGESTIVE_SPITTLE : SPELL_DIGESTIVE_SPITTLE_NPC_SLOW), TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR);
|
||||
}
|
||||
|
||||
void OnUnitExit(Unit* unit, AreaTriggerExitReason /*reason*/) override
|
||||
{
|
||||
unit->RemoveAurasDueToSpell(SPELL_DIGESTIVE_SPITTLE);
|
||||
unit->RemoveAurasDueToSpell(SPELL_DIGESTIVE_SPITTLE_NPC_SLOW);
|
||||
}
|
||||
};
|
||||
|
||||
// 1217240 - Devour
|
||||
// Id - 38188
|
||||
struct at_azhiccar_devour_force : AreaTriggerAI
|
||||
{
|
||||
using AreaTriggerAI::AreaTriggerAI;
|
||||
|
||||
void OnUnitEnter(Unit* unit) override
|
||||
{
|
||||
if (!unit->IsPlayer() || unit->GetEntry() == NPC_PORTAL_STALKER)
|
||||
return;
|
||||
|
||||
unit->ApplyMovementForce(at->GetGUID(), at->GetPosition(), 3.0f, MovementForceType::Gravity);
|
||||
}
|
||||
|
||||
void OnUnitExit(Unit* unit, AreaTriggerExitReason /*reason*/) override
|
||||
{
|
||||
unit->RemoveMovementForce(at->GetGUID());
|
||||
}
|
||||
};
|
||||
|
||||
// 1217240 - Devour
|
||||
// Id - 38189
|
||||
struct at_azhiccar_devour : AreaTriggerAI
|
||||
{
|
||||
using AreaTriggerAI::AreaTriggerAI;
|
||||
|
||||
void OnUnitEnter(Unit* unit) override
|
||||
{
|
||||
Unit* caster = at->GetCaster();
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
if (unit->IsPlayer())
|
||||
caster->CastSpell(unit, SPELL_FEAST, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR);
|
||||
else if (unit->HasAura(SPELL_DEVOUR_SELECTOR))
|
||||
caster->CastSpell(unit, SPELL_FEAST_INSTAKILL, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR);
|
||||
}
|
||||
};
|
||||
|
||||
// Id - 176
|
||||
struct at_azhiccar_intro : AreaTriggerAI
|
||||
{
|
||||
at_azhiccar_intro(AreaTrigger* areatrigger) : AreaTriggerAI(areatrigger) { }
|
||||
|
||||
void OnUnitEnter(Unit* unit) override
|
||||
{
|
||||
InstanceScript* instance = at->GetInstanceScript();
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
Player* player = unit->ToPlayer();
|
||||
if (!player || player->IsGameMaster())
|
||||
return;
|
||||
|
||||
if (Creature* azhiccar = instance->GetCreature(DATA_AZHICCAR))
|
||||
azhiccar->AI()->DoAction(ACTION_START_INTRO);
|
||||
|
||||
at->Remove();
|
||||
}
|
||||
};
|
||||
|
||||
// 245411 - Ravaging Scavenger
|
||||
// 245412 - Voracious Gorger
|
||||
struct npc_azhiccar_intro_creature : public ScriptedAI
|
||||
{
|
||||
npc_azhiccar_intro_creature(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void SpellHit(WorldObject* /*caster*/, SpellInfo const* spellInfo) override
|
||||
{
|
||||
if (spellInfo->Id == SPELL_DEVOUR_INTRO_SELECTOR)
|
||||
{
|
||||
_scheduler.Schedule(2000ms, 4500ms, [this](TaskContext)
|
||||
{
|
||||
me->SendPlayOrphanSpellVisual(OrphanSpellVisualPosition, me->GetPosition(), SPELL_VISUAL_DEVOURED, 45.0f, false);
|
||||
DoCastSelf(SPELL_DEVOUR_INSTAKILL);
|
||||
me->DespawnOrUnsummon(5s);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
|
||||
private:
|
||||
TaskScheduler _scheduler;
|
||||
};
|
||||
|
||||
// 1233116 - Devour
|
||||
class spell_azhiccar_devour_intro_selector : public SpellScript
|
||||
{
|
||||
void HandleHitTarget(SpellEffIndex /*effIndex*/) const
|
||||
{
|
||||
Unit* target = GetHitUnit();
|
||||
std::function<void(Movement::MoveSplineInit&)> initializer = [](Movement::MoveSplineInit& init)
|
||||
{
|
||||
init.SetBackward();
|
||||
init.MoveTo(AzhiccarPosition.GetPositionX(), AzhiccarPosition.GetPositionY(), AzhiccarPosition.GetPositionZ(), false);
|
||||
};
|
||||
target->SendPlaySpellVisualKit(SPELL_VISUALKIT_ALARM, 4, 9000);
|
||||
target->GetMotionMaster()->LaunchMoveSpline(std::move(initializer), POINT_AZHICCAR, MOTION_PRIORITY_NORMAL, POINT_MOTION_TYPE);
|
||||
target->SetSpeed(MOVE_RUN_BACK, 16.0f);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_azhiccar_devour_intro_selector::HandleHitTarget, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_azhiccar()
|
||||
{
|
||||
RegisterEcodomeAldaniCreatureAI(boss_azhiccar);
|
||||
|
||||
RegisterEcodomeAldaniCreatureAI(npc_azhiccar_frenzied_mite);
|
||||
RegisterSpellScript(spell_azhiccar_energy_controller);
|
||||
RegisterSpellScript(spell_azhiccar_toxic_regurgitation_selector);
|
||||
RegisterSpellScript(spell_azhiccar_toxic_regurgitation_cast);
|
||||
RegisterSpellAndAuraScriptPair(spell_azhiccar_invading_shriek, spell_azhiccar_invading_shriek_aura);
|
||||
RegisterSpellScript(spell_azhiccar_invading_shriek_dummy);
|
||||
RegisterSpellScript(spell_azhiccar_player_detection);
|
||||
RegisterSpellScript(spell_azhiccar_devour);
|
||||
RegisterSpellScript(spell_azhiccar_devour_selector);
|
||||
RegisterSpellScript(spell_azhiccar_feast);
|
||||
RegisterAreaTriggerAI(at_azhiccar_digestive_spittle);
|
||||
RegisterAreaTriggerAI(at_azhiccar_devour_force);
|
||||
RegisterAreaTriggerAI(at_azhiccar_devour);
|
||||
|
||||
// Intro
|
||||
RegisterAreaTriggerAI(at_azhiccar_intro);
|
||||
RegisterEcodomeAldaniCreatureAI(npc_azhiccar_intro_creature);
|
||||
RegisterSpellScript(spell_azhiccar_devour_intro_selector);
|
||||
}
|
||||
58
src/server/scripts/Karesh/EcoDomeAldani/ecodome_aldani.h
Normal file
58
src/server/scripts/Karesh/EcoDomeAldani/ecodome_aldani.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#ifndef DEF_ECODOME_ALDANI_H_
|
||||
#define DEF_ECODOME_ALDANI_H_
|
||||
|
||||
#include "CreatureAIImpl.h"
|
||||
|
||||
#define EAScriptName "instance_ecodome_aldani"
|
||||
#define DataHeader "EcodomeAldani"
|
||||
|
||||
uint32 const EncounterCount = 3;
|
||||
|
||||
enum EcodomeAldaniDataTypes
|
||||
{
|
||||
// Encounters
|
||||
DATA_AZHICCAR = 0,
|
||||
DATA_TAAHBAT_AND_AWAZJ = 1,
|
||||
DATA_SOUL_SCRIBE = 2,
|
||||
|
||||
DATA_TAAHBAT,
|
||||
DATA_AWAZJ,
|
||||
|
||||
DATA_AZHICCAR_INTRO
|
||||
};
|
||||
|
||||
enum EcodomeAldaniCreatureIds
|
||||
{
|
||||
// Bosses
|
||||
BOSS_AZHICCAR = 234893,
|
||||
BOSS_TAAHBAT = 234933,
|
||||
BOSS_AWAZJ = 241375,
|
||||
BOSS_SOUL_SCRIBE = 247283
|
||||
};
|
||||
|
||||
template <class AI, class T>
|
||||
inline AI* GetEcodomeAldaniAI(T* obj)
|
||||
{
|
||||
return GetInstanceAI<AI>(obj, EAScriptName);
|
||||
}
|
||||
|
||||
#define RegisterEcodomeAldaniCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetEcodomeAldaniAI)
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* 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 "Creature.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ecodome_aldani.h"
|
||||
|
||||
static constexpr ObjectData creatureData[] =
|
||||
{
|
||||
{ BOSS_AZHICCAR, DATA_AZHICCAR },
|
||||
{ BOSS_TAAHBAT, DATA_TAAHBAT },
|
||||
{ BOSS_AWAZJ, DATA_AWAZJ },
|
||||
{ BOSS_SOUL_SCRIBE, DATA_SOUL_SCRIBE },
|
||||
{ 0, 0 } // END
|
||||
};
|
||||
|
||||
static constexpr DungeonEncounterData encounters[] =
|
||||
{
|
||||
{ DATA_AZHICCAR, {{ 3107 }} },
|
||||
{ DATA_TAAHBAT_AND_AWAZJ, {{ 3108 }} },
|
||||
{ DATA_SOUL_SCRIBE, {{ 3109 }} }
|
||||
};
|
||||
|
||||
class instance_ecodome_aldani : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_ecodome_aldani() : InstanceMapScript(EAScriptName, 2830) { }
|
||||
|
||||
struct instance_ecodome_aldani_InstanceMapScript: public InstanceScript
|
||||
{
|
||||
instance_ecodome_aldani_InstanceMapScript(InstanceMap* map) : InstanceScript(map)
|
||||
{
|
||||
SetHeaders(DataHeader);
|
||||
SetBossNumber(EncounterCount);
|
||||
LoadObjectData(creatureData, {});
|
||||
LoadDungeonEncounterData(encounters);
|
||||
|
||||
_azhiccarIntroState = NOT_STARTED;
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 dataId) const override
|
||||
{
|
||||
switch (dataId)
|
||||
{
|
||||
case DATA_AZHICCAR_INTRO:
|
||||
return _azhiccarIntroState;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SetData(uint32 dataId, uint32 value) override
|
||||
{
|
||||
switch (dataId)
|
||||
{
|
||||
case DATA_AZHICCAR_INTRO:
|
||||
_azhiccarIntroState = value;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint8 _azhiccarIntroState;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const override
|
||||
{
|
||||
return new instance_ecodome_aldani_InstanceMapScript(map);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_ecodome_aldani()
|
||||
{
|
||||
new instance_ecodome_aldani();
|
||||
}
|
||||
31
src/server/scripts/Karesh/karesh_script_loader.cpp
Normal file
31
src/server/scripts/Karesh/karesh_script_loader.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
// This is where scripts' loading functions should be declared:
|
||||
|
||||
// Eco-Dome Aldani
|
||||
void AddSC_boss_azhiccar();
|
||||
void AddSC_instance_ecodome_aldani();
|
||||
|
||||
// The name of this function should match:
|
||||
// void Add${NameOfDirectory}Scripts()
|
||||
void AddKareshScripts()
|
||||
{
|
||||
// Eco-Dome Aldani
|
||||
AddSC_boss_azhiccar();
|
||||
AddSC_instance_ecodome_aldani();
|
||||
}
|
||||
Reference in New Issue
Block a user