142 for (
auto itr =
_spells.begin(); itr !=
_spells.end(); ++itr, ++count)
193 if (!creature->m_spells[0])
194 TC_LOG_ERROR(
"scripts.ai",
"TurretAI set for creature with spell1 = 0. AI will do nothing ({})", creature->GetGUID().ToString());
196 if (
SpellInfo const* spellInfo =
sSpellMgr->GetSpellInfo(creature->m_spells[0], creature->GetMap()->GetDifficultyID()))
198 auto [minRange, maxRange] = spellInfo->GetMinMaxRange(
false);
199 _minimumRange = minRange;
200 creature->m_CombatDistance = maxRange;
202 creature->m_SightDistance = creature->m_CombatDistance;
203 creature->SetCanMelee(
false);
237 me->SetCanMelee(
false);
284 for (
auto const& [i, vehicleSeat] : vehicleKit->Seats)
292 player->ExitVehicle();
#define VEHICLE_CONDITION_CHECK_TIME
#define VEHICLE_DISMISS_TIME
@ CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE
AISpellInfoType * GetAISpellInfo(uint32 spellId, Difficulty difficulty)
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
#define TC_LOG_ERROR(filterType__, message__,...)
static int32 Permissible(Creature const *creature)
void UpdateAI(uint32) override
void UpdateAI(uint32 diff) override
void InitializeAI() override
void JustEngagedWith(Unit *) override
void SpellInterrupted(uint32 spellId, uint32 unTimeMs) override
void InitializeAI() override
void JustDied(Unit *killer) override
void JustEngagedWith(Unit *who) override
void UpdateAI(uint32 diff) override
uint32 m_spells[MAX_CREATURE_SPELLS]
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
void ScheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
void RescheduleEvent(uint32 eventId, Milliseconds time, uint32 group=0, uint8 phase=0)
Difficulty GetDifficultyID() const
bool DoSpellAttackIfReady(uint32 spellId)
virtual void InitializeAI()
SpellCastResult DoCast(uint32 spellId)
bool IsWithinCombatRange(Unit const *obj, float dist2compare) const
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Unit * EnsureVictim() const
bool Attack(Unit *victim, bool meleeAttack)
bool HasUnitState(const uint32 f) const
bool HasBreakableByDamageCrowdControlAura(Unit const *excludeCasterChannel=nullptr) const
Vehicle * GetVehicleKit() const
int32 GetCurrentSpellCastTime(uint32 spell_id) const
bool IsVehicleInUse() const
Returns information whether the vehicle is currently used by any unit.
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
bool IsNeutralToAll() const
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
bool CanAIAttack(Unit const *who) const override
TurretAI(Creature *creature, uint32 scriptId={}) noexcept
void UpdateAI(uint32 diff) override
void AttackStart(Unit *who) override
== Triggered Actions Requested ==================
VehicleAI(Creature *creature, uint32 scriptId={}) noexcept
static int32 Permissible(Creature const *creature)
void UpdateAI(uint32 diff) override
void OnCharmed(bool isNew) override
void CheckConditions(uint32 diff)