fix(Scripts/BlackwingLair): Nefarian say low health and rewrite p3 (#19405)
* Nefaran says low hp and shadowflame texts, use ScheduleHealthCheckEvent * use drakonic bone spells * remove no longer needed _scheduler * remove extra file
This commit is contained in:
@@ -0,0 +1,8 @@
|
|||||||
|
--
|
||||||
|
UPDATE `creature_text` SET `GroupID`=14, `ID`=0 WHERE `CreatureID`=11583 AND `GroupID`=0 AND `ID`=1;
|
||||||
|
UPDATE `creature_text` SET `GroupID`=15, `ID`=0, `Type`=6 WHERE `CreatureID`=11583 AND `GroupID`=0 AND `ID`=2;
|
||||||
|
|
||||||
|
DELETE FROM `conditions` WHERE `SourceEntry` IN (23361,23362);
|
||||||
|
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
|
||||||
|
(13, 2, 23361, 0, 0, 31, 0, 5, 179804, 0, 0, 0, 0, '', 'Nefarian - Raise Undead Drakonid - Target Drakonid Bones'),
|
||||||
|
(13, 1, 23362, 0, 0, 31, 0, 5, 179804, 0, 0, 0, 0, '', 'Nefarian - Raise Drakonids - Target Drakonid Bones');
|
||||||
+32
-62
@@ -81,6 +81,8 @@ enum Says
|
|||||||
SAY_RAISE_SKELETONS = 1,
|
SAY_RAISE_SKELETONS = 1,
|
||||||
SAY_SLAY = 2,
|
SAY_SLAY = 2,
|
||||||
SAY_DEATH = 3,
|
SAY_DEATH = 3,
|
||||||
|
SAY_XHEALTH = 14,
|
||||||
|
SAY_SHADOWFLAME = 15,
|
||||||
|
|
||||||
SAY_MAGE = 4,
|
SAY_MAGE = 4,
|
||||||
SAY_WARRIOR = 5,
|
SAY_WARRIOR = 5,
|
||||||
@@ -109,6 +111,7 @@ enum Paths
|
|||||||
|
|
||||||
enum GameObjects
|
enum GameObjects
|
||||||
{
|
{
|
||||||
|
GO_DRAKONID_BONES = 179804,
|
||||||
GO_PORTCULLIS_ACTIVE = 164726,
|
GO_PORTCULLIS_ACTIVE = 164726,
|
||||||
GO_PORTCULLIS_TOBOSSROOMS = 175186
|
GO_PORTCULLIS_TOBOSSROOMS = 175186
|
||||||
};
|
};
|
||||||
@@ -136,6 +139,8 @@ enum Spells
|
|||||||
SPELL_SHADOW_COMMAND = 22667,
|
SPELL_SHADOW_COMMAND = 22667,
|
||||||
SPELL_FEAR = 22678,
|
SPELL_FEAR = 22678,
|
||||||
SPELL_SHADOWBLINK = 22664,
|
SPELL_SHADOWBLINK = 22664,
|
||||||
|
SPELL_RAISE_DRAKONID = 23362,
|
||||||
|
SPELL_SUMMON_DRAKONID_CORPSE = 23363,
|
||||||
|
|
||||||
SPELL_NEFARIANS_BARRIER = 22663,
|
SPELL_NEFARIANS_BARRIER = 22663,
|
||||||
|
|
||||||
@@ -273,6 +278,12 @@ public:
|
|||||||
{
|
{
|
||||||
nefarian->DespawnOrUnsummon();
|
nefarian->DespawnOrUnsummon();
|
||||||
}
|
}
|
||||||
|
std::list<GameObject*> drakonidBones;
|
||||||
|
me->GetGameObjectListWithEntryInGrid(drakonidBones, GO_DRAKONID_BONES, DEFAULT_VISIBILITY_INSTANCE);
|
||||||
|
for (auto const& bones : drakonidBones)
|
||||||
|
{
|
||||||
|
bones->DespawnOrUnsummon();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -521,19 +532,10 @@ public:
|
|||||||
|
|
||||||
struct boss_nefarian : public BossAI
|
struct boss_nefarian : public BossAI
|
||||||
{
|
{
|
||||||
boss_nefarian(Creature* creature) : BossAI(creature, DATA_NEFARIAN), _introDone(false)
|
boss_nefarian(Creature* creature) : BossAI(creature, DATA_NEFARIAN), _introDone(false) { }
|
||||||
{
|
|
||||||
Initialize();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Initialize()
|
|
||||||
{
|
|
||||||
Phase3 = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Reset() override
|
void Reset() override
|
||||||
{
|
{
|
||||||
Initialize();
|
|
||||||
me->SetReactState(REACT_PASSIVE);
|
me->SetReactState(REACT_PASSIVE);
|
||||||
me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||||
me->SetCanFly(true);
|
me->SetCanFly(true);
|
||||||
@@ -552,6 +554,16 @@ struct boss_nefarian : public BossAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
classesPresent.clear();
|
classesPresent.clear();
|
||||||
|
|
||||||
|
ScheduleHealthCheckEvent(20, [&]
|
||||||
|
{
|
||||||
|
DoCastSelf(SPELL_RAISE_DRAKONID, true);
|
||||||
|
Talk(SAY_RAISE_SKELETONS);
|
||||||
|
});
|
||||||
|
ScheduleHealthCheckEvent(5, [&]
|
||||||
|
{
|
||||||
|
Talk(SAY_XHEALTH);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void JustEngagedWith(Unit* /*who*/) override {}
|
void JustEngagedWith(Unit* /*who*/) override {}
|
||||||
@@ -587,6 +599,7 @@ struct boss_nefarian : public BossAI
|
|||||||
if (id == 5)
|
if (id == 5)
|
||||||
{
|
{
|
||||||
DoCastAOE(SPELL_SHADOWFLAME_INITIAL);
|
DoCastAOE(SPELL_SHADOWFLAME_INITIAL);
|
||||||
|
Talk(SAY_SHADOWFLAME);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -616,29 +629,6 @@ struct boss_nefarian : public BossAI
|
|||||||
_introDone = true;
|
_introDone = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DamageTaken(Unit* /*unit*/, uint32& damage, DamageEffectType, SpellSchoolMask) override
|
|
||||||
{
|
|
||||||
if (me->HealthBelowPctDamaged(20, damage) && !Phase3)
|
|
||||||
{
|
|
||||||
std::list<Creature*> constructList;
|
|
||||||
me->GetCreatureListWithEntryInGrid(constructList, NPC_BONE_CONSTRUCT, 500.0f);
|
|
||||||
for (Creature* const& summon : constructList)
|
|
||||||
{
|
|
||||||
if (summon && !summon->IsAlive())
|
|
||||||
{
|
|
||||||
summon->Respawn();
|
|
||||||
summon->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
|
||||||
summon->SetReactState(REACT_AGGRESSIVE);
|
|
||||||
summon->SetStandState(UNIT_STAND_STATE_STAND);
|
|
||||||
DoZoneInCombat(summon);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Phase3 = true;
|
|
||||||
Talk(SAY_RAISE_SKELETONS);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void UpdateAI(uint32 diff) override
|
void UpdateAI(uint32 diff) override
|
||||||
{
|
{
|
||||||
if (!UpdateVictim())
|
if (!UpdateVictim())
|
||||||
@@ -762,7 +752,6 @@ struct boss_nefarian : public BossAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool Phase3;
|
|
||||||
bool _introDone;
|
bool _introDone;
|
||||||
std::set<uint8> classesPresent;
|
std::set<uint8> classesPresent;
|
||||||
};
|
};
|
||||||
@@ -797,7 +786,7 @@ struct npc_corrupted_totem : public ScriptedAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
me->AddAura(AURA_AVOIDANCE, me);
|
me->AddAura(AURA_AVOIDANCE, me);
|
||||||
_scheduler.CancelAll();
|
scheduler.CancelAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetAura(bool apply) const
|
void SetAura(bool apply) const
|
||||||
@@ -877,8 +866,7 @@ struct npc_corrupted_totem : public ScriptedAI
|
|||||||
{
|
{
|
||||||
me->SetInCombatWithZone();
|
me->SetInCombatWithZone();
|
||||||
|
|
||||||
_scheduler
|
scheduler.Schedule(1ms, [this](TaskContext context)
|
||||||
.Schedule(1ms, [this](TaskContext context)
|
|
||||||
{
|
{
|
||||||
if (me->GetEntry() == NPC_TOTEM_C_FIRE_NOVA)
|
if (me->GetEntry() == NPC_TOTEM_C_FIRE_NOVA)
|
||||||
{
|
{
|
||||||
@@ -913,7 +901,7 @@ struct npc_corrupted_totem : public ScriptedAI
|
|||||||
SetAura(false);
|
SetAura(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
_scheduler.CancelAll();
|
scheduler.CancelAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateAI(uint32 diff) override
|
void UpdateAI(uint32 diff) override
|
||||||
@@ -923,11 +911,10 @@ struct npc_corrupted_totem : public ScriptedAI
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_scheduler.Update(diff);
|
scheduler.Update(diff);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
TaskScheduler _scheduler;
|
|
||||||
bool _auraAdded;
|
bool _auraAdded;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -940,14 +927,14 @@ struct npc_drakonid_spawner : public ScriptedAI
|
|||||||
if (action == ACTION_SPAWNER_STOP)
|
if (action == ACTION_SPAWNER_STOP)
|
||||||
{
|
{
|
||||||
me->RemoveAurasDueToSpell(SPELL_SPAWN_DRAKONID_GEN);
|
me->RemoveAurasDueToSpell(SPELL_SPAWN_DRAKONID_GEN);
|
||||||
_scheduler.CancelAll();
|
scheduler.CancelAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IsSummonedBy(WorldObject* summoner) override
|
void IsSummonedBy(WorldObject* summoner) override
|
||||||
{
|
{
|
||||||
DoCastSelf(SPELL_SPAWN_DRAKONID_GEN);
|
DoCastSelf(SPELL_SPAWN_DRAKONID_GEN);
|
||||||
_scheduler.Schedule(10s, 60s, [this](TaskContext /*context*/)
|
scheduler.Schedule(10s, 60s, [this](TaskContext /*context*/)
|
||||||
{
|
{
|
||||||
DoCastSelf(SPELL_SPAWN_CHROMATIC_DRAKONID);
|
DoCastSelf(SPELL_SPAWN_CHROMATIC_DRAKONID);
|
||||||
});
|
});
|
||||||
@@ -957,12 +944,10 @@ struct npc_drakonid_spawner : public ScriptedAI
|
|||||||
|
|
||||||
void UpdateAI(uint32 diff) override
|
void UpdateAI(uint32 diff) override
|
||||||
{
|
{
|
||||||
_scheduler.Update(diff);
|
scheduler.Update(diff);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SummonedCreatureDies(Creature* summon, Unit* /*unit*/) override
|
void SummonedCreatureDies(Creature* summon, Unit* /*unit*/) override
|
||||||
{
|
|
||||||
if (summon->GetEntry() != NPC_BONE_CONSTRUCT)
|
|
||||||
{
|
{
|
||||||
if (Creature* victor = ObjectAccessor::GetCreature(*me, _owner))
|
if (Creature* victor = ObjectAccessor::GetCreature(*me, _owner))
|
||||||
{
|
{
|
||||||
@@ -971,32 +956,17 @@ struct npc_drakonid_spawner : public ScriptedAI
|
|||||||
|
|
||||||
ObjectGuid summonGuid = summon->GetGUID();
|
ObjectGuid summonGuid = summon->GetGUID();
|
||||||
|
|
||||||
summon->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
scheduler.Schedule(1s, [this, summonGuid](TaskContext /*context*/)
|
||||||
summon->SetHomePosition(summon->GetPosition());
|
|
||||||
|
|
||||||
_scheduler.Schedule(1s, [this, summonGuid](TaskContext /*context*/)
|
|
||||||
{
|
{
|
||||||
if (Creature* construct = ObjectAccessor::GetCreature(*me, summonGuid))
|
if (Creature* construct = ObjectAccessor::GetCreature(*me, summonGuid))
|
||||||
{
|
{
|
||||||
construct->SetVisible(false);
|
construct->SetVisible(false);
|
||||||
}
|
construct->CastSpell(construct, SPELL_SUMMON_DRAKONID_CORPSE, true);
|
||||||
}).Schedule(2s, [this, summonGuid](TaskContext /*context*/)
|
|
||||||
{
|
|
||||||
if (Creature* construct = ObjectAccessor::GetCreature(*me, summonGuid))
|
|
||||||
{
|
|
||||||
construct->UpdateEntry(NPC_BONE_CONSTRUCT, true);
|
|
||||||
construct->SetReactState(REACT_PASSIVE);
|
|
||||||
construct->SetStandState(UNIT_STAND_STATE_DEAD);
|
|
||||||
construct->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
|
||||||
construct->SetCorpseRemoveTime(DAY * IN_MILLISECONDS);
|
|
||||||
construct->SetVisible(true);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
TaskScheduler _scheduler;
|
|
||||||
ObjectGuid _owner;
|
ObjectGuid _owner;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user