Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_overlord_wyrmthalak.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 "blackrock_spire.h"
9
11{
13 SPELL_SHOUT = 23511,
14 SPELL_CLEAVE = 20691,
16};
17
25
31
32const Position SummonLocation1 = { -39.355f, -513.456f, 88.472f, 4.679f };
33const Position SummonLocation2 = { -49.875f, -511.896f, 88.195f, 4.613f };
34
36{
37public:
38 boss_overlord_wyrmthalak() : CreatureScript("boss_overlord_wyrmthalak") { }
39
41 {
42 return new boss_overlordwyrmthalakAI(creature);
43 }
44
46 {
48
50
52 {
53 _Reset();
54 Summoned = false;
55 }
56
57 void EnterCombat(Unit* /*who*/) OVERRIDE
58 {
60 events.ScheduleEvent(EVENT_BLAST_WAVE, 20 * IN_MILLISECONDS);
61 events.ScheduleEvent(EVENT_SHOUT, 2 * IN_MILLISECONDS);
62 events.ScheduleEvent(EVENT_CLEAVE, 6 * IN_MILLISECONDS);
63 events.ScheduleEvent(EVENT_KNOCK_AWAY, 12 * IN_MILLISECONDS);
64 }
65
66 void JustDied(Unit* /*killer*/) OVERRIDE
67 {
68 _JustDied();
69 }
70
72 {
73 if (!UpdateVictim())
74 return;
75
76 if (!Summoned && HealthBelowPct(51))
77 {
78 if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
79 {
81 warlord->AI()->AttackStart(target);
83 berserker->AI()->AttackStart(target);
84 Summoned = true;
85 }
86 }
87
88 events.Update(diff);
89
90 if (me->HasUnitState(UNIT_STATE_CASTING))
91 return;
92
93 while (uint32 eventId = events.ExecuteEvent())
94 {
95 switch (eventId)
96 {
99 events.ScheduleEvent(EVENT_BLAST_WAVE, 20 * IN_MILLISECONDS);
100 break;
101 case EVENT_SHOUT:
103 events.ScheduleEvent(EVENT_SHOUT, 10 * IN_MILLISECONDS);
104 break;
105 case EVENT_CLEAVE:
107 events.ScheduleEvent(EVENT_CLEAVE, 7 * IN_MILLISECONDS);
108 break;
109 case EVENT_KNOCK_AWAY:
111 events.ScheduleEvent(EVENT_KNOCK_AWAY, 14 * IN_MILLISECONDS);
112 break;
113 }
114 }
116 }
117 };
118};
119
@ IN_MILLISECONDS
Definition Common.h:125
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ TEMPSUMMON_TIMED_DESPAWN
Definition Object.h:70
@ UNIT_STATE_CASTING
Definition Unit.h:527
@ SELECT_TARGET_RANDOM
Definition UnitAI.h:23
@ SPELL_CLEAVE
@ EVENT_CLEAVE
@ DATA_OVERLORD_WYRMTHALAK
@ EVENT_KNOCK_AWAY
Definition boss_gyth.cpp:32
@ NPC_SMOLDERTHORN_BERSERKER
const Position SummonLocation2
void AddSC_boss_overlordwyrmthalak()
const Position SummonLocation1
EventMap events
BossAI(Creature *creature, uint32 bossId)
void _EnterCombat()
bool UpdateVictim()
CreatureScript(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
Definition UnitAI.cpp:66
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Creature * me
bool HealthBelowPct(uint32 pct) const
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================