refactor(Core/AI): Some more refactoring prep for Comat Threat system… (#15026)

Co-authored-by: Treeston <14020072+Treeston@users.noreply.github.com>
This commit is contained in:
Kitzunu
2023-02-13 21:39:40 +01:00
committed by GitHub
parent fdfa88093e
commit bd6034e1a9
391 changed files with 873 additions and 846 deletions

View File

@@ -307,10 +307,10 @@ public:
events.ScheduleEvent(EVENT_LIGHTNING_WAVE, 12000);
}
void EnterCombat(Unit* who) override
void JustEngagedWith(Unit* who) override
{
Talk(SAY_YSONDRE_AGGRO);
WorldBossAI::EnterCombat(who);
WorldBossAI::JustEngagedWith(who);
}
// Summon druid spirits on 75%, 50% and 25% health
@@ -412,10 +412,10 @@ public:
me->RemoveAurasDueToSpell(SPELL_SHADOW_BOLT_WHIRL);
}
void EnterCombat(Unit* who) override
void JustEngagedWith(Unit* who) override
{
Talk(SAY_LETHON_AGGRO);
WorldBossAI::EnterCombat(who);
WorldBossAI::JustEngagedWith(who);
DoCastSelf(SPELL_SHADOW_BOLT_WHIRL, true);
}
@@ -539,10 +539,10 @@ public:
emerald_dragonAI::KilledUnit(who);
}
void EnterCombat(Unit* who) override
void JustEngagedWith(Unit* who) override
{
Talk(SAY_EMERISS_AGGRO);
WorldBossAI::EnterCombat(who);
WorldBossAI::JustEngagedWith(who);
}
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
@@ -630,10 +630,10 @@ public:
events.ScheduleEvent(EVENT_BELLOWING_ROAR, 30000);
}
void EnterCombat(Unit* who) override
void JustEngagedWith(Unit* who) override
{
Talk(SAY_TAERAR_AGGRO);
emerald_dragonAI::EnterCombat(who);
emerald_dragonAI::JustEngagedWith(who);
}
void SummonedCreatureDies(Creature* /*summon*/, Unit*) override

View File

