mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 02:50:29 +00:00
feat(Core/Scripting): implement OnlyOnceAreaTrigger & Zul'Gurub's in… (#8850)
Co-authored-by: Treeston <treeston.mmoc@gmail.com>
This commit is contained in:
@@ -24,6 +24,7 @@ Category: Zul'Gurub
|
||||
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "Player.h"
|
||||
#include "zulgurub.h"
|
||||
|
||||
enum Says
|
||||
@@ -175,7 +176,35 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class at_zulgurub_entrance_speech : public OnlyOnceAreaTriggerScript
|
||||
{
|
||||
public:
|
||||
at_zulgurub_entrance_speech() : OnlyOnceAreaTriggerScript("at_zulgurub_entrance_speech") {}
|
||||
|
||||
bool _OnTrigger(Player* player, const AreaTrigger* /*at*/) override
|
||||
{
|
||||
if (InstanceScript* instance = player->GetInstanceScript())
|
||||
{
|
||||
// Instance map's enormous, Hakkar's GRID is not loaded by the time players enter.
|
||||
// Without this, the creature never says anything, because it doesn't load in time.
|
||||
player->GetMap()->LoadGrid(-11783.99f, -1655.27f);
|
||||
|
||||
if (Creature* hakkar = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_HAKKAR)))
|
||||
{
|
||||
hakkar->setActive(true);
|
||||
if (hakkar->GetAI())
|
||||
{
|
||||
hakkar->AI()->Talk(SAY_PROTECT_ALTAR);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_hakkar()
|
||||
{
|
||||
new boss_hakkar();
|
||||
new at_zulgurub_entrance_speech();
|
||||
}
|
||||
|
||||
@@ -73,6 +73,9 @@ public:
|
||||
case NPC_ARLOKK:
|
||||
_arlokkGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_HAKKAR:
|
||||
_hakkarGUID = creature->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,6 +126,8 @@ public:
|
||||
return _arlokkGUID;
|
||||
case GO_GONG_OF_BETHEKK:
|
||||
return _goGongOfBethekkGUID;
|
||||
case DATA_HAKKAR:
|
||||
return _hakkarGUID;
|
||||
}
|
||||
|
||||
return ObjectGuid::Empty;
|
||||
@@ -181,6 +186,7 @@ public:
|
||||
ObjectGuid _vilebranchSpeakerGUID;
|
||||
ObjectGuid _arlokkGUID;
|
||||
ObjectGuid _goGongOfBethekkGUID;
|
||||
ObjectGuid _hakkarGUID;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const override
|
||||
|
||||
@@ -57,7 +57,8 @@ enum CreatureIds
|
||||
NPC_MANDOKIR = 11382, // Mandokir Event
|
||||
NPC_OHGAN = 14988, // Mandokir Event
|
||||
NPC_VILEBRANCH_SPEAKER = 11391, // Mandokir Event
|
||||
NPC_CHAINED_SPIRT = 15117 // Mandokir Event
|
||||
NPC_CHAINED_SPIRT = 15117, // Mandokir Event
|
||||
NPC_HAKKAR = 14834
|
||||
};
|
||||
|
||||
enum GameobjectIds
|
||||
|
||||
Reference in New Issue
Block a user