Scripts/Gruul's Lair: Update scripts (#31827)

(cherry picked from commit ce3db0e49dd750d494e3673a92cb76445d58ca3c)
This commit is contained in:
offl
2026-07-19 23:52:03 +02:00
committed by Shauren
parent 6bc60fd1cf
commit 0e9c00850a
4 changed files with 26 additions and 22 deletions
@@ -0,0 +1,3 @@
--
UPDATE `creature_text` SET `Type` = 16 WHERE `CreatureID` = 18831 AND `GroupID` = 3 AND `ID` = 1;
UPDATE `creature_text` SET `TextRange` = 3 WHERE `CreatureID` = 18831;
@@ -188,7 +188,7 @@ private:
struct OgreBaseAI : public ScriptedAI
{
OgreBaseAI(Creature* creature) : ScriptedAI(creature), instance(creature->GetInstanceScript()) { }
OgreBaseAI(Creature* creature) : ScriptedAI(creature), Instance(creature->GetInstanceScript()) { }
void InitializeAI() override
{
@@ -198,8 +198,8 @@ struct OgreBaseAI : public ScriptedAI
void Reset() override
{
scheduler.CancelAll();
scheduler.SetValidator([this]
Scheduler.CancelAll();
Scheduler.SetValidator([this]
{
return !me->HasUnitState(UNIT_STATE_CASTING);
});
@@ -214,7 +214,7 @@ struct OgreBaseAI : public ScriptedAI
void JustDied(Unit* /*killer*/) override
{
if (Creature* maulgar = instance->GetCreature(DATA_MAULGAR))
if (Creature* maulgar = Instance->GetCreature(DATA_MAULGAR))
maulgar->AI()->DoAction(ACTION_OGRE_DEATH);
}
@@ -223,22 +223,22 @@ struct OgreBaseAI : public ScriptedAI
if (!UpdateVictim())
return;
scheduler.Update(diff);
Scheduler.Update(diff);
}
protected:
InstanceScript* instance;
TaskScheduler scheduler;
InstanceScript* Instance;
TaskScheduler Scheduler;
};
// 18834 - Olm the Summoner
struct boss_olm_the_summoner : public OgreBaseAI
{
boss_olm_the_summoner(Creature* creature) : OgreBaseAI(creature) { }
using OgreBaseAI::OgreBaseAI;
void ScheduleEvents() override
{
scheduler
Scheduler
.Schedule(5s, 10s, [this](TaskContext& task)
{
DoCastVictim(SPELL_DARK_DECAY);
@@ -260,26 +260,26 @@ struct boss_olm_the_summoner : public OgreBaseAI
// 18835 - Kiggler the Crazed
struct boss_kiggler_the_crazed : public OgreBaseAI
{
boss_kiggler_the_crazed(Creature* creature) : OgreBaseAI(creature) { }
using OgreBaseAI::OgreBaseAI;
void AttackStart(Unit* who) override
{
ScriptedAI::AttackStartCaster(who, 40.0f);
if (me->GetDistance(who) > 10.0f)
ScriptedAI::AttackStartCaster(who, 40.0f);
else if (me->GetDistance(who) < 10.0f)
ScriptedAI::AttackStart(who);
}
void SpellHitTarget(WorldObject* target, SpellInfo const* spellInfo) override
{
Unit* unitTarget = target->ToUnit();
if (!unitTarget)
return;
if (spellInfo->Id == SPELL_ARCANE_EXPLOSION)
ModifyThreatByPercent(unitTarget, -100);
if (Unit* unit = target->ToUnit())
ModifyThreatByPercent(unit, -100);
}
void ScheduleEvents() override
{
scheduler
Scheduler
.Schedule(0s, [this](TaskContext& task)
{
DoCastVictim(SPELL_LIGHTNING_BOLT);
@@ -307,7 +307,7 @@ struct boss_kiggler_the_crazed : public OgreBaseAI
// 18836 - Blindeye the Seer
struct boss_blindeye_the_seer : public OgreBaseAI
{
boss_blindeye_the_seer(Creature* creature) : OgreBaseAI(creature) { }
using OgreBaseAI::OgreBaseAI;
void OnSpellCast(SpellInfo const* spellInfo) override
{
@@ -317,7 +317,7 @@ struct boss_blindeye_the_seer : public OgreBaseAI
void ScheduleEvents() override
{
scheduler
Scheduler
.Schedule(7s, [this](TaskContext& task)
{
if (Unit* target = DoSelectLowestHpFriendly(250.0f))
@@ -335,11 +335,11 @@ struct boss_blindeye_the_seer : public OgreBaseAI
// 18832 - Krosh Firehand
struct boss_krosh_firehand : public OgreBaseAI
{
boss_krosh_firehand(Creature* creature) : OgreBaseAI(creature) { }
using OgreBaseAI::OgreBaseAI;
void ScheduleEvents() override
{
scheduler
Scheduler
.Schedule(0s, 5s, [this](TaskContext& task)
{
DoCastVictim(SPELL_GREATER_FIREBALL);
@@ -23,7 +23,7 @@
#define GLScriptName "instance_gruuls_lair"
#define DataHeader "GL"
uint32 const EncounterCount = 2;
constexpr uint32 EncounterCount = 2;
enum GLEncounters
{
@@ -95,6 +95,7 @@ class instance_gruuls_lair : public InstanceMapScript
return InstanceScript::GetData64(type);
}
protected:
ObjectGuid::LowType MaulgarOgreSpawnId[4] = { };
};