@@ -48,7 +48,7 @@ public:
IsSelfRooted = false;
}
void EnterCombat(Unit* who) override
void JustEngagedWith(Unit* who) override
{
if (!me->IsWithinMeleeRange(who))
IsSelfRooted = true;

View File

@@ -291,7 +291,7 @@ public:
events.Reset();
}
void EnterCombat(Unit* victim) override
void JustEngagedWith(Unit* who) override
{
RevealForm();
me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
@@ -301,9 +301,9 @@ public:
return;
}
if (victim && (UnitIsUnfair(victim) || !QuestIncomplete(victim, ARTORIUS_HEAD)))
if (who && (UnitIsUnfair(who) || !QuestIncomplete(who, ARTORIUS_HEAD)))
{
me->CastSpell(victim, SPELL_FOOLS_PLIGHT, true);
me->CastSpell(who, SPELL_FOOLS_PLIGHT, true);
}
events.ScheduleEvent(EVENT_FOOLS_PLIGHT, urand(2000, 3000));
@@ -486,7 +486,7 @@ public:
ResetState();
}
void EnterCombat(Unit* /*victim*/) override
void JustEngagedWith(Unit* /*who*/) override
{
RevealForm();
me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
@@ -652,16 +652,16 @@ public:
events.ScheduleEvent(SIMONE_EVENT_CHECK_PET_STATE, 2000);
}
void EnterCombat(Unit* victim) override
void JustEngagedWith(Unit* who) override
{
RevealForm();
me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
if (!InNormalForm())
{
if (victim && (UnitIsUnfair(victim) || !QuestIncomplete(victim, SIMONE_HEAD)))
if (who && (UnitIsUnfair(who) || !QuestIncomplete(who, SIMONE_HEAD)))
{
me->CastSpell(victim, SPELL_FOOLS_PLIGHT, true);
me->CastSpell(who, SPELL_FOOLS_PLIGHT, true);
}
events.ScheduleEvent(EVENT_RANGE_CHECK, 1000);
@@ -886,7 +886,7 @@ public:
me->RemoveAllMinionsByEntry(CREEPING_DOOM_ENTRY);
}
void EnterCombat(Unit* victim) override
void JustEngagedWith(Unit* who) override
{
RevealForm();
me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
@@ -901,9 +901,9 @@ public:
me->CastSpell(me, NELSON_SPELL_SOUL_FLAME, true);
}
if (victim && (UnitIsUnfair(victim) || !QuestIncomplete(victim, NELSON_HEAD)))
if (who && (UnitIsUnfair(who) || !QuestIncomplete(who, NELSON_HEAD)))
{
me->CastSpell(victim, SPELL_FOOLS_PLIGHT, true);
me->CastSpell(who, SPELL_FOOLS_PLIGHT, true);
}
events.ScheduleEvent(EVENT_FOOLS_PLIGHT, urand(2000, 3000));
@@ -1069,16 +1069,16 @@ public:
events.Reset();
}
void EnterCombat(Unit* victim) override
void JustEngagedWith(Unit* who) override
{
RevealForm();
me->RemoveNpcFlag(UNIT_NPC_FLAG_GOSSIP);
if (!InNormalForm())
{
if (victim && (UnitIsUnfair(victim) || !QuestIncomplete(victim, FRANKLIN_HEAD)))
if (who && (UnitIsUnfair(who) || !QuestIncomplete(who, FRANKLIN_HEAD)))
{
me->CastSpell(victim, SPELL_FOOLS_PLIGHT, true);
me->CastSpell(who, SPELL_FOOLS_PLIGHT, true);
}
events.ScheduleEvent(FRANKLIN_EVENT_DEMONIC_ENRAGE, urand(9000, 13000));

View File

@@ -56,7 +56,7 @@ EndContentData */
#include "WaypointMgr.h"
#include "World.h"
// @todo: this import is not necessary for compilation and marked as unused by the IDE
/// @todo: this import is not necessary for compilation and marked as unused by the IDE
// however, for some reasons removing it would cause a damn linking issue
// there is probably some underlying problem with imports which should properly addressed
// see: https://github.com/azerothcore/azerothcore-wotlk/issues/9766
@@ -700,7 +700,7 @@ public:
me->RemoveNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
}
void EnterCombat(Unit* /*who*/) override { }
void JustEngagedWith(Unit* /*who*/) override { }
void UpdateAI(uint32 diff) override
{
@@ -815,7 +815,7 @@ public:
}
}
void EnterCombat(Unit* /*who*/) override { }
void JustEngagedWith(Unit* /*who*/) override { }
void ReceiveEmote(Player* player, uint32 emote) override
{
@@ -1046,7 +1046,7 @@ public:
void UpdateAI(uint32 diff) override;
void EnterCombat(Unit* /*who*/) override { }
void JustEngagedWith(Unit* /*who*/) override { }
};
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) override
@@ -1113,7 +1113,7 @@ public:
}
}
void EnterCombat(Unit* /*who*/) override { }
void JustEngagedWith(Unit* /*who*/) override { }
void SpellHit(Unit* caster, SpellInfo const* spell) override
{
@@ -1297,7 +1297,7 @@ public:
me->SetHealth(me->CountPctFromMaxHealth(70));
}
void EnterCombat(Unit* /*who*/) override { }
void JustEngagedWith(Unit* /*who*/) override { }
void SpellHit(Unit* caster, SpellInfo const* spell) override
{
@@ -1476,7 +1476,7 @@ public:
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
}
void EnterCombat(Unit* /*who*/) override
void JustEngagedWith(Unit* /*who*/) override
{
}
@@ -1672,7 +1672,7 @@ public:
npc_steam_tonkAI(Creature* creature) : ScriptedAI(creature) { }
void Reset() override { }
void EnterCombat(Unit* /*who*/) override { }
void JustEngagedWith(Unit* /*who*/) override { }
void OnPossess(bool apply)
{
@@ -2373,7 +2373,7 @@ public:
me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
}
void EnterCombat(Unit* /*who*/) override { }
void JustEngagedWith(Unit* /*who*/) override { }
void DoAction(int32 /*param*/) override
{
@@ -2591,7 +2591,7 @@ public:
events.Reset();
}
void EnterCombat(Unit* /*who*/) override
void JustEngagedWith(Unit* /*who*/) override
{
events.ScheduleEvent(EVENT_FLAME_BUFFET, 4s);
events.ScheduleEvent(EVENT_FLAME_BREATH, 12s);