Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_pit_lord_argaloth.cpp
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#include "ScriptMgr.h"
7#include "ScriptedCreature.h"
8#include "SpellScript.h"
9#include "baradin_hold.h"
10
11/* TODO:
12- Fel Firestorm need completion
13- Need Correct timer
14*/
15
23
30
32{
33 public:
34 boss_pit_lord_argaloth() : CreatureScript("boss_pit_lord_argaloth") { }
35
37 {
39
40 void EnterCombat(Unit* /*who*/) OVERRIDE
41 {
43 instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me);
44 events.ScheduleEvent(EVENT_METEOR_SLASH, std::rand() % (20 * IN_MILLISECONDS) + (10 * IN_MILLISECONDS));
45 events.ScheduleEvent(EVENT_CONSUMING_DARKNESS, std::rand() % (25 * IN_MILLISECONDS) + (20 * IN_MILLISECONDS));
46 events.ScheduleEvent(EVENT_BERSERK, 5 * MINUTE * IN_MILLISECONDS);
47 }
48
50 {
51 me->GetMotionMaster()->MoveTargetedHome();
52 instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
54 }
55
56 void DamageTaken(Unit* /*attacker*/, uint32& damage) OVERRIDE
57 {
58 if (me->HealthBelowPctDamaged(33, damage) ||
59 me->HealthBelowPctDamaged(66, damage))
60 {
62 }
63 }
64
65 void JustDied(Unit* /*killer*/) OVERRIDE
66 {
67 _JustDied();
68 instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
69 }
70
72 {
73 if (!UpdateVictim())
74 return;
75
76 events.Update(diff);
77
78 if (me->HasUnitState(UNIT_STATE_CASTING))
79 return;
80
81 while (uint32 eventId = events.ExecuteEvent())
82 {
83 switch (eventId)
84 {
87 events.ScheduleEvent(EVENT_METEOR_SLASH, std::rand() % (20 * IN_MILLISECONDS) + (15 * IN_MILLISECONDS));
88 break;
91 events.ScheduleEvent(EVENT_CONSUMING_DARKNESS, std::rand() % (25 * IN_MILLISECONDS) + (20 * IN_MILLISECONDS));
92 break;
93 case EVENT_BERSERK:
94 DoCast(me, SPELL_BERSERK, true);
95 break;
96 default:
97 break;
98 }
99 }
100
102 }
103 };
104
106 {
108 }
109};
110
111// 88954 / 95173 - Consuming Darkness
137
138// 88942 / 95172 - Meteor Slash
182
@ IN_MILLISECONDS
Definition Common.h:125
@ MINUTE
Definition Common.h:119
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ ENCOUNTER_FRAME_DISENGAGE
@ ENCOUNTER_FRAME_ENGAGE
@ EFFECT_0
@ TARGET_UNIT_CONE_ENEMY_104
@ TARGET_UNIT_SRC_AREA_ENEMY
#define SpellObjectAreaTargetSelectFn(F, I, N)
#define SpellHitFn(F)
@ UNIT_STATE_CASTING
Definition Unit.h:527
CreatureAI * GetBaradinHoldAI(Creature *creature)
@ DATA_ARGALOTH
#define SPELL_BERSERK
@ EVENT_BERSERK
@ SPELL_CONSUMING_DARKNESS
@ SPELL_FEL_FIRESTORM
void AddSC_boss_pit_lord_argaloth()
@ EVENT_CONSUMING_DARKNESS
InstanceScript *const instance
void _DespawnAtEvade()
EventMap events
BossAI(Creature *creature, uint32 bossId)
void _EnterCombat()
bool UpdateVictim()
CreatureScript(const char *name)
HookList< HitHandler > OnHit
void SetHitDamage(int32 damage)
Unit * GetCaster()
HookList< ObjectAreaTargetSelectHandler > OnObjectAreaTargetSelect
int32 GetHitDamage()
SpellScriptLoader(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
void DoCastAOE(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:176
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
SpellScript * GetSpellScript() const OVERRIDE
PrepareSpellScript(spell_argaloth_meteor_slash_SpellScript)
SpellScript * GetSpellScript() const OVERRIDE
void RandomResizeList(std::list< T > &list, uint32 size)
Definition Containers.h:19
Creature * me
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void DamageTaken(Unit *, uint32 &damage) OVERRIDE