Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_galvangar.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
17
19{
22};
23
25{
26public:
27 boss_galvangar() : CreatureScript("boss_galvangar") { }
28
30 {
31 boss_galvangarAI(Creature* creature) : ScriptedAI(creature) { }
32
39
41 {
42 CleaveTimer = std::rand() % (9* IN_MILLISECONDS) + (1 * IN_MILLISECONDS);
43 FrighteningShoutTimer = std::rand() % (19 * IN_MILLISECONDS) + (2 * IN_MILLISECONDS);
44 Whirlwind1Timer = std::rand() % (13 * IN_MILLISECONDS) + (1 * IN_MILLISECONDS);
45 Whirlwind2Timer = std::rand() % (20 * IN_MILLISECONDS) + (5 * IN_MILLISECONDS);
46 MortalStrikeTimer = std::rand() % (20 * IN_MILLISECONDS) + (5 * IN_MILLISECONDS);
48 }
49
50 void EnterCombat(Unit* /*who*/) OVERRIDE
51 {
53 }
54
56 {
57 Reset();
58 }
59
61 {
62 if (!UpdateVictim())
63 return;
64
65 if (CleaveTimer <= diff)
66 {
68 CleaveTimer = std::rand() % (16 * IN_MILLISECONDS) + (10 * IN_MILLISECONDS);
69 } else CleaveTimer -= diff;
70
71 if (FrighteningShoutTimer <= diff)
72 {
74 FrighteningShoutTimer = std::rand() % (15 * IN_MILLISECONDS) + (10 * IN_MILLISECONDS);
75 } else FrighteningShoutTimer -= diff;
76
77 if (Whirlwind1Timer <= diff)
78 {
80 Whirlwind1Timer = std::rand() % (10 * IN_MILLISECONDS) + (6 * IN_MILLISECONDS);
81 } else Whirlwind1Timer -= diff;
82
83 if (Whirlwind2Timer <= diff)
84 {
86 Whirlwind2Timer = std::rand() % (25 * IN_MILLISECONDS) + (10 * IN_MILLISECONDS);
87 } else Whirlwind2Timer -= diff;
88
89 if (MortalStrikeTimer <= diff)
90 {
92 MortalStrikeTimer = std::rand() % (30 * IN_MILLISECONDS) + (10 * IN_MILLISECONDS);
93 } else MortalStrikeTimer -= diff;
94
95 // check if creature is not outside of building
96 if (ResetTimer <= diff)
97 {
98 if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
99 {
102 }
104 } else ResetTimer -= diff;
105
107 }
108 };
109
111 {
112 return new boss_galvangarAI(creature);
113 }
114};
115
117{
118 new boss_galvangar;
119}
@ IN_MILLISECONDS
Definition Common.h:125
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ SPELL_CLEAVE
@ YELL_EVADE
@ YELL_AGGRO
@ SPELL_WHIRLWIND2
@ YELL_EVADE
@ YELL_AGGRO
void AddSC_boss_galvangar()
@ SPELL_CLEAVE
@ SPELL_MORTAL_STRIKE
@ SPELL_FRIGHTENING_SHOUT
@ SPELL_WHIRLWIND2
@ SPELL_WHIRLWIND1
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)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void EnterCombat(Unit *) OVERRIDE