Scripts/BaradinHold: rewrote and finished Argaloth encounter

* updated instance script to new model
This commit is contained in:
Ovahlord
2018-07-15 15:18:41 +02:00
parent c8a3548720
commit ad9c191a7d
4 changed files with 399 additions and 145 deletions

View File

@@ -0,0 +1,172 @@
-- Template Updates
-- Argaloth
UPDATE `creature_template` SET `difficulty_entry_1`= 51350, `mingold`= 2200000, `maxgold`= 2400000 WHERE `entry`= 47120;
UPDATE `creature_template` SET `minlevel`= 88, `maxlevel`= 88, `faction`= 16, `exp`= 3, `speed_walk`= 1.2, `speed_run`= 1.71429, `unit_flags2`= 134219776, `movementId`= 164, `mingold`= 4900000, `maxgold`= 5100000, `lootid`= 51350 WHERE `entry`= 51350;
UPDATE `creature_template` SET `DamageModifier`= 70, `BaseVariance`= 0.5, `mechanic_immune_mask`= 617299839 WHERE `entry` IN (47120, 51350);
-- Fel Flames
UPDATE `creature_template` SET `ScriptName`= 'npc_argaloth_fel_flames' WHERE `entry`= 47829;
-- Template Addons
DELETE FROM `creature_template_addon` WHERE `entry`= 47829;
-- Spells
DELETE FROM `spell_script_names` WHERE `ScriptName` IN
('spell_argaloth_fel_firestorm');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(88987, 'spell_argaloth_fel_firestorm'),
(95176, 'spell_argaloth_fel_firestorm');
-- Texts
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');
-- Currency Loot
DELETE FROM `creature_onkill_reward` WHERE `creature_id` IN (47120, 51350);
INSERT INTO `creature_onkill_reward` (`creature_id`, `CurrencyId1`, `CurrencyCount1`) VALUES
(47120, 396, 11500),
(51350, 396, 13500);
-- Loot
DELETE FROM `creature_loot_template` WHERE `entry` IN (47120, 51350);
INSERT INTO `creature_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `IsCurrency`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES
(47120, 471200, 471200, 100, 0, 0, 1, 0, 2, 2, ''),
(51350, 471200, 471200, 100, 0, 0, 1, 0, 6, 6, '');
DELETE FROM `reference_loot_template` WHERE `Entry`= 471200;
INSERT INTO `reference_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `IsCurrency`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES
(471200, 60245, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60247, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60248, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60250, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60255, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60257, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60261, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60275, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60278, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60280, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60283, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60285, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60288, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60290, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60298, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60300, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60305, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60307, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60310, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60312, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60314, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60316, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60319, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60321, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60324, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60326, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60330, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60332, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60340, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60342, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60345, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60347, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60350, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60352, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60355, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60357, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60361, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60363, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60409, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60411, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60414, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60416, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60419, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60421, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60424, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60426, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60429, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60431, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60434, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60436, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60439, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60441, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60443, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60445, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60448, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60450, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60453, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60455, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60459, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60461, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60463, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60465, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60468, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60470, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60473, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60475, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60478, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60480, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60505, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60508, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60509, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60513, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60516, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60521, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60533, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60534, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60536, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60539, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60540, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60554, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60555, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60557, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60564, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60567, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60580, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60581, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60583, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60586, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60587, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60589, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60593, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60602, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60604, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60607, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60612, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60613, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60626, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60628, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60630, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60634, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60636, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60637, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60645, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60647, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60649, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60650, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60651, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60658, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60659, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60661, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60662, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60664, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60668, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60669, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60670, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60673, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60776, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60778, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60779, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60783, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60786, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60787, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60788, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60794, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60799, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60800, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60801, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60806, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 60807, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 61026, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 61031, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 61032, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 61033, 0, 0, 0, 0, 1, 1, 1, 1, ''),
(471200, 61047, 0, 0, 0, 0, 1, 1, 1, 1, '');

View File

