diff options
author | Aqua Deus <95978183+aquadeus@users.noreply.github.com> | 2024-05-21 02:45:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-21 02:45:53 +0200 |
commit | f96aa9a9406319f223fa90f7e24c4a0ef38a5c4c (patch) | |
tree | c1aa6778d7013eedffac2a38b59b98eaf3463067 | |
parent | 3e5850d7bd2398a126636c6ddd7b863e2c0e0127 (diff) |
Scripts/RagefireChasm: Implement Slagmaw encounter (#29989)
4 files changed, 193 insertions, 7 deletions
diff --git a/sql/updates/world/master/2024_05_21_02_world.sql b/sql/updates/world/master/2024_05_21_02_world.sql new file mode 100644 index 00000000000..dba941802f1 --- /dev/null +++ b/sql/updates/world/master/2024_05_21_02_world.sql @@ -0,0 +1,26 @@ +-- Creature +UPDATE `creature_template` SET `ScriptName`='boss_slagmaw' WHERE `entry`=61463; + +-- Serverside spells +DELETE FROM `serverside_spell` WHERE `Id` IN (119424, 119425, 119426, 119428) 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`, `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 +(119424, 0, 0, 0, 0, 0x100, 0x40000, 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, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0, 'Magnaw Teleport North', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0), +(119425, 0, 0, 0, 0, 0x100, 0x40000, 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, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0, 'Magnaw Teleport East', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0), +(119426, 0, 0, 0, 0, 0x100, 0x40000, 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, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0, 'Magnaw Teleport South', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0), +(119428, 0, 0, 0, 0, 0x100, 0x40000, 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, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0, 'Magnaw Teleport West', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0); + +DELETE FROM `serverside_spell_effect` WHERE `SpellID` IN (119424, 119425, 119426, 119428) 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 +(119424, 0, 0, 252, 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, 17), +(119425, 0, 0, 252, 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, 17), +(119426, 0, 0, 252, 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, 17), +(119428, 0, 0, 252, 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, 17); + +DELETE FROM `spell_target_position` WHERE `ID` IN (119424, 119425, 119426, 119428) AND `EffectIndex`=0; +INSERT INTO `spell_target_position` (`ID`, `EffectIndex`, `MapID`, `PositionX`, `PositionY`, `PositionZ`, `Orientation`, `VerifiedBuild`) VALUES +(119424, 0, 389, -222.94, 165.703, -19.721, 3.797819, 54630), +(119425, 0, 389, -226.477, 135.704, -19.721, 2.330294, 54630), +(119426, 0, 389, -263.212, 136.244, -19.721, 0.7556769, 54630), +(119428, 0, 389, -256.389, 172.884, -19.721, 5.577933, 54630); + +UPDATE `creature_template_difficulty` SET `StaticFlags4`=`StaticFlags4`|0x00000200 WHERE `Entry`=61463; diff --git a/src/server/scripts/Kalimdor/RagefireChasm/boss_slagmaw.cpp b/src/server/scripts/Kalimdor/RagefireChasm/boss_slagmaw.cpp new file mode 100644 index 00000000000..e3757130cc0 --- /dev/null +++ b/src/server/scripts/Kalimdor/RagefireChasm/boss_slagmaw.cpp @@ -0,0 +1,165 @@ +/* + * 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 "Containers.h" +#include "InstanceScript.h" +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ragefire_chasm.h" + +enum SlagmawSpells +{ + SPELL_LAVA_SPIT = 119434, + SPELL_MAGNAW_SUBMERGE = 120384, + SPELL_MAGNAW_TELEPORT_NORTH = 119424, // Serverside + SPELL_MAGNAW_TELEPORT_EAST = 119425, // Serverside + SPELL_MAGNAW_TELEPORT_SOUTH = 119426, // Serverside + SPELL_MAGNAW_TELEPORT_WEST = 119428 // Serverside +}; + +enum SlagmawEvents +{ + EVENT_LAVA_SPIT = 1, + EVENT_TELEPORT, + EVENT_EMERGE, + EVENT_BOUNDARY_CHECK, +}; + +std::array<uint32, 4> const SlagmawTeleportSpells = +{ + SPELL_MAGNAW_TELEPORT_NORTH, + SPELL_MAGNAW_TELEPORT_EAST, + SPELL_MAGNAW_TELEPORT_SOUTH, + SPELL_MAGNAW_TELEPORT_WEST +}; + +// 61463 - Slagmaw +struct boss_slagmaw : public BossAI +{ + boss_slagmaw(Creature* creature) : BossAI(creature, BOSS_SLAGMAW), _lavaSpitCounter(0), _lastTeleportSpell(SPELL_MAGNAW_TELEPORT_WEST) { } + + void Reset() override + { + _Reset(); + _lavaSpitCounter = 0; + _lastTeleportSpell = SPELL_MAGNAW_TELEPORT_WEST; + } + + void JustDied(Unit* /*killer*/) override + { + _JustDied(); + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); + } + + void EnterEvadeMode(EvadeReason /*why*/) override + { + _EnterEvadeMode(); + _DespawnAtEvade(); + + instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); + } + + void JustEngagedWith(Unit* who) override + { + BossAI::JustEngagedWith(who); + + instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me, 1); + + events.ScheduleEvent(EVENT_LAVA_SPIT, 1s); + events.ScheduleEvent(EVENT_BOUNDARY_CHECK, 2500ms); + } + + void HandleSubmergePhase() + { + DoCastSelf(SPELL_MAGNAW_SUBMERGE); + _lavaSpitCounter = 0; + + events.ScheduleEvent(EVENT_TELEPORT, 3s); + } + + uint32 GetNextTeleportSpell() + { + std::array<uint32, 3> teleportSpells = { }; + std::ranges::remove_copy(SlagmawTeleportSpells, teleportSpells.begin(), _lastTeleportSpell); + _lastTeleportSpell = Trinity::Containers::SelectRandomContainerElement(teleportSpells); + return _lastTeleportSpell; + } + + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + switch (events.ExecuteEvent()) + { + case EVENT_LAVA_SPIT: + { + if (_lavaSpitCounter < 5) + { + if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) + { + DoCast(target, SPELL_LAVA_SPIT); + _lavaSpitCounter++; + } + events.Repeat(1s); + break; + } + else if (_lavaSpitCounter == 5) + { + HandleSubmergePhase(); + break; + } + break; + } + case EVENT_TELEPORT: + { + DoCastSelf(GetNextTeleportSpell()); + events.ScheduleEvent(EVENT_EMERGE, 1s); + break; + } + case EVENT_EMERGE: + { + me->RemoveAurasDueToSpell(SPELL_MAGNAW_SUBMERGE); + events.ScheduleEvent(EVENT_LAVA_SPIT, 1s); + break; + } + case EVENT_BOUNDARY_CHECK: + { + if (me->GetVictim()->GetDistance(me) > 50.0f) + EnterEvadeMode(EvadeReason::Other); + events.ScheduleEvent(EVENT_BOUNDARY_CHECK, 2500ms); + break; + } + default: + break; + } + } + +private: + uint8 _lavaSpitCounter; + uint32 _lastTeleportSpell; +}; + +void AddSC_boss_slagmaw() +{ + RegisterRagefireChasmCreatureAI(boss_slagmaw); +} diff --git a/src/server/scripts/Kalimdor/RagefireChasm/instance_ragefire_chasm.cpp b/src/server/scripts/Kalimdor/RagefireChasm/instance_ragefire_chasm.cpp index 2ea035a34fc..9c5dc1fcd21 100644 --- a/src/server/scripts/Kalimdor/RagefireChasm/instance_ragefire_chasm.cpp +++ b/src/server/scripts/Kalimdor/RagefireChasm/instance_ragefire_chasm.cpp @@ -15,16 +15,10 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "AreaBoundary.h" #include "ScriptMgr.h" #include "InstanceScript.h" #include "ragefire_chasm.h" -BossBoundaryData const boundaries = -{ - { BOSS_SLAGMAW, new RectangleBoundary(-298.2f, -257.1f, 94.4f, 172.4f) } -}; - ObjectData const creatureData[] = { { NPC_ADAROGG, BOSS_ADAROGG }, @@ -54,7 +48,6 @@ public: SetHeaders(DataHeader); SetBossNumber(EncounterCount); LoadObjectData(creatureData, nullptr); - LoadBossBoundaries(boundaries); LoadDungeonEncounterData(encounters); } }; diff --git a/src/server/scripts/Kalimdor/kalimdor_script_loader.cpp b/src/server/scripts/Kalimdor/kalimdor_script_loader.cpp index 1799abb01e7..50c3cb20ee1 100644 --- a/src/server/scripts/Kalimdor/kalimdor_script_loader.cpp +++ b/src/server/scripts/Kalimdor/kalimdor_script_loader.cpp @@ -65,6 +65,7 @@ void AddSC_instance_dragon_soul(); // Ragefire Chasm void AddSC_boss_adarogg(); void AddSC_boss_dark_shaman_koranthal(); +void AddSC_boss_slagmaw(); void AddSC_boss_lava_guard_gordoth(); void AddSC_instance_ragefire_chasm(); // Maraudon @@ -209,6 +210,7 @@ void AddKalimdorScripts() // Ragefire Chasm AddSC_boss_adarogg(); AddSC_boss_dark_shaman_koranthal(); + AddSC_boss_slagmaw(); AddSC_boss_lava_guard_gordoth(); AddSC_instance_ragefire_chasm(); //Maraudon |