Scripts/Gundrak: Preparing for updating to new model (#26413)

Co-authored-by: offl <offl@users.noreply.github.com>
(cherry picked from commit 0cf18bcb22)
This commit is contained in:
offl
2021-04-15 15:16:49 +03:00
committed by Shauren
parent a6e074c36c
commit fe8becd2a0
4 changed files with 20 additions and 28 deletions

View File

@@ -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);
}

View File

@@ -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();
}

View File

@@ -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_

View File

@@ -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") { }
go_gundrak_altar(GameObject* go) : GameObjectAI(go), instance(go->GetInstanceScript()) { }
struct go_gundrak_altarAI : public GameObjectAI
{
go_gundrak_altarAI(GameObject* go) : GameObjectAI(go), instance(go->GetInstanceScript()) { }
InstanceScript* instance;
InstanceScript* instance;
bool OnGossipHello(Player* /*player*/) override
{
me->AddFlag(GO_FLAG_NOT_SELECTABLE);
me->SetGoState(GO_STATE_ACTIVE);
bool OnGossipHello(Player* /*player*/) override
{
me->AddFlag(GO_FLAG_NOT_SELECTABLE);
me->SetGoState(GO_STATE_ACTIVE);
instance->SetData(DATA_STATUE_ACTIVATE, me->GetEntry());
return true;
}
};
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);
}