OregonCore  revision be9e804-git
Your Favourite TBC server
TempSummon Class Reference

#include <TemporarySummon.h>

+ Inheritance diagram for TempSummon:

Public Member Functions

 TempSummon (SummonPropertiesEntry const *properties, Unit *owner, bool isWorldObject)
 
 ~TempSummon () override
 
void Update (uint32 time) override
 
virtual void InitStats (uint32 lifetime)
 
virtual void InitSummon ()
 
void UnSummon (uint32 msTime=0)
 
void RemoveFromWorld () override
 
void SetTempSummonType (TempSummonType type)
 
TempSummonType GetTempSummonType () const
 
void SaveToDB () override
 
UnitGetSummoner () const
 
void SetSummoner (Unit *summoner)
 
- Public Member Functions inherited from Creature
 Creature (bool isWorldObject=false)
 
 ~Creature () override
 
void AddToWorld () override
 
void DisappearAndDie ()
 
bool Create (uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 team, float x, float y, float z, float ang, const CreatureData *data=NULL)
 
bool LoadCreaturesAddon (bool reload=false)
 
void SelectLevel ()
 
void LoadEquipment (uint32 equip_entry, bool force=false)
 
uint32 GetDBTableGUIDLow () const
 
char const * GetSubName () const
 
void GetRespawnPosition (float &x, float &y, float &z, float *ori=NULL, float *dist=NULL) const
 
uint32 GetEquipmentId () const
 
void SetVirtualItem (VirtualItemSlot slot, uint32 item_id)
 
void SetVirtualItemRaw (VirtualItemSlot slot, uint32 display_id, uint32 info0, uint32 info1)
 
void SetCorpseDelay (uint32 delay)
 
bool IsRacialLeader () const
 
bool IsCivilian () const
 
bool IsTrigger () const
 
bool IsGuard () const
 
bool CanWalk () const
 
bool CanSwim () const
 
bool CanFly () const
 
void SetReactState (ReactStates st)
 
ReactStates GetReactState () const
 
bool HasReactState (ReactStates state) const
 
void InitializeReactState ()
 
bool IsTrainerOf (Player *player, bool msg) const
 
bool CanInteractWithBattleMaster (Player *player, bool msg) const
 
bool CanTrainAndResetTalentsOf (Player *pPlayer) const
 
bool CanCreatureAttack (Unit const *victim, bool force=true) const
 
bool IsImmuneToSpell (SpellEntry const *spellInfo, bool useCharges=false) override
 
bool IsImmuneToSpellEffect (SpellEntry const *spellInfo, uint32 index, bool castOnSelf) const override
 
bool isElite () const
 
bool isWorldBoss () const
 
uint8 getLevelForTarget (Unit const *target) const
 
bool IsInEvadeMode () const
 
bool AIM_Initialize (CreatureAI *ai=NULL)
 
CreatureAIAI () const
 
uint32 GetShieldBlockValue () const override
 
SpellSchoolMask GetMeleeDamageSchoolMask () const override
 
void SetMeleeDamageSchool (SpellSchools school)
 
void _AddCreatureSpellCooldown (uint32 spell_id, time_t end_time)
 
void _AddCreatureCategoryCooldown (uint32 category, time_t apply_time)
 
void AddCreatureSpellCooldown (uint32 spellid)
 
bool HasSpellCooldown (uint32 spell_id) const
 
bool HasCategoryCooldown (uint32 spell_id) const
 
bool HasSpell (uint32 spellID) const override
 
bool UpdateEntry (uint32 entry, uint32 team=ALLIANCE, const CreatureData *data=NULL)
 
void UpdateMovementFlags (bool packetOnly=false)
 
bool UpdateStats (Stats stat) override
 
bool UpdateAllStats () override
 
void UpdateResistances (uint32 school) override
 
void UpdateArmor () override
 
void UpdateMaxHealth () override
 
void UpdateMaxPower (Powers power) override
 
void UpdateAttackPowerAndDamage (bool ranged=false) override
 
void CalculateMinMaxDamage (WeaponAttackType attType, bool normalized, bool addTotalPct, float &minDamage, float &maxDamage) override
 
void SetCanDualWield (bool value)
 
void SetCurrentEquipmentId (uint8 id)
 
uint32 GetCurrentEquipmentId ()
 
float GetSpellDamageMod (int32 Rank) const
 
VendorItemData const * GetVendorItems () const
 
uint32 GetVendorItemCurrentCount (VendorItem const *vItem)
 
uint32 UpdateVendorItemCurrentCount (VendorItem const *vItem, uint32 used_count)
 
TrainerSpellData const * GetTrainerSpells () const
 
CreatureInfo const * GetCreatureTemplate () const
 
CreatureData const * GetCreatureData () const
 
CreatureDataAddon const * GetCreatureAddon () const
 
std::string GetAIName () const
 
std::string GetScriptName ()
 
uint32 GetScriptId ()
 
void setEmoteState (uint8 emote)
 
void Say (const char *text, uint32 language, uint64 TargetGuid)
 
void Yell (const char *text, uint32 language, uint64 TargetGuid)
 
void TextEmote (const char *text, uint64 TargetGuid, bool IsBossEmote=false)
 
void Whisper (const char *text, uint64 receiver, bool IsBossWhisper=false)
 
void Say (int32 textId, uint32 language, uint64 TargetGuid)
 
void Yell (int32 textId, uint32 language, uint64 TargetGuid)
 
void TextEmote (int32 textId, uint64 TargetGuid, bool IsBossEmote=false)
 
void Whisper (int32 textId, uint64 receiver, bool IsBossWhisper=false)
 
const char * GetNameForLocaleIdx (int32 locale_idx) const override
 
void setDeathState (DeathState s) override
 
bool LoadFromDB (uint32 guid, Map *map)
 
bool LoadCreatureFromDB (uint32 guid, Map *map, bool addToMap=true)
 
virtual void SaveToDB (uint32 mapid, uint8 spawnMask, uint32 phaseMask)
 
virtual void DeleteFromDB ()
 
void StartPickPocketRefillTimer ()
 
void ResetPickPocketRefillTimer ()
 
bool CanGeneratePickPocketLoot () const
 
void SetSkinner (uint64 guid)
 
uint64 GetSkinner () const
 
PlayerGetLootRecipient () const
 
GroupGetLootRecipientGroup () const
 
bool hasLootRecipient () const
 
bool isTappedBy (Player const *player) const
 
void SetLootRecipient (Unit *unit)
 
void AllLootRemovedFromCorpse ()
 
SpellEntry const * reachWithSpellAttack (Unit *pVictim)
 
SpellEntry const * reachWithSpellCure (Unit *pVictim)
 
bool canStartAttack (Unit const *u, bool force) const
 
float GetAttackDistance (Unit const *pl) const
 
float GetAggroRange (Unit const *target) const
 
void SendAIReaction (AiReaction reactionType)
 
UnitSelectNearestTarget (float dist=0, bool playerOnly=false) const
 
UnitSelectNearestTargetInAttackDistance (float dist=0) const
 
UnitSelectNearestHostileUnitInAggroRange (bool useLOS=false) const
 
void DoFleeToGetAssistance ()
 
void CallForHelp (float fRadius)
 
void CallAssistance ()
 
void SetNoCallAssistance (bool val)
 
void SetNoSearchAssistance (bool val)
 
bool HasSearchedAssistance () const
 
bool CanAssistTo (const Unit *u, const Unit *enemy, bool checkfaction=true) const
 
bool _IsTargetAcceptable (const Unit *target) const
 
MovementGeneratorType GetDefaultMovementType () const
 
void SetDefaultMovementType (MovementGeneratorType mgt)
 
Cell const & GetCurrentCell () const
 
void SetCurrentCell (Cell const &cell)
 
void RemoveCorpse (bool setSpawnTime=true)
 
void ForcedDespawn (uint32 timeMSToDespawn=0)
 
void DespawnOrUnsummon (uint32 msTimeToDespawn=0)
 
time_t const & GetRespawnTime () const
 
time_t GetRespawnTimeEx () const
 
void SetRespawnTime (uint32 respawn)
 
void Respawn (bool force=false)
 
void SaveRespawnTime () override
 
uint32 GetRespawnDelay () const
 
void SetRespawnDelay (uint32 delay)
 
float GetRespawnRadius () const
 
void SetRespawnRadius (float dist)
 
uint32 GetCombatPulseDelay () const
 
void SetCombatPulseDelay (uint32 delay)
 
time_t GetLinkedCreatureRespawnTime () const
 
const CreatureDataGetLinkedRespawnCreatureData () const
 
void SendZoneUnderAttackMessage (Player *attacker)
 
void SetInCombatWithZone ()
 
bool hasQuest (uint32 quest_id) const override
 
bool hasInvolvedQuest (uint32 quest_id) const override
 
bool isRegeneratingHealth ()
 
void setRegeneratingHealth (bool regenHealth)
 
virtual uint8 GetPetAutoSpellSize () const
 
virtual uint32 GetPetAutoSpellOnPos (uint8 pos) const
 
void SetHomePosition (float x, float y, float z, float o)
 
void SetHomePosition (const Position &pos)
 
void GetHomePosition (float &x, float &y, float &z, float &ori)
 
Position GetHomePosition ()
 
uint32 GetGlobalCooldown () const
 
uint32 GetWaypointPath ()
 
void LoadPath (uint32 pathid)
 
uint32 GetCurrentWaypointID ()
 
void UpdateWaypointID (uint32 wpID)
 
void SearchFormation ()
 
CreatureGroupGetFormation ()
 
void SetFormation (CreatureGroup *formation)
 
UnitSelectVictim ()
 
void SetDisableReputationGain (bool disable)
 
bool IsReputationGainDisabled ()
 
bool IsDamageEnoughForLootingAndReward () const
 
void SetPlayerDamaged (bool set)
 
uint32 GetOriginalEntry () const
 
void SetOriginalEntry (uint32 entry)
 
bool SetLevitate (bool enable, bool packetOnly=false) override
 
bool SetWalk (bool enable) override
 
bool SetSwim (bool enable) override
 
bool SetCanFly (bool enable, bool packetOnly=false) override
 
bool SetFeatherFall (bool enable, bool packetOnly=false) override
 
bool SetWaterWalking (bool enable, bool packetOnly=false) override
 
bool SetHover (bool enable, bool packetOnly=false) override
 
CreatureTextRepeatIds GetTextRepeatGroup (uint8 textGroup)
 
void SetTextRepeatId (uint8 textGroup, uint8 id)
 
void ClearTextRepeatGroup (uint8 textGroup)
 
