Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
boss_vanndar.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
9enum Yells
10{
13 //YELL_RESPAWN1 = -1810010, // Missing in database
14 //YELL_RESPAWN2 = -1810011, // Missing in database
17};
18
20{
21 SPELL_AVATAR = 19135,
23 SPELL_STORMBOLT = 20685 // not sure
24};
25
27{
28public:
29 boss_vanndar() : CreatureScript("boss_vanndar") { }
30
31 struct boss_vanndarAI : public ScriptedAI
32 {
33 boss_vanndarAI(Creature* creature) : ScriptedAI(creature) { }
34
40
49
50 void EnterCombat(Unit* /*who*/) OVERRIDE
51 {
53 }
54
56 {
57 if (!UpdateVictim())
58 return;
59
60 if (AvatarTimer <= diff)
61 {
63 AvatarTimer = std::rand() % (20 * IN_MILLISECONDS) + (15 * IN_MILLISECONDS);
64 } else AvatarTimer -= diff;
65
66 if (ThunderclapTimer <= diff)
67 {
69 ThunderclapTimer = std::rand() % (15 * IN_MILLISECONDS) + (5 * IN_MILLISECONDS);
70 } else ThunderclapTimer -= diff;
71
72 if (StormboltTimer <= diff)
73 {
75 StormboltTimer = std::rand() % (25 * IN_MILLISECONDS) + (10 * IN_MILLISECONDS);
76 } else StormboltTimer -= diff;
77
78 if (YellTimer <= diff)
79 {
81 YellTimer = std::rand() % (30 * IN_MILLISECONDS) + (20 * IN_MILLISECONDS); //20 to 30 seconds
82 } else YellTimer -= diff;
83
84 // check if creature is not outside of building
85 if (ResetTimer <= diff)
86 {
87 if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
88 {
91 }
93 } else ResetTimer -= diff;
94
96 }
97 };
98
100 {
101 return new boss_vanndarAI(creature);
102 }
103};
104
106{
107 new boss_vanndar;
108}
@ IN_MILLISECONDS
Definition Common.h:125
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
@ YELL_EVADE
@ YELL_AGGRO
@ YELL_RANDOM
@ YELL_RANDOM
@ YELL_EVADE
@ YELL_SPELL
@ YELL_AGGRO
void AddSC_boss_vanndar()
@ SPELL_AVATAR
@ SPELL_THUNDERCLAP
@ SPELL_STORMBOLT
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 EnterCombat(Unit *) OVERRIDE
boss_vanndarAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================