@@ -34,10 +34,16 @@ enum BHDataTypes
enum BHCreatureIds
{
// Bosses
BOSS_ARGALOTH = 47120,
BOSS_OCCUTHAR = 52363,
BOSS_ALIZABAL = 55869,
// Encounter Related
/*Argaloth*/
NPC_FEL_FLAMES = 47829,
/*Occu'thar*/
NPC_EYE_OF_OCCUTHAR = 52389,
NPC_FOCUS_FIRE_DUMMY = 52369,
NPC_OCCUTHAR_EYE = 52368

View File

@@ -22,25 +22,39 @@
#include "MotionMaster.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "SpellAuraEffects.h"
/* TODO:
- Fel Firestorm need completion
- Need Correct timer
*/
enum Texts
{
SAY_ANNOUNCE_FEL_FIRESTORM = 0
};
enum Spells
{
SPELL_METEOR_SLASH = 88942,
SPELL_CONSUMING_DARKNESS = 88954,
SPELL_FEL_FIRESTORM = 88972,
SPELL_BERSERK = 47008
// Argaloth
SPELL_FEL_FIRESTORM = 88972,
SPELL_FEL_FIRESTORM_TRIGGERED = 88973,
SPELL_BERSERK = 47008,
SPELL_METEOR_SLASH_VISUAL = 88949,
// Fel Flames
SPELL_FEL_FLAMES = 88999
};
#define SPELL_METEOR_SLASH RAID_MODE<uint32>(88942, 95172)
#define SPELL_CONSUMING_DARKNESS RAID_MODE<uint32>(88954, 95173)
enum Events
{
EVENT_METEOR_SLASH = 1,
EVENT_CONSUMING_DARKNESS = 2,
EVENT_BERSERK = 3
// Argaloth
EVENT_METEOR_SLASH = 1,
EVENT_CONSUMING_DARKNESS,
EVENT_FEL_FIRESTORM,
EVENT_END_FEL_FLAME_PHASE,
EVENT_BERSERK,
// Fel Flames
EVENT_FEL_FLAMES
};
class boss_pit_lord_argaloth : public CreatureScript
@@ -57,8 +71,8 @@ class boss_pit_lord_argaloth : public CreatureScript
void Initialize()
{
first_fel_firestorm = false;
second_fel_firestorm = false;
_felFirestormCount = 0;
_felFlamesGUIDs.clear();
}
void Reset() override
@@ -71,40 +85,58 @@ class boss_pit_lord_argaloth : public CreatureScript
{
_JustEngagedWith();
instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me);
events.ScheduleEvent(EVENT_METEOR_SLASH, urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS));
events.ScheduleEvent(EVENT_CONSUMING_DARKNESS, urand(20 * IN_MILLISECONDS, 25 * IN_MILLISECONDS));
events.ScheduleEvent(EVENT_BERSERK, 5 * MINUTE * IN_MILLISECONDS);
events.ScheduleEvent(EVENT_METEOR_SLASH, 10s + 800ms);
events.ScheduleEvent(EVENT_CONSUMING_DARKNESS, 6s);
events.ScheduleEvent(EVENT_BERSERK, 5min);
}
void EnterEvadeMode(EvadeReason /*why*/) override
{
first_fel_firestorm = false;
second_fel_firestorm = false;
me->GetMotionMaster()->MoveTargetedHome();
_EnterEvadeMode();
summons.DespawnAll();
RemoveAuras();
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
_DespawnAtEvade();
}
void DamageTaken(Unit* /*attacker*/, uint32& damage) override
{
if (me->HealthBelowPctDamaged(66, damage) && !first_fel_firestorm)
{
first_fel_firestorm = true;
DoCastAOE(SPELL_FEL_FIRESTORM);
}
else if (me->HealthBelowPctDamaged(33, damage) && !second_fel_firestorm)
{
second_fel_firestorm = true;
DoCastAOE(SPELL_FEL_FIRESTORM);
}
}
void JustDied(Unit* /*killer*/) override
{
_JustDied();
RemoveAuras();
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
}
void DamageTaken(Unit* /*attacker*/, uint32& damage) override
{
if (me->HealthBelowPctDamaged(66, damage) && _felFirestormCount == 0)
{
events.Reset();
events.ScheduleEvent(EVENT_FEL_FIRESTORM, 1ms);
_felFirestormCount++;
}
else if (me->HealthBelowPctDamaged(33, damage) && _felFirestormCount == 1)
{
events.Reset();
events.ScheduleEvent(EVENT_FEL_FIRESTORM, 1ms);
_felFirestormCount++;
}
}
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_FEL_FIRESTORM)
{
DoCastSelf(SPELL_FEL_FIRESTORM_TRIGGERED, true);
events.ScheduleEvent(EVENT_END_FEL_FLAME_PHASE, 18s);
}
}
void JustSummoned(Creature* summon) override
{
summons.Summon(summon);
_felFlamesGUIDs.insert(summon->GetGUID());
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
@@ -120,16 +152,35 @@ class boss_pit_lord_argaloth : public CreatureScript
switch (eventId)
{
case EVENT_METEOR_SLASH:
DoCastSelf(SPELL_METEOR_SLASH_VISUAL);
DoCastAOE(SPELL_METEOR_SLASH);
events.ScheduleEvent(EVENT_METEOR_SLASH, urand(15 * IN_MILLISECONDS, 20 * IN_MILLISECONDS));
events.Repeat(17s);
break;
case EVENT_CONSUMING_DARKNESS:
DoCastAOE(SPELL_CONSUMING_DARKNESS, true);
events.ScheduleEvent(EVENT_CONSUMING_DARKNESS, urand(20 * IN_MILLISECONDS, 25 * IN_MILLISECONDS));
DoCastAOE(SPELL_CONSUMING_DARKNESS);
events.Repeat(22s, 24s);
break;
case EVENT_BERSERK:
DoCast(me, SPELL_BERSERK, true);
break;
case EVENT_FEL_FIRESTORM:
me->AttackStop();
me->SetReactState(REACT_PASSIVE);
Talk(SAY_ANNOUNCE_FEL_FIRESTORM);
DoCastAOE(SPELL_FEL_FIRESTORM);
break;
case EVENT_END_FEL_FLAME_PHASE:
me->SetReactState(REACT_AGGRESSIVE);
if (Unit* victim = me->GetVictim())
me->AI()->AttackStart(victim);
for (ObjectGuid guid : _felFlamesGUIDs)
if (Creature* felFlame = ObjectAccessor::GetCreature(*me, guid))
felFlame->RemoveAllAuras();
events.ScheduleEvent(EVENT_CONSUMING_DARKNESS, 6s);
events.ScheduleEvent(EVENT_METEOR_SLASH, 9s);
break;
default:
break;
}
@@ -139,8 +190,14 @@ class boss_pit_lord_argaloth : public CreatureScript
}
private:
bool first_fel_firestorm;
bool second_fel_firestorm;
uint8 _felFirestormCount;
GuidSet _felFlamesGUIDs;
void RemoveAuras()
{
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_CONSUMING_DARKNESS);
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_METEOR_SLASH);
}
};
CreatureAI* GetAI(Creature* creature) const override
@@ -149,81 +206,138 @@ class boss_pit_lord_argaloth : public CreatureScript
}
};
// 88954 / 95173 - Consuming Darkness
class spell_argaloth_consuming_darkness : public SpellScriptLoader
class npc_argaloth_fel_flames : public CreatureScript
{
public:
spell_argaloth_consuming_darkness() : SpellScriptLoader("spell_argaloth_consuming_darkness") { }
npc_argaloth_fel_flames() : CreatureScript("npc_argaloth_fel_flames") { }
class spell_argaloth_consuming_darkness_SpellScript : public SpellScript
struct npc_argaloth_fel_flamesAI : public ScriptedAI
{
PrepareSpellScript(spell_argaloth_consuming_darkness_SpellScript);
npc_argaloth_fel_flamesAI(Creature* creature) : ScriptedAI(creature) { }
void FilterTargets(std::list<WorldObject*>& targets)
void IsSummonedBy(Unit* /*summoner*/) override
{
Trinity::Containers::RandomResize(targets, GetCaster()->GetMap()->Is25ManRaid() ? 8 : 3);
_events.ScheduleEvent(EVENT_FEL_FLAMES, 1s + 100ms);
}
void Register() override
void UpdateAI(uint32 diff) override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_argaloth_consuming_darkness_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
_events.Update(diff);
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
{
PrepareSpellScript(spell_argaloth_meteor_slash_SpellScript);
bool Load() override
{
_targetCount = 0;
return true;
}
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_ENEMY_104);
OnHit += SpellHitFn(spell_argaloth_meteor_slash_SpellScript::SplitDamage);
while (uint32 eventId = _events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_FEL_FLAMES:
DoCastSelf(SPELL_FEL_FLAMES);
break;
default:
break;
}
}
}
private:
uint32 _targetCount =0;
EventMap _events;
};
SpellScript* GetSpellScript() const override
CreatureAI* GetAI(Creature* creature) const override
{
return new spell_argaloth_meteor_slash_SpellScript();
return GetBaradinHoldAI<npc_argaloth_fel_flamesAI>(creature);
}
};
// 88954 / 95173 - Consuming Darkness
class spell_argaloth_consuming_darkness : public SpellScript
{
PrepareSpellScript(spell_argaloth_consuming_darkness);
void FilterTargets(std::list<WorldObject*>& targets)
{
Trinity::Containers::RandomResize(targets, GetCaster()->GetMap()->Is25ManRaid() ? 8 : 3);
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_argaloth_consuming_darkness::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
class spell_argaloth_consuming_darkness_AuraScript : public AuraScript
{
PrepareAuraScript(spell_argaloth_consuming_darkness_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_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
}
};
// 88942 / 95172 - Meteor Slash
class spell_argaloth_meteor_slash : public SpellScript
{
PrepareSpellScript(spell_argaloth_meteor_slash);
bool Load() override
{
_targetCount = 0;
return true;
}
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::CountTargets, EFFECT_0, TARGET_UNIT_CONE_ENEMY_104);
OnHit += SpellHitFn(spell_argaloth_meteor_slash::SplitDamage);
}
private:
uint32 _targetCount;
};
// 88987 / 95176 - Fel Firestorm
class spell_argaloth_fel_firestorm : public SpellScript
{
PrepareSpellScript(spell_argaloth_fel_firestorm);
void FilterTargets(std::list<WorldObject*>& targets)
{
Trinity::Containers::RandomResize(targets, GetCaster()->GetMap()->Is25ManRaid() ? 3 : 1);
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_argaloth_fel_firestorm::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
void AddSC_boss_pit_lord_argaloth()
{
new boss_pit_lord_argaloth();
new spell_argaloth_consuming_darkness();
new spell_argaloth_meteor_slash();
new npc_argaloth_fel_flames();
RegisterSpellAndAuraScriptPair(spell_argaloth_consuming_darkness, spell_argaloth_consuming_darkness_AuraScript);
RegisterSpellScript(spell_argaloth_meteor_slash);
RegisterSpellScript(spell_argaloth_fel_firestorm);
}

View File

@@ -22,6 +22,14 @@
#include "InstanceScript.h"
#include "Map.h"
ObjectData const creatureData[] =
{
{ BOSS_ARGALOTH, DATA_ARGALOTH },
{ BOSS_OCCUTHAR, DATA_OCCUTHAR },
{ BOSS_ALIZABAL, DATA_ALIZABAL },
{ 0, 0 } // END
};
DoorData const doorData[] =
{
{ GO_ARGALOTH_DOOR, DATA_ARGALOTH, DOOR_TYPE_ROOM },
@@ -41,70 +49,24 @@ class instance_baradin_hold: public InstanceMapScript
{
SetHeaders(DataHeader);
SetBossNumber(EncounterCount);
LoadObjectData(creatureData, nullptr);
LoadDoorData(doorData);
}
void OnCreatureCreate(Creature* creature) override
{
InstanceScript::OnCreatureCreate(creature);
switch (creature->GetEntry())
{
case BOSS_ARGALOTH:
ArgalothGUID = creature->GetGUID();
case NPC_FEL_FLAMES:
if (Creature* argaloth = GetCreature(DATA_ARGALOTH))
argaloth->AI()->JustSummoned(creature);
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
{
switch(go->GetEntry())
{
case GO_ARGALOTH_DOOR:
case GO_OCCUTHAR_DOOR:
case GO_ALIZABAL_DOOR:
AddDoor(go, false);
break;
}
}
protected:
ObjectGuid ArgalothGUID;
ObjectGuid OccutharGUID;
ObjectGuid AlizabalGUID;
};
InstanceScript* GetInstanceScript(InstanceMap* map) const