- Public Member Functions inherited from Unit
 ~Unit () override
 
void AddToWorld () override
 
void RemoveFromWorld () override
 
void CleanupsBeforeDelete () override
 
DiminishingLevels GetDiminishing (DiminishingGroup group)
 
void IncrDiminishing (DiminishingGroup group)
 
void ApplyDiminishingToDuration (DiminishingGroup group, int32 &duration, Unit *caster, DiminishingLevels Level)
 
void ApplyDiminishingAura (DiminishingGroup group, bool apply)
 
void ClearDiminishings ()
 
uint32 GetSpellRadiusForTarget (Unit *target, const SpellRadiusEntry *radiusEntry)
 
void Update (uint32 time) override
 
void setAttackTimer (WeaponAttackType type, uint32 time)
 
void resetAttackTimer (WeaponAttackType type=BASE_ATTACK)
 
uint32 getAttackTimer (WeaponAttackType type) const
 
bool isAttackReady (WeaponAttackType type=BASE_ATTACK) const
 
bool haveOffhandWeapon () const
 
bool UpdateMeleeAttackingState ()
 
bool CanUseEquippedWeapon (WeaponAttackType attackType) const
 
bool CanDualWield () const
 
float GetCombatReach () const
 
float GetMeleeReach () const
 
bool IsWithinCombatRange (const Unit *obj, float dist2compare) const
 
bool IsWithinMeleeRange (Unit *obj, float dist=MELEE_RANGE) const
 
void GetRandomContactPoint (const Unit *target, float &x, float &y, float &z, float distance2dMin, float distance2dMax) const
 
void _addAttacker (Unit *pAttacker)
 
void _removeAttacker (Unit *pAttacker)
 
UnitgetAttackerForHelper () const
 
bool Attack (Unit *victim, bool meleeAttack)
 
void CastStop (uint32 except_spellid=0)
 
bool AttackStop ()
 
void RemoveAllAttackers ()
 
AttackerSet const & getAttackers () const
 
bool isAttackingPlayer () const
 
UnitGetVictim () const
 
void CombatStop (bool cast=false)
 
void CombatStopWithPets (bool cast=false)
 
UnitSelectNearbyTarget (Unit *exclude=NULL, float dist=NOMINAL_MELEE_RANGE) const
 
PlayerSelectNearestPlayer (float distance=0) const
 
void SendMeleeAttackStop (Unit *victim=NULL)
 
void SendMeleeAttackStart (Unit *victim)
 
void SetCritterGUID (uint64 guid)
 
uint64 GetCritterGUID () const
 
void AddUnitState (uint32 f)
 
bool HasUnitState (const uint32 f) const
 
void ClearUnitState (uint32 f)
 
bool CanFreeMove () const
 
uint32 HasUnitTypeMask (uint32 mask) const
 
void AddUnitTypeMask (uint32 mask)
 
bool IsSummon () const
 
bool IsGuardian () const
 
bool IsPet () const
 
bool IsHunterPet () const
 
bool IsTotem () const
 
bool IsDuringRemoveFromWorld () const
 
PetToPet ()
 
Pet const * ToPet () const
 
uint8 getLevel () const
 
uint8 getLevelForTarget (WorldObject const *) const override
 
void SetLevel (uint32 lvl)
 
uint8 getRace () const
 
uint32 getRaceMask () const
 
uint8 getClass () const
 
uint32 getClassMask () const
 
uint8 getGender () const
 
float GetStat (Stats stat) const
 
void SetStat (Stats stat, int32 val)
 
uint32 GetArmor () const
 
void SetArmor (int32 val)
 
uint32 GetResistance (SpellSchools school) const
 
void SetResistance (SpellSchools school, int32 val)
 
uint32 GetHealth () const
 
uint32 GetMaxHealth () const
 
bool ShouldRevealHealthTo (Player *player) const
 
void SendHealthUpdateDueToCharm (Player *charmer)
 
bool IsFullHealth () const
 
bool HealthBelowPct (int32 pct) const
 
bool HealthBelowPctDamaged (int32 pct, uint32 damage) const
 
bool HealthAbovePct (int32 pct) const
 
bool HealthAbovePctHealed (int32 pct, uint32 heal) const
 
float GetHealthPct () const
 
uint32 CountPctFromMaxHealth (int32 pct) const
 
uint32 CountPctFromCurHealth (int32 pct) const
 
void SetHealth (uint32 val)
 
void SetMaxHealth (uint32 val)
 
void SetFullHealth ()
 
int32 ModifyHealth (int32 val)
 
Powers getPowerType () const
 
void setPowerType (Powers power)
 
uint32 GetPower (Powers power) const
 
uint32 GetMaxPower (Powers power) const
 
void SetPower (Powers power, uint32 val)
 
void SetMaxPower (Powers power, uint32 val)
 
int32 ModifyPower (Powers power, int32 val)
 
void ApplyPowerMod (Powers power, uint32 val, bool apply)
 
void ApplyMaxPowerMod (Powers power, uint32 val, bool apply)
 
uint32 GetAttackTime (WeaponAttackType att) const
 
void SetAttackTime (WeaponAttackType att, uint32 val)
 
void ApplyAttackTimePercentMod (WeaponAttackType att, float val, bool apply)
 
void ApplyCastTimePercentMod (float val, bool apply)
 
SheathState GetSheath () const
 
virtual void SetSheath (SheathState sheathed)
 
uint32 GetFaction () const
 
void SetFaction (uint32 faction)
 
FactionTemplateEntry const * GetFactionTemplateEntry () const
 
ReputationRank GetReactionTo (Unit const *target) const
 
bool IsHostileTo (Unit const *unit) const
 
bool IsHostileToPlayers () const
 
bool IsFriendlyTo (Unit const *unit) const
 
bool IsNeutralToAll () const
 
bool IsInPartyWith (Unit const *unit) const
 
bool IsInRaidWith (Unit const *unit) const
 
void GetPartyMember (std::list< Unit * > &units, float dist)
 
void GetRaidMember (std::list< Unit * > &units, float dist)
 
bool IsContestedGuard () const
 
bool IsInSanctuary () const
 
bool IsPvP () const
 
void SetPvP (bool state)
 
uint32 GetCreatureType () const
 
uint32 GetCreatureTypeMask () const
 
uint8 GetStandState () const
 
bool IsSitState () const
 
bool IsStandState () const
 
void SetStandState (uint8 state)
 
void SetStandFlags (uint8 flags)
 
void RemoveStandFlags (uint8 flags)
 
bool IsMounted () const
 
uint32 GetMountID () const
 
void Mount (uint32 mount, uint32 spellId=0)
 
void Dismount ()
 
bool HasShapeshiftChangingModel () const
 
uint32 GetMaxSkillValueForLevel (Unit const *target=nullptr) const
 
void RemoveSpellbyDamageTaken (uint32 damage, uint32 spell)
 
uint32 DealDamage (Unit *victim, uint32 damage, CleanDamage const *cleanDamage=NULL, DamageEffectType damagetype=DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellEntry const *spellProto=NULL, bool durabilityLoss=true)
 
void Kill (Unit *victim, bool durabilityLoss=true)
 
void ProcDamageAndSpell (Unit *victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType=BASE_ATTACK, SpellEntry const *procSpell=NULL, bool canTrigger=true)
 
void ProcDamageAndSpellFor (bool isVictim, Unit *pTarget, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellEntry const *procSpell, uint32 damage)
 
void HandleEmoteCommand (uint32 anim_id)
 
void AttackerStateUpdate (Unit *victim, WeaponAttackType attType=BASE_ATTACK, bool extra=false)
 
float MeleeMissChanceCalc (const Unit *victim, WeaponAttackType attType) const
 
void CalculateMeleeDamage (Unit *victim, uint32 damage, CalcDamageInfo *damageInfo, WeaponAttackType attackType=BASE_ATTACK)
 
void DealMeleeDamage (CalcDamageInfo *damageInfo, bool durabilityLoss)
 
void CalculateSpellDamageTaken (SpellNonMeleeDamage *damageInfo, int32 damage, SpellEntry const *spellInfo, WeaponAttackType attackType=BASE_ATTACK, bool crit=false)
 
void DealSpellDamage (SpellNonMeleeDamage *damageInfo, bool durabilityLoss)
 
float MeleeSpellMissChance (const Unit *victim, WeaponAttackType attType, int32 skillDiff, uint32 spellId) const
 
SpellMissInfo MeleeSpellHitResult (Unit *victim, SpellEntry const *spell, bool cMiss=true)
 
SpellMissInfo MagicSpellHitResult (Unit *victim, SpellEntry const *spell)
 
SpellMissInfo SpellHitResult (Unit *victim, SpellEntry const *spell, bool canReflect=false, bool canMiss=true)
 
float GetUnitDodgeChance () const
 
float GetUnitParryChance () const
 
float GetUnitBlockChance () const
 
float GetUnitCriticalChance (WeaponAttackType attackType, const Unit *victim) const
 
int32 GetMechanicResistChance (const SpellEntry *spell)
 
bool CanUseAttackType (uint8 attacktype) const
 
uint32 GetUnitMeleeSkill (Unit const *target=NULL) const
 
uint32 GetDefenseSkillValue (Unit const *target=NULL) const
 
uint32 GetWeaponSkillValue (WeaponAttackType attType, Unit const *target=NULL) const
 
float GetWeaponProcChance () const
 
float GetPPMProcChance (uint32 WeaponSpeed, float PPM) const
 
MeleeHitOutcome RollMeleeOutcomeAgainst (const Unit *victim, WeaponAttackType attType) const
 
MeleeHitOutcome RollMeleeOutcomeAgainst (const Unit *victim, WeaponAttackType attType, int32 crit_chance, int32 miss_chance, int32 dodge_chance, int32 parry_chance, int32 block_chance, bool SpellCasted) const
 
bool IsVendor () const
 
bool IsTrainer () const
 
bool IsQuestGiver () const
 
bool IsGossip () const
 
bool IsTaxi () const
 
bool IsGuildMaster () const
 
bool IsBattleMaster () const
 
bool IsBanker () const
 
bool IsInnkeeper () const
 
bool IsSpiritHealer () const
 
bool IsSpiritGuide () const
 
bool IsTabardDesigner () const
 
bool IsAuctioner () const
 
bool IsArmorer () const
 
bool isServiceProvider () const
 
bool IsSpiritService () const
 
bool IsCritter () const
 
bool IsPlayer () const
 
bool IsInFlight () const
 
bool IsInitiatingCombat () const
 
bool IsInCombat () const
 
bool IsPetInCombat () const
 
