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
37
38static constexpr DungeonEncounterData encounters[] =
39{
40 { NPC_ARCHAVON, {{ 1126 }} },
41 { NPC_EMALON, {{ 1127 }} },
42 { NPC_KORALON, {{ 1128 }} },
43 { NPC_TORAVON, {{ 1129 }} }
44};
45
47{
48 public:
50
52 {
64
65 bool SetBossState(uint32 type, EncounterState state) override
66 {
67 if (!InstanceScript::SetBossState(type, state))
68 return false;
69
70 if (state != DONE)
71 return true;
72
73 switch (type)
74 {
75 case DATA_ARCHAVON:
77 break;
78 case DATA_EMALON:
80 break;
81 case DATA_KORALON:
83 break;
84 default:
85 return true;
86 }
87
88 // on every death of Archavon, Emalon and Koralon check our achievement
90
91 return true;
92 }
93
94 bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/, uint32 /*miscvalue1*/) override
95 {
96 switch (criteria_id)
97 {
101 {
102 // instance difficulty check is already done in db (achievement_criteria_data)
103 // int() for Visual Studio, compile errors with abs(time_t)
104 return (abs(int(ArchavonDeath-EmalonDeath)) < MINUTE && \
105 abs(int(EmalonDeath-KoralonDeath)) < MINUTE && \
106 abs(int(KoralonDeath-ArchavonDeath)) < MINUTE);
107 }
108 break;
109 default:
110 break;
111 }
112
113 return false;
114 }
115
116 private:
120 };
121
123 {
125 }
126};
127
@ MINUTE
Definition Common.h:32
uint32_t uint32
Definition Define.h:154
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 LoadObjectData(std::span< ObjectData const > creatureData, std::span< ObjectData const > gameObjectData)
void SetHeaders(std::string_view dataHeaders)
void LoadDungeonEncounterData(std::span< DungeonEncounterData const > encounters)
Definition Unit.h:635
InstanceScript * GetInstanceScript(InstanceMap *map) const override
static constexpr ObjectData creatureData[]
static constexpr DungeonEncounterData encounters[]
void AddSC_instance_vault_of_archavon()
time_t GetGameTime()
Definition GameTime.cpp:52
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