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), _procTarget(procTarget),
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),
448 uint32 count = itr->second;
520 auraApplication->GetBase()->Heartbeat();
528 return player->GetWeaponForAttack(
OFF_ATTACK,
true) !=
nullptr;
537 init.MoveTo(x, y, z, generatePath, forceDestination);
538 init.SetVelocity(speed);
627 transport->GetPositionWithOffset(pos).GetPosition(loc.x, loc.y, loc.z, loc.
orientation);
678 float distsq = dx * dx + dy * dy + dz * dz;
681 float maxdist = dist2compare + sizefactor;
683 return distsq < maxdist * maxdist;
694 float distsq = dx*dx + dy*dy + dz*dz;
698 return distsq <= maxdist * maxdist;
714 return IsInDist(obj, objBoundaryRadius);
747 m_interruptMask |= aurApp->GetBase()->GetSpellInfo()->AuraInterruptFlags;
764 if (aura->GetSpellInfo()->SpellFamilyName == familyName && aura->GetSpellInfo()->SpellFamilyFlags & familyFlags)
772 if ((!excludeAura || excludeAura != aura->GetSpellInfo()->Id) &&
784 if (excludeCasterChannel)
786 excludeAura = currentChanneledSpell->GetSpellInfo()->Id;
791 if (!aurApp->IsPositive()
792 && (!excludeAura || excludeAura != aurApp->GetBase()->GetId())
816 std::copy(list.begin(), list.end(), std::back_inserter(effects));
822 uint32 damageDone = damage;
823 uint32 damageTaken = damage;
829 uint32 tmpDamage = damageTaken;
833 tmpDamage = victimCreature->CalculateDamageForSparring(attacker, tmpDamage);
836 victimAI->DamageTaken(attacker, tmpDamage, damagetype, spellProto);
838 if (
UnitAI* attackerAI = attacker ? attacker->
GetAI() :
nullptr)
839 attackerAI->DamageDealt(victim, tmpDamage, damagetype);
842 sScriptMgr->OnDamage(attacker, victim, tmpDamage);
845 if (tmpDamage != damageTaken)
850 damageDone = tmpDamage;
852 damageTaken = tmpDamage;
857 if (attacker != victim && damagetype !=
DOT)
861 if (
CreatureAI* controlledAI = cControlled->AI())
862 controlledAI->OwnerAttackedBy(attacker);
890 for (
auto i = vCopyDamageCopy.begin(); i != vCopyDamageCopy.end(); ++i)
893 if (!((*i)->GetBase()->IsAppliedOnTarget(victim->
GetGUID())))
896 if (((*i)->GetMiscValue() & damageSchoolMask) == 0)
899 Unit* shareDamageTarget = (*i)->GetCaster();
900 if (!shareDamageTarget)
902 SpellInfo const* spell = (*i)->GetSpellInfo();
918 bool duel_hasEnded =
false;
919 bool duel_wasMounted =
false;
927 damageTaken = health - 1;
929 duel_hasEnded =
true;
933 damageTaken = health - 1;
939 victimAI->OnHealthDepleted(attacker,
false);
946 if (victimRider && victimRider->
duel && victimRider->
duel->IsMounted)
953 damageTaken = health - 1;
955 duel_wasMounted =
true;
956 duel_hasEnded =
true;
961 damageTaken = health - 1;
963 if (attacker && attacker != victim)
989 bool skipSettingDeathState =
false;
991 if (health <= damageTaken)
1002 DamageInfo damageInfo =
DamageInfo(attacker, victim, damageTaken, spellProto, damageSchoolMask, damagetype,
1004 for (
AuraEffect* absorbAurEff : vAbsorbOverkill)
1006 Aura* base = absorbAurEff->GetBase();
1011 if (!(absorbAurEff->GetMiscValue() & damageInfo.
GetSchoolMask()))
1015 if (absorbAurEff->GetAmount() > 0)
1017 if (damageTaken > absorbAurEff->GetAmount())
1028 bool deathFullyPrevented =
false;
1030 absorbAurEff->GetBase()->CallScriptEffectAbsorbHandlers(absorbAurEff, aurApp, damageInfo, currentAbsorb, deathFullyPrevented);
1033 currentAbsorb = std::min(currentAbsorb, damageInfo.
GetDamage());
1041 if (deathFullyPrevented)
1044 skipSettingDeathState =
true;
1054 absorbLog.
Absorbed = currentAbsorb;
1066 durabilityLoss =
false;
1069 Unit::Kill(attacker, victim, durabilityLoss, skipSettingDeathState);
1117 auto isCastInterrupted = [&]()
1131 auto isCastDelayed = [&]()
1145 if (isCastInterrupted())
1147 else if (isCastDelayed())
1152 if (damageTaken && victim->
IsPlayer())
1155 spell->DelayedChannel();
1166 if (duel_wasMounted)
1171 he->
duel->Opponent->CombatStopWithPets(
true);
1199 if (!victim || !victim->
IsAlive())
1222 uint32 crit_bonus = damage;
1226 damage += crit_bonus;
1231 if (critPctDamageMod != 0)
1232 AddPct(damage, critPctDamageMod);
1252 damage -= damageInfo->
blocked;
1287 damageInfo->
damage = damage;
1315 if (!damageInfo->
Spell)
1317 TC_LOG_DEBUG(
"entities.unit",
"Unit::DealSpellDamage has no spell");
1330 damageInfo->
Target = victim;
1398 damageInfo->
Damage = damage;
1479 float reducePercent = 1.f - leveldif * 0.1f;
1502 resilienceReduction = damageInfo->
Damage - resilienceReduction;
1503 damageInfo->
Damage -= resilienceReduction;
1546 float percent60 = 3.0f * percent20;
1547 if (offtime > percent20 && offtime <= percent60)
1549 else if (offtime > percent60)
1551 offtime -= 2.0f * percent20;
1558 float percent60 = 3.0f * percent20;
1559 if (basetime > percent20 && basetime <= percent60)
1561 else if (basetime > percent60)
1563 basetime -= 2.0f * percent20;
1579 float chance = 20.0f;
1588 chance *= attackerMeleeSkill / float(victimDefense) * 0.16f;
1608 for (
AuraEffect const* aurEff : vDamageShieldsCopy)
1610 SpellInfo const* spellInfo = aurEff->GetSpellInfo();
1627 uint32 damage = aurEff->GetAmountAsInt();
1628 if (
Unit* caster = aurEff->GetCaster())
1630 damage = caster->SpellDamageBonusDone(
this, spellInfo, damage,
SPELL_DIRECT_DAMAGE, aurEff->GetSpellEffectInfo());
1686 float armor = float(victim->
GetArmor());
1695 for (AuraEffectList::const_iterator i = reductionAuras.begin(); i != reductionAuras.end(); ++i)
1696 if ((*i)->GetCasterGUID() == attacker->
GetGUID())
1697 armorBypassPct += (*i)->GetAmount();
1698 armor =
CalculatePct(armor, 100 - std::min(armorBypassPct, 100.0));
1708 for (
AuraEffect const* aurEff : resIgnoreAuras)
1711 armor = std::floor(
AddPct(armor, -aurEff->GetAmount()));
1728 float maxArmorPen = 0.f;
1735 maxArmorPen = std::min((armor + maxArmorPen) / 3.f, armor);
1741 if (G3D::fuzzyLe(armor, 0.0f))
1757 if (attackerItemLevel)
1760 if (attackerLevel == maxLevelForExpansion)
1764 armorConstant *=
sDB2Manager.GetCurveValueAt(curveId, itemLevelDelta);
1768 if (!(armor + armorConstant))
1771 float mitigation = std::min(armor / (armor + armorConstant), 0.85f);
1772 return uint32(std::max(damage * (1.0f - mitigation), 0.0f));
1786 float discreteResistProbability[11] = { };
1787 if (averageResist <= 0.1f)
1789 discreteResistProbability[0] = 1.0f - 7.5f * averageResist;
1790 discreteResistProbability[1] = 5.0f * averageResist;
1791 discreteResistProbability[2] = 2.5f * averageResist;
1795 for (
uint32 i = 0; i < 11; ++i)
1796 discreteResistProbability[i] = std::max(0.5f - 2.5f * std::fabs(0.1f * i - averageResist), 0.0f);
1800 float probabilitySum = 0.0f;
1803 for (; resistance < 11; ++resistance)
1804 if (roll < (probabilitySum += discreteResistProbability[resistance]))
1807 float damageResisted = damage * resistance / 10.f;
1808 if (damageResisted > 0.0f)
1810 float ignoredResistance = 0.0f;
1815 ignoredResistance = std::min(ignoredResistance, 100.0f);
1816 ApplyPct(damageResisted, 100.0f - ignoredResistance);
1822 float armorReduction = damage - damageAfterArmor;
1825 damageResisted = std::min(damageResisted, armorReduction);
1829 damageResisted = std::max(damageResisted, 0.f);
1830 return uint32(damageResisted);
1835 float victimResistance = float(victim->
GetResistance(schoolMask));
1842 victimResistance -= float(player->GetSpellPenetrationItemMod());
1844 else if (
Unit const* unitCaster = caster->
ToUnit())
1850 victimResistance = 0.0f;
1854 victimResistance = 0.0f;
1856 victimResistance = std::max(victimResistance, 0.0f);
1863 static uint32 const bossLevel = 83;
1864 static float const bossResistanceConstant = 510.0f;
1866 float resistanceConstant = 0.0f;
1868 if (level == bossLevel)
1869 resistanceConstant = bossResistanceConstant;
1871 resistanceConstant = level * 5.0f;
1873 return victimResistance / (victimResistance + resistanceConstant);
1884 float auraAbsorbMod = 0.f;
1903 for (
auto itr = vSchoolAbsorbCopy.begin(); (itr != vSchoolAbsorbCopy.end()) && (damageInfo.
GetDamage() > 0); ++itr)
1916 if (currentAbsorb < 0)
1924 bool defaultPrevented =
false;
1927 currentAbsorb = tempAbsorb;
1929 if (!defaultPrevented)
1936 tempAbsorb = currentAbsorb;
1961 absorbLog.
Absorbed = currentAbsorb;
1970 for (
auto itr = vManaShieldCopy.begin(); (itr != vManaShieldCopy.end()) && (damageInfo.
GetDamage() > 0); ++itr)
1984 if (currentAbsorb < 0)
1990 uint32 tempAbsorb = currentAbsorb;
1992 bool defaultPrevented =
false;
1995 currentAbsorb = tempAbsorb;
1997 if (!defaultPrevented)
2002 int32 manaReduction = currentAbsorb;
2006 manaReduction =
int32(
float(manaReduction) * manaMultiplier);
2011 currentAbsorb = currentAbsorb ?
int32(
float(currentAbsorb) * (
float(manaTaken) /
float(manaReduction))) : 0;
2015 tempAbsorb = currentAbsorb;
2038 absorbLog.
Absorbed = currentAbsorb;
2051 for (
auto itr = vSplitDamagePctCopy.begin(); itr != vSplitDamagePctCopy.end() && damageInfo.
GetDamage() > 0; ++itr)
2063 Unit* caster = (*itr)->GetCaster();
2069 (*itr)->GetBase()->CallScriptEffectSplitHandlers((*itr), aurApp, damageInfo, splitDamage);
2089 if (victimCreature->ShouldFakeDamageFrom(damageInfo.
GetAttacker()))
2096 log.
damage = splitDamage;
2098 log.
absorb = split_absorb;
2114 for (
auto i = vHealAbsorb.begin(); i != vHealAbsorb.end() && healInfo.
GetHeal() > 0; ++i)
2127 if (currentAbsorb < 0)
2132 bool defaultPrevented =
false;
2135 currentAbsorb = tempAbsorb;
2137 if (!defaultPrevented)
2144 tempAbsorb = currentAbsorb;
2166 absorbLog.
Absorbed = currentAbsorb;
2211 if (!autoAttackError)
2226 attackerPlayer->SetAttackSwingError(autoAttackError);
2232 if (!autoAttackError)
2298 uint32 meleeAttackSpellId = 0;
2301 if (!meleeAttackOverrides.empty())
2302 meleeAttackSpellId = meleeAttackOverrides.front()->GetSpellEffectInfo().TriggerSpell;
2306 auto itr = std::find_if(meleeAttackOverrides.begin(), meleeAttackOverrides.end(), [&](
AuraEffect const* aurEff)
2308 return aurEff->GetSpellEffectInfo().MiscValue != 0;
2310 if (itr != meleeAttackOverrides.end())
2311 meleeAttackSpellId = (*itr)->GetSpellEffectInfo().MiscValue;
2314 if (!meleeAttackSpellId)
2324 if (victimCreature->ShouldFakeDamageFrom(damageInfo.
Attacker))
2347 TC_LOG_DEBUG(
"entities.unit",
"AttackerStateUpdate: {} attacked {} for {} dmg, absorbed {}, blocked {}, resisted {}.",
2352 CastSpell(victim, meleeAttackSpellId,
true);
2379 targetGUID = selection;
2407 int32 sum = 0, tmp = 0;
2423 canParryOrBlock =
false;
2428 if (tmp > 0 && roll < (sum += tmp))
2440 && roll < (sum += tmp))
2445 if (canParryOrBlock)
2449 && roll < (sum += tmp))
2457 attackerLevel + 3 < victimLevel)
2460 tmp = (10 + 10 * (victimLevel - attackerLevel)) * 100;
2461 if (tmp > 0 && roll < (sum += tmp))
2466 if (canParryOrBlock)
2470 && roll < (sum += tmp))
2476 if (tmp > 0 && roll < (sum += tmp))
2481 if (attackerLevel >= victimLevel + 4 &&
2487 tmp = attackerLevel - victimLevel * 1000 - 1500;
2488 if (roll < (sum += tmp))
2490 TC_LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: CRUSHING <{}, {})", sum-tmp, sum);
2501 float minDamage = 0.0f;
2502 float maxDamage = 0.0f;
2504 if (normalized || !addTotalPct)
2509 float minOffhandDamage = 0.0f;
2510 float maxOffhandDamage = 0.0f;
2512 minDamage += minOffhandDamage;
2513 maxDamage += maxOffhandDamage;
2542 minDamage = std::max(0.f, minDamage);
2543 maxDamage = std::max(0.f, maxDamage);
2545 if (minDamage > maxDamage)
2546 std::swap(minDamage, maxDamage);
2589 float resistMech = 0;
2592 if (!effect.IsEffect())
2599 if (resistMech < temp)
2604 return std::max(resistMech, 0.0f);
2646 tmp += resist_chance;
2676 tmp += deflect_chance;
2705 if (!aurEff->IsAffectingSpell(spellInfo))
2708 switch (aurEff->GetMiscValue())
2720 TC_LOG_DEBUG(
"entities.unit",
"Spell {} SPELL_AURA_IGNORE_COMBAT_RESULT has unhandled state {}", aurEff->GetId(), aurEff->GetMiscValue());
2729 if (dodgeChance < 0)
2732 if (roll < (tmp += dodgeChance))
2740 if (parryChance < 0)
2751 if (blockChance < 0)
2766 float chance = 0.0f;
2767 float levelBonus = 0.0f;
2769 chance = playerVictim->m_activePlayerData->DodgePercentage;
2778 levelBonus = 1.5f * levelDiff;
2782 chance += levelBonus;
2795 return std::max(chance, 0.0f);
2802 float chance = 0.0f;
2803 float levelBonus = 0.0f;
2806 if (playerVictim->CanParry())
2810 tmpitem = playerVictim->GetWeaponForAttack(
OFF_ATTACK,
true);
2813 chance = playerVictim->m_activePlayerData->ParryPercentage;
2824 levelBonus = 1.5f * levelDiff;
2828 chance += levelBonus;
2835 return std::max(chance, 0.0f);
2840 float miss_chance = 5.0f;
2849 float chance = 0.0f;
2850 float levelBonus = 0.0f;
2853 if (playerVictim->CanBlock())
2857 chance = playerVictim->m_activePlayerData->BlockPercentage;
2868 levelBonus = 1.5f * levelDiff;
2872 chance += levelBonus;
2873 return std::max(chance, 0.0f);
2878 float chance = 0.0f;
2884 chance = thisPlayer->m_activePlayerData->CritPercentage;
2887 chance = thisPlayer->m_activePlayerData->OffhandCritPercentage;
2890 chance = thisPlayer->m_activePlayerData->RangedCritPercentage;
2913 float chance = critDone;
2933 return aurEff->
GetCasterGUID() == tempSummon->GetSummonerGUID();
2939 return std::max(chance, 0.0f);
2972 spell->SetReferencedFromCurrent(
false);
2988 if (i->second->IsExpired())
2997 visibleAura->ClientUpdate();
3005 GameObjectList::iterator itr;
3008 if (!(*itr)->isSpawned())
3011 (*itr)->SetRespawnTime(0);
3033 if (autoRepeatSpellInfo->
Id != 75)
3045 if (autoRepeatSpellInfo->
Id != 75)
3249 if (spell && spell->m_spellInfo->Id == spell_id)
3413 AuraEffect const* auraEff = foundAura->GetEffect(spellEffectInfo.EffectIndex);
3419 bp = *(createInfo.
BaseAmount + spellEffectInfo.EffectIndex);
3421 bp = spellEffectInfo.BasePoints;
3431 if (castItemGUID != foundAura->GetCastItemGUID())
3434 *oldGUID = castItemGUID;
3435 uint32* oldItemId =
const_cast<uint32*
>(&foundAura->m_castItemId);
3437 int32* oldItemLevel =
const_cast<int32*
>(&foundAura->m_castItemLevel);
3469 std::vector<Aura*> aurasSharingLimit;
3472 if (scAura->IsSingleTargetWith(aura))
3473 aurasSharingLimit.push_back(scAura);
3479 while (aurasSharingLimit.size() > maxOtherAuras)
3481 aurasSharingLimit.back()->Remove();
3482 aurasSharingLimit.pop_back();
3498 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());
3516 m_appliedAuras.insert(AuraApplicationMap::value_type(aurId, aurApp));
3557 uint32 aStateMask = (1 << (aState - 1));
3582 if (effMask & 1 << aurEff->GetEffIndex())
3593 player->UpdateVisibleObjectInteractions(
false,
true,
false,
false);
3611 TC_LOG_DEBUG(
"spells",
"Aura {} now is remove mode {}", aura->
GetId(), removeMode);
3629 bool auraStateFound =
false;
3633 bool canBreak =
false;
3635 for (AuraStateAurasMap::iterator itr =
m_auraStateAuras.lower_bound(auraState); itr !=
m_auraStateAuras.upper_bound(auraState) && !(auraStateFound && canBreak);)
3637 if (itr->second == aurApp)
3644 auraStateFound =
true;
3654 if (aurApp->
HasEffect(aurEff->GetEffIndex()))
3670 if (!auraStateFound)
3675 uint32 aStateMask = (1 << (auraState - 1));
3686 player->UpdateVisibleObjectInteractions(
false,
true,
false,
false);
3702 for (AuraApplicationMap::iterator iter = range.first; iter != range.second;)
3704 if (iter->second == aurApp)
3753 Aura* aura = i->second;
3775 if (((itr->second->GetEffectMask() & reqEffMask) == reqEffMask) && (!casterGUID || itr->second->GetCasterGUID() == casterGUID))
3793 TC_LOG_ERROR(
"spells",
"Unit::RemoveOwnedAura() called with unallowed removeMode AURA_REMOVE_NONE, spellId {}", aura->
GetId());
3800 for (AuraMap::iterator itr = range.first; itr != range.second; ++itr)
3802 if (itr->second == aura)
3815 for (AuraMap::const_iterator itr = range.first; itr != range.second; ++itr)
3817 if (((itr->second->GetEffectMask() & reqEffMask) == reqEffMask)
3818 && (!casterGUID || itr->second->GetCasterGUID() == casterGUID)
3819 && (!itemCasterGUID || itr->second->GetCastItemGUID() == itemCasterGUID)
3820 && (!except || except != itr->second))
3844 for (AuraApplicationMap::iterator iter = range.first; iter != range.second;)
3846 Aura const* aura = iter->second->GetBase();
3869 if (aurApp->
HasEffect(aurEff->GetEffIndex()))
3881 for (AuraApplicationMap::iterator iter = range.first; iter != range.second;)
3883 if (aurApp == iter->second)
3905 if (check(iter->second))
3918 if (check(iter->second))
3931 if (check(iter->second))
3945 if (check(iter->second))
3957 for (AuraEffectList::iterator iter =
m_modAuras[auraType].begin(); iter !=
m_modAuras[auraType].end();)
3959 Aura* aura = (*iter)->GetBase();
3978 Aura const* aura = iter->second->GetBase();
3993 for (AuraMap::iterator iter = range.first; iter != range.second;)
3995 Aura* aura = iter->second;
4010 for (AuraMap::iterator iter = range.first; iter != range.second;)
4012 Aura* aura = iter->second;
4015 DispelInfo dispelInfo(dispeller, dispellerSpellId, chargesRemoved);
4038 for (AuraMap::iterator iter = range.first; iter != range.second;)
4040 Aura* aura = iter->second;
4043 std::array<SpellEffectValue, MAX_SPELL_EFFECTS> damage = { };
4044 std::array<SpellEffectValue, MAX_SPELL_EFFECTS> baseDamage = { };
4045 std::bitset<MAX_SPELL_EFFECTS> effMask;
4046 std::bitset<MAX_SPELL_EFFECTS> recalculateMask;
4051 baseDamage[i] = aurEff->GetBaseAmount();
4052 damage[i] = aurEff->GetAmount();
4054 if (aurEff->CanBeRecalculated())
4055 recalculateMask[i] =
true;
4067 oldAura->ModCharges(stolenCharges);
4069 oldAura->ModStackAmount(stolenCharges);
4070 oldAura->SetDuration(
int32(dur));
4087 if (newAura->IsSingleTarget())
4089 newAura->UnregisterSingleTarget();
4095 newAura->SetLoadedState(aura->
GetMaxDuration(),
int32(dur), stealCharge ? stolenCharges : aura->
GetCharges(), recalculateMask.to_ulong(), damage.data());
4096 newAura->ApplyForTargets();
4117 if (iter->second->GetBase()->GetCastItemGUID() == castItemGuid)
4129 for (AuraEffectList::iterator iter =
m_modAuras[auraType].begin(); iter !=
m_modAuras[auraType].end();)
4131 Aura* aura = (*iter)->GetBase();
4136 if (aura != except && (!casterGUID || aura->
GetCasterGUID() == casterGUID)
4151 SpellInfo const* spell = iter->second->GetBase()->GetSpellInfo();
4172 Aura const* aura = iter->second;
4193 for (AuraList::iterator iter = scAuras.begin(); iter != scAuras.end();)
4199 iter = scAuras.begin();
4206template<
typename InterruptFlag>
4221 if (interruptSource)
4240template <
typename InterruptFlags>
4249 Aura* aura = (*iter)->GetBase();
4252 && (!source || aura->
GetId() != source->
Id)
4265 && spell->GetSpellInfo()->HasChannelInterruptFlag(flag)
4266 && (!source || spell->GetSpellInfo()->
Id != source->
Id)
4280 Aura const* aura = iter->second->GetBase();
4304 std::vector<Aura*> aurasToUpdateTargets;
4308 if (exceptSpellId && aura->
GetId() == exceptSpellId)
4312 if (!(appliedMechanicMask & mechanicMaskToRemove))
4320 aurasToUpdateTargets.push_back(aura);
4324 for (
Aura* aura : aurasToUpdateTargets)
4326 aura->UpdateTargetMap(aura->GetCaster());
4329 if (!aura->IsPassive() && aura->GetOwner() ==
this && !aura->GetApplicationOfTarget(
GetGUID()))
4330 aura->Remove(removeMode);
4339 Aura const* aura = iter->second->GetBase();
4354 Aura* aura = iter->second;
4357 for (Aura::ApplicationMap::const_iterator itr = appMap.begin(); itr!= appMap.end();)
4373 if (iter->second->GetBase()->GetOwner() !=
this)
4388 AuraApplicationMap::iterator aurAppIter;
4392 AuraMap::iterator aurIter;
4396 const int maxIteration = 50;
4398 if (counter >= maxIteration)
4400 std::stringstream sstr;
4401 sstr <<
"Unit::RemoveAllAuras() iterated " << maxIteration <<
" times already but there are still "
4407 sstr <<
"m_appliedAuras:" <<
"\n";
4409 for (std::pair<uint32 const, AuraApplication*>& auraAppPair :
m_appliedAuras)
4410 sstr << auraAppPair.second->GetDebugInfo() <<
"\n";
4415 sstr <<
"m_ownedAuras:" <<
"\n";
4418 sstr << aura->GetDebugInfo() <<
"\n";
4450 auto evadeAuraCheck = [](
Aura const* aura)
4464 auto evadeAuraApplicationCheck = [&evadeAuraCheck](
AuraApplication const* aurApp)
4466 return evadeAuraCheck(aurApp->
GetBase());
4479 Aura const* aura = iter->second->GetBase();
4488 Aura* aura = iter->second;
4500 Aura const* aura = iter->second->GetBase();
4509 Aura* aura = iter->second;
4521 Aura const* aura = iter->second->GetBase();
4530 Aura* aura = iter->second;
4542 Aura const* aura = iter->second->GetBase();
4551 Aura* aura = iter->second;
4563 Aura* aura = iter->second;
4576 for (; range.first != range.second; ++range.first)
4578 Aura* aura = range.first->second;
4607 for (AuraApplicationMap::const_iterator itr = range.first; itr != range.second; ++itr)
4609 if (itr->second->HasEffect(effIndex)
4610 && (!caster || itr->second->GetBase()->GetCasterGUID() == caster))
4625 rankSpell =
sSpellMgr->GetNextSpellInChain(rankSpell);
4633 for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
4635 SpellInfo const* spell = (*i)->GetSpellInfo();
4638 if (!casterGUID.
IsEmpty() && (*i)->GetCasterGUID() != casterGUID)
4655 && (!except || except != app))
4667 if (predicate(pair.second))
4676 if (predicate(pair.second->GetBase()))
4684 for (AuraApplicationMap::value_type
const& pair :
m_appliedAuras)
4685 if (predicate(pair.second))
4693 for (AuraApplicationMap::value_type
const& pair :
m_appliedAuras)
4694 if (predicate(pair.second->GetBase()))
4703 return aurApp ? aurApp->
GetBase() :
nullptr;
4709 return aurApp ? aurApp->
GetBase() :
nullptr;
4715 return aurApp ? aurApp->
GetBase() :
nullptr;
4725 rankSpell =
sSpellMgr->GetNextSpellInChain(rankSpell);
4733 return aurApp ? aurApp->
GetBase() :
nullptr;
4739 for (
auto itr = auras.begin(); itr != auras.end(); ++itr)
4741 Aura* aura = itr->second;
4769 dispelList.emplace_back(aura, chance, charges);
4777 for (AuraApplicationMap::const_iterator itr = range.first; itr != range.second; ++itr)
4779 if (itr->second->HasEffect(effIndex)
4780 && (!caster || itr->second->GetBase()->GetCasterGUID() == caster))
4793 for (AuraApplicationMap::const_iterator itr = range.first; itr != range.second; ++itr)
4795 if (itr->second->GetBase()->GetStackAmount() == 0)
4798 count += (
uint32)itr->second->GetBase()->GetStackAmount();
4806 return GetAuraApplication(spellId, casterGUID, itemCasterGUID, reqEffMask) !=
nullptr;
4822 if (caster == eff->GetCasterGUID())
4830 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
4831 if (miscvalue == (*i)->GetMiscValue())
4839 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
4840 if ((*i)->IsAffectingSpell(affectedSpell))
4848 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
4849 if (value == (*i)->GetAmountAsInt())
4857 if (aura->GetSpellEffectInfo().TriggerSpell == triggerSpell)
4862template <
typename InterruptFlags>
4869 if (!(*iter)->IsPositive() && (*iter)->GetBase()->GetSpellInfo()->HasAuraInterruptFlag(flag) &&
4870 (!guid || (*iter)->GetBase()->GetCasterGUID() == guid))
4883 SpellInfo const* spellInfo = iter->second->GetBase()->GetSpellInfo();
4888 if (iter->second->HasEffect(spellEffectInfo.EffectIndex) && spellEffectInfo.IsEffect() && spellEffectInfo.Mechanic)
4889 if (mechanicMask & (
UI64LIT(1) << spellEffectInfo.Mechanic))
4902 SpellInfo const* spellInfo = itr->second->GetBase()->GetSpellInfo();
4909 if (newDuration > 0 && newDuration < existingDuration)
4919 for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
4921 if ((*i)->GetMiscValue() == script)
4922 if ((*i)->IsAffectingSpell(spell))
4930 static const AuraType diseaseAuraTypes[] =
4937 for (
AuraType aType : diseaseAuraTypes)
4943 && (*itr)->GetCasterGUID() == casterGUID)
4949 RemoveAura((*itr)->GetId(), (*itr)->GetCasterGUID());
4962 static const AuraType diseaseAuraTypes[] =
4973 for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
4976 if ((*i)->GetCasterGUID() == casterGUID)
4986 if (mTotalAuraList.empty())
4989 std::map<SpellGroup, SpellEffectValue> sameEffectSpellGroup;
4992 for (
AuraEffect const* aurEff : mTotalAuraList)
4994 if (predicate(aurEff))
4998 if (!
sSpellMgr->AddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(), auraType, aurEff->GetAmount(), sameEffectSpellGroup))
4999 modifier += aurEff->GetAmount();
5004 for (
auto itr = sameEffectSpellGroup.begin(); itr != sameEffectSpellGroup.end(); ++itr)
5005 modifier += itr->second;
5007 return static_cast<float>(modifier);
5013 if (mTotalAuraList.empty())
5016 std::map<SpellGroup, SpellEffectValue> sameEffectSpellGroup;
5019 for (
AuraEffect const* aurEff : mTotalAuraList)
5021 if (predicate(aurEff))
5025 if (!
sSpellMgr->AddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(), auraType, aurEff->GetAmount(), sameEffectSpellGroup))
5026 AddPct(multiplier, aurEff->GetAmount());
5031 for (
auto itr = sameEffectSpellGroup.begin(); itr != sameEffectSpellGroup.end(); ++itr)
5032 AddPct(multiplier, itr->second);
5034 return static_cast<float>(multiplier);
5040 if (mTotalAuraList.empty())
5044 for (
AuraEffect const* aurEff : mTotalAuraList)
5046 if (predicate(aurEff))
5047 modifier = std::max(modifier, aurEff->GetAmount());
5050 return static_cast<float>(modifier);
5056 if (mTotalAuraList.empty())
5060 for (
AuraEffect const* aurEff : mTotalAuraList)
5062 if (predicate(aurEff))
5063 modifier = std::min(modifier, aurEff->GetAmount());
5066 return static_cast<float>(modifier);
5113 if (except != aurEff && (aurEff->
GetMiscValue() & miscMask) != 0)
5221 float modPos = 0.0f;
5222 float modNeg = 0.0f;
5223 float factor = 0.0f;
5236 modValue =
static_cast<Guardian*
>(
this)->GetBonusStatFromOwner(stat);
5306 std::vector<DynamicObject*> dynamicobjects =
GetDynObjects(spellId);
5307 return dynamicobjects.empty() ? nullptr : dynamicobjects.front();
5312 std::vector<DynamicObject*> dynamicobjects;
5313 for (DynObjectList::const_iterator i =
m_dynObj.begin(); i !=
m_dynObj.end(); ++i)
5314 if ((*i)->GetSpellId() == spellId)
5315 dynamicobjects.push_back(*i);
5317 return dynamicobjects;
5344 return gameobjects.empty() ? nullptr : gameobjects.front();
5349 std::vector<GameObject*> gameobjects;
5350 for (GameObjectList::const_iterator i =
m_gameObj.begin(); i !=
m_gameObj.end(); ++i)
5351 if ((*i)->GetSpellId() == spellId)
5352 gameobjects.push_back(*i);
5422 GameObjectList::iterator i, next;
5426 if (spellid == 0 || (*i)->GetSpellId() == spellid)
5431 (*i)->SetRespawnTime(0);
5447 GameObjectList::iterator i =
m_gameObj.begin();
5449 (*i)->SetRespawnTime(0);
5472 return areaTriggers.empty() ? nullptr : areaTriggers.front();
5477 std::vector<AreaTrigger*> areaTriggers;
5479 if ((*i)->GetSpellId() == spellId)
5480 areaTriggers.push_back(*i);
5482 return areaTriggers;
5504 if (areaTrigger->GetAuraEffect() == aurEff)
5506 areaTrigger->Remove();
5537 at->HandleUnitExit(
this);
5574 static constexpr int32 ProcChainHardLimit = 10;
5577 TC_LOG_ERROR(
"spells.aura.effect",
"Unit::ProcSkillsAndAuras: Possible infinite proc loop detected, current triggering spell {}", spell->
GetDebugInfo().c_str());
5599 actor->
TriggerAurasProcOnEvent(
nullptr,
nullptr, actionTarget, typeMaskActor, typeMaskActionTarget, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo);
5644 spellOrDamageImmune.
SpellID = spellId;
5658 packet.
OverDamage = (overkill < 0 ? -1 : overkill);
5686 dmgInfo.
Damage =
Damage - AbsorbDamage - Resist - BlockedAmount;
5689 dmgInfo.
Absorb = AbsorbDamage;
5692 dmgInfo.
Blocked = BlockedAmount;
5703 if (!powerTypeEntry)
5740 if (thisPlayer->GetGroup())
5753 if (!powerTypeEntry)
5782 if (!powerTypeAuras.empty())
5784 AuraEffect const* powerTypeAura = powerTypeAuras.front();
5796 displayPower =
Powers(powerDisplay->ActualType);
5805 return displayPower;
5855 if (!victim || victim ==
this)
5958 if (
CreatureAI* controlledAI = cControlled->AI())
5959 controlledAI->OwnerAttacked(victim);
5986 creature->SetNoCallAssistance(
false);
5999 for (
Unit* attacker : attackers)
6001 toRemove.push_back(attacker);
6003 for (
Unit* attacker : toRemove)
6022 std::vector<Unit*> attackersToRemove;
6026 for (
Unit* attacker : attackersToRemove)
6045 minion->CombatStop(includingCast);
6054 if ((*itr)->isAttackingPlayer())
6060 if (summon->isAttackingPlayer())
6071 if (!(*iter)->AttackStop())
6073 TC_LOG_ERROR(
"entities.unit",
"WORLD: Unit has an attacker that isn't attacking it!");
6081 uint32 mask = 1 << (flag - 1);
6090 for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr)
6095 if (!spellInfo || !spellInfo->
IsPassive())
6103 for (PetSpellMap::const_iterator itr = pet->m_spells.begin(); itr != pet->m_spells.end(); ++itr)
6108 if (!spellInfo || !spellInfo->
IsPassive())
6123 for (Unit::AuraApplicationMap::iterator itr = tAuras.begin(); itr != tAuras.end();)
6125 SpellInfo const* spellProto = itr->second->GetBase()->GetSpellInfo();
6140 if (itr->second->GetBase()->GetCasterGUID() == target->
GetGUID())
6141 auraStates |= (1 << (itr->first - 1));
6161 for (AuraStateAurasMap::const_iterator itr = range.first; itr != range.second; ++itr)
6162 if (itr->second->GetBase()->GetCasterGUID() ==
Caster->GetGUID())
6168 return (*
m_unitData->AuraState & (1 << (flag - 1))) != 0;
6208 return master->GetControllingPlayer();
6224 TC_LOG_ERROR(
"entities.unit",
"Unit::GetFirstMinion: Minion {} not exist.", pet_guid.
ToString());
6240 TC_LOG_FATAL(
"entities.unit",
"Unit::GetGuardianPet: Guardian {} not exist.", pet_guid.
ToString());
6280 if (oldPet != minion && (oldPet->IsPet() || minion->
IsPet() || oldPet->GetEntry() != minion->
GetEntry()))
6283 if (
Pet* oldPetAsPet = oldPet->
ToPet())
6312 if (
BattlePets::BattlePet const* pet = thisPlayer->GetSession()->GetBattlePetMgr()->GetPet(thisPlayer->GetSummonedBattlePetGUID()))
6318 if (
uint32 display = pet->PacketInfo.DisplayID)
6388 if (
GetGUID() == (*itr)->GetCharmerGUID())
6392 if ((*itr)->GetOwnerGUID() !=
GetGUID())
6395 (*itr)->OutDebugInfo();
6407 if ((*itr)->IsPet())
6532 victimAI->HealReceived(healer, addhealth);
6534 if (
UnitAI* healerAI = healer ? healer->
GetAI() :
nullptr)
6535 healerAI->HealDone(victim, addhealth);
6543 Unit* unit = healer;
6585 for (AuraEffectList::const_iterator i = interceptAuras.begin(); i != interceptAuras.end(); ++i)
6587 if (
Unit* magnet = (*i)->GetBase()->GetCaster())
6628 TC_LOG_ERROR(
"entities.unit",
"Unit {} is trying to release unit {} which is neither charmed nor owned by it",
GetEntry(), target->
GetEntry());
6653 return u->isPossessed();
6660 Player* player =
nullptr;
6684 std::vector<Unit*> nearMembers;
6690 Player* Target = itr.GetSource();
6693 nearMembers.push_back(Target);
6698 nearMembers.push_back(pet);
6701 if (nearMembers.empty())
6704 uint32 randTarget =
urand(0, nearMembers.size()-1);
6705 return nearMembers[randTarget];
6752 if (OldTotem->IsSummon())
6753 OldTotem->ToTempSummon()->UnSummon();
6771 spellHealLog.
Crit = critical;
6791 data.
Type = powertype;
6803 player->InterruptPowerRegen(powerType);
6806 int32 overEnergize = damage - gain;
6813 if (!spellProto || !victim)
6816 int32 DoneTotal = 0;
6817 float DoneTotalMod = 1.0f;
6819 auto callDamageScript = [&](
int32& dmg,
int32& flatMod,
float& pctMod)
6830 callDamageScript(pdamage, DoneTotal, DoneTotalMod);
6831 return int32(std::max(
float(pdamage + DoneTotal) * DoneTotalMod, 0.0f));
6837 return owner->SpellDamageBonusDone(victim, spellProto, pdamage, damagetype, spellEffectInfo, stack, spell, aurEff);
6849 DoneAdvertisedBenefit +=
static_cast<Guardian const*
>(
this)->GetBonusDamage();
6857 attackPowerCoeff *= 100.0f;
6859 attackPowerCoeff /= 100.0f;
6874 DoneTotal +=
int32(stack * attackPowerCoeff * attackPowerBonus);
6878 if (DoneAdvertisedBenefit)
6888 DoneTotal +=
int32(DoneAdvertisedBenefit * coeff * stack);
6891 callDamageScript(pdamage, DoneTotal, DoneTotalMod);
6893 float tmpDamage = float(pdamage + DoneTotal) * DoneTotalMod;
6899 return int32(std::max(tmpDamage, 0.0f));
6918 return owner->SpellDamagePctDone(victim, spellProto, damagetype, spellEffectInfo);
6921 float DoneTotalMod = 1.0f;
6931 float maxModDamagePercentSchool = 0.0f;
6936 maxModDamagePercentSchool = std::max(maxModDamagePercentSchool, thisPlayer->m_activePlayerData->ModDamageDonePercent[i]);
6941 DoneTotalMod *= maxModDamagePercentSchool;
6974 if (spellProto->
Id == 228598)
6976 DoneTotalMod *= 3.0f;
6982 AddPct(DoneTotalMod, 30 * count);
6985 if (spellProto->
Id == 198590)
6991 return DoneTotalMod;
6999 float TakenTotalMod = 1.0f;
7014 AddPct(TakenTotalMod, cheatDeath->GetAmount());
7055 if (damagetype ==
DOT)
7065 if (caster && TakenTotalMod < 1.0f)
7067 float damageReduction = 1.0f - TakenTotalMod;
7069 for (
AuraEffect const* aurEff : casterIgnoreResist)
7071 if (!(aurEff->GetMiscValue() & spellProto->
GetSchoolMask()))
7074 AddPct(damageReduction, -aurEff->GetAmount());
7077 TakenTotalMod = 1.0f - damageReduction;
7080 float tmpDamage = pdamage * TakenTotalMod;
7081 return int32(std::max(tmpDamage, 0.0f));
7090 if (overrideSP > 0.0f)
7106 for (
AuraEffect const* aurEff : mDamageDoneOfStatPercent)
7108 if ((aurEff->GetMiscValue() & schoolMask) != 0)
7111 Stats const usedStat =
static_cast<Stats>(aurEff->GetMiscValueB());
7118 return DoneAdvertisedBenefit;
7132 float crit_chance = 0.0f;
7138 auto getPhysicalCritChance = [&]
7143 auto getMagicCritChance = [&]
7146 return *thisPlayer->m_activePlayerData->SpellCritPercentage;
7152 crit_chance = std::max(crit_chance, getPhysicalCritChance());
7155 crit_chance = std::max(crit_chance, getMagicCritChance());
7172 return std::max(crit_chance, 0.0f);
7182 float crit_chance = doneChance;
7198 for (
AuraEffect const* aurEff : mOverrideClassScript)
7208 crit_chance *= 1.5f;
7210 crit_chance += eff->GetAmount();
7231 crit_chance -= levelDiff * 1.0f;
7266 return aurEff->
GetCasterGUID() == tempSummon->GetSummonerGUID();
7277 return std::max(crit_chance, 0.0f);
7283 int32 crit_bonus = damage * 2;
7284 float crit_mod = 0.0f;
7290 if (crit_bonus != 0)
7291 AddPct(crit_bonus, crit_mod);
7295 return aurEff->GetCasterGUID() == caster->GetGUID();
7298 crit_bonus -= damage;
7304 crit_bonus += damage;
7313 int32 crit_bonus = damage;
7320 damage += crit_bonus;
7333 return owner->SpellHealingBonusDone(victim, spellProto, healamount, damagetype, spellEffectInfo, stack, spell, aurEff);
7339 int32 DoneTotal = 0;
7345 for (
AuraEffect const* aurEff : mOverrideClassScript)
7368 DoneAdvertisedBenefit +=
static_cast<Guardian const*
>(
this)->GetBonusDamage();
7376 attackPowerCoeff *= 100.0f;
7378 attackPowerCoeff /= 100.0f;
7393 DoneTotal +=
int32(stack * attackPowerCoeff * attackPowerBonus);
7397 if (DoneAdvertisedBenefit)
7407 DoneTotal +=
int32(DoneAdvertisedBenefit * coeff * stack);
7412 switch (otherSpellEffect.ApplyAuraName)
7431 float heal = float(healamount + DoneTotal) * DoneTotalMod;
7437 return int32(std::max(heal, 0.0f));
7445 return owner->SpellHealingPctDone(victim, spellProto);
7463 float DoneTotalMod = 1.0f;
7468 float maxModDamagePercentSchool = 0.0f;
7471 maxModDamagePercentSchool = std::max(maxModDamagePercentSchool, thisPlayer->m_activePlayerData->ModHealingDonePercent[i]);
7473 DoneTotalMod *= maxModDamagePercentSchool;
7489 if (healingDonePctVsTargetHealth->IsAffectingSpell(spellProto))
7490 AddPct(DoneTotalMod,
CalculatePct(healingDonePctVsTargetHealth->GetAmount(), healthPctDiff));
7492 return DoneTotalMod;
7499 if (!allowPositive && !allowNegative)
7502 float TakenTotalMod = 1.0f;
7509 AddPct(TakenTotalMod, minval);
7511 if (damagetype ==
DOT)
7516 AddPct(TakenTotalMod, minval_hot);
7524 AddPct(TakenTotalMod, maxval);
7526 if (damagetype ==
DOT)
7531 AddPct(TakenTotalMod, maxval_hot);
7540 TakenTotalMod *= 1.2f;
7556 else if (!allowNegative)
7572 else if (!allowNegative)
7579 float heal = healamount * TakenTotalMod;
7580 return int32(std::max(heal, 0.0f));
7587 float overrideSP = thisPlayer->m_activePlayerData->OverrideSpellPowerByAPPercent;
7588 if (overrideSP > 0.0f)
7611 for (AuraEffectList::const_iterator i = mHealingDoneOfStatPercent.begin(); i != mHealingDoneOfStatPercent.end(); ++i)
7614 Stats usedStat =
Stats((*i)->GetSpellEffectInfo().MiscValue);
7618 return advertisedBenefit;
7630 return owner->SpellAbsorbBonusDone(victim, spellProto, absorbamount, spellEffectInfo, stack, aurEff);
7634 return absorbamount;
7636 int32 doneTotal = 0;
7643 doneAdvertisedBenefit +=
static_cast<Guardian const*
>(
this)->GetBonusDamage();
7650 attackPowerCoeff *= 100.0f;
7652 attackPowerCoeff /= 100.0f;
7667 doneTotal +=
int32(stack * attackPowerCoeff * attackPowerBonus);
7670 if (doneAdvertisedBenefit)
7681 doneTotal +=
int32(doneAdvertisedBenefit * coeff * stack);
7687 float absorbAmount = float(absorbamount + doneTotal) * doneTotalMod;
7689 return static_cast<int32>(std::round(absorbAmount));
7696 return owner->SpellAbsorbPctDone(victim, spellProto);
7698 float doneTotalMod = 1.f;
7705 return doneTotalMod;
7711 return absorbamount;
7713 int32 doneTotal = 0;
7714 float takenTotalMod = 1.f;
7718 float absorb = float(absorbamount + doneTotal) * takenTotalMod;
7720 return static_cast<int32>(std::round(absorb));
7731 if (!requireImmunityPurgesEffectAttribute)
7732 return range.
begin() != range.
end();
7734 return std::ranges::any_of(range, [](
uint32 immunitySpellId)
7746 if (hasImmunity(idList, spellInfo->
Id))
7755 if (hasImmunity(dispelList, dispel))
7763 if (hasImmunity(mechanicList, mechanic))
7767 bool immuneToAllEffects =
true;
7772 if (!spellEffectInfo.IsEffect() || !(effectMask & (1 << spellEffectInfo.EffectIndex)))
7776 immuneToAllEffects =
false;
7783 if (immuneToAllEffects)
7788 uint32 schoolImmunityMask = 0;
7790 for (
auto [auraSchoolImmunityMask, immunityAuraId] : schoolList)
7792 if ((auraSchoolImmunityMask & schoolMask) == 0)
7796 if (requireImmunityPurgesEffectAttribute)
7806 schoolImmunityMask |= auraSchoolImmunityMask;
7808 if ((schoolImmunityMask & schoolMask) == schoolMask)
7819 for (
auto itr = schoolList.begin(); itr != schoolList.end(); ++itr)
7829 for (
auto itr = damageList.begin(); itr != damageList.end(); ++itr)
7839 for (
auto itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
7840 mask |= (
UI64LIT(1) << itr->first);
7849 for (
auto itr = damageList.begin(); itr != damageList.end(); ++itr)
7862 if ((schoolImmunityMask & schoolMask) == schoolMask)
7867 if ((damageImmunityMask & schoolMask) == schoolMask)
7888 uint32 schoolImmunityMask = 0;
7889 for (
auto&& [immunitySchoolMask, immunityAuraId] : container)
7898 schoolImmunityMask |= immunitySchoolMask;
7902 return (schoolImmunityMask & schoolMask) == schoolMask;
7918 bool requireImmunityPurgesEffectAttribute )
const
7932 if (!requireImmunityPurgesEffectAttribute)
7933 return range.
begin() != range.
end();
7935 return std::ranges::any_of(range, [](
uint32 immunitySpellId)
7947 if (hasImmunity(effectList, spellEffectInfo.
Effect))
7953 if (hasImmunity(mechanicList, mechanic))
7962 if (hasImmunity(list, aura))
7971 if (!(immuneAuraApply->GetMiscValue() & spellInfo->
GetSchoolMask()))
7999 uint32 schoolImmunityMask = 0;
8000 for (
auto&& [immunitySchoolMask, immunityAuraId] : container)
8006 schoolImmunityMask |= immunitySchoolMask;
8010 return (schoolImmunityMask & schoolMask) == schoolMask;
8023 if (!pVictim || damage == 0)
8029 int32 DoneFlatBenefit = 0;
8062 float DoneTotalMod = 1.0f;
8072 float maxModDamagePercentSchool = 0.0f;
8076 if (schoolMask & (1 << i))
8077 maxModDamagePercentSchool = std::max(maxModDamagePercentSchool, thisPlayer->m_activePlayerData->ModDamageDonePercent[i]);
8082 DoneTotalMod *= maxModDamagePercentSchool;
8090 AddPct(DoneTotalMod, autoAttackDamage->GetAmount());
8114 else if (spellProto && spellProto->
Mechanic)
8122 float damageF = float(damage + DoneFlatBenefit) * DoneTotalMod;
8130 return int32(std::max(damageF, 0.0f));
8138 int32 TakenFlatBenefit = 0;
8148 if ((TakenFlatBenefit < 0) && (pdamage < -TakenFlatBenefit))
8152 float TakenTotalMod = 1.0f;
8188 if (damagetype ==
DOT)
8205 AddPct(TakenTotalMod, cheatDeath->GetAmount());
8221 if (TakenTotalMod < 1.0f)
8225 float damageReduction = 1.0f - TakenTotalMod;
8227 for (
AuraEffect const* aurEff : casterIgnoreResist)
8229 if (!(aurEff->GetMiscValue() & attackSchoolMask))
8232 AddPct(damageReduction, -aurEff->GetAmount());
8235 TakenTotalMod = 1.0f - damageReduction;
8238 float tmpDamage = float(pdamage + TakenFlatBenefit) * TakenTotalMod;
8239 return int32(std::max(tmpDamage, 0.0f));
8249 for (
auto itr = bounds.first; itr != bounds.second;)
8251 if (itr->second == spellId)
8281 return std::floor((WeaponSpeed * PPM) / 600.0f);
8301 player->SendOnCancelExpectedVehicleRideAura();
8344 player->EnablePetControlsOnDismount();
8345 player->ResummonPetTemporaryUnSummonedIfAny();
8346 player->ResummonBattlePetTemporaryUnSummonedIfAny();
8372 uint32 ridingSkill = 5000;
8374 bool isSubmerged =
false;
8375 bool isInWater =
false;
8386 mountFlags = areaTable->GetMountFlags();
8396 if (!mountCapability)
8399 if (ridingSkill < mountCapability->ReqRidingSkill)
8434 if (mountCapability->
ReqMapID != -1 &&
8453 return mountCapability;
8465 if (
uint32 mountType = spellShapeshiftForm->MountTypeID)
8472 aurEff->RecalculateAmount();
8473 if (!aurEff->GetAmountAsInt())
8474 aurEff->GetBase()->Remove();
8479 if (!
HasAura(capability->ModSpellAuraID))
8480 CastSpell(
this, capability->ModSpellAuraID, aurEff);
8526 std::list<CombatReference*> toEnd;
8529 toEnd.push_back(pair.second);
8532 toEnd.push_back(pair.second);
8549 std::list<CombatReference*> toEnd;
8552 toEnd.push_back(pair.second);
8555 toEnd.push_back(pair.second);
8608 int64 val = dVal + curHealth;
8617 if (val < maxHealth)
8620 gain = val - curHealth;
8622 else if (curHealth != maxHealth)
8625 gain = maxHealth - curHealth;
8635 player->GetSession()->SendPacket(packet.
Write());
8650 int64 val = dVal + curHealth;
8658 if (val < maxHealth)
8660 else if (curHealth != maxHealth)
8661 gain = maxHealth - curHealth;
8675 uint32 triggerSpell = effect->GetSpellEffectInfo().TriggerSpell;
8681 if (newVal < threshold || oldVal > threshold)
8685 if (newVal > threshold || oldVal < threshold)
8709 int32 val = dVal + curPower;
8720 SetPower(power, val, withPowerUpdate);
8721 gain = val - curPower;
8723 else if (curPower != maxPower)
8725 SetPower(power, maxPower, withPowerUpdate);
8726 gain = maxPower - curPower;
8746 if (ownerPlayer->IsGroupVisibleFor(seerPlayer))
8780 float main_speed_mod = 0.0f;
8781 float stack_bonus = 1.0f;
8782 float non_stack_bonus = 1.0f;
8822 float owner_speed_mod = 0.0f;
8827 main_speed_mod = std::max(main_speed_mod, owner_speed_mod);
8845 TC_LOG_ERROR(
"entities.unit",
"Unit::UpdateSpeed: Unsupported move type ({})", mtype);
8850 float speed = std::max(non_stack_bonus, stack_bonus);
8852 AddPct(speed, main_speed_mod);
8875 if (speed > max_speed)
8885 if (speed < minSpeed)
8897 if (creature->HasUnitTypeMask(
UNIT_MASK_MINION) && !creature->IsInCombat())
8905 if (speed < ownerSpeed || creature->
IsWithinDist3d(followed, 10.0f))
8920 float baseMinSpeed = 1.0f;
8924 float min_speed =
CalculatePct(baseMinSpeed, minSpeedMod);
8925 if (speed < min_speed)
8944 rate = std::max(rate, 0.01f);
8986 playerMover->GetSession()->SendPacket(selfpacket.
Write());
8992 playerMover->SendMessageToSet(packet.
Write(),
false);
9028 if (!flightCapabilityEntry)
9031 auto [opcode, newValue, rateAura] = [&]
9054 return std::tuple<OpcodeServer, float, AuraType>();
9081 selfpacket.
Speed = newValue;
9082 playerMover->GetSession()->SendPacket(selfpacket.
Write());
9089 if (!flightCapabilityEntry)
9092 auto [opcode, min, max, rateAura] = [&]
9105 return std::tuple<OpcodeServer, float, float, AuraType>();
9141 playerMover->GetSession()->SendPacket(selfpacket.
Write());
9208 zoneScript->OnUnitDeath(
this);
9258 if (!target->
IsEngaged() && !canInitialAggro)
9262 targetOwner->EngageWithTarget(
this);
9266 if (myPlayerOwner && targetPlayerOwner && !(myPlayerOwner->
duel && myPlayerOwner->
duel->Opponent == targetPlayerOwner))
9280 if (minion->IsInCombat())
9294 if (interactionAllowed)
9304 if (interactionAllowed)
9343 if (currentLevel < maxLevel)
9344 diminish.
hitCount = currentLevel + 1;
9359 if (limitDuration > 0 && duration > limitDuration)
9361 Unit const* target = targetOwner ? targetOwner :
this;
9362 WorldObject const* source = casterOwner ? casterOwner : caster;
9365 duration = limitDuration;
9424 duration =
int32(duration * mod);
9425 return (duration != 0);
9435 else if (diminish.
stack)
9440 if (!diminish.
stack)
9472 return (creatureType >= 1) ? (1 << (creatureType - 1)) : 0;
9480 return creature->GetCreatureTemplate()->type;
9506 bool isTravelShapeshiftForm = [form]()
9510 if (shapeInfo->MountTypeID)
9520 if (onlyTravelShapeshiftForm && !isTravelShapeshiftForm)
9526 SpellInfo const* spellInfo = aurEff->GetBase()->GetSpellInfo();
9528 aurEff->GetBase()->Remove(removeMode);
9590 TC_LOG_ERROR(
"entities.unit",
"ERROR in HandleStatFlatModifier(): non-existing UnitMods or wrong UnitModifierType!");
9597 switch (modifierType)
9615 TC_LOG_ERROR(
"entities.unit",
"ERROR in ApplyStatPctModifier(): non-existing UnitMods or wrong UnitModifierType!");
9622 switch (modifierType)
9657 TC_LOG_ERROR(
"entities.unit",
"attempt to access non-existing modifier value from UnitMods!");
9668 TC_LOG_ERROR(
"entities.unit",
"attempt to access non-existing modifier value from UnitMods!");
9733 ABORT_MSG(
"Not implemented UnitMod %u", unitMod);
9829 value += createStat;
9841 TC_LOG_ERROR(
"entities.unit",
"attempt to access non-existing UnitMods in GetTotalAuraModValue()!");
9900 float baseValue = value;
9918 ap += std::max<float>(
m_unitData->MainHandWeaponAttackPower,
m_unitData->RangedWeaponAttackPower);
9921 return ap * (1.0f +
m_unitData->RangedAttackPowerMultiplier);
9929 ap += std::max<float>(
m_unitData->MainHandWeaponAttackPower,
m_unitData->RangedWeaponAttackPower);
9938 return ap * (1.0f +
m_unitData->AttackPowerMultiplier);
9966 if (player->GetGroup())
9982 if (maxHealth < val)
9994 if (player->GetGroup())
9999 if (pet->isControlled())
10020 if (pet->isControlled())
10053 if (maxPower < val)
10064 packet.
Powers.emplace_back(val, power);
10073 if (player->GetGroup())
10104 if (val < cur_power)
10114 if (effect->GetMiscValue() == power)
10117 uint32 triggerSpell = effect->GetSpellEffectInfo().TriggerSpell;
10128 oldValueCheck =
GetPctOf(oldVal, maxPower);
10129 newValueCheck =
GetPctOf(newVal, maxPower);
10135 if (oldValueCheck >= effect->GetAmount() || newValueCheck < effectAmount)
10139 if (oldValueCheck <= effect->GetAmount() || newValueCheck > effectAmount)
10160 ai->UpdateAI(diff);
10167 i_AIs.emplace(newAI);
10178 if (!
i_AIs.empty())
10251 creature->SummonGraveyardTeleporter();
10287 if (owner->m_Controlled.find(
this) != owner->m_Controlled.end())
10289 TC_LOG_FATAL(
"entities.unit",
"Unit {} is in controlled list of {} when removed from world",
GetEntry(), owner->GetEntry());
10339 UnitAI* newAI =
nullptr;
10347 if (
CreatureAI* charmerAI = creatureCharmer->AI())
10348 newAI = charmerAI->GetAIForCharmedPlayer(
ToPlayer());
10375 ai->OnCharmed(
true);
10413 switch (missCondition)
10466 if (!damageNullified)
10532 aurasTriggeringProc.emplace_back(procEffectMask, aurApp);
10541 aurasTriggeringProc.emplace_back(0, aurApp);
10557 processAuraApplication(aurApp);
10564 processAuraApplication(itr->second);
10573 ProcEventInfo myProcEventInfo(
this, actionTarget, actionTarget, typeMaskActor, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo);
10582 if (modOwner !=
this && spell)
10585 for (
auto itr = modOwner->GetAppliedAuras().begin(); itr != modOwner->GetAppliedAuras().end(); ++itr)
10587 if (spell->
m_appliedMods.count(itr->second->GetBase()) != 0)
10588 modAuras.push_front(itr->second);
10590 modOwner->GetProcAurasTriggeredOnEvent(myAurasTriggeringProc, &modAuras, myProcEventInfo);
10596 ProcEventInfo targetProcEventInfo(
this, actionTarget,
this, typeMaskActionTarget, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo);
10598 if (typeMaskActionTarget && actionTarget)
10603 if (typeMaskActionTarget && actionTarget)
10610 bool const disableProcs = triggeringSpell && triggeringSpell->
IsProcDisabled();
10617 for (
auto const& [procEffectMask, aurApp] : aurasTriggeringProc)
10639 petActionFeedback.
SpellID = spellId;
10652 petActionSound.
Action = pettalk;
10701 movementGenerator->Pause(timer);
10713 movementGenerator->Resume(timer);
10785 displayScale = model->DisplayScale;
10808 if (!transforms.empty())
10811 for (
auto i = transforms.begin(); i != transforms.end(); ++i)
10817 if (!ignorePositiveAurasPreventingMounting)
10818 handledAura = (*i);
10821 handledAura = (*i);
10826 handledAura = (*i);
10842 else if (!shapeshiftAura.empty())
10905 std::list<Unit*> targets;
10915 targets.remove(exclude);
10918 for (std::list<Unit*>::iterator tIter = targets.begin(); tIter != targets.end();)
10920 if (!
IsWithinLOSInMap(*tIter) || (*tIter)->IsTotem() || (*tIter)->IsSpiritService() || (*tIter)->IsCritter())
10921 targets.erase(tIter++);
10927 if (targets.empty())
10963 var *= (apply ? (100.0f + val) / 100.0f : 100.0f / (100.0f + val));
11012 if (player->GetGroup())
11017 Pet* pet = ((
Pet*)
this);
11122 return !petInfo.has_value();
11125 if (freeActiveSlotItr == petStable.
ActivePets.end())
11135 TC_LOG_ERROR(
"entities.unit",
"Pet::InitStatsForLevel() failed for creature (Entry: {})!", pet->
GetEntry());
11164 TC_LOG_ERROR(
"entities.unit",
"Unit::PlayOneShotAnimKitId using invalid AnimKit ID: {}", animKitId);
11231 if (attacker && !attacker->
IsInMap(victim))
11232 attacker =
nullptr;
11235 Player* player =
nullptr;
11241 bool isRewardAllowed = attacker != victim;
11243 isRewardAllowed = isRewardAllowed && !creature->
GetTapList().empty();
11245 std::vector<Player*> tappers;
11246 if (isRewardAllowed && creature)
11250 tappers.push_back(tapper);
11253 isRewardAllowed =
false;
11258 isRewardAllowed =
false;
11262 if (isRewardAllowed)
11264 std::unordered_set<Group*> groups;
11265 for (
Player* tapper : tappers)
11267 if (
Group* tapperGroup = tapper->GetGroup())
11269 if (groups.insert(tapperGroup).second)
11272 partyKillLog.
Player = player && tapperGroup->IsMember(player->
GetGUID()) ? player->
GetGUID() : tapper->GetGUID();
11274 partyKillLog.
Write();
11276 tapperGroup->BroadcastPacket(partyKillLog.
GetRawPacket(), tapperGroup->GetMemberGroup(tapper->GetGUID()) != 0);
11279 tapperGroup->UpdateLooterGuid(creature,
true);
11285 partyKillLog.
Player = tapper->GetGUID();
11287 tapper->SendDirectMessage(partyKillLog.
Write());
11296 dungeonEncounter = instance->GetBossDungeonEncounter(creature);
11300 if (dungeonEncounter)
11306 else if (!tappers.empty())
11308 Group* group = !groups.empty() ? *groups.begin() :
nullptr;
11326 for (
Group* tapperGroup : groups)
11327 tapperGroup->UpdateLooterGuid(creature);
11332 for (
Player* tapper : tappers)
11336 if (dungeonEncounter)
11352 for (
Player* tapper : tappers)
11354 if (
Quest const* reward =
sObjectMgr->GetQuestTemplate(vignette->Data->RewardQuestID))
11357 if (vignette->Data->VisibleTrackingQuestID)
11358 tapper->SetRewardedQuest(vignette->Data->VisibleTrackingQuestID);
11366 if (attacker && (attacker->
IsPet() || attacker->
IsTotem()))
11377 for (
Player* tapper : tappers)
11378 if (tapper->IsAtGroupRewardDistance(victim))
11379 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);
11391 if (!skipSettingDeathState)
11400 for (
Player* tapper : tappers)
11402 Pet* pet = tapper->GetPet();
11417 plrVictim->SetPvPDeath(player !=
nullptr);
11424 TC_LOG_DEBUG(
"entities.unit",
"We are dead, losing {} percent durability", loss);
11426 plrVictim->DurabilityLossAll(baseLoss,
false);
11428 plrVictim->SendDurabilityLoss(plrVictim, loss);
11435 if (plrVictim->duel)
11437 plrVictim->duel->Opponent->CombatStopWithPets(
true);
11438 plrVictim->CombatStopWithPets(
true);
11447 if (!creature->
IsPet())
11469 ai->OnHealthDepleted(attacker,
true);
11470 ai->JustDied(attacker);
11475 if (
WorldObject * summoner = summon->GetSummoner())
11477 if (summoner->ToCreature() && summoner->ToCreature()->IsAIEnabled())
11478 summoner->ToCreature()->AI()->SummonedCreatureDies(creature, attacker);
11479 else if (summoner->ToGameObject() && summoner->ToGameObject()->AI())
11480 summoner->ToGameObject()->AI()->SummonedCreatureDies(creature, attacker);
11487 if (player && attacker != victim)
11490 pvp->HandleKill(player, victim);
11493 bf->HandleKill(player, victim);
11510 bg->HandleKillPlayer(playerVictim, player);
11513 bg->HandleKillUnit(victim->
ToCreature(), attacker);
11533 sScriptMgr->OnPVPKill(killerPlr, killedPlr);
11535 sScriptMgr->OnCreatureKill(killerPlr, killedCre);
11540 sScriptMgr->OnPlayerKilledByCreature(killerCre, killed);
11698 playerMover->SendDirectMessage(packet.
Write());
11718 Unit* caster =
nullptr;
11720 if (!fearAuras.empty())
11790 if (
this == charmer)
11865 if (player->isAFK())
11866 player->ToggleAFK();
11868 player->SetClientControl(
this,
false);
11939 ai->OnCharmed(
false);
12027 player->SetClientControl(
this,
true);
12042 charmedAI->OnCharmed(
false);
12080 m_vehicleKit = Trinity::make_unique_trackable<Vehicle>(
this, vehInfo, creatureEntry);
12095 if (!onRemoveFromWorld)
12126 return vehicleRoot;
12199 Group* group =
nullptr;
12209 Player* Target = itr.GetSource();
12215 TagUnitMap.push_back(Target);
12218 if (pet->IsAlive())
12219 TagUnitMap.push_back(pet);
12226 TagUnitMap.push_back(owner);
12228 if ((pet ==
this ||
IsInMap(pet)) && pet->IsAlive())
12229 TagUnitMap.push_back(pet);
12236 return entry->IsContestedGuardFaction();
12274 if (!(effMask & (1 << spellEffectInfo.EffectIndex)))
12278 effMask &= ~(1 << spellEffectInfo.EffectIndex);
12290 aura->ApplyForTargets();
12300 aura =
AddAura(spellId, target);
12347 playSpellVisualKit.
KitType = type;
12348 playSpellVisualKit.
Duration = duration;
12362 bool hasMissile =
false;
12369 if (spell->GetSpellInfo()->Id == spellId)
12371 itr.second->ScheduleAbort();
12385 packet.
Reverse = reverseMissile;
12401 Unit const* target =
nullptr;
12438 missChance += 19.0f;
12441 float resistMissChance = 100.0f;
12446 missChance -= resistMissChance - 100.0f;
12460 return std::max(missChance, 0.f);
12511 speedXY = -speedXY;
12512 o = o - float(
M_PI);
12515 float vcos = std::cos(o);
12516 float vsin = std::sin(o);
12524 return player->GetRatingBonusValue(cr);
12528 return owner->GetRatingBonusValue(cr);
12561 if (
Item* artifact = player->GetItemByGuid(artifactAura->GetCastItemGUID()))
12563 if (
ShapeshiftForm(artifactAppearance->OverrideShapeshiftFormID) == form)
12564 return artifactAppearance->OverrideShapeshiftDisplayID;
12568 bool useRandom =
false;
12584 std::vector<uint32> displayIds;
12585 displayIds.reserve(formModelData->Choices->size());
12587 for (std::size_t i = 0; i < formModelData->Choices->size(); ++i)
12594 displayIds.push_back(displayInfo->DisplayID);
12598 if (!displayIds.empty())
12603 if (
uint32 formChoice = player->GetCustomizationChoice(formModelData->OptionID))
12605 auto choiceItr = std::find_if(formModelData->Choices->begin(), formModelData->Choices->end(), [formChoice](
ChrCustomizationChoiceEntry const* choice)
12607 return choice->ID == formChoice;
12610 if (choiceItr != formModelData->Choices->end())
12612 return displayInfo->DisplayID;
12638 bool spellClickHandled =
false;
12642 auto clickBounds =
sObjectMgr->GetSpellClickInfoMapBounds(spellClickEntry);
12643 for (
auto const& clickPair : clickBounds)
12646 if (!clickPair.second.IsFitToRequirements(clicker,
this))
12650 if (!
sConditionMgr->IsObjectMeetingSpellClickConditions(spellClickEntry, clickPair.second.spellId, clicker,
this))
12653 spellClickHandled =
HandleSpellClick(clicker, seatId, clickPair.second.spellId,
flags, &clickPair.second);
12665 Unit* caster = clicker;
12666 Unit* target =
this;
12670 if (spellClickInfo)
12685 uint8 effectIndex = 0;
12686 bool hasControlVehicleAura =
false;
12691 hasControlVehicleAura =
true;
12699 if (!hasControlVehicleAura)
12701 if (!spellClickInfo)
12702 TC_LOG_ERROR(
"sql.sql",
"RideSpell {} specified in vehicle_accessory or vehicle_template_accessory is not a valid vehicle enter aura!", spellId);
12704 TC_LOG_ERROR(
"sql.sql",
"Spell {} specified in npc_spellclick_spells is not a valid vehicle enter aura!", spellId);
12713 castResult = caster->
CastSpell(target, spellId, args);
12717 std::array<SpellEffectValue, MAX_SPELL_EFFECTS> bp = { };
12719 bp[spellEffectInfo.EffectIndex] = spellEffectInfo.BasePoints;
12721 bp[effectIndex] = seatId;
12794 if (
CreatureGroup* creatureGroup = vehicleBaseCreature->GetFormation())
12819 for (AuraEffectList::const_iterator itr = vehicleAuras.begin(); itr != vehicleAuras.end(); ++itr)
12821 if ((*itr)->GetCasterGUID() !=
GetGUID())
12825 ASSERT(!rideVehicleEffect);
12826 rideVehicleEffect = *itr;
12830 ASSERT(rideVehicleEffect);
12868 TC_LOG_ERROR(
"entities.vehicle",
"RemovePassenger() couldn't remove current unit from vehicle. Debug info: {}",
GetDebugInfo());
12875 if (player && player->
duel && player->
duel->IsMounted)
12888 pos = *exitPosition;
12907 float height = pos.
GetPositionZ() + vehicleCollisionHeight;
12915 init.SetTransportExit();
12985 Unit* broadcastSource =
this;
12996 playerMover->SendDirectMessage(moveTeleport.
Write());
12998 broadcastSource = playerMover;
13032 TC_LOG_DEBUG(
"entities.unit",
"Unit::UpdatePosition({}, {}, {}) .. bad coordinates!", x, y, z);
13040 bool const relocated = (teleport ||
13054 for (
AuraEffect const* auraEffect : controlZoneAuras)
13074 return (relocated || turn);
13101 float addRage = baseRage;
13128 for (AttackerSet::const_iterator itr = attackers.begin(); itr != attackers.end();)
13130 if ((*itr)->GetFactionTemplateEntry()->Faction == faction_id)
13132 (*itr)->AttackStop();
13133 itr = attackers.begin();
13139 std::vector<CombatReference*> refsToEnd;
13141 if (pair.second->GetOther(
this)->GetFactionTemplateEntry()->Faction == faction_id)
13142 refsToEnd.push_back(pair.second);
13147 minion->StopAttackFaction(faction_id);
13159 std::ostringstream o;
13160 o <<
"Summon Slot: ";
13167 o <<
"Controlled List: ";
13169 o << (*itr)->GetGUID().ToString() <<
", ";
13173 o <<
"Aura List: ";
13175 o << itr->first <<
", ";
13181 o <<
"Passenger List: ";
13184 o << passenger->GetGUID().ToString() <<
", ";
13205 if (mask & (1 << i) && (!resist || *resist > schoolResistance))
13206 resist = schoolResistance;
13209 return resist.value_or(0);
13239 transport->GetPositionWithOffset({ stayPos.x, stayPos.y, stayPos.z }).GetPosition(stayPos.x, stayPos.y, stayPos.z);
13385 playerMover->SendDirectMessage(packet.
Write());
13486 playerMover->SendDirectMessage(packet.
Write());
13512 static OpcodeServer const waterWalkingOpcodeTable[2][2] =
13523 playerMover->SendDirectMessage(packet.
Write());
13550 static OpcodeServer const featherFallOpcodeTable[2][2] =
13561 playerMover->SendDirectMessage(packet.
Write());
13582 float hoverHeight =
m_unitData->HoverHeight;
13614 playerMover->SendDirectMessage(packet.
Write());
13660 static OpcodeServer const collisionOpcodeTable[2][2] =
13671 playerMover->SendDirectMessage(packet.
Write());
13697 static OpcodeServer const disableStrafingOpcodeTable[2] =
13708 playerMover->SendDirectMessage(packet.
Write());
13728 static OpcodeServer const disableJumpingOpcodeTable[2] =
13739 playerMover->SendDirectMessage(packet.
Write());
13759 static constexpr OpcodeServer fullSpeedTurningOpcodeTable[2] =
13770 playerMover->SendDirectMessage(packet.
Write());
13790 static constexpr OpcodeServer fullSpeedPitchingOpcodeTable[2] =
13801 playerMover->SendDirectMessage(packet.
Write());
13821 static constexpr OpcodeServer alwaysAllowPitchingOpcodeTable[2] =
13832 playerMover->SendDirectMessage(packet.
Write());
13855 static OpcodeServer const swimToFlyTransOpcodeTable[2] =
13866 playerMover->SendDirectMessage(packet.
Write());
13887 static OpcodeServer const canTurnWhileFallingOpcodeTable[2] =
13898 playerMover->SendDirectMessage(packet.
Write());
13929 playerMover->SendDirectMessage(packet.
Write());
13949 static OpcodeServer const disableInertiaOpcodeTable[2] =
13960 playerMover->SendDirectMessage(packet.
Write());
13991 playerMover->SendDirectMessage(packet.
Write());
14022 playerMover->SendDirectMessage(packet.
Write());
14040 player->SendDirectMessage(moveSetVehicleRec.
Write());
14071 applyMovementForce.
Force = &force;
14072 movingPlayer->SendDirectMessage(applyMovementForce.
Write());
14078 updateApplyMovementForce.
Force = &force;
14096 moveRemoveMovementForce.
ID = id;
14097 movingPlayer->SendDirectMessage(moveRemoveMovementForce.
Write());
14122 static OpcodeServer const ignoreMovementForcesOpcodeTable[2] =
14133 movingPlayer->SendDirectMessage(packet.
Write());
14152 setModMovementForceMagnitude.
Speed = modMagnitude;
14153 movingPlayer->SendDirectMessage(setModMovementForceMagnitude.
Write());
14154 ++movingPlayer->m_movementForceModMagnitudeChanges;
14160 updateModMovementForceMagnitude.
Speed = modMagnitude;
14202 displayScale = model->DisplayScale;
14206 hoverHeight = modelData->HoverHeight * modelData->ModelScale * displayInfo->CreatureModelScale * displayScale;
14254 for (SpellSpellGroupMap::const_iterator itr = spellGroup.first; itr != spellGroup.second ; ++itr)
14259 for (AuraEffectList::const_iterator auraItr = auraEffList.begin(); auraItr != auraEffList.end(); ++auraItr)
14261 if (aurEff != (*auraItr) && (!checkMiscValue || (*auraItr)->GetMiscValue() == miscValue) &&
14262 sSpellMgr->IsSpellMemberOfSpellGroup((*auraItr)->GetSpellInfo()->Id, itr->second))
14265 if (abs(val) < abs((*auraItr)->GetAmount()))
14266 val = (*auraItr)->GetAmount();
14286 for (Unit::AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end();)
14297 diff = std::popcount(auraEffectMask) - std::popcount(existingAurEff->
GetBase()->
GetEffectMask());
14304 if (removeOtherAuraApplications && (!base->
IsArea() || base->
GetOwner() !=
this))
14312 itr = auras.begin();
14363 return m_unitData->VirtualItems[slot].ItemID;
14371 return m_unitData->VirtualItems[slot].ItemAppearanceModID;
14389 TC_LOG_ERROR(
"entities.unit",
"WorldObject::MonsterText: `broadcast_text` (ID: {}) was not found", textId);
14422 TC_LOG_ERROR(
"entities.unit",
"WorldObject::Whisper: `broadcast_text` was not {} found", textId);
14435 clearBossEmotes.
Write();
14445 ref.GetSource()->SendDirectMessage(clearBossEmotes.
GetRawPacket());
14452 if (slot == spellId)
14467 auto findMatchingAuraEffectIn = [
this, spellInfo, &triggerFlag, context](
AuraType type) ->
SpellInfo const*
14471 bool matches = auraEffect->GetMiscValue() ?
uint32(auraEffect->GetMiscValue()) == spellInfo->
Id : auraEffect->IsAffectingSpell(spellInfo);
14472 if (matches && context->
AddSpell(auraEffect->GetAmountAsInt()))
14474 if (
SpellInfo const* newInfo =
sSpellMgr->GetSpellInfo(auraEffect->GetAmountAsInt(),
GetMap()->GetDifficultyID()))
14479 triggerFlag &= ~TRIGGERED_IGNORE_POWER_COST;
14484 triggerFlag &= ~TRIGGERED_IGNORE_SHAPESHIFT;
14496 triggerFlag &= ~TRIGGERED_IGNORE_CAST_TIME;
14512 for (
AuraEffect const* effect : visualOverrides)
14514 if (
uint32(effect->GetMiscValue()) == spellInfo->
Id)
14518 spellInfo = visualSpell;
14593 std::stringstream sstr;
14598 <<
" Class: " << std::to_string(
GetClass()) <<
"\n"
14605 size_t controlledCount = 0;
14609 sstr <<
"\n" <<
"m_Controlled " << controlledCount <<
" : " << controlled->GetGUID().ToString();
14618 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
#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_UNSUMMON_PET
@ TELE_TO_NOT_LEAVE_TRANSPORT
std::unordered_map< uint32, PlayerSpell > PlayerSpellMap
#define INVENTORY_SLOT_BAG_0
Trinity::IteratorPair< UF::ChrCustomizationChoice const * > MakeChrCustomizationChoiceRange(Container const &container)
uint32 urand(uint32 min, uint32 max)
bool roll_chance(T chance)
@ 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
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
@ SPELL_EFFECT_HEALTH_LEECH
@ SPELL_EFFECT_NORMALIZED_WEAPON_DMG
#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
@ 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
#define MAX_GAMEOBJECT_SLOT
@ 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_TOTAL_STAT_PERCENTAGE
@ 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_PERCENT_STAT
@ 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_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_BINARY_SPELL
@ 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
@ MOVEMENTFLAG_WATERWALKING
@ MOVEMENTFLAG_MASK_MOVING
@ MOVEMENTFLAG_DISABLE_GRAVITY
@ MOVEMENTFLAG_FALLING_SLOW
@ MOVEMENTFLAG_MASK_MOVING_FLY
@ MOVEMENTFLAG_FALLING_FAR
@ MOVEMENTFLAG_SPLINE_ELEVATION
@ MOVEMENTFLAG_DISABLE_COLLISION
@ MOVEMENTFLAG2_CAN_DOUBLE_JUMP
@ MOVEMENTFLAG2_CAN_SWIM_TO_FLY_TRANS
@ MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING
@ MOVEMENTFLAG2_CAN_TURN_WHILE_FALLING
@ MOVEMENTFLAG2_NO_STRAFE
@ MOVEMENTFLAG2_IGNORE_MOVEMENT_FORCES
@ MOVEMENTFLAG2_FULL_SPEED_PITCHING
@ MOVEMENTFLAG2_FULL_SPEED_TURNING
@ MOVEMENTFLAG2_NO_JUMPING
#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
@ MOVEMENTFLAG3_ADV_FLYING
@ MOVEMENTFLAG3_DISABLE_INERTIA
@ MOVEMENTFLAG3_CANNOT_SWIM
@ MOVEMENTFLAG3_CAN_ADV_FLY
#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]
@ BASE_PCT_EXCLUDE_CREATE
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
@ UNIT_MOD_ATTACK_POWER_RANGED
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
uint8 GetLevelForTarget(WorldObject const *target) const override
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)
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 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 MoveTo(Vector3 const &destination, bool generatePath=true, bool forceDestination=false)
void DisableTransportPathTransformations()
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)
bool TeleportTo(uint32 mapid, float x, float y, float z, float orientation, TeleportToOptions options=TELE_TO_NONE, Optional< uint32 > instanceId={}, uint32 teleportSpellId=0)
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
ProcEventInfo(Unit *actor, Unit *actionTarget, Unit *procTarget, ProcFlagsInit const &typeMask, ProcFlagsSpellType spellTypeMask, ProcFlagsSpellPhase spellPhaseMask, ProcFlagsHit hitMask, Spell *spell, DamageInfo *damageInfo, HealInfo *healInfo)
SpellSchoolMask GetSchoolMask() const
Spell const * GetProcSpell() const
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
bool HasEffect(SpellEffectName effect) 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 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 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)
bool IsProcDisabled() const
int32 GetCastTime() const
std::string GetDebugInfo() const
static void SendCastResult(Player *caster, SpellInfo const *spellInfo, SpellCastVisual spellVisual, ObjectGuid cast_count, SpellCastResult result, SpellCustomErrors customError=SPELL_CUSTOM_ERROR_NONE, int32 *param1=nullptr, int32 *param2=nullptr)
int32 GetProcChainLength() const
void CallScriptOnResistAbsorbCalculateHandlers(DamageInfo const &damageInfo, uint32 &resistAmount, int32 &absorbAmount)
CurrentSpellTypes GetCurrentContainer() const
void SendChannelUpdate(uint32 time, Optional< SpellCastResult > result={})
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)
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
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)
bool HasExtraUnitMovementFlag(uint32 f) const
void AIUpdateTick(uint32 diff)
virtual void RecalculateObjectScale()
void SetHealth(uint64 val)
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)
uint32 GetUnitMovementFlags() const
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
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 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
void AddExtraUnitMovementFlag(uint32 f)
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 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
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)
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 _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 AddExtraUnitMovementFlag2(uint32 f)
void RemoveAllGameObjects()
static void DealHeal(HealInfo &healInfo)
bool isPossessedByPlayer() const
std::multimap< uint32, AuraApplication * > AuraApplicationMap
void _RegisterDynObject(DynamicObject *dynObj)
void UpdateSpeed(UnitMoveType mtype)
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)
void RemoveExtraUnitMovementFlag(uint32 f)
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)
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
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)
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 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
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
void UpdateInterruptMask()
void StartReactiveTimer(ReactiveType reactive)
void IncrDiminishing(SpellInfo const *auraSpellInfo)
void CleanupsBeforeDelete(bool finalCleanup=true) override
void SetFacingToObject(WorldObject const *object, bool force=true)
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
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()
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
bool SetDisableGravity(bool disable, bool updateAnimTier=true)
void CancelSpellMissiles(uint32 spellId, bool reverseMissile=false, bool abortSpell=false)
void FollowerRemoved(AbstractFollower *f)
void RemoveAurasWithAttribute(uint32 flags)
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 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)
void AddUnitMovementFlag(uint32 f)
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
bool HasUnitMovementFlag(uint32 f) 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
void SendPetTalk(uint32 pettalk)
bool HasAuraType(AuraType auraType) const
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 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
void SendPetAIReaction(ObjectGuid guid)
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
uint32 GetExtraUnitMovementFlags() const
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
bool HasExtraUnitMovementFlag2(uint32 f) 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
void SetFacingTo(float const ori, bool force=true)
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
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 RemoveExtraUnitMovementFlag2(uint32 f)
std::array< float, MAX_STATS > m_createStats
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
void RemoveUnitMovementFlag(uint32 f)
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)
virtual bool CanSwim() const
virtual float GetNativeObjectScale() const
uint32 GetDoTsByCaster(ObjectGuid casterGUID) const
void RemoveFromWorld() override
void SendPetActionFeedback(PetActionFeedback msg, uint32 spellId)
-------—Pet responses methods--------------—
void AttackerStateUpdate(Unit *victim, WeaponAttackType attType=BASE_ATTACK, bool extra=false)
bool IsOnOceanFloor() 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 SendMeleeAttackStop(Unit *victim=nullptr)
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 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)
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
void RemoveAurasWithFamily(SpellFamilyNames family, flag128 const &familyFlag, ObjectGuid casterGUID)
void _ApplyAuraEffect(Aura *aura, uint8 effIndex)
void RemoveAllMinionsByEntry(uint32 entry)
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
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 InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true)
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 UpdateStatBuffMod(Stats stat)
virtual void ExitVehicle(Position const *exitPosition=nullptr)
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
virtual uint8 GetLevelForTarget(WorldObject const *) 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
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
uint32 SequenceIndex
Unit movement packet index, incremented each time.
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
MovementForce const * Force
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
::MovementForces::Container const * MovementForces
WorldPacket const * Write() override
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
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 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 VisitAllObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
static void VisitWorldObjects(WorldObject const *obj, T &visitor, float radius, bool dont_load=true)
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
void SetFallTime(uint32 fallTime)
void RemoveMovementFlag(uint32 flag)
struct MovementInfo::TransportInfo transport
bool HasMovementFlag(uint32 flag) const
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
UpdateFieldArray< std::string, 5, 0, 1 > Name
UpdateField< uint8, 64, 85 > SheatheState
UpdateField< uint32, 32, 51 > RangedAttackRoundBaseTime
UpdateFieldArray< int32, 10, 137, 138 > Power
UpdateField< float, 32, 58 > NativeXDisplayScale
UpdateFieldArray< int32, 10, 137, 148 > MaxPower
UpdateField< uint8, 32, 33 > CreatureType
DynamicUpdateField< int32, 0, 4 > WorldEffects
UpdateField< int32, 96, 125 > FlightCapabilityID
UpdateFieldArray< uint32, 2, 182, 183 > AttackRoundBaseTime
UpdateField< uint32, 128, 132 > CurrentAreaID
UpdateField< uint8, 64, 69 > AnimTier
DynamicUpdateField< ObjectGuid, 0, 5 > ChannelObjects
UpdateField< ObjectGuid, 0, 18 > SummonedBy
UpdateField< uint8, 64, 88 > ShapeshiftForm
UpdateField< int32, 32, 57 > NativeDisplayID
UpdateFieldArray< UF::VisibleItem, 3, 178, 179 > VirtualItems
UpdateField< uint8, 32, 34 > DisplayPower
UpdateField< ObjectGuid, 0, 17 > CharmedBy
UpdateField< float, 64, 77 > ModHaste
UpdateField< float, 64, 76 > ModSpellHaste
UpdateField< int32, 32, 38 > Level
UpdateField< uint32, 0, 8 > NpcFlags2
UpdateField< uint8, 64, 66 > StandState
UpdateField< float, 64, 78 > ModRangedHaste
UpdateField< int32, 0, 6 > DisplayID
UpdateField< int64, 32, 36 > Health
UpdateField< int64, 32, 37 > MaxHealth
UpdateFieldArray< int32, 5, 185, 191 > StatPosBuff
UpdateField< float, 64, 74 > ModCastingSpeed
UpdateField< float, 64, 79 > ModHasteRegen
UpdateField< float, 32, 54 > DisplayScale
UpdateField< ObjectGuid, 0, 14 > Charm
UpdateFieldArray< int32, 5, 185, 196 > StatNegBuff
UpdateField< uint32, 0, 7 > NpcFlags
UpdateField< uint32, 32, 50 > AuraState
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)