Core/Creatures: Moved autoattack handling from scripts to game

This commit is contained in:
Shauren
2024-01-08 22:23:12 +01:00
parent eeb4407f07
commit 605e5f94c0
425 changed files with 393 additions and 1816 deletions

View File

@@ -156,8 +156,6 @@ struct emerald_dragonAI : public WorldBossAI
if (Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 0, -50.0f, true))
DoCast(target, SPELL_SUMMON_PLAYER);
DoMeleeAttackIfReady();
}
};

View File

@@ -129,12 +129,8 @@ struct npc_guard_generic : public GuardAI
{
me->resetAttackTimer();
DoCastVictim(spellInfo->Id);
meleeContext.Repeat();
return;
}
}
me->AttackerStateUpdate(victim);
me->resetAttackTimer();
meleeContext.Repeat();
}).Schedule(Seconds(5), [this](TaskContext spellContext)
{
@@ -205,10 +201,7 @@ struct npc_guard_shattrath_faction : public GuardAI
if (!UpdateVictim())
return;
_scheduler.Update(diff, [this]
{
DoMeleeAttackIfReady();
});
_scheduler.Update(diff);
}
void ScheduleVanish()

View File

@@ -251,8 +251,7 @@ public:
ResetFlagTimer -= diff;
}
if (UpdateVictim())
DoMeleeAttackIfReady();
UpdateVictim();
}
void ReceiveEmote(Player* player, uint32 emote) override