diff options
| author | jackpoz <giacomopoz@gmail.com> | 2014-09-25 22:28:20 +0200 |
|---|---|---|
| committer | jackpoz <giacomopoz@gmail.com> | 2014-09-25 22:28:20 +0200 |
| commit | 79b9ca4a58175bcbfe859446dbb36ba4b30216b9 (patch) | |
| tree | d423f9e3af5bf47966f14d250347d969d337f555 /src/server/scripts/EasternKingdoms | |
| parent | 16a884d999d17290955f3c2721b78a13c8795293 (diff) | |
Scripts/Misc: Make InstanceScript::Initialize() obsolete
Move all InstanceScript initialization code from Initialize() to the constructor.
InstanceScript::Initialize() is now obsolete, please don't use it anymore. The only reason it's still in the sources is for backward compatibility.
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
10 files changed, 63 insertions, 98 deletions
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp index 22999c221dd..46cdd5edc7d 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp @@ -76,7 +76,16 @@ public: struct instance_blackrock_depths_InstanceMapScript : public InstanceScript { - instance_blackrock_depths_InstanceMapScript(Map* map) : InstanceScript(map) { } + instance_blackrock_depths_InstanceMapScript(Map* map) : InstanceScript(map) + { + SetHeaders(DataHeader); + memset(&encounter, 0, sizeof(encounter)); + + BarAleCount = 0; + GhostKillCount = 0; + TombTimer = TIMER_TOMBOFTHESEVEN; + TombEventCounter = 0; + } uint32 encounter[MAX_ENCOUNTER]; std::string str_data; @@ -115,17 +124,6 @@ public: uint32 TombTimer; uint32 TombEventCounter; - void Initialize() override - { - SetHeaders(DataHeader); - memset(&encounter, 0, sizeof(encounter)); - - BarAleCount = 0; - GhostKillCount = 0; - TombTimer = TIMER_TOMBOFTHESEVEN; - TombEventCounter = 0; - } - void OnCreatureCreate(Creature* creature) override { switch (creature->GetEntry()) diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp index bae3f1b9b5c..20e04ed1b91 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp @@ -63,13 +63,6 @@ public: SetBossNumber(EncounterCount); } - void Initialize() override - { - // Razorgore - EggCount = 0; - EggEvent = 0; - } - void OnCreatureCreate(Creature* creature) override { switch (creature->GetEntry()) diff --git a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp index d7667b37e87..d4e32d8e908 100644 --- a/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp +++ b/src/server/scripts/EasternKingdoms/Deadmines/instance_deadmines.cpp @@ -56,7 +56,12 @@ class instance_deadmines : public InstanceMapScript struct instance_deadmines_InstanceMapScript : public InstanceScript { - instance_deadmines_InstanceMapScript(Map* map) : InstanceScript(map) { } + instance_deadmines_InstanceMapScript(Map* map) : InstanceScript(map) + { + SetHeaders(DataHeader); + + State = CANNON_NOT_USED; + } ObjectGuid FactoryDoorGUID; ObjectGuid IronCladDoorGUID; @@ -71,13 +76,6 @@ class instance_deadmines : public InstanceMapScript uint32 PiratesDelay_Timer; ObjectGuid uiSmiteChestGUID; - void Initialize() override - { - SetHeaders(DataHeader); - - State = CANNON_NOT_USED; - } - virtual void Update(uint32 diff) override { if (!IronCladDoorGUID || !DefiasCannonGUID || !DoorLeverGUID) diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp index 9cd6afaca78..958126610f9 100644 --- a/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp +++ b/src/server/scripts/EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp @@ -37,6 +37,7 @@ public: instance_gnomeregan_InstanceMapScript(Map* map) : InstanceScript(map) { SetHeaders(DataHeader); + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); } uint32 m_auiEncounter[MAX_ENCOUNTER]; @@ -46,11 +47,6 @@ public: ObjectGuid uiBastmasterEmiShortfuseGUID; - void Initialize() override - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - } - void Load(const char* in) override { if (!in) diff --git a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp index 0d639df731a..a294611babf 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp @@ -56,7 +56,15 @@ public: struct instance_karazhan_InstanceMapScript : public InstanceScript { - instance_karazhan_InstanceMapScript(Map* map) : InstanceScript(map) { } + instance_karazhan_InstanceMapScript(Map* map) : InstanceScript(map) + { + SetHeaders(DataHeader); + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + // 1 - OZ, 2 - HOOD, 3 - RAJ, this never gets altered. + m_uiOperaEvent = urand(1, 3); + m_uiOzDeathCount = 0; + } uint32 m_auiEncounter[MAX_ENCOUNTER]; std::string strSaveData; @@ -80,16 +88,6 @@ public: ObjectGuid ImageGUID; ObjectGuid DustCoveredChest; - void Initialize() override - { - SetHeaders(DataHeader); - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - // 1 - OZ, 2 - HOOD, 3 - RAJ, this never gets altered. - m_uiOperaEvent = urand(1, 3); - m_uiOzDeathCount = 0; - } - bool IsEncounterInProgress() const override { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp index ae8cb74ea49..3379882ce28 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp @@ -78,7 +78,14 @@ public: struct instance_shadowfang_keep_InstanceMapScript : public InstanceScript { - instance_shadowfang_keep_InstanceMapScript(Map* map) : InstanceScript(map) { } + instance_shadowfang_keep_InstanceMapScript(Map* map) : InstanceScript(map) + { + SetHeaders(DataHeader); + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + uiPhase = 0; + uiTimer = 0; + } uint32 m_auiEncounter[MAX_ENCOUNTER]; std::string str_data; @@ -94,15 +101,6 @@ public: uint8 uiPhase; uint16 uiTimer; - void Initialize() override - { - SetHeaders(DataHeader); - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - uiPhase = 0; - uiTimer = 0; - } - void OnCreatureCreate(Creature* creature) override { switch (creature->GetEntry()) diff --git a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp index 927ca0b19ac..699b61ed216 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp @@ -50,6 +50,11 @@ class instance_stratholme : public InstanceMapScript instance_stratholme_InstanceMapScript(Map* map) : InstanceScript(map) { SetHeaders(DataHeader); + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + EncounterState[i] = NOT_STARTED; + + for (uint8 i = 0; i < 5; ++i) + IsSilverHandDead[i] = false; } uint32 EncounterState[MAX_ENCOUNTER]; @@ -73,18 +78,6 @@ class instance_stratholme : public InstanceMapScript GuidSet abomnationGUID; EventMap events; - void Initialize() override - { - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - EncounterState[i] = NOT_STARTED; - - for (uint8 i = 0; i < 5; ++i) - IsSilverHandDead[i] = false; - - crystalsGUID.clear(); - abomnationGUID.clear(); - } - bool StartSlaugtherSquare() { //change to DONE when crystals implemented diff --git a/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp index 194f5790f44..bc3980d6420 100644 --- a/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp +++ b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp @@ -61,6 +61,14 @@ public: instance_sunken_temple_InstanceMapScript(Map* map) : InstanceScript(map) { SetHeaders(DataHeader); + State = 0; + + s1 = false; + s2 = false; + s3 = false; + s4 = false; + s5 = false; + s6 = false; } ObjectGuid GOAtalaiStatue1; @@ -80,19 +88,6 @@ public: bool s5; bool s6; - void Initialize() override - { - - State = 0; - - s1 = false; - s2 = false; - s3 = false; - s4 = false; - s5 = false; - s6 = false; - } - void OnGameObjectCreate(GameObject* go) override { switch (go->GetEntry()) diff --git a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp index 956f7099596..c6c190dd962 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/instance_uldaman.cpp @@ -45,9 +45,7 @@ class instance_uldaman : public InstanceMapScript struct instance_uldaman_InstanceMapScript : public InstanceScript { - instance_uldaman_InstanceMapScript(Map* map) : InstanceScript(map) { } - - void Initialize() override + instance_uldaman_InstanceMapScript(Map* map) : InstanceScript(map) { SetHeaders(DataHeader); memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp index 72bd8446972..122e19f217b 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp @@ -66,7 +66,21 @@ class instance_zulaman : public InstanceMapScript struct instance_zulaman_InstanceMapScript : public InstanceScript { - instance_zulaman_InstanceMapScript(Map* map) : InstanceScript(map) { } + instance_zulaman_InstanceMapScript(Map* map) : InstanceScript(map) + { + SetHeaders(DataHeader); + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + QuestTimer = 0; + QuestMinute = 0; + BossKilled = 0; + ChestLooted = 0; + + for (uint8 i = 0; i < RAND_VENDOR; ++i) + RandVendor[i] = NOT_STARTED; + + m_auiEncounter[DATA_GONGEVENT] = NOT_STARTED; + } ObjectGuid HarkorsSatchelGUID; ObjectGuid TanzarsTrunkGUID; @@ -90,22 +104,6 @@ class instance_zulaman : public InstanceMapScript uint32 m_auiEncounter[MAX_ENCOUNTER]; uint32 RandVendor[RAND_VENDOR]; - void Initialize() override - { - SetHeaders(DataHeader); - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - QuestTimer = 0; - QuestMinute = 0; - BossKilled = 0; - ChestLooted = 0; - - for (uint8 i = 0; i < RAND_VENDOR; ++i) - RandVendor[i] = NOT_STARTED; - - m_auiEncounter[DATA_GONGEVENT] = NOT_STARTED; - } - bool IsEncounterInProgress() const override { for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) |
