TrinityCore
Loading...
Searching...
No Matches
instance_vault_of_archavon.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "ScriptMgr.h"
19#include "GameTime.h"
20#include "InstanceScript.h"
21#include "vault_of_archavon.h"
22
23/* Vault of Archavon encounters:
241 - Archavon the Stone Watcher event
252 - Emalon the Storm Watcher event
263 - Koralon the Flame Watcher event
274 - Toravon the Ice Watcher event
28*/
29
31{
36 { 0, 0, }
37};
38
40{
41 public:
43
45 {
56
57 bool SetBossState(uint32 type, EncounterState state) override
58 {
59 if (!InstanceScript::SetBossState(type, state))
60 return false;
61
62 if (state != DONE)
63 return true;
64
65 switch (type)
66 {
67 case DATA_ARCHAVON:
69 break;
70 case DATA_EMALON:
72 break;
73 case DATA_KORALON:
75 break;
76 default:
77 return true;
78 }
79
80 // on every death of Archavon, Emalon and Koralon check our achievement
82
83 return true;
84 }
85
86 bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/, uint32 /*miscvalue1*/) override
87 {
88 switch (criteria_id)
89 {
93 {
94 // instance difficulty check is already done in db (achievement_criteria_data)
95 // int() for Visual Studio, compile errors with abs(time_t)
96 return (abs(int(ArchavonDeath-EmalonDeath)) < MINUTE && \
97 abs(int(EmalonDeath-KoralonDeath)) < MINUTE && \
99 }
100 break;
101 default:
102 break;
103 }
104
105 return false;
106 }
107
108 private:
112 };
113
115 {
117 }
118};
119
@ MINUTE
Definition Common.h:29
uint32_t uint32
Definition Define.h:133
EncounterState
@ DONE
#define DataHeader
uint32 const EncounterCount
void SetBossNumber(uint32 number)
virtual bool SetBossState(uint32 id, EncounterState state)
void DoCastSpellOnPlayers(uint32 spell, bool includePets=false, bool includeControlled=false)
void SetHeaders(std::string const &dataHeaders)
void LoadObjectData(ObjectData const *creatureData, ObjectData const *gameObjectData)
Definition Unit.h:769
InstanceScript * GetInstanceScript(InstanceMap *map) const override
ObjectData const creatureData[]
void AddSC_instance_vault_of_archavon()
time_t GetGameTime()
Definition GameTime.cpp:42
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const *, Unit const *, uint32) override
#define VoAScriptName
@ SPELL_EARTH_WIND_FIRE_ACHIEVEMENT_CHECK
@ NPC_KORALON
@ NPC_TORAVON
@ NPC_EMALON
@ NPC_ARCHAVON
@ DATA_ARCHAVON
@ DATA_KORALON
@ DATA_EMALON
@ DATA_TORAVON
@ CRITERIA_EARTH_WIND_FIRE_25
@ CRITERIA_EARTH_WIND_FIRE_10