140#pragma warning(disable:4355)
152#pragma warning(default:4355)
204 for (
uint8 i = 0; i < maxAttackType; ++i)
361 init.
MoveTo(x, y, z, generatePath, forceDestination);
384 uint32 const positionUpdateDelay = 400;
398 transport->CalculatePassengerPosition(loc.x, loc.y, loc.z, &loc.
orientation);
417 ? (fabs(ground - loc.z) <= fabs(floor - loc.z) ? ground : floor)
419 if (loc.z < terrainZ)
455 float distsq = dx * dx + dy * dy + dz * dz;
458 float maxdist = dist2compare + sizefactor;
460 return distsq < maxdist * maxdist;
471 float distsq = dx * dx + dy * dy + dz * dz;
474 float maxdist = dist + sizefactor;
476 return distsq < maxdist * maxdist;
482 if (combat_reach < 0.1f)
486 if (attacker_number > 0)
489 GetAngle(obj) + (attacker_number ? (
static_cast<float>(
M_PI / 2) -
static_cast<float>(
M_PI) * (
float)
rand_norm()) *
float(attacker_number) / combat_reach * 0.3f : 0));
516 m_interruptMask |= (*i)->GetBase()->GetSpellInfo()->AuraInterruptFlags;
531 if (!casterStateAuras.empty())
533 for (Unit::AuraEffectList::const_iterator i = casterStateAuras.begin(); i != casterStateAuras.end(); ++i)
536 if ((*i)->GetCaster() &&
IsFriendlyTo((*i)->GetCaster()))
539 bool failCast =
true;
540 for (Unit::AuraEffectList::iterator j = targetStateAuras.begin(); j != targetStateAuras.end();)
542 if (((*i)->GetId() == (*j)->GetId()) && ((*i)->GetCasterGUID() == (*i)->GetCasterGUID()))
545 j = targetStateAuras.erase(j);
557 if (!targetStateAuras.empty())
559 for (Unit::AuraEffectList::const_iterator i = targetStateAuras.begin(); i != targetStateAuras.end(); ++i)
560 if (!(*i)->GetCaster() || !
IsFriendlyTo((*i)->GetCaster()))
572 for (AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
573 if (
SpellInfo const* iterSpellProto = (*itr)->GetSpellInfo())
574 if (iterSpellProto->SpellFamilyName == familyName && iterSpellProto->SpellFamilyFlags[0] & familyFlags)
582 for (AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
583 if ((!excludeAura || excludeAura != (*itr)->GetSpellInfo()->Id) &&
593 excludeAura = currentChanneledSpell->GetSpellInfo()->Id;
663 victim != NULL, victim && victim->
isDead());
727 int32 resistMech = 0;
737 if (resistMech < temp)
774 uint32 roll = std::rand() % 10000;
784 int32 resist_mech = 0;
792 if (resist_mech < temp * 100)
793 resist_mech = temp * 100;
801 bool canDodge =
true;
802 bool canParry =
true;
811 tmp += resist_chance;
825 tmp += deflect_chance;
862 for (AuraEffectList::const_iterator i = ignore.begin(); i != ignore.end(); ++i)
864 if (!(*i)->IsAffectingSpell(spellInfo))
878 SF_LOG_DEBUG(
"entities.unit",
"Spell %u SPELL_AURA_IGNORE_COMBAT_RESULT has unhandled state %d", (*i)->GetId(), (*i)->GetMiscValue());
892 dodgeChance -=
int32(
ToPlayer()->GetExpertiseDodgeOrParryReduction(attType) * 100.0f);
898 if (roll < (tmp += dodgeChance))
908 parryChance -=
int32(
ToPlayer()->GetExpertiseDodgeOrParryReduction(attType) * 100.0f);
945 thisLevel = std::max<int32>(thisLevel, spellInfo->
SpellLevel);
951 modHitChance = 96 - leveldif;
953 modHitChance = 94 - (leveldif - 2) * lchance;
966 int32 HitChance = modHitChance * 100;
972 int32 tmp = 10000 - HitChance;
974 int32 rand = std::rand() % 10000;
981 tmp += resist_chance;
991 tmp += deflect_chance;
1034 for (Unit::AuraEffectList::const_iterator i = mReflectSpellsSchool.begin(); i != mReflectSpellsSchool.end(); ++i)
1036 reflectchance += (*i)->GetAmount();
1078 return dodge > 0.0f ? dodge : 0.0f;
1088 float chance = 0.0f;
1092 if (player->CanParry())
1111 return chance > 0.0f ? chance : 0.0f;
1116 float miss_chance = 5.00f;
1133 if (player->CanBlock())
1136 if (tmpitem && !tmpitem->
IsBroken())
1150 return block > 0.0f ? block : 0.0f;
1221 if (i->second->IsExpired())
1228 if (itr->second->IsNeedClientUpdate())
1229 itr->second->ClientUpdate();
1235 GameObjectList::iterator itr;
1238 if (!(*itr)->isSpawned())
1240 (*itr)->SetOwnerGUID(0);
1241 (*itr)->SetRespawnTime(0);
1459 return spell->GetCastTime();
1514 if (liquid && liquid->
SpellId)
1546 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
1548 if ((*i)->IsAffectingSpell(affectedSpell) && (*i)->GetAmount() > modifier)
1549 modifier = (*i)->GetAmount();
1560 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
1562 if ((*i)->IsAffectingSpell(affectedSpell) && (*i)->GetAmount() < modifier)
1563 modifier = (*i)->GetAmount();
1622 for (DynObjectList::const_iterator i =
m_dynObj.begin(); i !=
m_dynObj.end(); ++i)
1656 for (GameObjectList::const_iterator i =
m_gameObj.begin(); i !=
m_gameObj.end(); ++i)
1657 if ((*i)->GetSpellId() == spellId)
1733 GameObjectList::iterator i, next;
1737 if (spellid == 0 || (*i)->GetSpellId() == spellid)
1739 (*i)->SetOwnerGUID(0);
1742 (*i)->SetRespawnTime(0);
1758 GameObjectList::iterator i =
m_gameObj.begin();
1759 (*i)->SetOwnerGUID(0);
1760 (*i)->SetRespawnTime(0);
1798 data <<
uint32(overkill > 0 ? overkill : 0);
1827 log.
damage = Damage - AbsorbedDamage - Resist - Blocked;
1828 log.
absorb = AbsorbedDamage;
1987 SF_LOG_DEBUG(
"entities.unit",
"WORLD: Sending SMSG_ATTACKER_STATE_UPDATE");
1999 buff <<
uint32(overkill < 0 ? 0 : overkill);
2000 buff <<
uint8(count);
2002 for (
uint32 i = 0; i < count; ++i)
2005 buff << float(damageInfo->
damage);
2011 for (
uint32 i = 0; i < count; ++i)
2017 for (
uint32 i = 0; i < count; ++i)
2044 for (
uint8 i = 0; i < 2; ++i)
2070 dmgInfo.
damage = Damage - AbsorbDamage - Resist - BlockedAmount;
2072 dmgInfo.
absorb = AbsorbDamage;
2090 if (pet->isControlled())
2098 switch (new_powertype)
2127 SF_LOG_ERROR(
"entities.unit",
"Player %s has invalid faction (faction template id) #%u", player->GetName().c_str(),
getFaction());
2129 SF_LOG_ERROR(
"entities.unit",
"Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureTemplate()->Entry,
getFaction());
2157 if (selfPlayerOwner)
2163 else if (targetPlayerOwner)
2177 if (selfPlayerOwner && targetPlayerOwner)
2180 if (selfPlayerOwner == targetPlayerOwner)
2199 if (selfPlayerOwner)
2209 if (targetFactionEntry->CanHaveReputation())
2234 if (!factionTemplateEntry)
2238 if (!targetFactionTemplateEntry)
2247 if (
ReputationRank const* repRank = targetPlayerOwner->GetReputationMgr().GetForcedRankIfAny(factionTemplateEntry))
2253 if (factionEntry->CanHaveReputation())
2256 ReputationRank repRank = targetPlayerOwner->GetReputationMgr().GetRank(factionEntry);
2257 if (targetPlayerOwner->GetReputationMgr().IsAtWar(factionEntry))
2266 if (factionTemplateEntry->
IsHostileTo(*targetFactionTemplateEntry))
2268 if (factionTemplateEntry->
IsFriendlyTo(*targetFactionTemplateEntry))
2270 if (targetFactionTemplateEntry->
IsFriendlyTo(*factionTemplateEntry))
2291 if (!my_faction || !my_faction->
faction)
2304 if (!my_faction || !my_faction->
faction)
2398 SF_LOG_FATAL(
"entities.unit",
"Unit::GetGuardianPet: Guardian " UI64FMTD " not exist.", pet_guid);
2459 if (oldPet != minion && (oldPet->IsPet() || minion->
IsPet() || oldPet->GetEntry() != minion->
GetEntry()))
2462 if (oldPet->IsPet())
2559 if (
GetGUID() == (*itr)->GetCharmerGUID())
2563 if ((*itr)->GetOwnerGUID() !=
GetGUID())
2566 (*itr)->OutDebugInfo();
2579 if ((*itr)->IsPet())
2736 for (Unit::AuraEffectList::const_iterator itr = magnetAuras.begin(); itr != magnetAuras.end(); ++itr)
2738 if (
Unit* magnet = (*itr)->GetBase()->GetCaster())
2754 for (AuraEffectList::const_iterator i = hitTriggerAuras.begin(); i != hitTriggerAuras.end(); ++i)
2756 if (
Unit* magnet = (*i)->GetBase()->GetCaster())
2798 SF_LOG_ERROR(
"entities.unit",
"Unit %u is trying to release unit %u which is neither charmed nor owned by it",
GetEntry(), target->
GetEntry());
2821 return u->isPossessed();
2852 std::vector<Unit*> nearMembers;
2857 if (
Player* Target = itr->GetSource())
2861 nearMembers.push_back(Target);
2864 if (
Unit* pet = Target->GetGuardianPet())
2866 nearMembers.push_back(pet);
2869 if (nearMembers.empty())
2872 uint32 randTarget = std::rand() % nearMembers.size();
2873 return nearMembers[randTarget];
2920 if (OldTotem->IsSummon())
2921 OldTotem->ToTempSummon()->UnSummon();
2931 data <<
uint32(OverHeal);
3028 data <<
int32(damage);
3040 data <<
uint32(powerType);
3060 if (overrideSP > 0.0f)
3064 int32 DoneAdvertisedBenefit = 0;
3067 for (AuraEffectList::const_iterator i = mDamageDone.begin(); i != mDamageDone.end(); ++i)
3068 if (((*i)->GetMiscValue() & schoolMask) != 0 &&
3069 (*i)->GetSpellInfo()->EquippedItemClass == -1 &&
3071 (*i)->GetSpellInfo()->EquippedItemInventoryTypeMask == 0)
3073 DoneAdvertisedBenefit += (*i)->GetAmount();
3086 for (AuraEffectList::const_iterator i = mDamageDoneOfStatPercent.begin(); i != mDamageDoneOfStatPercent.end(); ++i)
3088 if ((*i)->GetMiscValue() & schoolMask)
3091 Stats usedStat =
Stats((*i)->GetMiscValueB());
3096 return DoneAdvertisedBenefit;
3101 int32 TakenAdvertisedBenefit = 0;
3104 for (AuraEffectList::const_iterator i = mDamageTaken.begin(); i != mDamageTaken.end(); ++i)
3105 if (((*i)->GetMiscValue() & schoolMask) != 0)
3106 TakenAdvertisedBenefit += (*i)->GetAmount();
3108 return TakenAdvertisedBenefit;
3122 float crit_chance = 0.0f;
3128 switch (spellProto->
Id)
3163 for (AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
3165 if (!((*i)->IsAffectingSpell(spellProto)))
3168 switch ((*i)->GetMiscValue())
3173 ApplyPct(crit_chance, (*i)->GetAmount() * 25);
3188 crit_chance += aurEff->GetAmount();
3196 crit_chance += aurEff->GetAmount();
3206 crit_chance += aurEff->GetAmount();
3224 crit_chance += aura->GetAmount();
3278 crit_chance += rendAndTear->GetAmount();
3305 for (AuraEffectList::const_iterator i = critAuras.begin(); i != critAuras.end(); ++i)
3306 if ((*i)->GetCasterGUID() ==
GetGUID() && (*i)->IsAffectingSpell(spellProto))
3307 crit_chance += (*i)->GetAmount();
3310 crit_chance = crit_chance > 0.0f ? crit_chance : 0.0f;
3319 int32 crit_bonus = damage;
3320 float crit_mod = 0.0f;
3327 crit_bonus += damage;
3330 crit_bonus += damage / 2;
3336 if (crit_bonus != 0)
3337 AddPct(crit_bonus, crit_mod);
3339 crit_bonus -= damage;
3341 if (damage >
uint32(crit_bonus))
3348 crit_bonus += damage;
3356 int32 crit_bonus = damage;
3358 damage += crit_bonus;
3370 if (overrideSP > 0.0f)
3374 int32 advertisedBenefit = 0;
3377 for (AuraEffectList::const_iterator i = mHealingDone.begin(); i != mHealingDone.end(); ++i)
3378 if (!(*i)->GetMiscValue() || ((*i)->GetMiscValue() & schoolMask) != 0)
3379 advertisedBenefit += (*i)->GetAmount();
3393 for (AuraEffectList::const_iterator i = mHealingDoneOfStatPercent.begin(); i != mHealingDoneOfStatPercent.end(); ++i)
3396 Stats usedStat =
Stats((*i)->GetSpellInfo()->Effects[(*i)->GetEffIndex()].MiscValue);
3400 return advertisedBenefit;
3405 int32 advertisedBenefit = 0;
3408 for (AuraEffectList::const_iterator i = mDamageTaken.begin(); i != mDamageTaken.end(); ++i)
3409 if (((*i)->GetMiscValue() & schoolMask) != 0)
3410 advertisedBenefit += (*i)->GetAmount();
3412 return advertisedBenefit;
3419 for (SpellImmuneList::const_iterator itr = schoolList.begin(); itr != schoolList.end(); ++itr)
3420 if (itr->type & shoolMask)
3425 for (SpellImmuneList::const_iterator itr = damageList.begin(); itr != damageList.end(); ++itr)
3426 if (itr->type & shoolMask)
3438 if (spellInfo->
Id != 42292 && spellInfo->
Id != 59752)
3442 for (SpellImmuneList::const_iterator itr = schoolList.begin(); itr != schoolList.end(); ++itr)
3449 for (SpellImmuneList::const_iterator itr = damageList.begin(); itr != damageList.end(); ++itr)
3450 if (itr->type & shoolMask)
3463 for (SpellImmuneList::const_iterator itr = idList.begin(); itr != idList.end(); ++itr)
3464 if (itr->type == spellInfo->
Id)
3473 for (SpellImmuneList::const_iterator itr = dispelList.begin(); itr != dispelList.end(); ++itr)
3474 if (itr->type == spellInfo->
Dispel)
3482 for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
3483 if (itr->type == spellInfo->
Mechanic)
3487 bool immuneToAllEffects =
true;
3496 immuneToAllEffects =
false;
3501 if (immuneToAllEffects)
3504 if (spellInfo->
Id != 42292 && spellInfo->
Id != 59752)
3507 for (SpellImmuneList::const_iterator itr = schoolList.begin(); itr != schoolList.end(); ++itr)
3528 for (SpellImmuneList::const_iterator itr = effectList.begin(); itr != effectList.end(); ++itr)
3529 if (itr->type == effect)
3535 for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
3536 if (itr->type == mechanic)
3543 for (SpellImmuneList::const_iterator itr = list.begin(); itr != list.end(); ++itr)
3544 if (itr->type == aura)
3550 for (AuraEffectList::const_iterator iter = immuneAuraApply.begin(); iter != immuneAuraApply.end(); ++iter)
3564 for (SpellImmuneList::const_iterator itr = schoolList.begin(); itr != schoolList.end(); ++itr)
3574 for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
3575 mask |= (1 << itr->type);
3587 if (itr->type == type)
3602 if (itr->spellId == spellId && itr->type == type)
3621 for (AuraApplicationMap::iterator itr = auras.begin(); itr != auras.end();)
3623 SpellInfo const* spell = itr->second->GetBase()->GetSpellInfo();
3649 player->SendOnCancelExpectedVehicleRideAura();
3657 Pet* pet = player->GetPet();
3661 bool hasFlyingMountSpeedAura =
false;
3664 if (
SpellInfo const* spellInfo =
sSpellMgr->GetSpellInfo(mountCapability->SpeedModSpell))
3668 player->UnsummonPetTemporaryIfAny();
3669 else if (!player->GetTransport())
3679 player->SendMovementSetCollisionHeight(player->GetCollisionHeight(
true));
3694 thisPlayer->SendMovementSetCollisionHeight(thisPlayer->GetCollisionHeight(
false));
3718 if (
Pet* pPet = player->GetPet())
3724 player->ResummonPetTemporaryUnSummonedIfAny();
3734 if (!mountTypeEntry)
3739 uint32 ridingSkill = 5000;
3746 if (!mountCapability)
3749 if (ridingSkill < mountCapability->RequiredRidingSkill)
3762 else if (!(mountCapability->
Flags & 0x1))
3764 if (!(mountCapability->
Flags & 0x2))
3780 return mountCapability;
3904 if (playerAffectingAttacker && playerAffectingTarget)
3905 if (playerAffectingAttacker->
duel && playerAffectingAttacker->
duel->
opponent == playerAffectingTarget && playerAffectingAttacker->
duel->
startTime != 0)
3915 if (playerAffectingAttacker && playerAffectingTarget)
3994 if (selfPlayerOwner && targetPlayerOwner)
3997 if (selfPlayerOwner != targetPlayerOwner
3998 && targetPlayerOwner->
duel)
4032 int32 val = dVal + curHealth;
4041 if (val < maxHealth)
4044 gain = val - curHealth;
4046 else if (curHealth != maxHealth)
4049 gain = maxHealth - curHealth;
4064 int32 val = dVal + curHealth;
4072 if (val < maxHealth)
4074 else if (curHealth != maxHealth)
4075 gain = maxHealth - curHealth;
4090 int32 val = dVal + curPower;
4102 gain = val - curPower;
4104 else if (curPower != maxPower)
4107 gain = maxPower - curPower;
4125 return (
uint32)f_BaseAttackTime;
4141 if (ownerPlayer->IsGroupVisibleFor(seerPlayer))
4175 int32 main_speed_mod = 0;
4176 float stack_bonus = 1.0f;
4177 float non_stack_bonus = 1.0f;
4217 int32 owner_speed_mod = 0;
4222 main_speed_mod = std::max(main_speed_mod, owner_speed_mod);
4240 SF_LOG_ERROR(
"entities.unit",
"Unit::UpdateSpeed: Unsupported move type (%d)", mtype);
4245 float speed = std::max(non_stack_bonus, stack_bonus);
4247 AddPct(speed, main_speed_mod);
4264 float base_rate = 1.00f;
4269 float mult = base_rate + ((dist - 5) * 0.01f);
4283 if (speed > max_speed)
4306 float min_speed = minSpeedMod / 100.0f;
4307 if (speed < min_speed)
4361 Movement::PacketSender(
this, moveTypeToOpcode[mtype][0], moveTypeToOpcode[mtype][1], moveTypeToOpcode[mtype][2], &extra).
Send();
4411 zoneScript->OnUnitDeath(
this);
4497 if (target && target == taunter)
4525 if (!target || target != taunter)
4537 if (target && target != taunter)
4553 Unit* target = NULL;
4556 if (!tauntAuras.empty())
4558 Unit* caster = tauntAuras.back()->GetCaster();
4561 if (caster && caster->
IsAlive())
4563 else if (tauntAuras.size() > 1)
4569 AuraEffectList::const_iterator aura = --tauntAuras.end();
4573 caster = (*aura)->GetCaster();
4579 }
while (aura != tauntAuras.begin());
4599 if (owner->IsInCombat())
4603 for (ControlList::const_iterator itr = owner->m_Controlled.begin(); itr != owner->m_Controlled.end(); ++itr)
4605 if ((*itr)->IsInCombat())
4658 if (!iAuras.empty())
4660 for (Unit::AuraEffectList::const_iterator itr = iAuras.begin(); itr != iAuras.end(); ++itr)
4662 if ((*itr)->GetBase()->IsPermanent())
4686 switch (effect_index)
4711 return spellProto->
Effects[effect_index].
CalcValue(
this, basePoints, target);
4723 if (comboPoints && minduration != -1 && minduration != maxduration)
4726 duration = minduration + (minduration * comboPoints);
4728 duration = minduration +
int32((maxduration - minduration) * comboPoints / 5);
4731 duration = minduration;
4748 int32 durationMod_always = 0;
4749 int32 durationMod_not_stack = 0;
4753 if (!(mechanic & 1 << i))
4760 if (new_durationMod_always < durationMod_always)
4761 durationMod_always = new_durationMod_always;
4762 if (new_durationMod_not_stack < durationMod_not_stack)
4763 durationMod_not_stack = new_durationMod_not_stack;
4767 if (durationMod_always > durationMod_not_stack)
4768 durationMod = durationMod_not_stack;
4770 durationMod = durationMod_always;
4772 if (durationMod != 0)
4773 AddPct(duration, durationMod);
4779 if (durationMod_always)
4780 durationMod += durationMod_always;
4782 if (durationMod != 0)
4783 AddPct(duration, durationMod);
4818 return std::max(duration, 0);
4823 if (!spellProto || castTime < 0)
4841 if (i->DRGroup != group)
4868 if (i->DRGroup != group)
4928 return (creatureType >= 1) ? (1 << (creatureType - 1)) : 0;
4959 SF_LOG_ERROR(
"entities.unit",
"ERROR in HandleStatModifier(): non-existing UnitMods or wrong UnitModifierType!");
4963 switch (modifierType)
5031 SF_LOG_ERROR(
"entities.unit",
"attempt to access non-existing modifier value from UnitMods!");
5171 if (maxHealth < val)
5192 if (player->GetGroup())
5197 if (pet->isControlled())
5225 if (pet->isControlled())
5292 data <<
uint8(powerIndex);
5303 if (player->GetGroup())
5308 if (pet->isControlled())
5334 if (pet->isControlled())
5342 if (val < cur_power)
5441 if (owner->m_Controlled.find(
this) != owner->m_Controlled.end())
5443 SF_LOG_FATAL(
"entities.unit",
"Unit %u is in controlled list of %u when removed from world",
GetEntry(), owner->GetEntry());
5546 _oldReactState = _unit->ToCreature()->GetReactState();
5547 _unit->ToCreature()->SetReactState(REACT_PASSIVE);
5600 switch (
_unit->GetEntry())
5611 uint32 spellId =
_unit->ToCreature()->m_spells[i];
5638 uint32 spellId =
_unit->ToCreature()->m_spells[x];
5912 data << (
uint8)state;
5951 if (!transforms.empty())
5954 for (Unit::AuraEffectList::const_reverse_iterator i = transforms.rbegin(); i != transforms.rend(); ++i)
5961 if (!aurApp->IsPositive())
6045 std::list<Unit*> targets;
6055 targets.remove(exclude);
6058 for (std::list<Unit*>::iterator tIter = targets.begin(); tIter != targets.end();)
6061 targets.erase(tIter++);
6067 if (targets.empty())
6126 if (CastingTime > 7000) CastingTime = 7000;
6127 if (CastingTime < 1500) CastingTime = 1500;
6134 bool DirectDamage =
false;
6135 bool AreaEffect =
false;
6147 DirectDamage =
true;
6174 if (overTime > 0 && CastingTime > 0 && DirectDamage)
6178 if (OriginalCastTime > 7000) OriginalCastTime = 7000;
6179 if (OriginalCastTime < 1500) OriginalCastTime = 1500;
6181 float PtOT = (overTime / 15000.0f) / ((overTime / 15000.0f) + (OriginalCastTime / 3500.0f));
6183 if (damagetype ==
DOT)
6184 CastingTime =
uint32(CastingTime * PtOT);
6185 else if (PtOT < 1.0f)
6186 CastingTime =
uint32(CastingTime * (1 - PtOT));
6207 for (
uint8 i = 0; i < effects; ++i)
6208 CastingTime *= 0.95f;
6216 float DotFactor = 1.0f;
6217 if (damagetype ==
DOT)
6221 DotFactor = DotDuration / 15000.0f;
6224 DotFactor /= DotTicks;
6232 return (CastingTime / 3500.0f) * DotFactor;
6242 pet->CastPetAura(petSpell);
6252 pet->RemoveAurasDueToSpell(petSpell->
GetAura(pet->GetEntry()));
6306 SF_LOG_ERROR(
"entities.unit",
"Pet::InitStatsForLevel() failed for creature (Entry: %u)!", pet->
GetEntry());
6352 bool isRewardAllowed =
true;
6356 if (!isRewardAllowed)
6365 if (isRewardAllowed && player && player != victim)
6409 group->BroadcastPacket(&data, group->GetMemberGroup(player->
GetGUID()));
6413 group->UpdateLooterGuid(creature,
true);
6414 if (group->GetLooterGuid())
6420 group->SendLooter(creature, looter);
6423 group->SendLooter(creature, NULL);
6426 group->SendLooter(creature, NULL);
6428 group->UpdateLooterGuid(creature);
6485 bool spiritOfRedemption =
false;
6489 for (AuraEffectList::const_iterator itr = dummyAuras.begin(); itr != dummyAuras.end(); ++itr)
6491 if ((*itr)->GetSpellInfo()->SpellIconID == 1654)
6504 victim->
CastSpell(victim, 27827,
true, NULL, aurEff);
6505 spiritOfRedemption =
true;
6511 if (!spiritOfRedemption)
6533 plrVictim->SetPvPDeath(player != NULL);
6540 SF_LOG_DEBUG(
"entities.unit",
"We are dead, losing %u percent durability", loss);
6542 plrVictim->DurabilityLossAll(baseLoss,
false);
6551 if (plrVictim->duel)
6553 plrVictim->duel->opponent->CombatStopWithPets(
true);
6554 plrVictim->CombatStopWithPets(
true);
6562 if (creature && !creature->
IsPet())
6579 if (
Unit* summoner = summon->GetSummoner())
6580 if (summoner->ToCreature() && summoner->IsAIEnabled)
6581 summoner->ToCreature()->AI()->SummonedCreatureDies(creature,
this);
6590 if (instanceMap->
IsInstance() && creditedPlayer)
6595 ((
InstanceMap*)instanceMap)->PermBindAllPlayers(creditedPlayer);
6603 if (save->GetResetTime() < resettime) save->SetResetTime(resettime);
6611 if (player &&
this != victim)
6614 pvp->HandleKill(player, victim);
6617 bf->HandleKill(player, victim);
6630 bg->HandleKillPlayer(playerVictim, player);
6632 bg->HandleKillUnit(victim->
ToCreature(), player);
6651 sScriptMgr->OnCreatureKill(killerPlr, killedCre);
6656 sScriptMgr->OnPlayerKilledByCreature(killerCre, killed);
6662 float offset = 0.0f;
6822 Unit* caster = NULL;
6824 if (!fearAuras.empty())
6833 if (!fearAuras2.empty())
6895 if (
this == charmer)
6962 if (player->
isAFK())
7071 creature->AI()->OnCharmed(
false);
7275 Group* group = NULL;
7285 Player* Target = itr->GetSource();
7291 TagUnitMap.push_back(Target);
7294 if (pet->IsAlive() &&
IsInMap(Target))
7295 TagUnitMap.push_back(pet);
7302 TagUnitMap.push_back(owner);
7304 if (pet->IsAlive() && (pet ==
this ||
IsInMap(pet)))
7305 TagUnitMap.push_back(pet);
7312 return entry->IsContestedGuardFaction();
7358 data <<
uint16(ReflectStatus);
7361 data << float(orientation);
7365 data <<
uint32(SpellVisualId);
7368 data <<
uint16(MissReason);
7388 data <<
uint32(Duration);
7390 data <<
uint32(SpellVisualId);
7405 Unit const* target = NULL;
7430 float hitChance = 100.0f;
7439 missChance += hitChance - 100.0f;
7447 if (missChance < 0.0f)
7449 if (missChance > 60.0f)
7486 offlineThreatList.sort();
7487 threatList.merge(offlineThreatList);
7489 for (std::list<HostileReference*>::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
7490 if (
Unit* unit = (*itr)->getTarget())
7503 (*itr)->SetPhaseMask(newPhaseMask,
true);
7508 summon->SetPhaseMask(newPhaseMask,
true);
7545 offlineThreatList.sort();
7546 threatList.merge(offlineThreatList);
7548 for (std::list<HostileReference*>::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
7549 if (
Unit* unit = (*itr)->getTarget())
7550 unit->getHostileRefManager().setOnlineOfflineState(
ToCreature(), unit->
IsPhased(
this));
7556 (*itr)->SetPhased(
id,
true, apply);
7561 summon->SetPhased(
id,
true, apply);
7585 data << float(speedXY);
7586 data << float(vsin);
7587 data << float(speedZ);
7589 data << float(vcos);
7605 if (player && player->
m_mover !=
this)
7623 return player->GetRatingBonusValue(cr);
7627 return owner->GetRatingBonusValue(cr);
7991 if (totemType == 3211)
7994 if (totemType == 3403)
7997 if (totemType == 3402)
8000 if (totemType == 3406)
8003 if (totemType == 3407)
8006 if (totemType == 3405)
8009 if (totemType == 3399)
8012 if (totemType == 3400)
8141 float angle = forward ? 0 :
M_PI;
8162 bool result =
false;
8165 for (SpellClickInfoContainer::const_iterator itr = clickPair.first; itr != clickPair.second; ++itr)
8168 if (!itr->second.IsFitToRequirements(clicker,
this))
8200 SF_LOG_ERROR(
"sql.sql",
"Spell %u specified in npc_spellclick_spells is not a valid vehicle enter aura!", itr->second.spellId);
8285 if (seat ==
m_vehicle->Seats.end() || !seat->second.IsEmpty())
8290 for (AuraEffectList::const_iterator itr = vehicleAuras.begin(); itr != vehicleAuras.end(); ++itr)
8292 if ((*itr)->GetCasterGUID() !=
GetGUID())
8296 ASSERT(!rideVehicleEffect);
8297 rideVehicleEffect = *itr;
8301 ASSERT(rideVehicleEffect);
8350 pos = *exitPosition;
8400 Position pos = { x, y, z, orientation };
8414 bool hasTimestamp = mi.
time;
8419 bool hasTransportTime2 = hasTransportData &&
m_movementInfo.transport.time2 != 0;
8420 bool hasTransportTime3 =
false;
8421 bool hasTransportVehicleId = hasTransportData &&
m_movementInfo.transport.time3 != 0;
8424 bool hasFallData = hasFallDirection ||
m_movementInfo.jump.fallTime != 0;
8437 for (; *sequence !=
MSEEnd; ++sequence)
8461 if (hasTransportData)
8482 if (hasTransportData)
8507 if (hasTransportData)
8511 if (hasTransportData)
8525 data.
WriteBit(!hasSplineElevation);
8531 if (!hasMountDisplayId)
8537 if (hasMovementFlags)
8541 if (hasMovementFlags2)
8565 if (hasTransportData)
8569 if (hasTransportData)
8573 if (hasTransportData)
8577 if (hasTransportData)
8581 if (hasTransportData)
8585 if (hasTransportData)
8589 if (hasTransportData && hasTransportTime2)
8593 if (hasTransportData && hasTransportTime3)
8609 if (hasFallData && hasFallDirection)
8613 if (hasFallData && hasFallDirection)
8617 if (hasFallData && hasFallDirection)
8621 if (hasSplineElevation)
8648 data.
WriteBit(hasTransportVehicleId);
8651 if (hasTransportVehicleId)
8706 SF_LOG_DEBUG(
"entities.unit",
"Unit::UpdatePosition(%f, %f, %f) .. bad coordinates!", x, y, z);
8732 return (relocated || turn);
8762 SF_LOG_DEBUG(
"entities.unit",
"WORLD: Send SMSG_THREAT_UPDATE Message");
8771 for (ThreatContainer::StorageType::const_iterator itr = tlist.begin(); itr != tlist.end(); ++itr)
8773 ObjectGuid UnitThreatGUID = (*itr)->getUnitGuid();
8780 for (ThreatContainer::StorageType::const_iterator itr = tlist.begin(); itr != tlist.end(); ++itr)
8782 ObjectGuid UnitThreatGUID = (*itr)->getUnitGuid();
8784 data <<
uint32((*itr)->getThreat() * 100);
8798 SF_LOG_DEBUG(
"entities.unit",
"WORLD: Send SMSG_HIGHEST_THREAT_UPDATE Message");
8819 for (ThreatContainer::StorageType::const_iterator itr = tlist.begin(); itr != tlist.end(); ++itr)
8838 for (ThreatContainer::StorageType::const_iterator itr = tlist.begin(); itr != tlist.end(); ++itr)
8844 data <<
uint32((*itr)->getThreat());
8885 SF_LOG_DEBUG(
"entities.unit",
"WORLD: Send SMSG_THREAT_REMOVE Message");
8928 addRage = floor(0.5f + (25.7f * baseRage /
GetMaxHealth()));
8943 if (victim->GetFactionTemplateEntry()->faction == faction_id)
8956 for (AttackerSet::const_iterator itr = attackers.begin(); itr != attackers.end();)
8958 if ((*itr)->GetFactionTemplateEntry()->faction == faction_id)
8960 (*itr)->AttackStop();
8961 itr = attackers.begin();
8970 (*itr)->StopAttackFaction(faction_id);
8985 cell.
Visit(p, world_unit_searcher, *
GetMap(), *
this, fMaxSearchRange);
8986 cell.
Visit(p, grid_unit_searcher, *
GetMap(), *
this, fMaxSearchRange);
8998 std::ostringstream o;
8999 o <<
"Summon Slot: ";
9003 SF_LOG_INFO(
"entities.unit",
"%s", o.str().c_str());
9006 o <<
"Controlled List: ";
9008 o << (*itr)->GetGUID() <<
", ";
9009 SF_LOG_INFO(
"entities.unit",
"%s", o.str().c_str());
9014 o << itr->first <<
", ";
9015 SF_LOG_INFO(
"entities.unit",
"%s", o.str().c_str());
9020 o <<
"Passenger List: ";
9023 o << passenger->GetGUID() <<
", ";
9024 SF_LOG_INFO(
"entities.unit",
"%s", o.str().c_str());
9035 for (AuraEffectList::const_iterator i = periodicAuras.begin(); i != periodicAuras.end(); ++i)
9037 if ((*i)->GetCasterGUID() != caster || (*i)->GetId() != spellId || (*i)->GetEffIndex() != effectIndex || !(*i)->GetTotalTicks())
9039 amount +=
uint32(((*i)->GetAmount() * std::max<int32>((*i)->GetTotalTicks() -
int32((*i)->GetTickNumber()), 0)) / (*i)->GetTotalTicks());
9080 G3D::Vector3
const stayPos =
_unit->movespline->FinalDestination();
9393 for (
uint16 index = 0; index < valCount; ++index)
9400 updateMask.
SetBit(index);
9410 fieldBuffer <<
uint32(appendValue);
9438 fieldBuffer <<
uint32(appendValue);
9454 cinfo = transformInfo;
9477 fieldBuffer <<
uint32(displayId);
9502 fieldBuffer << dynamicFlags;
9536 data->
append(fieldBuffer);
9550 data <<
uint32(vehicleId);
9554 player->SendDirectMessage(&data);
9561 data <<
uint32(vehicleId);
std::list< Condition * > ConditionList
@ CREATURE_FLAG_EXTRA_NO_BLOCK
@ CREATURE_FLAG_EXTRA_TRIGGER
@ CREATURE_FLAG_EXTRA_INSTANCE_BIND
@ CREATURE_FLAG_EXTRA_NO_PARRY
@ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED
@ ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE
@ ACHIEVEMENT_CRITERIA_TYPE_TOTAL_HEALING_RECEIVED
@ ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_PLAYER
@ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED
@ ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE
@ ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS
@ FACTION_TEMPLATE_FLAG_HOSTILE_BY_DEFAULT
@ FACTION_TEMPLATE_FLAG_CONTESTED_GUARD
DBCStorage< FactionEntry > sFactionStore(FactionEntryfmt)
DBCStorage< SpellShapeshiftFormEntry > sSpellShapeshiftFormStore(SpellShapeshiftFormfmt)
DBCStorage< VehicleEntry > sVehicleStore(VehicleEntryfmt)
DBCStorage< MountCapabilityEntry > sMountCapabilityStore(MountCapabilityfmt)
uint32 GetPowerIndexByClass(uint32 powerType, uint32 classId)
DBCStorage< FactionTemplateEntry > sFactionTemplateStore(FactionTemplateEntryfmt)
DBCStorage< MountTypeEntry > sMountTypeStore(MountTypefmt)
DBCStorage< LiquidTypeEntry > sLiquidTypeStore(LiquidTypefmt)
#define MAX_SPELL_EFFECTS
#define MAX_MOUNT_CAPABILITIES
TypeMapContainer< AllWorldObjectTypes > WorldTypeMapContainer
TypeMapContainer< AllGridObjectTypes > GridTypeMapContainer
CoordPair< TOTAL_NUMBER_OF_CELLS_PER_MAP > CellCoord
@ GROUP_UPDATE_FLAG_CUR_HP
@ GROUP_UPDATE_FLAG_PET_CUR_HP
@ GROUP_UPDATE_FLAG_POWER_TYPE
@ GROUP_UPDATE_FLAG_PET_CUR_POWER
@ GROUP_UPDATE_FLAG_PET_MAX_POWER
@ GROUP_UPDATE_FLAG_MAX_HP
@ GROUP_UPDATE_FLAG_PET_POWER_TYPE
@ GROUP_UPDATE_FLAG_MAX_POWER
@ GROUP_UPDATE_FLAG_LEVEL
@ GROUP_UPDATE_FLAG_PET_MAX_HP
@ GROUP_UPDATE_FLAG_CUR_POWER
#define SF_LOG_DEBUG(filterType__,...)
#define SF_LOG_FATAL(filterType__,...)
#define SF_LOG_ERROR(filterType__,...)
#define SF_LOG_INFO(filterType__,...)
LootStore LootTemplates_Creature("creature_loot_template", "creature entry", true)
MovementStatusElements const * GetMovementStatusElementsSequence(Opcodes opcode)
@ MSEMountDisplayIdWithCheck
@ MSEHasTransportVehicleId
@ MSEHasTransportGuidByte5
@ MSEMountDisplayIdWithoutCheck
@ MSEHasTransportGuidByte3
@ MSEHasTransportGuidByte6
@ MSEHasTransportGuidByte2
@ MSEHasTransportGuidByte1
@ MSEHasTransportGuidByte7
@ MSEOrientationWithoutCheck
@ MSETransportOrientation
@ MSEHasTransportGuidByte4
@ MSEHasTransportGuidByte0
#define DEFAULT_COMBAT_REACH
@ NOTIFY_VISIBILITY_CHANGED
uint32 GUID_LOPART(uint64 x)
bool IS_CREATURE_GUID(uint64 guid)
uint64 MAKE_NEW_GUID(uint32 l, uint32 e, uint32 h)
bool IS_PLAYER_GUID(uint64 guid)
std::pair< SpellClickInfoContainer::const_iterator, SpellClickInfoContainer::const_iterator > SpellClickInfoMapBounds
@ TELE_TO_NOT_LEAVE_COMBAT
@ TELE_TO_NOT_UNSUMMON_PET
@ TELE_TO_NOT_LEAVE_TRANSPORT
@ PLAYER_FLAGS_CONTESTED_PVP
#define INVENTORY_SLOT_BAG_0
@ SERVERSIDE_VISIBILITY_GM
@ SERVERSIDE_VISIBILITY_GHOST
@ SPELL_ATTR0_IMPOSSIBLE_DODGE_PARRY_BLOCK
@ SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY
@ SPELL_ATTR0_CASTABLE_WHILE_DEAD
@ SPELL_EFFECT_POWER_BURN
@ SPELL_EFFECT_HEALTH_LEECH
@ SPELL_EFFECT_ENVIRONMENTAL_DAMAGE
@ SPELL_EFFECT_POWER_DRAIN
@ SPELL_EFFECT_SCHOOL_DAMAGE
@ SPELL_EFFECT_APPLY_AURA
@ SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY
@ SPELL_ATTR1_CANT_BE_REDIRECTED
@ NPC_CLICK_CAST_TARGET_CLICKER
@ NPC_CLICK_CAST_ORIG_CASTER_OWNER
@ NPC_CLICK_CAST_CASTER_CLICKER
@ SPELL_ATTR2_AUTOREPEAT_FLAG
@ SPELL_ATTR2_NOT_RESET_AUTO_ACTIONS
SpellSchools GetFirstSchoolInMask(SpellSchoolMask mask)
uint32 const CREATURE_TYPEMASK_DEMON_OR_UNDEAD
@ UNIT_DYNFLAG_SPECIALINFO
@ UNIT_DYNFLAG_TAPPED_BY_PLAYER
@ UNIT_DYNFLAG_TRACK_UNIT
@ SPELL_DAMAGE_CLASS_RANGED
@ SPELL_DAMAGE_CLASS_MAGIC
@ SPELL_DAMAGE_CLASS_NONE
@ SPELL_DAMAGE_CLASS_MELEE
@ SPELL_ATTR6_CAN_TARGET_INVISIBLE
@ SPELL_ATTR6_ASSIST_IGNORE_IMMUNE_FLAG
@ SPELL_ATTR6_CAN_TARGET_UNTARGETABLE
#define PER_CASTER_AURA_STATE_MASK
@ SPELL_ATTR3_BLOCKABLE_SPELL
@ SPELL_ATTR3_IGNORE_HIT_RESULT
@ AURA_STATE_HEALTHLESS_35_PERCENT
@ AURA_STATE_HEALTH_ABOVE_75_PERCENT
@ AURA_STATE_HEALTHLESS_20_PERCENT
@ AURA_STATE_HUNTER_PARRY
@ SPELL_ATTR8_ATTACK_IGNORE_IMMUNE_TO_PC_FLAG
#define MAX_SPELL_IMMUNITY
@ CREATURE_TYPEFLAGS_PARTY_MEMBER
@ CREATURE_TYPEFLAGS_AID_PLAYERS
@ SPELL_SCHOOL_MASK_NORMAL
@ SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE
@ SPELL_AURA_MOD_FLIGHT_SPEED_NOT_STACK
@ SPELL_AURA_PERIODIC_DAMAGE
@ SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED
@ SPELL_AURA_MOD_MOUNTED_FLIGHT_SPEED_ALWAYS
@ SPELL_AURA_MOD_PARRY_PERCENT
@ SPELL_AURA_MOD_CRITICAL_HEALING_AMOUNT
@ SPELL_AURA_MECHANIC_DURATION_MOD_NOT_STACK
@ SPELL_AURA_MOD_POSSESS_PET
@ SPELL_AURA_MOD_INCREASE_SPEED
@ SPELL_AURA_MOD_EXPERTISE
@ SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER
@ SPELL_AURA_MOD_MOUNTED_SPEED_NOT_STACK
@ SPELL_AURA_CAST_WHILE_WALKING
@ SPELL_AURA_ADD_CASTER_HIT_TRIGGER
@ SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE
@ SPELL_AURA_REFLECT_SPELLS
@ SPELL_AURA_CONTROL_VEHICLE
@ SPELL_AURA_IGNORE_HIT_DIRECTION
@ SPELL_AURA_IGNORE_COMBAT_RESULT
@ SPELL_AURA_MOD_SPEED_NOT_STACK
@ SPELL_AURA_MOD_INCREASE_VEHICLE_FLIGHT_SPEED
@ SPELL_AURA_MOD_INVISIBILITY
@ SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT
@ SPELL_AURA_PERIODIC_HEAL
@ SPELL_AURA_MOD_ENEMY_DODGE
@ SPELL_AURA_MOD_DODGE_PERCENT
@ SPELL_AURA_MOD_INCREASE_SWIM_SPEED
@ SPELL_AURA_DEFLECT_SPELLS
@ SPELL_AURA_MOD_CRIT_DAMAGE_BONUS
@ SPELL_AURA_MOD_HEALING_DONE
@ SPELL_AURA_MOD_AURA_DURATION_BY_DISPEL
@ SPELL_AURA_MOD_RAGE_FROM_DAMAGE_DEALT
@ SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_CHANCE
@ SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT
@ SPELL_AURA_MECHANIC_DURATION_MOD
@ SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE
@ SPELL_AURA_MOD_DAMAGE_TAKEN
@ SPELL_AURA_MOD_VEHICLE_SPEED_ALWAYS
@ SPELL_AURA_MOD_ATTACKER_SPELL_CRIT_CHANCE
@ SPELL_AURA_MOD_CRIT_PCT
@ SPELL_AURA_MOD_MINIMUM_SPEED
@ SPELL_AURA_MOD_BLOCK_CRIT_CHANCE
@ SPELL_AURA_MOD_SPEED_ALWAYS
@ SPELL_AURA_MOD_DECREASE_SPEED
@ SPELL_AURA_MOD_COMBAT_RESULT_CHANCE
@ SPELL_AURA_MOD_MOUNTED_SPEED_ALWAYS
@ SPELL_AURA_MOD_WEAPON_CRIT_PERCENT
@ SPELL_AURA_SPELL_MAGNET
@ SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL
@ SPELL_AURA_MOD_DURABILITY_LOSS
@ SPELL_AURA_PERIODIC_LEECH
@ SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE
@ SPELL_AURA_MOD_DAMAGE_DONE
@ SPELL_AURA_REFLECT_SPELLS_SCHOOL
@ SPELL_AURA_MOD_MECHANIC_RESISTANCE
@ SPELL_AURA_INTERFERE_TARGETTING
@ SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED
@ SPELL_AURA_OVERRIDE_CLASS_SCRIPTS
@ SPELL_AURA_MOD_INCREASE_MOUNTED_SPEED
@ SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED
@ SPELL_AURA_MOD_BLOCK_PERCENT
@ AURA_EFFECT_HANDLE_SEND_FOR_CLIENT
@ SPELL_ATTR0_CU_REQ_CASTER_BEHIND_TARGET
@ SPELL_SPECIFIC_MAGE_POLYMORPH
DiminishingLevels GetDiminishingReturnsMaxLevel(DiminishingGroup group)
@ SPELL_GROUP_ELIXIR_BATTLE
@ SPELL_GROUP_ELIXIR_GUARDIAN
@ PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG
uint32 getMSTimeDiff(uint32 oldMSTime, uint32 newMSTime)
float baseMoveSpeed[MAX_MOVE_TYPE]
float playerBaseMoveSpeed[MAX_MOVE_TYPE]
@ UNIT_NPC_FLAG_TABARDDESIGNER
@ UNIT_NPC_FLAG_AUCTIONEER
@ UNIT_NPC_FLAG_BATTLEMASTER
@ UNIT_NPC_FLAG_INNKEEPER
@ UNIT_NPC_FLAG_SPELLCLICK
@ UNIT_NPC_FLAG_PLAYER_VEHICLE
@ UNIT_NPC_FLAG_FLIGHTMASTER
@ UNIT_NPC_FLAG_PETITIONER
@ UNIT_NPC_FLAG_SPIRITGUIDE
@ UNIT_NPC_FLAG_SPIRITHEALER
@ AURA_INTERRUPT_FLAG_TAKE_DAMAGE
@ AURA_INTERRUPT_FLAG_MOVE
@ AURA_INTERRUPT_FLAG_TURNING
@ AURA_INTERRUPT_FLAG_NOT_ABOVEWATER
@ AURA_INTERRUPT_FLAG_NOT_SEATED
@ AURA_INTERRUPT_FLAG_NOT_UNDERWATER
@ AURA_INTERRUPT_FLAG_MOUNT
@ AURA_INTERRUPT_FLAG_NOT_MOUNTED
@ MOVEMENTFLAG_WATERWALKING
@ MOVEMENTFLAG_MASK_MOVING
@ MOVEMENTFLAG_DISABLE_GRAVITY
@ MOVEMENTFLAG_FALLING_SLOW
@ MOVEMENTFLAG_MASK_MOVING_FLY
@ MOVEMENTFLAG_FALLING_FAR
@ MOVEMENTFLAG_SPLINE_ELEVATION
@ UNIT_MASK_CONTROLABLE_GUARDIAN
#define MAX_UNIT_ACTION_BAR_INDEX
float baseMoveSpeed[MAX_MOVE_TYPE]
@ SPELLMOD_CRIT_DAMAGE_BONUS
@ SPELLMOD_CRITICAL_CHANCE
@ SPELLMOD_RESIST_MISS_CHANCE
@ UNIT_MOD_DAMAGE_OFFHAND
@ UNIT_MOD_STAT_INTELLECT
@ UNIT_MOD_RESISTANCE_SHADOW
@ UNIT_MOD_RESISTANCE_FROST
@ UNIT_MOD_RESISTANCE_HOLY
@ UNIT_MOD_RESISTANCE_ARCANE
@ UNIT_MOD_ARCANE_CHARGES
@ UNIT_MOD_BURNING_EMBERS
@ UNIT_MOD_RESISTANCE_FIRE
@ UNIT_MOD_RESISTANCE_NATURE
@ UNIT_MOD_DAMAGE_MAINHAND
@ UNIT_MOD_ATTACK_POWER_RANGED
@ ACTION_BAR_INDEX_PET_SPELL_START
@ ACTION_BAR_INDEX_PET_SPELL_END
@ UNIT_STAND_STATE_SIT_HIGH_CHAIR
@ UNIT_STAND_STATE_SIT_MEDIUM_CHAIR
@ UNIT_STAND_STATE_SIT_LOW_CHAIR
@ UNIT_STAND_STATE_SIT_CHAIR
#define MAX_AGGRO_RESET_TIME
@ TRIGGERED_FULL_MASK
Will ignore most target checks (mostly DBC target checks).
@ TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE
Will ignore caster aura states including combat requirements and death state.
#define CREATURE_MAX_SPELLS
#define CURRENT_MAX_SPELL
@ CURRENT_CHANNELED_SPELL
@ CURRENT_AUTOREPEAT_SPELL
@ MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING
@ MOVEMENTFLAG2_FULL_SPEED_PITCHING
#define MAX_GAMEOBJECT_SLOT
@ UNIT_BYTE2_FLAG_FFA_PVP
@ UNIT_BYTE2_FLAG_SANCTUARY
@ UNIT_STATE_UNATTACKABLE
@ UNIT_STATE_MELEE_ATTACKING
@ SUMMON_TYPE_LIGHTSPRING
@ SUMMON_TYPE_TOTEM_EARTH
@ SUMMON_TYPE_TOTEM_WATER
@ SUMMON_TYPE_STATUE_JADE
std::list< SpellImmune > SpellImmuneList
@ UNIT_FLAG_NON_ATTACKABLE
@ UNIT_FLAG_IMMUNE_TO_NPC
@ UNIT_FLAG_DISABLE_POWERS
@ UNIT_FLAG_PVP_ATTACKABLE
@ UNIT_FLAG_NOT_SELECTABLE
@ UNIT_FLAG_NOT_ATTACKABLE_1
@ UNIT_FLAG_PLAYER_CONTROLLED
@ UNIT_FLAG2_IGNORE_REPUTATION
@ UNIT_FLAG2_DISARM_OFFHAND
@ UNIT_FLAG2_DISARM_RANGED
float playerBaseMoveSpeed[MAX_MOVE_TYPE]
uint32 UnitUpdateFieldFlags[PLAYER_END]
@ UF_FLAG_VIEWER_DEPENDENT
@ UNIT_FIELD_ATTACK_ROUND_BASE_TIME
@ UNIT_FIELD_MOD_CASTING_SPEED
@ UNIT_FIELD_STAT_POS_BUFF
@ UNIT_FIELD_SHAPESHIFT_FORM
@ UNIT_FIELD_MOUNT_DISPLAY_ID
@ UNIT_FIELD_MOD_SPELL_HASTE
@ UNIT_FIELD_RANGED_ATTACK_POWER
@ UNIT_FIELD_RESISTANCE_BUFF_MODS_NEGATIVE
@ UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER
@ UNIT_FIELD_RESISTANCE_BUFF_MODS_POSITIVE
@ UNIT_FIELD_ATTACK_POWER_MULTIPLIER
@ UNIT_FIELD_ATTACK_POWER
@ UNIT_FIELD_PET_NAME_TIMESTAMP
@ UNIT_FIELD_FACTION_TEMPLATE
@ UNIT_FIELD_COMBAT_REACH
@ UNIT_FIELD_RANGED_ATTACK_ROUND_BASE_TIME
@ UNIT_FIELD_MOD_RANGED_HASTE
@ UNIT_FIELD_HOVER_HEIGHT
@ UNIT_FIELD_STAT_NEG_BUFF
@ UNIT_FIELD_CREATED_BY_SPELL
@ OBJECT_FIELD_DYNAMIC_FLAGS
@ PLAYER_FIELD_OFFHAND_CRIT_PERCENTAGE
@ PLAYER_FIELD_DODGE_PERCENTAGE
@ PLAYER_FIELD_RANGED_CRIT_PERCENTAGE
@ PLAYER_FIELD_PARRY_PERCENTAGE
@ PLAYER_FIELD_HAIR_COLOR_ID
@ PLAYER_FIELD_OVERRIDE_SPELL_POWER_BY_APPERCENT
@ PLAYER_FIELD_CRIT_PERCENTAGE
@ PLAYER_FIELD_SPELL_CRIT_PERCENTAGE
@ PLAYER_FIELD_SELF_RES_SPELL
@ PLAYER_FIELD_BLOCK_PERCENTAGE
@ PLAYER_FIELD_PLAYER_FLAGS
bool roll_chance_f(float chance)
bool roll_chance_i(int chance)
T RoundToInterval(T &num, T floor, T ceil)
T ApplyPct(T &base, U pct)
void ApplyPercentModFloatVar(float &var, float val, bool apply)
T CalculatePct(T base, U pct)
@ VEHICLE_SPELL_RIDE_HARDCODED
AuraRemoveMode GetRemoveMode() const
void ChangeAmount(int32 newAmount, bool mark=true, bool onStackOrReapply=false)
AuraType GetAuraType() const
void HandleEffect(AuraApplication *aurApp, uint8 mode, bool apply)
uint64 GetCasterGUID() const
const AuraApplication * GetApplicationOfTarget(uint64 guid) const
void UpdateOwner(uint32 diff, WorldObject *owner)
static Aura * TryRefreshStackOrCreate(SpellInfo const *spellproto, uint32 tryEffMask, WorldObject *owner, Unit *caster, int32 *baseAmount=NULL, Item *castItem=NULL, uint64 casterGUID=0, bool *refresh=NULL)
void WriteGuidBytes(const ObjectGuid &guid, Offsets... offsets)
bool WriteBit(uint32 bit)
void WriteGuidMask(const ObjectGuid &guid, Offsets... offsets)
void WriteBits(T value, size_t bits)
void WriteByteSeq(uint8 b)
virtual void OnSpellClick(Unit *, bool &)
virtual void JustDied(Unit *)
virtual void KilledUnit(Unit *)
void OnCharmed(bool apply)
virtual void EnterEvadeMode()
uint16 GetLootMode() const
bool HasReactState(ReactStates state) const
void DespawnOrUnsummon(uint32 msTimeToDespawn=0)
bool CanFly() const OVERRIDE
bool hasLootRecipient() const
void SetLootRecipient(Unit *unit)
Player * GetLootRecipient() const
CreatureTemplate const * GetCreatureTemplate() const
bool CanCreatureAttack(Unit const *victim, bool force=true) const
bool IsDamageEnoughForLootingAndReward() const
bool isTappedBy(Player const *player) const
bool _IsTargetAcceptable(const Unit *target) const
Unit * SelectNearestTargetInAttackDistance(float dist=0) const
time_t GetRespawnTimeEx() const
bool IsInEvadeMode() const
void ResistDamage(uint32 amount)
void AbsorbDamage(uint32 amount)
void ModifyDamage(int32 amount)
WeaponAttackType m_attackType
SpellInfo const *const m_spellInfo
void BlockDamage(uint32 amount)
DamageInfo(Unit *_attacker, Unit *_victim, uint32 _damage, SpellInfo const *_spellInfo, SpellSchoolMask _schoolMask, DamageEffectType _damageType)
SpellSchoolMask const m_schoolMask
DamageEffectType const m_damageType
uint32 GetSpellId() const
uint32 GetSpellId() const
void SetOwnerGUID(uint64 owner)
uint64 GetOwnerGUID() const
void SetRespawnTime(int32 respawn)
bool HasGlobalCooldown(SpellInfo const *spellInfo) const
GlobalCooldownList m_GlobalCooldowns
void AddGlobalCooldown(SpellInfo const *spellInfo, uint32 gcd)
void CancelGlobalCooldown(SpellInfo const *spellInfo)
uint32 GetMembersCount() const
GroupReference * GetFirstMember()
bool InitStatsForLevel(uint8 level)
HostileReference * getFirst()
void deleteReferencesForFaction(uint32 faction)
void threatAssist(Unit *victim, float baseThreat, SpellInfo const *threatSpell=NULL)
void setOnlineOfflineState(bool isOnline)
HostileReference * next()
uint64 getUnitGuid() const
void CreatureRelocation(Creature *creature, float x, float y, float z, float ang, bool respawnRelocationOnFail=true)
float GetHeight(float x, float y, float z, bool checkVMap=true, float maxSearchDist=DEFAULT_HEIGHT_SEARCH) const
bool IsBattleground() const
bool IsUnderWater(float x, float y, float z) const
bool IsInWater(float x, float y, float z, LiquidData *data=0) const
Creature * GetCreature(uint64 guid)
bool IsRaidOrHeroicDungeon() const
void PlayerRelocation(Player *, float x, float y, float z, float orientation)
ZLiquidStatus getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, LiquidData *data=0) const
bool IsGuardianPet() const
void MoveJump(Position const &pos, float speedXY, float speedZ, uint32 id=EVENT_JUMP)
void MoveKnockbackFrom(float srcX, float srcY, float speedXY, float speedZ)
void MovementExpired(bool reset=true)
void MoveJumpTo(float angle, float speedXY, float speedZ)
void Clear(bool reset=true)
void MoveFleeing(Unit *enemy, uint32 time=0)
void DisableTransportPathTransformations()
void SetVelocity(float velocity)
void SetFacing(float angle)
void MoveTo(const Vector3 &destination, bool generatePath=true, bool forceDestination=false)
static Creature * GetCreatureOrPetOrVehicle(WorldObject const &, uint64)
static Player * GetPlayer(WorldObject const &, uint64 guid)
static Unit * GetUnit(WorldObject const &, uint64 guid)
static Player * FindPlayer(uint64)
void ApplyModSignedFloatValue(uint16 index, float val, bool apply)
uint8 GetByteValue(uint16 index, uint8 offset) const
void SetByteValue(uint16 index, uint8 offset, uint8 value)
ObjectGuid GetObjectGUID() const
int32 GetInt32Value(uint16 index) const
void SetInt32Value(uint16 index, int32 value)
uint32 GetUInt32Value(uint16 index) const
uint32 GetGUIDLow() const
void RemoveFieldNotifyFlag(uint16 flag)
bool RemoveUInt64Value(uint16 index, uint64 value)
void SetFlag(uint16 index, uint32 newFlag)
void RemoveFlag(uint16 index, uint32 oldFlag)
float GetFloatValue(uint16 index) const
void BuildDynamicValuesUpdate(uint8 updateType, ByteBuffer *data, Player *target) const
uint16 m_fieldNotifyFlags
const ByteBuffer & GetPackGUID() const
void BuildValuesUpdateBlockForPlayer(UpdateData *data, Player *target) const
void SetFloatValue(uint16 index, float value)
virtual void AddToWorld()
void RemoveByteFlag(uint16 index, uint8 offset, uint8 newFlag)
bool HasFlag(uint16 index, uint32 flag) const
void SetFieldNotifyFlag(uint16 flag)
void SetUInt32Value(uint16 index, uint32 value)
void ApplyPercentModFloatValue(uint16 index, float val, bool apply)
void SetUInt64Value(uint16 index, uint64 value)
bool AddUInt64Value(uint16 index, uint64 value)
void SetByteFlag(uint16 index, uint8 offset, uint8 newFlag)
uint32 GetAura(uint32 petEntry) const
bool CreateBaseAtCreatureInfo(CreatureTemplate const *cinfo, Unit *owner)
bool CreateBaseAtCreature(Creature *creature)
bool isControlled() const
void InitPetCreateSpells()
void setFactionForRace(uint8 race)
void SendAttackSwingCancelAttack()
bool IsInSameRaidWith(Player const *p) const
void SendRemoveControlBar()
void SetGroupUpdateFlag(uint32 flag)
void DuelComplete(DuelCompleteType type)
uint16 GetSkillValue(uint32 skill) const
void SendAutoRepeatCancel(Unit *target)
uint8 m_forced_speed_changes[MAX_MOVE_TYPE]
void SendDirectMessage(WorldPacket *data)
void CharmSpellInitialize()
bool HaveAtClient(WorldObject const *u) const
void UpdatePvPState(bool onlyFFA=false)
bool InBattleground() const
void PetSpellInitialize()
uint32 GetBaseSpellPowerBonus() const
Returns base spellpower bonus from spellpower stat on items, without spellpower from intellect stat.
void SetFallInformation(uint32 time, float z)
uint32 GetResurrectionSpellId()
WorldSession * GetSession() const
OutdoorPvP * GetOutdoorPvP() const
void SetViewpoint(WorldObject *target, bool apply)
static uint32 TeamForRace(uint8 race)
void RewardPlayerAndGroupAtKill(Unit *victim, bool isBattleGround)
void AddSpellAndCategoryCooldowns(SpellInfo const *spellInfo, uint32 itemId, Spell *spell=NULL, bool infinityCooldown=false)
Battleground * GetBattleground() const
void SetClientControl(Unit *target, uint8 allowMove)
bool IsGameMaster() const
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint64 miscValue1=0, uint64 miscValue2=0, uint64 miscValue3=0, Unit *unit=NULL)
bool TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options=0)
void PossessSpellInitialize()
void StopCastingBindSight()
void SendMessageToSet(WorldPacket *data, bool self) override
void SendCooldownEvent(SpellInfo const *spellInfo, uint32 itemId=0, Spell *spell=NULL, bool setCooldown=true)
Item * GetWeaponForAttack(WeaponAttackType attackType, bool useable=false) const
uint8 GetSubGroup() const
void VehicleSpellInitialize()
bool isAllowedToLoot(const Creature *creature)
void ResummonPetTemporaryUnSummonedIfAny()
uint64 GetComboTarget() const
bool CanSeeSpellClickOn(Creature const *creature) const
void SetMover(Unit *target)
bool IsInSameGroupWith(Player const *p) const
ReputationMgr & GetReputationMgr()
ProcEventInfo(Unit *actor, Unit *actionTarget, Unit *procTarget, uint32 typeMask, uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask, Spell *spell, DamageInfo *damageInfo, HealInfo *healInfo)
Unit *const _actionTarget
FactionState const * GetState(FactionEntry const *factionEntry) const
bool IsAtWar(uint32 faction_id) const
ReputationRank const * GetForcedRankIfAny(FactionTemplateEntry const *factionTemplateEntry) const
bool IsTargetingArea() const
int32 CalcValue(Unit const *caster=NULL, int32 const *basePoints=NULL, Unit const *target=NULL) const
SpellInfo const * GetSpellInfo() const
bool IsInterruptable() const
void SendChannelUpdate(uint32 time)
void prepare(SpellCastTargets const *targets, AuraEffect const *triggeredByAura=NULL)
int32 GetCastTime() const
CurrentSpellTypes GetCurrentContainer() const
void SetReferencedFromCurrent(bool yes)
void finish(bool ok=true)
SpellEffectInfo Effects[MAX_SPELL_EFFECTS]
uint32 GetMaxTicks() const
SpellInfo const * GetFirstRankSpell() const
bool IsAutocastable() const
uint32 GetCategory() const
bool IsCooldownStartedOnEvent() const
uint32 CalcCastTime(uint8 level=0, Spell *spell=NULL) const
SpellRangeEntry const * RangeEntry
uint32 GetDispelMask() const
SpellSpecificType GetSpellSpecific() const
float GetMinRange(bool positive=false) const
int32 GetMaxDuration() const
bool CanPierceImmuneAura(SpellInfo const *aura) const
uint32 GetSpellMechanicMaskByEffectMask(uint32 effectMask) const
float GetMaxRange(bool positive=false, Unit *caster=NULL, Spell *spell=NULL) const
bool IsAllowingDeadTarget() const
Mechanics GetEffectMechanic(uint8 effIndex) const
SpellSchoolMask GetSchoolMask() const
int32 GetDuration() const
bool NeedsExplicitUnitTarget() const
SpellCastResult CheckTarget(Unit const *caster, WorldObject const *target, bool implicit=true) const
bool IsAffectingArea() const
uint32 StartRecoveryCategory
SpellCastResult CheckExplicitTarget(Unit const *caster, WorldObject const *target, Item const *itemTarget=NULL) const
bool IsPositiveEffect(uint8 effIndex) const
virtual void UnSummon(uint32 msTime=0)
const SummonPropertiesEntry *const m_Properties
std::list< HostileReference * > StorageType
ThreatContainer::StorageType const & getThreatList() const
ThreatContainer::StorageType const & getOfflineThreatList() const
StorageType::const_iterator const_iterator
const_iterator begin() const
uint32 GetSpell(uint8 slot=0) const
void RemovePassenger(WorldObject *passenger)
virtual void HealReceived(Unit *, uint32 &)
virtual void HealDone(Unit *, uint32 &)
virtual void AttackStart(Unit *)
bool HasAuraTypeWithAffectMask(AuraType auratype, SpellInfo const *affectedSpell) const
void EnterVehicle(Unit *base, int8 seatId=-1)
int32 ModifyHealth(int32 val)
void ApplyResilience(Unit const *victim, int32 *damage, bool isCrit) const
uint32 m_reactiveTimer[MAX_REACTIVE]
void ClearUnitState(uint32 f)
void OutDebugInfo() const
void _EnterVehicle(Vehicle *vehicle, int8 seatId, AuraApplication const *aurApp=NULL)
void SetMinion(Minion *minion, bool apply)
void CastStop(uint32 except_spellid=0)
bool _IsValidAssistTarget(Unit const *target, SpellInfo const *bySpell) const
bool m_duringRemoveFromWorld
void RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Vehicle * GetVehicle() const
bool HealthAbovePct(int32 pct) const
void RemoveGameObject(GameObject *gameObj, bool del)
bool isTargetableForAttack(bool checkFakeDeath=true) const
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
uint32 GetSchoolImmunityMask() const
Spell * m_currentSpells[CURRENT_MAX_SPELL]
uint32 m_lastSanctuaryTime
uint32 GetMechanicImmunityMask() const
virtual void UpdateDamagePhysical(WeaponAttackType attType)=0
DiminishingLevels GetDiminishing(DiminishingGroup group)
bool HasAuraState(AuraStateType flag, SpellInfo const *spellProto=NULL, Unit const *Caster=NULL) const
void setFaction(uint32 faction)
void ApplyResistanceBuffModsPercentMod(SpellSchools school, bool positive, float val, bool apply)
void GetRandomContactPoint(const Unit *target, float &x, float &y, float &z, float distance2dMin, float distance2dMax) const
uint32 SpellCriticalDamageBonus(SpellInfo const *spellProto, uint32 damage, Unit *victim)
void SetResistanceBuffMods(SpellSchools school, bool positive, float val)
uint32 GetUnitMovementFlags() const
LiquidTypeEntry const * _lastLiquid
bool HasAuraTypeWithCaster(AuraType auratype, uint64 caster) const
void RemovePetAura(PetAura const *petSpell)
AuraApplication * GetVisibleAura(uint8 slot) const
void _UpdateAutoRepeatSpell()
int32 CalculateSpellDamage(Unit const *target, SpellInfo const *spellProto, uint8 effect_index, int32 const *basePoints=NULL) const
void SendMoveKnockBack(Player *player, float speedXY, float speedZ, float vcos, float vsin)
void IncrDiminishing(DiminishingGroup group)
Unit * SelectNearbyTarget(Unit *exclude=NULL, float dist=NOMINAL_MELEE_RANGE) const
void SetFacingTo(float ori)
void Kill(Unit *victim, bool durabilityLoss=true)
void RemoveAllControlled()
bool CanHaveThreatList() const
uint64 GetCharmGUID() const
float GetTotalStatValue(Stats stat) const
void CombatStop(bool includingCast=false)
void TrackGameObject(GameObject *gameObj)
void ClearPhases(bool update=false)
void PlayOneShotAnimKit(uint32 id)
virtual void SetTarget(uint64)=0
void SendMeleeAttackStop(Unit *victim=NULL)
ReputationRank GetReactionTo(Unit const *target) const
bool IsContestedGuard() const
bool IsValidAttackTarget(Unit const *target) const
bool isSpellBlocked(Unit *victim, SpellInfo const *spellProto, WeaponAttackType attackType=WeaponAttackType::BASE_ATTACK)
float GetSpeed(UnitMoveType mtype) const
bool SetFall(bool enable)
void _UnregisterDynObject(DynamicObject *dynObj)
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
void UpdateObjectVisibility(bool forced=true) override
uint32 getFaction() const
uint32 GetRemainingPeriodicAmount(uint64 caster, uint32 spellId, AuraType auraType, uint8 effectIndex=0) const
bool HasVisionObscured(Unit const *target) const
Diminishing m_Diminishing
void SendClearThreatListOpcode(ObjectGuid UnitGUID)
void UpdateHeight(float newZ)
Only server-side height update, does not broadcast to client.
bool IsNonMeleeSpellCasted(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
ComboPointHolderSet m_ComboPointHolders
void SetConfused(bool apply)
void _UpdateSpells(uint32 time)
Unit * GetCharmerOrOwnerOrSelf() const
void SetAnimTier(AnimTier tier)
void AddToWorld() override
bool SetPhased(uint32 id, bool update, bool apply) OVERRIDE
FactionTemplateEntry const * GetFactionTemplateEntry() const
SpellMissInfo MeleeSpellHitResult(Unit *victim, SpellInfo const *spellInfo)
void SetControlled(bool apply, UnitState state)
SpellSchools GetSpellSchoolByAuraGroup(UnitMods unitMod) const
SpellMissInfo MagicSpellHitResult(Unit *victim, SpellInfo const *spellInfo)
void SetStunned(bool apply)
uint32 GetModelForForm(ShapeshiftForm form) const
Stats GetStatByAuraGroup(UnitMods unitMod) const
float m_auraModifiersGroup[UNIT_MOD_END][MODIFIER_TYPE_END]
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, uint64 originalCaster=0)
uint32 GetResistance(SpellSchools school) const
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except=0)
void AddPetAura(PetAura const *petSpell)
float m_modAttackSpeedPct[3]
void SetPower(Powers power, int32 val)
void SendPetActionFeedback(uint8 msg) const
-------—Pet responses methods--------------—
void RemoveAurasDueToSpell(uint32 spellId, uint64 casterGUID=0, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Player * GetSpellModOwner() const
Spell * FindCurrentSpellBySpellId(uint32 spell_id) const
void SendSpellMiss(Unit *target, uint32 spellID, SpellMissInfo missInfo)
Creature * GetVehicleCreatureBase() const
void RemoveVehicleKit(bool remove=false)
uint32 m_overrideAutoattackRange
void RemoveAllGameObjects()
uint64 GetCharmerOrOwnerGUID() const
bool isPossessedByPlayer() const
std::multimap< uint32, AuraApplication * > AuraApplicationMap
void ApplyStatBuffMod(Stats stat, float val, bool apply)
float GetSpellMinRangeForTarget(Unit const *target, SpellInfo const *spellInfo) const
void _RegisterDynObject(DynamicObject *dynObj)
bool isInFrontInMap(Unit const *target, float distance, float arc=M_PI) const
bool IsPolymorphed() const
float GetUnitDodgeChance() const
ShapeshiftForm GetShapeshiftForm() const
float ApplyTotalThreatModifier(float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL)
void WriteMovementInfo(WorldPacket &data, Movement::ExtraMovementStatusElement *extras=NULL)
void RemoveNotOwnSingleTargetAuras(uint32 newPhase=0, bool phaseid=false)
float CalculateDefaultCoefficient(SpellInfo const *spellInfo, DamageEffectType damagetype) const
float GetCombatRatingReduction(CombatRating cr) const
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=NULL)
bool isSpellCrit(Unit *victim, SpellInfo const *spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType=WeaponAttackType::BASE_ATTACK) const
virtual void UpdateAttackPowerAndDamage(bool ranged=false)=0
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
void SetCreatorGUID(uint64 creator)
uint32 SpellCriticalHealingBonus(SpellInfo const *spellProto, uint32 damage, Unit *victim)
Unit * GetCharmer() const
void GetAttackableUnitListInRange(std::list< Unit * > &list, float fMaxSearchRange) const
float GetPositionZMinusOffset() const
Unit * getAttackerForHelper() const
void SendMeleeAttackStart(Unit *victim)
Pet * CreateTamedPetFrom(Creature *creatureTarget, uint32 spell_id=0)
bool IsHostileToPlayers() const
bool IsInDisallowedMountForm() const
void SendSpellDamageImmune(Unit *target, uint32 spellId)
float m_weaponDamage[uint8(WeaponAttackType::MAX_ATTACK)][2]
void SendAttackStateUpdate(CalcDamageInfo *damageInfo)
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
DynamicObject * GetDynObject(uint32 spellId)
int32 CalcSpellDuration(SpellInfo const *spellProto)
virtual bool CanFly() const =0
Unit * GetVehicleBase() const
bool haveOffhandWeapon() const
MotionMaster * GetMotionMaster()
uint64 GetPetGUID() const
void RemoveVisibleAura(uint8 slot)
void SetCharm(Unit *target, bool apply)
void SendTeleportPacket(Position &pos)
void SendHealSpellLog(ObjectGuid CasterGUID, ObjectGuid TargetGUID, uint32 SpellID, uint32 Damage, uint32 OverHeal, uint32 Absorb, bool critical=false)
uint8 getLevelForTarget(WorldObject const *) const override
bool SetCharmedBy(Unit *charmer, CharmType type, AuraApplication const *aurApp=NULL)
uint64 m_SummonSlot[MAX_SUMMON_SLOT]
void UpdateInterruptMask()
void CleanupsBeforeDelete(bool finalCleanup=true) override
uint32 GetMaxHealth() const
void TauntApply(Unit *victim)
uint64 m_ObjectSlot[MAX_GAMEOBJECT_SLOT]
virtual void UpdateResistances(uint32 school)=0
void SetFacingToObject(WorldObject *object)
void UpdateSplineMovement(uint32 t_diff)
bool IsLevitating() const
uint32 GetDamageReduction(uint32 damage) const
int32 ModSpellDuration(SpellInfo const *spellProto, Unit const *target, int32 duration, bool positive, uint32 effectMask)
float m_createStats[MAX_STATS]
bool HasAuraWithMechanic(uint32 mechanicMask) const
float ApplyEffectModifiers(SpellInfo const *spellProto, uint8 effect_index, float value) const
bool IsSplineEnabled() const
int32 GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const
void UpdateReactives(uint32 p_time)
float m_modRangedHitChance
bool IsOnVehicle(const Unit *vehicle) const
void ApplyStatPercentBuffMod(Stats stat, float val, bool apply)
void SetClass(uint8 newClass)
void ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply)
void NearTeleportTo(float x, float y, float z, float orientation, bool casting=false)
int32 GetMaxPower(Powers power) const
void StopMoving()
-------—End of Pet responses methods-------—
uint32 GetUnitMeleeSkill(Unit const *target=NULL) const
void AddPlayerToVision(Player *player)
uint64 GetMinionGUID() const
GameObject * GetGameObject(uint32 spellId) const
bool IsWithinCombatRange(const Unit *obj, float dist2compare) const
uint32 m_removedAurasCount
void RemoveAllAurasOnDeath()
uint32 m_movementCounter
Incrementing counter used in movement packets.
void SetHealth(uint32 val)
bool IsStandState() const
TempSummon * ToTempSummon()
CharmInfo * GetCharmInfo()
int32 GetMechanicResistChance(SpellInfo const *spellInfo) const
AuraMap::iterator m_auraUpdateIterator
bool m_AutoRepeatFirstCast
void TauntFadeOut(Unit *taunter)
void _DeleteRemovedAuras()
int32 ModifyPower(Powers power, int32 val)
Unit * GetNextRandomRaidMemberOrPet(float radius)
Powers GetPowerTypeByAuraGroup(UnitMods unitMod) const
int32 HealBySpell(Unit *victim, SpellInfo const *spellInfo, uint32 addHealth, bool critical=false)
bool IsNeutralToAll() const
bool HasAura(uint32 spellId, uint64 casterGUID=0, uint64 itemCasterGUID=0, uint32 reqEffMask=0) const
uint64 GetCharmerGUID() const
virtual bool HasSpell(uint32) const
float GetUnitMissChance(WeaponAttackType attType) const
void AddUnitState(uint32 f)
uint32 GetCritDamageReduction(uint32 damage) const
void ClearComboPointHolders()
void Mount(uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
void SendSpellDamageResist(Unit *target, uint32 spellId)
bool isInAccessiblePlaceFor(Creature const *c) const
int32 GetMinPower(Powers power) const
int32 DealHeal(Unit *victim, uint32 addhealth)
bool _IsValidAttackTarget(Unit const *target, SpellInfo const *bySpell, WorldObject const *obj=NULL) const
uint32 getAttackTimer(WeaponAttackType type) const
uint32 BuildAuraStateUpdateForTarget(Unit *target) const
Unit * GetRedirectThreatTarget()
float GetSpellMaxRangeForTarget(Unit const *target, SpellInfo const *spellInfo) const
void _ExitVehicle(Position const *exitPosition=NULL)
ThreatManager m_ThreatManager
bool m_ControlledByPlayer
void SetFeared(bool apply)
Unit * GetCharmerOrOwner() const
Unit * GetMeleeHitRedirectTarget(Unit *victim, SpellInfo const *spellInfo=NULL)
MotionMaster i_motionMaster
int32 GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const
bool CanUseAttackType(WeaponAttackType attacktype) const
void propagateSpeedChange()
-------—End of Pet responses methods-------—
bool SetHover(bool enable, bool packetOnly=false)
uint32 GetCreatureType() const
void SetOwnerGUID(uint64 owner)
float GetMeleeReach() const
void AddGameObject(GameObject *gameObj)
bool HandleStatModifier(UnitMods unitMod, UnitModifierType modifierType, float amount, bool apply)
void SetCurrentCastedSpell(Spell *pSpell)
void SendSetVehicleRecId(uint32 vehicleId)
bool SetSwim(bool enable)
virtual bool IsImmunedToSpell(SpellInfo const *spellInfo) const
bool isAttackReady(WeaponAttackType type=WeaponAttackType::BASE_ATTACK) const
float GetCombatReach() const
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport=false)
int32 GetHealthGain(int32 dVal)
void EnergizeBySpell(Unit *victim, uint32 SpellID, int32 Damage, Powers powertype)
AuraApplicationList m_interruptableAuras
SpellImmuneList m_spellImmune[MAX_SPELL_IMMUNITY]
void ModifyAuraState(AuraStateType flag, bool apply)
static Creature * GetCreature(WorldObject &object, uint64 guid)
bool HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName, uint32 familyFlags) const
bool isInBackInMap(Unit const *target, float distance, float arc=M_PI) const
void SetCritterGUID(uint64 guid)
bool isPossessing() const
uint32 GetNativeDisplayId() const
uint64 GetTransGUID() const override
virtual void UpdateArmor()=0
bool HealthBelowPct(int32 pct) const
void SetRooted(bool apply, bool packetOnly=false)
void AddUnitMovementFlag(uint32 f)
float GetModifierValue(UnitMods unitMod, UnitModifierType modifierType) const
float GetWeaponDamageRange(WeaponAttackType attType, WeaponDamageRange type) const
void UpdateAuraForGroup(uint8 slot)
int32 SpellBaseDamageBonusTaken(SpellSchoolMask schoolMask) const
void JumpTo(float speedXY, float speedZ, bool forward=true)
bool SetCanFly(bool enable)
HostileRefManager m_HostileRefManager
void CalcHealAbsorb(Unit *victim, SpellInfo const *spellInfo, uint32 &healAmount, uint32 &absorb)
void SendRemoveFromThreatListOpcode(HostileReference *pHostileReference)
int32 m_baseSpellCritChance
bool HasUnitMovementFlag(uint32 f) const
virtual void UpdateMaxPower(Powers power)=0
void SendPetTalk(uint32 pettalk) const
virtual bool IsInWater() const
TransportBase * GetDirectTransport() const
Returns the transport this unit is on directly (if on vehicle and transport, return vehicle).
void RewardRage(uint32 baseRage, bool attacker)
uint32 GetModelForTotem(uint32 totemType) const
void RemoveDynObject(uint32 spellId)
AttackerSet const & getAttackers() const
uint32 GetPowerIndex(uint32 powerType) const
bool SetFeatherFall(bool enable, bool packetOnly=false)
float GetTotalAuraMultiplier(AuraType auratype) const
bool HasAuraType(AuraType auraType) const
static Unit * GetUnit(WorldObject &object, uint64 guid)
bool SetWalk(bool enable)
int32 GetMaxPositiveAuraModifier(AuraType auratype) const
void SetVisibleAura(uint8 slot, AuraApplication *aur)
void setAttackTimer(WeaponAttackType type, uint32 time)
virtual bool UpdateStats(Stats stat)=0
void RemoveAllDynObjects()
float m_modMeleeHitChance
void SetPhaseMask(uint32 newPhaseMask, bool update) override
uint32 GetAttackTime(WeaponAttackType att) const
time_t GetLastDamagedTime() const
uint16 GetExtraUnitMovementFlags() const
Unit * GetMagicHitRedirectTarget(Unit *victim, SpellInfo const *spellInfo)
void StopAttackFaction(uint32 faction_id)
uint32 GetCastingTimeForBonus(SpellInfo const *spellProto, DamageEffectType damagetype, uint32 CastingTime) const
bool IsWithinMeleeRange(const Unit *obj, float dist=MELEE_RANGE) const
void RemoveAreaAurasDueToLeaveWorld()
bool CanModifyStats() const
uint16 HasExtraUnitMovementFlag(uint16 f) const
void RemoveCharmedBy(Unit *charmer)
HostileRefManager & getHostileRefManager()
int32 ModifyPowerPct(Powers power, float pct, bool apply=true)
void RemoveAurasByType(AuraType auraType, uint64 casterGUID=0, Aura *except=NULL, bool negative=true, bool positive=true)
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, uint64 casterGUID=0) const
float GetSpeedRate(UnitMoveType mtype) const
virtual void SetDisplayId(uint32 modelId)
std::set< Unit * > AttackerSet
void SendMissileCancel(uint32 spellId, bool cancel=true)
void CleanupBeforeRemoveFromMap(bool finalCleanup)
uint8 getStandState() const
int32 GetPower(Powers power) const
RedirectThreatInfo _redirectThreadInfo
int32 SpellBaseHealingBonusDone(SpellSchoolMask schoolMask) const
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage *log)
void UpdateOrientation(float orientation)
Only server-side orientation update, does not broadcast to client.
virtual bool IsUnderWater() const
float GetUnitBlockChance() const
void RemovePlayerFromVision(Player *player)
bool IsImmunedToDamage(SpellSchoolMask meleeSchoolMask) const
float GetCreateStat(Stats stat) const
void UpdateSplinePosition()
DeathState getDeathState() const
Unit * GetFirstControlled() const
void SetSpeed(UnitMoveType mtype, float rate, bool forced=false)
void ApplyCastTimePercentMod(float val, bool apply)
bool CreateVehicleKit(uint32 id, uint32 creatureEntry, bool loading=false)
virtual bool IsImmunedToSpellEffect(SpellInfo const *spellInfo, uint32 index) const
bool HasUnitState(const uint32 f) const
Player * GetAffectingPlayer() const
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply)
TimeTrackerSmall m_movesplineTimer
void FinishSpell(CurrentSpellTypes spellType, bool ok=true)
void resetAttackTimer(WeaponAttackType type=WeaponAttackType::BASE_ATTACK)
bool IsInRaidWith(Unit const *unit) const
void CastCustomSpell(Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, uint64 originalCaster=0)
bool IsInFeralForm() const
int32 GetCreatePowers(Powers power) const
std::unique_ptr< Movement::MoveSpline > movespline
static ReputationRank GetFactionReactionTo(FactionTemplateEntry const *factionTemplateEntry, Unit const *target)
bool IsFriendlyTo(Unit const *unit) const
void RemoveUnitMovementFlag(uint32 f)
void RemoveBindSightAuras()
ThreatManager & getThreatManager()
int32 GetMaxNegativeAuraModifier(AuraType auratype) const
AuraApplicationMap m_appliedAuras
int32 GetTotalAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const
CharmInfo * InitCharmInfo()
void RemoveFromWorld() override
void SendPlaySpellVisual(uint32 SpellVisualId, float x, float y, float z, float orientation, uint8 SpeedTime, uint16 MissReason, uint16 ReflectStatus)
uint32 m_attackTimer[uint8(WeaponAttackType::MAX_ATTACK)]
bool InitTamedPet(Pet *pet, uint8 level, uint32 spell_id) const
virtual void UpdateMaxHealth()=0
uint32 HasUnitTypeMask(uint32 mask) const
void SendPeriodicAuraLog(SpellPeriodicAuraLogInfo *pInfo)
float GetResistanceBuffMods(SpellSchools school, bool positive) const
SpellInfo const * m_overrideAutoattackSpellInfo
float GetStat(Stats stat) const
void SendEnergizeSpellLog(Unit *victim, uint32 spellID, int32 damage, Powers powertype)
void UpdateSpeed(UnitMoveType mtype, bool forced)
void SendDurabilityLoss(Player *receiver, uint32 percent)
uint64 GetOwnerGUID() const
bool IsControlledByPlayer() const
float GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 misc_mask) const
int32 GetMaxNegativeAuraModifierByAffectMask(AuraType auratype, SpellInfo const *affectedSpell) const
virtual SpellSchoolMask GetMeleeDamageSchoolMask() const
Minion * GetFirstMinion() const
bool HandleSpellClick(Unit *clicker, int8 seatId=-1)
bool HasBreakableByDamageAuraType(AuraType type, uint32 excludeAura=0) const
bool IsAlwaysVisibleFor(WorldObject const *seer) const override
AuraEffect * GetDummyAuraEffect(SpellFamilyNames name, uint32 iconId, uint8 effIndex) const
uint32 getTransForm() const
void SetMaxPower(Powers power, int32 val)
float GetUnitParryChance() const
bool SetDisableGravity(bool disable, bool packetOnly=false)
Powers getPowerType() const
virtual void setDeathState(DeathState s)
void SetMaxHealth(uint32 val)
void GetPartyMembers(std::list< Unit * > &units)
uint32 GetCombatRatingDamageReduction(CombatRating cr, float rate, float cap, uint32 damage) const
int32 GetTotalAuraModifier(AuraType auratype) const
void SendChangeCurrentVictimOpcode(HostileReference *pHostileReference)
uint32 GetCreatureTypeMask() const
bool HasBreakableByDamageCrowdControlAura(Unit *excludeCasterChannel=NULL) const
AuraApplicationMap & GetAppliedAuras()
std::list< AuraEffect * > AuraEffectList
void SetMinionGUID(uint64 guid)
VisibleAuraMap m_visibleAuras
uint32 GetCreateMana() const
bool IsServiceProvider() const
MountCapabilityEntry const * GetMountCapability(uint32 mountType) const
void ChangeSeat(int8 seatId, bool next=true)
void SetInFront(WorldObject const *target)
void ApplySpellDispelImmunity(const SpellInfo *spellProto, DispelType type, bool apply)
int32 GetMaxPositiveAuraModifierByAffectMask(AuraType auratype, SpellInfo const *affectedSpell) const
static Player * GetPlayer(WorldObject &object, uint64 guid)
float m_speed_rate[MAX_MOVE_TYPE]
int32 SpellBaseHealingBonusTaken(SpellSchoolMask schoolMask) const
void setPowerType(Powers power)
void SetFieldPowerType(uint32 powerType)
float MeleeSpellMissChance(Unit const *victim, WeaponAttackType attType, uint32 spellId) const
bool IsAlwaysDetectableFor(WorldObject const *seer) const override
bool IsValidAssistTarget(Unit const *target) const
Vehicle * GetVehicleKit() const
void SendPlaySpellVisualKit(uint32 SpellVisualId, uint32 Duration, int32 Type)
float m_modSpellHitChance
Guardian * GetGuardianPet() const
uint64 GetCritterGUID() const
void SendThreatListUpdate()
bool IsHostileTo(Unit const *unit) const
void ExitVehicle(Position const *exitPosition=NULL)
void SetStandState(uint8 state)
void RemoveAllMinionsByEntry(uint32 entry)
int32 SpellBaseDamageBonusDone(SpellSchoolMask schoolMask) const
virtual void UpdateUnderwaterState(Map *m, float x, float y, float z)
void KnockbackFrom(float x, float y, float speedXY, float speedZ)
int32 GetCurrentSpellCastTime(uint32 spell_id) const
uint64 GetCharmerOrOwnerOrOwnGUID() const
void SetShapeshiftForm(ShapeshiftForm form)
void GetAllMinionsByEntry(std::list< Creature * > &Minions, uint32 entry)
bool IsInPartyWith(Unit const *unit) const
void Update(uint32 time) OVERRIDE
void ProcDamageAndSpell(Unit *victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType=WeaponAttackType::BASE_ATTACK, SpellInfo const *procSpell=NULL, SpellInfo const *procAura=NULL)
SharedVisionList m_sharedVision
void SendPetAIReaction(ObjectGuid UnitGUID) const
void ApplyResistanceBuffModsMod(SpellSchools school, bool positive, float val, bool apply)
bool _isWalkingBeforeCharm
void ModSpellCastTime(SpellInfo const *spellProto, int32 &castTime, Spell *spell=NULL)
void SetPetGUID(uint64 guid)
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true)
float GetTotalAttackPowerValue(WeaponAttackType attType) const
float m_threatModifier[MAX_SPELL_SCHOOL]
void BuildValuesUpdate(uint8 updatetype, ByteBuffer *data, Player *target) const override
bool SetWaterWalking(bool enable, bool packetOnly=false)
void MonsterMoveWithSpeed(float x, float y, float z, float speed, bool generatePath=false, bool forceDestination=false)
float GetUnitCriticalChance(WeaponAttackType attackType, const Unit *victim) const
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
SpellMissInfo SpellHitResult(Unit *victim, SpellInfo const *spellInfo, bool canReflect=false)
bool BuildPacket(WorldPacket *packet)
uint32 GetBlockCount() const
void SetCount(uint32 valuesCount)
void SetBit(uint32 index)
void AppendToPacket(ByteBuffer *data)
Unit * GetBase() const
May be called from scripts.
bool AddPassenger(Unit *passenger, int8 seatId=-1)
Attempts to add a passenger to the vehicle on 'seatId'.
uint32 GetCreatureEntry() const
void RelocatePassengers()
Relocate passengers. Must be called after m_base::Relocate.
void InstallAllAccessories(bool evading)
int8 GetTransSeat() const
bool IsPhased(WorldObject const *obj) const
virtual void SetPhaseMask(uint32 newPhaseMask, bool update)
uint32 GetPhaseMask() const
InstanceScript * GetInstanceScript()
virtual void RemoveFromWorld()
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
bool IsWithinLOSInMap(WorldObject const *obj) const
virtual bool IsAlwaysDetectableFor(WorldObject const *) const
std::set< uint32 > const & GetPhases() const
void SetWorldObject(bool apply)
void SetTransport(Transport *t)
void RebuildTerrainSwaps()
virtual bool SetPhased(uint32 id, bool update, bool apply)
float GetTransOffsetX() const
ZoneScript * GetZoneScript() const
uint32 GetInstanceId() const
void setActive(bool isActiveObject)
float GetTransOffsetY() const
std::string const & GetName() const
float GetTransOffsetZ() const
virtual bool IsAlwaysVisibleFor(WorldObject const *) const
void VisitNearbyObject(float const &radius, NOTIFIER ¬ifier) const
void GetNearPoint(WorldObject const *searcher, float &x, float &y, float &z, float searcher_size, float distance2d, float absAngle) const
bool InSamePhase(WorldObject const *obj) const
WorldObject(bool isWorldObject)
void GetContactPoint(WorldObject const *obj, float &x, float &y, float &z, float distance2d=CONTACT_DISTANCE) const
uint32 GetTransTime() const
Transport * GetTransport() const
void UpdateAllowedPositionZ(float x, float y, float &z) const
void ClearPhases(bool update=false)
void AddToNotify(uint16 f)
Map const * GetBaseMap() const
float GetVisibilityRange() const
float GetDistance(WorldObject const *obj) const
float GetTransOffsetO() const
MovementInfo m_movementInfo
virtual void SendMessageToSet(WorldPacket *data, bool self)
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibility
void GetZoneAndAreaId(uint32 &zoneid, uint32 &areaid) const
bool CanSeeOrDetect(WorldObject const *obj, bool ignoreStealth=false, bool distanceCheck=false) const
bool IsInMap(WorldObject const *obj) const
virtual void UpdateObjectVisibility(bool forced=true)
Opcodes GetOpcode() const
void SendPacket(WorldPacket const *packet, bool forced=false)
Send a packet to the client.
std::string GetOpcodeNameForLogging(Opcodes id, bool isServerOpcode, uint16 opcodeNumber=0)
Lookup opcode name for human understandable logging.
@ SMSG_MOVE_SET_FLIGHT_SPEED
@ SMSG_MOVE_SET_FLIGHT_BACK_SPEED
@ SMSG_SPLINE_MOVE_STOP_SWIM
@ SMSG_MOVE_UPDATE_PITCH_RATE
@ SMSG_SET_VEHICLE_REC_ID
@ SMSG_MOVE_SET_VEHICLE_REC_ID
@ SMSG_MOVE_SET_RUN_BACK_SPEED
@ SMSG_SPLINE_MOVE_START_SWIM
@ SMSG_SPLINE_MOVE_SET_RUN_MODE
@ SMSG_PET_ACTION_FEEDBACK
@ SMSG_SPLINE_MOVE_GRAVITY_DISABLE
@ SMSG_SPLINE_MOVE_SET_RUN_SPEED
@ SMSG_SPELLORDAMAGE_IMMUNE
@ SMSG_MOVE_UPDATE_TELEPORT
@ SMSG_SPLINE_MOVE_SET_PITCH_RATE
@ SMSG_PLAY_SPELL_VISUAL_KIT
@ SMSG_SPLINE_MOVE_SET_FLIGHT_SPEED
@ SMSG_SPELL_NON_MELEE_DAMAGE_LOG
@ SMSG_SPLINE_MOVE_SET_NORMAL_FALL
@ SMSG_MOVE_UPDATE_FLIGHT_SPEED
@ SMSG_MOVE_SET_PITCH_RATE
@ SMSG_SPELL_PERIODIC_AURA_LOG
@ SMSG_MOVE_GRAVITY_DISABLE
@ SMSG_ATTACKER_STATE_UPDATE
@ SMSG_MOVE_UPDATE_FLIGHT_BACK_SPEED
@ SMSG_MOVE_UPDATE_WALK_SPEED
@ SMSG_SPLINE_MOVE_SET_LAND_WALK
@ SMSG_MOVE_GRAVITY_ENABLE
@ SMSG_MOVE_UPDATE_SWIM_SPEED
@ SMSG_SPELL_ENERGIZE_LOG
@ SMSG_SPLINE_MOVE_SET_WALK_SPEED
@ SMSG_HIGHEST_THREAT_UPDATE
@ SMSG_MOVE_UPDATE_TURN_RATE
@ SMSG_SPLINE_MOVE_SET_HOVER
@ SMSG_SPLINE_MOVE_SET_FLYING
@ SMSG_MOVE_SET_TURN_RATE
@ SMSG_SPLINE_MOVE_UNSET_HOVER
@ SMSG_SPLINE_MOVE_SET_TURN_RATE
@ SMSG_MOVE_SET_SWIM_SPEED
@ SMSG_MOVE_UPDATE_RUN_SPEED
@ SMSG_MOVE_SET_WALK_SPEED
@ SMSG_SPLINE_MOVE_UNROOT
@ SMSG_DURABILITY_DAMAGE_DEATH
@ SMSG_SPLINE_MOVE_SET_WATER_WALK
@ SMSG_SPLINE_MOVE_SET_SWIM_SPEED
@ SMSG_MOVE_UPDATE_SWIM_BACK_SPEED
@ SMSG_SPLINE_MOVE_SET_WALK_MODE
@ SMSG_SPLINE_MOVE_GRAVITY_ENABLE
@ SMSG_SPLINE_MOVE_UNSET_FLYING
@ SMSG_SPLINE_MOVE_SET_RUN_BACK_SPEED
@ SMSG_MOVE_UNSET_CAN_FLY
@ SMSG_MOVE_UPDATE_RUN_BACK_SPEED
@ SMSG_MOVE_SET_SWIM_BACK_SPEED
@ SMSG_MOVE_SET_RUN_SPEED
@ SMSG_SPLINE_MOVE_SET_FEATHER_FALL
@ SMSG_SPLINE_MOVE_SET_SWIM_BACK_SPEED
@ SMSG_PLAY_ONE_SHOT_ANIM_KIT
@ SMSG_SPLINE_MOVE_SET_FLIGHT_BACK_SPEED
@ CONFIG_CREATURE_FAMILY_FLEE_DELAY
@ CONFIG_DURABILITY_LOSS_IN_PVP
@ CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP
@ RATE_DURABILITY_LOSS_ON_DEATH
bool PrintInvalidSequenceElement(MovementStatusElements element, char const *function)
bool GetAttackStopVictimDeadBit(bool hasVictim, bool victimIsDead)
C::value_type const & SelectRandomContainerElement(C const &container)
bool ShouldTemporarilyUnsummonMountedPet(bool inBattleground, bool hasFlyingMountSpeedAura)
bool ShouldApplySplineGroundClamp(bool hasTransport, bool isCreature, bool isFalling)
bool ShouldClearMountedPetStunForTransport(bool ownerMounted, bool ownerHasTransport, bool petStunned)
bool IsValidMapCoord(float c)
CellCoord ComputeCellCoord(float x, float y)
void Visit(CellCoord const &, TypeContainerVisitor< T, CONTAINER > &visitor, Map &, WorldObject const &, float) const
void SetIsCommandFollow(bool val)
void BuildActionBar(WorldPacket *data) const
void LoadPetActionBar(const std::string &data)
void SetActionBar(uint8 index, uint32 spellOrAction, ActiveStates type)
bool AddSpellToActionBar(SpellInfo const *spellInfo, ActiveStates newstate=ACT_DECIDE, uint8 preferredSlot=0)
void InitPossessCreateSpells()
void SetIsAtStay(bool val)
void SetPetNumber(uint32 petnumber, bool statwindow)
void SetIsFollowing(bool val)
UnitActionBarEntry PetActionBar[MAX_UNIT_ACTION_BAR_INDEX]
void SetIsReturning(bool val)
void InitCharmCreateSpells()
bool RemoveSpellFromActionBar(uint32 spell_id)
CommandStates _CommandState
void GetStayPosition(float &x, float &y, float &z) const
void SetSpellAutocast(SpellInfo const *spellInfo, bool state)
ReactStates _oldReactState
void ToggleCreatureAutocast(SpellInfo const *spellInfo, bool apply)
void InitEmptyActionBar(bool withAttack=true)
void SetIsCommandAttack(bool val)
CharmSpellInfo _charmspells[4]
bool IsHostileTo(FactionTemplateEntry const &entry) const
bool IsHostileToPlayers() const
bool IsNeutralToAll() const
bool IsFriendlyTo(FactionTemplateEntry const &entry) const
bool FillLoot(uint32 lootId, LootStore const &store, Player *lootOwner, bool personal, bool noEmptyError=false, uint16 lootMode=LOOT_MODE_DEFAULT)
void generateMoneyLoot(uint32 minAmount, uint32 maxAmount)
uint32 MountCapability[MAX_MOUNT_CAPABILITIES]
struct MovementInfo::JumpInfo jump
struct MovementInfo::TransportInfo transport
float GetAngle(Position const *pos) const
float GetExactDist2d(const float x, const float y) const
float GetPositionZ() const
float GetOrientation() const
bool HasInArc(float arcangle, Position const *pos, float border=2.0f) const
void GetSinCos(float x, float y, float &vsin, float &vcos) const
void SetOrientation(float orientation)
float GetPositionX() const
void GetPosition(float &x, float &y) const
float GetPositionY() const
void Relocate(float x, float y)
AuraEffect const * auraEff