125 _aura(aura), _chance(dispelChance), _charges(dispelCharges)
137 : m_attacker(attacker), m_victim(victim), m_damage(damage), m_originalDamage(damage), m_spellInfo(spellInfo), m_schoolMask(schoolMask), m_damageType(damageType), m_attackType(attackType),
138 m_absorb(0), m_resist(0), m_block(0), m_hitMask(
PROC_HIT_NONE)
143 : m_attacker(dmgInfo.Attacker), m_victim(dmgInfo.Target), m_damage(dmgInfo.
Damage), m_originalDamage(dmgInfo.
Damage), m_spellInfo(nullptr), m_schoolMask(
SpellSchoolMask(dmgInfo.DamageSchoolMask)),
144 m_damageType(
DIRECT_DAMAGE), m_attackType(dmgInfo.AttackType), m_absorb(dmgInfo.Absorb), m_resist(dmgInfo.Resist), m_block(dmgInfo.Blocked), m_hitMask(
PROC_HIT_NONE)
185 if (!damageNullified)
189 if (!damageNullified)
196 : m_attacker(spellNonMeleeDamage.attacker), m_victim(spellNonMeleeDamage.target), m_damage(spellNonMeleeDamage.damage), m_originalDamage(spellNonMeleeDamage.originalDamage),
197 m_spellInfo(spellNonMeleeDamage.
Spell), m_schoolMask(
SpellSchoolMask(spellNonMeleeDamage.schoolMask)), m_damageType(damageType),
198 m_attackType(attackType), m_absorb(spellNonMeleeDamage.absorb), m_resist(spellNonMeleeDamage.resist), m_block(spellNonMeleeDamage.blocked), m_hitMask(hitMask)
200 if (spellNonMeleeDamage.
blocked)
202 if (spellNonMeleeDamage.
absorb)
251 : _healer(healer), _target(target), _heal(heal), _originalHeal(heal), _effectiveHeal(0), _absorb(0), _spellInfo(spellInfo), _schoolMask(schoolMask), _hitMask(0)
257 amount = std::min(amount,
GetHeal());
275 _actor(actor), _actionTarget(actionTarget),
276 _typeMask(typeMask), _spellTypeMask(spellTypeMask),
277 _spellPhaseMask(spellPhaseMask), _hitMask(hitMask), _spell(spell),
278 _damageInfo(damageInfo), _healInfo(healInfo)
304 : target(_target), attacker(_attacker), castId(_castId),
Spell(_spellInfo), SpellVisual(spellVisual), damage(0), originalDamage(0),
305 schoolMask(_schoolMask), absorb(0), resist(0), periodicLog(false), blocked(0), reflectingSpellId(0),
HitInfo(0), cleanDamage(0), fullBlock(false), preHitHealth(_target->GetHealth())
310 WorldObject(isWorldObject), m_lastSanctuaryTime(0), LastCharmerGUID(), movespline(
std::make_unique<
Movement::MoveSpline>()),
311 m_ControlledByPlayer(false), m_procDeep(0), m_procChainLength(0), m_transformSpell(0),
313 m_unitMovedByMe(nullptr), m_playerMovingMe(nullptr), m_charmer(nullptr), m_charmed(nullptr),
314 i_motionMaster(
std::make_unique<
MotionMaster>(this)), m_regenTimer(0), m_vehicle(nullptr),
315 m_unitTypeMask(
UNIT_MASK_NONE), m_Diminishing(), m_combatManager(this),
316 m_threatManager(this), m_aiLocked(false), _aiAnimKitId(0), _movementAnimKitId(0), _meleeAnimKitId(0),
453 uint32 count = itr->second;
525 auraApplication->GetBase()->Heartbeat();
533 return player->GetWeaponForAttack(
OFF_ATTACK,
true) !=
nullptr;
542 init.MoveTo(x, y, z, generatePath, forceDestination);
543 init.SetVelocity(speed);
632 transport->GetPositionWithOffset(pos).GetPosition(loc.x, loc.y, loc.z, loc.
orientation);
683 float distsq = dx * dx + dy * dy + dz * dz;
686 float maxdist = dist2compare + sizefactor;
688 return distsq < maxdist * maxdist;
699 float distsq = dx*dx + dy*dy + dz*dz;
703 return distsq <= maxdist * maxdist;
719 return IsInDist(obj, objBoundaryRadius);
752 m_interruptMask |= aurApp->GetBase()->GetSpellInfo()->AuraInterruptFlags;
769 if (aura->GetSpellInfo()->SpellFamilyName == familyName && aura->GetSpellInfo()->SpellFamilyFlags & familyFlags)
777 if ((!excludeAura || excludeAura != aura->GetSpellInfo()->Id) &&
789 if (excludeCasterChannel)
791 excludeAura = currentChanneledSpell->GetSpellInfo()->Id;
796 if (!aurApp->IsPositive()
797 && (!excludeAura || excludeAura != aurApp->GetBase()->GetId())
821 std::copy(list.begin(), list.end(), std::back_inserter(effects));
827 uint32 damageDone = damage;
828 uint32 damageTaken = damage;
834 uint32 tmpDamage = damageTaken;
838 tmpDamage = victimCreature->CalculateDamageForSparring(attacker, tmpDamage);
841 victimAI->DamageTaken(attacker, tmpDamage, damagetype, spellProto);
843 if (
UnitAI* attackerAI = attacker ? attacker->
GetAI() :
nullptr)
844 attackerAI->DamageDealt(victim, tmpDamage, damagetype);
847 sScriptMgr->OnDamage(attacker, victim, tmpDamage);
850 if (tmpDamage != damageTaken)
855 damageDone = tmpDamage;
857 damageTaken = tmpDamage;
862 if (attacker != victim && damagetype !=
DOT)
866 if (
CreatureAI* controlledAI = cControlled->AI())
867 controlledAI->OwnerAttackedBy(attacker);
895 for (
auto i = vCopyDamageCopy.begin(); i != vCopyDamageCopy.end(); ++i)
898 if (!((*i)->GetBase()->IsAppliedOnTarget(victim->
GetGUID())))
901 if (((*i)->GetMiscValue() & damageSchoolMask) == 0)
904 Unit* shareDamageTarget = (*i)->GetCaster();
905 if (!shareDamageTarget)
907 SpellInfo const* spell = (*i)->GetSpellInfo();
923 bool duel_hasEnded =
false;
924 bool duel_wasMounted =
false;
932 damageTaken = health - 1;
934 duel_hasEnded =
true;
938 damageTaken = health - 1;
944 victimAI->OnHealthDepleted(attacker,
false);
951 if (victimRider && victimRider->
duel && victimRider->
duel->IsMounted)
958 damageTaken = health - 1;
960 duel_wasMounted =
true;
961 duel_hasEnded =
true;
966 damageTaken = health - 1;
968 if (attacker && attacker != victim)
994 bool skipSettingDeathState =
false;
996 if (health <= damageTaken)
1007 DamageInfo damageInfo =
DamageInfo(attacker, victim, damageTaken, spellProto, damageSchoolMask, damagetype,
1009 for (
AuraEffect* absorbAurEff : vAbsorbOverkill)
1011 Aura* base = absorbAurEff->GetBase();
1016 if (!(absorbAurEff->GetMiscValue() & damageInfo.
GetSchoolMask()))
1020 if (absorbAurEff->GetAmount() > 0)
1022 if (damageTaken > absorbAurEff->GetAmount())
1033 bool deathFullyPrevented =
false;
1035 absorbAurEff->GetBase()->CallScriptEffectAbsorbHandlers(absorbAurEff, aurApp, damageInfo, currentAbsorb, deathFullyPrevented);
1038 currentAbsorb = std::min(currentAbsorb, damageInfo.
GetDamage());
1046 if (deathFullyPrevented)
1049 skipSettingDeathState =
true;
1059 absorbLog.
Absorbed = currentAbsorb;
1071 durabilityLoss =
false;
1074 Unit::Kill(attacker, victim, durabilityLoss, skipSettingDeathState);
1122 auto isCastInterrupted = [&]()
1136 auto isCastDelayed = [&]()
1150 if (isCastInterrupted())
1152 else if (isCastDelayed())
1157 if (damageTaken && victim->
IsPlayer())
1160 spell->DelayedChannel();
1171 if (duel_wasMounted)
1176 he->
duel->Opponent->CombatStopWithPets(
true);
1204 if (!victim || !victim->
IsAlive())
1227 uint32 crit_bonus = damage;
1231 damage += crit_bonus;
1236 if (critPctDamageMod != 0)
1237 AddPct(damage, critPctDamageMod);
1257 damage -= damageInfo->
blocked;
1292 damageInfo->
damage = damage;
1320 if (!damageInfo->
Spell)
1322 TC_LOG_DEBUG(
"entities.unit",
"Unit::DealSpellDamage has no spell");
1335 damageInfo->
Target = victim;
1403 damageInfo->
Damage = damage;
1484 float reducePercent = 1.f - leveldif * 0.1f;
1507 resilienceReduction = damageInfo->
Damage - resilienceReduction;
1508 damageInfo->
Damage -= resilienceReduction;
1551 float percent60 = 3.0f * percent20;
1552 if (offtime > percent20 && offtime <= percent60)
1554 else if (offtime > percent60)
1556 offtime -= 2.0f * percent20;
1563 float percent60 = 3.0f * percent20;
1564 if (basetime > percent20 && basetime <= percent60)
1566 else if (basetime > percent60)
1568 basetime -= 2.0f * percent20;
1584 float chance = 20.0f;
1593 chance *= attackerMeleeSkill / float(victimDefense) * 0.16f;
1613 for (
AuraEffect const* aurEff : vDamageShieldsCopy)
1615 SpellInfo const* spellInfo = aurEff->GetSpellInfo();
1632 uint32 damage = aurEff->GetAmountAsInt();
1633 if (
Unit* caster = aurEff->GetCaster())
1635 damage = caster->SpellDamageBonusDone(
this, spellInfo, damage,
SPELL_DIRECT_DAMAGE, aurEff->GetSpellEffectInfo());
1691 float armor = float(victim->
GetArmor());
1700 for (AuraEffectList::const_iterator i = reductionAuras.begin(); i != reductionAuras.end(); ++i)
1701 if ((*i)->GetCasterGUID() == attacker->
GetGUID())
1702 armorBypassPct += (*i)->GetAmount();
1703 armor =
CalculatePct(armor, 100 - std::min(armorBypassPct, 100.0));
1713 for (
AuraEffect const* aurEff : resIgnoreAuras)
1716 armor = std::floor(
AddPct(armor, -aurEff->GetAmount()));
1733 float maxArmorPen = 0.f;
1740 maxArmorPen = std::min((armor + maxArmorPen) / 3.f, armor);
1746 if (G3D::fuzzyLe(armor, 0.0f))
1762 if (attackerItemLevel)
1765 if (attackerLevel == maxLevelForExpansion)
1769 armorConstant *=
sDB2Manager.GetCurveValueAt(curveId, itemLevelDelta);
1773 if (!(armor + armorConstant))
1776 float mitigation = std::min(armor / (armor + armorConstant), 0.85f);
1777 return uint32(std::max(damage * (1.0f - mitigation), 0.0f));
1791 float discreteResistProbability[11] = { };
1792 if (averageResist <= 0.1f)
1794 discreteResistProbability[0] = 1.0f - 7.5f * averageResist;
1795 discreteResistProbability[1] = 5.0f * averageResist;
1796 discreteResistProbability[2] = 2.5f * averageResist;
1800 for (
uint32 i = 0; i < 11; ++i)
1801 discreteResistProbability[i] = std::max(0.5f - 2.5f * std::fabs(0.1f * i - averageResist), 0.0f);
1805 float probabilitySum = 0.0f;
1808 for (; resistance < 11; ++resistance)
1809 if (roll < (probabilitySum += discreteResistProbability[resistance]))
1812 float damageResisted = damage * resistance / 10.f;
1813 if (damageResisted > 0.0f)
1815 float ignoredResistance = 0.0f;
1820 ignoredResistance = std::min(ignoredResistance, 100.0f);
1821 ApplyPct(damageResisted, 100.0f - ignoredResistance);
1827 float armorReduction = damage - damageAfterArmor;
1830 damageResisted = std::min(damageResisted, armorReduction);
1834 damageResisted = std::max(damageResisted, 0.f);
1835 return uint32(damageResisted);
1840 float victimResistance = float(victim->
GetResistance(schoolMask));
1847 victimResistance -= float(player->GetSpellPenetrationItemMod());
1849 else if (
Unit const* unitCaster = caster->
ToUnit())
1855 victimResistance = 0.0f;
1859 victimResistance = 0.0f;
1861 victimResistance = std::max(victimResistance, 0.0f);
1863 return victimResistance;
1874 float auraAbsorbMod = 0.f;
1893 for (
auto itr = vSchoolAbsorbCopy.begin(); (itr != vSchoolAbsorbCopy.end()) && (damageInfo.
GetDamage() > 0); ++itr)
1906 if (currentAbsorb < 0)
1914 bool defaultPrevented =
false;
1917 currentAbsorb = tempAbsorb;
1919 if (!defaultPrevented)
1926 tempAbsorb = currentAbsorb;
1951 absorbLog.
Absorbed = currentAbsorb;
1960 for (
auto itr = vManaShieldCopy.begin(); (itr != vManaShieldCopy.end()) && (damageInfo.
GetDamage() > 0); ++itr)
1974 if (currentAbsorb < 0)
1980 uint32 tempAbsorb = currentAbsorb;
1982 bool defaultPrevented =
false;
1985 currentAbsorb = tempAbsorb;
1987 if (!defaultPrevented)
1992 int32 manaReduction = currentAbsorb;
1996 manaReduction =
int32(
float(manaReduction) * manaMultiplier);
2001 currentAbsorb = currentAbsorb ?
int32(
float(currentAbsorb) * (
float(manaTaken) /
float(manaReduction))) : 0;
2005 tempAbsorb = currentAbsorb;
2028 absorbLog.
Absorbed = currentAbsorb;
2041 for (
auto itr = vSplitDamagePctCopy.begin(); itr != vSplitDamagePctCopy.end() && damageInfo.
GetDamage() > 0; ++itr)
2053 Unit* caster = (*itr)->GetCaster();
2059 (*itr)->GetBase()->CallScriptEffectSplitHandlers((*itr), aurApp, damageInfo, splitDamage);
2079 if (victimCreature->ShouldFakeDamageFrom(damageInfo.
GetAttacker()))
2086 log.
damage = splitDamage;
2088 log.
absorb = split_absorb;
2106 for (
auto i = vHealAbsorb.begin(); i != vHealAbsorb.end() && healInfo.
GetHeal() > 0; ++i)
2119 if (currentAbsorb < 0)
2124 bool defaultPrevented =
false;
2127 currentAbsorb = tempAbsorb;
2129 if (!defaultPrevented)
2136 tempAbsorb = currentAbsorb;
2158 absorbLog.
Absorbed = currentAbsorb;
2202 if (!autoAttackError)
2217 attackerPlayer->SetAttackSwingError(autoAttackError);
2223 if (!autoAttackError)
2289 uint32 meleeAttackSpellId = 0;
2292 if (!meleeAttackOverrides.empty())
2293 meleeAttackSpellId = meleeAttackOverrides.front()->GetSpellEffectInfo().TriggerSpell;
2297 auto itr = std::find_if(meleeAttackOverrides.begin(), meleeAttackOverrides.end(), [&](
AuraEffect const* aurEff)
2299 return aurEff->GetSpellEffectInfo().MiscValue != 0;
2301 if (itr != meleeAttackOverrides.end())
2302 meleeAttackSpellId = (*itr)->GetSpellEffectInfo().MiscValue;
2305 if (!meleeAttackSpellId)
2315 if (victimCreature->ShouldFakeDamageFrom(damageInfo.
Attacker))
2338 TC_LOG_DEBUG(
"entities.unit",
"AttackerStateUpdate: {} attacked {} for {} dmg, absorbed {}, blocked {}, resisted {}.",
2343 CastSpell(victim, meleeAttackSpellId,
true);
2370 targetGUID = selection;
2398 int32 sum = 0, tmp = 0;
2414 canParryOrBlock =
false;
2419 if (tmp > 0 && roll < (sum += tmp))
2431 && roll < (sum += tmp))
2436 if (canParryOrBlock)
2440 && roll < (sum += tmp))
2448 attackerLevel + 3 < victimLevel)
2451 tmp = (10 + 10 * (victimLevel - attackerLevel)) * 100;
2452 if (tmp > 0 && roll < (sum += tmp))
2457 if (canParryOrBlock)
2461 && roll < (sum += tmp))
2467 if (tmp > 0 && roll < (sum += tmp))
2472 if (attackerLevel >= victimLevel + 4 &&
2478 tmp = attackerLevel - victimLevel * 1000 - 1500;
2479 if (roll < (sum += tmp))
2481 TC_LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: CRUSHING <{}, {})", sum-tmp, sum);
2492 float minDamage = 0.0f;
2493 float maxDamage = 0.0f;
2495 if (normalized || !addTotalPct)
2500 float minOffhandDamage = 0.0f;
2501 float maxOffhandDamage = 0.0f;
2503 minDamage += minOffhandDamage;
2504 maxDamage += maxOffhandDamage;
2533 minDamage = std::max(0.f, minDamage);
2534 maxDamage = std::max(0.f, maxDamage);
2536 if (minDamage > maxDamage)
2537 std::swap(minDamage, maxDamage);
2576 float resistMech = 0;
2579 if (!effect.IsEffect())
2586 if (resistMech < temp)
2591 return std::max(resistMech, 0.0f);
2633 tmp += resist_chance;
2663 tmp += deflect_chance;
2692 if (!aurEff->IsAffectingSpell(spellInfo))
2695 switch (aurEff->GetMiscValue())
2707 TC_LOG_DEBUG(
"entities.unit",
"Spell {} SPELL_AURA_IGNORE_COMBAT_RESULT has unhandled state {}", aurEff->GetId(), aurEff->GetMiscValue());
2716 if (dodgeChance < 0)
2719 if (roll < (tmp += dodgeChance))
2727 if (parryChance < 0)
2738 if (blockChance < 0)
2753 float chance = 0.0f;
2754 float levelBonus = 0.0f;
2756 chance = playerVictim->m_activePlayerData->DodgePercentage;
2765 levelBonus = 1.5f * levelDiff;
2769 chance += levelBonus;
2782 return std::max(chance, 0.0f);
2789 float chance = 0.0f;
2790 float levelBonus = 0.0f;
2793 if (playerVictim->CanParry())
2797 tmpitem = playerVictim->GetWeaponForAttack(
OFF_ATTACK,
true);
2800 chance = playerVictim->m_activePlayerData->ParryPercentage;
2811 levelBonus = 1.5f * levelDiff;
2815 chance += levelBonus;
2822 return std::max(chance, 0.0f);
2827 float miss_chance = 5.0f;
2836 float chance = 0.0f;
2837 float levelBonus = 0.0f;
2840 if (playerVictim->CanBlock())
2844 chance = playerVictim->m_activePlayerData->BlockPercentage;
2855 levelBonus = 1.5f * levelDiff;
2859 chance += levelBonus;
2860 return std::max(chance, 0.0f);
2865 float chance = 0.0f;
2871 chance = thisPlayer->m_activePlayerData->CritPercentage;
2874 chance = thisPlayer->m_activePlayerData->OffhandCritPercentage;
2877 chance = thisPlayer->m_activePlayerData->RangedCritPercentage;
2900 float chance = critDone;
2920 return aurEff->
GetCasterGUID() == tempSummon->GetSummonerGUID();
2926 return std::max(chance, 0.0f);
2959 spell->SetReferencedFromCurrent(
false);
2975 if (i->second->IsExpired())
2984 visibleAura->ClientUpdate();
2992 GameObjectList::iterator itr;
2995 if (!(*itr)->isSpawned())
2998 (*itr)->SetRespawnTime(0);
3177 spell->
cancel(result, resultOther, interrupter);
3208 spell->SetReferencedFromCurrent(
false);
3215 player->SendAutoRepeatCancel(
this);
3220 bool skipInstant ,
bool skipChanneledAllowingActions )
const
3271 if (spell && spell->m_spellInfo->Id == spell_id)
3431 AuraEffect const* auraEff = foundAura->GetEffect(spellEffectInfo.EffectIndex);
3437 bp = *(createInfo.
BaseAmount + spellEffectInfo.EffectIndex);
3439 bp = spellEffectInfo.BasePoints;
3449 if (castItemGUID != foundAura->GetCastItemGUID())
3452 *oldGUID = castItemGUID;
3453 uint32* oldItemId =
const_cast<uint32*
>(&foundAura->m_castItemId);
3455 int32* oldItemLevel =
const_cast<int32*
>(&foundAura->m_castItemLevel);
3487 std::vector<Aura*> aurasSharingLimit;
3490 if (scAura->IsSingleTargetWith(aura))
3491 aurasSharingLimit.push_back(scAura);
3497 while (aurasSharingLimit.size() > maxOtherAuras)
3499 aurasSharingLimit.back()->Remove();
3500 aurasSharingLimit.pop_back();
3516 TC_LOG_ERROR(
"spells",
"Unit::_CreateAuraApplication() called with a removed aura. Check if OnEffectHitTarget() is triggering any spell with apply aura effect (that's not allowed!)\nUnit: {}\nAura: {}",
GetDebugInfo(), aura->
GetDebugInfo());
3534 m_appliedAuras.insert(AuraApplicationMap::value_type(aurId, aurApp));
3575 uint32 aStateMask = (1 << (aState - 1));
3600 if (effMask & 1 << aurEff->GetEffIndex())
3611 player->UpdateVisibleObjectInteractions(
false,
true,
false,
false);
3629 TC_LOG_DEBUG(
"spells",
"Aura {} now is remove mode {}", aura->
GetId(), removeMode);
3647 bool auraStateFound =
false;
3651 bool canBreak =
false;
3653 for (AuraStateAurasMap::iterator itr =
m_auraStateAuras.lower_bound(auraState); itr !=
m_auraStateAuras.upper_bound(auraState) && !(auraStateFound && canBreak);)
3655 if (itr->second == aurApp)
3662 auraStateFound =
true;
3672 if (aurApp->
HasEffect(aurEff->GetEffIndex()))
3688 if (!auraStateFound)
3693 uint32 aStateMask = (1 << (auraState - 1));
3704 player->UpdateVisibleObjectInteractions(
false,
true,
false,
false);
3720 for (AuraApplicationMap::iterator iter = range.first; iter != range.second;)
3722 if (iter->second == aurApp)
3771 Aura* aura = i->second;
3793 if (((itr->second->GetEffectMask() & reqEffMask) == reqEffMask) && (!casterGUID || itr->second->GetCasterGUID() == casterGUID))
3811 TC_LOG_ERROR(
"spells",
"Unit::RemoveOwnedAura() called with unallowed removeMode AURA_REMOVE_NONE, spellId {}", aura->
GetId());
3818 for (AuraMap::iterator itr = range.first; itr != range.second; ++itr)
3820 if (itr->second == aura)
3833 for (AuraMap::const_iterator itr = range.first; itr != range.second; ++itr)
3835 if (((itr->second->GetEffectMask() & reqEffMask) == reqEffMask)
3836 && (!casterGUID || itr->second->GetCasterGUID() == casterGUID)
3837 && (!itemCasterGUID || itr->second->GetCastItemGUID() == itemCasterGUID)
3838 && (!except || except != itr->second))
3862 for (AuraApplicationMap::iterator iter = range.first; iter != range.second;)
3864 Aura const* aura = iter->second->GetBase();
3887 if (aurApp->
HasEffect(aurEff->GetEffIndex()))
3899 for (AuraApplicationMap::iterator iter = range.first; iter != range.second;)
3901 if (aurApp == iter->second)
3923 if (check(iter->second))
3936 if (check(iter->second))
3949 if (check(iter->second))
3963 if (check(iter->second))
3975 for (AuraEffectList::iterator iter =
m_modAuras[auraType].begin(); iter !=
m_modAuras[auraType].end();)
3977 Aura* aura = (*iter)->GetBase();
3996 Aura const* aura = iter->second->GetBase();
4011 for (AuraMap::iterator iter = range.first; iter != range.second;)
4013 Aura* aura = iter->second;
4028 for (AuraMap::iterator iter = range.first; iter != range.second;)
4030 Aura* aura = iter->second;
4033 DispelInfo dispelInfo(dispeller, dispellerSpellId, chargesRemoved);
4056 for (AuraMap::iterator iter = range.first; iter != range.second;)
4058 Aura* aura = iter->second;
4061 std::array<SpellEffectValue, MAX_SPELL_EFFECTS> damage = { };
4062 std::array<SpellEffectValue, MAX_SPELL_EFFECTS> baseDamage = { };
4063 std::bitset<MAX_SPELL_EFFECTS> effMask;
4064 std::bitset<MAX_SPELL_EFFECTS> recalculateMask;
4069 baseDamage[i] = aurEff->GetBaseAmount();
4070 damage[i] = aurEff->GetAmount();
4072 if (aurEff->CanBeRecalculated())
4073 recalculateMask[i] =
true;
4085 oldAura->ModCharges(stolenCharges);
4087 oldAura->ModStackAmount(stolenCharges);
4088 oldAura->SetDuration(
int32(dur));
4105 if (newAura->IsSingleTarget())
4107 newAura->UnregisterSingleTarget();
4113 newAura->SetLoadedState(aura->
GetMaxDuration(),
int32(dur), stealCharge ? stolenCharges : aura->
GetCharges(), recalculateMask.to_ulong(), damage.data());
4114 newAura->ApplyForTargets();
4135 if (iter->second->GetBase()->GetCastItemGUID() == castItemGuid)
4147 for (AuraEffectList::iterator iter =
m_modAuras[auraType].begin(); iter !=
m_modAuras[auraType].end();)
4149 Aura* aura = (*iter)->GetBase();
4154 if (aura != except && (!casterGUID || aura->
GetCasterGUID() == casterGUID)
4169 SpellInfo const* spell = iter->second->GetBase()->GetSpellInfo();
4190 Aura const* aura = iter->second;
4211 for (AuraList::iterator iter = scAuras.begin(); iter != scAuras.end();)
4217 iter = scAuras.begin();
4224template<
typename InterruptFlag>
4239 if (interruptSource)
4258template <
typename InterruptFlags>
4267 Aura* aura = (*iter)->GetBase();
4270 && (!source || aura->
GetId() != source->
Id)
4283 && spell->GetSpellInfo()->HasChannelInterruptFlag(flag)
4284 && (!source || spell->GetSpellInfo()->
Id != source->
Id)
4298 Aura const* aura = iter->second->GetBase();
4322 std::vector<Aura*> aurasToUpdateTargets;
4326 if (exceptSpellId && aura->
GetId() == exceptSpellId)
4330 if (!(appliedMechanicMask & mechanicMaskToRemove))
4338 aurasToUpdateTargets.push_back(aura);
4342 for (
Aura* aura : aurasToUpdateTargets)
4344 aura->UpdateTargetMap(aura->GetCaster());
4347 if (!aura->IsPassive() && aura->GetOwner() ==
this && !aura->GetApplicationOfTarget(
GetGUID()))
4348 aura->Remove(removeMode);
4357 Aura const* aura = iter->second->GetBase();
4372 Aura* aura = iter->second;
4375 for (Aura::ApplicationMap::const_iterator itr = appMap.begin(); itr!= appMap.end();)
4391 if (iter->second->GetBase()->GetOwner() !=
this)
4406 AuraApplicationMap::iterator aurAppIter;
4410 AuraMap::iterator aurIter;
4414 const int maxIteration = 50;
4416 if (counter >= maxIteration)
4418 std::stringstream sstr;
4419 sstr <<
"Unit::RemoveAllAuras() iterated " << maxIteration <<
" times already but there are still "
4425 sstr <<
"m_appliedAuras:" <<
"\n";
4427 for (std::pair<uint32 const, AuraApplication*>& auraAppPair :
m_appliedAuras)
4428 sstr << auraAppPair.second->GetDebugInfo() <<
"\n";
4433 sstr <<
"m_ownedAuras:" <<
"\n";
4436 sstr << aura->GetDebugInfo() <<
"\n";
4468 auto evadeAuraCheck = [](
Aura const* aura)
4482 auto evadeAuraApplicationCheck = [&evadeAuraCheck](
AuraApplication const* aurApp)
4484 return evadeAuraCheck(aurApp->
GetBase());
4497 Aura const* aura = iter->second->GetBase();
4506 Aura* aura = iter->second;
4518 Aura const* aura = iter->second->GetBase();
4527 Aura* aura = iter->second;
4539 Aura const* aura = iter->second->GetBase();
4548 Aura* aura = iter->second;
4560 Aura const* aura = iter->second->GetBase();
4569 Aura* aura = iter->second;
4581 Aura* aura = iter->second;
4594 for (; range.first != range.second; ++range.first)
4596 Aura* aura = range.first->second;
4625 for (AuraApplicationMap::const_iterator itr = range.first; itr != range.second; ++itr)
4627 if (itr->second->HasEffect(effIndex)
4628 && (!caster || itr->second->GetBase()->GetCasterGUID() == caster))
4643 rankSpell =
sSpellMgr->GetNextSpellInChain(rankSpell);
4651 for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
4653 SpellInfo const* spell = (*i)->GetSpellInfo();
4656 if (!casterGUID.
IsEmpty() && (*i)->GetCasterGUID() != casterGUID)
4673 && (!except || except != app))
4685 if (predicate(pair.second))
4694 if (predicate(pair.second->GetBase()))
4702 for (AuraApplicationMap::value_type
const& pair :
m_appliedAuras)
4703 if (predicate(pair.second))
4711 for (AuraApplicationMap::value_type
const& pair :
m_appliedAuras)
4712 if (predicate(pair.second->GetBase()))
4721 return aurApp ? aurApp->
GetBase() :
nullptr;
4727 return aurApp ? aurApp->
GetBase() :
nullptr;
4733 return aurApp ? aurApp->
GetBase() :
nullptr;
4743 rankSpell =
sSpellMgr->GetNextSpellInChain(rankSpell);
4751 return aurApp ? aurApp->
GetBase() :
nullptr;
4757 for (
auto itr = auras.begin(); itr != auras.end(); ++itr)
4759 Aura* aura = itr->second;
4787 dispelList.emplace_back(aura, chance, charges);
4795 for (AuraApplicationMap::const_iterator itr = range.first; itr != range.second; ++itr)
4797 if (itr->second->HasEffect(effIndex)
4798 && (!caster || itr->second->GetBase()->GetCasterGUID() == caster))
4811 for (AuraApplicationMap::const_iterator itr = range.first; itr != range.second; ++itr)
4813 if (itr->second->GetBase()->GetStackAmount() == 0)
4816 count += (
uint32)itr->second->GetBase()->GetStackAmount();
4824 return GetAuraApplication(spellId, casterGUID, itemCasterGUID, reqEffMask) !=
nullptr;
4840 if (caster == eff->GetCasterGUID())
4848 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
4849 if (miscvalue == (*i)->GetMiscValue())
4857 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
4858 if ((*i)->IsAffectingSpell(affectedSpell))
4866 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
4867 if (value == (*i)->GetAmountAsInt())
4875 if (aura->GetSpellEffectInfo().TriggerSpell == triggerSpell)
4880template <
typename InterruptFlags>
4887 if (!(*iter)->IsPositive() && (*iter)->GetBase()->GetSpellInfo()->HasAuraInterruptFlag(flag) &&
4888 (!guid || (*iter)->GetBase()->GetCasterGUID() == guid))
4901 SpellInfo const* spellInfo = iter->second->GetBase()->GetSpellInfo();
4906 if (iter->second->HasEffect(spellEffectInfo.EffectIndex) && spellEffectInfo.IsEffect() && spellEffectInfo.Mechanic)
4907 if (mechanicMask & (
UI64LIT(1) << spellEffectInfo.Mechanic))
4920 SpellInfo const* spellInfo = itr->second->GetBase()->GetSpellInfo();
4927 if (newDuration > 0 && newDuration < existingDuration)
4937 for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
4939 if ((*i)->GetMiscValue() == script)
4940 if ((*i)->IsAffectingSpell(spell))
4948 static const AuraType diseaseAuraTypes[] =
4955 for (
AuraType aType : diseaseAuraTypes)
4961 && (*itr)->GetCasterGUID() == casterGUID)
4967 RemoveAura((*itr)->GetId(), (*itr)->GetCasterGUID());
4980 static const AuraType diseaseAuraTypes[] =
4991 for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
4994 if ((*i)->GetCasterGUID() == casterGUID)
5004 if (mTotalAuraList.empty())
5007 std::map<SpellGroup, SpellEffectValue> sameEffectSpellGroup;
5010 for (
AuraEffect const* aurEff : mTotalAuraList)
5012 if (predicate(aurEff))
5016 if (!
sSpellMgr->AddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(), auraType, aurEff->GetAmount(), sameEffectSpellGroup))
5017 modifier += aurEff->GetAmount();
5022 for (
auto itr = sameEffectSpellGroup.begin(); itr != sameEffectSpellGroup.end(); ++itr)
5023 modifier += itr->second;
5025 return static_cast<float>(modifier);
5031 if (mTotalAuraList.empty())
5034 std::map<SpellGroup, SpellEffectValue> sameEffectSpellGroup;
5037 for (
AuraEffect const* aurEff : mTotalAuraList)
5039 if (predicate(aurEff))
5043 if (!
sSpellMgr->AddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(), auraType, aurEff->GetAmount(), sameEffectSpellGroup))
5044 AddPct(multiplier, aurEff->GetAmount());
5049 for (
auto itr = sameEffectSpellGroup.begin(); itr != sameEffectSpellGroup.end(); ++itr)
5050 AddPct(multiplier, itr->second);
5052 return static_cast<float>(multiplier);
5058 if (mTotalAuraList.empty())
5062 for (
AuraEffect const* aurEff : mTotalAuraList)
5064 if (predicate(aurEff))
5065 modifier = std::max(modifier, aurEff->GetAmount());
5068 return static_cast<float>(modifier);
5074 if (mTotalAuraList.empty())
5078 for (
AuraEffect const* aurEff : mTotalAuraList)
5080 if (predicate(aurEff))
5081 modifier = std::min(modifier, aurEff->GetAmount());
5084 return static_cast<float>(modifier);
5131 if (except != aurEff && (aurEff->
GetMiscValue() & miscMask) != 0)
5239 float modPos = 0.0f;
5240 float modNeg = 0.0f;
5246 float modValue =
static_cast<Guardian*
>(
this)->GetBonusStatFromOwner(stat);
5275 float modsFromPct = baseModFromPct + totalModFromPct;
5278 float nonAuraMod = totalValue;
5279 nonAuraMod -= modPos;
5280 nonAuraMod -= modNeg;
5283 if (nonAuraMod > 0.f)
5284 modPos += nonAuraMod;
5286 modNeg += nonAuraMod;
5289 if (modsFromPct > 0.f)
5290 modPos += modsFromPct;
5292 modNeg += modsFromPct;
5334 std::vector<DynamicObject*> dynamicobjects =
GetDynObjects(spellId);
5335 return dynamicobjects.empty() ? nullptr : dynamicobjects.front();
5340 std::vector<DynamicObject*> dynamicobjects;
5341 for (DynObjectList::const_iterator i =
m_dynObj.begin(); i !=
m_dynObj.end(); ++i)
5342 if ((*i)->GetSpellId() == spellId)
5343 dynamicobjects.push_back(*i);
5345 return dynamicobjects;
5372 return gameobjects.empty() ? nullptr : gameobjects.front();
5377 std::vector<GameObject*> gameobjects;
5378 for (GameObjectList::const_iterator i =
m_gameObj.begin(); i !=
m_gameObj.end(); ++i)
5379 if ((*i)->GetSpellId() == spellId)
5380 gameobjects.push_back(*i);
5412 objectSlotItr->Clear();
5453 if (spellid == 0 || (*i)->GetSpellId() == spellid)
5491 return areaTriggers.empty() ? nullptr : areaTriggers.front();
5496 std::vector<AreaTrigger*> areaTriggers;
5498 if ((*i)->GetSpellId() == spellId)
5499 areaTriggers.push_back(*i);
5501 return areaTriggers;
5523 if (areaTrigger->GetAuraEffect() == aurEff)
5525 areaTrigger->Remove();
5556 at->HandleUnitExit(
this);
5593 static constexpr int32 ProcChainHardLimit = 10;
5596 TC_LOG_ERROR(
"spells.aura.effect",
"Unit::ProcSkillsAndAuras: Possible infinite proc loop detected, current triggering spell {}", spell->
GetDebugInfo().c_str());
5618 actor->
TriggerAurasProcOnEvent(
nullptr,
nullptr, actionTarget, typeMaskActor, typeMaskActionTarget, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo);
5663 spellOrDamageImmune.
SpellID = spellId;
5677 packet.
OverDamage = (overkill < 0 ? -1 : overkill);
5705 dmgInfo.
Damage =
Damage - AbsorbDamage - Resist - BlockedAmount;
5708 dmgInfo.
Absorb = AbsorbDamage;
5711 dmgInfo.
Blocked = BlockedAmount;
5722 if (!powerTypeEntry)
5759 if (thisPlayer->GetGroup())
5772 if (!powerTypeEntry)
5801 if (!powerTypeAuras.empty())
5803 AuraEffect const* powerTypeAura = powerTypeAuras.front();
5815 displayPower =
Powers(powerDisplay->ActualType);
5824 return displayPower;
5874 if (!victim || victim ==
this)
5977 if (
CreatureAI* controlledAI = cControlled->AI())
5978 controlledAI->OwnerAttacked(victim);
6005 creature->SetNoCallAssistance(
false);
6018 for (
Unit* attacker : attackers)
6020 toRemove.push_back(attacker);
6022 for (
Unit* attacker : toRemove)
6041 std::vector<Unit*> attackersToRemove;
6045 for (
Unit* attacker : attackersToRemove)
6064 minion->CombatStop(includingCast);
6073 if ((*itr)->isAttackingPlayer())
6079 if (summon->isAttackingPlayer())
6090 if (!(*iter)->AttackStop())
6092 TC_LOG_ERROR(
"entities.unit",
"WORLD: Unit has an attacker that isn't attacking it!");
6100 uint32 mask = 1 << (flag - 1);
6109 for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr)
6114 if (!spellInfo || !spellInfo->
IsPassive())
6122 for (PetSpellMap::const_iterator itr = pet->m_spells.begin(); itr != pet->m_spells.end(); ++itr)
6127 if (!spellInfo || !spellInfo->
IsPassive())
6142 for (Unit::AuraApplicationMap::iterator itr = tAuras.begin(); itr != tAuras.end();)
6144 SpellInfo const* spellProto = itr->second->GetBase()->GetSpellInfo();
6159 if (itr->second->GetBase()->GetCasterGUID() == target->
GetGUID())
6160 auraStates |= (1 << (itr->first - 1));
6180 for (AuraStateAurasMap::const_iterator itr = range.first; itr != range.second; ++itr)
6181 if (itr->second->GetBase()->GetCasterGUID() ==
Caster->GetGUID())
6187 return (*
m_unitData->AuraState & (1 << (flag - 1))) != 0;
6227 return master->GetControllingPlayer();
6243 TC_LOG_ERROR(
"entities.unit",
"Unit::GetFirstMinion: Minion {} not exist.", pet_guid.
ToString());
6259 TC_LOG_FATAL(
"entities.unit",
"Unit::GetGuardianPet: Guardian {} not exist.", pet_guid.
ToString());
6299 if (oldPet != minion && (oldPet->IsPet() || minion->
IsPet() || oldPet->GetEntry() != minion->
GetEntry()))
6302 if (
Pet* oldPetAsPet = oldPet->
ToPet())
6331 if (
BattlePets::BattlePet const* pet = thisPlayer->GetSession()->GetBattlePetMgr()->GetPet(thisPlayer->GetSummonedBattlePetGUID()))
6337 if (
uint32 display = pet->PacketInfo.DisplayID)
6407 if (
GetGUID() == (*itr)->GetCharmerGUID())
6411 if ((*itr)->GetOwnerGUID() !=
GetGUID())
6414 (*itr)->OutDebugInfo();
6426 if ((*itr)->IsPet())
6551 victimAI->HealReceived(healer, addhealth);
6553 if (
UnitAI* healerAI = healer ? healer->
GetAI() :
nullptr)
6554 healerAI->HealDone(victim, addhealth);
6562 Unit* unit = healer;
6604 for (AuraEffectList::const_iterator i = interceptAuras.begin(); i != interceptAuras.end(); ++i)
6606 if (
Unit* magnet = (*i)->GetBase()->GetCaster())
6647 TC_LOG_ERROR(
"entities.unit",
"Unit {} is trying to release unit {} which is neither charmed nor owned by it",
GetEntry(), target->
GetEntry());
6672 return u->isPossessed();
6679 Player* player =
nullptr;
6703 std::vector<Unit*> nearMembers;
6709 Player* Target = itr.GetSource();
6712 nearMembers.push_back(Target);
6717 nearMembers.push_back(pet);
6720 if (nearMembers.empty())
6723 uint32 randTarget =
urand(0, nearMembers.size()-1);
6724 return nearMembers[randTarget];
6771 if (OldTotem->IsSummon())
6772 OldTotem->ToTempSummon()->UnSummon();
6790 spellHealLog.
Crit = critical;
6810 data.
Type = powertype;
6822 player->InterruptPowerRegen(powerType);
6825 int32 overEnergize = damage - gain;
6832 if (!spellProto || !victim)
6835 int32 DoneTotal = 0;
6836 float DoneTotalMod = 1.0f;
6838 auto callDamageScript = [&](
int32& dmg,
int32& flatMod,
float& pctMod)
6849 callDamageScript(pdamage, DoneTotal, DoneTotalMod);
6850 return int32(std::max(
float(pdamage + DoneTotal) * DoneTotalMod, 0.0f));
6856 return owner->SpellDamageBonusDone(victim, spellProto, pdamage, damagetype, spellEffectInfo, stack, spell, aurEff);
6868 DoneAdvertisedBenefit +=
static_cast<Guardian const*
>(
this)->GetBonusDamage();
6876 attackPowerCoeff *= 100.0f;
6878 attackPowerCoeff /= 100.0f;
6893 DoneTotal +=
int32(stack * attackPowerCoeff * attackPowerBonus);
6897 if (DoneAdvertisedBenefit)
6907 DoneTotal +=
int32(DoneAdvertisedBenefit * coeff * stack);
6910 callDamageScript(pdamage, DoneTotal, DoneTotalMod);
6912 float tmpDamage = float(pdamage + DoneTotal) * DoneTotalMod;
6918 return int32(std::max(tmpDamage, 0.0f));
6937 return owner->SpellDamagePctDone(victim, spellProto, damagetype, spellEffectInfo);
6940 float DoneTotalMod = 1.0f;
6950 float maxModDamagePercentSchool = 0.0f;
6955 maxModDamagePercentSchool = std::max(maxModDamagePercentSchool, thisPlayer->m_activePlayerData->ModDamageDonePercent[i]);
6960 DoneTotalMod *= maxModDamagePercentSchool;
6993 if (spellProto->
Id == 228598)
6995 DoneTotalMod *= 3.0f;
7001 AddPct(DoneTotalMod, 30 * count);
7004 if (spellProto->
Id == 198590)
7010 return DoneTotalMod;
7018 float TakenTotalMod = 1.0f;
7033 AddPct(TakenTotalMod, cheatDeath->GetAmount());
7074 if (damagetype ==
DOT)
7084 if (caster && TakenTotalMod < 1.0f)
7086 float damageReduction = 1.0f - TakenTotalMod;
7088 for (
AuraEffect const* aurEff : casterIgnoreResist)
7090 if (!(aurEff->GetMiscValue() & spellProto->
GetSchoolMask()))
7093 AddPct(damageReduction, -aurEff->GetAmount());
7096 TakenTotalMod = 1.0f - damageReduction;
7099 float tmpDamage = pdamage * TakenTotalMod;
7100 return int32(std::max(tmpDamage, 0.0f));
7109 if (overrideSP > 0.0f)
7125 for (
AuraEffect const* aurEff : mDamageDoneOfStatPercent)
7127 if ((aurEff->GetMiscValue() & schoolMask) != 0)
7130 Stats const usedStat =
static_cast<Stats>(aurEff->GetMiscValueB());
7137 return DoneAdvertisedBenefit;
7151 float crit_chance = 0.0f;
7157 auto getPhysicalCritChance = [&]
7162 auto getMagicCritChance = [&]
7165 return *thisPlayer->m_activePlayerData->SpellCritPercentage;
7171 crit_chance = std::max(crit_chance, getPhysicalCritChance());
7174 crit_chance = std::max(crit_chance, getMagicCritChance());
7191 return std::max(crit_chance, 0.0f);
7201 float crit_chance = doneChance;
7217 for (
AuraEffect const* aurEff : mOverrideClassScript)
7227 crit_chance *= 1.5f;
7229 crit_chance += eff->GetAmount();
7250 crit_chance -= levelDiff * 1.0f;
7285 return aurEff->
GetCasterGUID() == tempSummon->GetSummonerGUID();
7296 return std::max(crit_chance, 0.0f);
7302 int32 crit_bonus = damage * 2;
7303 float crit_mod = 0.0f;
7309 if (crit_bonus != 0)
7310 AddPct(crit_bonus, crit_mod);
7314 return aurEff->GetCasterGUID() == caster->GetGUID();
7317 crit_bonus -= damage;
7323 crit_bonus += damage;
7332 int32 crit_bonus = damage;
7339 damage += crit_bonus;
7352 return owner->SpellHealingBonusDone(victim, spellProto, healamount, damagetype, spellEffectInfo, stack, spell, aurEff);
7358 int32 DoneTotal = 0;
7364 for (
AuraEffect const* aurEff : mOverrideClassScript)
7387 DoneAdvertisedBenefit +=
static_cast<Guardian const*
>(
this)->GetBonusDamage();
7395 attackPowerCoeff *= 100.0f;
7397 attackPowerCoeff /= 100.0f;
7412 DoneTotal +=
int32(stack * attackPowerCoeff * attackPowerBonus);
7416 if (DoneAdvertisedBenefit)
7426 DoneTotal +=
int32(DoneAdvertisedBenefit * coeff * stack);
7431 switch (otherSpellEffect.ApplyAuraName)
7450 float heal = float(healamount + DoneTotal) * DoneTotalMod;
7456 return int32(std::max(heal, 0.0f));
7464 return owner->SpellHealingPctDone(victim, spellProto);
7482 float DoneTotalMod = 1.0f;
7487 float maxModDamagePercentSchool = 0.0f;
7490 maxModDamagePercentSchool = std::max(maxModDamagePercentSchool, thisPlayer->m_activePlayerData->ModHealingDonePercent[i]);
7492 DoneTotalMod *= maxModDamagePercentSchool;
7508 if (healingDonePctVsTargetHealth->IsAffectingSpell(spellProto))
7509 AddPct(DoneTotalMod,
CalculatePct(healingDonePctVsTargetHealth->GetAmount(), healthPctDiff));
7511 return DoneTotalMod;
7518 if (!allowPositive && !allowNegative)
7521 float TakenTotalMod = 1.0f;
7528 AddPct(TakenTotalMod, minval);
7530 if (damagetype ==
DOT)
7535 AddPct(TakenTotalMod, minval_hot);
7543 AddPct(TakenTotalMod, maxval);
7545 if (damagetype ==
DOT)
7550 AddPct(TakenTotalMod, maxval_hot);
7559 TakenTotalMod *= 1.2f;
7575 else if (!allowNegative)
7591 else if (!allowNegative)
7598 float heal = healamount * TakenTotalMod;
7599 return int32(std::max(heal, 0.0f));
7606 float overrideSP = thisPlayer->m_activePlayerData->OverrideSpellPowerByAPPercent;
7607 if (overrideSP > 0.0f)
7630 for (AuraEffectList::const_iterator i = mHealingDoneOfStatPercent.begin(); i != mHealingDoneOfStatPercent.end(); ++i)
7633 Stats usedStat =
Stats((*i)->GetSpellEffectInfo().MiscValue);
7637 return advertisedBenefit;
7649 return owner->SpellAbsorbBonusDone(victim, spellProto, absorbamount, spellEffectInfo, stack, aurEff);
7653 return absorbamount;
7655 int32 doneTotal = 0;
7662 doneAdvertisedBenefit +=
static_cast<Guardian const*
>(
this)->GetBonusDamage();
7669 attackPowerCoeff *= 100.0f;
7671 attackPowerCoeff /= 100.0f;
7686 doneTotal +=
int32(stack * attackPowerCoeff * attackPowerBonus);
7689 if (doneAdvertisedBenefit)
7700 doneTotal +=
int32(doneAdvertisedBenefit * coeff * stack);
7706 float absorbAmount = float(absorbamount + doneTotal) * doneTotalMod;
7708 return static_cast<int32>(std::round(absorbAmount));
7715 return owner->SpellAbsorbPctDone(victim, spellProto);
7717 float doneTotalMod = 1.f;
7724 return doneTotalMod;
7730 return absorbamount;
7732 int32 doneTotal = 0;
7733 float takenTotalMod = 1.f;
7737 float absorb = float(absorbamount + doneTotal) * takenTotalMod;
7739 return static_cast<int32>(std::round(absorb));
7750 if (!requireImmunityPurgesEffectAttribute)
7751 return range.
begin() != range.
end();
7753 return std::ranges::any_of(range, [](
uint32 immunitySpellId)
7765 if (hasImmunity(idList, spellInfo->
Id))
7774 if (hasImmunity(dispelList, dispel))
7782 if (hasImmunity(mechanicList, mechanic))
7786 bool immuneToAllEffects =
true;
7791 if (!spellEffectInfo.IsEffect() || !(effectMask & (1 << spellEffectInfo.EffectIndex)))
7795 immuneToAllEffects =
false;
7802 if (immuneToAllEffects)
7807 uint32 schoolImmunityMask = 0;
7809 for (
auto [auraSchoolImmunityMask, immunityAuraId] : schoolList)
7811 if ((auraSchoolImmunityMask & schoolMask) == 0)
7815 if (requireImmunityPurgesEffectAttribute)
7825 schoolImmunityMask |= auraSchoolImmunityMask;
7827 if ((schoolImmunityMask & schoolMask) == schoolMask)
7838 for (
auto itr = schoolList.begin(); itr != schoolList.end(); ++itr)
7848 for (
auto itr = damageList.begin(); itr != damageList.end(); ++itr)
7858 for (
auto itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
7859 mask |= (
UI64LIT(1) << itr->first);
7868 for (
auto itr = damageList.begin(); itr != damageList.end(); ++itr)
7881 if ((schoolImmunityMask & schoolMask) == schoolMask)
7886 if ((damageImmunityMask & schoolMask) == schoolMask)
7907 uint32 schoolImmunityMask = 0;
7908 for (
auto&& [immunitySchoolMask, immunityAuraId] : container)
7917 schoolImmunityMask |= immunitySchoolMask;
7921 return (schoolImmunityMask & schoolMask) == schoolMask;
7937 bool requireImmunityPurgesEffectAttribute )
const
7951 if (!requireImmunityPurgesEffectAttribute)
7952 return range.
begin() != range.
end();
7954 return std::ranges::any_of(range, [](
uint32 immunitySpellId)
7966 if (hasImmunity(effectList, spellEffectInfo.
Effect))
7972 if (hasImmunity(mechanicList, mechanic))
7981 if (hasImmunity(list, aura))
7990 if (!(immuneAuraApply->GetMiscValue() & spellInfo->
GetSchoolMask()))
8018 uint32 schoolImmunityMask = 0;
8019 for (
auto&& [immunitySchoolMask, immunityAuraId] : container)
8025 schoolImmunityMask |= immunitySchoolMask;
8029 return (schoolImmunityMask & schoolMask) == schoolMask;
8042 if (!pVictim || damage == 0)
8048 int32 DoneFlatBenefit = 0;
8081 float DoneTotalMod = 1.0f;
8091 float maxModDamagePercentSchool = 0.0f;
8095 if (schoolMask & (1 << i))
8096 maxModDamagePercentSchool = std::max(maxModDamagePercentSchool, thisPlayer->m_activePlayerData->ModDamageDonePercent[i]);
8101 DoneTotalMod *= maxModDamagePercentSchool;
8109 AddPct(DoneTotalMod, autoAttackDamage->GetAmount());
8133 else if (spellProto && spellProto->
Mechanic)
8141 float damageF = float(damage + DoneFlatBenefit) * DoneTotalMod;
8149 return int32(std::max(damageF, 0.0f));
8157 int32 TakenFlatBenefit = 0;
8167 if ((TakenFlatBenefit < 0) && (pdamage < -TakenFlatBenefit))
8171 float TakenTotalMod = 1.0f;
8207 if (damagetype ==
DOT)
8224 AddPct(TakenTotalMod, cheatDeath->GetAmount());
8240 if (TakenTotalMod < 1.0f)
8244 float damageReduction = 1.0f - TakenTotalMod;
8246 for (
AuraEffect const* aurEff : casterIgnoreResist)
8248 if (!(aurEff->GetMiscValue() & attackSchoolMask))
8251 AddPct(damageReduction, -aurEff->GetAmount());
8254 TakenTotalMod = 1.0f - damageReduction;
8257 float tmpDamage = float(pdamage + TakenFlatBenefit) * TakenTotalMod;
8258 return int32(std::max(tmpDamage, 0.0f));
8268 for (
auto itr = bounds.first; itr != bounds.second;)
8270 if (itr->second == spellId)
8300 return std::floor((WeaponSpeed * PPM) / 600.0f);
8320 player->SendOnCancelExpectedVehicleRideAura();
8363 player->EnablePetControlsOnDismount();
8364 player->ResummonPetTemporaryUnSummonedIfAny();
8365 player->ResummonBattlePetTemporaryUnSummonedIfAny();
8391 uint32 ridingSkill = 5000;
8393 bool isSubmerged =
false;
8394 bool isInWater =
false;
8405 mountFlags = areaTable->GetMountFlags();
8415 if (!mountCapability)
8418 if (ridingSkill < mountCapability->ReqRidingSkill)
8453 if (mountCapability->
ReqMapID != -1 &&
8472 return mountCapability;
8484 if (
uint32 mountType = spellShapeshiftForm->MountTypeID)
8491 aurEff->RecalculateAmount();
8492 if (!aurEff->GetAmountAsInt())
8493 aurEff->GetBase()->Remove();
8498 if (!
HasAura(capability->ModSpellAuraID))
8499 CastSpell(
this, capability->ModSpellAuraID, aurEff);
8545 std::list<CombatReference*> toEnd;
8548 toEnd.push_back(pair.second);
8551 toEnd.push_back(pair.second);
8568 std::list<CombatReference*> toEnd;
8571 toEnd.push_back(pair.second);
8574 toEnd.push_back(pair.second);
8627 int64 val = dVal + curHealth;
8636 if (val < maxHealth)
8639 gain = val - curHealth;
8641 else if (curHealth != maxHealth)
8644 gain = maxHealth - curHealth;
8654 player->GetSession()->SendPacket(packet.
Write());
8669 int64 val = dVal + curHealth;
8677 if (val < maxHealth)
8679 else if (curHealth != maxHealth)
8680 gain = maxHealth - curHealth;
8694 uint32 triggerSpell = effect->GetSpellEffectInfo().TriggerSpell;
8700 if (newVal < threshold || oldVal > threshold)
8704 if (newVal > threshold || oldVal < threshold)
8728 int32 val = dVal + curPower;
8739 SetPower(power, val, withPowerUpdate);
8740 gain = val - curPower;
8742 else if (curPower != maxPower)
8744 SetPower(power, maxPower, withPowerUpdate);
8745 gain = maxPower - curPower;
8765 if (ownerPlayer->IsGroupVisibleFor(seerPlayer))
8799 float main_speed_mod = 0.0f;
8800 float stack_bonus = 1.0f;
8801 float non_stack_bonus = 1.0f;
8841 float owner_speed_mod = 0.0f;
8846 main_speed_mod = std::max(main_speed_mod, owner_speed_mod);
8864 TC_LOG_ERROR(
"entities.unit",
"Unit::UpdateSpeed: Unsupported move type ({})", mtype);
8869 float speed = std::max(non_stack_bonus, stack_bonus);
8871 AddPct(speed, main_speed_mod);
8894 if (speed > max_speed)
8904 if (speed < minSpeed)
8916 if (creature->HasUnitTypeMask(
UNIT_MASK_MINION) && !creature->IsInCombat())
8924 if (speed < ownerSpeed || creature->
IsWithinDist3d(followed, 10.0f))
8939 float baseMinSpeed = 1.0f;
8943 float min_speed =
CalculatePct(baseMinSpeed, minSpeedMod);
8944 if (speed < min_speed)
8963 rate = std::max(rate, 0.01f);
9005 playerMover->GetSession()->SendPacket(selfpacket.
Write());
9011 playerMover->SendMessageToSet(packet.
Write(),
false);
9047 if (!flightCapabilityEntry)
9050 auto [opcode, newValue, rateAura] = [&]
9073 return std::tuple<OpcodeServer, float, AuraType>();
9100 selfpacket.
Speed = newValue;
9101 playerMover->GetSession()->SendPacket(selfpacket.
Write());
9108 if (!flightCapabilityEntry)
9111 auto [opcode, min, max, rateAura] = [&]
9124 return std::tuple<OpcodeServer, float, float, AuraType>();
9160 playerMover->GetSession()->SendPacket(selfpacket.
Write());
9227 zoneScript->OnUnitDeath(
this);
9285 if (!target->
IsEngaged() && !canInitialAggro)
9289 targetOwner->EngageWithTarget(
this);
9293 if (myPlayerOwner && targetPlayerOwner && !(myPlayerOwner->
duel && myPlayerOwner->
duel->Opponent == targetPlayerOwner))
9307 if (minion->IsInCombat())
9321 if (interactionAllowed)
9331 if (interactionAllowed)
9370 if (currentLevel < maxLevel)
9371 diminish.
hitCount = currentLevel + 1;
9386 if (limitDuration > 0 && duration > limitDuration)
9388 Unit const* target = targetOwner ? targetOwner :
this;
9389 WorldObject const* source = casterOwner ? casterOwner : caster;
9392 duration = limitDuration;
9451 duration =
int32(duration * mod);
9452 return (duration != 0);
9462 else if (diminish.
stack)
9467 if (!diminish.
stack)
9499 return (creatureType >= 1) ? (1 << (creatureType - 1)) : 0;
9507 return creature->GetCreatureTemplate()->type;
9533 bool isTravelShapeshiftForm = [form]()
9537 if (shapeInfo->MountTypeID)
9547 if (onlyTravelShapeshiftForm && !isTravelShapeshiftForm)
9553 SpellInfo const* spellInfo = aurEff->GetBase()->GetSpellInfo();
9555 aurEff->GetBase()->Remove(removeMode);
9615 var *= (apply ? (100.0f + val) / 100.0f : 100.0f / (100.0f + val));
9622 TC_LOG_ERROR(
"entities.unit",
"ERROR in HandleStatFlatModifier(): non-existing UnitMods or wrong UnitModifierType!");
9629 switch (modifierType)
9646 TC_LOG_ERROR(
"entities.unit",
"ERROR in ApplyStatPctModifier(): non-existing UnitMods or wrong UnitModifierType!");
9653 switch (modifierType)
9688 TC_LOG_ERROR(
"entities.unit",
"attempt to access non-existing modifier value from UnitMods!");
9699 TC_LOG_ERROR(
"entities.unit",
"attempt to access non-existing modifier value from UnitMods!");
9761 ABORT_MSG(
"Not implemented UnitMod %u", unitMod);
9770 TC_LOG_ERROR(
"entities.unit",
"ERROR in HandleAttackPowerModifier(): non-existing AttackPowerModIndex or wrong AttackPowerModType!");
9774 switch (modifierType)
9794 TC_LOG_ERROR(
"entities.unit",
"ERROR in GetAttackPowerModifierValue(): non-existing AttackPowerModIndex or wrong AttackPowerModType!");
9897 return baseValue + totalValue;
9904 TC_LOG_ERROR(
"entities.unit",
"attempt to access non-existing UnitMods in GetTotalAuraModValue()!");
9963 float baseValue = value;
9981 ap += std::max<float>(
m_unitData->MainHandWeaponAttackPower,
m_unitData->RangedWeaponAttackPower);
9984 return ap * (1.0f +
m_unitData->RangedAttackPowerMultiplier);
9992 ap += std::max<float>(
m_unitData->MainHandWeaponAttackPower,
m_unitData->RangedWeaponAttackPower);
10001 return ap * (1.0f +
m_unitData->AttackPowerMultiplier);
10029 if (player->GetGroup())
10050 if (maxHealth < val)
10062 if (player->GetGroup())
10067 if (pet->isControlled())
10088 if (pet->isControlled())
10121 if (maxPower < val)
10132 packet.
Powers.emplace_back(val, power);
10141 if (player->GetGroup())
10172 if (val < cur_power)
10182 if (effect->GetMiscValue() == power)
10185 uint32 triggerSpell = effect->GetSpellEffectInfo().TriggerSpell;
10196 oldValueCheck =
GetPctOf(oldVal, maxPower);
10197 newValueCheck =
GetPctOf(newVal, maxPower);
10203 if (oldValueCheck >= effect->GetAmount() || newValueCheck < effectAmount)
10207 if (oldValueCheck <= effect->GetAmount() || newValueCheck > effectAmount)
10228 ai->UpdateAI(diff);
10235 i_AIs.emplace(newAI);
10246 if (!
i_AIs.empty())
10319 creature->SummonGraveyardTeleporter();
10355 if (owner->m_Controlled.find(
this) != owner->m_Controlled.end())
10357 TC_LOG_FATAL(
"entities.unit",
"Unit {} is in controlled list of {} when removed from world",
GetEntry(), owner->GetEntry());
10407 UnitAI* newAI =
nullptr;
10415 if (
CreatureAI* charmerAI = creatureCharmer->AI())
10416 newAI = charmerAI->GetAIForCharmedPlayer(
ToPlayer());
10443 ai->OnCharmed(
true);
10481 switch (missCondition)
10534 if (!damageNullified)
10600 aurasTriggeringProc.emplace_back(procEffectMask, aurApp);
10609 aurasTriggeringProc.emplace_back(0, aurApp);
10625 processAuraApplication(aurApp);
10632 processAuraApplication(itr->second);
10641 ProcEventInfo myProcEventInfo(
this, actionTarget, typeMaskActor, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo);
10650 if (modOwner !=
this && spell)
10653 for (
auto itr = modOwner->GetAppliedAuras().begin(); itr != modOwner->GetAppliedAuras().end(); ++itr)
10655 if (spell->
m_appliedMods.count(itr->second->GetBase()) != 0)
10656 modAuras.push_front(itr->second);
10658 modOwner->GetProcAurasTriggeredOnEvent(myAurasTriggeringProc, &modAuras, myProcEventInfo);
10664 ProcEventInfo targetProcEventInfo(
this, actionTarget, typeMaskActionTarget, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo);
10666 if (typeMaskActionTarget && actionTarget)
10671 if (typeMaskActionTarget && actionTarget)
10678 bool const disableProcs = triggeringSpell && triggeringSpell->
IsProcDisabled();
10685 for (
auto const& [procEffectMask, aurApp] : aurasTriggeringProc)
10707 petActionFeedback.
SpellID = spellId;
10716 petActionSound.
Action = action;
10774 movementGenerator->Pause(timer);
10786 movementGenerator->Resume(timer);
10858 displayScale = model->DisplayScale;
10881 if (!transforms.empty())
10884 for (
auto i = transforms.begin(); i != transforms.end(); ++i)
10890 if (!ignorePositiveAurasPreventingMounting)
10891 handledAura = (*i);
10894 handledAura = (*i);
10899 handledAura = (*i);
10915 else if (!shapeshiftAura.empty())
10978 std::list<Unit*> targets;
10988 targets.remove(exclude);
10991 for (std::list<Unit*>::iterator tIter = targets.begin(); tIter != targets.end();)
10993 if (!
IsWithinLOSInMap(*tIter) || (*tIter)->IsTotem() || (*tIter)->IsSpiritService() || (*tIter)->IsCritter())
10994 targets.erase(tIter++);
11000 if (targets.empty())
11085 else if (val < 0.0f)
11093 player->UpdatePowerRegen(power);
11100 if (player->GetGroup())
11105 Pet* pet = ((
Pet*)
this);
11208 return !petInfo.has_value();
11211 if (freeActiveSlotItr == petStable.
ActivePets.end())
11221 TC_LOG_ERROR(
"entities.unit",
"Pet::InitStatsForLevel() failed for creature (Entry: {})!", pet->
GetEntry());
11250 TC_LOG_ERROR(
"entities.unit",
"Unit::PlayOneShotAnimKitId using invalid AnimKit ID: {}", animKitId);
11317 if (attacker && !attacker->
IsInMap(victim))
11318 attacker =
nullptr;
11321 Player* player =
nullptr;
11327 bool isRewardAllowed = attacker != victim;
11329 isRewardAllowed = isRewardAllowed && !creature->
GetTapList().empty();
11331 std::vector<Player*> tappers;
11332 if (isRewardAllowed && creature)
11336 tappers.push_back(tapper);
11339 isRewardAllowed =
false;
11344 isRewardAllowed =
false;
11348 if (isRewardAllowed)
11350 std::unordered_set<Group*> groups;
11351 for (
Player* tapper : tappers)
11353 if (
Group* tapperGroup = tapper->GetGroup())
11355 if (groups.insert(tapperGroup).second)
11358 partyKillLog.
Player = player && tapperGroup->IsMember(player->
GetGUID()) ? player->
GetGUID() : tapper->GetGUID();
11360 partyKillLog.
Write();
11362 tapperGroup->BroadcastPacket(partyKillLog.
GetRawPacket(), tapperGroup->GetMemberGroup(tapper->GetGUID()) != 0);
11365 tapperGroup->UpdateLooterGuid(creature,
true);
11371 partyKillLog.
Player = tapper->GetGUID();
11373 tapper->SendDirectMessage(partyKillLog.
Write());
11382 dungeonEncounter = instance->GetBossDungeonEncounter(creature);
11386 if (dungeonEncounter)
11392 else if (!tappers.empty())
11394 Group* group = !groups.empty() ? *groups.begin() :
nullptr;
11412 for (
Group* tapperGroup : groups)
11413 tapperGroup->UpdateLooterGuid(creature);
11418 for (
Player* tapper : tappers)
11422 if (dungeonEncounter)
11438 for (
Player* tapper : tappers)
11440 if (
Quest const* reward =
sObjectMgr->GetQuestTemplate(vignette->Data->RewardQuestID))
11443 if (vignette->Data->VisibleTrackingQuestID)
11444 tapper->SetRewardedQuest(vignette->Data->VisibleTrackingQuestID);
11452 if (attacker && (attacker->
IsPet() || attacker->
IsTotem()))
11463 for (
Player* tapper : tappers)
11464 if (tapper->IsAtGroupRewardDistance(victim))
11465 Unit::ProcSkillsAndAuras(tapper, victim, {
PROC_FLAG_NONE,
PROC_FLAG_2_TARGET_DIES },
PROC_FLAG_NONE,
PROC_SPELL_TYPE_MASK_ALL,
PROC_SPELL_PHASE_NONE,
PROC_HIT_NONE,
nullptr,
nullptr,
nullptr);
11477 if (!skipSettingDeathState)
11486 for (
Player* tapper : tappers)
11488 Pet* pet = tapper->GetPet();
11503 plrVictim->SetPvPDeath(player !=
nullptr);
11510 TC_LOG_DEBUG(
"entities.unit",
"We are dead, losing {} percent durability", loss);
11512 plrVictim->DurabilityLossAll(baseLoss,
false);
11514 plrVictim->SendDurabilityLoss(plrVictim, loss);
11521 if (plrVictim->duel)
11523 plrVictim->duel->Opponent->CombatStopWithPets(
true);
11524 plrVictim->CombatStopWithPets(
true);
11533 if (!creature->
IsPet())
11555 ai->OnHealthDepleted(attacker,
true);
11556 ai->JustDied(attacker);
11561 if (
WorldObject * summoner = summon->GetSummoner())
11563 if (summoner->ToCreature() && summoner->ToCreature()->IsAIEnabled())
11564 summoner->ToCreature()->AI()->SummonedCreatureDies(creature, attacker);
11565 else if (summoner->ToGameObject() && summoner->ToGameObject()->AI())
11566 summoner->ToGameObject()->AI()->SummonedCreatureDies(creature, attacker);
11573 if (player && attacker != victim)
11576 pvp->HandleKill(player, victim);
11579 bf->HandleKill(player, victim);
11596 bg->HandleKillPlayer(playerVictim, player);
11599 bg->HandleKillUnit(victim->
ToCreature(), attacker);
11619 sScriptMgr->OnPVPKill(killerPlr, killedPlr);
11621 sScriptMgr->OnCreatureKill(killerPlr, killedCre);
11626 sScriptMgr->OnPlayerKilledByCreature(killerCre, killed);
11784 playerMover->SendDirectMessage(packet.
Write());
11804 Unit* caster =
nullptr;
11806 if (!fearAuras.empty())
11876 if (
this == charmer)
11952 if (player->isAFK())
11953 player->ToggleAFK();
11955 player->SetClientControl(
this,
false);
12026 ai->OnCharmed(
false);
12122 player->SetClientControl(
this,
true);
12137 charmedAI->OnCharmed(
false);
12175 m_vehicleKit = Trinity::make_unique_trackable<Vehicle>(
this, vehInfo, creatureEntry);
12190 if (!onRemoveFromWorld)
12221 return vehicleRoot;
12294 Group* group =
nullptr;
12304 Player* Target = itr.GetSource();
12310 TagUnitMap.push_back(Target);
12313 if (pet->IsAlive())
12314 TagUnitMap.push_back(pet);
12321 TagUnitMap.push_back(owner);
12323 if ((pet ==
this ||
IsInMap(pet)) && pet->IsAlive())
12324 TagUnitMap.push_back(pet);
12331 return entry->IsContestedGuardFaction();
12369 if (!(effMask & (1 << spellEffectInfo.EffectIndex)))
12373 effMask &= ~(1 << spellEffectInfo.EffectIndex);
12385 aura->ApplyForTargets();
12395 aura =
AddAura(spellId, target);
12442 playSpellVisualKit.
KitType = type;
12443 playSpellVisualKit.
Duration = duration;
12457 bool hasMissile =
false;
12464 if (spell->GetSpellInfo()->Id == spellId)
12466 itr.second->ScheduleAbort();
12480 packet.
Reverse = reverseMissile;
12496 Unit const* target =
nullptr;
12534 missChance += 19.0f;
12537 float resistMissChance = 100.0f;
12542 missChance -= resistMissChance - 100.0f;
12556 return std::max(missChance, 0.f);
12607 speedXY = -speedXY;
12608 o = o - float(
M_PI);
12611 float vcos = std::cos(o);
12612 float vsin = std::sin(o);
12620 return player->GetRatingBonusValue(cr);
12624 return owner->GetRatingBonusValue(cr);
12657 if (
Item* artifact = player->GetItemByGuid(artifactAura->GetCastItemGUID()))
12659 if (
ShapeshiftForm(artifactAppearance->OverrideShapeshiftFormID) == form)
12660 return artifactAppearance->OverrideShapeshiftDisplayID;
12664 bool useRandom =
false;
12680 std::vector<uint32> displayIds;
12681 displayIds.reserve(formModelData->Choices->size());
12683 for (std::size_t i = 0; i < formModelData->Choices->size(); ++i)
12690 displayIds.push_back(displayInfo->DisplayID);
12694 if (!displayIds.empty())
12699 if (
uint32 formChoice = player->GetCustomizationChoice(formModelData->OptionID))
12701 auto choiceItr = std::find_if(formModelData->Choices->begin(), formModelData->Choices->end(), [formChoice](
ChrCustomizationChoiceEntry const* choice)
12703 return choice->ID == formChoice;
12706 if (choiceItr != formModelData->Choices->end())
12708 return displayInfo->DisplayID;
12734 bool spellClickHandled =
false;
12738 auto clickBounds =
sObjectMgr->GetSpellClickInfoMapBounds(spellClickEntry);
12739 for (
auto const& clickPair : clickBounds)
12742 if (!clickPair.second.IsFitToRequirements(clicker,
this))
12746 if (!
sConditionMgr->IsObjectMeetingSpellClickConditions(spellClickEntry, clickPair.second.spellId, clicker,
this))
12749 spellClickHandled =
HandleSpellClick(clicker, seatId, clickPair.second.spellId,
flags, &clickPair.second);
12761 Unit* caster = clicker;
12762 Unit* target =
this;
12766 if (spellClickInfo)
12781 uint8 effectIndex = 0;
12782 bool hasControlVehicleAura =
false;
12787 hasControlVehicleAura =
true;
12795 if (!hasControlVehicleAura)
12797 if (!spellClickInfo)
12798 TC_LOG_ERROR(
"sql.sql",
"RideSpell {} specified in vehicle_accessory or vehicle_template_accessory is not a valid vehicle enter aura!", spellId);
12800 TC_LOG_ERROR(
"sql.sql",
"Spell {} specified in npc_spellclick_spells is not a valid vehicle enter aura!", spellId);
12809 castResult = caster->
CastSpell(target, spellId, args);
12813 std::array<SpellEffectValue, MAX_SPELL_EFFECTS> bp = { };
12815 bp[spellEffectInfo.EffectIndex] = spellEffectInfo.BasePoints;
12817 bp[effectIndex] = seatId;
12890 if (
CreatureGroup* creatureGroup = vehicleBaseCreature->GetFormation())
12915 for (AuraEffectList::const_iterator itr = vehicleAuras.begin(); itr != vehicleAuras.end(); ++itr)
12917 if ((*itr)->GetCasterGUID() !=
GetGUID())
12921 ASSERT(!rideVehicleEffect);
12922 rideVehicleEffect = *itr;
12926 ASSERT(rideVehicleEffect);
12964 TC_LOG_ERROR(
"entities.vehicle",
"RemovePassenger() couldn't remove current unit from vehicle. Debug info: {}",
GetDebugInfo());
12971 if (player && player->
duel && player->
duel->IsMounted)
12984 pos = *exitPosition;
13003 float height = pos.
GetPositionZ() + vehicleCollisionHeight;
13011 init.SetTransportExit();
13092 playerMover->SendDirectMessage(moveTeleport.
Write());
13128 TC_LOG_DEBUG(
"entities.unit",
"Unit::UpdatePosition({}, {}, {}) .. bad coordinates!", x, y, z);
13136 bool const relocated = (teleport ||
13150 for (
AuraEffect const* auraEffect : controlZoneAuras)
13170 return (relocated || turn);
13197 float addRage = baseRage;
13224 for (AttackerSet::const_iterator itr = attackers.begin(); itr != attackers.end();)
13226 if ((*itr)->GetFactionTemplateEntry()->Faction == faction_id)
13228 (*itr)->AttackStop();
13229 itr = attackers.begin();
13235 std::vector<CombatReference*> refsToEnd;
13237 if (pair.second->GetOther(
this)->GetFactionTemplateEntry()->Faction == faction_id)
13238 refsToEnd.push_back(pair.second);
13243 minion->StopAttackFaction(faction_id);
13255 std::ostringstream o;
13256 o <<
"Summon Slot: ";
13263 o <<
"Controlled List: ";
13265 o << (*itr)->GetGUID().ToString() <<
", ";
13269 o <<
"Aura List: ";
13271 o << itr->first <<
", ";
13277 o <<
"Passenger List: ";
13280 o << passenger->GetGUID().ToString() <<
", ";
13301 if (mask & (1 << i) && (!resist || *resist > schoolResistance))
13302 resist = schoolResistance;
13305 return resist.value_or(0);
13335 transport->GetPositionWithOffset({ stayPos.x, stayPos.y, stayPos.z }).GetPosition(stayPos.x, stayPos.y, stayPos.z);
13464 playerMover->SendDirectMessage(packet.
Write());
13565 playerMover->SendDirectMessage(packet.
Write());
13591 static OpcodeServer const waterWalkingOpcodeTable[2][2] =
13602 playerMover->SendDirectMessage(packet.
Write());
13629 static OpcodeServer const featherFallOpcodeTable[2][2] =
13640 playerMover->SendDirectMessage(packet.
Write());
13661 float hoverHeight =
m_unitData->HoverHeight;
13693 playerMover->SendDirectMessage(packet.
Write());
13739 static OpcodeServer const collisionOpcodeTable[2][2] =
13750 playerMover->SendDirectMessage(packet.
Write());
13776 static OpcodeServer const disableStrafingOpcodeTable[2] =
13787 playerMover->SendDirectMessage(packet.
Write());
13807 static OpcodeServer const disableJumpingOpcodeTable[2] =
13818 playerMover->SendDirectMessage(packet.
Write());
13838 static constexpr OpcodeServer fullSpeedTurningOpcodeTable[2] =
13849 playerMover->SendDirectMessage(packet.
Write());
13869 static constexpr OpcodeServer fullSpeedPitchingOpcodeTable[2] =
13880 playerMover->SendDirectMessage(packet.
Write());
13900 static constexpr OpcodeServer alwaysAllowPitchingOpcodeTable[2] =
13911 playerMover->SendDirectMessage(packet.
Write());
13934 static OpcodeServer const swimToFlyTransOpcodeTable[2] =
13945 playerMover->SendDirectMessage(packet.
Write());
13966 static OpcodeServer const canTurnWhileFallingOpcodeTable[2] =
13977 playerMover->SendDirectMessage(packet.
Write());
14008 playerMover->SendDirectMessage(packet.
Write());
14028 static OpcodeServer const disableInertiaOpcodeTable[2] =
14039 playerMover->SendDirectMessage(packet.
Write());
14070 playerMover->SendDirectMessage(packet.
Write());
14101 playerMover->SendDirectMessage(packet.
Write());
14119 player->SendDirectMessage(moveSetVehicleRec.
Write());
14150 applyMovementForce.
Force = &force;
14151 movingPlayer->SendDirectMessage(applyMovementForce.
Write());
14157 updateApplyMovementForce.
Force = &force;
14175 moveRemoveMovementForce.
ID = id;
14176 movingPlayer->SendDirectMessage(moveRemoveMovementForce.
Write());
14201 static OpcodeServer const ignoreMovementForcesOpcodeTable[2] =
14212 movingPlayer->SendDirectMessage(packet.
Write());
14231 setModMovementForceMagnitude.
Speed = modMagnitude;
14232 movingPlayer->SendDirectMessage(setModMovementForceMagnitude.
Write());
14233 ++movingPlayer->m_movementForceModMagnitudeChanges;
14239 updateModMovementForceMagnitude.
Speed = modMagnitude;
14258 inertia.
lifetime = duration.count();
14267 movingPlayer->SendDirectMessage(applyInertia.
Write());
14292 movingPlayer->SendDirectMessage(moveRemoveInertia.
Write());
14311 movingPlayer->SendDirectMessage(setGravityModifier.
Write());
14349 displayScale = model->DisplayScale;
14353 hoverHeight = modelData->HoverHeight * modelData->ModelScale * displayInfo->CreatureModelScale * displayScale;
14401 for (SpellSpellGroupMap::const_iterator itr = spellGroup.first; itr != spellGroup.second ; ++itr)
14406 for (AuraEffectList::const_iterator auraItr = auraEffList.begin(); auraItr != auraEffList.end(); ++auraItr)
14408 if (aurEff != (*auraItr) && (!checkMiscValue || (*auraItr)->GetMiscValue() == miscValue) &&
14409 sSpellMgr->IsSpellMemberOfSpellGroup((*auraItr)->GetSpellInfo()->Id, itr->second))
14412 if (abs(val) < abs((*auraItr)->GetAmount()))
14413 val = (*auraItr)->GetAmount();
14433 for (Unit::AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end();)
14444 diff = std::popcount(auraEffectMask) - std::popcount(existingAurEff->
GetBase()->
GetEffectMask());
14451 if (removeOtherAuraApplications && (!base->
IsArea() || base->
GetOwner() !=
this))
14459 itr = auras.begin();
14510 return m_unitData->VirtualItems[slot].ItemID;
14518 return m_unitData->VirtualItems[slot].ItemAppearanceModID;
14536 TC_LOG_ERROR(
"entities.unit",
"WorldObject::MonsterText: `broadcast_text` (ID: {}) was not found", textId);
14569 TC_LOG_ERROR(
"entities.unit",
"WorldObject::Whisper: `broadcast_text` was not {} found", textId);
14582 clearBossEmotes.
Write();
14592 ref.GetSource()->SendDirectMessage(clearBossEmotes.
GetRawPacket());
14599 if (slot == spellId)
14614 auto findMatchingAuraEffectIn = [
this, spellInfo, &triggerFlag, context](
AuraType type) ->
SpellInfo const*
14618 bool matches = auraEffect->GetMiscValue() ?
uint32(auraEffect->GetMiscValue()) == spellInfo->
Id : auraEffect->IsAffectingSpell(spellInfo);
14619 if (matches && context->
AddSpell(auraEffect->GetAmountAsInt()))
14621 if (
SpellInfo const* newInfo =
sSpellMgr->GetSpellInfo(auraEffect->GetAmountAsInt(),
GetMap()->GetDifficultyID()))
14626 triggerFlag &= ~TRIGGERED_IGNORE_POWER_COST;
14631 triggerFlag &= ~TRIGGERED_IGNORE_SHAPESHIFT;
14643 triggerFlag &= ~TRIGGERED_IGNORE_CAST_TIME;
14659 for (
AuraEffect const* effect : visualOverrides)
14661 if (
uint32(effect->GetMiscValue()) == spellInfo->
Id)
14665 spellInfo = visualSpell;
14740 std::stringstream sstr;
14745 <<
" Class: " << std::to_string(
GetClass()) <<
"\n"
14752 size_t controlledCount = 0;
14756 sstr <<
"\n" <<
"m_Controlled " << controlledCount <<
" : " << controlled->GetGUID().ToString();
14765 name[i] = uf.
Name[i];
#define sCreatureAIRegistry
@ CREATURE_FLAG_EXTRA_NO_BLOCK
@ CREATURE_FLAG_EXTRA_NO_CRUSHING_BLOWS
@ CREATURE_FLAG_EXTRA_NO_CRIT
@ CREATURE_FLAG_EXTRA_NO_PARRY_HASTEN
@ CREATURE_FLAG_EXTRA_OBEYS_TAUNT_DIMINISHING_RETURNS
@ CREATURE_FLAG_EXTRA_NO_PARRY
@ CREATURE_STATIC_FLAG_UNKILLABLE
DB2Storage< ArtifactAppearanceEntry > sArtifactAppearanceStore("ArtifactAppearance.db2", &ArtifactAppearanceLoadInfo::Instance)
DB2Storage< SpellCategoryEntry > sSpellCategoryStore("SpellCategory.db2", &SpellCategoryLoadInfo::Instance)
DB2Storage< CreatureModelDataEntry > sCreatureModelDataStore("CreatureModelData.db2", &CreatureModelDataLoadInfo::Instance)
DB2Storage< LiquidTypeEntry > sLiquidTypeStore("LiquidType.db2", &LiquidTypeLoadInfo::Instance)
DB2Storage< AnimKitEntry > sAnimKitStore("AnimKit.db2", &AnimKitLoadInfo::Instance)
DB2Storage< ChrClassesEntry > sChrClassesStore("ChrClasses.db2", &ChrClassesLoadInfo::Instance)
DB2Storage< SpellShapeshiftFormEntry > sSpellShapeshiftFormStore("SpellShapeshiftForm.db2", &SpellShapeshiftFormLoadInfo::Instance)
DB2Storage< CreatureDisplayInfoExtraEntry > sCreatureDisplayInfoExtraStore("CreatureDisplayInfoExtra.db2", &CreatureDisplayInfoExtraLoadInfo::Instance)
DB2Storage< EmotesEntry > sEmotesStore("Emotes.db2", &EmotesLoadInfo::Instance)
DB2Storage< BroadcastTextEntry > sBroadcastTextStore("BroadcastText.db2", &BroadcastTextLoadInfo::Instance)
DB2Storage< VignetteEntry > sVignetteStore("Vignette.db2", &VignetteLoadInfo::Instance)
DB2Storage< ChrRacesEntry > sChrRacesStore("ChrRaces.db2", &ChrRacesLoadInfo::Instance)
DB2Storage< ChrCustomizationReqEntry > sChrCustomizationReqStore("ChrCustomizationReq.db2", &ChrCustomizationReqLoadInfo::Instance)
DB2Storage< CreatureDisplayInfoEntry > sCreatureDisplayInfoStore("CreatureDisplayInfo.db2", &CreatureDisplayInfoLoadInfo::Instance)
DB2Storage< PowerDisplayEntry > sPowerDisplayStore("PowerDisplay.db2", &PowerDisplayLoadInfo::Instance)
DB2Storage< FlightCapabilityEntry > sFlightCapabilityStore("FlightCapability.db2", &FlightCapabilityLoadInfo::Instance)
DB2Storage< MountCapabilityEntry > sMountCapabilityStore("MountCapability.db2", &MountCapabilityLoadInfo::Instance)
DB2Storage< AreaTableEntry > sAreaTableStore("AreaTable.db2", &AreaTableLoadInfo::Instance)
DB2Storage< VehicleEntry > sVehicleStore("Vehicle.db2", &VehicleLoadInfo::Instance)
@ CanMountWhileTransformedAsThis
@ AllowUnderwaterSwimmingMounts
@ AllowSurfaceSwimmingMounts
@ ArmorItemLevelDiminishing
@ UnitsUseDefaultPowerOnInit
@ ResetCooldownUponEndingEncounter
@ MOUNT_CAPABILITY_FLAG_FLYING
@ MOUNT_CAPABIILTY_FLAG_IGNORE_RESTRICTIONS
@ MOUNT_CAPABILITY_FLAG_UNDERWATER
@ MOUNT_CAPABILITY_FLAG_GROUND
@ MOUNT_CAPABILITY_FLAG_FLOAT
@ SummonFromBattlePetJournal
std::chrono::milliseconds Milliseconds
Milliseconds shorthand typedef.
std::chrono::steady_clock::time_point TimePoint
time_point shorthand typedefs
#define ASSERT_NODEBUGINFO
#define ASSERT_NOTNULL(pointer)
@ GROUP_UPDATE_FLAG_CUR_HP
@ GROUP_UPDATE_FLAG_POWER_TYPE
@ GROUP_UPDATE_FLAG_MAX_HP
@ GROUP_UPDATE_FLAG_MAX_POWER
@ GROUP_UPDATE_FLAG_AURAS
@ GROUP_UPDATE_FLAG_LEVEL
@ GROUP_UPDATE_FLAG_CUR_POWER
@ GROUP_UPDATE_FLAG_PET_CUR_HP
@ GROUP_UPDATE_FLAG_PET_AURAS
@ GROUP_UPDATE_FLAG_PET_MAX_HP
@ ITEM_MODIFIER_ARTIFACT_APPEARANCE_ID
@ ITEM_SUBCLASS_WEAPON_AXE2
@ ITEM_SUBCLASS_WEAPON_STAFF
@ ITEM_SUBCLASS_WEAPON_MACE
@ ITEM_SUBCLASS_WEAPON_EXOTIC2
@ ITEM_SUBCLASS_WEAPON_WARGLAIVES
@ ITEM_SUBCLASS_WEAPON_FISHING_POLE
@ ITEM_SUBCLASS_WEAPON_MACE2
@ ITEM_SUBCLASS_WEAPON_DAGGER
@ ITEM_SUBCLASS_WEAPON_SWORD
@ ITEM_SUBCLASS_WEAPON_AXE
@ ITEM_SUBCLASS_WEAPON_FIST_WEAPON
@ ITEM_SUBCLASS_WEAPON_EXOTIC
@ ITEM_SUBCLASS_WEAPON_THROWN
@ ITEM_SUBCLASS_WEAPON_SWORD2
@ ITEM_SUBCLASS_WEAPON_POLEARM
#define TC_LOG_DEBUG(filterType__, message__,...)
#define TC_LOG_ERROR(filterType__, message__,...)
#define TC_LOG_FATAL(filterType__, message__,...)
LootStore LootTemplates_Skinning("skinning_loot_template", "creature skinning id", true)
LootStore LootTemplates_Creature("creature_loot_template", "creature entry", true)
std::unordered_map< ObjectGuid, std::unique_ptr< Loot > > GenerateDungeonEncounterPersonalLoot(uint32 dungeonEncounterId, uint32 lootId, LootStore const &store, LootType type, WorldObject const *lootOwner, uint32 minMoney, uint32 maxMoney, uint16 lootMode, MapDifficultyEntry const *mapDifficulty, std::vector< Player * > const &tappers)
bool IsInvalidMovementSlot(uint8 const slot)
@ MOTION_PRIORITY_HIGHEST
@ MOVEMENTFLAG_CAN_TURN_WHILE_FALLING
@ MOVEMENTFLAG_CAN_SWIM_TO_FLY_TRANS
@ MOVEMENTFLAG_WATERWALKING
@ MOVEMENTFLAG_MASK_MOVING
@ MOVEMENTFLAG_FULL_SPEED_PITCHING
@ MOVEMENTFLAG_DISABLE_GRAVITY
@ MOVEMENTFLAG_FALLING_SLOW
@ MOVEMENTFLAG_FULL_SPEED_TURNING
@ MOVEMENTFLAG_CANNOT_SWIM
@ MOVEMENTFLAG_MASK_TURNING
@ MOVEMENTFLAG_IGNORE_MOVEMENT_FORCES
@ MOVEMENTFLAG_MASK_MOVING_FLY
@ MOVEMENTFLAG_NO_JUMPING
@ MOVEMENTFLAG_FALLING_FAR
@ MOVEMENTFLAG_SPLINE_ELEVATION
@ MOVEMENTFLAG_CAN_ADV_FLY
@ MOVEMENTFLAG_CAN_DOUBLE_JUMP
@ MOVEMENTFLAG_ALWAYS_ALLOW_PITCHING
@ MOVEMENTFLAG_DISABLE_COLLISION
@ MOVEMENTFLAG_DISABLE_INERTIA
@ MOVEMENTFLAG_ADV_FLYING
#define DEFAULT_PLAYER_HOVER_HEIGHT
#define DEFAULT_PLAYER_DISPLAY_SCALE
#define NOMINAL_MELEE_RANGE
@ NOTIFY_VISIBILITY_CHANGED
float const DEFAULT_COLLISION_HEIGHT
@ SMSG_MOVE_SPLINE_SET_PITCH_RATE
@ SMSG_MOVE_SET_ADV_FLYING_LAUNCH_SPEED_COEFFICIENT
@ SMSG_MOVE_SPLINE_SET_SWIM_SPEED
@ SMSG_MOVE_SET_FLIGHT_SPEED
@ SMSG_MOVE_SPLINE_SET_FLYING
@ SMSG_MOVE_SET_FLIGHT_BACK_SPEED
@ SMSG_MOVE_SET_ADV_FLYING_SURFACE_FRICTION
@ SMSG_MOVE_DISABLE_COLLISION
@ SMSG_MOVE_UPDATE_PITCH_RATE
@ SMSG_MOVE_SPLINE_SET_WALK_SPEED
@ SMSG_MOVE_ENABLE_DOUBLE_JUMP
@ SMSG_MOVE_SPLINE_SET_RUN_MODE
@ SMSG_MOVE_DISABLE_GRAVITY
@ SMSG_MOVE_UNSET_CANNOT_SWIM
@ SMSG_MOVE_SPLINE_SET_SWIM_BACK_SPEED
@ SMSG_MOVE_SPLINE_DISABLE_COLLISION
@ SMSG_MOVE_ENABLE_TRANSITION_BETWEEN_SWIM_AND_FLY
@ SMSG_MOVE_SPLINE_UNROOT
@ SMSG_MOVE_SET_RUN_BACK_SPEED
@ SMSG_MOVE_SPLINE_SET_HOVER
@ SMSG_MOVE_SPLINE_SET_WATER_WALK
@ SMSG_MOVE_ENABLE_FULL_SPEED_PITCHING
@ SMSG_MOVE_SPLINE_SET_NORMAL_FALL
@ SMSG_MOVE_ENABLE_INERTIA
@ SMSG_MOVE_SET_ADV_FLYING_PITCHING_RATE_DOWN
@ SMSG_MOVE_SPLINE_SET_TURN_RATE
@ SMSG_MOVE_SET_NORMAL_FALL
@ SMSG_MOVE_SET_ADV_FLYING_BANKING_RATE
@ SMSG_MOVE_SET_ADV_FLYING_LIFT_COEFFICIENT
@ SMSG_MOVE_SPLINE_UNSET_HOVER
@ SMSG_MOVE_UPDATE_FLIGHT_SPEED
@ SMSG_MOVE_SET_PITCH_RATE
@ SMSG_MOVE_SPLINE_SET_LAND_WALK
@ SMSG_MOVE_UPDATE_FLIGHT_BACK_SPEED
@ SMSG_MOVE_UPDATE_WALK_SPEED
@ SMSG_MOVE_SET_CAN_TURN_WHILE_FALLING
@ SMSG_MOVE_SPLINE_DISABLE_GRAVITY
@ SMSG_MOVE_ENABLE_COLLISION
@ SMSG_MOVE_SET_IGNORE_MOVEMENT_FORCES
@ SMSG_MOVE_DISABLE_STRAFING
@ SMSG_MOVE_DISABLE_FULL_SPEED_TURNING
@ SMSG_MOVE_UNSET_IGNORE_MOVEMENT_FORCES
@ SMSG_MOVE_UPDATE_SWIM_SPEED
@ SMSG_MOVE_ENABLE_GRAVITY
@ SMSG_MOVE_UPDATE_MOD_MOVEMENT_FORCE_MAGNITUDE
@ SMSG_MOVE_SET_ADV_FLYING_PITCHING_RATE_UP
@ SMSG_MOVE_SET_ADV_FLYING_OVER_MAX_DECELERATION
@ SMSG_MOVE_SET_ADV_FLYING_MAX_VEL
@ SMSG_MOVE_UNSET_HOVERING
@ SMSG_MOVE_UNSET_CAN_ADV_FLY
@ SMSG_MOVE_UPDATE_TURN_RATE
@ SMSG_MOVE_SPLINE_SET_RUN_BACK_SPEED
@ SMSG_MOVE_SET_TURN_RATE
@ SMSG_MOVE_SET_WATER_WALK
@ SMSG_MOVE_UNSET_ALWAYS_ALLOW_PITCHING
@ SMSG_MOVE_SET_CANNOT_SWIM
@ SMSG_MOVE_SET_ALWAYS_ALLOW_PITCHING
@ SMSG_MOVE_SET_SWIM_SPEED
@ SMSG_MOVE_UPDATE_RUN_SPEED
@ SMSG_MOVE_SET_WALK_SPEED
@ SMSG_MOVE_SET_ADV_FLYING_ADD_IMPULSE_MAX_SPEED
@ SMSG_MOVE_ENABLE_FULL_SPEED_TURNING
@ SMSG_MOVE_SET_MOD_MOVEMENT_FORCE_MAGNITUDE
@ SMSG_MOVE_SET_ADV_FLYING_GLIDE_START_MIN_HEIGHT
@ SMSG_MOVE_SPLINE_ENABLE_GRAVITY
@ SMSG_MOVE_SPLINE_SET_RUN_SPEED
@ SMSG_MOVE_DISABLE_INERTIA
@ SMSG_MOVE_SET_CAN_ADV_FLY
@ SMSG_MOVE_SPLINE_SET_FLIGHT_BACK_SPEED
@ SMSG_MOVE_UPDATE_SWIM_BACK_SPEED
@ SMSG_MOVE_DISABLE_DOUBLE_JUMP
@ SMSG_MOVE_DISABLE_FULL_SPEED_PITCHING
@ SMSG_MOVE_SET_ADV_FLYING_TURN_VELOCITY_THRESHOLD
@ SMSG_MOVE_UNSET_CAN_FLY
@ SMSG_MOVE_SET_ADV_FLYING_DOUBLE_JUMP_VEL_MOD
@ SMSG_MOVE_SPLINE_UNSET_FLYING
@ SMSG_MOVE_SPLINE_SET_FLIGHT_SPEED
@ SMSG_MOVE_SPLINE_STOP_SWIM
@ SMSG_MOVE_SPLINE_START_SWIM
@ SMSG_MOVE_UPDATE_RUN_BACK_SPEED
@ SMSG_MOVE_SET_SWIM_BACK_SPEED
@ SMSG_MOVE_UNSET_CAN_TURN_WHILE_FALLING
@ SMSG_MOVE_SET_RUN_SPEED
@ SMSG_MOVE_DISABLE_TRANSITION_BETWEEN_SWIM_AND_FLY
@ SMSG_MOVE_SPLINE_ENABLE_COLLISION
@ SMSG_MOVE_ENABLE_STRAFING
@ SMSG_MOVE_SET_ADV_FLYING_AIR_FRICTION
@ SMSG_MOVE_SET_LAND_WALK
@ SMSG_MOVE_DISABLE_JUMPING
@ SMSG_MOVE_SPLINE_SET_FEATHER_FALL
@ SMSG_MOVE_SPLINE_SET_WALK_MODE
@ SMSG_MOVE_SET_FEATHER_FALL
@ SMSG_MOVE_ENABLE_JUMPING
std::optional< T > Optional
Optional helper class to wrap optional values within.
@ TELE_TO_NOT_LEAVE_COMBAT
@ TELE_TO_NOT_LEAVE_TRANSPORT
std::unordered_map< uint32, PlayerSpell > PlayerSpellMap
constexpr uint8 INVENTORY_SLOT_BAG_0
Trinity::IteratorPair< UF::ChrCustomizationChoice const * > MakeChrCustomizationChoiceRange(Container const &container)
bool roll_chance(float chance, PseudoRandomDistributionState &state)
uint32 urand(uint32 min, uint32 max)
@ SERVERSIDE_VISIBILITY_GM
@ SERVERSIDE_VISIBILITY_GHOST
@ SPELL_ATTR11_IGNORE_SPELLCAST_OVERRIDE_SHAPESHIFT_REQUIREMENTS
@ SPELL_ATTR11_IGNORE_CASTER_ABSORB_MODIFIERS
@ SPELL_ATTR11_IGNORE_TARGET_ABSORB_MODIFIERS
@ SPELL_ATTR10_RESET_COOLDOWN_ON_ENCOUNTER_END
@ SPELL_ATTR9_ALLOW_CAST_WHILE_CHANNELING
@ SPELL_ATTR9_IGNORE_CASTER_HEALING_MODIFIERS
@ SPELL_ATTR9_CANNOT_KILL_TARGET
#define MAX_POWERS_PER_CLASS
@ SPELL_ATTR7_DONT_CAUSE_SPELL_PUSHBACK
@ SPELL_ATTR7_DISPEL_REMOVES_CHARGES
@ SPELL_ATTR7_NO_ATTACK_PARRY
@ SPELL_ATTR7_DO_NOT_COUNT_FOR_PVP_SCOREBOARD
@ SPELL_ATTR7_NO_ATTACK_MISS
@ SPELL_ATTR7_NO_ATTACK_DODGE
@ SPELL_EFFECT_HEALTH_LEECH
@ SPELL_EFFECT_NORMALIZED_WEAPON_DMG
constexpr uint32 GetMaxLevelForExpansion(uint32 expansion)
@ SPELL_ATTR5_ALLOW_ACTIONS_DURING_CHANNEL
@ SPELL_ATTR5_REMOVE_ENTERING_ARENA
@ NPC_CLICK_CAST_TARGET_CLICKER
@ NPC_CLICK_CAST_ORIG_CASTER_OWNER
@ NPC_CLICK_CAST_CASTER_CLICKER
@ SPELL_SCHOOL_MASK_NORMAL
@ SPELL_SCHOOL_MASK_MAGIC
@ SPELL_ATTR2_ALLOW_WHILE_INVISIBLE
@ SPELL_ATTR2_PROC_COOLDOWN_ON_FAILURE
@ SPELL_ATTR2_ALLOW_DEAD_TARGET
@ SPELL_ATTR2_DO_NOT_RESET_COMBAT_TIMERS
@ SPELL_ATTR2_NO_SCHOOL_IMMUNITIES
@ ANIM_MOUNT_SELF_SPECIAL
@ SPELL_ATTR1_ALLOW_WHILE_STEALTHED
@ SPELL_ATTR1_AURA_STAYS_AFTER_COMBAT
@ SPELL_ATTR1_IMMUNITY_PURGES_EFFECT
@ SPELL_ATTR1_IMMUNITY_TO_HOSTILE_AND_FRIENDLY_EFFECTS
@ UNIT_DYNFLAG_SPECIALINFO
@ SPELL_ATTR3_TREAT_AS_PERIODIC
@ SPELL_ATTR3_ALLOW_AURA_WHILE_DEAD
@ SPELL_ATTR3_SUPPRESS_TARGET_PROCS
@ SPELL_ATTR3_NO_DURABILITY_LOSS
@ SPELL_ATTR3_REQUIRES_MAIN_HAND_WEAPON
@ SPELL_ATTR3_SUPPRESS_CASTER_PROCS
@ SPELL_ATTR3_NO_AVOIDANCE
@ SPELL_ATTR3_REQUIRES_OFF_HAND_WEAPON
@ SPELL_ATTR3_IGNORE_CASTER_MODIFIERS
@ SPELL_DAMAGE_CLASS_RANGED
@ SPELL_DAMAGE_CLASS_MAGIC
@ SPELL_DAMAGE_CLASS_NONE
@ SPELL_DAMAGE_CLASS_MELEE
#define PER_CASTER_AURA_STATE_MASK
@ SPELL_ATTR0_NO_ACTIVE_DEFENSE
@ SPELL_ATTR0_ALLOW_WHILE_MOUNTED
@ SPELL_ATTR0_NO_IMMUNITIES
@ SPELL_ATTR0_NO_AURA_CANCEL
@ SPELL_ATTR0_PROC_FAILURE_BURNS_CHARGE
@ SPELL_ATTR0_NOT_IN_COMBAT_ONLY_PEACEFUL
@ DIMINISHING_LEVEL_IMMUNE
@ DIMINISHING_LEVEL_TAUNT_IMMUNE
@ DIMINISHING_AOE_KNOCKBACK
@ SPELL_FAILED_INTERRUPTED
@ AURA_STATE_WOUNDED_20_PERCENT
@ AURA_STATE_HEALTHY_75_PERCENT
@ AURA_STATE_WOUNDED_35_PERCENT
@ AURA_STATE_WOUND_HEALTH_35_80
@ AURA_STATE_WOUND_HEALTH_20_80
@ AURA_STATE_WOUNDED_25_PERCENT
@ AURA_STATE_WOUNDED_50_PERCENT
@ SPELL_ATTR13_DO_NOT_ALLOW_DISABLE_MOVEMENT_INTERRUPT
@ SPELL_ATTR13_ALWAYS_ALLOW_NEGATIVE_HEALING_PERCENT_MODIFIERS
@ CHAT_MSG_MONSTER_WHISPER
@ CHAT_MSG_RAID_BOSS_WHISPER
@ CHAT_MSG_RAID_BOSS_EMOTE
@ SPELL_ATTR4_NO_HARMFUL_THREAT
@ SPELL_ATTR4_IGNORE_DAMAGE_TAKEN_MODIFIERS
@ SPELL_ATTR4_NO_PARTIAL_IMMUNITY
@ SPELL_ATTR4_REACTIVE_DAMAGE_PROC
@ SPELL_ATTR4_ALLOW_ENTERING_ARENA
@ SPELL_ATTR8_IGNORE_SPELLCAST_OVERRIDE_COST
@ SPELL_ATTR8_NO_ATTACK_BLOCK
@ SPELL_ATTR6_NO_PUSHBACK
@ SPELL_ATTR6_IGNORE_CASTER_DAMAGE_MODIFIERS
@ SPELL_ATTR6_IGNORE_HEALING_MODIFIERS
@ SPELL_ATTR6_ABSORB_CANNOT_BE_IGNORE
@ SPELL_ATTR6_DELAY_COMBAT_TIMER_DURING_CAST
AuraTriggerOnHealthChangeDirection
@ AURA_EFFECT_HANDLE_STAT
@ AURA_EFFECT_HANDLE_SEND_FOR_CLIENT
@ AURA_REMOVE_BY_ENEMY_SPELL
@ AURA_REMOVE_BY_INTERRUPT
@ SPELL_AURA_MOD_MELEE_ATTACK_POWER_VERSUS
@ SPELL_AURA_MOD_SPELL_DAMAGE_FROM_CASTER_BY_LABEL
@ SPELL_AURA_MOD_SCHOOL_MASK_DAMAGE_FROM_CASTER
@ SPELL_AURA_MOD_ADV_FLYING_LIFT_COEF
@ SPELL_AURA_CLONE_CASTER
@ SPELL_AURA_MOD_TARGET_ABSORB_SCHOOL
@ SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE
@ SPELL_AURA_MOD_FLIGHT_SPEED_NOT_STACK
@ SPELL_AURA_MOD_PERIODIC_DAMAGE_TAKEN
@ SPELL_AURA_PERIODIC_DAMAGE
@ SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED
@ SPELL_AURA_MOD_MOUNTED_FLIGHT_SPEED_ALWAYS
@ SPELL_AURA_MOD_AUTOATTACK_RANGE
@ SPELL_AURA_MOD_ADV_FLYING_ADD_IMPULSE_MAX_SPEED
@ SPELL_AURA_MOD_PARRY_PERCENT
@ SPELL_AURA_ABILITY_IGNORE_AURASTATE
@ SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE
@ SPELL_AURA_MOD_IGNORE_TARGET_RESIST
@ SPELL_AURA_MOD_SHAPESHIFT
@ SPELL_AURA_MOD_DAMAGE_DONE_VERSUS
@ SPELL_AURA_MOD_CRITICAL_HEALING_AMOUNT
@ SPELL_AURA_DAMAGE_SHIELD
@ SPELL_AURA_DISABLE_ATTACKING_EXCEPT_ABILITIES
@ SPELL_AURA_MOD_ADV_FLYING_MAX_VEL
@ SPELL_AURA_MOD_MELEE_DAMAGE_FROM_CASTER
@ SPELL_AURA_PERIODIC_HEALTH_FUNNEL
@ SPELL_AURA_IGNORE_DUAL_WIELD_HIT_PENALTY
@ SPELL_AURA_MOD_POSSESS_PET
@ SPELL_AURA_MOD_INCREASE_SPEED
@ SPELL_AURA_MOD_EXPERTISE
@ SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS
@ SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN
@ SPELL_AURA_OVERRIDE_AUTOATTACK_WITH_MELEE_SPELL
@ SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER
@ SPELL_AURA_MOD_MOUNTED_SPEED_NOT_STACK
@ SPELL_AURA_MOD_HEALING_DONE_PERCENT
@ SPELL_AURA_MOD_ADV_FLYING_PITCHING_RATE_DOWN
@ SPELL_AURA_MOD_CRIT_CHANCE_VERSUS_TARGET_HEALTH
@ SPELL_AURA_CAST_WHILE_WALKING_BY_SPELL_LABEL
@ SPELL_AURA_TRIGGER_SPELL_ON_HEALTH_PCT
@ SPELL_AURA_MOD_RANGED_ATTACK_POWER_VERSUS
@ SPELL_AURA_SHARE_DAMAGE_PCT
@ SPELL_AURA_CAST_WHILE_WALKING
@ SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE
@ SPELL_AURA_MOD_HEALING_TAKEN_FROM_CASTER
@ SPELL_AURA_TRIGGER_SPELL_ON_POWER_AMOUNT
@ SPELL_AURA_CONTROL_VEHICLE
@ SPELL_AURA_IGNORE_HIT_DIRECTION
@ SPELL_AURA_IGNORE_COMBAT_RESULT
@ SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS
@ SPELL_AURA_DISABLE_AUTOATTACK
@ SPELL_AURA_MOD_SPEED_NOT_STACK
@ SPELL_AURA_MOD_HEALING_DONE_PCT_VERSUS_TARGET_HEALTH
@ SPELL_AURA_SCHOOL_HEAL_ABSORB
@ SPELL_AURA_MOD_INCREASE_VEHICLE_FLIGHT_SPEED
@ SPELL_AURA_COSMETIC_MOUNTED
@ SPELL_AURA_BYPASS_ARMOR_FOR_CASTER
@ SPELL_AURA_MOD_HIT_CHANCE
@ SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT
@ SPELL_AURA_PERIODIC_HEAL
@ SPELL_AURA_MOD_ENEMY_DODGE
@ SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE
@ SPELL_AURA_PERIODIC_DAMAGE_PERCENT
@ SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN
@ SPELL_AURA_MOD_STUN_DISABLE_GRAVITY
@ SPELL_AURA_MOD_DODGE_PERCENT
@ SPELL_AURA_MOD_INCREASE_SWIM_SPEED
@ SPELL_AURA_SPLIT_DAMAGE_PCT
@ SPELL_AURA_SCHOOL_ABSORB_OVERKILL
@ SPELL_AURA_DEFLECT_SPELLS
@ SPELL_AURA_MOD_ABSORB_DONE_PCT
@ SPELL_AURA_MOD_CRIT_DAMAGE_BONUS
@ SPELL_AURA_MOD_HEALING_DONE
@ SPELL_AURA_MOD_HEALING_RECEIVED
@ SPELL_AURA_MOD_HEALING_PCT
@ SPELL_AURA_MOD_DAMAGE_PERCENT_DONE
@ SPELL_AURA_MOD_RAGE_FROM_DAMAGE_DEALT
@ SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER_PET
@ SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_CHANCE
@ SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT
@ SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_TRIGGERED
@ SPELL_AURA_MOD_ARMOR_PENETRATION_PCT
@ SPELL_AURA_MOD_CRITICAL_DAMAGE_TAKEN_FROM_CASTER
@ SPELL_AURA_MOD_OFFHAND_DAMAGE_PCT
@ SPELL_AURA_MOUNT_RESTRICTIONS
@ SPELL_AURA_OVERRIDE_SPELL_VISUAL
@ SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE
@ SPELL_AURA_MOD_CRITICAL_BLOCK_AMOUNT
@ SPELL_AURA_MOD_ABSORB_TAKEN_PCT
@ SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN
@ SPELL_AURA_MOD_MELEE_DAMAGE_TAKEN_PCT
@ SPELL_AURA_MOD_DAMAGE_TAKEN
@ SPELL_AURA_MOD_DAMAGE_DONE_VERSUS_AURASTATE
@ SPELL_AURA_MOD_VEHICLE_SPEED_ALWAYS
@ SPELL_AURA_MOD_POWER_GAIN_PCT
@ SPELL_AURA_MOD_CRIT_PCT
@ SPELL_AURA_MOD_MINIMUM_SPEED
@ SPELL_AURA_MOD_BLOCK_CRIT_CHANCE
@ SPELL_AURA_MOD_SPELL_DAMAGE_FROM_CASTER
@ SPELL_AURA_MOD_DAMAGE_PERCENT_DONE_BY_TARGET_AURA_MECHANIC
@ SPELL_AURA_MOD_POWER_DISPLAY
@ SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER_WITH_ABILITIES
@ SPELL_AURA_MOD_TARGET_RESISTANCE
@ SPELL_AURA_MOD_MINIMUM_SPEED_RATE
@ SPELL_AURA_MOD_SPEED_ALWAYS
@ SPELL_AURA_MOD_ROOT_DISABLE_GRAVITY
@ SPELL_AURA_MOD_DECREASE_SPEED
@ SPELL_AURA_MOD_VERSATILITY
@ SPELL_AURA_CAST_WHILE_WALKING_ALL
@ SPELL_AURA_SCHOOL_ABSORB
@ SPELL_AURA_MOD_DAMAGE_DONE_FOR_MECHANIC
@ SPELL_AURA_MOD_COMBAT_RESULT_CHANCE
@ SPELL_AURA_MOD_MOUNTED_SPEED_ALWAYS
@ SPELL_AURA_MOD_WEAPON_CRIT_PERCENT
@ SPELL_AURA_MOD_MOVEMENT_FORCE_MAGNITUDE
@ SPELL_AURA_MOD_DAMAGE_DONE_CREATURE
@ SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL
@ SPELL_AURA_TRIGGER_SPELL_ON_POWER_PCT
@ SPELL_AURA_MOD_ADV_FLYING_AIR_FRICTION
@ SPELL_AURA_MOD_DURABILITY_LOSS
@ SPELL_AURA_MOD_ADV_FLYING_OVER_MAX_DECELERATION
@ SPELL_AURA_PERIODIC_LEECH
@ SPELL_AURA_MOD_AUTOATTACK_CRIT_CHANCE
@ SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT
@ SPELL_AURA_ACT_AS_CONTROL_ZONE
@ SPELL_AURA_MOD_ADV_FLYING_BANKING_RATE
@ SPELL_AURA_MOD_AUTOATTACK_DAMAGE
@ SPELL_AURA_MOD_DAMAGE_DONE
@ SPELL_AURA_MOD_ADV_FLYING_PITCHING_RATE_UP
@ SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN_PCT
@ SPELL_AURA_MOD_MECHANIC_RESISTANCE
@ SPELL_AURA_MOD_UNATTACKABLE
@ SPELL_AURA_MOD_DAMAGE_TAKEN_BY_LABEL
@ SPELL_AURA_MOD_STAT_BONUS_PCT
@ 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_OVERRIDE_ACTIONBAR_SPELLS
@ SPELL_AURA_INTERCEPT_MELEE_RANGED_ATTACKS
@ SPELL_AURA_MOD_BLOCK_PERCENT
AuraTriggerOnPowerChangeDirection
@ DamagePushbackPlayerOnly
@ DamageCancelsPlayerOnly
double SpellEffectValue
This is a double instead of float to be able to store full range of int32.
@ StartOfRaidEncounterAndStartOfMythicPlus
@ EndOfRaidEncounterAndStartOfMythicPlus
@ PeriodicHealingAndDamage
@ TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE
Will ignore mounted/on vehicle restrictions.
@ TRIGGERED_IGNORE_SHAPESHIFT
Will ignore shapeshift checks.
@ TRIGGERED_IGNORE_POWER_COST
Will ignore power and reagent cost.
@ TRIGGERED_IGNORE_GCD
Will ignore GCD.
@ TRIGGERED_NONE
Not triggered.
@ TRIGGERED_IGNORE_CAST_TIME
Will always be instantly cast.
std::vector< AuraEffect * > AuraEffectVector
@ SPELL_ATTR0_CU_IGNORE_ARMOR
@ SPELL_ATTR0_CU_ENCHANT_PROC
@ SPELL_ATTR0_CU_CAN_CRIT
@ SPELL_ATTR0_CU_REQ_CASTER_BEHIND_TARGET
@ SPELL_ATTR0_CU_SCHOOLMASK_NORMAL_WITH_MAGIC
@ SPELL_SPECIFIC_MAGE_POLYMORPH
#define MELEE_BASED_TRIGGER_MASK
std::pair< SpellSpellGroupMap::const_iterator, SpellSpellGroupMap::const_iterator > SpellSpellGroupMapBounds
@ SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT
@ SPELL_GROUP_STACK_RULE_EXCLUSIVE_HIGHEST
@ PROC_SPELL_TYPE_MASK_ALL
@ PROC_FLAG_MAIN_HAND_WEAPON_SWING
@ PROC_FLAG_TAKE_MELEE_SWING
@ PROC_FLAG_TAKE_ANY_DAMAGE
@ PROC_FLAG_ENCOUNTER_START
@ PROC_FLAG_DEAL_MELEE_SWING
@ PROC_FLAG_TAKE_HARMFUL_SPELL
@ PROC_FLAG_OFF_HAND_WEAPON_SWING
@ PROC_FLAG_2_TARGET_DIES
@ SPELL_CAST_SOURCE_NORMAL
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
@ UNIT_FLAG2_AI_WILL_ONLY_SWIM_IF_TARGET_SWIMS
@ UNIT_FLAG2_INTERACT_WHILE_HOSTILE
@ UNIT_FLAG2_DISARM_OFFHAND
@ UNIT_FLAG2_DISARM_RANGED
@ HITINFO_SWINGNOHITSOUND
@ UNIT_STAND_STATE_SIT_HIGH_CHAIR
@ UNIT_STAND_STATE_SIT_MEDIUM_CHAIR
@ UNIT_STAND_STATE_SIT_LOW_CHAIR
@ UNIT_STAND_STATE_SIT_CHAIR
@ ADV_FLYING_DOUBLE_JUMP_VEL_MOD
@ ADV_FLYING_OVER_MAX_DECELERATION
@ ADV_FLYING_LIFT_COEFFICIENT
@ ADV_FLYING_ADD_IMPULSE_MAX_SPEED
@ ADV_FLYING_GLIDE_START_MIN_HEIGHT
@ ADV_FLYING_AIR_FRICTION
@ ADV_FLYING_LAUNCH_SPEED_COEFFICIENT
@ ADV_FLYING_SURFACE_FRICTION
#define MAX_DECLINED_NAME_CASES
@ ADV_FLYING_PITCHING_RATE_DOWN
@ ADV_FLYING_TURN_VELOCITY_THRESHOLD
@ ADV_FLYING_PITCHING_RATE_UP
@ ADV_FLYING_BANKING_RATE
@ UNIT_NPC_FLAG_TABARDDESIGNER
@ UNIT_NPC_FLAG_SPIRIT_HEALER
@ UNIT_NPC_FLAG_AUCTIONEER
@ UNIT_NPC_FLAG_AREA_SPIRIT_HEALER
@ 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_FLAG3_ALLOW_INTERACTION_WHILE_IN_COMBAT
#define MAX_EQUIPMENT_ITEMS
@ UNIT_FLAG_NON_ATTACKABLE
@ UNIT_FLAG_IMMUNE_TO_NPC
@ UNIT_FLAG_REMOVE_CLIENT_CONTROL
@ UNIT_FLAG_UNINTERACTIBLE
@ UNIT_FLAG_PLAYER_CONTROLLED
@ UNIT_FLAG_PET_IN_COMBAT
float baseMoveSpeed[MAX_MOVE_TYPE]
bool IsInterruptFlagIgnoredForSpell(InterruptFlag, Unit const *, SpellInfo const *, bool, SpellInfo const *)
ProcFlagsHit createProcHitMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missCondition)
static uint32 CalcMeleeAttackRageGain(Unit const *attacker, WeaponAttackType attType)
void ApplyPercentModFloatVar(float &var, float val, bool apply)
float playerBaseMoveSpeed[MAX_MOVE_TYPE]
std::unordered_multimap< uint32, uint32 > SpellImmuneContainer
@ UNIT_MASK_CONTROLABLE_GUARDIAN
@ UNIT_MOD_DAMAGE_OFFHAND
@ UNIT_MOD_STAT_INTELLECT
@ UNIT_MOD_RESISTANCE_SHADOW
@ UNIT_MOD_RESISTANCE_FROST
@ UNIT_MOD_RESISTANCE_HOLY
@ UNIT_MOD_RESISTANCE_START
@ UNIT_MOD_RESISTANCE_ARCANE
@ UNIT_MOD_ARCANE_CHARGES
@ UNIT_MOD_BURNING_EMBERS
@ UNIT_MOD_RESISTANCE_FIRE
@ UNIT_MOD_RESISTANCE_NATURE
@ UNIT_MOD_ALTERNATE_ENCOUNTER
@ UNIT_MOD_ALTERNATE_QUEST
@ UNIT_MOD_ALTERNATE_MOUNT
@ UNIT_MOD_DAMAGE_MAINHAND
TC_GAME_API float playerBaseMoveSpeed[MAX_MOVE_TYPE]
#define CURRENT_FIRST_NON_MELEE_SPELL
@ CURRENT_CHANNELED_SPELL
@ CURRENT_AUTOREPEAT_SPELL
@ UNIT_STATE_ATTACK_PLAYER
@ UNIT_STATE_UNATTACKABLE
@ UNIT_STATE_LOST_CONTROL
@ UNIT_STATE_CANNOT_AUTOATTACK
@ UNIT_STATE_MELEE_ATTACKING
#define MAX_AGGRO_RESET_TIME
#define ATTACK_DISPLAY_DELAY
std::vector< DispelableAura > DispelChargesList
#define CURRENT_MAX_SPELL
@ CR_VERSATILITY_DAMAGE_TAKEN
@ CR_VERSATILITY_DAMAGE_DONE
TC_GAME_API float baseMoveSpeed[MAX_MOVE_TYPE]
#define ARTIFACTS_ALL_WEAPONS_GENERAL_WEAPON_EQUIPPED_PASSIVE
float GetPctOf(T value, T max)
T RoundToInterval(T &num, T floor, T ceil)
constexpr std::underlying_type< E >::type AsUnderlyingType(E enumValue)
T ApplyPct(T &base, U pct)
T CalculatePct(T base, U pct)
@ VEHICLE_SPELL_RIDE_HARDCODED
uint32 GetSpellId() const
void SetRemoveMode(AuraRemoveMode mode)
void _HandleEffect(uint8 effIndex, bool apply)
uint32 GetEffectMask() const
AuraRemoveMode GetRemoveMode() const
bool HasEffect(uint8 effect) const
void ChangeAmount(SpellEffectValue newAmount, bool mark=true, bool onStackOrReapply=false, AuraEffect const *triggeredBy=nullptr)
SpellInfo const * GetSpellInfo() const
AuraType GetAuraType() const
void HandleEffect(AuraApplication *aurApp, uint8 mode, bool apply, AuraEffect const *triggeredBy=nullptr)
SpellEffectInfo const & GetSpellEffectInfo() const
int32 GetAmountAsInt() const
bool IsAffectingSpell(SpellInfo const *spell) const
int32 GetMiscValueB() const
int32 GetMiscValue() const
SpellEffectValue const m_baseAmount
SpellEffectValue GetAmount() const
ObjectGuid GetCasterGUID() const
bool HasMoreThanOneEffectForType(AuraType auraType) const
virtual void _UnapplyForTarget(Unit *target, Unit *caster, AuraApplication *auraApp)
void CallScriptEffectCalcCritChanceHandlers(AuraEffect const *aurEff, AuraApplication const *aurApp, Unit const *victim, float &critChance)
ObjectGuid GetCastId() const
int32 GetMaxDuration() const
void CallScriptEffectAbsorbHandlers(AuraEffect *aurEff, AuraApplication const *aurApp, DamageInfo &dmgInfo, uint32 &absorbAmount, bool &defaultPrevented)
virtual std::string GetDebugInfo() const
void CallScriptDispel(DispelInfo *dispelInfo)
static Aura * TryRefreshStackOrCreate(AuraCreateInfo &createInfo, bool updateEffectMask=true)
ApplicationMap const & GetApplicationMap()
void SetStackAmount(uint8 num)
void CallScriptCalcDamageAndHealingHandlers(AuraEffect const *aurEff, AuraApplication const *aurApp, Unit *victim, int32 &damageOrHealing, int32 &flatMod, float &pctMod)
Unit * GetUnitOwner() const
Trinity::IteratorPair< DBStorageIterator< AuraEffect * > > GetAuraEffects()
AuraApplication const * GetApplicationOfTarget(ObjectGuid guid) const
ObjectGuid GetCasterGUID() const
bool HasEffect(uint8 effIndex) const
void PrepareProcToTrigger(AuraApplication *aurApp, ProcEventInfo &eventInfo, TimePoint now)
uint32 GetProcEffectMask(AuraApplication *aurApp, ProcEventInfo &eventInfo, TimePoint now) const
WorldObject * GetOwner() const
bool ModCharges(int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
bool CanStackWith(Aura const *existingAura) const
int32 CalcDispelChance(Unit const *auraTarget, bool offensive) const
bool IsAppliedOnTarget(ObjectGuid guid) const
void AddProcCooldown(SpellProcEntry const *procEntry, TimePoint now)
int32 GetDuration() const
void UpdateOwner(uint32 diff, WorldObject *owner)
void UnregisterSingleTarget()
bool IsDeathPersistent() const
void PrepareProcChargeDrop(SpellProcEntry const *procEntry, ProcEventInfo const &eventInfo)
AuraEffect * GetEffect(uint32 index) const
void SetNeedClientUpdateForTargets() const
void CallScriptEnterLeaveCombatHandlers(AuraApplication const *aurApp, bool isNowInCombat)
bool ModStackAmount(int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT, bool resetPeriodicTimer=true)
void SetDuration(int32 duration, bool withMods=false)
void TriggerProcOnEvent(uint32 procEffectMask, AuraApplication *aurApp, ProcEventInfo &eventInfo)
void CallScriptEffectAfterAbsorbHandlers(AuraEffect *aurEff, AuraApplication const *aurApp, DamageInfo &dmgInfo, uint32 &absorbAmount)
void CallScriptEffectManaShieldHandlers(AuraEffect *aurEff, AuraApplication const *aurApp, DamageInfo &dmgInfo, uint32 &absorbAmount, bool &defaultPrevented)
AuraObjectType GetType() const
uint8 GetStackAmount() const
SpellInfo const * GetSpellInfo() const
ObjectGuid GetCastItemGUID() const
uint32 GetEffectMask() const
void HandleAuraSpecificMods(AuraApplication const *aurApp, Unit *caster, bool apply, bool onReapply)
Difficulty GetCastDifficulty() const
void SetIsSingleTarget(bool val)
virtual void _ApplyForTarget(Unit *target, Unit *caster, AuraApplication *auraApp)
std::unordered_map< ObjectGuid, AuraApplication * > ApplicationMap
void CallScriptEffectAfterManaShieldHandlers(AuraEffect *aurEff, AuraApplication const *aurApp, DamageInfo &dmgInfo, uint32 &absorbAmount)
virtual void Remove(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)=0
void CallScriptAfterDispel(DispelInfo *dispelInfo)
void _Remove(AuraRemoveMode removeMode)
bool IsSingleTarget() const
ObjectGuid const & GetGUID() const
void ApplyPercentModUpdateFieldValue(UF::UpdateFieldPrivateSetter< T > setter, float percent, bool apply)
void SetUpdateFieldValue(UF::UpdateFieldPrivateSetter< T > setter, typename UF::UpdateFieldPrivateSetter< T >::value_type value)
WowCS::EntityFragmentsHolder m_entityFragments
void ForceUpdateFieldChange(UF::UpdateFieldPrivateSetter< T > const &)
void RemoveDynamicUpdateFieldValue(UF::DynamicUpdateFieldSetter< T > setter, uint32 index)
UF::UpdateFieldHolder m_values
CreateObjectBits m_updateFlag
virtual void DestroyForPlayer(Player const *target) const
void SetUpdateFieldFlagValue(UF::UpdateFieldPrivateSetter< T > setter, typename UF::UpdateFieldPrivateSetter< T >::value_type flag)
void ClearDynamicUpdateFieldValues(UF::DynamicUpdateFieldSetter< T > setter)
UF::DynamicUpdateFieldSetter< T >::insert_result AddDynamicUpdateFieldValue(UF::DynamicUpdateFieldSetter< T > setter)
void RemoveUpdateFieldFlagValue(UF::UpdateFieldPrivateSetter< T > setter, typename UF::UpdateFieldPrivateSetter< T >::value_type flag)
void SuppressPvPCombat(UnitFilter *unitFilter=nullptr)
void EndAllPvECombat(UnitFilter *unitFilter=nullptr)
std::unordered_map< ObjectGuid, PvPCombatReference * > const & GetPvPCombatRefs() const
void Update(uint32 tdiff)
bool HasPvECombat() const
std::unordered_map< ObjectGuid, CombatReference * > const & GetPvECombatRefs() const
void EndAllCombat(UnitFilter *unitFilter=nullptr)
bool HasPvPCombat() const
void EndAllPvPCombat(UnitFilter *unitFilter=nullptr)
static bool IsPlayerMeetingCondition(Player const *player, uint32 conditionId)
virtual void JustUnregisteredDynObject(DynamicObject *)
virtual void JustSummonedGameobject(GameObject *)
virtual void OnSpellClick(Unit *, bool)
virtual void SummonedGameobjectDespawn(GameObject *)
virtual void OnSpellFailed(SpellInfo const *)
virtual void JustUnregisteredAreaTrigger(AreaTrigger *)
virtual void KilledUnit(Unit *)
virtual void JustRegisteredAreaTrigger(AreaTrigger *)
virtual void JustRegisteredDynObject(DynamicObject *)
bool IsTreatedAsRaidUnit() const
CreatureDifficulty const * GetCreatureDifficulty() const
uint16 GetLootMode() const
std::unordered_map< ObjectGuid, std::unique_ptr< Loot > > m_personalLoot
void SetLastDamagedTime(time_t val)
bool IsEvadingAttacks() const
void AllLootRemovedFromCorpse()
GuidUnorderedSet const & GetTapList() const
void SetTappedBy(Unit const *unit, bool withGroup=true)
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
float GetSpellDamageMod(CreatureClassifications classification) const
CreatureTemplate const * GetCreatureTemplate() const
bool CannotPenetrateWater() const
bool CanEnterWater() const override
void SetDisplayId(uint32 displayId, bool setNative=false) override
void LowerPlayerDamageReq(uint64 unDamage)
bool HasFlag(CreatureStaticFlags flag) const
bool IsFullyLooted() const
void SendAIReaction(AiReaction reactionType)
bool IsInEvadeMode() const
static char const * GetBroadcastTextValue(BroadcastTextEntry const *broadcastText, LocaleConstant locale=DEFAULT_LOCALE, uint8 gender=GENDER_MALE, bool forceGender=false)
static bool IsInArea(uint32 objectAreaId, uint32 areaId)
std::set< MountTypeXCapabilityEntry const *, MountTypeXCapabilityEntryComparator > MountTypeXCapabilitySet
void ResistDamage(uint32 amount)
void AbsorbDamage(uint32 amount)
void ModifyDamage(int32 amount)
Unit * GetAttacker() const
DamageInfo(Unit *attacker, Unit *victim, uint32 damage, SpellInfo const *spellInfo, SpellSchoolMask schoolMask, DamageEffectType damageType, WeaponAttackType attackType)
uint32 GetOriginalDamage() const
SpellInfo const * GetSpellInfo() const
void BlockDamage(uint32 amount)
DamageEffectType GetDamageType() const
WeaponAttackType GetAttackType() const
SpellSchoolMask GetSchoolMask() const
ProcFlagsHit GetHitMask() const
uint8 GetRemovedCharges() const
DispelableAura(Aura *aura, int32 dispelChance, uint8 dispelCharges)
uint32 GetSpellId() const
constexpr bool HasFlag(T flag) const
void KillAllEvents(bool force)
std::multimap< uint64, BasicEvent * > const & GetEvents() const
T_VALUES GetValue(FLAG_TYPE flag) const
void SetValue(FLAG_TYPE flag, T_VALUES value)
ObjectGuid GetOwnerGUID() const override
uint32 GetSpellId() const
void SetOwnerGUID(ObjectGuid owner)
void SetRespawnTime(int32 respawn)
uint32 GetMembersCount() const
ObjectGuid GetLooterGuid() const
GroupRefManager & GetMembers()
bool InitStatsForLevel(uint8 level)
uint32 GetEffectiveHeal() const
SpellInfo const * GetSpellInfo() const
uint32 GetHitMask() const
uint32 GetOriginalHeal() const
void SetEffectiveHeal(uint32 amount)
SpellSchoolMask GetSchoolMask() const
void AbsorbHeal(uint32 amount)
HealInfo(Unit *healer, Unit *target, uint32 heal, SpellInfo const *spellInfo, SpellSchoolMask schoolMask)
ItemTemplate const * GetTemplate() const
bool HaveLootFor(uint32 loot_id) const
void GameObjectRelocation(GameObject *go, float x, float y, float z, float orientation, bool respawnRelocationOnFail=true)
void CreatureRelocation(Creature *creature, float x, float y, float z, float ang, bool respawnRelocationOnFail=true)
ZLiquidStatus GetLiquidStatus(PhaseShift const &phaseShift, float x, float y, float z, Optional< map_liquidHeaderTypeFlags > ReqLiquidType={}, LiquidData *data=nullptr, float collisionHeight=2.03128f)
MapDifficultyEntry const * GetMapDifficulty() const
float GetWaterOrGroundLevel(PhaseShift const &phaseShift, float x, float y, float z, float *ground=nullptr, bool swim=false, float collisionHeight=2.03128f)
BattlegroundMap * ToBattlegroundMap()
Difficulty GetDifficultyID() const
MapEntry const * GetEntry() const
PlayerList const & GetPlayers() const
void PlayerRelocation(Player *, float x, float y, float z, float orientation)
Creature * GetCreature(ObjectGuid const &guid)
Transport * GetTransport(ObjectGuid const &guid)
void setDeathState(DeathState s) override
bool IsGuardianPet() const
bool HasMovementGenerator(std::function< bool(MovementGenerator const *)> const &filter, MovementSlot slot=MOTION_SLOT_ACTIVE) const
void LaunchMoveSpline(std::function< void(Movement::MoveSplineInit &init)> &&initializer, uint32 id=0, MovementGeneratorPriority priority=MOTION_PRIORITY_NORMAL, MovementGeneratorType type=EFFECT_MOTION_TYPE, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
MovementGeneratorType GetCurrentMovementGeneratorType() const
void PropagateSpeedChange()
void InterruptOnTeleport()
void MoveFleeing(Unit *enemy, Milliseconds time=0ms, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
void Remove(MovementGenerator *movement, MovementSlot slot=MOTION_SLOT_ACTIVE)
void MoveKnockbackFrom(Position const &origin, float speedXY, float speedZ, float angle=M_PI, Movement::SpellEffectExtraData const *spellEffectExtraData=nullptr)
void MoveFace(float orientation, uint32 id=EVENT_FACE)
void MoveTo(Vector3 const &destination, bool generatePath=true, bool forceDestination=false)
void DisableTransportPathTransformations()
void Stop(bool force=false)
void SetFacing(float angle)
LowType GetCounter() const
static ObjectGuid const Empty
bool IsMOTransport() const
std::string ToString() const
static CreatureModel const * ChooseDisplayId(CreatureTemplate const *cinfo, CreatureData const *data=nullptr)
void SetDynamicFlag(uint32 flag)
float GetObjectScale() const
bool HasDynamicFlag(uint32 flag) const
void BuildValuesUpdateBlockForPlayerWithFlag(UpdateData *data, UF::UpdateFieldFlag flags, Player const *target) const
virtual void ClearValuesChangesMask()
virtual void SetObjectScale(float scale)
Optional< uint32 > GetCurrentActivePetIndex() const
std::array< Optional< PetInfo >, MAX_ACTIVE_PETS > ActivePets
void SetCurrentActivePetIndex(uint32 index)
void FillPetInfo(PetStable::PetInfo *petInfo, Optional< ReactStates > forcedReactState={}) const
void SetGroupUpdateFlag(uint32 flag)
std::string GetDebugInfo() const override
bool CreateBaseAtCreatureInfo(CreatureTemplate const *cinfo, Unit *owner)
bool CreateBaseAtCreature(Creature *creature)
bool isControlled() const
void InitPetCreateSpells()
static void InheritPhaseShift(WorldObject *target, WorldObject const *source)
void StopCastingBindSight() const
void SetClientControl(Unit *target, bool allowMove)
bool IsInSameRaidWith(Player const *p) const
void SendAttackSwingCancelAttack() const
void AddPetToUpdateFields(PetStable::PetInfo const &pet, PetSaveMode slot, PetStableFlags flags)
void SetGroupUpdateFlag(uint32 flag)
void DuelComplete(DuelCompleteType type)
void SendDirectMessage(WorldPacket const *data) const
uint16 GetSkillValue(uint32 skill) const
UF::UpdateField< UF::ActivePlayerData, int32(WowCS::EntityFragment::CGObject), TYPEID_ACTIVE_PLAYER > m_activePlayerData
void SendAutoRepeatCancel(Unit *target)
PetStable & GetOrInitPetStable()
float GetRatingBonusValue(CombatRating cr) const
void CharmSpellInitialize()
void UpdatePvPState(bool onlyFFA=false)
bool InBattleground() const
void DurabilityPointLossForEquipSlot(EquipmentSlots slot)
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)
bool HaveAtClient(BaseEntity const *u) const
void SendRemoveControlBar() const
WorldSession * GetSession() const
OutdoorPvP * GetOutdoorPvP() const
void CastItemCombatSpell(DamageInfo const &damageInfo)
PlayerSpellMap const & GetSpellMap() const
void UpdateCriteria(CriteriaType type, uint64 miscValue1=0, uint64 miscValue2=0, uint64 miscValue3=0, WorldObject *ref=nullptr)
Battleground * GetBattleground() const
float GetExpertiseDodgeOrParryReduction(WeaponAttackType attType) const
bool IsGameMaster() const
std::array< uint8, MAX_MOVE_TYPE > m_forced_speed_changes
void PossessSpellInitialize()
Item * GetWeaponForAttack(WeaponAttackType attackType, bool useable=false) const
Group * GetGroup(Optional< uint8 > partyIndex)
std::unique_ptr< DuelInfo > duel
uint8 GetSubGroup() const
void VehicleSpellInitialize()
Team GetEffectiveTeam() const
void SetFactionForRace(uint8 race)
Stats GetPrimaryStat() const
void SetContestedPvP(Player *attackedPlayer=nullptr)
void ResummonPetTemporaryUnSummonedIfAny()
void UpdatePvP(bool state, bool override=false)
bool IsInSameGroupWith(Player const *p) const
SpellSchoolMask GetSchoolMask() const
Spell const * GetProcSpell() const
ProcEventInfo(Unit *actor, Unit *actionTarget, ProcFlagsInit const &typeMask, ProcFlagsSpellType spellTypeMask, ProcFlagsSpellPhase spellPhaseMask, ProcFlagsHit hitMask, Spell *spell, DamageInfo *damageInfo, HealInfo *healInfo)
SpellInfo const * GetSpellInfo() const
float CalcValueMultiplier(WorldObject *caster, Spell *spell=nullptr) const
float BonusCoefficientFromAP
EnumFlag< SpellEffectAttributes > EffectAttributes
SpellEffIndex EffectIndex
void SendCooldownEvent(SpellInfo const *spellInfo, uint32 itemId=0, Spell *spell=nullptr, bool startCooldown=true)
void ResetCooldowns(Predicate &&predicate, bool update=false)
void StartCooldown(SpellInfo const *spellInfo, uint32 itemId, Spell *spell=nullptr, bool onHold=false, Optional< Duration > forcedCooldown={})
DiminishingLevels GetDiminishingReturnsMaxLevel() const
Mechanics GetEffectMechanic(SpellEffIndex effIndex) const
SpellInfo const * GetFirstRankSpell() const
std::unordered_set< uint32 > Labels
uint64 GetAllEffectsMechanicMask() const
bool IsRequiringDeadTarget() const
EnumFlag< SpellAuraInterruptFlags2 > AuraInterruptFlags2
bool IsDeathPersistent() const
bool IsCooldownStartedOnEvent() const
bool HasAnyAuraInterruptFlag() const
bool IsStackableOnOneSlotWithDifferentCasters() const
uint32 GetDispelMask() const
SpellSpecificType GetSpellSpecific() const
DiminishingReturnsType GetDiminishingReturnsGroupType() const
bool IsMultiSlotAura() const
int32 GetMaxDuration() const
int32 GetDiminishingReturnsLimitDuration() const
DiminishingGroup GetDiminishingReturnsGroupForSpell() const
SpellCastResult CheckTarget(WorldObject const *caster, WorldObject const *target, bool implicit=true) const
bool IsItemFitToSpellRequirements(Item const *item) const
WeaponAttackType GetAttackType() const
SpellSchoolMask GetSchoolMask() const
AuraStateType GetAuraState() const
bool HasAttribute(SpellAttr0 attribute) const
uint64 GetSpellMechanicMaskByEffectMask(uint32 effectMask) const
bool HasChannelInterruptFlag(SpellAuraInterruptFlags flag) const
bool IsPassiveStackableWithRanks() const
uint32 MaxAffectedTargets
int32 GetDuration() const
std::vector< SpellEffectInfo > const & GetEffects() const
SpellCastResult CheckExplicitTarget(WorldObject const *caster, WorldObject const *target, Item const *itemTarget=nullptr) const
bool CanPierceImmuneAura(SpellInfo const *auraSpellInfo) const
std::bitset< MAX_SPELL_EFFECTS > NegativeEffects
bool HasEffect(SpellEffects effect) const
bool IsRangedWeaponSpell() const
EnumFlag< SpellAuraInterruptFlags > AuraInterruptFlags
bool HasAura(AuraType aura) const
bool HasAuraInterruptFlag(SpellAuraInterruptFlags flag) const
bool HasLabel(uint32 labelId) const
bool IsPositiveEffect(uint8 effIndex) const
bool IsSingleTarget() const
static CreatureImmunities const * GetCreatureImmunities(int32 creatureImmunitiesId)
SpellState getState() const
SpellInfo const * GetSpellInfo() const
void CallScriptCalcDamageHandlers(SpellEffectInfo const &spellEffectInfo, Unit *victim, int32 &damage, int32 &flatMod, float &pctMod)
bool IsInterruptable() const
static Spell const * ExtractSpellFromEvent(BasicEvent *event)
void cancel(SpellCastResult result=SPELL_FAILED_INTERRUPTED, Optional< SpellCastResult > resultOther={}, ObjectGuid const &failedBy=ObjectGuid::Empty)
bool IsProcDisabled() const
int32 GetCastTime() const
std::string GetDebugInfo() const
void SendChannelUpdate(uint32 time, Optional< SpellCastResult > result={}, ObjectGuid const &failedBy=ObjectGuid::Empty)
int32 GetProcChainLength() const
void CallScriptOnResistAbsorbCalculateHandlers(DamageInfo const &damageInfo, uint32 &resistAmount, int32 &absorbAmount)
CurrentSpellTypes GetCurrentContainer() const
SpellCastResult prepare(SpellCastTargets const &targets, AuraEffect const *triggeredByAura=nullptr)
void CallScriptCalcHealingHandlers(SpellEffectInfo const &spellEffectInfo, Unit *victim, int32 &healing, int32 &flatMod, float &pctMod)
void SetReferencedFromCurrent(bool yes)
static void SendCastResult(Player const *caster, SpellInfo const *spellInfo, SpellCastVisual spellVisual, ObjectGuid cast_count, SpellCastResult result, SpellCustomErrors customError=SPELL_CUSTOM_ERROR_NONE, int32 *param1=nullptr, int32 *param2=nullptr)
UsedSpellMods m_appliedMods
void CallScriptCalcCritChanceHandlers(Unit const *victim, float &chance)
void finish(SpellCastResult result=SPELL_CAST_OK)
virtual void UnSummon(uint32 msTime=0)
SummonPropertiesEntry const *const m_Properties
void ForwardThreatForAssistingMe(Unit *assistant, float baseAmount, SpellInfo const *spell=nullptr, bool ignoreModifiers=false)
== AFFECT OTHERS' THREAT LISTS ==
bool IsThreatListEmpty(bool includeOffline=false) const
void AddThreat(Unit *target, float amount, SpellInfo const *spell=nullptr, bool ignoreModifiers=false, bool ignoreRedirects=false)
== AFFECT MY THREAT LIST ==
uint32 GetSpell(uint8 slot=0) const
virtual ObjectGuid GetTransportGUID() const =0
Position GetPositionWithOffset(Position const &offset) const override
This method transforms supplied transport offsets into global coordinates.
Utility class to enable range for loop syntax for multimap.equal_range uses.
constexpr end_iterator end() const
constexpr iterator begin() const
MutableFieldReference< T, false > ModifyValue(UpdateField< T, BlockBit, Bit >(Derived::*field))
void ClearChangesMask(UpdateField< T, BlockBit, Bit >(Derived::*field))
virtual void OnCharmed(bool isNew)
float GetUnitMissChance() const
void EnterVehicle(Unit *base, int8 seatId=-1)
void SetCannotTurn(bool apply)
bool SetCanDoubleJump(bool enable)
static uint32 DealDamage(Unit *attacker, Unit *victim, uint32 damage, CleanDamage const *cleanDamage=nullptr, DamageEffectType damagetype=DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *spellProto=nullptr, bool durabilityLoss=true)
float GetPctModifierValue(UnitMods unitMod, UnitModifierPctType modifierType) const
Unit * GetCharmed() const
void ClearUnitState(uint32 f)
void OutDebugInfo() const
bool IsWithinMeleeRangeAt(Position const &pos, Unit const *obj) const
void RemoveAreaTrigger(uint32 spellId)
void SetFlightCapabilityID(int32 flightCapabilityId, bool clientUpdate)
void ApplySpellImmune(uint32 spellId, SpellImmunity op, uint32 type, bool apply)
void SetMinion(Minion *minion, bool apply)
std::pair< AuraApplicationMap::iterator, AuraApplicationMap::iterator > AuraApplicationMapBoundsNonConst
int32 ModifyPower(Powers power, int32 val, bool withPowerUpdate=true)
void CastStop(uint32 except_spellid=0)
bool IsWithinMeleeRange(Unit const *obj) const
void ApplyMovementForce(ObjectGuid id, Position origin, float magnitude, MovementForceType type, Position direction={}, ObjectGuid transportGuid=ObjectGuid::Empty)
void SetImmuneToAll(bool apply, bool keepCombat)
void SetImmuneToPC(bool apply, bool keepCombat)
bool m_duringRemoveFromWorld
float GetBoundingRadius() const
int32 SpellDamageBonusDone(Unit *victim, SpellInfo const *spellProto, int32 pdamage, DamageEffectType damagetype, SpellEffectInfo const &spellEffectInfo, uint32 stack=1, Spell *spell=nullptr, AuraEffect const *aurEff=nullptr) const
void RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Vehicle * GetVehicle() const
EnumFlag< SpellAuraInterruptFlags2 > m_interruptMask2
bool IsWithinBoundaryRadius(const Unit *obj) const
virtual bool IsMovementPreventedByCasting() const
void RemoveAurasByType(AuraType auraType, std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
int32 SpellAbsorbBonusTaken(Unit *caster, SpellInfo const *spellProto, int32 absorbamount) const
bool SetAlwaysAllowPitching(bool enable)
virtual void UpdateResistances(uint32 school)
bool SetStrafingDisabled(bool disable)
void RemoveGameObject(GameObject *gameObj, bool del)
bool isTargetableForAttack(bool checkFakeDeath=true) const
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
uint32 GetSchoolImmunityMask() const
std::unique_ptr< SpellHistory > _spellHistory
void UpdateAttackTimeField(WeaponAttackType att)
float GetHealthPct() const
float m_baseSpellCritChance
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true, bool skipChanneledAllowingActions=false) const
SpellImmuneContainer m_spellImmune[MAX_SPELL_IMMUNITY]
void CombatStop(bool includingCast=false, bool mutualPvP=true, bool(*unitFilter)(Unit const *otherUnit)=nullptr)
int32 MeleeDamageBonusTaken(Unit *attacker, int32 pdamage, WeaponAttackType attType, DamageEffectType damagetype, SpellInfo const *spellProto=nullptr, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL)
void SetCreateStat(Stats stat, float val)
void AIUpdateTick(uint32 diff)
virtual void RecalculateObjectScale()
void SetHealth(uint64 val)
void HandleAttackPowerModifier(AttackPowerModIndex index, AttackPowerModType modifierType, float amount, bool apply)
void RemoveUnitMovementFlag(MovementFlags f)
virtual MovementGeneratorType GetDefaultMovementType() const
bool HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName, flag128 familyFlags) const
void SetFacingToPoint(Position const &point, bool force=true)
bool SetCanAdvFly(bool enable)
LiquidTypeEntry const * _lastLiquid
float GetTotalAuraModifierByMiscMask(AuraType auraType, uint32 misc_mask) const
static uint32 SpellCriticalHealingBonus(Unit const *caster, SpellInfo const *spellProto, uint32 damage, Unit *victim)
void _UpdateAutoRepeatSpell()
void SetVirtualItem(uint32 slot, uint32 itemId, uint16 appearanceModId=0, uint16 itemVisual=0)
void SendMoveKnockBack(Player *player, float speedXY, float speedZ, float vcos, float vsin)
float GetTotalAuraModValue(UnitMods unitMod) const
float GetMaxPositiveAuraModifier(AuraType auraType) const
AreaTriggerList m_areaTrigger
void AddUnitMovementFlag(MovementFlags f)
uint64 CountPctFromMaxHealth(float pct) const
bool IsInteractionAllowedInCombat() const
void Heartbeat() override
int32 SpellHealingBonusTaken(Unit *caster, SpellInfo const *spellProto, int32 healamount, DamageEffectType damagetype) const
void RemoveAllControlled()
ObjectGuid GetDemonCreatorGUID() const
bool CanHaveThreatList() const
====================== THREAT & COMBAT ====================
void RemoveGameObjectImpl(GameObject *gameObj, bool del)
void RemoveAurasByShapeShift()
float GetTotalStatValue(Stats stat) const
void SetPlayHoverAnim(bool enable, bool sendUpdate=true)
std::unique_ptr< MotionMaster > i_motionMaster
void SetUnitFlag3(UnitFlags3 flags)
void SetGender(Gender gender)
float GetUnitCriticalChanceTaken(Unit const *attacker, WeaponAttackType attackType, float critDone) const
bool IsContestedGuard() const
std::unordered_map< ObjectGuid, uint32 > extraAttacksTargets
void UpdateUnitMod(UnitMods unitMod)
void UpdateDamagePctDoneMods(WeaponAttackType attackType)
float GetSpeed(UnitMoveType mtype) const
bool SetFall(bool enable)
void _UnregisterDynObject(DynamicObject *dynObj)
float GetTotalAuraModifierByAffectMask(AuraType auraType, SpellInfo const *affectedSpell) const
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
void UpdateObjectVisibility(bool forced=true) override
int64 ModifyHealth(int64 val)
std::array< uint32, MAX_REACTIVE > m_reactiveTimer
std::shared_ptr< UnitAI > i_AI
uint32 GetCastSpellXSpellVisualId(SpellInfo const *spellInfo) const override
void SetCurrentCastSpell(Spell *pSpell)
void TriggerOnHealthChangeAuras(uint64 oldVal, uint64 newVal)
void SetMinionGUID(ObjectGuid guid)
float SpellDamagePctDone(Unit *victim, SpellInfo const *spellProto, DamageEffectType damagetype, SpellEffectInfo const &spellEffectInfo) const
void RestoreDisplayId(bool ignorePositiveAurasPreventingMounting=false)
Diminishing m_Diminishing
void SetHoverHeight(float hoverHeight)
void SetGravityModifier(float gravityModifier)
void SetStandState(UnitStandStateType state, uint32 animKitID=0)
void FinishSpell(CurrentSpellTypes spellType, SpellCastResult result=SPELL_CAST_OK)
void EnergizeBySpell(Unit *victim, SpellInfo const *spellInfo, int32 damage, Powers powerType)
void SetInitialPowerValue(Powers powerType)
void SendPlaySpellVisual(Unit *target, uint32 spellVisualId, uint8 missReason, uint8 reflectStatus, float travelSpeed, bool speedAsTime=false, float launchDelay=0.0f)
void UpdateHeight(float newZ)
Only server-side height update, does not broadcast to client.
std::array< Spell *, CURRENT_MAX_SPELL > m_currentSpells
void _RemoveNoStackAurasDueToAura(Aura *aura, bool owned)
virtual void OnPhaseChange()
void SetConfused(bool apply)
void _UpdateSpells(uint32 time)
ThreatManager & GetThreatManager()
void ReplaceAllPvpFlags(UnitPVPStateFlags flags)
void AddToWorld() override
virtual float GetArmorMultiplierForTarget(WorldObject const *) const
float GetPPMProcChance(uint32 WeaponSpeed, float PPM, SpellInfo const *spellProto) const
virtual void AtExitCombat()
void _UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMode)
bool HasAuraTypeWithMiscvalue(AuraType auraType, int32 miscValue) const
virtual ClassPowerTypes GetPowerTypes() const =0
void SetInCombatWith(Unit *enemy, bool addSecondUnitSuppressed=false)
float GetMaxPositiveAuraModifierByAffectMask(AuraType auraType, SpellInfo const *affectedSpell) const
virtual void Say(std::string_view text, Language language, WorldObject const *target=nullptr)
void PropagateSpeedChange()
-------—End of Pet responses methods-------—
void DelayOwnedAuras(uint32 spellId, ObjectGuid caster, int32 delaytime)
void SetControlled(bool apply, UnitState state)
float GetMaxNegativeAuraModifierByAffectMask(AuraType auraType, SpellInfo const *affectedSpell) const
SpellSchools GetSpellSchoolByAuraGroup(UnitMods unitMod) const
void SetStunned(bool apply)
void ApplySpellHastePercentMod(float val, bool apply)
std::array< ObjectGuid, MAX_SUMMON_SLOT > m_SummonSlot
Stats GetStatByAuraGroup(UnitMods unitMod) const
void HandleSpellClick(Unit *clicker, int8 seatId=-1)
bool CanUseAttackType(uint8 attacktype) const
bool IsWithinCombatRange(Unit const *obj, float dist2compare) const
Player * GetDemonCreatorPlayer() const
void SendPetAIReaction(ObjectGuid guid) const
void _RegisterAreaTrigger(AreaTrigger *areaTrigger)
bool HasAuraTypeWithCaster(AuraType auraType, ObjectGuid caster) const
Spell * FindCurrentSpellBySpellId(uint32 spell_id) const
uint32 GetMountDisplayId() const
void UpdateAllDamageDoneMods()
void RemoveVisibleAura(AuraApplication *aurApp)
int64 GetHealthGain(int64 dVal)
Creature * GetVehicleCreatureBase() const
std::unique_ptr< CharmInfo > m_charmInfo
void UpdateDisplayPower()
float GetCollisionHeight() const override
void RemoveAllGameObjects()
static void DealHeal(HealInfo &healInfo)
bool isPossessedByPlayer() const
std::multimap< uint32, AuraApplication * > AuraApplicationMap
void _RegisterDynObject(DynamicObject *dynObj)
void UpdateSpeed(UnitMoveType mtype)
void CancelAutoRepeatSpell()
static void DealDamageMods(Unit const *attacker, Unit const *victim, uint32 &damage, uint32 *absorb)
bool IsPolymorphed() const
void CancelTravelShapeshiftForm(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT, bool force=false)
bool IsAreaSpiritHealer() const
void PlayOneShotAnimKitId(uint16 animKitId)
float m_weaponDamage[MAX_ATTACK][2]
ShapeshiftForm GetShapeshiftForm() const
void SetFaction(uint32 faction) override
virtual void SetPvP(bool state)
ObjectGuid GetOwnerGUID() const override
uint64 GetMechanicImmunityMask() const
void CancelShapeshiftForm(bool onlyTravelShapeshiftForm=false, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT, bool force=false)
Unit * SelectNearbyTarget(Unit *exclude=nullptr, float dist=NOMINAL_MELEE_RANGE) const
SpellEffectValue GetHighestExclusiveSameEffectSpellGroupValue(AuraEffect const *aurEff, AuraType auraType, bool checkMiscValue=false, int32 miscValue=0) const
bool isInBackInMap(Unit const *target, float distance, float arc=float(M_PI)) const
float GetCombatRatingReduction(CombatRating cr) const
void RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId, ObjectGuid casterGUID, WorldObject *dispeller, uint8 chargesRemoved=1)
bool SetEnableFullSpeedTurning(bool enable)
virtual void UpdateAttackPowerAndDamage(bool ranged=false)=0
static void CalcHealAbsorb(HealInfo &healInfo)
virtual void Yell(std::string_view text, Language language, WorldObject const *target=nullptr)
void CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType=BASE_ATTACK, bool crit=false, bool blocked=false, Spell *spell=nullptr)
void StopMoving(bool force=false)
virtual SpellSchoolMask GetMeleeDamageSchoolMask(WeaponAttackType attackType=BASE_ATTACK) const =0
Unit * GetVehicleRoot() const
void SetCantProc(bool apply)
Unit * GetCharmer() const
void SetSpeed(UnitMoveType mtype, float newValue)
Aura * GetOwnedAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, Aura *except=nullptr) const
void ExitAllAreaTriggers()
void SetStatPctModifier(UnitMods unitMod, UnitModifierPctType modifierType, float val)
Unit * getAttackerForHelper() const
std::forward_list< AuraEffect * > AuraEffectList
float GetUnitParryChance(WeaponAttackType attType, Unit const *victim) const
void SetPower(Powers power, int32 val, bool withPowerUpdate=true)
void TriggerOnPowerChangeAuras(Powers power, int32 oldVal, int32 newVal)
void SendMeleeAttackStart(Unit *victim)
Pet * CreateTamedPetFrom(Creature *creatureTarget, uint32 spell_id=0)
void UpdateAdvFlyingSpeed(AdvFlyingRateTypeSingle speedType, bool clientUpdate)
Trinity::unique_trackable_ptr< Vehicle > m_vehicleKit
bool IsInDisallowedMountForm() const
void ApplyStatPctModifier(UnitMods unitMod, UnitModifierPctType modifierType, float amount)
std::vector< AreaTrigger * > AreaTriggerList
VisibleAuraContainer m_visibleAuras
UnitPVPStateFlags GetPvpFlags() const
float m_attackPowerMods[uint32(AttackPowerModIndex::End)][uint32(AttackPowerModType::End)]
virtual void UpdateDamageDoneMods(WeaponAttackType attackType, int32 skipEnchantSlot=-1)
void _removeAttacker(Unit *pAttacker)
void SendAttackStateUpdate(CalcDamageInfo *damageInfo)
AuraApplication * GetAuraApplicationOfRankedSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraApplication *except=nullptr) const
std::forward_list< AuraApplication * > AuraApplicationList
uint32 GetTransformSpell() const
void EnterAreaTrigger(AreaTrigger *areaTrigger)
void RemoveAllAurasExceptType(AuraType type)
void DealSpellDamage(SpellNonMeleeDamage const *damageInfo, bool durabilityLoss)
uint64 GetRaceMask() const
uint32 CalculateDamage(WeaponAttackType attType, bool normalized, bool addTotalPct) const
uint32 _lastExtraAttackSpell
float GetMaxNegativeAuraModifierByMiscValue(AuraType auraType, int32 misc_value) const
void SetAnimTier(AnimTier animTier, bool notifyClient=true)
static void CalcAbsorbResist(DamageInfo &damageInfo, Spell *spell=nullptr)
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
virtual bool CanFly() const =0
void SetAuraStack(uint32 spellId, Unit *target, uint32 stack)
Unit * GetVehicleBase() const
bool haveOffhandWeapon() const
MotionMaster * GetMotionMaster()
bool SetFeatherFall(bool enable)
Powers GetPowerType() const
bool HasUnitFlag(UnitFlags flags) const
static uint32 CalcArmorReducedDamage(Unit const *attacker, Unit *victim, uint32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType=MAX_ATTACK, uint8 attackerLevel=0)
void _addAttacker(Unit *pAttacker)
bool SetEnableFullSpeedPitching(bool enable)
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true, SpellCastResult result=SPELL_FAILED_INTERRUPTED, Optional< SpellCastResult > resultOther={}, ObjectGuid const &interrupter=ObjectGuid::Empty)
void ProcSkillsAndReactives(bool isVictim, Unit *procTarget, ProcFlagsInit const &typeMask, ProcFlagsHit hitMask, WeaponAttackType attType)
std::array< ObjectGuid, MAX_GAMEOBJECT_SLOT > m_ObjectSlot
void SetCharm(Unit *target, bool apply)
void SetMovedUnit(Unit *target)
ObjectGuid GetCharmedGUID() const
void SetCreatedBySpell(int32 spellId)
bool SetHover(bool enable, bool updateAnimTier=true)
bool CanDualWield() const
void UpdateInterruptMask()
void StartReactiveTimer(ReactiveType reactive)
void IncrDiminishing(SpellInfo const *auraSpellInfo)
void CleanupsBeforeDelete(bool finalCleanup=true) override
void AddChannelObject(ObjectGuid guid)
void ResumeMovement(uint32 timer=0, uint8 slot=0)
float GetMaxNegativeAuraModifierByMiscMask(AuraType auraType, uint32 misc_mask) const
Aura * AddAura(uint32 spellId, Unit *target)
bool HasInterruptFlag(SpellAuraInterruptFlags flags) const
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
bool isAttackingPlayer() const
void AtEndOfEncounter(EncounterType type)
virtual void AtEnterCombat()
uint32 GetBaseAttackTime(WeaponAttackType att) const
std::unique_ptr< MovementForces > _movementForces
MovementFlags GetUnitMovementFlags() const
void UpdateSplineMovement(uint32 t_diff)
uint32 GetDamageReduction(uint32 damage) const
std::array< float, MAX_STATS > m_floatStatPosBuff
void SetUnitFlag2(UnitFlags2 flags)
bool HasUnitFlag2(UnitFlags2 flags) const
std::string GetDebugInfo() const override
std::pair< AuraMap::const_iterator, AuraMap::const_iterator > AuraMapBounds
virtual bool IsLoading() const
uint32 BuildAuraStateUpdateForTarget(Unit const *target) const
bool isInFrontInMap(Unit const *target, float distance, float arc=float(M_PI)) const
float m_auraFlatModifiersGroup[UNIT_MOD_END][MODIFIER_TYPE_FLAT_END]
void SetImmuneToNPC(bool apply, bool keepCombat)
void PauseMovement(uint32 timer=0, uint8 slot=0, bool forced=true)
void SetPetNameTimestamp(uint32 timestamp)
bool IsSplineEnabled() const
std::array< uint32, MAX_ATTACK > m_baseAttackSpeed
void RemoveAllAurasRequiringDeadTarget()
void UpdateAuraForGroup()
void ApplyHasteRegenPercentMod(float val, bool apply)
Vignettes::VignetteData const * GetVignette() const
void UpdateReactives(uint32 p_time)
virtual bool CanApplyResilience() const
AuraEffect * IsScriptOverriden(SpellInfo const *spell, int32 script) const
float m_modRangedHitChance
float GetCombatReach() const override
void AtTargetAttacked(Unit *target, bool canInitialAggro)
static uint32 CalcSpellResistedDamage(Unit const *attacker, Unit *victim, uint32 damage, SpellSchoolMask schoolMask, SpellInfo const *spellInfo)
void ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply)
void SetBonusResistanceMod(SpellSchools school, int32 val)
int32 GetMaxPower(Powers power) const
std::pair< AuraApplicationMap::const_iterator, AuraApplicationMap::const_iterator > AuraApplicationMapBounds
int32 HealBySpell(HealInfo &healInfo, bool critical=false)
void AddPlayerToVision(Player *player)
void RemoveNpcFlag(NPCFlags flags)
void SendHealSpellLog(HealInfo &healInfo, bool critical=false)
GameObject * GetGameObject(uint32 spellId) const
int32 GetFlightCapabilityID() const
void _ExitVehicle(Position const *exitPosition=nullptr)
uint32 m_removedAurasCount
void RemoveAllAurasOnDeath()
uint32 m_movementCounter
Incrementing counter used in movement packets.
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage const *log)
bool IsStandState() const
TempSummon * ToTempSummon()
bool IsGravityDisabled() const
CharmInfo * GetCharmInfo()
void AtStartOfEncounter(EncounterType type)
bool SetCanTransitionBetweenSwimAndFly(bool enable)
bool SetDisableInertia(bool disable)
bool IsInCombatWith(Unit const *who) const
ObjectGuid GetCharmerOrOwnerGUID() const override
void RemoveUnitFlag3(UnitFlags3 flags)
AuraMap::iterator m_auraUpdateIterator
Unit * GetMeleeHitRedirectTarget(Unit *victim, SpellInfo const *spellInfo=nullptr)
ObjectGuid _lastDamagedTargetGuid
float SpellCritChanceDone(Spell *spell, AuraEffect const *aurEff, SpellSchoolMask schoolMask, WeaponAttackType attackType=BASE_ATTACK) const
void CancelSpellMissiles(uint32 spellId, bool reverseMissile=false, bool abortSpell=false)
void FollowerRemoved(AbstractFollower *f)
void RemoveAllFollowers()
virtual void SetInteractionAllowedWhileHostile(bool interactionAllowed)
void UpdateMountCapability()
void FollowerAdded(AbstractFollower *f)
void _DeleteRemovedAuras()
Player * GetPlayerMovingMe() const
void CancelMountAura(bool force=false)
void _ApplyAura(AuraApplication *aurApp, uint32 effMask)
void SetUninteractible(bool apply)
Unit * GetNextRandomRaidMemberOrPet(float radius)
void SetBaseAttackTime(WeaponAttackType att, uint32 val)
virtual bool HasSpell(uint32) const
virtual bool IsAffectedByDiminishingReturns() const
std::pair< AuraStateAurasMap::const_iterator, AuraStateAurasMap::const_iterator > AuraStateAurasMapBounds
void AddUnitState(uint32 f)
float GetMaxPositiveAuraModifierByMiscMask(AuraType auraType, uint32 misc_mask, AuraEffect const *except=nullptr) const
static void ApplyResilience(Unit const *victim, int32 *damage)
float GetTotalAuraMultiplier(AuraType auraType) const
void Mount(uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
AreaTriggerList m_insideAreaTriggers
void SetSheath(SheathState sheathed)
bool IsOnVehicle(Unit const *vehicle) const
void SendSpellDamageResist(Unit *target, uint32 spellId)
bool isInAccessiblePlaceFor(Creature const *c) const
bool IsCharmedOwnedByPlayerOrPlayer() const
int32 GetMinPower(Powers power) const
virtual void SetInteractionAllowedInCombat(bool interactionAllowed)
Unit * EnsureVictim() const
uint32 getAttackTimer(WeaponAttackType type) const
bool IsDuringRemoveFromWorld() const
bool m_ControlledByPlayer
void SetFeared(bool apply)
Unit * GetCharmerOrOwner() const
uint32 GetDiseasesByCaster(ObjectGuid casterGUID, bool remove=false)
void RemoveAurasDueToItemSpell(uint32 spellId, ObjectGuid castItemGuid)
virtual void UpdateDamagePhysical(WeaponAttackType attType)
void SetFacingToObject(WorldObject const *object, bool force=true, uint32 movementId=EVENT_FACE)
void ExitAreaTrigger(AreaTrigger *areaTrigger)
bool IsPlayingHoverAnim() const
void _ApplyAllAuraStatMods()
bool SetMoveCantSwim(bool cantSwim)
void SetBattlePetCompanionNameTimestamp(uint32 timestamp)
uint32 GetCreatureType() const
int32 RewardRage(uint32 baseRage)
void AddGameObject(GameObject *gameObj)
void InterruptMovementBasedAuras()
virtual bool IsImmunedToSpellEffect(SpellInfo const *spellInfo, SpellEffectInfo const &spellEffectInfo, WorldObject const *caster, bool requireImmunityPurgesEffectAttribute=false) const
bool HasNegativeAuraWithInterruptFlag(InterruptFlags flag, ObjectGuid guid=ObjectGuid::Empty) const
bool IsThreatened() const
bool SetJumpingDisabled(bool disable)
void SendSetVehicleRecId(uint32 vehicleId)
bool SetSwim(bool enable)
void SetEmoteState(Emote emote)
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport=false)
PositionUpdateInfo _positionUpdateInfo
void SetPvpFlag(UnitPVPStateFlags flags)
virtual void UpdateNearbyPlayersInteractions()
AuraApplicationList m_interruptableAuras
void SetResistance(SpellSchools school, int32 val)
float GetTotalAuraMultiplierByMiscValue(AuraType auraType, int32 misc_value) const
uint32 GetDisplayId() const
void SendCancelSpellVisualKit(uint32 id)
uint32 GetVirtualItemId(uint32 slot) const
static float CalculateAverageResistReduction(WorldObject const *caster, SpellSchoolMask schoolMask, Unit const *victim, SpellInfo const *spellInfo=nullptr)
bool IsHighestExclusiveAuraEffect(SpellInfo const *spellInfo, AuraType auraType, SpellEffectValue effectAmount, uint32 auraEffectMask, bool removeOtherAuraApplications=false)
void SendSpellDamageImmune(Unit *target, uint32 spellId, bool isPeriodic)
void ModifyAuraState(AuraStateType flag, bool apply)
Unit * GetUnitBeingMoved() const
EnumFlag< SpellOtherImmunity > GetSpellOtherImmunityMask() const
uint32 GetAuraCount(uint32 spellId) const
UnitAI * GetTopAI() const
void HandleProcExtraAttackFor(Unit *victim, uint32 count)
bool isPossessing() const
uint32 GetNativeDisplayId() const
float SpellCritChanceTaken(Unit const *caster, Spell *spell, AuraEffect const *aurEff, SpellSchoolMask schoolMask, float doneChance, WeaponAttackType attackType=BASE_ATTACK) const
void RemoveAllGroupBuffsFromCaster(ObjectGuid casterGUID)
virtual void UpdateArmor()=0
void SetChannelObject(uint32 slot, ObjectGuid guid)
uint64 GetMaxHealth() const
void ApplyControlStatesIfNeeded()
void SetRooted(bool apply)
ThreatManager m_threatManager
uint32 _oldFactionId
faction before charm
bool Attack(Unit *victim, bool meleeAttack)
int32 CalculateAOEAvoidance(int32 damage, uint32 schoolMask, bool npcCaster) const
float GetWeaponDamageRange(WeaponAttackType attType, WeaponDamageRange type) const
std::forward_list< Aura * > AuraList
float GetTotalAuraMultiplierByAffectMask(AuraType auraType, SpellInfo const *affectedSpell) const
bool HasAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid caster=ObjectGuid::Empty) const
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
ObjectGuid GetMinionGUID() const
bool SetCanFly(bool enable)
virtual float GetDamageMultiplierForTarget(WorldObject const *) const
bool SetCollision(bool disable)
uint16 GetMaxSkillValueForLevel(Unit const *target=nullptr) const
virtual void UpdateMaxPower(Powers power)=0
void _AddAura(UnitAura *aura, Unit *caster)
TransportBase * GetDirectTransport() const
Returns the transport this unit is on directly (if on vehicle and transport, return vehicle)
uint32 GetFaction() const override
virtual void TextEmote(std::string_view text, WorldObject const *target=nullptr, bool isBossEmote=false)
void RemoveDynObject(uint32 spellId)
void SendCancelSpellVisual(uint32 id)
void SendEnergizeSpellLog(Unit *victim, uint32 spellId, int32 damage, int32 overEnergize, Powers powerType)
bool HasAuraState(AuraStateType flag, SpellInfo const *spellProto=nullptr, Unit const *Caster=nullptr) const
void GetDispellableAuraList(WorldObject const *caster, uint32 dispelMask, DispelChargesList &dispelList, bool isReflect=false) const
AttackerSet const & getAttackers() const
void RemoveUnitFlag2(UnitFlags2 flags)
void RemovePvpFlag(UnitPVPStateFlags flags)
void SetAI(UnitAI *newAI)
AuraEffect * GetAuraEffectOfRankedSpell(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
void SendTeleportPacket(TeleportLocation const &teleportLocation)
float GetMechanicResistChance(SpellInfo const *spellInfo) const
bool SetCanTurnWhileFalling(bool enable)
std::multimap< uint32, Aura * > AuraMap
float GetTotalAuraModifier(AuraType auraType) const
bool HasAuraType(AuraType auraType) const
void RemoveInertia(int32 id)
std::unique_ptr< Vignettes::VignetteData > m_vignette
void RemoveOwnedAuras(std::function< bool(Aura const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
bool SetWalk(bool enable)
float GetUnitBlockChance(WeaponAttackType attType, Unit const *victim) const
bool HasStrongerAuraWithDR(SpellInfo const *auraSpellInfo, Unit *caster) const
void SendPetActionSound(PetAction action) const
void EngageWithTarget(Unit *who)
void UpdateCreatureType()
void AddInterruptMask(SpellAuraInterruptFlags flags, SpellAuraInterruptFlags2 flags2)
void CalculateMeleeDamage(Unit *victim, CalcDamageInfo *damageInfo, WeaponAttackType attackType=BASE_ATTACK)
SpellMissInfo MeleeSpellHitResult(Unit *victim, SpellInfo const *spellInfo) const override
void setAttackTimer(WeaponAttackType type, uint32 time)
virtual bool UpdateStats(Stats stat)=0
bool IsImmunedToSpell(SpellInfo const *spellInfo, uint32 effectMask, WorldObject const *caster, bool requireImmunityPurgesEffectAttribute=false) const
void RemoveAllDynObjects()
void ClearValuesChangesMask() override
bool HasNpcFlag(NPCFlags flags) const
void GetAllMinionsByEntry(std::list< TempSummon * > &Minions, uint32 entry)
float m_modMeleeHitChance
virtual bool CheckAttackFitToAuraRequirement(WeaponAttackType, AuraEffect const *) const
void _RemoveAllAuraStatMods()
ObjectGuid GetCritterGUID() const
void RemoveAuraFromStack(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT, uint16 num=1)
uint8 GetLevelForTarget(WorldObject const *) const override
void SetFullPower(Powers power)
void RemoveAurasWithInterruptFlags(InterruptFlags flag, SpellInfo const *source=nullptr)
void SetMovementAnimKitId(uint16 animKitId)
void StopAttackFaction(uint32 faction_id)
bool HasScheduledAIChange() const
void RemoveAreaAurasDueToLeaveWorld()
float GetAPMultiplier(WeaponAttackType attType, bool normalized) const
bool CanModifyStats() const
float GetUnitCriticalChanceDone(WeaponAttackType attackType) const
void RemoveCharmedBy(Unit *charmer)
void RemoveMovementForce(ObjectGuid id)
Trinity::Containers::FlatSet< AuraApplication *, VisibleAuraSlotCompare > m_visibleAurasToUpdate
virtual void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float &minDamage, float &maxDamage) const =0
bool IsDisallowedMountForm(uint32 spellId, ShapeshiftForm form, uint32 displayId) const
void SetMaxHealth(uint64 val)
float GetMaxNegativeAuraModifier(AuraType auraType) const
float GetSpeedRate(UnitMoveType mtype) const
std::set< Unit * > AttackerSet
virtual void SetTarget(ObjectGuid const &)=0
void RemoveAppliedAuras(std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
float GetTotalAuraModifierByMiscValue(AuraType auraType, int32 misc_value) const
virtual uint32 GetPowerIndex(Powers power) const =0
void CleanupBeforeRemoveFromMap(bool finalCleanup)
void UpdateStatBuffModForClient(Stats stat)
void UpdatePetCombatState()
std::vector< Unit * > UnitVector
UF::UpdateField< UF::UnitData, int32(WowCS::EntityFragment::CGObject), TYPEID_UNIT > m_unitData
int32 GetPower(Powers power) const
void RemoveWorldEffect(int32 worldEffectId)
int32 SpellBaseHealingBonusDone(SpellSchoolMask schoolMask) const
float GetTotalAttackPowerValue(WeaponAttackType attType, bool includeWeapon=true) const
void UpdateOrientation(float orientation)
Only server-side orientation update, does not broadcast to client.
bool IsUnderWater() const
void SetBattlePetCompanionGUID(ObjectGuid guid)
void SetSpeedRate(UnitMoveType mtype, float rate)
void AddExtraAttacks(uint32 count)
void RemovePlayerFromVision(Player *player)
void SendFlightSplineSyncUpdate()
bool IsImmunedToDamage(SpellSchoolMask meleeSchoolMask) const
float GetCreateStat(Stats stat) const
bool IsImmunedToAuraPeriodicTick(WorldObject const *caster, AuraEffect const *auraEffect) const
bool IsHighestExclusiveAura(Aura const *aura, bool removeOtherAuraApplications=false)
void GetProcAurasTriggeredOnEvent(AuraApplicationProcContainer &aurasTriggeringProc, AuraApplicationList *procAuras, ProcEventInfo &eventInfo)
void UpdateSplinePosition()
void SetOwnerGUID(ObjectGuid owner)
DeathState getDeathState() const
bool SetIgnoreMovementForces(bool ignore)
Unit * GetFirstControlled() const
float GetTotalAuraMultiplierByMiscMask(AuraType auraType, uint32 misc_mask) const
ObjectGuid GetTransGUID() const override
void ApplyCastTimePercentMod(float val, bool apply)
std::vector< DynamicObject * > GetDynObjects(uint32 spellId) const
bool HealthAbovePct(float pct) const
virtual float GetHealthMultiplierForTarget(WorldObject const *) const
void DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
bool HealthBelowPct(float pct) const
float GetAttackPowerModifierValue(AttackPowerModIndex index, AttackPowerModType modifierType) const
uint16 _movementAnimKitId
void NearTeleportTo(TeleportLocation const &target, bool casting=false)
bool CreateVehicleKit(uint32 id, uint32 creatureEntry, bool loading=false)
bool HasUnitState(const uint32 f) const
std::unordered_set< AbstractFollower * > m_followingMe
virtual void Update(uint32 time) override
bool IsInRaidWith(Unit const *unit) const
AuraApplication * _CreateAuraApplication(Aura *aura, uint32 effMask)
void _UnregisterAreaTrigger(AreaTrigger *areaTrigger)
int32 SpellDamageBonusTaken(Unit *caster, SpellInfo const *spellProto, int32 pdamage, DamageEffectType damagetype) const
void ProcessPositionDataChanged(PositionFullTerrainStatus const &data) override
bool IsInFeralForm() const
DynamicObject * GetDynObject(uint32 spellId) const
void SetLevel(uint8 lvl, bool sendUpdate=true)
std::unique_ptr< Movement::MoveSpline > movespline
static uint32 SpellCriticalDamageBonus(Unit const *caster, SpellInfo const *spellProto, uint32 damage, Unit *victim)
void CalculateHoverHeight()
std::pair< AuraMap::iterator, AuraMap::iterator > AuraMapBoundsNonConst
static std::vector< AuraEffect * > CopyAuraEffectList(AuraEffectList const &list)
void RemoveBindSightAuras()
std::array< float, ADV_FLYING_MAX_SPEED_TYPE > m_advFlyingSpeed
void KnockbackFrom(Position const &origin, float speedXY, float speedZ, float angle=M_PI, Movement::SpellEffectExtraData const *spellEffectExtraData=nullptr)
void SendPlaySpellVisualKit(uint32 id, uint32 type, uint32 duration) const
AuraApplicationMap m_appliedAuras
CharmInfo * InitCharmInfo()
void RemoveAllAttackers()
int32 SpellBaseAbsorbBonusDone(SpellSchoolMask schoolMask) const
void SetClass(uint8 classId)
void SetFacingTo(float ori, bool force=true, uint32 movementId=EVENT_FACE)
virtual bool CanSwim() const
virtual float GetNativeObjectScale() const
uint32 GetDoTsByCaster(ObjectGuid casterGUID) const
void RemoveFromWorld() override
void AttackerStateUpdate(Unit *victim, WeaponAttackType attType=BASE_ATTACK, bool extra=false)
bool IsOnOceanFloor() const
bool HasUnitMovementFlag(MovementFlags f) const
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
Powers CalculateDisplayPowerType() const
virtual void UpdateMaxHealth()=0
uint32 HasUnitTypeMask(uint32 mask) const
std::array< float, MAX_MOVE_TYPE > m_speed_rate
float GetFlatModifierValue(UnitMods unitMod, UnitModifierFlatType modifierType) const
void _RegisterAuraEffect(AuraEffect *aurEff, bool apply)
void SendPeriodicAuraLog(SpellPeriodicAuraLogInfo *pInfo)
void _EnterVehicle(Vehicle *vehicle, int8 seatId, AuraApplication const *aurApp=nullptr)
float GetMeleeRange(Unit const *target) const
void DoMeleeAttackIfReady()
float GetStat(Stats stat) const
void RemoveAurasWithMechanic(uint64 mechanicMaskToRemove, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT, uint32 exceptSpellId=0, bool withEffectMechanics=false)
void SendDurabilityLoss(Player *receiver, uint32 percent)
int32 SpellAbsorbBonusDone(Unit *victim, SpellInfo const *spellProto, int32 absorbamount, SpellEffectInfo const &spellEffectInfo, uint32 stack=1, AuraEffect const *aurEff=nullptr) const
int32 MeleeDamageBonusDone(Unit *pVictim, int32 damage, WeaponAttackType attType, DamageEffectType damagetype, SpellInfo const *spellProto=nullptr, SpellEffectInfo const *spellEffectInfo=nullptr, Mechanics mechanic=MECHANIC_NONE, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL, Spell *spell=nullptr, AuraEffect const *aurEff=nullptr)
virtual float GetBlockPercent(uint8) const
SpellHistory * GetSpellHistory()
std::array< float, MAX_ATTACK > m_modAttackSpeedPct
bool IsBlockCritical() const
void HandleEmoteCommand(Emote emoteId, Player *target=nullptr, Trinity::IteratorPair< int32 const * > spellVisualKitIds={}, int32 sequenceVariation=0)
bool IsControlledByPlayer() const
void SetVisibleAura(AuraApplication *aurApp)
DiminishingLevels GetDiminishing(DiminishingGroup group) const
bool HasBreakableByDamageCrowdControlAura(Unit const *excludeCasterChannel=nullptr) const
ObjectGuid GetCharmerGUID() const
void UpdateLiquidStatusOnPositionChange(Optional< LiquidData > const &newLiquidData)
bool HasAuraWithMechanic(uint64 mechanicMask) const
Minion * GetFirstMinion() const
UnitStandStateType GetStandState() const
float SpellHealingPctDone(Unit *victim, SpellInfo const *spellProto) const
UnitAI * GetScheduledChangeAI()
bool HasAuraTypeWithValue(AuraType auraType, int32 value) const
void DestroyForPlayer(Player const *target) const override
bool HasBreakableByDamageAuraType(AuraType type, uint32 excludeAura=0) const
bool SetCharmedBy(Unit *charmer, CharmType type, AuraApplication const *aurApp=nullptr)
bool IsAlwaysVisibleFor(WorldObject const *seer) const override
void SetPetGUID(ObjectGuid guid)
bool SetWaterWalking(bool enable)
void TriggerAurasProcOnEvent(AuraApplicationList *myProcAuras, AuraApplicationList *targetProcAuras, Unit *actionTarget, ProcFlagsInit const &typeMaskActor, ProcFlagsInit const &typeMaskActionTarget, ProcFlagsSpellType spellTypeMask, ProcFlagsSpellPhase spellPhaseMask, ProcFlagsHit hitMask, Spell *spell, DamageInfo *damageInfo, HealInfo *healInfo)
void SetMaxPower(Powers power, int32 val)
void ApplyInertia(int32 id, Milliseconds duration)
void RemoveAllAreaTriggers(AreaTriggerRemoveReason reason=AreaTriggerRemoveReason::Default)
std::vector< std::pair< uint32, AuraApplication * > > AuraApplicationProcContainer
virtual void setDeathState(DeathState s)
void SetCreatorGUID(ObjectGuid creator)
void GetPartyMembers(std::list< Unit * > &units)
virtual void AtEngage(Unit *target)
void RemoveVehicleKit(bool onRemoveFromWorld=false)
ObjectGuid LastCharmerGUID
uint32 GetCombatRatingDamageReduction(CombatRating cr, float rate, float cap, uint32 damage) const
UF::UpdateFieldFlag GetUpdateFieldFlagsFor(Player const *target) const override
float GetUnitDodgeChance(WeaponAttackType attType, Unit const *victim) const
static bool IsDamageReducedByArmor(SpellSchoolMask damageSchoolMask, SpellInfo const *spellInfo=nullptr)
void HandleStatFlatModifier(UnitMods unitMod, UnitModifierFlatType modifierType, float amount, bool apply)
CombatManager & GetCombatManager()
void SetUnitFlag(UnitFlags flags)
MeleeHitOutcome RollMeleeOutcomeAgainst(Unit const *victim, WeaponAttackType attType) const
void UpdateMovementForcesModMagnitude()
uint32 GetCreatureTypeMask() const
bool InitTamedPet(Pet *pet, uint8 level, uint32 spell_id)
bool HasAuraTypeWithTriggerSpell(AuraType auratype, uint32 triggerSpell) const
bool HasAuraTypeWithAffectMask(AuraType auraType, SpellInfo const *affectedSpell) const
void SetCritterGUID(ObjectGuid guid)
AuraApplicationMap & GetAppliedAuras()
void ClearBossEmotes(Optional< uint32 > zoneId={}, Player const *target=nullptr) const
Clears boss emotes frame.
void RemoveMovementImpairingAuras(bool withRoot)
bool isAttackReady(WeaponAttackType type=BASE_ATTACK) const
void SetVignette(uint32 vignetteId)
bool ApplyDiminishingToDuration(SpellInfo const *auraSpellInfo, int32 &duration, WorldObject *caster, DiminishingLevels previousLevel) const
bool IsUninteractible() const
std::vector< AreaTrigger * > GetAreaTriggers(uint32 spellId) const
std::vector< GameObject * > GetGameObjects(uint32 spellId) const
std::array< uint32, MAX_ATTACK > m_attackTimer
bool IsServiceProvider() const
MountCapabilityEntry const * GetMountCapability(uint32 mountType) const
void SetVisibleAuraUpdate(AuraApplication *aurApp)
CombatManager m_combatManager
void ChangeSeat(int8 seatId, bool next=true)
void SetInFront(WorldObject const *target)
void ApplyDiminishingAura(DiminishingGroup group, bool apply)
AuraStateAurasMap m_auraStateAuras
int32 GetResistance(SpellSchools school) const
AuraList & GetSingleCastAuras()
bool IsAlwaysDetectableFor(WorldObject const *seer) const override
AuraApplication * GetAuraApplication(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraApplication *except=nullptr) const
Vehicle * GetVehicleKit() const
bool CanCastSpellWhileMoving(SpellInfo const *spellInfo) const
void PushAI(UnitAI *newAI)
float m_modSpellHitChance
void ValidateAttackersAndOwnTarget()
Guardian * GetGuardianPet() const
void resetAttackTimer(WeaponAttackType type=BASE_ATTACK)
Aura * GetAuraOfRankedSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
virtual void Talk(std::string_view text, ChatMsg msgType, Language language, float textRange, WorldObject const *target)
static void ProcSkillsAndAuras(Unit *actor, Unit *actionTarget, ProcFlagsInit const &typeMaskActor, ProcFlagsInit const &typeMaskActionTarget, ProcFlagsSpellType spellTypeMask, ProcFlagsSpellPhase spellPhaseMask, ProcFlagsHit hitMask, Spell *spell, DamageInfo *damageInfo, HealInfo *healInfo)
virtual bool IsEngaged() const
bool SetDisableGravity(bool disable, bool updateAnimTier=true, bool updatePlayHoverAnim=true)
void RemoveAurasWithFamily(SpellFamilyNames family, flag128 const &familyFlag, ObjectGuid casterGUID)
void _ApplyAuraEffect(Aura *aura, uint8 effIndex)
void RemoveAllMinionsByEntry(uint32 entry)
void SendPetActionFeedback(PetActionFeedback msg, uint32 spellId) const
-------—Pet responses methods--------------—
AuraMap & GetOwnedAuras()
void UpdateAllDamagePctDoneMods()
int32 SpellBaseDamageBonusDone(SpellSchoolMask schoolMask) const
virtual void Whisper(std::string_view text, Language language, Player *target, bool isBossWhisper=false)
void ClearChannelObjects()
std::array< float, MAX_STATS > m_floatStatNegBuff
int32 GetCurrentSpellCastTime(uint32 spell_id) const
float MeleeSpellMissChance(Unit const *victim, WeaponAttackType attType, SpellInfo const *spellInfo) const override
void RemoveAurasOnEvade()
void SetStatFlatModifier(UnitMods unitMod, UnitModifierFlatType modifierType, float val)
float SpellAbsorbPctDone(Unit *victim, SpellInfo const *spellProto) const
void SetShapeshiftForm(ShapeshiftForm form)
float GetUnitCriticalChanceAgainst(WeaponAttackType attackType, Unit const *victim) const
bool IsInPartyWith(Unit const *unit) const
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint32 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
static void Kill(Unit *attacker, Unit *victim, bool durabilityLoss=true, bool skipSettingDeathState=false)
SharedVisionList m_sharedVision
void SetMeleeAnimKitId(uint16 animKitId)
float GetMaxPositiveAuraModifierByMiscValue(AuraType auraType, int32 misc_value) const
void SendMeleeAttackStop(Unit const *victim=nullptr) const
EnumFlag< SpellAuraInterruptFlags > m_interruptMask
std::array< AuraEffectList, TOTAL_AURAS > m_modAuras
int32 SpellHealingBonusDone(Unit *victim, SpellInfo const *spellProto, int32 healamount, DamageEffectType damagetype, SpellEffectInfo const &spellEffectInfo, uint32 stack=1, Spell *spell=nullptr, AuraEffect const *aurEff=nullptr) const
ObjectGuid GetTarget() const
bool _isWalkingBeforeCharm
Are we walking before we were charmed?
void SetPowerType(Powers power, bool sendUpdate=true, bool onInit=false)
void SetMountDisplayId(uint32 mountDisplayId)
void RemoveNotOwnSingleTargetAuras(bool onPhaseChange=false)
virtual void SetDisplayId(uint32 displayId, bool setNative=false)
void TriggerAuraHeartbeat()
void SetWildBattlePetLevel(uint32 wildBattlePetLevel)
void RemoveVisibleAuraUpdate(AuraApplication *aurApp)
GetCastSpellInfoResult GetCastSpellInfo(SpellInfo const *spellInfo) const
uint32 GetModelForForm(ShapeshiftForm form, uint32 spellId) const
void AddWorldEffect(int32 worldEffectId)
void RemoveUnitFlag(UnitFlags flags)
void SetAIAnimKitId(uint16 animKitId)
void MonsterMoveWithSpeed(float x, float y, float z, float speed, bool generatePath=false, bool forceDestination=false)
uint16 GetVirtualItemAppearanceMod(uint32 slot) const
Unit * GetDemonCreator() const
Player * m_playerMovingMe
void RemoveAurasDueToSpellBySteal(uint32 spellId, ObjectGuid casterGUID, WorldObject *stealer, int32 stolenCharges=1)
AreaTrigger * GetAreaTrigger(uint32 spellId) const
uint32 GetDamageImmunityMask() const
Player * GetControllingPlayer() const
float GetWeaponProcChance() const
Aura * _TryStackingOrRefreshingExistingAura(AuraCreateInfo &createInfo)
ObjectGuid GetPetGUID() const
void RemoveChannelObject(ObjectGuid guid)
void RemoveAurasWithAttribute(SpellAttr0 flags)
void UpdateStatBuffMod(Stats stat)
virtual void ExitVehicle(Position const *exitPosition=nullptr)
void SendPetDismissSound() const
float m_auraPctModifiersGroup[UNIT_MOD_END][MODIFIER_TYPE_PCT_END]
void CombatStopWithPets(bool includingCast=false)
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
bool BuildPacket(WorldPacket *packet)
Vehicle * RemovePassenger(WorldObject *passenger) override
Removes the passenger from the vehicle.
uint32 GetCreatureEntry() const
void Uninstall()
Removes all passengers and sets status to STATUS_UNINSTALLING. No new passengers can be added to the ...
void RelocatePassengers()
Relocate passengers. Must be called after m_base::Relocate.
SeatMap Seats
The collection of all seats on the vehicle. Including vacant ones.
std::string GetDebugInfo() const
SeatMap::const_iterator GetNextEmptySeat(int8 seatId, bool next) const
Gets the next empty seat based on current seat.
VehicleSeatAddon const * GetSeatAddonForSeatOfPassenger(Unit const *passenger) const
Gets the vehicle seat addon data for the seat of a passenger.
Milliseconds GetDespawnDelay()
void InstallAllAccessories(bool evading)
bool AddVehiclePassenger(Unit *unit, int8 seatId=-1)
constexpr uint32 GetMapId() const
int8 GetTransSeat() const
bool InSamePhase(PhaseShift const &phaseShift) const
bool IsWithinDist3d(float x, float y, float z, float dist) const
virtual void SendMessageToSet(WorldPacket const *data, bool self) const
ZLiquidStatus GetLiquidStatus() const
void UpdateAllowedPositionZ(float x, float y, float &z, float *groundZ=nullptr) const
void AddToWorld() override
virtual bool IsAlwaysVisibleFor(WorldObject const *seer) const
Unit * GetCharmerOrOwner() const
void RemoveFromWorld() override
InstanceScript * GetInstanceScript() const
void SendSpellMiss(Unit *target, uint32 spellID, SpellMissInfo missInfo)
Unit * GetCharmerOrOwnerOrSelf() const
void SendCombatLogMessage(WorldPackets::CombatLog::CombatLogServerPacket *combatLog) const
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
std::string GetDebugInfo() const override
bool IsValidAttackTarget(WorldObject const *target, SpellInfo const *bySpell=nullptr) const
virtual bool IsAlwaysDetectableFor(WorldObject const *seer) const
bool IsHostileTo(WorldObject const *target) const
PhaseShift & GetPhaseShift()
ZoneScript * GetZoneScript() const
TransportBase * GetTransport() const
SpellMissInfo SpellHitResult(Unit *victim, SpellInfo const *spellInfo, bool canReflect, bool canImmune) const
void setActive(bool isActiveObject)
std::string const & GetName() const
bool IsWithinLOSInMap(WorldObject const *obj, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing) const
virtual void ProcessPositionDataChanged(PositionFullTerrainStatus const &data)
Player * GetSpellModOwner() const
Player * GetCharmerOrOwnerPlayerOrPlayerItself() const
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
void SetIsStoredInWorldObjectGridContainer(bool apply)
void AddToNotify(uint16 f)
float GetVisibilityRange() const
virtual uint32 GetCastSpellXSpellVisualId(SpellInfo const *spellInfo) const
float GetDistance(WorldObject const *obj) const
MovementInfo m_movementInfo
FlaggedValuesArray32< int32, uint32, ServerSideVisibilityType, TOTAL_SERVERSIDE_VISIBILITY_TYPES > m_serverSideVisibility
bool IsFriendlyTo(WorldObject const *target) const
bool IsInMap(WorldObject const *obj) const
virtual void Update(uint32 diff)
FactionTemplateEntry const * GetFactionTemplateEntry() const
virtual void UpdateObjectVisibility(bool forced=true)
virtual void CleanupsBeforeDelete(bool finalCleanup=true)
WorldPacket const * Write() override
void Initialize(ChatMsg chatType, Language language, WorldObject const *sender, WorldObject const *receiver, std::string_view message, uint32 achievementId=0, std::string_view channelName="", LocaleConstant locale=DEFAULT_LOCALE, std::string_view addonPrefix="")
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
std::vector< int32 > SpellVisualKitIDs
Spells::ContentTuningParams ContentTuning
Optional< SubDamage > SubDmg
Spells::SpellCastLogData LogData
WorldPacket const * Write() override
Spells::SpellCastVisual Visual
Optional< Spells::ContentTuningParams > ContentTuning
WorldPacket const * Write() override
std::vector< PeriodicAuraLogEffect > Effects
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
std::vector< PowerUpdatePower > Powers
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
Duration< Milliseconds, uint32 > LifetimeMs
WorldPacket const * Write() override
MovementForce const * Force
WorldPacket const * Write() override
TaggedPosition< Position::XY > Direction
WorldPacket const * Write() override
MoveKnockBackSpeeds Speeds
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
uint32 SequenceIndex
Unit movement packet index, incremented each time.
WorldPacket const * Write() override
WorldPacket const * Write() override
uint32 SequenceIndex
Unit movement packet index, incremented each time.
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
TaggedPosition< Position::XYZ > Pos
Optional< ObjectGuid > TransportGUID
WorldPacket const * Write() override
Duration< Milliseconds, uint32 > LifetimeMs
MovementForce const * Force
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
std::span< MovementForce const > MovementForces
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * GetRawPacket() const
WorldPacket const * Write() override
WorldPacket const * Write() override
::PetActionFeedback Response
WorldPacket const * Write() override
WorldPacket const * Write() override
int32 CreatureDisplayInfoID
TaggedPosition< Position::XYZ > ModelPosition
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
TaggedPosition< Position::XYZ > TargetPosition
WorldPacket const * Write() override
WorldPacket const * Write() override
LocaleConstant GetSessionDbLocaleIndex() const
void SendPacket(WorldPacket const *packet, bool forced=false)
Send a packet to the client.
@ CONFIG_CREATURE_FAMILY_FLEE_DELAY
@ RATE_DURABILITY_LOSS_DAMAGE
@ RATE_DURABILITY_LOSS_ON_DEATH
@ CONFIG_LISTEN_RANGE_YELL
@ CONFIG_LISTEN_RANGE_SAY
@ CONFIG_LISTEN_RANGE_TEXTEMOTE
@ CONFIG_DURABILITY_LOSS_IN_PVP
TimePoint Now()
Current chrono steady_clock time point.
ItemContext GetContextForPlayer(MapDifficultyEntry const *mapDifficulty, Player const *player)
TC_GAME_API std::string MovementFlags_ToString(MovementFlags flags)
TC_GAME_API WorldObject * GetWorldObject(WorldObject const &, ObjectGuid const &)
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
TC_GAME_API Player * GetPlayer(Map const *, ObjectGuid const &guid)
TC_GAME_API Creature * GetCreatureOrPetOrVehicle(WorldObject const &, ObjectGuid const &)
std::list< T, Alloc >::iterator RemoveUnique(std::list< T, Alloc > &list, std::type_identity_t< T > const &value)
auto MapEqualRange(M &map, typename M::key_type const &key)
auto SelectRandomContainerElement(C const &container) -> std::add_const_t< decltype(*std::ranges::begin(container))> &
bool IsValidMapCoord(float c)
std::unique_ptr< VignetteData > Create(VignetteEntry const *vignetteData, WorldObject const *owner)
void Update(VignetteData &vignette, WorldObject const *owner)
void Remove(VignetteData &vignette, WorldObject const *owner)
AuraCreateInfo & SetCaster(Unit *caster)
AuraCreateInfo & SetCasterGUID(ObjectGuid const &guid)
uint32 GetAuraEffectMask() const
SpellInfo const * GetSpellInfo() const
AuraCreateInfo & SetBaseAmount(SpellEffectValue const *bp)
SpellEffectValue const * BaseAmount
AuraCreateInfo & SetStackAmount(int32 stackAmount)
WeaponAttackType AttackType
ProcFlagsInit ProcAttacker
MeleeHitOutcome HitOutCome
static void VisitWorldObjects(WorldObject const *obj, T &visitor, float radius)
static void VisitAllObjects(WorldObject const *obj, T &visitor, float radius)
void SetIsCommandFollow(bool val)
void InitPossessCreateSpells()
void SetIsAtStay(bool val)
void SetPetNumber(uint32 petnumber, bool statwindow)
void SetIsFollowing(bool val)
void SetIsReturning(bool val)
void InitCharmCreateSpells()
void GetStayPosition(float &x, float &y, float &z)
void SetIsCommandAttack(bool val)
EnumFlag< ChrRacesFlag > GetFlags() const
WeaponAttackType attackType
int32 ExtendedDisplayInfoID
EnumFlag< CreatureModelDataFlags > GetFlags() const
float TurnVelocityThresholdMax
float TurnVelocityThresholdMin
float GlideStartMinHeight
float OverMaxDeceleration
float PitchingRateDownMax
float LaunchSpeedCoefficient
float PitchingRateDownMin
InventoryType GetInventoryType() const
uint32 GetSubClass() const
void NotifyLootList(Map const *map) const
void generateMoneyLoot(uint32 minAmount, uint32 maxAmount)
void SetDungeonEncounterId(uint32 dungeonEncounterId)
bool FillLoot(uint32 lootId, LootStore const &store, Player *lootOwner, bool personal, bool noEmptyError=false, uint16 lootMode=LOOT_MODE_DEFAULT, ItemContext context=ItemContext::NONE)
int16 CosmeticParentMapID
TaggedPosition< Position::XYZ > Origin
TaggedPosition< Position::XYZ > Direction
bool HasMovementFlag(MovementFlags flag) const
Optional< Inertia > inertia
void RemoveMovementFlag(MovementFlags flag)
void SetFallTime(uint32 fallTime)
struct MovementInfo::TransportInfo transport
Optional< LiquidData > liquidInfo
constexpr void SetOrientation(float orientation)
constexpr float GetPositionX() const
constexpr float GetPositionY() const
std::string ToString() const
bool HasInArc(float arcangle, Position const *pos, float border=2.0f) const
float GetAbsoluteAngle(float x, float y) const
constexpr void GetPosition(float &x, float &y) const
constexpr void Relocate(float x, float y)
constexpr Position GetPosition() const
constexpr bool IsInDist(float x, float y, float z, float dist) const
void RelocateOffset(Position const &offset)
constexpr float GetOrientation() const
constexpr float GetPositionZ() const
EnumFlag< PowerTypeFlags > GetFlags() const
SpellNonMeleeDamage(Unit *_attacker, Unit *_target, SpellInfo const *_spellInfo, SpellCastVisual spellVisual, uint32 _schoolMask, ObjectGuid _castId=ObjectGuid::Empty)
SpellCastVisual SpellVisual
AuraEffect const * auraEff
EnumFlag< SpellShapeshiftFormFlags > GetFlags() const
EnumFlag< SummonPropertiesFlags > GetFlags() const
Optional< ObjectGuid > TransportGuid
std::array< T, N > RawValue
static constexpr RaceMask GetMaskForRace(uint32 raceId)
UpdateFieldArray< std::string, 5, 0, 1 > Name
UpdateField< uint32, 32, 52 > AuraState
UpdateFieldArray< int32, 5, 187, 193 > StatPosBuff
UpdateField< int64, 32, 38 > Health
UpdateField< int32, 32, 59 > NativeDisplayID
UpdateField< uint32, 128, 134 > CurrentAreaID
UpdateField< int32, 32, 40 > Level
UpdateField< float, 64, 81 > ModHasteRegen
DynamicUpdateField< int32, 0, 4 > WorldEffects
UpdateField< float, 64, 78 > ModSpellHaste
UpdateFieldArray< uint32, 2, 184, 185 > AttackRoundBaseTime
DynamicUpdateField< ObjectGuid, 0, 5 > ChannelObjects
UpdateField< uint8, 64, 90 > ShapeshiftForm
UpdateField< uint8, 64, 71 > AnimTier
UpdateField< ObjectGuid, 0, 18 > SummonedBy
UpdateField< float, 64, 80 > ModRangedHaste
UpdateField< uint8, 64, 87 > SheatheState
UpdateField< float, 32, 60 > NativeXDisplayScale
UpdateField< float, 32, 56 > DisplayScale
UpdateFieldArray< int32, 10, 139, 140 > Power
UpdateField< uint8, 64, 68 > StandState
UpdateField< ObjectGuid, 0, 17 > CharmedBy
UpdateField< float, 64, 79 > ModHaste
UpdateField< uint8, 32, 35 > CreatureType
UpdateFieldArray< int32, 10, 139, 150 > MaxPower
UpdateField< uint8, 32, 36 > DisplayPower
UpdateField< int64, 32, 39 > MaxHealth
UpdateField< uint32, 0, 8 > NpcFlags2
UpdateField< int32, 0, 6 > DisplayID
UpdateField< uint32, 32, 53 > RangedAttackRoundBaseTime
UpdateFieldArray< int32, 5, 187, 198 > StatNegBuff
UpdateField< int32, 96, 127 > FlightCapabilityID
UpdateFieldArray< UF::VisibleItem, 3, 180, 181 > VirtualItems
UpdateField< ObjectGuid, 0, 14 > Charm
UpdateField< float, 64, 77 > ModCastingSpeedNeg
UpdateField< uint32, 0, 7 > NpcFlags
UpdateField< float, 64, 76 > ModCastingSpeed
UpdateField< uint16, 0, 7 > ItemVisual
UpdateField< int32, 0, 3 > ItemID
UpdateField< uint16, 0, 6 > ItemAppearanceModID
std::array< uint32, 5 > VisitedSpells
bool AddSpell(uint32 spellId)
bool operator()(AuraApplication *left, AuraApplication *right) const
VehicleExitParameters ExitParameter
Optional< Spells::ContentTuningParams > ContentTuning
int32 AbsorbedOrAmplitude
bool GenerateDataForUnits(T *attacker, U *target)
void Initialize(Unit const *unit)
void Add(EntityFragment fragment, bool update, void const *data=nullptr)