bool IsInCombatWith (Unit const *who) const
 
void CombatStart (Unit *target, bool initialAggro=true)
 
void SetInCombatState (bool PvP, Unit *enemy=NULL)
 
void SetInitiatingCombat (bool flag)
 
void SetInCombatWith (Unit *enemy)
 
void ClearInCombat ()
 
void ClearInPetCombat ()
 
uint32 IsInPvPCombat () const
 
uint32 GetAuraCount (uint32 spellId) const
 
bool HasAuraType (AuraType auraType) const
 
bool HasAuraTypeWithCaster (AuraType auratype, uint64 caster) const
 
bool HasAuraTypeWithMiscvalue (AuraType auratype, int32 miscvalue) const
 
bool HasAuraTypeWithFamilyFlags (AuraType auraType, uint32 familyName, uint64 familyFlags) const
 
bool HasNegativeAuraWithInterruptFlag (uint32 flag)
 
bool HasAura (uint32 spellId, uint8 effIndex=0) const
 
bool HasHigherRankOfAura (uint32 spellid, uint8 effIndex) const
 
bool HasBreakableByDamageAuraType (AuraType type, uint32 excludeAura=0) const
 
bool HasBreakableByDamageCrowdControlAura (Unit *excludeCasterChannel=NULL) const
 
bool HasStealthAura () const
 
bool HasInvisibilityAura () const
 
bool IsFeared () const
 
bool IsInRoots () const
 
bool IsPolymorphed () const
 
bool isFrozen () const
 
bool isTargetableForAttack (bool checkFakeDeath=true) const
 
bool IsValidAttackTarget (Unit const *target) const
 
bool _IsValidAttackTarget (Unit const *target, SpellEntry const *bySpell, WorldObject const *obj=NULL) const
 
bool isAttackableByAOE (float x=0, float y=0, float z=0, bool LosCheck=false) const
 
bool IsValidAssistTarget (Unit const *target) const
 
bool _IsValidAssistTarget (Unit const *target, SpellEntry const *bySpell) const
 
virtual bool IsInWater () const
 
virtual bool IsUnderWater () const
 
bool isInAccessiblePlaceFor (Creature const *c) const
 
virtual uint32 GetHighestLearnedRankOf (uint32 spellid) const
 
void SendHealSpellLog (Unit *victim, uint32 SpellID, uint32 Damage, bool critical=false)
 
void SendEnergizeSpellLog (Unit *victim, uint32 SpellID, uint32 Damage, Powers powertype)
 
void EnergizeBySpell (Unit *victim, uint32 SpellID, uint32 Damage, Powers powertype)
 
uint32 SpellNonMeleeDamageLog (Unit *victim, uint32 spellID, uint32 damage, bool isTriggeredSpell=false, bool useSpellDamage=true)
 
void CastSpell (Unit *Victim, uint32 spellId, bool triggered, Item *castItem=NULL, Aura *triggeredByAura=NULL, uint64 originalCaster=0)
 
void CastSpell (Unit *Victim, SpellEntry const *spellInfo, bool triggered, Item *castItem=NULL, Aura *triggeredByAura=NULL, uint64 originalCaster=0)
 
void CastCustomSpell (Unit *Victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=NULL, Aura *triggeredByAura=NULL, uint64 originalCaster=0)
 
void CastCustomSpell (uint32 spellId, SpellValueMod mod, uint32 value, Unit *Victim=NULL, bool triggered=true, Item *castItem=NULL, Aura *triggeredByAura=NULL, uint64 originalCaster=0)
 
void CastCustomSpell (uint32 spellId, CustomSpellValues const &value, Unit *Victim=NULL, bool triggered=true, Item *castItem=NULL, Aura *triggeredByAura=NULL, uint64 originalCaster=0)
 
void CastSpell (float x, float y, float z, uint32 spellId, bool triggered, Item *castItem=NULL, Aura *triggeredByAura=NULL, uint64 originalCaster=0)
 
void CastSpell (GameObject *go, uint32 spellId, bool triggered, Item *castItem=NULL, Aura *triggeredByAura=NULL, uint64 originalCaster=0)
 
void AddAura (uint32 spellId, Unit *target)
 
void DeMorph ()
 
void SendAttackStateUpdate (CalcDamageInfo *damageInfo)
 
void SendAttackStateUpdate (uint32 HitInfo, Unit *target, uint8 SwingType, SpellSchoolMask damageSchoolMask, uint32 Damage, uint32 AbsorbDamage, uint32 Resist, VictimState TargetState, uint32 BlockedAmount)
 
void SendSpellNonMeleeDamageLog (SpellNonMeleeDamage *log)
 
void SendSpellNonMeleeDamageLog (Unit *target, uint32 SpellID, uint32 Damage, SpellSchoolMask damageSchoolMask, uint32 AbsorbedDamage, uint32 Resist, bool PhysicalDamage, uint32 Blocked, bool CriticalHit=false)
 
void SendSpellMiss (Unit *target, uint32 spellID, SpellMissInfo missInfo)
 
void SendSpellDamageImmune (Unit *target, uint32 spellId)
 
virtual bool SetPosition (float x, float y, float z, float orientation, bool teleport=false)
 
bool SetPosition (const Position &pos, bool teleport=false)
 
void NearTeleportTo (float x, float y, float z, float orientation, bool casting=false)
 
void SendTeleportPacket (Position &pos)
 
void SendMovementFlagUpdate (bool self=false)
 
void BuildHeartBeatMsg (WorldPacket *data) const
 
void BuildMovementPacket (ByteBuffer *data) const
 
bool isMoving () const
 
bool IsAlive () const
 
bool isDying () const
 
bool isDead () const
 
DeathState getDeathState () const
 
uint64 GetOwnerGUID () const
 
uint64 GetCreatorGUID () const
 
void SetCreatorGUID (uint64 creator)
 
uint64 GetMinionGUID () const
 
void SetMinionGUID (uint64 guid)
 
uint64 GetCharmerGUID () const
 
void SetCharmerGUID (uint64 owner)
 
uint64 GetCharmGUID () const
 
void SetPetGUID (uint64 guid)
 
uint64 GetPetGUID () const
 
bool IsControlledByPlayer () const
 
uint64 GetCharmerOrOwnerGUID () const
 
uint64 GetCharmerOrOwnerOrOwnGUID () const
 
bool IsCharmedOwnedByPlayerOrPlayer () const
 
PlayerGetAffectingPlayer () const
 
PlayerGetSpellModOwner () const
 
UnitGetOwner () const
 
GuardianGetGuardianPet () const
 
MinionGetFirstMinion () const
 
UnitGetCharmer () const
 
UnitGetCharm () const
 
UnitGetCharmerOrOwner () const
 
UnitGetCharmerOrOwnerOrSelf () const
 
PlayerGetCharmerOrOwnerPlayerOrPlayerItself () const
 
void SetMinion (Minion *minion, bool apply)
 
void RemoveAllMinionsByEntry (uint32 entry)
 
void SetCharm (Unit *target, bool apply)
 
void SetCharmedBy (Unit *charmer, CharmType type)
 
void RemoveCharmedBy (Unit *charmer)
 
void RestoreFaction ()
 
UnitGetFirstControlled () const
 
void RemoveAllControlled ()
 
bool isCharmed () const
 
bool isPossessed () const
 
bool isPossessedByPlayer () const
 
bool isPossessing () const
 
bool isPossessing (Unit *u) const
 
CharmInfoGetCharmInfo ()
 
CharmInfoInitCharmInfo ()
 
void DeleteCharmInfo ()
 
void UpdateCharmAI ()
 
SharedVisionList const & GetSharedVisionList ()
 
void AddPlayerToVision (Player *plr)
 
void RemovePlayerFromVision (Player *plr)
 
bool HasSharedVision () const
 
void RemoveBindSightAuras ()
 
void RemoveCharmAuras ()
 
PetCreateTamedPetFrom (Creature *creatureTarget, uint32 spell_id=0)
 
bool AddAura (Aura *aur)
 
