Scripts/Hellfire Ramparts: Update scripts (#31014)

(cherry picked from commit 147d2394226e3eaf13252061c9301185e865dfc5)
This commit is contained in:
offl
2026-06-23 22:48:26 +02:00
committed by Shauren
parent 16432c0d70
commit 215c8a47f3
6 changed files with 663 additions and 738 deletions
@@ -50,188 +50,176 @@ enum Spells
SPELL_SUMMON_FIENDISH_HOUND = 30707
};
class boss_omor_the_unscarred : public CreatureScript
struct boss_omor_the_unscarred : public BossAI
{
public:
boss_omor_the_unscarred(Creature* creature) : BossAI(creature, DATA_OMOR_THE_UNSCARRED)
{
Initialize();
SetCombatMovement(false);
}
boss_omor_the_unscarred() : CreatureScript("boss_omor_the_unscarred") { }
void Initialize()
{
OrbitalStrike_Timer = 25000;
ShadowWhip_Timer = 2000;
Aura_Timer = 10000;
DemonicShield_Timer = 1000;
Shadowbolt_Timer = 2000;
Summon_Timer = 10000;
SummonedCount = 0;
PlayerGUID.Clear();
CanPullBack = false;
}
struct boss_omor_the_unscarredAI : public BossAI
void Reset() override
{
Talk(SAY_WIPE);
Initialize();
_Reset();
}
void JustEngagedWith(Unit* who) override
{
BossAI::JustEngagedWith(who);
Talk(SAY_AGGRO);
}
void KilledUnit(Unit* /*victim*/) override
{
if (rand32() % 2)
return;
Talk(SAY_KILL_1);
}
void JustSummoned(Creature* summoned) override
{
Talk(SAY_SUMMON);
if (Unit* random = SelectTarget(SelectTargetMethod::Random, 0))
summoned->AI()->AttackStart(random);
++SummonedCount;
}
void JustDied(Unit* /*killer*/) override
{
Talk(SAY_DIE);
_JustDied();
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
//only two may be wrong, perhaps increase timer and spawn periodically instead.
if (SummonedCount < 2)
{
boss_omor_the_unscarredAI(Creature* creature) : BossAI(creature, DATA_OMOR_THE_UNSCARRED)
if (Summon_Timer <= diff)
{
Initialize();
SetCombatMovement(false);
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_SUMMON_FIENDISH_HOUND);
Summon_Timer = 15000 + rand32() % 15000;
}
else
Summon_Timer -= diff;
}
void Initialize()
if (CanPullBack)
{
if (ShadowWhip_Timer <= diff)
{
OrbitalStrike_Timer = 25000;
ShadowWhip_Timer = 2000;
Aura_Timer = 10000;
DemonicShield_Timer = 1000;
Shadowbolt_Timer = 2000;
Summon_Timer = 10000;
SummonedCount = 0;
PlayerGUID.Clear();
CanPullBack = false;
}
void Reset() override
{
Talk(SAY_WIPE);
Initialize();
_Reset();
}
void JustEngagedWith(Unit* who) override
{
BossAI::JustEngagedWith(who);
Talk(SAY_AGGRO);
}
void KilledUnit(Unit* /*victim*/) override
{
if (rand32() % 2)
return;
Talk(SAY_KILL_1);
}
void JustSummoned(Creature* summoned) override
{
Talk(SAY_SUMMON);
if (Unit* random = SelectTarget(SelectTargetMethod::Random, 0))
summoned->AI()->AttackStart(random);
++SummonedCount;
}
void JustDied(Unit* /*killer*/) override
{
Talk(SAY_DIE);
_JustDied();
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
//only two may be wrong, perhaps increase timer and spawn periodically instead.
if (SummonedCount < 2)
if (Player* temp = ObjectAccessor::GetPlayer(*me, PlayerGUID))
{
if (Summon_Timer <= diff)
//if unit dosen't have this flag, then no pulling back (script will attempt cast, even if orbital strike was resisted)
if (temp->HasUnitMovementFlag(MOVEMENTFLAG_FALLING_FAR))
{
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_SUMMON_FIENDISH_HOUND);
Summon_Timer = 15000 + rand32() % 15000;
}
else
Summon_Timer -= diff;
}
if (CanPullBack)
{
if (ShadowWhip_Timer <= diff)
{
if (Player* temp = ObjectAccessor::GetPlayer(*me, PlayerGUID))
{
//if unit dosen't have this flag, then no pulling back (script will attempt cast, even if orbital strike was resisted)
if (temp->HasUnitMovementFlag(MOVEMENTFLAG_FALLING_FAR))
{
me->InterruptNonMeleeSpells(false);
DoCast(temp, SPELL_SHADOW_WHIP);
}
}
PlayerGUID.Clear();
ShadowWhip_Timer = 2000;
CanPullBack = false;
}
else
ShadowWhip_Timer -= diff;
}
else
if (OrbitalStrike_Timer <= diff)
{
Unit* temp = nullptr;
if (me->IsWithinMeleeRange(me->GetVictim()))
temp = me->GetVictim();
else temp = SelectTarget(SelectTargetMethod::Random, 0);
if (temp && temp->GetTypeId() == TYPEID_PLAYER)
{
DoCast(temp, SPELL_ORBITAL_STRIKE);
OrbitalStrike_Timer = 14000 + rand32() % 2000;
PlayerGUID = temp->GetGUID();
if (!PlayerGUID.IsEmpty())
CanPullBack = true;
}
}
else
OrbitalStrike_Timer -= diff;
if (HealthBelowPct(20))
{
if (DemonicShield_Timer <= diff)
{
DoCast(me, SPELL_DEMONIC_SHIELD);
DemonicShield_Timer = 15000;
}
else
DemonicShield_Timer -= diff;
}
if (Aura_Timer <= diff)
{
Talk(SAY_CURSE);
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
{
DoCast(target, SPELL_TREACHEROUS_AURA);
Aura_Timer = 8000 + rand32() % 8000;
DoCast(temp, SPELL_SHADOW_WHIP);
}
}
else
Aura_Timer -= diff;
if (Shadowbolt_Timer <= diff)
{
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
{
target = me->GetVictim();
DoCast(target, SPELL_SHADOW_BOLT);
Shadowbolt_Timer = 4000 + rand32() % 2500;
}
}
else
Shadowbolt_Timer -= diff;
PlayerGUID.Clear();
ShadowWhip_Timer = 2000;
CanPullBack = false;
}
private:
uint32 OrbitalStrike_Timer;
uint32 ShadowWhip_Timer;
uint32 Aura_Timer;
uint32 DemonicShield_Timer;
uint32 Shadowbolt_Timer;
uint32 Summon_Timer;
uint32 SummonedCount;
ObjectGuid PlayerGUID;
bool CanPullBack;
};
CreatureAI* GetAI(Creature* creature) const override
{
return GetHellfireRampartsAI<boss_omor_the_unscarredAI>(creature);
else
ShadowWhip_Timer -= diff;
}
else
if (OrbitalStrike_Timer <= diff)
{
Unit* temp = nullptr;
if (me->IsWithinMeleeRange(me->GetVictim()))
temp = me->GetVictim();
else temp = SelectTarget(SelectTargetMethod::Random, 0);
if (temp && temp->GetTypeId() == TYPEID_PLAYER)
{
DoCast(temp, SPELL_ORBITAL_STRIKE);
OrbitalStrike_Timer = 14000 + rand32() % 2000;
PlayerGUID = temp->GetGUID();
if (!PlayerGUID.IsEmpty())
CanPullBack = true;
}
}
else
OrbitalStrike_Timer -= diff;
if (HealthBelowPct(20))
{
if (DemonicShield_Timer <= diff)
{
DoCast(me, SPELL_DEMONIC_SHIELD);
DemonicShield_Timer = 15000;
}
else
DemonicShield_Timer -= diff;
}
if (Aura_Timer <= diff)
{
Talk(SAY_CURSE);
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
{
DoCast(target, SPELL_TREACHEROUS_AURA);
Aura_Timer = 8000 + rand32() % 8000;
}
}
else
Aura_Timer -= diff;
if (Shadowbolt_Timer <= diff)
{
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
{
target = me->GetVictim();
DoCast(target, SPELL_SHADOW_BOLT);
Shadowbolt_Timer = 4000 + rand32() % 2500;
}
}
else
Shadowbolt_Timer -= diff;
}
private:
uint32 OrbitalStrike_Timer;
uint32 ShadowWhip_Timer;
uint32 Aura_Timer;
uint32 DemonicShield_Timer;
uint32 Shadowbolt_Timer;
uint32 Summon_Timer;
uint32 SummonedCount;
ObjectGuid PlayerGUID;
bool CanPullBack;
};
void AddSC_boss_omor_the_unscarred()
{
new boss_omor_the_unscarred();
RegisterHellfireRampartsCreatureAI(boss_omor_the_unscarred);
}
@@ -64,468 +64,425 @@ const float VazrudenRing[2][3] =
{ -1377.0f, 1760.0f, 112.0f }
};
class boss_nazan : public CreatureScript
struct boss_nazan : public BossAI
{
public:
boss_nazan() : CreatureScript("boss_nazan") { }
boss_nazan(Creature* creature) : BossAI(creature, DATA_NAZAN)
{
Initialize();
flight = true;
BellowingRoar_Timer = 0;
ConeOfFire_Timer = 0;
}
struct boss_nazanAI : public BossAI
void Initialize()
{
Fireball_Timer = 4000;
Fly_Timer = 45000;
Turn_Timer = 0;
}
void Reset() override
{
Initialize();
_Reset();
}
void JustEngagedWith(Unit* /*who*/) override { }
void IsSummonedBy(WorldObject* summoner) override
{
if (summoner->GetEntry() == NPC_VAZRUDEN_HERALD)
VazrudenGUID = summoner->GetGUID();
}
void JustSummoned(Creature* summoned) override
{
if (summoned && summoned->GetEntry() == NPC_LIQUID_FIRE)
{
boss_nazanAI(Creature* creature) : BossAI(creature, DATA_NAZAN)
{
Initialize();
flight = true;
BellowingRoar_Timer = 0;
ConeOfFire_Timer = 0;
}
summoned->SetLevel(me->GetLevel());
summoned->SetFaction(me->GetFaction());
summoned->CastSpell(summoned, DUNGEON_MODE(SPELL_SUMMON_LIQUID_FIRE, SPELL_SUMMON_LIQUID_FIRE_H), true);
summoned->CastSpell(summoned, SPELL_FIRE_NOVA_VISUAL, true);
}
}
void Initialize()
void SpellHitTarget(WorldObject* target, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == uint32(SPELL_FIREBALL))
me->SummonCreature(NPC_LIQUID_FIRE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 30s);
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
if (Fireball_Timer <= diff)
{
if (Unit* victim = SelectTarget(SelectTargetMethod::Random, 0))
DoCast(victim, SPELL_FIREBALL, true);
Fireball_Timer = urand(4000, 7000);
}
else
Fireball_Timer -= diff;
if (flight) // phase 1 - the flight
{
Creature* Vazruden = ObjectAccessor::GetCreature(*me, VazrudenGUID);
if (Fly_Timer < diff || !(Vazruden && Vazruden->IsAlive() && Vazruden->HealthAbovePct(20)))
{
flight = false;
BellowingRoar_Timer = 6000;
ConeOfFire_Timer = 12000;
me->SetDisableGravity(false);
me->SetWalk(true);
me->GetMotionMaster()->Clear();
if (Unit* victim = SelectTarget(SelectTargetMethod::MinDistance, 0))
AttackStart(victim);
DoStartMovement(me->GetVictim());
Talk(EMOTE);
return;
}
else
Fly_Timer -= diff;
if (Turn_Timer <= diff)
{
uint32 waypoint = (Fly_Timer/10000)%2;
if (!me->IsWithinDist3d(VazrudenRing[waypoint][0], VazrudenRing[waypoint][1], VazrudenRing[waypoint][2], 5))
me->GetMotionMaster()->MovePoint(0, VazrudenRing[waypoint][0], VazrudenRing[waypoint][1], VazrudenRing[waypoint][2]);
Turn_Timer = 10000;
}
else
Turn_Timer -= diff;
}
else // phase 2 - land fight
{
if (ConeOfFire_Timer <= diff)
{
DoCast(me, SPELL_CONE_OF_FIRE);
ConeOfFire_Timer = 12000;
Fireball_Timer = 4000;
Fly_Timer = 45000;
Turn_Timer = 0;
}
else
ConeOfFire_Timer -= diff;
void Reset() override
if (IsHeroic())
{
Initialize();
_Reset();
}
void JustEngagedWith(Unit* /*who*/) override { }
void IsSummonedBy(WorldObject* summoner) override
{
if (summoner->GetEntry() == NPC_VAZRUDEN_HERALD)
VazrudenGUID = summoner->GetGUID();
}
void JustSummoned(Creature* summoned) override
{
if (summoned && summoned->GetEntry() == NPC_LIQUID_FIRE)
if (BellowingRoar_Timer <= diff)
{
summoned->SetLevel(me->GetLevel());
summoned->SetFaction(me->GetFaction());
summoned->CastSpell(summoned, DUNGEON_MODE(SPELL_SUMMON_LIQUID_FIRE, SPELL_SUMMON_LIQUID_FIRE_H), true);
summoned->CastSpell(summoned, SPELL_FIRE_NOVA_VISUAL, true);
}
}
void SpellHitTarget(WorldObject* target, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == uint32(SPELL_FIREBALL))
me->SummonCreature(NPC_LIQUID_FIRE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 30s);
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
if (Fireball_Timer <= diff)
{
if (Unit* victim = SelectTarget(SelectTargetMethod::Random, 0))
DoCast(victim, SPELL_FIREBALL, true);
Fireball_Timer = urand(4000, 7000);
DoCast(me, SPELL_BELLOWING_ROAR);
BellowingRoar_Timer = 45000;
}
else
Fireball_Timer -= diff;
BellowingRoar_Timer -= diff;
}
}
}
if (flight) // phase 1 - the flight
private:
uint32 Fireball_Timer;
uint32 ConeOfFire_Timer;
uint32 BellowingRoar_Timer;
uint32 Fly_Timer;
uint32 Turn_Timer;
bool flight;
ObjectGuid VazrudenGUID;
};
struct boss_vazruden : public BossAI
{
boss_vazruden(Creature* creature) : BossAI(creature, DATA_VAZRUDEN)
{
Initialize();
}
void Initialize()
{
Revenge_Timer = 4000;
UnsummonCheck = 2000;
WipeSaid = false;
}
void Reset() override
{
Initialize();
_Reset();
}
void JustEngagedWith(Unit* who) override
{
Talk(SAY_AGGRO);
BossAI::JustEngagedWith(who);
}
void KilledUnit(Unit* who) override
{
if (who && who->GetEntry() != NPC_VAZRUDEN)
Talk(SAY_KILL);
}
void JustDied(Unit* killer) override
{
if (killer && killer != me)
Talk(SAY_DIE);
_JustDied();
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
{
if (UnsummonCheck < diff && me->IsAlive())
{
if (!WipeSaid)
{
Creature* Vazruden = ObjectAccessor::GetCreature(*me, VazrudenGUID);
if (Fly_Timer < diff || !(Vazruden && Vazruden->IsAlive() && Vazruden->HealthAbovePct(20)))
Talk(SAY_WIPE);
WipeSaid = true;
}
me->DisappearAndDie();
}
else
UnsummonCheck -= diff;
return;
}
if (Revenge_Timer <= diff)
{
if (Unit* victim = me->GetVictim())
DoCast(victim, DUNGEON_MODE(SPELL_REVENGE, SPELL_REVENGE_H));
Revenge_Timer = 5000;
}
else
Revenge_Timer -= diff;
}
private:
uint32 Revenge_Timer;
bool WipeSaid;
uint32 UnsummonCheck;
};
struct boss_vazruden_the_herald : public ScriptedAI
{
boss_vazruden_the_herald(Creature* creature) : ScriptedAI(creature)
{
Initialize();
summoned = false;
sentryDown = false;
}
void Initialize()
{
phase = 0;
waypoint = 0;
check = 0;
}
void Reset() override
{
Initialize();
UnsummonAdds();
}
void UnsummonAdds()
{
if (summoned)
{
Creature* Nazan = ObjectAccessor::GetCreature(*me, NazanGUID);
if (!Nazan)
Nazan = me->FindNearestCreature(NPC_NAZAN, 5000);
if (Nazan)
{
Nazan->DisappearAndDie();
NazanGUID.Clear();
}
Creature* Vazruden = ObjectAccessor::GetCreature(*me, VazrudenGUID);
if (!Vazruden)
Vazruden = me->FindNearestCreature(NPC_VAZRUDEN, 5000);
if (Vazruden)
{
Vazruden->DisappearAndDie();
VazrudenGUID.Clear();
}
summoned = false;
me->ClearUnitState(UNIT_STATE_ROOT);
me->SetVisible(true);
}
}
void SummonAdds()
{
if (!summoned)
{
if (Creature* Vazruden = me->SummonCreature(NPC_VAZRUDEN, VazrudenMiddle[0], VazrudenMiddle[1], VazrudenMiddle[2], 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 100min))
VazrudenGUID = Vazruden->GetGUID();
if (Creature* Nazan = me->SummonCreature(NPC_NAZAN, VazrudenMiddle[0], VazrudenMiddle[1], VazrudenMiddle[2], 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 100min))
{
NazanGUID = Nazan->GetGUID();
if (Player* player = Nazan->SelectNearestPlayer(60.0f))
Nazan->AI()->AttackStart(player);
}
summoned = true;
me->SetVisible(false);
me->AddUnitState(UNIT_STATE_ROOT);
}
}
void JustEngagedWith(Unit* /*who*/) override
{
if (phase == 0)
{
phase = 1;
check = 0;
Talk(SAY_INTRO);
}
}
void JustSummoned(Creature* summon) override
{
if (!summon)
return;
Unit* victim = me->GetVictim();
if (summon->GetEntry() == NPC_NAZAN)
{
summon->SetDisableGravity(true);
summon->SetSpeedRate(MOVE_FLIGHT, 2.5f);
if (victim)
AttackStartNoMove(victim);
}
else
if (victim)
summon->AI()->AttackStart(victim);
}
void SentryDownBy(Unit* killer)
{
if (sentryDown)
{
AttackStartNoMove(killer);
sentryDown = false;
}
else
sentryDown = true;
}
void UpdateAI(uint32 diff) override
{
switch (phase)
{
case 0: // circle around the platform
return;
break;
case 1: // go to the middle and begin the fight
if (check <= diff)
{
if (!me->IsWithinDist3d(VazrudenMiddle[0], VazrudenMiddle[1], VazrudenMiddle[2], 5))
{
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MovePoint(0, VazrudenMiddle[0], VazrudenMiddle[1], VazrudenMiddle[2]);
check = 1000;
}
else
{
SummonAdds();
phase = 2;
return;
}
}
else
check -= diff;
break;
default: // adds do the job now
if (check <= diff)
{
Creature* Nazan = ObjectAccessor::GetCreature(*me, NazanGUID);
Creature* Vazruden = ObjectAccessor::GetCreature(*me, VazrudenGUID);
if ((Nazan && Nazan->IsAlive()) || (Vazruden && Vazruden->IsAlive()))
{
if ((Nazan && Nazan->GetVictim()) || (Vazruden && Vazruden->GetVictim()))
return;
else
{
flight = false;
BellowingRoar_Timer = 6000;
ConeOfFire_Timer = 12000;
me->SetDisableGravity(false);
me->SetWalk(true);
me->GetMotionMaster()->Clear();
if (Unit* victim = SelectTarget(SelectTargetMethod::MinDistance, 0))
AttackStart(victim);
DoStartMovement(me->GetVictim());
Talk(EMOTE);
UnsummonAdds();
EnterEvadeMode();
return;
}
else
Fly_Timer -= diff;
if (Turn_Timer <= diff)
{
uint32 waypoint = (Fly_Timer/10000)%2;
if (!me->IsWithinDist3d(VazrudenRing[waypoint][0], VazrudenRing[waypoint][1], VazrudenRing[waypoint][2], 5))
me->GetMotionMaster()->MovePoint(0, VazrudenRing[waypoint][0], VazrudenRing[waypoint][1], VazrudenRing[waypoint][2]);
Turn_Timer = 10000;
}
else
Turn_Timer -= diff;
}
else // phase 2 - land fight
if (!(Nazan && Nazan->IsAlive()) && !(Vazruden && Vazruden->IsAlive()))
{
if (ConeOfFire_Timer <= diff)
{
DoCast(me, SPELL_CONE_OF_FIRE);
ConeOfFire_Timer = 12000;
Fireball_Timer = 4000;
}
else
ConeOfFire_Timer -= diff;
if (IsHeroic())
{
if (BellowingRoar_Timer <= diff)
{
DoCast(me, SPELL_BELLOWING_ROAR);
BellowingRoar_Timer = 45000;
}
else
BellowingRoar_Timer -= diff;
}
me->DisappearAndDie();
}
check = 2000;
}
private:
uint32 Fireball_Timer;
uint32 ConeOfFire_Timer;
uint32 BellowingRoar_Timer;
uint32 Fly_Timer;
uint32 Turn_Timer;
bool flight;
ObjectGuid VazrudenGUID;
};
CreatureAI* GetAI(Creature* creature) const override
{
return GetHellfireRampartsAI<boss_nazanAI>(creature);
else
check -= diff;
break;
}
}
private:
uint32 phase;
uint32 waypoint;
uint32 check;
bool sentryDown;
ObjectGuid NazanGUID;
ObjectGuid VazrudenGUID;
bool summoned;
};
class boss_vazruden : public CreatureScript
struct npc_hellfire_sentry : public ScriptedAI
{
public:
boss_vazruden() : CreatureScript("boss_vazruden") { }
npc_hellfire_sentry(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
struct boss_vazrudenAI : public BossAI
void Initialize()
{
KidneyShot_Timer = urand(3000, 7000);
}
void Reset() override
{
Initialize();
}
void JustEngagedWith(Unit* /*who*/) override { }
void JustDied(Unit* killer) override
{
if (!killer)
return;
if (Creature* herald = me->FindNearestCreature(NPC_VAZRUDEN_HERALD, 150))
ENSURE_AI(boss_vazruden_the_herald, herald->AI())->SentryDownBy(killer);
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
if (KidneyShot_Timer <= diff)
{
boss_vazrudenAI(Creature* creature) : BossAI(creature, DATA_VAZRUDEN)
{
Initialize();
}
void Initialize()
{
Revenge_Timer = 4000;
UnsummonCheck = 2000;
WipeSaid = false;
}
void Reset() override
{
Initialize();
_Reset();
}
void JustEngagedWith(Unit* who) override
{
Talk(SAY_AGGRO);
BossAI::JustEngagedWith(who);
}
void KilledUnit(Unit* who) override
{
if (who && who->GetEntry() != NPC_VAZRUDEN)
Talk(SAY_KILL);
}
void JustDied(Unit* killer) override
{
if (killer && killer != me)
Talk(SAY_DIE);
_JustDied();
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
{
if (UnsummonCheck < diff && me->IsAlive())
{
if (!WipeSaid)
{
Talk(SAY_WIPE);
WipeSaid = true;
}
me->DisappearAndDie();
}
else
UnsummonCheck -= diff;
return;
}
if (Revenge_Timer <= diff)
{
if (Unit* victim = me->GetVictim())
DoCast(victim, DUNGEON_MODE(SPELL_REVENGE, SPELL_REVENGE_H));
Revenge_Timer = 5000;
}
else
Revenge_Timer -= diff;
}
private:
uint32 Revenge_Timer;
bool WipeSaid;
uint32 UnsummonCheck;
};
CreatureAI* GetAI(Creature* creature) const override
{
return GetHellfireRampartsAI<boss_vazrudenAI>(creature);
if (Unit* victim = me->GetVictim())
DoCast(victim, SPELL_KIDNEY_SHOT);
KidneyShot_Timer = 20000;
}
else
KidneyShot_Timer -= diff;
}
private:
uint32 KidneyShot_Timer;
};
class boss_vazruden_the_herald : public CreatureScript
{
public:
boss_vazruden_the_herald() : CreatureScript("boss_vazruden_the_herald") { }
struct boss_vazruden_the_heraldAI : public ScriptedAI
{
boss_vazruden_the_heraldAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
summoned = false;
sentryDown = false;
}
void Initialize()
{
phase = 0;
waypoint = 0;
check = 0;
}
void Reset() override
{
Initialize();
UnsummonAdds();
}
void UnsummonAdds()
{
if (summoned)
{
Creature* Nazan = ObjectAccessor::GetCreature(*me, NazanGUID);
if (!Nazan)
Nazan = me->FindNearestCreature(NPC_NAZAN, 5000);
if (Nazan)
{
Nazan->DisappearAndDie();
NazanGUID.Clear();
}
Creature* Vazruden = ObjectAccessor::GetCreature(*me, VazrudenGUID);
if (!Vazruden)
Vazruden = me->FindNearestCreature(NPC_VAZRUDEN, 5000);
if (Vazruden)
{
Vazruden->DisappearAndDie();
VazrudenGUID.Clear();
}
summoned = false;
me->ClearUnitState(UNIT_STATE_ROOT);
me->SetVisible(true);
}
}
void SummonAdds()
{
if (!summoned)
{
if (Creature* Vazruden = me->SummonCreature(NPC_VAZRUDEN, VazrudenMiddle[0], VazrudenMiddle[1], VazrudenMiddle[2], 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 100min))
VazrudenGUID = Vazruden->GetGUID();
if (Creature* Nazan = me->SummonCreature(NPC_NAZAN, VazrudenMiddle[0], VazrudenMiddle[1], VazrudenMiddle[2], 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 100min))
{
NazanGUID = Nazan->GetGUID();
if (Player* player = Nazan->SelectNearestPlayer(60.0f))
Nazan->AI()->AttackStart(player);
}
summoned = true;
me->SetVisible(false);
me->AddUnitState(UNIT_STATE_ROOT);
}
}
void JustEngagedWith(Unit* /*who*/) override
{
if (phase == 0)
{
phase = 1;
check = 0;
Talk(SAY_INTRO);
}
}
void JustSummoned(Creature* summon) override
{
if (!summon)
return;
Unit* victim = me->GetVictim();
if (summon->GetEntry() == NPC_NAZAN)
{
summon->SetDisableGravity(true);
summon->SetSpeedRate(MOVE_FLIGHT, 2.5f);
if (victim)
AttackStartNoMove(victim);
}
else
if (victim)
summon->AI()->AttackStart(victim);
}
void SentryDownBy(Unit* killer)
{
if (sentryDown)
{
AttackStartNoMove(killer);
sentryDown = false;
}
else
sentryDown = true;
}
void UpdateAI(uint32 diff) override
{
switch (phase)
{
case 0: // circle around the platform
return;
break;
case 1: // go to the middle and begin the fight
if (check <= diff)
{
if (!me->IsWithinDist3d(VazrudenMiddle[0], VazrudenMiddle[1], VazrudenMiddle[2], 5))
{
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MovePoint(0, VazrudenMiddle[0], VazrudenMiddle[1], VazrudenMiddle[2]);
check = 1000;
}
else
{
SummonAdds();
phase = 2;
return;
}
}
else
check -= diff;
break;
default: // adds do the job now
if (check <= diff)
{
Creature* Nazan = ObjectAccessor::GetCreature(*me, NazanGUID);
Creature* Vazruden = ObjectAccessor::GetCreature(*me, VazrudenGUID);
if ((Nazan && Nazan->IsAlive()) || (Vazruden && Vazruden->IsAlive()))
{
if ((Nazan && Nazan->GetVictim()) || (Vazruden && Vazruden->GetVictim()))
return;
else
{
UnsummonAdds();
EnterEvadeMode();
return;
}
}
if (!(Nazan && Nazan->IsAlive()) && !(Vazruden && Vazruden->IsAlive()))
{
me->DisappearAndDie();
}
check = 2000;
}
else
check -= diff;
break;
}
}
private:
uint32 phase;
uint32 waypoint;
uint32 check;
bool sentryDown;
ObjectGuid NazanGUID;
ObjectGuid VazrudenGUID;
bool summoned;
};
CreatureAI* GetAI(Creature* creature) const override
{
return GetHellfireRampartsAI<boss_vazruden_the_heraldAI>(creature);
}
};
class npc_hellfire_sentry : public CreatureScript
{
public:
npc_hellfire_sentry() : CreatureScript("npc_hellfire_sentry") { }
struct npc_hellfire_sentryAI : public ScriptedAI
{
npc_hellfire_sentryAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
KidneyShot_Timer = urand(3000, 7000);
}
void Reset() override
{
Initialize();
}
void JustEngagedWith(Unit* /*who*/) override { }
void JustDied(Unit* killer) override
{
if (!killer)
return;
if (Creature* herald = me->FindNearestCreature(NPC_VAZRUDEN_HERALD, 150))
ENSURE_AI(boss_vazruden_the_herald::boss_vazruden_the_heraldAI, herald->AI())->SentryDownBy(killer);
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
if (KidneyShot_Timer <= diff)
{
if (Unit* victim = me->GetVictim())
DoCast(victim, SPELL_KIDNEY_SHOT);
KidneyShot_Timer = 20000;
}
else
KidneyShot_Timer -= diff;
}
private:
uint32 KidneyShot_Timer;
};
CreatureAI* GetAI(Creature* creature) const override
{
return GetHellfireRampartsAI<npc_hellfire_sentryAI>(creature);
}
};
void AddSC_boss_vazruden_the_herald()
{
new boss_vazruden_the_herald();
new boss_vazruden();
new boss_nazan();
new npc_hellfire_sentry();
RegisterHellfireRampartsCreatureAI(boss_nazan);
RegisterHellfireRampartsCreatureAI(boss_vazruden);
RegisterHellfireRampartsCreatureAI(boss_vazruden_the_herald);
RegisterHellfireRampartsCreatureAI(npc_hellfire_sentry);
}
@@ -15,168 +15,151 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Boss_Watchkeeper_Gargolmar
SD%Complete: 80
SDComment: Missing adds to heal him. Surge should be used on target furthest away, not random.
SDCategory: Hellfire Citadel, Hellfire Ramparts
EndScriptData */
/* Missing adds to heal him
* Surge should be used on target furthest away, not random */
#include "ScriptMgr.h"
#include "hellfire_ramparts.h"
#include "ScriptedCreature.h"
#include "SpellInfo.h"
enum Says
enum GargolmarTexts
{
SAY_TAUNT = 0,
SAY_HEAL = 1,
SAY_SURGE = 2,
SAY_AGGRO = 3,
SAY_KILL = 4,
SAY_DIE = 5
SAY_SLAY = 4
};
enum Spells
enum GargolmarSpells
{
SPELL_MORTAL_WOUND = 30641,
SPELL_SURGE = 34645,
SPELL_RETALIATION = 22857
};
enum Events
enum GargolmarEvents
{
EVENT_MORTAL_WOUND = 1,
EVENT_SURGE = 2,
EVENT_RETALIATION = 3
EVENT_SURGE,
EVENT_RETALIATION,
EVENT_TAUNT,
EVENT_HEAL
};
class boss_watchkeeper_gargolmar : public CreatureScript
enum GargolmarMisc
{
public:
boss_watchkeeper_gargolmar() : CreatureScript("boss_watchkeeper_gargolmar") { }
SOUND_DEATH = 10336
};
struct boss_watchkeeper_gargolmarAI : public BossAI
// 17306 - Watchkeeper Gargolmar
struct boss_watchkeeper_gargolmar : public BossAI
{
boss_watchkeeper_gargolmar(Creature* creature) : BossAI(creature, DATA_WATCHKEEPER_GARGOLMAR), _yelledForHeal(false), _retaliation(false) { }
void JustAppeared() override
{
// This is just timed, not on LoS or areatrigger (the source is videos)
events.ScheduleEvent(EVENT_TAUNT, 10min, 15min);
}
void Reset() override
{
_Reset();
_yelledForHeal = false;
_retaliation = false;
}
void JustEngagedWith(Unit* who) override
{
Talk(SAY_AGGRO);
BossAI::JustEngagedWith(who);
events.ScheduleEvent(EVENT_MORTAL_WOUND, 5s, 10s);
events.ScheduleEvent(EVENT_SURGE, 3s, 5s);
}
void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
{
if (!_yelledForHeal && me->HealthBelowPctDamaged(40, damage))
{
boss_watchkeeper_gargolmarAI(Creature* creature) : BossAI(creature, DATA_WATCHKEEPER_GARGOLMAR)
{
Initialize();
}
void Initialize()
{
hasTaunted = false;
yelledForHeal = false;
retaliation = false;
}
void Reset() override
{
Initialize();
_Reset();
}
void JustEngagedWith(Unit* who) override
{
Talk(SAY_AGGRO);
events.ScheduleEvent(EVENT_MORTAL_WOUND, 5s);
events.ScheduleEvent(EVENT_SURGE, 4s);
BossAI::JustEngagedWith(who);
}
void MoveInLineOfSight(Unit* who) override
{
if (!me->GetVictim() && me->CanCreatureAttack(who))
{
if (!me->CanFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
return;
float attackRadius = me->GetAttackDistance(who);
if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who))
{
//who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
AttackStart(who);
}
else if (!hasTaunted && me->IsWithinDistInMap(who, 60.0f))
{
Talk(SAY_TAUNT);
hasTaunted = true;
}
}
}
void KilledUnit(Unit* /*victim*/) override
{
Talk(SAY_KILL);
}
void JustDied(Unit* /*killer*/) override
{
Talk(SAY_DIE);
_JustDied();
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_MORTAL_WOUND:
DoCastVictim(SPELL_MORTAL_WOUND);
events.ScheduleEvent(EVENT_MORTAL_WOUND, 5s, 13s);
break;
case EVENT_SURGE:
Talk(SAY_SURGE);
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
DoCast(target, SPELL_SURGE);
events.ScheduleEvent(EVENT_SURGE, 5s, 13s);
break;
case EVENT_RETALIATION:
DoCast(me, SPELL_RETALIATION);
events.ScheduleEvent(EVENT_RETALIATION, 30s);
break;
default:
break;
}
}
if (!retaliation)
{
if (HealthBelowPct(20))
{
events.ScheduleEvent(EVENT_RETALIATION, 1s);
retaliation = true;
}
}
if (!yelledForHeal)
{
if (HealthBelowPct(40))
{
Talk(SAY_HEAL);
yelledForHeal = true;
}
}
}
private:
bool hasTaunted;
bool yelledForHeal;
bool retaliation;
};
CreatureAI* GetAI(Creature* creature) const override
{
return GetHellfireRampartsAI<boss_watchkeeper_gargolmarAI>(creature);
_yelledForHeal = true;
events.ScheduleEvent(EVENT_HEAL, 0s);
}
if (!_retaliation && me->HealthBelowPctDamaged(20, damage))
{
_retaliation = true;
events.ScheduleEvent(EVENT_RETALIATION, 0s);
}
}
void OnSpellCast(SpellInfo const* spell) override
{
if (spell->Id == SPELL_SURGE)
if (roll_chance(50))
Talk(SAY_SURGE);
}
void KilledUnit(Unit* /*victim*/) override
{
Talk(SAY_SLAY);
}
void JustDied(Unit* /*killer*/) override
{
_JustDied();
DoPlaySoundToSet(me, SOUND_DEATH);
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
{
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
if (eventId == EVENT_TAUNT)
Talk(SAY_TAUNT);
}
return;
}
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_MORTAL_WOUND:
DoCastVictim(SPELL_MORTAL_WOUND);
events.Repeat(5s, 15s);
break;
case EVENT_SURGE:
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
DoCast(target, SPELL_SURGE);
events.Repeat(15s, 40s);
break;
case EVENT_RETALIATION:
DoCastSelf(SPELL_RETALIATION);
events.Repeat(30s);
break;
case EVENT_HEAL:
Talk(SAY_HEAL);
break;
default:
break;
}
}
}
private:
bool _yelledForHeal;
bool _retaliation;
};
void AddSC_boss_watchkeeper_gargolmar()
{
new boss_watchkeeper_gargolmar();
RegisterHellfireRampartsCreatureAI(boss_watchkeeper_gargolmar);
}
@@ -54,4 +54,6 @@ inline AI* GetHellfireRampartsAI(T* obj)
return GetInstanceAI<AI>(obj, HRScriptName);
}
#define RegisterHellfireRampartsCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetHellfireRampartsAI)
#endif
@@ -15,13 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Instance_Hellfire_Ramparts
SD%Complete: 50
SDComment:
SDCategory: Hellfire Ramparts
EndScriptData */
#include "ScriptMgr.h"
#include "GameObject.h"
#include "hellfire_ramparts.h"