TrinityCore
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 { NPC_ARCHAVON, {{ 1126 }} },
42 { NPC_EMALON, {{ 1127 }} },
43 { NPC_KORALON, {{ 1128 }} },
44 { NPC_TORAVON, {{ 1129 }} }
45};
46
48{
49 public:
51
53 {
55 {
60
61 ArchavonDeath = 0;
62 EmalonDeath = 0;
63 KoralonDeath = 0;
64 }
65
66 bool SetBossState(uint32 type, EncounterState state) override
67 {
68 if (!InstanceScript::SetBossState(type, state))
69 return false;
70
71 if (state != DONE)
72 return true;
73
74 switch (type)
75 {
76 case DATA_ARCHAVON:
78 break;
79 case DATA_EMALON:
81 break;
82 case DATA_KORALON:
84 break;
85 default:
86 return true;
87 }
88
89 // on every death of Archavon, Emalon and Koralon check our achievement
91
92 return true;
93 }
94
95 bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/, uint32 /*miscvalue1*/) override
96 {
97 switch (criteria_id)
98 {
102 {
103 // instance difficulty check is already done in db (achievement_criteria_data)
104 // int() for Visual Studio, compile errors with abs(time_t)
105 return (abs(int(ArchavonDeath-EmalonDeath)) < MINUTE && \
106 abs(int(EmalonDeath-KoralonDeath)) < MINUTE && \
107 abs(int(KoralonDeath-ArchavonDeath)) < MINUTE);
108 }
109 break;
110 default:
111 break;
112 }
113
114 return false;
115 }
116
117 private:
121 };
122
124 {
126 }
127};
128
130{
132}
@ MINUTE
Definition: Common.h:29
uint32_t uint32
Definition: Define.h:142
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 LoadDungeonEncounterData(T const &encounters)
void SetHeaders(std::string const &dataHeaders)
void LoadObjectData(ObjectData const *creatureData, ObjectData const *gameObjectData)
Definition: Unit.h:627
InstanceScript * GetInstanceScript(InstanceMap *map) const override
ObjectData const creatureData[]
DungeonEncounterData const encounters[]
void AddSC_instance_vault_of_archavon()
time_t GetGameTime()
Definition: GameTime.cpp:44
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