void RemoveAura (AuraMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
 
void RemoveAura (uint32 spellId, uint32 effindex, Aura *except=NULL)
 
void RemoveSingleAuraFromStackByDispel (uint32 spellId)
 
void RemoveSingleAuraFromStack (uint32 spellId, uint32 effindex)
 
void RemoveAurasDueToSpell (uint32 spellId, Aura *except=NULL)
 
void RemoveAurasDueToItemSpell (Item *castItem, uint32 spellId)
 
void RemoveAurasByCasterSpell (uint32 spellId, uint64 casterGUID)
 
void SetAurasDurationByCasterSpell (uint32 spellId, uint64 casterGUID, int32 duration)
 
AuraGetAuraByCasterSpell (uint32 spellId, uint64 casterGUID)
 
void RemoveAurasDueToSpellByDispel (uint32 spellId, uint64 casterGUID, Unit *dispeler)
 
void RemoveAurasDueToSpellBySteal (uint32 spellId, uint64 casterGUID, Unit *stealer)
 
void RemoveAurasByType (AuraType auraType, uint64 casterGUID=0, Aura *except=NULL, bool negative=true, bool positive=true)
 
void RemoveAurasDueToSpellByCancel (uint32 spellId)
 
void RemoveAurasAtChanneledTarget (SpellEntry const *spellInfo, Unit *caster)
 
void RemoveNotOwnSingleTargetAuras ()
 
void RemoveSpellsCausingAura (AuraType auraType)
 
void RemoveAuraTypeByCaster (AuraType auraType, uint64 casterGUID)
 
void RemoveRankAurasDueToSpell (uint32 spellId)
 
bool RemoveNoStackAurasDueToAura (Aura *Aur)
 
void RemoveAurasWithInterruptFlags (uint32 flags, uint32 except=0)
 
void RemoveAurasWithAttribute (uint32 flags)
 
void RemoveAurasWithDispelType (DispelType type)
 
void RemoveMovementImpairingAuras ()
 
void RemoveAllAuras ()
 
void RemoveArenaAuras ()
 
void RemoveAllAurasOnDeath ()
 
void DelayAura (uint32 spellId, uint32 effindex, int32 delaytime)
 
float GetResistanceBuffMods (SpellSchools school, bool positive) const
 
void SetResistanceBuffMods (SpellSchools school, bool positive, float val)
 
void ApplyResistanceBuffModsMod (SpellSchools school, bool positive, float val, bool apply)
 
void ApplyResistanceBuffModsPercentMod (SpellSchools school, bool positive, float val, bool apply)
 
void InitStatBuffMods ()
 
void ApplyStatBuffMod (Stats stat, float val, bool apply)
 
void ApplyStatPercentBuffMod (Stats stat, float val, bool apply)
 
void SetCreateStat (Stats stat, float val)
 
void SetCreateHealth (uint32 val)
 
uint32 GetCreateHealth () const
 
void SetCreateMana (uint32 val)
 
uint32 GetCreateMana () const
 
uint32 GetCreatePowers (Powers power) const
 
float GetPosStat (Stats stat) const
 
float GetNegStat (Stats stat) const
 
float GetCreateStat (Stats stat) const
 
void SetCurrentCastedSpell (Spell *pSpell)
 
virtual void ProhibitSpellSchool (SpellSchoolMask, uint32)
 
void InterruptSpell (CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true)
 
void FinishSpell (CurrentSpellTypes spellType, bool ok=true)
 
bool IsNonMeleeSpellCast (bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false) const
 
void InterruptNonMeleeSpells (bool withDelayed, uint32 spellid=0, bool withInstant=true)
 
uint64 GetTarget () const
 
void SetTarget (uint64 guid=0)
 
SpellGetCurrentSpell (CurrentSpellTypes spellType) const
 
SpellGetCurrentSpell (uint32 spellType) const
 
SpellFindCurrentSpellBySpellId (uint32 spell_id) const
 
int32 GetCurrentSpellCastTime (uint32 spell_id) const
 
bool CanMoveDuringChannel () const
 
bool IsInFeralForm () const
 
bool IsInTravelForm () const
 
bool IsInFlightForm () const
 
bool HandleStatModifier (UnitMods unitMod, UnitModifierType modifierType, float amount, bool apply)
 
void SetModifierValue (UnitMods unitMod, UnitModifierType modifierType, float value)
 
float GetModifierValue (UnitMods unitMod, UnitModifierType modifierType) const
 
float GetTotalStatValue (Stats stat) const
 
float GetTotalAuraModValue (UnitMods unitMod) const
 
SpellSchools GetSpellSchoolByAuraGroup (UnitMods unitMod) const
 
Stats GetStatByAuraGroup (UnitMods unitMod) const
 
Powers GetPowerTypeByAuraGroup (UnitMods unitMod) const
 
bool CanModifyStats () const
 
void SetCanModifyStats (bool modifyStats)
 
virtual void UpdateAllResistances ()
 
virtual void UpdateDamagePhysical (WeaponAttackType attType)
 
float GetTotalAttackPowerValue (WeaponAttackType attType) const
 
float GetWeaponDamageRange (WeaponAttackType attType, WeaponDamageRange type) const
 
void SetBaseWeaponDamage (WeaponAttackType attType, WeaponDamageRange damageRange, float value)
 
uint32 CalculateDamage (WeaponAttackType attType, bool normalized, bool addTotalPct)
 
float GetAPMultiplier (WeaponAttackType attType, bool normalized)
 
bool isInFrontInMap (Unit const *target, float distance, float arc=M_PI) const
 
void SetInFront (Unit const *target)
 
void SetInFront (float x, float y)
 
bool isInBackInMap (Unit const *target, float distance, float arc=M_PI) const
 
void SetFacingTo (float ori)
 
void SetFacingToObject (WorldObject *pObject)
 
bool IsVisible () const
 
void SetVisible (bool x)
 
bool isValid () const override
 
void SetPhaseMask (uint32 newPhaseMask, bool update) override
 
void UpdateObjectVisibility (bool forced=true) override
 
bool isInvisibleForAlive () const
 returns true if creature can't be seen by alive units More...
 
AuraListGetSingleCastAuras ()
 
AuraList const & GetSingleCastAuras () const
 
bool CanHaveThreatList () const
 
void AddThreat (Unit *victim, float threat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellEntry const *threatSpell=NULL)
 
void AddAssistThreat (Unit *victim, float threatToAdd, SpellEntry const *threatSpell)
 
float ApplyTotalThreatModifier (float threat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL)
 
void DeleteThreatList ()
 
void TauntApply (Unit *victim)
 
void TauntFadeOut (Unit *taunter)
 
ThreatManagergetThreatManager ()
 
void addHatedBy (HostileReference *pHostileReference)
 
void removeHatedBy (HostileReference *)
 
HostileRefManagergetHostileRefManager ()
 
AuraGetAura (uint32 spellId, uint32 effindex)
 
AuraMapGetAuras ()
 
AuraMap const & GetAuras () const
 
AuraList const & GetAurasByType (AuraType type) const
 
void ApplyAuraProcTriggerDamage (Aura *aura, bool apply)
 
int32 GetTotalAuraModifier (AuraType auratype) const
 
float GetTotalAuraMultiplier (AuraType auratype) const
 
int32 GetMaxPositiveAuraModifier (AuraType auratype) const
 
int32 GetMaxNegativeAuraModifier (AuraType auratype) const
 
int32 GetTotalAuraModifierByMiscMask (AuraType auratype, uint32 misc_mask) const
 
float GetTotalAuraMultiplierByMiscMask (AuraType auratype, uint32 misc_mask) const
 
int32 GetMaxPositiveAuraModifierByMiscMask (AuraType auratype, uint32 misc_mask) const
 
int32 GetMaxNegativeAuraModifierByMiscMask (AuraType auratype, uint32 misc_mask) const
 
int32 GetTotalAuraModifierByMiscValue (AuraType auratype, int32 misc_value) const
 
float GetTotalAuraMultiplierByMiscValue (AuraType auratype, int32 misc_value) const
 
int32 GetMaxPositiveAuraModifierByMiscValue (AuraType auratype, int32 misc_value) const
 
int32 GetMaxNegativeAuraModifierByMiscValue (AuraType auratype, int32 misc_value) const
 
AuraGetDummyAura (uint32 spell_id) const
 
uint32 GetInterruptMask () const
 
void AddInterruptMask (uint32 mask)
 
void UpdateInterruptMask ()
 
uint32 GetDisplayId ()
 
void SetDisplayId (uint32 modelId)
 
uint32 GetNativeDisplayId ()
 
void SetNativeDisplayId (uint32 modelId)
 
void setTransForm (uint32 spellid)
 
uint32 getTransForm () const
 
void UpdateModelData ()
 
void AddDynObject (DynamicObject *dynObj)
 
void RemoveDynObject (uint32 spellid)
 
void RemoveDynObjectWithGUID (uint64 guid)
 
void RemoveAllDynObjects ()
 
void AddGameObject (GameObject *gameObj)
 
void RemoveGameObject (GameObject *gameObj, bool del)
 
void RemoveGameObject (uint32 spellid, bool del)
 
void RemoveAllGameObjects ()
 
DynamicObjectGetDynObject (uint32 spellId, uint32 effIndex)
 
DynamicObjectGetDynObject (uint32 spellId)
 
void ModifyAuraState (AuraState flag, bool apply)
 
bool HasAuraState (AuraState flag) const
 
void UnsummonAllTotems ()
 
int32 SpellBaseDamageBonus (SpellSchoolMask schoolMask)
 
int32 SpellBaseHealingBonus (SpellSchoolMask schoolMask)
 
int32 SpellBaseDamageBonusForVictim (SpellSchoolMask schoolMask, Unit *victim)
 
int32 SpellBaseHealingBonusForVictim (SpellSchoolMask schoolMask, Unit *victim)
 
uint32 SpellDamageBonus (Unit *victim, SpellEntry const *spellProto, uint32 damage, DamageEffectType damagetype)
 
uint32 SpellHealingBonus (SpellEntry const *spellProto, uint32 healamount, DamageEffectType damagetype, Unit *victim)
 
bool isSpellBlocked (Unit *victim, SpellEntry const *spellProto, WeaponAttackType attackType=BASE_ATTACK)
 
bool isSpellCrit (Unit *victim, SpellEntry const *spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType=BASE_ATTACK)
 
uint32 SpellCriticalBonus (SpellEntry const *spellProto, uint32 damage, Unit *victim)
 
void SetLastManaUse (uint32 spellCastTime)
 
bool IsUnderLastManaUseEffect () const
 
void SetContestedPvP (Player *attackedPlayer=NULL)
 
void MeleeDamageBonus (Unit *victim, uint32 *damage, WeaponAttackType attType, SpellEntry const *spellProto=NULL)
 
uint32 GetCastingTimeForBonus (SpellEntry const *spellProto, DamageEffectType damagetype, uint32 CastingTime)
 
void ApplySpellImmune (uint32 spellId, uint32 op, uint32 type, bool apply)
 
void ApplySpellDispelImmunity (const SpellEntry *spellProto, DispelType type, bool apply)
 
bool IsImmunedToDamage (SpellSchoolMask meleeSchoolMask, bool useCharges=false)
 
bool IsImmunedToDamage (SpellEntry const *spellInfo) const
 
uint32 CalculateEffectiveMagicResistance (Unit *attacker, SpellSchoolMask schoolMask) const
 
float CalculateMagicResistanceMitigation (Unit *attacker, uint32 resistance, bool binary) const
 
uint32 CalcArmorReducedDamage (Unit *victim, const uint32 damage)
 
void CalcAbsorbResist (Unit *victim, SpellSchoolMask schoolMask, DamageEffectType damagetype, const uint32 damage, uint32 *absorb, uint32 *resist, SpellEntry const *spellInfo=NULL, bool binary=false)
 
void UpdateSpeed (UnitMoveType mtype, bool forced)
 
float GetSpeed (UnitMoveType mtype) const
 
float GetSpeedRate (UnitMoveType mtype) const
 
void SetSpeed (UnitMoveType mtype, float rate, bool forced=false)
 
bool isHover () const
 
void _RemoveAllAuraMods ()
 
void _ApplyAllAuraMods ()
 
int32 CalculateSpellDamage (SpellEntry const *spellProto, uint8 effect_index, int32 basePoints, Unit const *target)
 
int32 CalculateSpellDuration (SpellEntry const *spellProto, uint8 effect_index, Unit const *target)
 
float CalculateLevelPenalty (SpellEntry const *spellProto) const
 
void ModSpellCastTime (SpellEntry const *spellProto, int32 &castTime, Spell *spell)
 
void ModSpellDurationTime (SpellEntry const *spellProto, int32 &duration, Spell *spell)
 
void addFollower (FollowerReference *pRef)
 
void removeFollower (FollowerReference *)
 
MotionMasterGetMotionMaster ()
 
bool IsStopped () const
 
void StopMoving ()
 
void AddUnitMovementFlag (uint32 f)
 
void RemoveUnitMovementFlag (uint32 f)
 
bool HasUnitMovementFlag (uint32 f) const
 
uint32 GetUnitMovementFlags () const
 
void SetUnitMovementFlags (uint32 f)
 
void SetControlled (bool apply, UnitState state)
 
void SetFeared (bool apply)
 
void SetConfused (bool apply)
 
void SetStunned (bool apply)
 
void MonsterMoveWithSpeed (float x, float y, float z, float speed, bool generatePath=false, bool forceDestination=false)
 
void SendMonsterMoveWithSpeedToCurrentDestination (float speed)
 
void AddComboPointHolder (uint32 lowguid)
 
void RemoveComboPointHolder (uint32 lowguid)
 
void ClearComboPointHolders ()
 
void SendPetCastFail (uint32 spellid, SpellCastResult msg)
 
void SendPetActionFeedback (uint8 msg)
 
void SendPetTalk (uint32 pettalk)
 
void SendPetSpellCooldown (uint32 spellid, time_t cooltime)
 
void SendPetClearCooldown (uint32 spellid)
 
void SendPetAIReaction (uint64 guid)
 
void propagateSpeedChange ()
 
void ClearAllReactives ()
 
void StartReactiveTimer (ReactiveType reactive)
 
void UpdateReactives (uint32 p_time)
 
void UpdateAuraForGroup (uint8 slot)
 
void AddPetAura (PetAura const *petSpell)
 
void RemovePetAura (PetAura const *petSpell)
 
void SetReducedThreatPercent (uint32 pct, uint64 guid)
 
uint32 GetReducedThreatPercent ()
 
UnitGetMisdirectionTarget ()
 
virtual float GetFollowAngle () const
 
bool IsFlying () const
 
bool IsFalling () const
 
bool IsWalking () const
 
bool IsRooted () const
 
void SetRooted (bool apply)
 
bool IsLevitating () const
 
time_t GetLastDamagedTime () const
 
void SetLastDamagedTime (time_t val)
 
TempSummonToTempSummon ()
 
TempSummon const * ToTempSummon () const
 
- Public Member Functions inherited from WorldObject
 ~WorldObject () override
 
void _Create (uint32 guidlow, HighGuid guidhigh, uint32 phaseMask)
 
void GetNearPoint2D (float &x, float &y, float distance, float absAngle) const
 
void GetNearPoint (WorldObject const *searcher, float &x, float &y, float &z, float searcher_size, float distance2d, float absAngle) const
 
void GetClosePoint (float &x, float &y, float &z, float size, float distance2d=0, float angle=0) const
 
void MovePosition (Position &pos, float dist, float angle)
 
Position GetNearPosition (float dist, float angle)
 
void MovePositionToFirstCollision (Position &pos, float dist, float angle)
 
Position GetFirstCollisionPosition (float dist, float angle)
 
float GetPositionZTarget (Position &pos, float destx, float desty)
 
Position GetRandomNearPosition (float radius)
 
void GetContactPoint (const WorldObject *obj, float &x, float &y, float &z, float distance2d=CONTACT_DISTANCE) const
 
virtual float GetObjectBoundingRadius () const
 
float GetObjectSize () const
 
void UpdateGroundPositionZ (float x, float y, float &z) const
 
void UpdateAllowedPositionZ (float x, float y, float &z) const
 
void GetRandomPoint (const Position &srcPos, float distance, float &rand_x, float &rand_y, float &rand_z) const
 
void GetRandomPoint (const Position &srcPos, float distance, Position &pos) const
 
float GetDistanceSqr (float x, float y, float z) const
 
bool HasInArc (float arcangle, const Position *pos) const
 
bool HasInArc (const float arcangle, const float x, const float y) const
 
uint32 GetInstanceId () const
 
uint32 GetPhaseMask () const
 
bool InSamePhase (uint32 phasemask) const
 
bool InSamePhase (WorldObject const *obj) const
 
uint32 GetZoneId () const
 
uint32 GetAreaId () const
 
InstanceDataGetInstanceData ()
 
const char * GetName () const
 
void SetName (const std::string &newname)
 
float GetDistance (const WorldObject *obj) const
 
float GetDistance (const Position &pos) const
 
float GetDistance (float x, float y, float z) const
 
float GetDistance2d (const WorldObject *obj) const
 
float GetDistance2d (float x, float y) const
 
float GetDistanceZ (const WorldObject *obj) const
 
bool IsInMap (const WorldObject *obj) const
 
bool IsWithinDist3d (float x, float y, float z, float dist) const
 
bool IsWithinDist3d (const Position *pos, float dist) const
 
bool IsWithinDist2d (float x, float y, float dist) const
 
bool IsWithinDist2d (const Position *pos, float dist) const
 
bool _IsWithinDist (WorldObject const *obj, float dist2compare, bool is3D) const
 
bool IsWithinDist (WorldObject const *obj, float dist2compare, bool is3D=true) const
 
bool IsWithinDistInMap (WorldObject const *obj, float dist2compare, bool is3D=true) const
 
bool IsWithinLOS (float x, float y, float z) const
 
bool IsWithinLOSInMap (const WorldObject *obj) const
 
Position GetHitSpherePointFor (Position const &dest) const
 
void GetHitSpherePointFor (Position const &dest, float &x, float &y, float &z) const
 
bool GetDistanceOrder (WorldObject const *obj1, WorldObject const *obj2, bool is3D=true) const
 
bool IsInRange (WorldObject const *obj, float minRange, float maxRange, bool is3D=true) const
 
bool IsInRange2d (float x, float y, float minRange, float maxRange) const
 
bool IsInRange3d (float x, float y, float z, float minRange, float maxRange) const
 
virtual void SendMessageToSet (WorldPacket *data, bool self)
 
virtual void SendMessageToSetInRange (WorldPacket *data, float dist, bool self)
 
void MonsterSay (const char *text, uint32 language, uint64 TargetGuid)
 
void MonsterYell (const char *text, uint32 language, uint64 TargetGuid)
 
void MonsterTextEmote (const char *text, uint64 TargetGuid, bool IsBossEmote=false)
 
void MonsterWhisper (const char *text, uint64 receiver, bool IsBossWhisper=false)
 
void MonsterSay (int32 textId, uint32 language, uint64 TargetGuid)
 
void MonsterYell (int32 textId, uint32 language, uint64 TargetGuid)
 
void MonsterTextEmote (int32 textId, uint64 TargetGuid, bool IsBossEmote=false)
 
void MonsterWhisper (int32 textId, uint64 receiver, bool IsBossWhisper=false)
 
void MonsterYellToZone (int32 textId, uint32 language, uint64 TargetGuid)
 
void BuildMonsterChat (WorldPacket *data, uint8 msgtype, char const *text, uint32 language, char const *name, uint64 TargetGuid) const
 
void PlayDistanceSound (uint32 sound_id, Player *target=NULL)
 
void PlayDirectSound (uint32 sound_id, Player *target=NULL)
 
void SendObjectDeSpawnAnim (uint64 guid)
 
void SendObjectCustomAnim (uint64 guid, uint32 anim=0)
 
void AddObjectToRemoveList ()
 
virtual bool IsNeverVisible () const
 
float GetGridActivationRange () const
 
float GetVisibilityRange () const
 
float GetSightRange (const WorldObject *target=NULL) const
 
bool CanSeeOrDetect (WorldObject const *obj, bool ignoreStealth=false, bool distanceCheck=false, bool checkAlert=false) const
 
void SendPlaySound (uint32 Sound, bool OnlySelf)
 
virtual void SetMap (Map *map)
 
virtual void ResetMap ()
 
MapGetMap () const
 
MapFindMap () const
 
Map const * GetBaseMap () const
 
void SetZoneScript ()
 
TempSummonSummonCreature (uint32 id, const Position &pos, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0)
 
TempSummonSummonCreature (uint32 id, float x, float y, float z, float ang, TempSummonType spwtype=TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0)
 
GameObjectSummonGameObject (uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime)
 
CreatureSummonTrigger (float x, float y, float z, float ang, uint32 dur, CreatureAI *(*GetAI)(Creature *)=NULL)
 
void SummonCreatureGroup (uint8 group, std::list< TempSummon * > *list=NULL)
 
CreatureFindNearestCreature (uint32 entry, float range, bool alive=true)
 
GameObjectFindNearestGameObject (uint32 entry, float range)
 
GameObjectFindNearestGameObjectOfType (GameobjectTypes type, float range) const
 
void GetGameObjectListWithEntryInGrid (std::list< GameObject * > &gameobjectList, uint32 entry=GRID_SEARCH_ALL_ENTRIES, float maxSearchRange=250.0f) const
 
void GetCreatureListWithEntryInGrid (std::list< Creature * > &creatureList, uint32 entry=GRID_SEARCH_ALL_ENTRIES, float maxSearchRange=250.0f) const
 
void DestroyForNearbyPlayers ()
 
virtual void UpdateObjectVisibilityOnCreate ()
 
void BuildUpdate (UpdateDataMapType &) override
 
void AddToNotify (uint16 f)
 
bool isNeedNotify (uint16 f) const
 
uint16 GetNotifyFlags () const
 
bool NotifyExecuted (uint16 f) const
 
void SetNotified (uint16 f)
 
void ResetAllNotifies ()
 
bool isActiveObject () const
 
void setActive (bool isActiveObject)
 
bool IsVisibilityOverridden () const
 
void SetVisibilityDistanceOverride (VisibilityDistanceType type)
 
void SetWorldObject (bool apply)
 
bool IsPermanentWorldObject () const
 
bool IsWorldObject () const
 
template<class NOTIFIER >
void VisitNearbyWorldObject (const float &radius, NOTIFIER &notifier) const
 
template<class NOTIFIER >
void VisitNearbyObject (float const &radius, NOTIFIER &notifier) const
 
template<class NOTIFIER >
void VisitNearbyGridObject (float const &radius, NOTIFIER &notifier) const
 
- Public Member Functions inherited from Object
virtual ~Object ()
 
const bool & IsInWorld () const
 
uint64 GetGUID () const
 
uint32 GetGUIDLow () const
 
uint32 GetGUIDMid () const
 
uint32 GetGUIDHigh () const
 
PackedGuid const & GetPackGUID () const
 
ObjectGuid const & GetObjectGUID () const
 
std::string GetGuidStr () const
 
uint32 GetEntry () const
 
void SetEntry (uint32 entry)
 
float GetObjectScale () const
 
void SetObjectScale (float scale)
 
uint8 GetTypeId () const
 
bool isType (uint16 mask) const
 
virtual void BuildCreateUpdateBlockForPlayer (UpdateData *data, Player *target) const
 
void SendUpdateToPlayer (Player *player)
 
void BuildValuesUpdateBlockForPlayer (UpdateData *data, Player *target) const
 
void BuildOutOfRangeUpdateBlock (UpdateData *data) const
 
void BuildMovementUpdateBlock (UpdateData *data, uint32 flags=0) const
 
virtual void DestroyForPlayer (Player *target, bool onDeath=false) const
 
const int32GetInt32Value (uint16 index) const
 
const uint32GetUInt32Value (uint16 index) const
 
const uint64GetUInt64Value (uint16 index) const
 
const float & GetFloatValue (uint16 index) const
 
uint8 GetByteValue (uint16 index, uint8 offset) const
 
ObjectGuid const & GetGuidValue (uint16 index) const
 
uint16 GetUInt16Value (uint16 index, uint8 offset) const
 
void SetInt32Value (uint16 index, int32 value)
 
void SetUInt32Value (uint16 index, uint32 value)
 
void SetUInt64Value (uint16 index, const uint64 &value)
 
void SetFloatValue (uint16 index, float value)
 
void SetByteValue (uint16 index, uint8 offset, uint8 value)
 
void SetUInt16Value (uint16 index, uint8 offset, uint16 value)
 
void SetInt16Value (uint16 index, uint8 offset, int16 value)
 
void SetStatFloatValue (uint16 index, float value)
 
void SetStatInt32Value (uint16 index, int32 value)
 
bool AddUInt64Value (uint16 index, const uint64 &value)
 
bool RemoveUInt64Value (uint16 index, const uint64 &value)
 
void ApplyModUInt32Value (uint16 index, int32 val, bool apply)
 
void ApplyModInt32Value (uint16 index, int32 val, bool apply)
 
void ApplyModUInt64Value (uint16 index, int32 val, bool apply)
 
void ApplyModPositiveFloatValue (uint16 index, float val, bool apply)
 
void ApplyModSignedFloatValue (uint16 index, float val, bool apply)
 
void ApplyPercentModFloatValue (uint16 index, float val, bool apply)
 
void SetFlag (uint16 index, uint32 newFlag)
 
void RemoveFlag (uint16 index, uint32 oldFlag)
 
void ToggleFlag (uint16 index, uint32 flag)
 
bool HasFlag (uint16 index, uint32 flag) const
 
void SetByteFlag (uint16 index, uint8 offset, uint8 newFlag)
 
void RemoveByteFlag (uint16 index, uint8 offset, uint8 newFlag)
 
void ToggleFlag (uint16 index, uint8 offset, uint8 flag)
 
bool HasByteFlag (uint16 index, uint8 offset, uint8 flag) const
 
void ApplyModFlag (uint16 index, uint32 flag, bool apply)
 
void SetFlag64 (uint16 index, uint64 newFlag)
 
void RemoveFlag64 (uint16 index, uint64 oldFlag)
 
void ToggleFlag64 (uint16 index, uint64 flag)
 
bool HasFlag64 (uint16 index, uint64 flag) const
 
void ApplyModFlag64 (uint16 index, uint64 flag, bool apply)
 
void ClearUpdateMask (bool remove)
 
bool LoadValues (const char *data)
 
uint16 GetValuesCount () const
 
void BuildFieldsUpdate (Player *, UpdateDataMapType &) const
 
void ForceValuesUpdateAtIndex (uint32)
 
PlayerToPlayer ()
 
Player const * ToPlayer () const
 
CreatureToCreature ()
 
Creature const * ToCreature () const
 
UnitToUnit ()
 
Unit const * ToUnit () const
 
GameObjectToGameObject ()
 
GameObject const * ToGameObject () const
 
CorpseToCorpse ()
 
Corpse const * ToCorpse () const
 
DynamicObjectToDynObject ()
 
DynamicObject const * ToDynObject () const
 
- Public Member Functions inherited from WorldLocation
 WorldLocation (uint32 _mapid=MAPID_INVALID, float _x=0, float _y=0, float _z=0, float _o=0)
 
 WorldLocation (const WorldLocation &loc)
 
void WorldRelocate (const WorldLocation &loc)
 
uint32 GetMapId () const
 
- Public Member Functions inherited from Position
 Position (float x=0, float y=0, float z=0, float o=0)
 
 Position (Position const &loc)
 
bool operator== (Position const &a)
 
bool operator!= (Position const &a)
 
void Relocate (float x, float y)
 
void Relocate (float x, float y, float z)
 
void Relocate (float x, float y, float z, float orientation)
 
void Relocate (Position const &pos)
 
void Relocate (Position const *pos)
 
void RelocateOffset (Position const &offset)
 
void SetOrientation (float orientation)
 
float GetPositionX () const
 
float GetPositionY () const
 
float GetPositionZ () const
 
float GetOrientation () const
 
void GetPosition (float &x, float &y) const
 
void GetPosition (float &x, float &y, float &z) const
 
void GetPosition (float &x, float &y, float &z, float &o) const
 
Position GetPosition () const
 
Position::PositionXYStreamer PositionXYStream ()
 
Position::PositionXYZStreamer PositionXYZStream ()
 
Position::PositionXYZOStreamer PositionXYZOStream ()
 
bool IsPositionValid () const
 
float GetExactDist2dSq (float x, float y) const
 
float GetExactDist2d (const float x, const float y) const
 
float GetExactDist2dSq (Position const *pos) const
 
float GetExactDist2d (Position const *pos) const
 
float GetExactDistSq (float x, float y, float z) const
 
float GetExactDist (float x, float y, float z) const
 
float GetExactDistSq (Position const *pos) const
 
float GetExactDist (Position const *pos) const
 
void GetPositionOffsetTo (Position const &endPos, Position &retOffset) const
 
Position GetPositionWithOffset (Position const &offset) const
 
float GetAngle (Position const *pos) const
 
float GetAngle (float x, float y) const
 
float GetRelativeAngle (Position const *pos) const
 
float GetRelativeAngle (float x, float y) const
 
void GetSinCos (float x, float y, float &vsin, float &vcos) const
 
bool IsInDist2d (float x, float y, float dist) const
 
bool IsInDist2d (Position const *pos, float dist) const
 
bool IsInDist (float x, float y, float z, float dist) const
 
bool IsInDist (Position const *pos, float dist) const
 
bool IsWithinBox (const Position &center, float xradius, float yradius, float zradius) const
 
bool HasInArc (float arcangle, Position const *pos, float border=2.0f) const
 
bool HasInLine (Position const *pos, float width) const
 
std::string ToString () const
 
- Public Member Functions inherited from GridObject< Creature >
bool IsInGrid () const
 
void AddToGrid (GridRefManager< Creature > &m)
 
void RemoveFromGrid ()
 

Public Attributes

SummonPropertiesEntry const * m_Properties
 
- Public Attributes inherited from Creature
Loot loot
 
uint32 m_spells [CREATURE_MAX_SPELLS]
 
CreatureSpellCooldowns m_CreatureSpellCooldowns
 
CreatureSpellCooldowns m_CreatureCategoryCooldowns
 
uint32 m_GlobalCooldown
 
bool hasPlayerDamaged
 
float m_SightDistance
 
float m_CombatDistance
 
bool m_isTempWorldObject
 
- Public Attributes inherited from Unit
uint32 m_extraAttacks
 
bool m_canDualWield
 
IntervalTimer m_CombatTimer
 
ControlList m_Controlled
 
uint64 m_SummonSlot [MAX_SUMMON_SLOT]
 
uint64 m_ObjectSlot [4]
 
uint32 m_ShapeShiftFormSpellId
 
uint32 m_ShapeShiftModelId
 
ShapeshiftForm m_form
 
float m_modMeleeHitChance
 
float m_modRangedHitChance
 
float m_modSpellHitChance
 
int32 m_baseSpellCritChance
 
float m_threatModifier [MAX_SPELL_SCHOOL]
 
float m_modAttackSpeedPct [3]
 
uint32 _oldFactionId
 
EventProcessor m_Events
 
SpellImmuneList m_spellImmune [MAX_SPELL_IMMUNITY]
 
uint32 m_lastSanctuaryTime
 
uint32 m_AuraFlags
 
Movement::MoveSplinemovespline
 
PetAuraSet m_petAuras
 
bool IsAIEnabled
 
bool NeedChangeAI
 
uint64 LastCharmerGUID
 
bool m_ControlledByPlayer
 
- Public Attributes inherited from WorldObject
FlaggedValuesArray32< int32, uint32, StealthType, TOTAL_STEALTH_TYPESm_stealth
 
FlaggedValuesArray32< int32, uint32, StealthType, TOTAL_STEALTH_TYPESm_stealthDetect
 
FlaggedValuesArray32< int32, uint32, InvisibilityType, TOTAL_INVISIBILITY_TYPESm_invisibility
 
FlaggedValuesArray32< int32, uint32, InvisibilityType, TOTAL_INVISIBILITY_TYPESm_invisibilityDetect
 
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPESm_serverSideVisibility
 
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPESm_serverSideVisibilityDetect
 
uint32 m_groupLootTimer
 
uint64 lootingGroupLeaderGUID
 
MovementInfo m_movementInfo
 
- Public Attributes inherited from WorldLocation
uint32 m_mapId
 
- Public Attributes inherited from Position
float m_positionX
 
float m_positionY
 
float m_positionZ
 

Private Attributes

TempSummonType m_type
 
uint32 m_timer
 
uint32 m_lifetime
 
uint64 m_summonerGUID
 

Additional Inherited Members

- Public Types inherited from Unit
typedef std::set< Unit * > AttackerSet
 
typedef std::set< Unit * > ControlList
 
typedef std::pair< uint32, uint8spellEffectPair
 
typedef std::multimap< spellEffectPair, Aura * > AuraMap
 
typedef std::list< Aura * > AuraList
 
typedef std::list< DiminishingReturnDiminishing
 
typedef std::set< AuraTypeAuraTypeSet
 
typedef std::set< uint32ComboPointHolderSet
 
typedef std::set< PetAura const * > PetAuraSet
 
- Static Public Member Functions inherited from Unit
static ReputationRank GetFactionReactionTo (FactionTemplateEntry const *factionTemplateEntry, Unit const *target)
 
static bool IsDamageReducedByArmor (SpellSchoolMask damageSchoolMask, SpellEntry const *spellInfo=NULL, uint8 effIndex=MAX_SPELL_EFFECTS)
 
static UnitGetUnit (WorldObject &object, uint64 guid)
 
static PlayerGetPlayer (WorldObject &object, uint64 guid)
 
static CreatureGetCreature (WorldObject &object, uint64 guid)
 
- Static Public Member Functions inherited from WorldObject
static bool InSamePhase (WorldObject const *a, WorldObject const *b)
 
- Static Public Member Functions inherited from Position
static float NormalizeOrientation (float o)
 
- Protected Types inherited from Unit
typedef std::list< uint64DynObjectGUIDs
 
- Protected Member Functions inherited from Creature
bool CreateFromProto (uint32 guidlow, uint32 Entry, uint32 team, const CreatureData *data=NULL)
 
bool InitEntry (uint32 entry, uint32 team=ALLIANCE, const CreatureData *data=NULL)
 
void _RealtimeSetCreatureInfo ()
 
void RegenerateMana ()
 
void RegenerateHealth ()
 
bool IsInvisibleDueToDespawn () const override
 
bool CanAlwaysSee (WorldObject const *obj) const override
 
void SetBaseWalkSpeed (float speed) override
 
void SetBaseRunSpeed (float speed) override
 
- Protected Member Functions inherited from Unit
 Unit (bool isWorldObject)
 
void _UpdateSpells (uint32 time)
 
void _DeleteAuras ()
 
void _UpdateAutoRepeatSpell ()
 
void DisableSpline ()
 
bool IsAlwaysVisibleFor (WorldObject const *seer) const override
 
bool IsAlwaysDetectableFor (WorldObject const *seer) const override
 
- Protected Member Functions inherited from WorldObject
 WorldObject (bool isWorldObject)
 
void SetLocationMapId (uint32 _mapId)
 
void SetLocationInstanceId (uint32 _instanceId)
 
- Protected Member Functions inherited from Object
 Object ()
 
void _InitValues ()
 
void _Create (uint32 guidlow, uint32 entry, HighGuid guidhigh)
 
void _LoadIntoDataField (const char *data, uint32 startOffset, uint32 count)
 
virtual void _SetUpdateBits (UpdateMask *updateMask, Player *target) const
 
virtual void _SetCreateBits (UpdateMask *updateMask, Player *target) const
 
void _BuildMovementUpdate (ByteBuffer *data, uint8 updateFlags) const
 
void _BuildValuesUpdate (uint8 updatetype, ByteBuffer *data, UpdateMask *updateMask, Player *target) const
 
- Static Protected Member Functions inherited from Creature
static float _GetHealthMod (int32 Rank)
 
static float _GetDamageMod (int32 Rank)
 
- Protected Attributes inherited from Creature
VendorItemCounts m_vendorItemCounts
 
uint32 m_lootMoney
 
uint64 m_lootRecipient
 
uint32 m_lootRecipientGroup
 
uint64 _skinner
 
time_t _pickpocketLootRestore
 Timers. More...
 
uint32 m_corpseRemoveTime
 
time_t m_respawnTime
 
uint32 m_respawnDelay
 
uint32 m_corpseDelay
 
float m_respawnradius
 
uint32 m_combatPulseTime
 
uint32 m_combatPulseDelay
 
uint8 m_emoteState
 
ReactStates m_reactState
 
uint32 m_regenTimer
 
MovementGeneratorType m_defaultMovementType
 
Cell m_currentCell
 
uint32 m_DBTableGuid
 
uint32 m_equipmentId
 
bool m_AlreadyCallAssistance
 
bool m_AlreadySearchedAssistance
 
bool m_regenHealth
 
bool m_AI_locked
 
SpellSchoolMask m_meleeDamageSchoolMask
 
uint32 m_originalEntry
 
Position m_homePosition
 
bool DisableReputationGain
 
CreatureData const * m_creatureData
 
- Protected Attributes inherited from Unit
UnitAIi_AI
 
UnitAIi_disabledAI
 
bool m_AutoRepeatFirstCast
 
bool m_initiatingCombat
 
uint32 m_attackTimer [MAX_ATTACK]
 
float m_createStats [MAX_STATS]
 
AttackerSet m_attackers
 
Unitm_attacking
 
DeathState m_deathState
 
AuraMap m_Auras
 
AuraMap::iterator m_AurasUpdateIterator
 
uint32 m_removedAurasCount
 
DynObjectGUIDs m_dynObjGUIDs
 
std::list< GameObject * > m_gameObj
 
bool m_isSorted
 
uint32 m_transform
 
AuraList m_removedAuras
 
AuraList m_modAuras [TOTAL_AURAS]
 
AuraList m_scAuras
 
AuraList m_interruptableAuras
 
AuraList m_ccAuras
 
uint32 m_interruptMask
 
float m_auraModifiersGroup [UNIT_MOD_END][MODIFIER_TYPE_END]
 
float m_weaponDamage [MAX_ATTACK][2]
 
bool m_canModifyStats
 
float m_speed_rate [MAX_MOVE_TYPE]
 
uint32 m_unitTypeMask
 
CharmInfom_charmInfo
 
SharedVisionList m_sharedVision
 
MotionMaster i_motionMaster
 
uint64 miniPetGuid
 
uint32 m_reactiveTimer [MAX_REACTIVE]
 
ThreatManager m_ThreatManager
 
float m_baseSpeedWalk
 
float m_baseSpeedRun
 
- Protected Attributes inherited from WorldObject
std::string m_name
 
bool m_isActive
 
const bool m_isWorldObject
 
ZoneScriptm_zoneScript
 
float m_visibilityDistanceOverride
 
- Protected Attributes inherited from Object
uint16 m_objectType
 
uint8 m_objectTypeId
 
uint8 m_updateFlag
 
union {
   int32 *   m_int32Values
 
   uint32 *   m_uint32Values
 
   float *   m_floatValues
 
}; 
 
uint32m_uint32Values_mirror
 
uint16 m_valuesCount
 
bool m_objectUpdated
 

Detailed Description

Definition at line 39 of file TemporarySummon.h.

Constructor & Destructor Documentation

TempSummon::TempSummon ( SummonPropertiesEntry const *  properties,
Unit owner,
bool  isWorldObject 
)
explicit

Definition at line 23 of file TemporarySummon.cpp.

References Object::GetGUID(), m_summonerGUID, Unit::m_unitTypeMask, and UNIT_MASK_SUMMON.

23  :
24 Creature(isWorldObject), m_Properties(properties), m_type(TEMPSUMMON_MANUAL_DESPAWN), m_timer(0), m_lifetime(0)
25 {
26  m_summonerGUID = owner ? owner->GetGUID() : 0;
28 }
despawns when UnSummon() is called
uint64 m_summonerGUID
uint64 GetGUID() const
Definition: Object.h:177
SummonPropertiesEntry const * m_Properties
uint32 m_lifetime
TempSummonType m_type
uint32 m_unitTypeMask
Definition: Unit.h:2052
Creature(bool isWorldObject=false)
Definition: Creature.cpp:145
uint32 m_timer
TempSummon::~TempSummon ( )
inlineoverride

Definition at line 43 of file TemporarySummon.h.

References TempSummonData::time, and TempSummonData::type.

43 {};

Member Function Documentation

Unit * TempSummon::GetSummoner ( ) const

Definition at line 30 of file TemporarySummon.cpp.

References ObjectAccessor::GetUnit(), and m_summonerGUID.

Referenced by Unit::DealDamage(), InitStats(), InitSummon(), RemoveFromWorld(), and UnSummon().

31 {
33 }
uint64 m_summonerGUID
static Unit * GetUnit(WorldObject const &, uint64 guid)
TempSummonType TempSummon::GetTempSummonType ( ) const
inline

Definition at line 50 of file TemporarySummon.h.

Referenced by Map::SummonCreature().

51  {
52  return m_type;
53  }
TempSummonType m_type
void TempSummon::InitStats ( uint32  lifetime)
virtual

Reimplemented in Puppet, Guardian, Minion, and Totem.

Definition at line 176 of file TemporarySummon.cpp.

References ASSERT, SummonPropertiesEntry::Faction, Map::GetCreature(), Unit::GetFaction(), Object::GetGUID(), Unit::getLevel(), WorldObject::GetMap(), GetSummoner(), Object::GetTypeId(), Unit::IsPet(), Unit::IsSummon(), Creature::IsTrigger(), Unit::m_ControlledByPlayer, m_lifetime, m_Properties, Creature::m_spells, Unit::m_SummonSlot, m_timer, m_type, Unit::SetFaction(), Unit::SetLevel(), SummonPropertiesEntry::Slot, TEMPSUMMON_DEAD_DESPAWN, TEMPSUMMON_MANUAL_DESPAWN, TEMPSUMMON_TIMED_DESPAWN, TYPEID_PLAYER, and UnSummon().

Referenced by Minion::InitStats(), and Map::SummonCreature().

177 {
178  ASSERT(!IsPet());
179 
180  m_timer = duration;
181  m_lifetime = duration;
182 
185 
186  Unit* owner = GetSummoner();
187 
188  if (owner && IsTrigger() && m_spells[0])
189  {
190  SetFaction(owner->GetFaction());
191  SetLevel(owner->getLevel());
192  if (owner->GetTypeId() == TYPEID_PLAYER)
193  m_ControlledByPlayer = true;
194  }
195 
196  if (!m_Properties)
197  return;
198 
199  if (owner)
200  {
201  if (uint32 slot = m_Properties->Slot)
202  {
203  if (owner->m_SummonSlot[slot] && owner->m_SummonSlot[slot] != GetGUID())
204  {
205  Creature* oldSummon = GetMap()->GetCreature(owner->m_SummonSlot[slot]);
206  if (oldSummon && oldSummon->IsSummon())
207  ((TempSummon*)oldSummon)->UnSummon();
208  }
209  owner->m_SummonSlot[slot] = GetGUID();
210  }
211  }
212 
213  if (m_Properties->Faction)
215 }
despawns when UnSummon() is called
bool m_ControlledByPlayer
Definition: Unit.h:1995
Map * GetMap() const
Definition: Object.h:817
uint32 GetFaction() const
Definition: Unit.h:1116
bool IsTrigger() const
Definition: Creature.h:497
uint64 m_SummonSlot[MAX_SUMMON_SLOT]
Definition: Unit.h:1607
Unit * GetSummoner() const
uint8 getLevel() const
Definition: Unit.h:1057
void UnSummon(uint32 msTime=0)
uint64 GetGUID() const
Definition: Object.h:177
despawns when the creature disappears
despawns after a specified time
uint8 GetTypeId() const
Definition: Object.h:192
uint32 m_spells[CREATURE_MAX_SPELLS]
Definition: Creature.h:612
Creature * GetCreature(uint64 guid)
Definition: Map.cpp:2630
SummonPropertiesEntry const * m_Properties
bool IsPet() const
Definition: Unit.h:1048
uint32 m_lifetime
TempSummonType m_type
void SetFaction(uint32 faction)
Definition: Unit.h:1117
#define ASSERT
Definition: Errors.h:29
void SetLevel(uint32 lvl)
Definition: Unit.cpp:10931
ACE_UINT32 uint32
Definition: Define.h:71
bool IsSummon() const
Definition: Unit.h:1046
Definition: Unit.h:908
uint32 m_timer
void TempSummon::InitSummon ( )
virtual

Reimplemented in Puppet, Guardian, and Totem.

Definition at line 217 of file TemporarySummon.cpp.

References Creature::AI(), GetSummoner(), Object::GetTypeId(), Unit::IsAIEnabled, CreatureAI::IsSummonedBy(), CreatureAI::JustSummoned(), Object::ToCreature(), and TYPEID_UNIT.

Referenced by Guardian::InitSummon(), Puppet::InitSummon(), and Map::SummonCreature().

218 {
219  Unit* owner = GetSummoner();
220  if (owner)
221  {
222  if (owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsAIEnabled)
223  owner->ToCreature()->AI()->JustSummoned(this);
224  if (IsAIEnabled)
225  AI()->IsSummonedBy(owner);
226  }
227 }
virtual void IsSummonedBy(Unit *)
Definition: CreatureAI.h:120
bool IsAIEnabled
Definition: Unit.h:1993
Unit * GetSummoner() const
uint8 GetTypeId() const
Definition: Object.h:192
CreatureAI * AI() const
Definition: Creature.h:525
Creature * ToCreature()
Definition: Object.h:371
Definition: Unit.h:908
virtual void JustSummoned(Creature *)
Definition: CreatureAI.h:119
void TempSummon::RemoveFromWorld ( )
overridevirtual

Reimplemented from Creature.

Reimplemented in Puppet, and Minion.

Definition at line 266 of file TemporarySummon.cpp.

References Object::GetGUID(), GetSummoner(), Object::IsInWorld(), m_Properties, Creature::RemoveFromWorld(), and SummonPropertiesEntry::Slot.

Referenced by Minion::RemoveFromWorld().

267 {
268  if (!IsInWorld())
269  return;
270 
271  if (m_Properties)
272  if (uint32 slot = m_Properties->Slot)
273  if (Unit* owner = GetSummoner())
274  if (owner->m_SummonSlot[slot] == GetGUID())
275  owner->m_SummonSlot[slot] = 0;
276 
277  //if (GetOwnerGUID())
278  // sLog.outError("Unit %u has owner guid when removed from world", GetEntry());
279 
281 }
Unit * GetSummoner() const
uint64 GetGUID() const
Definition: Object.h:177
const bool & IsInWorld() const
Definition: Object.h:150
SummonPropertiesEntry const * m_Properties
void RemoveFromWorld() override
Definition: Creature.cpp:196
ACE_UINT32 uint32
Definition: Define.h:71
Definition: Unit.h:908
void TempSummon::SaveToDB ( )
overridevirtual

Reimplemented from Creature.

Definition at line 283 of file TemporarySummon.cpp.

284 {
285 }
void TempSummon::SetSummoner ( Unit summoner)
inline

Definition at line 56 of file TemporarySummon.h.

References Object::GetGUID().

56 { m_summonerGUID = summoner->GetGUID(); }
uint64 m_summonerGUID
uint64 GetGUID() const
Definition: Object.h:177
void TempSummon::SetTempSummonType ( TempSummonType  type)

Definition at line 229 of file TemporarySummon.cpp.

References m_type.

Referenced by Map::SummonCreature().

230 {
231  m_type = type;
232 }
TempSummonType m_type
void TempSummon::UnSummon ( uint32  msTime = 0)

Definition at line 234 of file TemporarySummon.cpp.

References EventProcessor::AddEvent(), WorldObject::AddObjectToRemoveList(), Creature::AI(), ASSERT, EventProcessor::CalculateTime(), GetSummoner(), Object::GetTypeId(), Unit::IsAIEnabled, Object::IsInWorld(), Unit::IsPet(), Unit::m_Events, PET_SAVE_NOT_IN_SLOT, CreatureAI::SummonedCreatureDespawn(), Object::ToCreature(), and TYPEID_UNIT.

Referenced by Spell::EffectDummy(), Spell::EffectSummonType(), InitStats(), Update(), and Puppet::Update().

235 {
236  if (msTime)
237  {
238  UnsummonDelayEvent* pEvent = new UnsummonDelayEvent(*this);
239 
240  m_Events.AddEvent(pEvent, m_Events.CalculateTime(msTime));
241  return;
242  }
243 
244  if (IsPet())
245  {
246  ((Pet*)this)->Remove(PET_SAVE_NOT_IN_SLOT);
247  ASSERT(!IsInWorld());
248  return;
249  }
250 
251  Unit* owner = GetSummoner();
252  if (owner && owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsAIEnabled)
253  owner->ToCreature()->AI()->SummonedCreatureDespawn(this);
254 
256 }
EventProcessor m_Events
Definition: Unit.h:1636
void AddEvent(BasicEvent *Event, uint64 e_time, bool set_addtime=true)
uint64 CalculateTime(uint64 t_offset)
bool IsAIEnabled
Definition: Unit.h:1993
Unit * GetSummoner() const
uint8 GetTypeId() const
Definition: Object.h:192
const bool & IsInWorld() const
Definition: Object.h:150
void AddObjectToRemoveList()
Definition: Object.cpp:2017
CreatureAI * AI() const
Definition: Creature.h:525
bool IsPet() const
Definition: Unit.h:1048
Creature * ToCreature()
Definition: Object.h:371
#define ASSERT
Definition: Errors.h:29
virtual void SummonedCreatureDespawn(Creature *)
Definition: CreatureAI.h:122
Definition: Unit.h:908
Definition: Pet.h:146
void TempSummon::Update ( uint32  time)
overridevirtual

Reimplemented from Creature.

Reimplemented in Puppet, and Totem.

Definition at line 35 of file TemporarySummon.cpp.

References CORPSE, DEAD, Object::GetEntry(), Unit::IsAlive(), Unit::isCharmed(), Unit::IsInCombat(), Unit::m_deathState, m_lifetime, m_timer, m_type, sLog, TEMPSUMMON_CORPSE_DESPAWN, TEMPSUMMON_CORPSE_TIMED_DESPAWN, TEMPSUMMON_DEAD_DESPAWN, TEMPSUMMON_MANUAL_DESPAWN, TEMPSUMMON_TIMED_DESPAWN, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_CHARM, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, UnSummon(), and Creature::Update().

Referenced by Puppet::Update().

36 {
37  Creature::Update(diff);
38 
39  if (m_deathState == DEAD)
40  {
41  UnSummon();
42  return;
43  }
44  switch (m_type)
45  {
47  break;
49  {
50  if (m_timer <= diff)
51  {
52  UnSummon();
53  return;
54  }
55 
56  m_timer -= diff;
57  break;
58  }
60  {
61  if (!IsInCombat())
62  {
63  if (m_timer <= diff)
64  {
65  UnSummon();
66  return;
67  }
68 
69  m_timer -= diff;
70  }
71  else if (m_timer != m_lifetime)
73 
74  break;
75  }
76 
78  {
79  if (m_deathState == CORPSE)
80  {
81  if (m_timer <= diff)
82  {
83  UnSummon();
84  return;
85  }
86 
87  m_timer -= diff;
88  }
89  break;
90  }
92  if (!isCharmed())
93  {
94  if (m_timer <= diff)
95  {
96  UnSummon();
97  return;
98  }
99  else
100  m_timer -= diff;
101  }
102  break;
104  {
105  // if m_deathState is DEAD, CORPSE was skipped
106  if (m_deathState == CORPSE || m_deathState == DEAD)
107  {
108  UnSummon();
109  return;
110  }
111 
112  break;
113  }
115  {
116  if (m_deathState == DEAD)
117  {
118  UnSummon();
119  return;
120  }
121  break;
122  }
124  {
125  // if m_deathState is DEAD, CORPSE was skipped
126  if (m_deathState == CORPSE || m_deathState == DEAD)
127  {
128  UnSummon();
129  return;
130  }
131 
132  if (!IsInCombat())
133  {
134  if (m_timer <= diff)
135  {
136  UnSummon();
137  return;
138  }
139  else
140  m_timer -= diff;
141  }
142  else if (m_timer != m_lifetime)
144  break;
145  }
147  {
148  // if m_deathState is DEAD, CORPSE was skipped
149  if (m_deathState == DEAD)
150  {
151  UnSummon();
152  return;
153  }
154 
155  if (!IsInCombat() && IsAlive())
156  {
157  if (m_timer <= diff)
158  {
159  UnSummon();
160  return;
161  }
162  else
163  m_timer -= diff;
164  }
165  else if (m_timer != m_lifetime)
167  break;
168  }
169  default:
170  UnSummon();
171  sLog.outError("Temporary summoned creature (entry: %u) has unknown type %u. ", GetEntry(), m_type);
172  break;
173  }
174 }
despawns when UnSummon() is called
Definition: Unit.h:440
bool IsInCombat() const
Definition: Unit.h:1243
#define sLog
Log class singleton.
Definition: Log.h:187
decharms after a specified time after the cresture is out of charm
Definition: Unit.h:439
despawns after a specified time OR when the creature dies
void UnSummon(uint32 msTime=0)
despawns when the creature disappears
despawns after a specified time
bool IsAlive() const
Definition: Unit.h:1336
DeathState m_deathState
Definition: Unit.h:2025
despawns after a specified time after the creature is out of combat
uint32 m_lifetime
despawns after a specified time OR when the creature disappears
despawns after a specified time after death
TempSummonType m_type
void Update(uint32 time) override
Definition: Creature.cpp:467
uint32 GetEntry() const
Definition: Object.h:186
bool isCharmed() const
Definition: Unit.h:1434
despawns instantly after death
uint32 m_timer

Member Data Documentation

uint32 TempSummon::m_lifetime
private

Definition at line 62 of file TemporarySummon.h.

Referenced by InitStats(), and Update().

SummonPropertiesEntry const* TempSummon::m_Properties
uint64 TempSummon::m_summonerGUID
private

Definition at line 63 of file TemporarySummon.h.

Referenced by GetSummoner(), and TempSummon().

uint32 TempSummon::m_timer
private

Definition at line 61 of file TemporarySummon.h.

Referenced by InitStats(), and Update().

TempSummonType TempSummon::m_type
private

Definition at line 60 of file TemporarySummon.h.

Referenced by InitStats(), SetTempSummonType(), and Update().


The documentation for this class was generated from the following files: