mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 19:06:49 +01:00
Scripts/Baradin Hold: rewrite Argaloth encounter (#29604)
* handle all missing mechanics and visuals * modernized instance script
This commit is contained in:
17
sql/updates/world/master/2024_01_22_00_world.sql
Normal file
17
sql/updates/world/master/2024_01_22_00_world.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
UPDATE `creature_template` SET `ScriptName`= 'boss_argaloth' WHERE `ScriptName`= 'boss_pit_lord_argaloth';
|
||||
UPDATE `creature_template` SET `flags_extra`= 0x80, `AIName`= 'NullCreatureAI' WHERE `entry`= 47829;
|
||||
UPDATE `creature_template_difficulty` SET `StaticFlags1`= 0x2000306, `StaticFlags2`= 0x100000, `StaticFlags3`= 0x8400, `StaticFlags4`= 0x210 WHERE `Entry`= 47829;
|
||||
UPDATE `creature_template_addon` SET `Auras`= '' WHERE `entry`= 47829;
|
||||
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_argaloth_meteor_slash', 'spell_argaloth_fel_firestorm_forcecast');
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(88972, 'spell_argaloth_fel_firestorm'),
|
||||
(88987, 'spell_argaloth_fel_firestorm_forcecast');
|
||||
|
||||
DELETE FROM `spell_custom_attr` WHERE `entry`= 88942;
|
||||
INSERT INTO `spell_custom_attr` (`entry`, `attributes`) VALUES
|
||||
(88942, 0x8);
|
||||
|
||||
DELETE FROM `creature_text` WHERE `CreatureID`= 47120;
|
||||
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `comment`) VALUES
|
||||
(47120, 0, 0, '|TInterface\\Icons\\spell_fire_felrainoffire.blp:20|t%s begins to cast |cFFFF0000|Hspell:88972|h[Fel Firestorm]|h|r!', 41, 0, 100, 0, 0, 0, 48107, 'Argaloth - Announce Fel Firestorm');
|
||||
@@ -27,16 +27,25 @@ uint32 const EncounterCount = 3;
|
||||
|
||||
enum BHDataTypes
|
||||
{
|
||||
DATA_ARGALOTH = 0,
|
||||
DATA_OCCUTHAR = 1,
|
||||
DATA_ALIZABAL = 2
|
||||
// Encounters
|
||||
BOSS_ARGALOTH = 0,
|
||||
BOSS_OCCUTHAR = 1,
|
||||
BOSS_ALIZABAL = 2,
|
||||
|
||||
// Encounter Related
|
||||
DATA_EXTINUISH_FEL_FLAMES
|
||||
};
|
||||
|
||||
enum BHCreatureIds
|
||||
{
|
||||
BOSS_ARGALOTH = 47120,
|
||||
BOSS_OCCUTHAR = 52363,
|
||||
BOSS_ALIZABAL = 55869,
|
||||
// Bosses
|
||||
NPC_ARGALOTH = 47120,
|
||||
NPC_OCCUTHAR = 52363,
|
||||
NPC_ALIZABAL = 55869,
|
||||
|
||||
// Encounter Related Creatures
|
||||
/*Argaloth*/
|
||||
NPC_FEL_FLAMES = 47829,
|
||||
|
||||
NPC_EYE_OF_OCCUTHAR = 52389,
|
||||
NPC_FOCUS_FIRE_DUMMY = 52369,
|
||||
@@ -50,10 +59,18 @@ enum BHGameObjectIds
|
||||
GO_ALIZABAL_DOOR = 209849
|
||||
};
|
||||
|
||||
template<typename AI>
|
||||
CreatureAI* GetBaradinHoldAI(Creature* creature)
|
||||
enum BHSpells
|
||||
{
|
||||
return GetInstanceAI<AI>(creature, BHScriptName);
|
||||
// Fel Flames
|
||||
SPELL_FEL_FLAMES = 88999
|
||||
};
|
||||
|
||||
template<class AI, class T>
|
||||
inline AI* GetBaradinHoldAI(T* obj)
|
||||
{
|
||||
return GetInstanceAI<AI>(obj, BHScriptName);
|
||||
}
|
||||
|
||||
#define RegisterBaradinHoldCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetBaradinHoldAI)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -70,7 +70,7 @@ class at_alizabal_intro : public AreaTriggerScript
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/) override
|
||||
{
|
||||
if (InstanceScript* instance = player->GetInstanceScript())
|
||||
if (Creature* alizabal = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_ALIZABAL)))
|
||||
if (Creature* alizabal = instance->GetCreature(BOSS_ALIZABAL))
|
||||
alizabal->AI()->DoAction(ACTION_INTRO);
|
||||
return true;
|
||||
}
|
||||
@@ -83,7 +83,7 @@ class boss_alizabal : public CreatureScript
|
||||
|
||||
struct boss_alizabalAI : public BossAI
|
||||
{
|
||||
boss_alizabalAI(Creature* creature) : BossAI(creature, DATA_ALIZABAL) { }
|
||||
boss_alizabalAI(Creature* creature) : BossAI(creature, BOSS_ALIZABAL) { }
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
|
||||
212
src/server/scripts/EasternKingdoms/BaradinHold/boss_argaloth.cpp
Normal file
212
src/server/scripts/EasternKingdoms/BaradinHold/boss_argaloth.cpp
Normal file
@@ -0,0 +1,212 @@
|
||||
/*
|
||||
* 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 "ScriptMgr.h"
|
||||
#include "baradin_hold.h"
|
||||
#include "Containers.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Map.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
enum ArgalothTexts
|
||||
{
|
||||
SAY_ANNOUNCE_FEL_FIRESTORM = 0
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
// Argaloth
|
||||
SPELL_FEL_FIRESTORM = 88972,
|
||||
SPELL_FEL_FIRESTORM_TRIGGERED = 88973,
|
||||
SPELL_BERSERK = 47008,
|
||||
SPELL_METEOR_SLASH_VISUAL = 88949,
|
||||
SPELL_METEOR_SLASH = 88942,
|
||||
SPELL_CONSUMING_DARKNESS = 88954,
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
// Argaloth
|
||||
EVENT_METEOR_SLASH = 1,
|
||||
EVENT_CONSUMING_DARKNESS,
|
||||
EVENT_FEL_FIRESTORM,
|
||||
EVENT_END_FEL_FIRESTORM,
|
||||
EVENT_BERSERK,
|
||||
|
||||
// Fel Flames
|
||||
EVENT_FEL_FLAMES
|
||||
};
|
||||
|
||||
struct boss_argaloth : public BossAI
|
||||
{
|
||||
boss_argaloth(Creature* creature) : BossAI(creature, BOSS_ARGALOTH), _felFirestormCount(0), _isInFelFirestormPhase(false) { }
|
||||
|
||||
void JustEngagedWith(Unit* who) override
|
||||
{
|
||||
BossAI::JustEngagedWith(who);
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me, 1);
|
||||
events.ScheduleEvent(EVENT_METEOR_SLASH, 11s);
|
||||
events.ScheduleEvent(EVENT_CONSUMING_DARKNESS, 6s);
|
||||
events.ScheduleEvent(EVENT_BERSERK, 5min);
|
||||
}
|
||||
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
|
||||
summons.DespawnAll();
|
||||
_DespawnAtEvade();
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
|
||||
{
|
||||
if (damage >= me->GetHealth() || _isInFelFirestormPhase)
|
||||
return;
|
||||
|
||||
if ((me->HealthBelowPctDamaged(66, damage) && _felFirestormCount == 0) || (me->HealthBelowPctDamaged(33, damage) && _felFirestormCount == 1))
|
||||
{
|
||||
events.ScheduleEvent(EVENT_FEL_FIRESTORM, 1ms);
|
||||
++_felFirestormCount;
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
_JustDied();
|
||||
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_METEOR_SLASH:
|
||||
DoCastSelf(SPELL_METEOR_SLASH_VISUAL);
|
||||
DoCastAOE(SPELL_METEOR_SLASH);
|
||||
events.ScheduleEvent(EVENT_METEOR_SLASH, 17s);
|
||||
break;
|
||||
case EVENT_CONSUMING_DARKNESS:
|
||||
DoCastAOE(SPELL_CONSUMING_DARKNESS, CastSpellExtraArgs().AddSpellMod(SPELLVALUE_MAX_TARGETS, Is25ManRaid() ? 8 : 3));
|
||||
events.ScheduleEvent(EVENT_CONSUMING_DARKNESS, 22s, 24s);
|
||||
break;
|
||||
case EVENT_FEL_FIRESTORM:
|
||||
me->AttackStop();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
Talk(SAY_ANNOUNCE_FEL_FIRESTORM);
|
||||
DoCastAOE(SPELL_FEL_FIRESTORM);
|
||||
events.ScheduleEvent(EVENT_END_FEL_FIRESTORM, 21s);
|
||||
events.CancelEvent(EVENT_METEOR_SLASH);
|
||||
events.CancelEvent(EVENT_CONSUMING_DARKNESS);
|
||||
_isInFelFirestormPhase = true;
|
||||
break;
|
||||
case EVENT_END_FEL_FIRESTORM:
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
instance->SetData(DATA_EXTINUISH_FEL_FLAMES, 0);
|
||||
events.ScheduleEvent(EVENT_CONSUMING_DARKNESS, 6s);
|
||||
events.ScheduleEvent(EVENT_METEOR_SLASH, 9s);
|
||||
_isInFelFirestormPhase = false;
|
||||
break;
|
||||
case EVENT_BERSERK:
|
||||
DoCastSelf(SPELL_BERSERK);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
}
|
||||
private:
|
||||
uint8 _felFirestormCount;
|
||||
bool _isInFelFirestormPhase;
|
||||
};
|
||||
|
||||
// 88954 - Consuming Darkness
|
||||
class spell_argaloth_consuming_darkness : public AuraScript
|
||||
{
|
||||
void HandlePeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
if (AuraEffect* aurEff = GetEffect(EFFECT_0))
|
||||
{
|
||||
int32 damage = aurEff->GetAmount() + CalculatePct(aurEff->GetAmount(), 10);
|
||||
aurEff->SetAmount(damage);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_argaloth_consuming_darkness::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
// 88972 - Fel Firestorm
|
||||
class spell_argaloth_fel_firestorm : public AuraScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_FEL_FIRESTORM_TRIGGERED });
|
||||
}
|
||||
|
||||
void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetTarget()->CastSpell(nullptr, SPELL_FEL_FIRESTORM_TRIGGERED);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_argaloth_fel_firestorm::AfterApply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
// 88987 - Fel Firestorm
|
||||
class spell_argaloth_fel_firestorm_forcecast : public SpellScript
|
||||
{
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
if (targets.empty())
|
||||
return;
|
||||
|
||||
size_t targetSize = GetCaster()->GetMap()->Is25ManRaid() ? 8 : 3;
|
||||
if (targets.size() > targetSize)
|
||||
Trinity::Containers::RandomResize(targets, targetSize);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_argaloth_fel_firestorm_forcecast::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_argaloth()
|
||||
{
|
||||
RegisterBaradinHoldCreatureAI(boss_argaloth);
|
||||
RegisterSpellScript(spell_argaloth_consuming_darkness);
|
||||
RegisterSpellScript(spell_argaloth_fel_firestorm);
|
||||
RegisterSpellScript(spell_argaloth_fel_firestorm_forcecast);
|
||||
}
|
||||
@@ -61,7 +61,7 @@ class boss_occuthar : public CreatureScript
|
||||
|
||||
struct boss_occutharAI : public BossAI
|
||||
{
|
||||
boss_occutharAI(Creature* creature) : BossAI(creature, DATA_OCCUTHAR),
|
||||
boss_occutharAI(Creature* creature) : BossAI(creature, BOSS_OCCUTHAR),
|
||||
_vehicle(me->GetVehicleKit())
|
||||
{
|
||||
ASSERT(_vehicle);
|
||||
@@ -168,7 +168,7 @@ class npc_eyestalk : public CreatureScript
|
||||
void IsSummonedBy(WorldObject* /*summoner*/) override
|
||||
{
|
||||
// player is the spellcaster so register summon manually
|
||||
if (Creature* occuthar = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_OCCUTHAR)))
|
||||
if (Creature* occuthar = _instance->GetCreature(BOSS_OCCUTHAR))
|
||||
occuthar->AI()->JustSummoned(me);
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ class spell_occuthar_eyes_of_occuthar_vehicle : public SpellScriptLoader
|
||||
{
|
||||
Position pos = GetHitUnit()->GetPosition();
|
||||
|
||||
if (Creature* occuthar = ObjectAccessor::GetCreature(*GetCaster(), GetCaster()->GetInstanceScript()->GetGuidData(DATA_OCCUTHAR)))
|
||||
if (Creature* occuthar = GetCaster()->GetInstanceScript()->GetCreature(BOSS_OCCUTHAR))
|
||||
{
|
||||
if (Creature* creature = occuthar->SummonCreature(NPC_EYE_OF_OCCUTHAR, pos))
|
||||
creature->CastSpell(GetHitUnit(), SPELL_GAZE_OF_OCCUTHAR, false);
|
||||
|
||||
@@ -1,190 +0,0 @@
|
||||
/*
|
||||
* 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 "ScriptMgr.h"
|
||||
#include "baradin_hold.h"
|
||||
#include "Containers.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Map.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
/* TODO:
|
||||
- Fel Firestorm need completion
|
||||
- Need Correct timer
|
||||
*/
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_METEOR_SLASH = 88942,
|
||||
SPELL_CONSUMING_DARKNESS = 88954,
|
||||
SPELL_FEL_FIRESTORM = 88972,
|
||||
SPELL_BERSERK = 47008
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_METEOR_SLASH = 1,
|
||||
EVENT_CONSUMING_DARKNESS = 2,
|
||||
EVENT_BERSERK = 3
|
||||
};
|
||||
|
||||
class boss_pit_lord_argaloth : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_pit_lord_argaloth() : CreatureScript("boss_pit_lord_argaloth") { }
|
||||
|
||||
struct boss_pit_lord_argalothAI : public BossAI
|
||||
{
|
||||
boss_pit_lord_argalothAI(Creature* creature) : BossAI(creature, DATA_ARGALOTH) { }
|
||||
|
||||
void JustEngagedWith(Unit* who) override
|
||||
{
|
||||
BossAI::JustEngagedWith(who);
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me);
|
||||
events.ScheduleEvent(EVENT_METEOR_SLASH, 10s, 20s);
|
||||
events.ScheduleEvent(EVENT_CONSUMING_DARKNESS, 20s, 25s);
|
||||
events.ScheduleEvent(EVENT_BERSERK, 5min);
|
||||
}
|
||||
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
|
||||
_DespawnAtEvade();
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
|
||||
{
|
||||
if (me->HealthBelowPctDamaged(33, damage) ||
|
||||
me->HealthBelowPctDamaged(66, damage))
|
||||
{
|
||||
DoCastAOE(SPELL_FEL_FIRESTORM);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
_JustDied();
|
||||
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_METEOR_SLASH:
|
||||
DoCastAOE(SPELL_METEOR_SLASH);
|
||||
events.ScheduleEvent(EVENT_METEOR_SLASH, 15s, 20s);
|
||||
break;
|
||||
case EVENT_CONSUMING_DARKNESS:
|
||||
DoCastAOE(SPELL_CONSUMING_DARKNESS, true);
|
||||
events.ScheduleEvent(EVENT_CONSUMING_DARKNESS, 20s, 25s);
|
||||
break;
|
||||
case EVENT_BERSERK:
|
||||
DoCast(me, SPELL_BERSERK, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetBaradinHoldAI<boss_pit_lord_argalothAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
// 88954 / 95173 - Consuming Darkness
|
||||
class spell_argaloth_consuming_darkness : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_argaloth_consuming_darkness() : SpellScriptLoader("spell_argaloth_consuming_darkness") { }
|
||||
|
||||
class spell_argaloth_consuming_darkness_SpellScript : public SpellScript
|
||||
{
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
Trinity::Containers::RandomResize(targets, GetCaster()->GetMap()->Is25ManRaid() ? 8 : 3);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_argaloth_consuming_darkness_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_argaloth_consuming_darkness_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
// 88942 / 95172 - Meteor Slash
|
||||
class spell_argaloth_meteor_slash : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_argaloth_meteor_slash() : SpellScriptLoader("spell_argaloth_meteor_slash") { }
|
||||
|
||||
class spell_argaloth_meteor_slash_SpellScript : public SpellScript
|
||||
{
|
||||
void CountTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
_targetCount = targets.size();
|
||||
}
|
||||
|
||||
void SplitDamage()
|
||||
{
|
||||
if (!_targetCount)
|
||||
return;
|
||||
|
||||
SetHitDamage(GetHitDamage() / _targetCount);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_argaloth_meteor_slash_SpellScript::CountTargets, EFFECT_0, TARGET_UNIT_CONE_CASTER_TO_DEST_ENEMY);
|
||||
OnHit += SpellHitFn(spell_argaloth_meteor_slash_SpellScript::SplitDamage);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _targetCount = 0;
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_argaloth_meteor_slash_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_pit_lord_argaloth()
|
||||
{
|
||||
new boss_pit_lord_argaloth();
|
||||
new spell_argaloth_consuming_darkness();
|
||||
new spell_argaloth_meteor_slash();
|
||||
}
|
||||
@@ -18,23 +18,30 @@
|
||||
#include "ScriptMgr.h"
|
||||
#include "baradin_hold.h"
|
||||
#include "Creature.h"
|
||||
#include "GameObject.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Map.h"
|
||||
|
||||
DoorData const doorData[] =
|
||||
{
|
||||
{ GO_ARGALOTH_DOOR, DATA_ARGALOTH, EncounterDoorBehavior::OpenWhenNotInProgress },
|
||||
{ GO_OCCUTHAR_DOOR, DATA_OCCUTHAR, EncounterDoorBehavior::OpenWhenNotInProgress },
|
||||
{ GO_ALIZABAL_DOOR, DATA_ALIZABAL, EncounterDoorBehavior::OpenWhenNotInProgress },
|
||||
{ GO_ARGALOTH_DOOR, BOSS_ARGALOTH, EncounterDoorBehavior::OpenWhenNotInProgress },
|
||||
{ GO_OCCUTHAR_DOOR, BOSS_OCCUTHAR, EncounterDoorBehavior::OpenWhenNotInProgress },
|
||||
{ GO_ALIZABAL_DOOR, BOSS_ALIZABAL, EncounterDoorBehavior::OpenWhenNotInProgress },
|
||||
{ 0, 0, EncounterDoorBehavior::OpenWhenNotInProgress } // END
|
||||
};
|
||||
|
||||
ObjectData const creatureData[] =
|
||||
{
|
||||
{ NPC_ARGALOTH, BOSS_ARGALOTH },
|
||||
{ NPC_OCCUTHAR, BOSS_OCCUTHAR },
|
||||
{ NPC_ALIZABAL, BOSS_ALIZABAL },
|
||||
{ 0, 0 } // END
|
||||
};
|
||||
|
||||
DungeonEncounterData const encounters[] =
|
||||
{
|
||||
{ DATA_ARGALOTH, {{ 1033 }} },
|
||||
{ DATA_OCCUTHAR, {{ 1250 }} },
|
||||
{ DATA_ALIZABAL, {{ 1332 }} }
|
||||
{ BOSS_ARGALOTH, {{ 1033 }} },
|
||||
{ BOSS_OCCUTHAR, {{ 1250 }} },
|
||||
{ BOSS_ALIZABAL, {{ 1332 }} }
|
||||
};
|
||||
|
||||
class instance_baradin_hold: public InstanceMapScript
|
||||
@@ -48,71 +55,44 @@ class instance_baradin_hold: public InstanceMapScript
|
||||
{
|
||||
SetHeaders(DataHeader);
|
||||
SetBossNumber(EncounterCount);
|
||||
LoadObjectData(creatureData, nullptr);
|
||||
LoadDoorData(doorData);
|
||||
LoadDungeonEncounterData(encounters);
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature) override
|
||||
{
|
||||
InstanceScript::OnCreatureCreate(creature);
|
||||
|
||||
switch(creature->GetEntry())
|
||||
{
|
||||
case BOSS_ARGALOTH:
|
||||
ArgalothGUID = creature->GetGUID();
|
||||
case NPC_FEL_FLAMES:
|
||||
_felFlameGUIDs.push_back(creature->GetGUID());
|
||||
creature->m_Events.AddEventAtOffset([creature]() { creature->CastSpell(nullptr, SPELL_FEL_FLAMES); }, 1s);
|
||||
break;
|
||||
case BOSS_OCCUTHAR:
|
||||
OccutharGUID = creature->GetGUID();
|
||||
break;
|
||||
case BOSS_ALIZABAL:
|
||||
AlizabalGUID = creature->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go) override
|
||||
{
|
||||
switch(go->GetEntry())
|
||||
{
|
||||
case GO_ARGALOTH_DOOR:
|
||||
case GO_OCCUTHAR_DOOR:
|
||||
case GO_ALIZABAL_DOOR:
|
||||
AddDoor(go, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ObjectGuid GetGuidData(uint32 data) const override
|
||||
{
|
||||
switch (data)
|
||||
{
|
||||
case DATA_ARGALOTH:
|
||||
return ArgalothGUID;
|
||||
case DATA_OCCUTHAR:
|
||||
return OccutharGUID;
|
||||
case DATA_ALIZABAL:
|
||||
return AlizabalGUID;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
|
||||
void OnGameObjectRemove(GameObject* go) override
|
||||
void SetData(uint32 type, uint32 /*value*/) override
|
||||
{
|
||||
switch(go->GetEntry())
|
||||
switch (type)
|
||||
{
|
||||
case GO_ARGALOTH_DOOR:
|
||||
case GO_OCCUTHAR_DOOR:
|
||||
case GO_ALIZABAL_DOOR:
|
||||
AddDoor(go, false);
|
||||
case DATA_EXTINUISH_FEL_FLAMES:
|
||||
for (ObjectGuid const& guid : _felFlameGUIDs)
|
||||
if (Creature* felFlame = instance->GetCreature(guid))
|
||||
felFlame->RemoveAllAuras();
|
||||
|
||||
_felFlameGUIDs.clear();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
ObjectGuid ArgalothGUID;
|
||||
ObjectGuid OccutharGUID;
|
||||
ObjectGuid AlizabalGUID;
|
||||
private:
|
||||
std::vector<ObjectGuid> _felFlameGUIDs;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const override
|
||||
|
||||
@@ -24,7 +24,7 @@ void AddSC_boss_vanndar();
|
||||
void AddSC_arathi_basin(); //Arathi Basin
|
||||
void AddSC_boss_alizabal(); //Baradin Hold
|
||||
void AddSC_boss_occuthar();
|
||||
void AddSC_boss_pit_lord_argaloth();
|
||||
void AddSC_boss_argaloth();
|
||||
void AddSC_instance_baradin_hold();
|
||||
void AddSC_instance_bastion_of_twilight(); //Bastion of Twilight
|
||||
void AddSC_boss_romogg_bonecrusher(); //Blackrock Caverns
|
||||
@@ -219,7 +219,7 @@ void AddEasternKingdomsScripts()
|
||||
AddSC_arathi_basin(); //Arathi Basin
|
||||
AddSC_boss_alizabal(); //Baradin Hold
|
||||
AddSC_boss_occuthar();
|
||||
AddSC_boss_pit_lord_argaloth();
|
||||
AddSC_boss_argaloth();
|
||||
AddSC_instance_baradin_hold();
|
||||
AddSC_instance_bastion_of_twilight(); //Bastion of Twilight
|
||||
AddSC_boss_romogg_bonecrusher(); //Blackrock Caverns
|
||||
|
||||
Reference in New Issue
Block a user