Scripts/RagefireChasm: Implement Dark Shaman Koranthal encounter (#29977)

This commit is contained in:
Aqua Deus
2024-05-16 03:11:57 +02:00
committed by GitHub
parent 68571cba18
commit 7342d909b6
3 changed files with 163 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
-- Creature
UPDATE `creature_template` SET `ScriptName`='boss_dark_shaman_koranthal' WHERE `entry`=61412;
UPDATE `creature_template` SET `flags_extra`=`flags_extra`|0x80 WHERE `entry`=61413;
-- Conditions
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` = 119927;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `ConditionStringValue1`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(13, 1, 119927, 0, 0, 51, 0, 5, 61413, 0, '', 0, 0, 0, '', 'Spell \'Shadow Vortex\' can only hit \'Flame Visual\'');
-- Texts
DELETE FROM `creature_text` WHERE `CreatureID` = 61412;
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
(61412, 0, 0, 'The power of the Dark Shaman will overwhelm you!', 14, 0, 100, 0, 0, 0, 61305, 0, 'Dark Shaman Koranthal to Player'),
(61412, 1, 0, '|TInterface\Icons\spell_shadow_shadowfury:20|tDark Shaman Koranthal summons a |r|cFF9E09DE|Hspell:119971|h[Shadow Storm]|h|r!', 41, 0, 100, 0, 0, 0, 61139, 0, 'Dark Shaman Koranthal to Player'),
(61412, 2, 0, 'My death... means... nothing...', 14, 0, 100, 0, 0, 0, 61306, 0, 'Dark Shaman Koranthal to Player');
-- Spell
DELETE FROM `spell_script_names` WHERE `spell_id`=119973;
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(119973, 'spell_dark_shaman_koranthal_shadow_storm');

View File

@@ -0,0 +1,141 @@
/*
* 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 "InstanceScript.h"
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "ragefire_chasm.h"
enum KoranthalSpells
{
SPELL_SHADOW_VORTEX = 119928,
SPELL_TWISTED_ELEMENTS = 119300,
SPELL_SHADOW_STORM = 119971
};
enum KoranthalTexts
{
SAY_AGGRO = 0,
SAY_SHADOW_STORM = 1,
SAY_DEATH = 2
};
enum KoranthalEvents
{
EVENT_TWISTED_ELEMENTS = 1,
EVENT_SHADOW_STORM = 2
};
// 61412 - Dark Shaman Koranthal
struct boss_dark_shaman_koranthal : public BossAI
{
boss_dark_shaman_koranthal(Creature* creature) : BossAI(creature, BOSS_DARK_SHAMAN_KORANTHAL) { }
void JustAppeared() override
{
DoCastSelf(SPELL_SHADOW_VORTEX);
}
void Reset() override
{
_Reset();
}
void EnterEvadeMode(EvadeReason /*why*/) override
{
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
_EnterEvadeMode();
_DespawnAtEvade();
}
void JustEngagedWith(Unit* who) override
{
BossAI::JustEngagedWith(who);
Talk(SAY_AGGRO);
me->RemoveAurasDueToSpell(SPELL_SHADOW_VORTEX);
instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me, 1);
events.ScheduleEvent(EVENT_TWISTED_ELEMENTS, 6s);
events.ScheduleEvent(EVENT_SHADOW_STORM, 20500ms);
}
void JustDied(Unit* /*killer*/) override
{
_JustDied();
Talk(SAY_DEATH);
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_TWISTED_ELEMENTS:
{
DoCastVictim(SPELL_TWISTED_ELEMENTS);
events.Repeat(7200ms);
break;
}
case EVENT_SHADOW_STORM:
{
Talk(SAY_SHADOW_STORM);
DoCast(SPELL_SHADOW_STORM);
events.Repeat(47200ms);
break;
}
default:
break;
}
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
}
}
};
// 119973 - Shadow Storm
class spell_dark_shaman_koranthal_shadow_storm : public SpellScript
{
void HandleScript(SpellEffIndex /*effIndex*/) const
{
GetCaster()->CastSpell(GetHitUnit(), GetEffectValue(), true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_dark_shaman_koranthal_shadow_storm::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
void AddSC_boss_dark_shaman_koranthal()
{
RegisterRagefireChasmCreatureAI(boss_dark_shaman_koranthal);
RegisterSpellScript(spell_dark_shaman_koranthal_shadow_storm);
}

View File

@@ -64,6 +64,7 @@ void AddSC_instance_dire_maul();
void AddSC_instance_dragon_soul();
// Ragefire Chasm
void AddSC_boss_adarogg();
void AddSC_boss_dark_shaman_koranthal();
void AddSC_instance_ragefire_chasm();
// Maraudon
void AddSC_boss_celebras_the_cursed();
@@ -206,6 +207,7 @@ void AddKalimdorScripts()
AddSC_instance_dragon_soul();
// Ragefire Chasm
AddSC_boss_adarogg();
AddSC_boss_dark_shaman_koranthal();
AddSC_instance_ragefire_chasm();
//Maraudon
AddSC_boss_celebras_the_cursed();