Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_drekthar.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
10{
15 SPELL_SWEEPING_STRIKES = 18765, // not sure
16 SPELL_CLEAVE = 20677, // not sure
17 SPELL_WINDFURY = 35886, // not sure
18 SPELL_STORMPIKE = 51876 // not sure
19};
20
28
30{
31public:
32 boss_drekthar() : CreatureScript("boss_drekthar") { }
33
35 {
36 boss_drektharAI(Creature* creature) : ScriptedAI(creature) { }
37
44
46 {
47 WhirlwindTimer = std::rand() % (20 * IN_MILLISECONDS) + (1 * IN_MILLISECONDS);
48 Whirlwind2Timer = std::rand() % (20 * IN_MILLISECONDS) + (1 * IN_MILLISECONDS) ;
52 YellTimer = std::rand() % (30 * IN_MILLISECONDS) + (20 * IN_MILLISECONDS); //20 to 30 seconds
53 }
54
55 void EnterCombat(Unit* /*who*/) OVERRIDE
56 {
58 }
59
61 {
62 Reset();
64 }
65
67 {
68 if (!UpdateVictim())
69 return;
70
71 if (WhirlwindTimer <= diff)
72 {
74 WhirlwindTimer = std::rand() % (18 * IN_MILLISECONDS) + (8 * IN_MILLISECONDS);
75 } else WhirlwindTimer -= diff;
76
77 if (Whirlwind2Timer <= diff)
78 {
80 Whirlwind2Timer = std::rand() % (25 * IN_MILLISECONDS) + (7 * IN_MILLISECONDS);
81 } else Whirlwind2Timer -= diff;
82
83 if (KnockdownTimer <= diff)
84 {
86 KnockdownTimer = std::rand() % (15 * IN_MILLISECONDS) + (10 * IN_MILLISECONDS);
87 } else KnockdownTimer -= diff;
88
89 if (FrenzyTimer <= diff)
90 {
92 FrenzyTimer = std::rand() % (30 * IN_MILLISECONDS) + (20 * IN_MILLISECONDS);
93 } else FrenzyTimer -= diff;
94
95 if (YellTimer <= diff)
96 {
98 YellTimer = std::rand() % (30 * IN_MILLISECONDS) + (20 * IN_MILLISECONDS); //20 to 30 seconds
99 } else YellTimer -= diff;
100
101 // check if creature is not outside of building
102 if (ResetTimer <= diff)
103 {
104 if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
105 {
108 }
110 } else ResetTimer -= diff;
111
113 }
114 };
115
117 {
118 return new boss_drektharAI(creature);
119 }
120};
121
123{
124 new boss_drekthar;
125}
@ IN_MILLISECONDS
Definition Common.h:125
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ SPELL_CLEAVE
@ SPELL_WHIRLWIND
@ YELL_EVADE
@ YELL_AGGRO
void AddSC_boss_drekthar()
@ YELL_RANDOM
@ YELL_EVADE
@ YELL_AGGRO
@ YELL_RESPAWN
@ SPELL_WINDFURY
@ SPELL_STORMPIKE
@ SPELL_WHIRLWIND2
@ SPELL_FRENZY
@ SPELL_SWEEPING_STRIKES
@ SPELL_KNOCKDOWN
@ SPELL_WHIRLWIND
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool UpdateVictim()
virtual void EnterEvadeMode()
CreatureScript(const char *name)
void DoMeleeAttackIfReady()
Definition UnitAI.cpp:28
void DoCastVictim(uint32 spellId, bool triggered=false)
Definition UnitAI.cpp:168
Definition Unit.h:1367
CreatureAI * GetAI(Creature *creature) const OVERRIDE
Creature * me
ScriptedAI(Creature *creature)
boss_drektharAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void EnterCombat(Unit *) OVERRIDE