Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
instance_vault_of_archavon.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 "InstanceScript.h"
8#include "vault_of_archavon.h"
9
10/* Vault of Archavon encounters:
111 - Archavon the Stone Watcher event
122 - Emalon the Storm Watcher event
133 - Koralon the Flame Watcher event
144 - Toravon the Ice Watcher event
15*/
16
18{
19 public:
20 instance_vault_of_archavon() : InstanceMapScript("instance_vault_of_archavon", 624) { }
21
23 {
34
36 {
37 switch (creature->GetEntry())
38 {
39 case NPC_EMALON:
40 EmalonGUID = creature->GetGUID();
41 break;
42 case NPC_TORAVON:
43 ToravonGUID = creature->GetGUID();
44 break;
45 default:
46 break;
47 }
48 }
49
50 uint64 GetData64(uint32 identifier) const OVERRIDE
51 {
52 switch (identifier)
53 {
54 case DATA_EMALON:
55 return EmalonGUID;
56 case DATA_TORAVON:
57 return ToravonGUID;
58 default:
59 break;
60 }
61
62 return 0;
63 }
64
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:
76 ArchavonDeath = time(NULL);
77 break;
78 case DATA_EMALON:
79 EmalonDeath = time(NULL);
80 break;
81 case DATA_KORALON:
82 KoralonDeath = time(NULL);
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:
122 };
123
128};
129
@ MINUTE
Definition Common.h:119
std::uint32_t uint32
Definition Define.h:77
#define OVERRIDE
Definition Define.h:60
std::uint64_t uint64
Definition Define.h:76
EncounterState
@ DONE
uint32 const EncounterCount
InstanceMapScript(const char *name, uint32 mapId)
InstanceScript(Map *map)
void SetBossNumber(uint32 number)
virtual bool SetBossState(uint32 id, EncounterState state)
void DoCastSpellOnPlayers(uint32 spell)
Definition Map.h:238
Definition Unit.h:1367
InstanceScript * GetInstanceScript(InstanceMap *map) const OVERRIDE
void AddSC_instance_vault_of_archavon()
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const *, Unit const *, uint32) OVERRIDE
@ CRITERIA_EARTH_WIND_FIRE_25
@ CRITERIA_EARTH_WIND_FIRE_10
@ SPELL_EARTH_WIND_FIRE_ACHIEVEMENT_CHECK
@ NPC_TORAVON
@ NPC_EMALON
@ DATA_ARCHAVON
@ DATA_KORALON
@ DATA_EMALON
@ DATA_TORAVON