Merge pull request #8 from azerothcore/master

Merge
This commit is contained in:
kadeshar
2025-08-30 21:23:42 +02:00
committed by GitHub
17 changed files with 115 additions and 79 deletions
@@ -177,6 +177,9 @@ struct npc_sanguine_spirit : public ScriptedAI
me->SetReactState(REACT_AGGRESSIVE);
me->SetInCombatWithZone();
DoCastSelf(SPELL_SANGUINE_SPIRIT_AURA);
}).Schedule(30s, [this](TaskContext /*context*/)
{
me->DespawnOrUnsummon();
});
}
@@ -320,6 +323,7 @@ public:
events.Reset();
if (InstanceScript* instance = player->GetInstanceScript())
{
if (instance->GetBossState(DATA_MIRKBLOOD) != DONE)
{
opener = player;
@@ -327,8 +331,10 @@ public:
events.ScheduleEvent(EVENT_SAY, 1s);
events.ScheduleEvent(EVENT_FLAG, 5s);
me->SetGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
}
}
me->SetGameObjectFlag(GO_FLAG_NOT_SELECTABLE);
return true;
}
@@ -342,14 +348,13 @@ public:
switch (events.ExecuteEvent())
{
case EVENT_SAY:
if (!mirkblood)
if (!mirkblood || !mirkblood->IsAlive())
return;
mirkblood->AI()->Talk(SAY_AGGRO, opener);
break;
case EVENT_FLAG:
if (!mirkblood)
return;
mirkblood->SetImmuneToPC(false);
if (mirkblood)
mirkblood->SetImmuneToPC(false);
me->Delete();
break;
}
+1 -65
View File
@@ -499,7 +499,7 @@ struct npc_necrotic_shard : public ScriptedAI
// Only Minions and the shard itself can deal damage.
void DamageTaken(Unit* attacker, uint32& damage, DamageEffectType /*damageType*/, SpellSchoolMask /*damageSchoolMask*/) override
{
if (attacker->GetFactionTemplateEntry() != me->GetFactionTemplateEntry())
if (attacker && attacker->GetFactionTemplateEntry() != me->GetFactionTemplateEntry())
damage = 0;
}
@@ -802,69 +802,6 @@ struct npc_cultist_engineer : public ScriptedAI
}
};
struct npc_shadow_of_doom : public CombatAI
{
npc_shadow_of_doom(Creature* creature) : CombatAI(creature) { }
void JustEngagedWith(Unit* /*who*/) override
{
scheduler.Schedule(2s, [&](TaskContext context)
{
DoCastVictim(SPELL_MINDFLAY);
context.Repeat(6500ms, 13s);
}).Schedule(2s, [&](TaskContext context)
{
DoCastVictim(SPELL_FEAR);
context.Repeat(14500ms, 14500ms);
});
}
void Reset() override
{
scheduler.CancelAll();
me->SetImmuneToPC(false);
}
void IsSummonedBy(WorldObject* summoner) override
{
if (!summoner)
return;
if (Player* player = summoner->ToPlayer())
{
me->SetImmuneToPC(true);
me->SetFacingToObject(player);
Talk(SHADOW_OF_DOOM_SAY_AGGRO, player);
DoCastSelf(SPELL_SPAWN_SMOKE, true);
scheduler.Schedule(5s, [this, player](TaskContext const& /*context*/)
{
me->SetImmuneToPC(false);
if (me->CanStartAttack(player))
AttackStart(player);
});
}
}
void JustDied(Unit* /*pKiller*/) override
{
DoCastSelf(SPELL_ZAP_CRYSTAL_CORPSE, true);
}
void SpellHit(Unit* /* caster */, SpellInfo const* spell) override
{
if (spell->Id == SPELL_SPIRIT_SPAWN_OUT)
me->DespawnOrUnsummon(3000);
}
void UpdateAI(uint32 const diff) override
{
scheduler.Update(diff);
DoMeleeAttackIfReady();
}
};
struct npc_flameshocker : public CombatAI
{
npc_flameshocker(Creature* creature) : CombatAI(creature) { }
@@ -1121,7 +1058,6 @@ void AddSC_scourge_invasion()
RegisterCreatureAI(npc_minion_spawner);
RegisterCreatureAI(npc_pallid_horror);
RegisterCreatureAI(npc_cultist_engineer);
RegisterCreatureAI(npc_shadow_of_doom);
RegisterCreatureAI(npc_flameshocker);
RegisterSpellScript(spell_communique_trigger);
RegisterSpellScript(spell_despawner_self);
@@ -137,10 +137,7 @@ enum ScourgeInvasionSpells
*/
// Shadow of Doom
SPELL_SPAWN_SMOKE = 10389, // Spawning Visual.
SPELL_ZAP_CRYSTAL_CORPSE = 28056, // Casted on Shard if Shadow of Doom dies.
SPELL_MINDFLAY = 16568,
SPELL_FEAR = 12542,
// Pallid Horror - Patchwerk Terror (also uses: 28315)
SPELL_SUMMON_CRACKED_NECROTIC_CRYSTAL = 28424, // Alliance.
@@ -336,7 +333,6 @@ enum ScourgeInvasionTalk
HERALD_OF_THE_LICH_KING_SAY_ATTACK_END = 1,
HERALD_OF_THE_LICH_KING_SAY_ATTACK_RANDOM = 2,
PALLID_HORROR_SAY_RANDOM_YELL = 0,
SHADOW_OF_DOOM_SAY_AGGRO = 0,
SYLVANAS_SAY_ATTACK_END = 3,
VARIAN_SAY_ATTACK_END = 3
};