Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_blackheart_the_inciter.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/*
7Name: Boss_Blackheart_the_Inciter
8%Complete: 75
9Comment: Incite Chaos not functional since core lacks Mind Control support
10Category: Auchindoun, Shadow Labyrinth
11*/
12
13#include "ScriptMgr.h"
14#include "ScriptedCreature.h"
15#include "shadow_labyrinth.h"
16
18{
20 SPELL_INCITE_CHAOS_B = 33684, //debuff applied to each member of party
21 SPELL_CHARGE = 33709,
23
29
30 //below, not used
36};
37
44
46{
47 public:
48 boss_blackheart_the_inciter() : CreatureScript("boss_blackheart_the_inciter") { }
49
51 {
53
55 {
56 _Reset();
57 }
58
59 void EnterCombat(Unit* /*who*/) OVERRIDE
60 {
62 events.ScheduleEvent(EVENT_INCITE_CHAOS, 20000);
63 events.ScheduleEvent(EVENT_CHARGE_ATTACK, 5000);
64 events.ScheduleEvent(EVENT_WAR_STOMP, 15000);
65
67 }
68
70 {
71 if (who->GetTypeId() == TypeID::TYPEID_PLAYER)
73 }
74
75 void JustDied(Unit* /*killer*/) OVERRIDE
76 {
77 _JustDied();
79 }
80
82 {
83 if (!UpdateVictim())
84 return;
85
86 events.Update(diff);
87
88 if (me->HasUnitState(UNIT_STATE_CASTING))
89 return;
90
91 while (uint32 eventId = events.ExecuteEvent())
92 {
93 switch (eventId)
94 {
96 {
98
99 std::list<HostileReference*> t_list = me->getThreatManager().getThreatList();
100 for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
101 {
102 if (Unit* target = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid()))
103 if (target->GetTypeId() == TypeID::TYPEID_PLAYER)
104 me->CastSpell(target, SPELL_INCITE_CHAOS_B, true);
105 }
106
108 events.ScheduleEvent(EVENT_INCITE_CHAOS, 40000);
109 break;
110 }
112 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
113 DoCast(target, SPELL_CHARGE);
114 events.ScheduleEvent(EVENT_CHARGE, std::rand() % 25000 + 15000);
115 break;
116 case EVENT_WAR_STOMP:
118 events.ScheduleEvent(EVENT_WAR_STOMP, std::rand() % 24000 + 18000);
119 break;
120 }
121 }
122
124 }
125 };
126
128 {
130 }
131};
132
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ TYPEID_PLAYER
Definition Object.h:55
@ EVENT_CHARGE
@ UNIT_STATE_CASTING
Definition Unit.h:527
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ SPELL_CHARGE
@ SAY_SLAY
@ SAY_INTRO
void AddSC_boss_blackheart_the_inciter()
#define SAY_DEATH
#define SAY_AGGRO
EventMap events
BossAI(Creature *creature, uint32 bossId)
void _EnterCombat()
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
CreatureScript(const char *name)
static Unit * GetUnit(WorldObject const &, uint64 guid)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCast(uint32 spellId)
Definition UnitAI.cpp:110
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition UnitAI.cpp:66
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
AI * GetShadowLabyrinthAI(Creature *creature)
@ DATA_BLACKHEART_THE_INCITER
Creature * me
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================