aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoroffl <11556157+offl@users.noreply.github.com>2021-04-15 15:16:49 +0300
committerShauren <shauren.trinity@gmail.com>2022-03-08 22:31:43 +0100
commitfe8becd2a074ce852e37aa0f1782d081dbabccc9 (patch)
treeb54b92ada5531ce8137e09942588dfde918cfaa1 /src
parenta6e074c36c9cb4d37ba53fe176eda6733d1d1dd3 (diff)
Scripts/Gundrak: Preparing for updating to new model (#26413)
Co-authored-by: offl <offl@users.noreply.github.com> (cherry picked from commit 0cf18bcb221d68b2e2b9657b9b5803e49937f9a7)
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp6
-rw-r--r--src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp6
-rw-r--r--src/server/scripts/Northrend/Gundrak/gundrak.h3
-rw-r--r--src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp33
4 files changed, 20 insertions, 28 deletions
diff --git a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp
index 336e7f30dd3..cef349cb430 100644
--- a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp
+++ b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp
@@ -446,7 +446,7 @@ private:
void AddSC_boss_drakkari_colossus()
{
- RegisterCreatureAIWithFactory(boss_drakkari_colossus, GetGundrakAI);
- RegisterCreatureAIWithFactory(boss_drakkari_elemental, GetGundrakAI);
- RegisterCreatureAIWithFactory(npc_living_mojo, GetGundrakAI);
+ RegisterGundrakCreatureAI(boss_drakkari_colossus);
+ RegisterGundrakCreatureAI(boss_drakkari_elemental);
+ RegisterGundrakCreatureAI(npc_living_mojo);
}
diff --git a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp
index 0d126ae1fbd..d8220e4a6c4 100644
--- a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp
+++ b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp
@@ -299,8 +299,8 @@ class achievement_snakes_whyd_it_have_to_be_snakes : public AchievementCriteriaS
void AddSC_boss_slad_ran()
{
- RegisterCreatureAIWithFactory(boss_slad_ran, GetGundrakAI);
- RegisterCreatureAIWithFactory(npc_slad_ran_constrictor, GetGundrakAI);
- RegisterCreatureAIWithFactory(npc_slad_ran_viper, GetGundrakAI);
+ RegisterGundrakCreatureAI(boss_slad_ran);
+ RegisterGundrakCreatureAI(npc_slad_ran_constrictor);
+ RegisterGundrakCreatureAI(npc_slad_ran_viper);
new achievement_snakes_whyd_it_have_to_be_snakes();
}
diff --git a/src/server/scripts/Northrend/Gundrak/gundrak.h b/src/server/scripts/Northrend/Gundrak/gundrak.h
index 4e1e51c3ccd..c4ddb3c07ab 100644
--- a/src/server/scripts/Northrend/Gundrak/gundrak.h
+++ b/src/server/scripts/Northrend/Gundrak/gundrak.h
@@ -96,4 +96,7 @@ inline AI* GetGundrakAI(T* obj)
return GetInstanceAI<AI>(obj, GundrakScriptName);
}
+#define RegisterGundrakCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetGundrakAI)
+#define RegisterGundrakGameObjectAI(ai_name) RegisterGameObjectAIWithFactory(ai_name, GetGundrakAI)
+
#endif // GUNDRAK_H_
diff --git a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp
index 285e04fc15b..42800babb12 100644
--- a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp
+++ b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp
@@ -349,35 +349,24 @@ class instance_gundrak : public InstanceMapScript
}
};
-class go_gundrak_altar : public GameObjectScript
+struct go_gundrak_altar : public GameObjectAI
{
- public:
- go_gundrak_altar() : GameObjectScript("go_gundrak_altar") { }
-
- struct go_gundrak_altarAI : public GameObjectAI
- {
- go_gundrak_altarAI(GameObject* go) : GameObjectAI(go), instance(go->GetInstanceScript()) { }
+ go_gundrak_altar(GameObject* go) : GameObjectAI(go), instance(go->GetInstanceScript()) { }
- InstanceScript* instance;
-
- bool OnGossipHello(Player* /*player*/) override
- {
- me->AddFlag(GO_FLAG_NOT_SELECTABLE);
- me->SetGoState(GO_STATE_ACTIVE);
+ InstanceScript* instance;
- instance->SetData(DATA_STATUE_ACTIVATE, me->GetEntry());
- return true;
- }
- };
+ bool OnGossipHello(Player* /*player*/) override
+ {
+ me->AddFlag(GO_FLAG_NOT_SELECTABLE);
+ me->SetGoState(GO_STATE_ACTIVE);
- GameObjectAI* GetAI(GameObject* go) const override
- {
- return GetGundrakAI<go_gundrak_altarAI>(go);
- }
+ instance->SetData(DATA_STATUE_ACTIVATE, me->GetEntry());
+ return true;
+ }
};
void AddSC_instance_gundrak()
{
new instance_gundrak();
- new go_gundrak_altar();
+ RegisterGundrakGameObjectAI(go_gundrak_altar);
}