54 if (
me->m_spells[i] &&
sSpellMgr->GetSpellInfo(
me->m_spells[i]))
67 for (SpellVct::iterator i =
spells.begin(); i !=
spells.end(); ++i)
69 me->CastSpell(killer, *i,
true);
74 for (SpellVct::iterator i =
spells.begin(); i !=
spells.end(); ++i)
77 me->CastSpell(who, *i,
false);
104 events.RescheduleEvent(spellId, unTimeMs);
116 for (SpellVct::iterator itr =
spells.begin(); itr !=
spells.end(); ++itr)
130 for (SpellVct::iterator itr =
spells.begin(); itr !=
spells.end(); ++itr, ++count)
133 me->CastSpell(who, *itr,
false);
140 cooldown +=
me->GetCurrentSpellCastTime(*itr);
142 events.ScheduleEvent(*itr, cooldown);
154 if (
me->GetVictim()->HasBreakableByDamageCrowdControlAura(
me))
156 me->InterruptNonMeleeSpells(
false);
166 uint32 casttime =
me->GetCurrentSpellCastTime(spellId);
167 events.ScheduleEvent(spellId, (casttime ? casttime : 500) +
GetAISpellInfo(spellId)->realCooldown);
177 if (!
me->m_spells[0])
178 SF_LOG_ERROR(
"misc",
"ArcherAI set for creature (entry = %u) with spell1=0. AI will do nothing",
me->GetEntry());
181 m_minRange = spellInfo ? spellInfo->GetMinRange(
false) : 0;
185 me->m_CombatDistance = spellInfo ? spellInfo->GetMaxRange(
false) : 0;
186 me->m_SightDistance =
me->m_CombatDistance;
196 if (
me->Attack(who,
true) && !who->
IsFlying())
197 me->GetMotionMaster()->MoveChase(who);
201 if (
me->Attack(who,
false) && !who->
IsFlying())
202 me->GetMotionMaster()->MoveChase(who,
me->m_CombatDistance);
206 me->GetMotionMaster()->MoveIdle();
226 if (!
me->m_spells[0])
227 SF_LOG_ERROR(
"misc",
"TurretAI set for creature (entry = %u) with spell1=0. AI will do nothing",
me->GetEntry());
230 m_minRange = spellInfo ? spellInfo->GetMinRange(
false) : 0;
231 me->m_CombatDistance = spellInfo ? spellInfo->GetMaxRange(
false) : 0;
232 me->m_SightDistance =
me->m_CombatDistance;
238 if (!
me->IsWithinCombatRange(
me->GetVictim(),
me->m_CombatDistance)
247 me->Attack(who,
false);
279 me->SetVisible(
false);
280 me->DespawnOrUnsummon();
289 me->SetVisible(
true);
320 if (
Vehicle* vehicleKit =
me->GetVehicleKit())
321 for (SeatMap::iterator itr = vehicleKit->Seats.begin(); itr != vehicleKit->Seats.end(); ++itr)
328 player->ExitVehicle();
#define VEHICLE_CONDITION_CHECK_TIME
#define VEHICLE_DISMISS_TIME
@ CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE
AISpellInfoType * GetAISpellInfo(uint32 i)
#define SF_LOG_DEBUG(filterType__,...)
#define SF_LOG_ERROR(filterType__,...)
@ UNIT_NPC_FLAG_SPELLCLICK
@ UNIT_NPC_FLAG_PLAYER_VEHICLE
#define CREATURE_MAX_SPELLS
static int Permissible(const Creature *)
void UpdateAI(uint32) OVERRIDE
== Triggered Actions Requested ==================
void EnterCombat(Unit *) OVERRIDE
void InitializeAI() OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void JustDied(Unit *killer) OVERRIDE
void EnterCombat(Unit *who) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void SpellInterrupted(uint32 spellId, uint32 unTimeMs) OVERRIDE
void InitializeAI() OVERRIDE
static int Permissible(const Creature *)
CreatureAI(Creature *creature)
static Unit * GetUnit(WorldObject const &, uint64 guid)
void DoMeleeAttackIfReady()
void DoCast(uint32 spellId)
virtual void InitializeAI()
bool DoSpellAttackIfReady(uint32 spell)
static AISpellInfoType * AISpellInfo
bool IsNeutralToAll() const
void AttackStart(Unit *who) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
static int Permissible(const Creature *)
void AttackStart(Unit *who) OVERRIDE
bool CanAIAttack(const Unit *who) const
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
static int Permissible(const Creature *)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void CheckConditions(const uint32 diff)
static int Permissible(const Creature *)
void OnCharmed(bool apply) OVERRIDE