mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-29 08:33:47 +00:00
@@ -1579,7 +1579,7 @@ void Creature::SelectLevel(bool changelevel)
|
||||
SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, stats->AttackPower);
|
||||
SetModifierValue(UNIT_MOD_ATTACK_POWER_RANGED, BASE_VALUE, stats->RangedAttackPower);
|
||||
|
||||
sScriptMgr->Creature_SelectLevel(cInfo, this);
|
||||
sScriptMgr->OnCreatureSelectLevel(cInfo, this);
|
||||
}
|
||||
|
||||
float Creature::_GetHealthMod(int32 Rank)
|
||||
|
||||
@@ -57,11 +57,11 @@ void ScriptMgr::OnBeforeCreatureSelectLevel(const CreatureTemplate* cinfo, Creat
|
||||
});
|
||||
}
|
||||
|
||||
void ScriptMgr::Creature_SelectLevel(const CreatureTemplate* cinfo, Creature* creature)
|
||||
void ScriptMgr::OnCreatureSelectLevel(const CreatureTemplate* cinfo, Creature* creature)
|
||||
{
|
||||
ExecuteScript<AllCreatureScript>([&](AllCreatureScript* script)
|
||||
{
|
||||
script->Creature_SelectLevel(cinfo, creature);
|
||||
script->OnCreatureSelectLevel(cinfo, creature);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public:
|
||||
virtual void OnBeforeCreatureSelectLevel(const CreatureTemplate* /*cinfo*/, Creature* /*creature*/, uint8& /*level*/) { }
|
||||
|
||||
// Called from End of Creature SelectLevel.
|
||||
virtual void Creature_SelectLevel(const CreatureTemplate* /*cinfo*/, Creature* /*creature*/) { }
|
||||
virtual void OnCreatureSelectLevel(const CreatureTemplate* /*cinfo*/, Creature* /*creature*/) { }
|
||||
|
||||
/**
|
||||
* @brief This hook runs after add creature in world
|
||||
|
||||
@@ -593,7 +593,7 @@ public: /* AllCreatureScript */
|
||||
//listener function (OnAllCreatureUpdate) is called by OnCreatureUpdate
|
||||
//void OnAllCreatureUpdate(Creature* creature, uint32 diff);
|
||||
void OnBeforeCreatureSelectLevel(const CreatureTemplate* cinfo, Creature* creature, uint8& level);
|
||||
void Creature_SelectLevel(const CreatureTemplate* cinfo, Creature* creature);
|
||||
void OnCreatureSelectLevel(const CreatureTemplate* cinfo, Creature* creature);
|
||||
void OnCreatureSaveToDB(Creature* creature);
|
||||
|
||||
public: /* AllGameobjectScript */
|
||||
|
||||
@@ -1312,6 +1312,8 @@ void WorldState::StartScourgeInvasion(bool sendMail)
|
||||
Acore::Containers::RandomShuffle(randomIds);
|
||||
for (uint32 id : randomIds)
|
||||
OnEnable(m_siData.m_activeInvasions[id]);
|
||||
|
||||
sGameEventMgr->StartEvent(GAME_EVENT_SCOURGE_INVASION_BOSSES);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -65,6 +65,7 @@ enum WorldStateGameEvents
|
||||
{
|
||||
// Scourge Invasion
|
||||
GAME_EVENT_SCOURGE_INVASION = 17,
|
||||
GAME_EVENT_SCOURGE_INVASION_BOSSES = 120,
|
||||
GAME_EVENT_SCOURGE_INVASION_WINTERSPRING = 121,
|
||||
GAME_EVENT_SCOURGE_INVASION_TANARIS = 122,
|
||||
GAME_EVENT_SCOURGE_INVASION_AZSHARA = 123,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user