21 me->NeedChangeAI =
true;
22 me->IsAIEnabled =
false;
57 if (!target && summoner->
CanHaveThreatList() && !summoner->getThreatManager().isThreatListEmpty())
69 SF_LOG_ERROR(
"misc",
"DoZoneInCombat called for creature that has empty threat list (creature entry = %u)", creature->
GetEntry());
80 if (
Player* player = itr->GetSource())
82 if (player->IsGameMaster())
85 if (player->IsAlive())
88 player->SetInCombatWith(creature);
122 if (
me->CanStartAttack(who,
false))
135 SF_LOG_DEBUG(
"entities.unit",
"Creature %u enters evade mode.",
me->GetEntry());
137 if (!
me->GetVehicle())
139 if (
Unit* owner =
me->GetCharmerOrOwner())
141 me->GetMotionMaster()->Clear(
false);
149 me->GetMotionMaster()->MoveTargetedHome();
156 me->GetVehicleKit()->Reset(
true);
167 if (
me->IsValidAttackTarget(target))
176 if (!
me->IsInCombat())
187 if (
Unit* victim =
me->SelectVictim())
189 return me->GetVictim();
194 if (!
me->IsInCombat())
199 if (
Unit* victim =
me->SelectVictim())
201 return me->GetVictim();
203 else if (
me->getThreatManager().isThreatListEmpty())
222 me->DeleteThreatList();
223 me->CombatStop(
true);
224 me->LoadCreaturesAddon(
true);
225 me->SetLootRecipient(NULL);
226 me->ResetPlayerDamageReq();
227 me->SetLastDamagedTime(0);
229 if (
me->IsInEvadeMode())
237 return me->SummonCreature(entry, pos, summonType, despawnTime);
244 return me->SummonCreature(entry, pos, summonType, despawnTime);
252 return me->SummonCreature(entry, pos, summonType, despawnTime);
AISpellInfoType * GetAISpellInfo(uint32 i)
#define SF_LOG_DEBUG(filterType__,...)
#define SF_LOG_ERROR(filterType__,...)
@ CREATURE_TYPE_NON_COMBAT_PET
@ SPELL_AURA_CLONE_CASTER
@ SPELL_AURA_CONTROL_VEHICLE
virtual void MoveInLineOfSight(Unit *)
void DoZoneInCombat(Creature *creature=NULL, float maxRangeToNearestTarget=50.0f)
Creature * DoSummon(uint32 entry, Position const &pos, uint32 despawnTime=30000, TempSummonType summonType=TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN)
bool UpdateVictimWithGaze()
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
bool m_MoveInLineOfSight_locked
Creature * DoSummonFlyer(uint32 entry, WorldObject *obj, float flightZ, float radius=5.0f, uint32 despawnTime=30000, TempSummonType summonType=TempSummonType::TEMPSUMMON_CORPSE_TIMED_DESPAWN)
void SetGazeOn(Unit *target)
void MoveInLineOfSight_Safe(Unit *who)
== Reactions At =================================
void OnCharmed(bool apply)
virtual void EnterEvadeMode()
bool HasReactState(ReactStates state) const
Unit * SelectNearestTarget(float dist=0, bool playerOnly=false) const
PlayerList const & GetPlayers() const
LinkedListHead::Iterator< MapReference const > const_iterator
Unit * GetSummoner() const
static AISpellInfoType * AISpellInfo
virtual void AttackStart(Unit *)
bool CanHaveThreatList() const
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=NULL)
Unit * getAttackerForHelper() const
TempSummon * ToTempSummon()
bool IsFriendlyTo(Unit const *unit) const
ThreatManager & getThreatManager()
bool IsHostileTo(Unit const *unit) const
void SetInCombatWith(Unit *enemy)
void GetRandomNearPosition(Position &pos, float radius)