fix(Scripts/Gundrak): Eck should spawn when the Ruin Dweller formatio… (#23114)

This commit is contained in:
Andrew
2025-10-06 12:40:29 -03:00
committed by GitHub
parent 4572003eb1
commit 1159076146
3 changed files with 41 additions and 17 deletions

View File

@@ -30,16 +30,21 @@ enum Data
DATA_MOORABI = 1,
DATA_DRAKKARI_COLOSSUS = 2,
DATA_GAL_DARAH = 3,
DATA_ECK_THE_FEROCIOUS_INIT = 4,
DATA_ECK_THE_FEROCIOUS = 5,
MAX_ENCOUNTERS = 6
DATA_ECK_THE_FEROCIOUS = 4,
MAX_ENCOUNTERS = 5
};
enum Creatures
{
NPC_RUINS_DWELLER = 29920,
NPC_ECK_THE_FEROCIOUS = 29932
};
enum GDTexts
{
EMOTE_SUMMON_ECK = 0
};
enum GameObjects
{
GO_ALTAR_OF_SLAD_RAN = 192518,

View File

@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureGroups.h"
#include "InstanceMapScript.h"
#include "ScriptedCreature.h"
#include "gundrak.h"
@@ -137,13 +138,6 @@ public:
{
switch (type)
{
case NPC_ECK_THE_FEROCIOUS:
if (GetBossState(DATA_ECK_THE_FEROCIOUS_INIT) != DONE)
{
SetBossState(DATA_ECK_THE_FEROCIOUS_INIT, NOT_STARTED);
SetBossState(DATA_ECK_THE_FEROCIOUS_INIT, DONE);
}
break;
case GO_ALTAR_OF_SLAD_RAN:
if (GameObject* statue = instance->GetGameObject(_bridgeGUIDs[0]))
statue->SetGoState(GO_STATE_READY);
@@ -194,19 +188,36 @@ public:
if (GameObject* altar = instance->GetGameObject(_drakkariAltarGUID))
altar->RemoveGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
break;
case DATA_ECK_THE_FEROCIOUS_INIT:
{
Position pos = {1624.70f, 891.43f, 95.08f, 1.2f};
if (instance->IsHeroic())
instance->SummonCreature(NPC_ECK_THE_FEROCIOUS, pos);
break;
}
}
return true;
}
void OnUnitDeath(Unit* unit) override
{
if (!instance->IsHeroic() || !unit->EntryEquals(NPC_RUINS_DWELLER) || IsBossDone(DATA_ECK_THE_FEROCIOUS))
return;
if (Creature* dweller = unit->ToCreature())
if (CreatureGroup* formation = dweller->GetFormation())
{
scheduler.CancelAll();
scheduler.Schedule(1s, [this, dweller, formation](TaskContext /*context*/)
{
if (!formation->IsAnyMemberAlive())
{
if (dweller)
dweller->AI()->Talk(EMOTE_SUMMON_ECK);
instance->SummonCreature(NPC_ECK_THE_FEROCIOUS, { 1624.70f, 891.43f, 95.08f, 1.2f });
}
});
}
}
void Update(uint32 diff) override
{
scheduler.Update(diff);
if (!_activateTimer)
return;