93 std::vector<Unit*> targets;
95 auto addTargetIfValid = [
this, &targets, summoner](
CombatReference* ref)
mutable
97 Unit* enemy = ref->GetOther(summoner);
99 targets.push_back(enemy);
103 addTargetIfValid(pair.second);
107 addTargetIfValid(pair.second);
109 for (
Unit* target : targets)
112 if (!targets.empty())
First const & RAND(First const &first, Second const &second, Rest const &... rest)
#define ASSERT_NOTNULL(pointer)
uint32 urand(uint32 min, uint32 max)
uint32 urandms(uint32 min, uint32 max)
#define RegisterCreatureAI(ai_name)
#define RegisterSpellScript(spell_script)
#define AuraEffectProcFn(F, I, N)
#define AuraCheckProcFn(F)
T CalculatePct(T base, U pct)
void PreventDefaultAction()
SpellInfo const * GetSpellInfo() const
HookList< CheckProcHandler > DoCheckProc
HookList< EffectProcHandler > OnEffectProc
bool DropCharge(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
std::unordered_map< ObjectGuid, PvPCombatReference * > const & GetPvPCombatRefs() const
std::unordered_map< ObjectGuid, CombatReference * > const & GetPvECombatRefs() const
float GetAttackDistance(Unit const *player) const
bool CanCreatureAttack(Unit const *victim, bool force=true) const
static ObjectGuid GetGUID(Object const *o)
Unit * GetActionTarget() const
SpellInfo const * GetSpellInfo() const
Unit * GetSummonerUnit() const
void FixateTarget(Unit *target)
void AddThreat(Unit *target, float amount, SpellInfo const *spell=nullptr, bool ignoreModifiers=false, bool ignoreRedirects=false)
== AFFECT MY THREAT LIST ==
Unit * GetFixateTarget() const
void DoMeleeAttackIfReady()
SpellCastResult DoCastVictim(uint32 spellId, CastSpellExtraArgs const &args={})
SpellCastResult DoCast(uint32 spellId)
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
bool CanHaveThreatList() const
====================== THREAT & COMBAT ====================
ThreatManager & GetThreatManager()
bool HasBreakableByDamageCrowdControlAura(Unit *excludeCasterChannel=nullptr) const
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
TempSummon * ToTempSummon()
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
void EngageWithTarget(Unit *who)
uint32 GetAttackTime(WeaponAttackType att) const
void SetMaxHealth(uint32 val)
CombatManager & GetCombatManager()
void SetAttackTime(WeaponAttackType att, uint32 val)
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
static bool ValidateSpellInfo(std::initializer_list< uint32 > spellIds)
PrepareAuraScript(spell_pet_charge)
void HandleDummy(AuraEffect const *, ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
bool CheckProc(ProcEventInfo &eventInfo)
PrepareAuraScript(spell_pet_culling_the_herd)
bool Validate(SpellInfo const *) override
PrepareAuraScript(spell_pet_guard_dog)
bool CheckProc(ProcEventInfo &eventInfo)
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
PrepareAuraScript(spell_pet_silverback)
bool CheckProc(ProcEventInfo &eventInfo)
bool Validate(SpellInfo const *) override
void HandleProc(AuraEffect const *aurEff, ProcEventInfo &eventInfo)
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
@ SPELL_HUNTER_CRIPPLING_POISON
@ SPELL_HUNTER_DEADLY_POISON_PASSIVE
@ SPELL_HUNTER_MIND_NUMBING_POISON
void AddSC_hunter_pet_scripts()
@ SPELL_PET_GUARD_DOG_HAPPINESS
@ SPELL_PET_SILVERBACK_RANK_2
@ SPELL_PET_SILVERBACK_RANK_1
void MoveInLineOfSight(Unit *) override
void UpdateAI(uint32 diff) override
void JustEngagedWith(Unit *) override
void JustAppeared() override
npc_pet_hunter_snake_trap(Creature *creature)