124 _aura(aura), _chance(dispelChance), _charges(dispelCharges)
136 : m_attacker(attacker), m_victim(victim), m_damage(damage), m_originalDamage(damage), m_spellInfo(spellInfo), m_schoolMask(schoolMask), m_damageType(damageType), m_attackType(attackType),
137 m_absorb(0), m_resist(0), m_block(0), m_hitMask(
PROC_HIT_NONE)
142 : m_attacker(dmgInfo.Attacker), m_victim(dmgInfo.Target), m_damage(dmgInfo.
Damage), m_originalDamage(dmgInfo.
Damage), m_spellInfo(nullptr), m_schoolMask(
SpellSchoolMask(dmgInfo.DamageSchoolMask)),
143 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)
184 if (!damageNullified)
188 if (!damageNullified)
195 : m_attacker(spellNonMeleeDamage.attacker), m_victim(spellNonMeleeDamage.target), m_damage(spellNonMeleeDamage.damage), m_originalDamage(spellNonMeleeDamage.originalDamage),
196 m_spellInfo(spellNonMeleeDamage.
Spell), m_schoolMask(
SpellSchoolMask(spellNonMeleeDamage.schoolMask)), m_damageType(damageType),
197 m_attackType(attackType), m_absorb(spellNonMeleeDamage.absorb), m_resist(spellNonMeleeDamage.resist), m_block(spellNonMeleeDamage.blocked), m_hitMask(hitMask)
199 if (spellNonMeleeDamage.
blocked)
201 if (spellNonMeleeDamage.
absorb)
250 : _healer(healer), _target(target), _heal(heal), _originalHeal(heal), _effectiveHeal(0), _absorb(0), _spellInfo(spellInfo), _schoolMask(schoolMask), _hitMask(0)
256 amount = std::min(amount,
GetHeal());
274 _actor(actor), _actionTarget(actionTarget), _procTarget(procTarget),
275 _typeMask(typeMask), _spellTypeMask(spellTypeMask),
276 _spellPhaseMask(spellPhaseMask), _hitMask(hitMask), _spell(spell),
277 _damageInfo(damageInfo), _healInfo(healInfo)
303 : target(_target), attacker(_attacker), castId(_castId),
Spell(_spellInfo), SpellVisual(spellVisual), damage(0), originalDamage(0),
304 schoolMask(_schoolMask), absorb(0), resist(0), periodicLog(false), blocked(0),
HitInfo(0), cleanDamage(0), fullBlock(false), preHitHealth(_target->GetHealth())
309 WorldObject(isWorldObject), m_lastSanctuaryTime(0), LastCharmerGUID(), movespline(
std::make_unique<
Movement::MoveSpline>()),
310 m_ControlledByPlayer(false), m_procDeep(0), m_procChainLength(0), m_transformSpell(0),
312 m_unitMovedByMe(nullptr), m_playerMovingMe(nullptr), m_charmer(nullptr), m_charmed(nullptr),
313 i_motionMaster(
std::make_unique<
MotionMaster>(this)), m_regenTimer(0), m_vehicle(nullptr),
314 m_unitTypeMask(
UNIT_MASK_NONE), m_Diminishing(), m_combatManager(this),
315 m_threatManager(this), m_aiLocked(false), _playHoverAnim(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);
621 transport->CalculatePassengerPosition(loc.x, loc.y, loc.z, &loc.
orientation);
672 float distsq = dx * dx + dy * dy + dz * dz;
675 float maxdist = dist2compare + sizefactor;
677 return distsq < maxdist * maxdist;
688 float distsq = dx*dx + dy*dy + dz*dz;
692 return distsq <= maxdist * maxdist;
708 return IsInDist(obj, objBoundaryRadius);
731 m_interruptMask |= aurApp->GetBase()->GetSpellInfo()->AuraInterruptFlags;
748 if (aura->GetSpellInfo()->SpellFamilyName == familyName && aura->GetSpellInfo()->SpellFamilyFlags & familyFlags)
756 for (AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
757 if ((!excludeAura || excludeAura != (*itr)->GetSpellInfo()->Id) &&
767 excludeAura = currentChanneledSpell->GetSpellInfo()->Id;
794 std::copy(list.begin(), list.end(), std::back_inserter(effects));
800 uint32 damageDone = damage;
801 uint32 damageTaken = damage;
807 uint32 tmpDamage = damageTaken;
811 tmpDamage = victimCreature->CalculateDamageForSparring(attacker, tmpDamage);
814 victimAI->DamageTaken(attacker, tmpDamage, damagetype, spellProto);
816 if (
UnitAI* attackerAI = attacker ? attacker->
GetAI() :
nullptr)
817 attackerAI->DamageDealt(victim, tmpDamage, damagetype);
820 sScriptMgr->OnDamage(attacker, victim, tmpDamage);
823 if (tmpDamage != damageTaken)
828 damageDone = tmpDamage;
830 damageTaken = tmpDamage;
835 if (attacker != victim && damagetype !=
DOT)
839 if (
CreatureAI* controlledAI = cControlled->AI())
840 controlledAI->OwnerAttackedBy(attacker);
868 for (
auto i = vCopyDamageCopy.begin(); i != vCopyDamageCopy.end(); ++i)
871 if (!((*i)->GetBase()->IsAppliedOnTarget(victim->
GetGUID())))
874 if (((*i)->GetMiscValue() & damageSchoolMask) == 0)
877 Unit* shareDamageTarget = (*i)->GetCaster();
878 if (!shareDamageTarget)
880 SpellInfo const* spell = (*i)->GetSpellInfo();
896 bool duel_hasEnded =
false;
897 bool duel_wasMounted =
false;
905 damageTaken = health - 1;
907 duel_hasEnded =
true;
911 damageTaken = health - 1;
917 victimAI->OnHealthDepleted(attacker,
false);
924 if (victimRider && victimRider->
duel && victimRider->
duel->IsMounted)
931 damageTaken = health - 1;
933 duel_wasMounted =
true;
934 duel_hasEnded =
true;
939 damageTaken = health - 1;
941 if (attacker && attacker != victim)
967 bool skipSettingDeathState =
false;
969 if (health <= damageTaken)
979 DamageInfo damageInfo =
DamageInfo(attacker, victim, damageTaken, spellProto, damageSchoolMask, damagetype,
981 for (
AuraEffect* absorbAurEff : vAbsorbOverkill)
983 Aura* base = absorbAurEff->GetBase();
988 if (!(absorbAurEff->GetMiscValue() & damageInfo.
GetSchoolMask()))
1000 bool deathFullyPrevented =
false;
1002 absorbAurEff->GetBase()->CallScriptEffectAbsorbHandlers(absorbAurEff, aurApp, damageInfo, currentAbsorb, deathFullyPrevented);
1005 currentAbsorb = std::min(currentAbsorb, damageInfo.
GetDamage());
1013 if (deathFullyPrevented)
1016 skipSettingDeathState =
true;
1026 absorbLog.
Absorbed = currentAbsorb;
1038 durabilityLoss =
false;
1041 Unit::Kill(attacker, victim, durabilityLoss, skipSettingDeathState);
1089 auto isCastInterrupted = [&]()
1103 auto isCastDelayed = [&]()
1117 if (isCastInterrupted())
1119 else if (isCastDelayed())
1124 if (damageTaken && victim->
IsPlayer())
1127 spell->DelayedChannel();
1138 if (duel_wasMounted)
1143 he->
duel->Opponent->CombatStopWithPets(
true);
1171 if (!victim || !victim->
IsAlive())
1194 uint32 crit_bonus = damage;
1198 damage += crit_bonus;
1203 if (critPctDamageMod != 0)
1204 AddPct(damage, critPctDamageMod);
1224 damage -= damageInfo->
blocked;
1259 damageInfo->
damage = damage;
1287 if (!damageInfo->
Spell)
1289 TC_LOG_DEBUG(
"entities.unit",
"Unit::DealSpellDamage has no spell");
1302 damageInfo->
Target = victim;
1370 damageInfo->
Damage = damage;
1451 float reducePercent = 1.f - leveldif * 0.1f;
1474 resilienceReduction = damageInfo->
Damage - resilienceReduction;
1475 damageInfo->
Damage -= resilienceReduction;
1518 float percent60 = 3.0f * percent20;
1519 if (offtime > percent20 && offtime <= percent60)
1521 else if (offtime > percent60)
1523 offtime -= 2.0f * percent20;
1530 float percent60 = 3.0f * percent20;
1531 if (basetime > percent20 && basetime <= percent60)
1533 else if (basetime > percent60)
1535 basetime -= 2.0f * percent20;
1551 float chance = 20.0f;
1560 chance *= attackerMeleeSkill / float(victimDefense) * 0.16f;
1580 for (
AuraEffect const* aurEff : vDamageShieldsCopy)
1582 SpellInfo const* spellInfo = aurEff->GetSpellInfo();
1599 uint32 damage = aurEff->GetAmount();
1600 if (
Unit* caster = aurEff->GetCaster())
1602 damage = caster->SpellDamageBonusDone(
this, spellInfo, damage,
SPELL_DIRECT_DAMAGE, aurEff->GetSpellEffectInfo());
1658 float armor = float(victim->
GetArmor());
1665 int32 armorBypassPct = 0;
1667 for (AuraEffectList::const_iterator i = reductionAuras.begin(); i != reductionAuras.end(); ++i)
1668 if ((*i)->GetCasterGUID() == attacker->
GetGUID())
1669 armorBypassPct += (*i)->GetAmount();
1670 armor =
CalculatePct(armor, 100 - std::min(armorBypassPct, 100));
1680 for (
AuraEffect const* aurEff : resIgnoreAuras)
1683 armor = std::floor(
AddPct(armor, -aurEff->GetAmount()));
1694 return aurEff->
GetSpellInfo()->IsItemFitToSpellRequirements(weapon);
1700 float maxArmorPen = 0.f;
1707 maxArmorPen = std::min((armor + maxArmorPen) / 3.f, armor);
1713 if (G3D::fuzzyLe(armor, 0.0f))
1726 if (!(armor + armorConstant))
1729 float mitigation = std::min(armor / (armor + armorConstant), 0.85f);
1730 return uint32(std::max(damage * (1.0f - mitigation), 0.0f));
1744 float discreteResistProbability[11] = { };
1745 if (averageResist <= 0.1f)
1747 discreteResistProbability[0] = 1.0f - 7.5f * averageResist;
1748 discreteResistProbability[1] = 5.0f * averageResist;
1749 discreteResistProbability[2] = 2.5f * averageResist;
1753 for (
uint32 i = 0; i < 11; ++i)
1754 discreteResistProbability[i] = std::max(0.5f - 2.5f * std::fabs(0.1f * i - averageResist), 0.0f);
1758 float probabilitySum = 0.0f;
1761 for (; resistance < 11; ++resistance)
1762 if (roll < (probabilitySum += discreteResistProbability[resistance]))
1765 float damageResisted = damage * resistance / 10.f;
1766 if (damageResisted > 0.0f)
1768 int32 ignoredResistance = 0;
1773 ignoredResistance = std::min<int32>(ignoredResistance, 100);
1774 ApplyPct(damageResisted, 100 - ignoredResistance);
1780 float armorReduction = damage - damageAfterArmor;
1783 damageResisted = std::min(damageResisted, armorReduction);
1787 damageResisted = std::max(damageResisted, 0.f);
1788 return uint32(damageResisted);
1793 float victimResistance = float(victim->
GetResistance(schoolMask));
1800 victimResistance -= float(player->GetSpellPenetrationItemMod());
1802 else if (
Unit const* unitCaster = caster->
ToUnit())
1808 victimResistance = 0.0f;
1812 victimResistance = 0.0f;
1814 victimResistance = std::max(victimResistance, 0.0f);
1821 static uint32 const bossLevel = 83;
1822 static float const bossResistanceConstant = 510.0f;
1824 float resistanceConstant = 0.0f;
1826 if (level == bossLevel)
1827 resistanceConstant = bossResistanceConstant;
1829 resistanceConstant = level * 5.0f;
1831 return victimResistance / (victimResistance + resistanceConstant);
1842 float auraAbsorbMod = 0.f;
1861 for (
auto itr = vSchoolAbsorbCopy.begin(); (itr != vSchoolAbsorbCopy.end()) && (damageInfo.
GetDamage() > 0); ++itr)
1874 if (currentAbsorb < 0)
1882 bool defaultPrevented =
false;
1885 currentAbsorb = tempAbsorb;
1887 if (!defaultPrevented)
1894 tempAbsorb = currentAbsorb;
1919 absorbLog.
Absorbed = currentAbsorb;
1928 for (
auto itr = vManaShieldCopy.begin(); (itr != vManaShieldCopy.end()) && (damageInfo.
GetDamage() > 0); ++itr)
1942 if (currentAbsorb < 0)
1948 uint32 tempAbsorb = currentAbsorb;
1950 bool defaultPrevented =
false;
1953 currentAbsorb = tempAbsorb;
1955 if (!defaultPrevented)
1960 int32 manaReduction = currentAbsorb;
1964 manaReduction =
int32(
float(manaReduction) * manaMultiplier);
1969 currentAbsorb = currentAbsorb ?
int32(
float(currentAbsorb) * (
float(manaTaken) /
float(manaReduction))) : 0;
1973 tempAbsorb = currentAbsorb;
1996 absorbLog.
Absorbed = currentAbsorb;
2009 for (
auto itr = vSplitDamagePctCopy.begin(); itr != vSplitDamagePctCopy.end() && damageInfo.
GetDamage() > 0; ++itr)
2021 Unit* caster = (*itr)->GetCaster();
2027 (*itr)->GetBase()->CallScriptEffectSplitHandlers((*itr), aurApp, damageInfo, splitDamage);
2047 if (victimCreature->ShouldFakeDamageFrom(damageInfo.
GetAttacker()))
2054 log.
damage = splitDamage;
2056 log.
absorb = split_absorb;
2071 for (
auto i = vHealAbsorb.begin(); i != vHealAbsorb.end() && healInfo.
GetHeal() > 0; ++i)
2084 if (currentAbsorb < 0)
2089 bool defaultPrevented =
false;
2092 currentAbsorb = tempAbsorb;
2094 if (!defaultPrevented)
2101 tempAbsorb = currentAbsorb;
2123 absorbLog.
Absorbed = currentAbsorb;
2167 if (!autoAttackError)
2182 attackerPlayer->SetAttackSwingError(autoAttackError);
2188 if (!autoAttackError)
2251 uint32 meleeAttackSpellId = 0;
2254 if (!meleeAttackOverrides.empty())
2255 meleeAttackSpellId = meleeAttackOverrides.front()->GetSpellEffectInfo().TriggerSpell;
2259 auto itr = std::find_if(meleeAttackOverrides.begin(), meleeAttackOverrides.end(), [&](
AuraEffect const* aurEff)
2261 return aurEff->GetSpellEffectInfo().MiscValue != 0;
2263 if (itr != meleeAttackOverrides.end())
2264 meleeAttackSpellId = (*itr)->GetSpellEffectInfo().MiscValue;
2267 if (!meleeAttackSpellId)
2277 if (victimCreature->ShouldFakeDamageFrom(damageInfo.
Attacker))
2300 TC_LOG_DEBUG(
"entities.unit",
"AttackerStateUpdate: {} attacked {} for {} dmg, absorbed {}, blocked {}, resisted {}.",
2305 CastSpell(victim, meleeAttackSpellId,
true);
2332 targetGUID = selection;
2360 int32 sum = 0, tmp = 0;
2376 canParryOrBlock =
false;
2381 if (tmp > 0 && roll < (sum += tmp))
2393 && roll < (sum += tmp))
2398 if (canParryOrBlock)
2402 && roll < (sum += tmp))
2410 attackerLevel + 3 < victimLevel)
2413 tmp = (10 + 10 * (victimLevel - attackerLevel)) * 100;
2414 if (tmp > 0 && roll < (sum += tmp))
2419 if (canParryOrBlock)
2423 && roll < (sum += tmp))
2429 if (tmp > 0 && roll < (sum += tmp))
2434 if (attackerLevel >= victimLevel + 4 &&
2440 tmp = attackerLevel - victimLevel * 1000 - 1500;
2441 if (roll < (sum += tmp))
2443 TC_LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: CRUSHING <{}, {})", sum-tmp, sum);
2454 float minDamage = 0.0f;
2455 float maxDamage = 0.0f;
2457 if (normalized || !addTotalPct)
2462 float minOffhandDamage = 0.0f;
2463 float maxOffhandDamage = 0.0f;
2465 minDamage += minOffhandDamage;
2466 maxDamage += maxOffhandDamage;
2495 minDamage = std::max(0.f, minDamage);
2496 maxDamage = std::max(0.f, maxDamage);
2498 if (minDamage > maxDamage)
2499 std::swap(minDamage, maxDamage);
2534 int32 resistMech = 0;
2537 if (!effect.IsEffect())
2544 if (resistMech < temp)
2549 return std::max(resistMech, 0);
2591 tmp += resist_chance;
2621 tmp += deflect_chance;
2650 if (!aurEff->IsAffectingSpell(spellInfo))
2653 switch (aurEff->GetMiscValue())
2665 TC_LOG_DEBUG(
"entities.unit",
"Spell {} SPELL_AURA_IGNORE_COMBAT_RESULT has unhandled state {}", aurEff->GetId(), aurEff->GetMiscValue());
2674 if (dodgeChance < 0)
2677 if (roll < (tmp += dodgeChance))
2685 if (parryChance < 0)
2696 if (blockChance < 0)
2711 float chance = 0.0f;
2712 float levelBonus = 0.0f;
2714 chance = playerVictim->m_activePlayerData->DodgePercentage;
2723 levelBonus = 1.5f * levelDiff;
2727 chance += levelBonus;
2740 return std::max(chance, 0.0f);
2747 float chance = 0.0f;
2748 float levelBonus = 0.0f;
2751 if (playerVictim->CanParry())
2755 tmpitem = playerVictim->GetWeaponForAttack(
OFF_ATTACK,
true);
2758 chance = playerVictim->m_activePlayerData->ParryPercentage;
2769 levelBonus = 1.5f * levelDiff;
2773 chance += levelBonus;
2780 return std::max(chance, 0.0f);
2785 float miss_chance = 5.0f;
2794 float chance = 0.0f;
2795 float levelBonus = 0.0f;
2798 if (playerVictim->CanBlock())
2802 chance = playerVictim->m_activePlayerData->BlockPercentage;
2813 levelBonus = 1.5f * levelDiff;
2817 chance += levelBonus;
2818 return std::max(chance, 0.0f);
2823 float chance = 0.0f;
2829 chance = thisPlayer->m_activePlayerData->CritPercentage;
2832 chance = thisPlayer->m_activePlayerData->OffhandCritPercentage;
2835 chance = thisPlayer->m_activePlayerData->RangedCritPercentage;
2858 float chance = critDone;
2878 return aurEff->
GetCasterGUID() == tempSummon->GetSummonerGUID();
2884 return std::max(chance, 0.0f);
2933 if (i->second->IsExpired())
2942 visibleAura->ClientUpdate();
2950 GameObjectList::iterator itr;
2953 if (!(*itr)->isSpawned())
2956 (*itr)->SetRespawnTime(0);
2975 if (autoRepeatSpellInfo->
Id != 75)
2987 if (autoRepeatSpellInfo->
Id != 75)
3177 return spell->GetCastTime();
3338 AuraEffect const* auraEff = foundAura->GetEffect(spellEffectInfo.EffectIndex);
3344 bp = *(createInfo.
BaseAmount + spellEffectInfo.EffectIndex);
3346 bp =
int32(spellEffectInfo.BasePoints);
3356 if (castItemGUID != foundAura->GetCastItemGUID())
3359 *oldGUID = castItemGUID;
3360 uint32* oldItemId =
const_cast<uint32*
>(&foundAura->m_castItemId);
3362 int32* oldItemLevel =
const_cast<int32*
>(&foundAura->m_castItemLevel);
3394 std::vector<Aura*> aurasSharingLimit;
3397 if (scAura->IsSingleTargetWith(aura))
3398 aurasSharingLimit.push_back(scAura);
3404 while (aurasSharingLimit.size() > maxOtherAuras)
3406 aurasSharingLimit.back()->Remove();
3407 aurasSharingLimit.pop_back();
3423 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());
3441 m_appliedAuras.insert(AuraApplicationMap::value_type(aurId, aurApp));
3482 uint32 aStateMask = (1 << (aState - 1));
3514 player->UpdateVisibleObjectInteractions(
false,
true,
false,
false);
3532 TC_LOG_DEBUG(
"spells",
"Aura {} now is remove mode {}", aura->
GetId(), removeMode);
3550 bool auraStateFound =
false;
3554 bool canBreak =
false;
3556 for (AuraStateAurasMap::iterator itr =
m_auraStateAuras.lower_bound(auraState); itr !=
m_auraStateAuras.upper_bound(auraState) && !(auraStateFound && canBreak);)
3558 if (itr->second == aurApp)
3565 auraStateFound =
true;
3593 if (!auraStateFound)
3598 uint32 aStateMask = (1 << (auraState - 1));
3609 player->UpdateVisibleObjectInteractions(
false,
true,
false,
false);
3625 for (AuraApplicationMap::iterator iter = range.first; iter != range.second;)
3627 if (iter->second == aurApp)
3676 Aura* aura = i->second;
3698 if (((itr->second->GetEffectMask() & reqEffMask) == reqEffMask) && (!casterGUID || itr->second->GetCasterGUID() == casterGUID))
3716 TC_LOG_ERROR(
"spells",
"Unit::RemoveOwnedAura() called with unallowed removeMode AURA_REMOVE_NONE, spellId {}", aura->
GetId());
3723 for (AuraMap::iterator itr = range.first; itr != range.second; ++itr)
3725 if (itr->second == aura)
3738 for (AuraMap::const_iterator itr = range.first; itr != range.second; ++itr)
3740 if (((itr->second->GetEffectMask() & reqEffMask) == reqEffMask)
3741 && (!casterGUID || itr->second->GetCasterGUID() == casterGUID)
3742 && (!itemCasterGUID || itr->second->GetCastItemGUID() == itemCasterGUID)
3743 && (!except || except != itr->second))
3767 for (AuraApplicationMap::iterator iter = range.first; iter != range.second;)
3769 Aura const* aura = iter->second->GetBase();
3804 for (AuraApplicationMap::iterator iter = range.first; iter != range.second;)
3806 if (aurApp == iter->second)
3828 if (check(iter->second))
3841 if (check(iter->second))
3854 if (check(iter->second))
3868 if (check(iter->second))
3880 for (AuraEffectList::iterator iter =
m_modAuras[auraType].begin(); iter !=
m_modAuras[auraType].end();)
3882 Aura* aura = (*iter)->GetBase();
3901 Aura const* aura = iter->second->GetBase();
3916 for (AuraMap::iterator iter = range.first; iter != range.second;)
3918 Aura* aura = iter->second;
3933 for (AuraMap::iterator iter = range.first; iter != range.second;)
3935 Aura* aura = iter->second;
3938 DispelInfo dispelInfo(dispeller, dispellerSpellId, chargesRemoved);
3961 for (AuraMap::iterator iter = range.first; iter != range.second;)
3963 Aura* aura = iter->second;
3969 uint32 recalculateMask = 0;
3979 recalculateMask |= 1 << i;
3997 oldAura->ModCharges(stolenCharges);
3999 oldAura->ModStackAmount(stolenCharges);
4000 oldAura->SetDuration(
int32(dur));
4016 if (newAura->IsSingleTarget())
4018 newAura->UnregisterSingleTarget();
4024 newAura->SetLoadedState(aura->
GetMaxDuration(),
int32(dur), stealCharge ? stolenCharges : aura->
GetCharges(), stolenCharges, recalculateMask, &damage[0]);
4025 newAura->ApplyForTargets();
4046 if (iter->second->GetBase()->GetCastItemGUID() == castItemGuid)
4058 for (AuraEffectList::iterator iter =
m_modAuras[auraType].begin(); iter !=
m_modAuras[auraType].end();)
4060 Aura* aura = (*iter)->GetBase();
4065 if (aura != except && (!casterGUID || aura->
GetCasterGUID() == casterGUID)
4080 SpellInfo const* spell = iter->second->GetBase()->GetSpellInfo();
4101 Aura const* aura = iter->second;
4122 for (AuraList::iterator iter = scAuras.begin(); iter != scAuras.end();)
4128 iter = scAuras.begin();
4135template<
typename InterruptFlag>
4150 if (interruptSource)
4169template <
typename InterruptFlags>
4178 Aura* aura = (*iter)->GetBase();
4181 && (!source || aura->
GetId() != source->
Id)
4194 && spell->GetSpellInfo()->HasChannelInterruptFlag(flag)
4195 && (!source || spell->GetSpellInfo()->
Id != source->
Id)
4209 Aura const* aura = iter->second->GetBase();
4233 std::vector<Aura*> aurasToUpdateTargets;
4237 if (exceptSpellId && aura->
GetId() == exceptSpellId)
4241 if (!(appliedMechanicMask & mechanicMaskToRemove))
4249 aurasToUpdateTargets.push_back(aura);
4253 for (
Aura* aura : aurasToUpdateTargets)
4255 aura->UpdateTargetMap(aura->GetCaster());
4258 if (!aura->IsPassive() && aura->GetOwner() ==
this && !aura->GetApplicationOfTarget(
GetGUID()))
4259 aura->Remove(removeMode);
4268 Aura const* aura = iter->second->GetBase();
4283 Aura* aura = iter->second;
4286 for (Aura::ApplicationMap::const_iterator itr = appMap.begin(); itr!= appMap.end();)
4302 if (iter->second->GetBase()->GetOwner() !=
this)
4317 AuraApplicationMap::iterator aurAppIter;
4321 AuraMap::iterator aurIter;
4325 const int maxIteration = 50;
4327 if (counter >= maxIteration)
4329 std::stringstream sstr;
4330 sstr <<
"Unit::RemoveAllAuras() iterated " << maxIteration <<
" times already but there are still "
4336 sstr <<
"m_appliedAuras:" <<
"\n";
4338 for (std::pair<uint32 const, AuraApplication*>& auraAppPair :
m_appliedAuras)
4339 sstr << auraAppPair.second->GetDebugInfo() <<
"\n";
4344 sstr <<
"m_ownedAuras:" <<
"\n";
4347 sstr << aura->GetDebugInfo() <<
"\n";
4379 auto evadeAuraCheck = [](
Aura const* aura)
4393 auto evadeAuraApplicationCheck = [&evadeAuraCheck](
AuraApplication const* aurApp)
4395 return evadeAuraCheck(aurApp->GetBase());
4408 Aura const* aura = iter->second->GetBase();
4417 Aura* aura = iter->second;
4429 Aura const* aura = iter->second->GetBase();
4438 Aura* aura = iter->second;
4450 Aura const* aura = iter->second->GetBase();
4459 Aura* aura = iter->second;
4471 Aura const* aura = iter->second->GetBase();
4480 Aura* aura = iter->second;
4492 Aura* aura = iter->second;
4505 for (; range.first != range.second; ++range.first)
4507 Aura* aura = range.first->second;
4536 for (AuraApplicationMap::const_iterator itr = range.first; itr != range.second; ++itr)
4538 if (itr->second->HasEffect(effIndex)
4539 && (!caster || itr->second->GetBase()->GetCasterGUID() == caster))
4541 return itr->second->GetBase()->GetEffect(effIndex);
4554 rankSpell =
sSpellMgr->GetNextSpellInChain(rankSpell);
4562 for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
4564 SpellInfo const* spell = (*i)->GetSpellInfo();
4567 if (!casterGUID.
IsEmpty() && (*i)->GetCasterGUID() != casterGUID)
4584 && (!except || except != app))
4596 if (predicate(pair.second))
4605 if (predicate(pair.second->GetBase()))
4613 for (AuraApplicationMap::value_type
const& pair :
m_appliedAuras)
4614 if (predicate(pair.second))
4622 for (AuraApplicationMap::value_type
const& pair :
m_appliedAuras)
4623 if (predicate(pair.second->GetBase()))
4632 return aurApp ? aurApp->
GetBase() :
nullptr;
4638 return aurApp ? aurApp->
GetBase() :
nullptr;
4644 return aurApp ? aurApp->
GetBase() :
nullptr;
4654 rankSpell =
sSpellMgr->GetNextSpellInChain(rankSpell);
4662 return aurApp ? aurApp->
GetBase() :
nullptr;
4668 for (
auto itr = auras.begin(); itr != auras.end(); ++itr)
4670 Aura* aura = itr->second;
4698 dispelList.emplace_back(aura, chance, charges);
4706 for (AuraApplicationMap::const_iterator itr = range.first; itr != range.second; ++itr)
4708 if (itr->second->HasEffect(effIndex)
4709 && (!caster || itr->second->GetBase()->GetCasterGUID() == caster))
4722 for (AuraApplicationMap::const_iterator itr = range.first; itr != range.second; ++itr)
4724 if (itr->second->GetBase()->GetStackAmount() == 0)
4727 count += (
uint32)itr->second->GetBase()->GetStackAmount();
4735 return GetAuraApplication(spellId, casterGUID, itemCasterGUID, reqEffMask) !=
nullptr;
4751 if (caster == eff->GetCasterGUID())
4759 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
4760 if (miscvalue == (*i)->GetMiscValue())
4768 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
4769 if ((*i)->IsAffectingSpell(affectedSpell))
4777 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
4778 if (value == (*i)->GetAmount())
4786 if (aura->GetSpellEffectInfo().TriggerSpell == triggerSpell)
4791template <
typename InterruptFlags>
4798 if (!(*iter)->IsPositive() && (*iter)->GetBase()->GetSpellInfo()->HasAuraInterruptFlag(flag) &&
4799 (!guid || (*iter)->GetBase()->GetCasterGUID() == guid))
4812 SpellInfo const* spellInfo = iter->second->GetBase()->GetSpellInfo();
4817 if (iter->second->HasEffect(spellEffectInfo.EffectIndex) && spellEffectInfo.IsEffect() && spellEffectInfo.Mechanic)
4818 if (mechanicMask & (
UI64LIT(1) << spellEffectInfo.Mechanic))
4831 SpellInfo const* spellInfo = itr->second->GetBase()->GetSpellInfo();
4838 if (newDuration > 0 && newDuration < existingDuration)
4848 for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
4850 if ((*i)->GetMiscValue() == script)
4851 if ((*i)->IsAffectingSpell(spell))
4859 static const AuraType diseaseAuraTypes[] =
4866 for (
AuraType aType : diseaseAuraTypes)
4872 && (*itr)->GetCasterGUID() == casterGUID)
4878 RemoveAura((*itr)->GetId(), (*itr)->GetCasterGUID());
4891 static const AuraType diseaseAuraTypes[] =
4902 for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
4905 if ((*i)->GetCasterGUID() == casterGUID)
4915 if (mTotalAuraList.empty())
4918 std::map<SpellGroup, int32> sameEffectSpellGroup;
4921 for (
AuraEffect const* aurEff : mTotalAuraList)
4923 if (predicate(aurEff))
4927 if (!
sSpellMgr->AddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(),
static_cast<uint32>(auraType), aurEff->GetAmount(), sameEffectSpellGroup))
4928 modifier += aurEff->GetAmount();
4933 for (
auto itr = sameEffectSpellGroup.begin(); itr != sameEffectSpellGroup.end(); ++itr)
4934 modifier += itr->second;
4942 if (mTotalAuraList.empty())
4945 std::map<SpellGroup, int32> sameEffectSpellGroup;
4946 float multiplier = 1.0f;
4948 for (
AuraEffect const* aurEff : mTotalAuraList)
4950 if (predicate(aurEff))
4954 if (!
sSpellMgr->AddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(),
static_cast<uint32>(auraType), aurEff->GetAmount(), sameEffectSpellGroup))
4955 AddPct(multiplier, aurEff->GetAmount());
4960 for (
auto itr = sameEffectSpellGroup.begin(); itr != sameEffectSpellGroup.end(); ++itr)
4961 AddPct(multiplier, itr->second);
4969 if (mTotalAuraList.empty())
4973 for (
AuraEffect const* aurEff : mTotalAuraList)
4975 if (predicate(aurEff))
4976 modifier = std::max(modifier, aurEff->GetAmount());
4985 if (mTotalAuraList.empty())
4989 for (
AuraEffect const* aurEff : mTotalAuraList)
4991 if (predicate(aurEff))
4992 modifier = std::min(modifier, aurEff->GetAmount());
5042 if (except != aurEff && (aurEff->
GetMiscValue() & miscMask) != 0)
5150 float modPos = 0.0f;
5151 float modNeg = 0.0f;
5152 float factor = 0.0f;
5165 modValue =
static_cast<Guardian*
>(
this)->GetBonusStatFromOwner(stat);
5235 std::vector<DynamicObject*> dynamicobjects =
GetDynObjects(spellId);
5236 return dynamicobjects.empty() ? nullptr : dynamicobjects.front();
5241 std::vector<DynamicObject*> dynamicobjects;
5242 for (DynObjectList::const_iterator i =
m_dynObj.begin(); i !=
m_dynObj.end(); ++i)
5243 if ((*i)->GetSpellId() == spellId)
5244 dynamicobjects.push_back(*i);
5246 return dynamicobjects;
5273 return gameobjects.empty() ? nullptr : gameobjects.front();
5278 std::vector<GameObject*> gameobjects;
5279 for (GameObjectList::const_iterator i =
m_gameObj.begin(); i !=
m_gameObj.end(); ++i)
5280 if ((*i)->GetSpellId() == spellId)
5281 gameobjects.push_back(*i);
5351 GameObjectList::iterator i, next;
5355 if (spellid == 0 || (*i)->GetSpellId() == spellid)
5360 (*i)->SetRespawnTime(0);
5376 GameObjectList::iterator i =
m_gameObj.begin();
5378 (*i)->SetRespawnTime(0);
5401 return areaTriggers.empty() ? nullptr : areaTriggers.front();
5406 std::vector<AreaTrigger*> areaTriggers;
5408 if ((*i)->GetSpellId() == spellId)
5409 areaTriggers.push_back(*i);
5411 return areaTriggers;
5433 if (areaTrigger->GetAuraEffect() == aurEff)
5435 areaTrigger->Remove();
5480 static constexpr int32 ProcChainHardLimit = 10;
5483 TC_LOG_ERROR(
"spells.aura.effect",
"Unit::ProcSkillsAndAuras: Possible infinite proc loop detected, current triggering spell {}", spell->
GetDebugInfo().c_str());
5505 actor->
TriggerAurasProcOnEvent(
nullptr,
nullptr, actionTarget, typeMaskActor, typeMaskActionTarget, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo);
5533 data.
Effects.push_back(spellLogEffect);
5552 spellOrDamageImmune.
SpellID = spellId;
5566 packet.
OverDamage = (overkill < 0 ? -1 : overkill);
5594 dmgInfo.
Damage =
Damage - AbsorbDamage - Resist - BlockedAmount;
5597 dmgInfo.
Absorb = AbsorbDamage;
5600 dmgInfo.
Blocked = BlockedAmount;
5611 if (!powerTypeEntry)
5648 if (thisPlayer->GetGroup())
5661 if (!powerTypeEntry)
5690 if (!powerTypeAuras.empty())
5692 AuraEffect const* powerTypeAura = powerTypeAuras.front();
5704 displayPower =
Powers(powerDisplay->ActualType);
5713 return displayPower;
5763 if (!victim || victim ==
this)
5865 if (
CreatureAI* controlledAI = cControlled->AI())
5866 controlledAI->OwnerAttacked(victim);
5892 creature->SetNoCallAssistance(
false);
5905 for (
Unit* attacker : attackers)
5907 toRemove.push_back(attacker);
5909 for (
Unit* attacker : toRemove)
5928 std::vector<Unit*> attackersToRemove;
5932 for (
Unit* attacker : attackersToRemove)
5951 minion->CombatStop(includingCast);
5960 if ((*itr)->isAttackingPlayer())
5966 if (summon->isAttackingPlayer())
5977 if (!(*iter)->AttackStop())
5979 TC_LOG_ERROR(
"entities.unit",
"WORLD: Unit has an attacker that isn't attacking it!");
5987 uint32 mask = 1 << (flag - 1);
5996 for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr)
6001 if (!spellInfo || !spellInfo->
IsPassive())
6009 for (PetSpellMap::const_iterator itr = pet->m_spells.begin(); itr != pet->m_spells.end(); ++itr)
6014 if (!spellInfo || !spellInfo->
IsPassive())
6029 for (Unit::AuraApplicationMap::iterator itr = tAuras.begin(); itr != tAuras.end();)
6031 SpellInfo const* spellProto = itr->second->GetBase()->GetSpellInfo();
6046 if (itr->second->GetBase()->GetCasterGUID() == target->
GetGUID())
6047 auraStates |= (1 << (itr->first - 1));
6067 for (AuraStateAurasMap::const_iterator itr = range.first; itr != range.second; ++itr)
6068 if (itr->second->GetBase()->GetCasterGUID() ==
Caster->GetGUID())
6074 return (*
m_unitData->AuraState & (1 << (flag - 1))) != 0;
6114 return master->GetControllingPlayer();
6130 TC_LOG_ERROR(
"entities.unit",
"Unit::GetFirstMinion: Minion {} not exist.", pet_guid.
ToString());
6146 TC_LOG_FATAL(
"entities.unit",
"Unit::GetGuardianPet: Guardian {} not exist.", pet_guid.
ToString());
6186 if (oldPet != minion && (oldPet->IsPet() || minion->
IsPet() || oldPet->GetEntry() != minion->
GetEntry()))
6189 if (
Pet* oldPetAsPet = oldPet->
ToPet())
6218 if (
BattlePets::BattlePet const* pet = thisPlayer->GetSession()->GetBattlePetMgr()->GetPet(thisPlayer->GetSummonedBattlePetGUID()))
6224 if (
uint32 display = pet->PacketInfo.DisplayID)
6294 if (
GetGUID() == (*itr)->GetCharmerGUID())
6298 if ((*itr)->GetOwnerGUID() !=
GetGUID())
6301 (*itr)->OutDebugInfo();
6313 if ((*itr)->IsPet())
6438 victimAI->HealReceived(healer, addhealth);
6440 if (
UnitAI* healerAI = healer ? healer->
GetAI() :
nullptr)
6441 healerAI->HealDone(victim, addhealth);
6449 Unit* unit = healer;
6491 for (AuraEffectList::const_iterator i = interceptAuras.begin(); i != interceptAuras.end(); ++i)
6493 if (
Unit* magnet = (*i)->GetBase()->GetCaster())
6534 TC_LOG_ERROR(
"entities.unit",
"Unit {} is trying to release unit {} which is neither charmed nor owned by it",
GetEntry(), target->
GetEntry());
6559 return u->isPossessed();
6566 Player* player =
nullptr;
6590 std::vector<Unit*> nearMembers;
6595 if (
Player* Target = itr->GetSource())
6599 nearMembers.push_back(Target);
6604 nearMembers.push_back(pet);
6607 if (nearMembers.empty())
6610 uint32 randTarget =
urand(0, nearMembers.size()-1);
6611 return nearMembers[randTarget];
6658 if (OldTotem->IsSummon())
6659 OldTotem->ToTempSummon()->UnSummon();
6677 spellHealLog.
Crit = critical;
6697 data.
Type = powertype;
6709 player->InterruptPowerRegen(powerType);
6712 int32 overEnergize = damage - gain;
6719 if (!spellProto || !victim)
6722 int32 DoneTotal = 0;
6723 float DoneTotalMod = 1.0f;
6725 auto callDamageScript = [&](
int32& dmg,
int32& flatMod,
float& pctMod)
6736 callDamageScript(pdamage, DoneTotal, DoneTotalMod);
6737 return int32(std::max(
float(pdamage + DoneTotal) * DoneTotalMod, 0.0f));
6743 return owner->SpellDamageBonusDone(victim, spellProto, pdamage, damagetype, spellEffectInfo, stack, spell, aurEff);
6755 DoneAdvertisedBenefit +=
static_cast<Guardian const*
>(
this)->GetBonusDamage();
6763 ApCoeffMod *= 100.0f;
6765 ApCoeffMod /= 100.0f;
6780 DoneTotal +=
int32(stack * ApCoeffMod * APbonus);
6784 if (DoneAdvertisedBenefit)
6794 DoneTotal +=
int32(DoneAdvertisedBenefit * coeff * stack);
6797 callDamageScript(pdamage, DoneTotal, DoneTotalMod);
6799 float tmpDamage = float(pdamage + DoneTotal) * DoneTotalMod;
6805 return int32(std::max(tmpDamage, 0.0f));
6824 return owner->SpellDamagePctDone(victim, spellProto, damagetype, spellEffectInfo);
6827 float DoneTotalMod = 1.0f;
6837 float maxModDamagePercentSchool = 0.0f;
6842 maxModDamagePercentSchool = std::max(maxModDamagePercentSchool, thisPlayer->m_activePlayerData->ModDamageDonePercent[i]);
6847 DoneTotalMod *= maxModDamagePercentSchool;
6880 if (spellProto->
Id == 228598)
6882 DoneTotalMod *= 3.0f;
6888 AddPct(DoneTotalMod, 30 * count);
6891 if (spellProto->
Id == 198590)
6897 return DoneTotalMod;
6905 float TakenTotalMod = 1.0f;
6920 AddPct(TakenTotalMod, cheatDeath->GetAmount());
6961 if (damagetype ==
DOT)
6971 if (caster && TakenTotalMod < 1.0f)
6973 float damageReduction = 1.0f - TakenTotalMod;
6975 for (
AuraEffect const* aurEff : casterIgnoreResist)
6977 if (!(aurEff->GetMiscValue() & spellProto->
GetSchoolMask()))
6980 AddPct(damageReduction, -aurEff->GetAmount());
6983 TakenTotalMod = 1.0f - damageReduction;
6986 float tmpDamage = pdamage * TakenTotalMod;
6987 return int32(std::max(tmpDamage, 0.0f));
6994 float overrideSP = thisPlayer->m_activePlayerData->OverrideSpellPowerByAPPercent;
6995 if (overrideSP > 0.0f)
7012 for (
AuraEffect const* aurEff : mDamageDoneOfStatPercent)
7014 if ((aurEff->GetMiscValue() & schoolMask) != 0)
7017 Stats const usedStat =
static_cast<Stats>(aurEff->GetMiscValueB());
7024 return DoneAdvertisedBenefit;
7038 float crit_chance = 0.0f;
7044 auto getPhysicalCritChance = [&]
7049 auto getMagicCritChance = [&]
7052 return *thisPlayer->m_activePlayerData->SpellCritPercentage;
7058 crit_chance = std::max(crit_chance, getPhysicalCritChance());
7061 crit_chance = std::max(crit_chance, getMagicCritChance());
7078 return std::max(crit_chance, 0.0f);
7088 float crit_chance = doneChance;
7104 for (
AuraEffect const* aurEff : mOverrideClassScript)
7114 crit_chance *= 1.5f;
7116 crit_chance += eff->GetAmount();
7137 crit_chance -= levelDiff * 1.0f;
7172 return aurEff->
GetCasterGUID() == tempSummon->GetSummonerGUID();
7183 return std::max(crit_chance, 0.0f);
7189 int32 crit_bonus = damage * 2;
7190 float crit_mod = 0.0f;
7196 if (crit_bonus != 0)
7197 AddPct(crit_bonus, crit_mod);
7201 return aurEff->GetCasterGUID() == caster->GetGUID();
7204 crit_bonus -= damage;
7210 crit_bonus += damage;
7219 int32 crit_bonus = damage;
7226 damage += crit_bonus;
7239 return owner->SpellHealingBonusDone(victim, spellProto, healamount, damagetype, spellEffectInfo, stack, spell, aurEff);
7245 int32 DoneTotal = 0;
7251 for (
AuraEffect const* aurEff : mOverrideClassScript)
7274 DoneAdvertisedBenefit +=
static_cast<Guardian const*
>(
this)->GetBonusDamage();
7287 if (DoneAdvertisedBenefit)
7297 DoneTotal +=
int32(DoneAdvertisedBenefit * coeff * stack);
7302 switch (otherSpellEffect.ApplyAuraName)
7321 float heal = float(healamount + DoneTotal) * DoneTotalMod;
7327 return int32(std::max(heal, 0.0f));
7335 return owner->SpellHealingPctDone(victim, spellProto);
7353 float DoneTotalMod = 1.0f;
7358 float maxModDamagePercentSchool = 0.0f;
7361 maxModDamagePercentSchool = std::max(maxModDamagePercentSchool, thisPlayer->m_activePlayerData->ModHealingDonePercent[i]);
7363 DoneTotalMod *= maxModDamagePercentSchool;
7379 if (healingDonePctVsTargetHealth->IsAffectingSpell(spellProto))
7380 AddPct(DoneTotalMod,
CalculatePct(
float(healingDonePctVsTargetHealth->GetAmount()), healthPctDiff));
7382 return DoneTotalMod;
7389 if (!allowPositive && !allowNegative)
7392 float TakenTotalMod = 1.0f;
7399 AddPct(TakenTotalMod, minval);
7401 if (damagetype ==
DOT)
7406 AddPct(TakenTotalMod, minval_hot);
7414 AddPct(TakenTotalMod, maxval);
7416 if (damagetype ==
DOT)
7421 AddPct(TakenTotalMod, maxval_hot);
7430 TakenTotalMod *= 1.2f;
7446 else if (!allowNegative)
7462 else if (!allowNegative)
7469 float heal = healamount * TakenTotalMod;
7470 return int32(std::max(heal, 0.0f));
7477 float overrideSP = thisPlayer->m_activePlayerData->OverrideSpellPowerByAPPercent;
7478 if (overrideSP > 0.0f)
7501 for (AuraEffectList::const_iterator i = mHealingDoneOfStatPercent.begin(); i != mHealingDoneOfStatPercent.end(); ++i)
7504 Stats usedStat =
Stats((*i)->GetSpellEffectInfo().MiscValue);
7508 return advertisedBenefit;
7519 if (!requireImmunityPurgesEffectAttribute)
7520 return range.
begin() != range.
end();
7522 return std::any_of(range.
begin(), range.
end(), [](SpellImmuneContainer::value_type
const& entry)
7524 if (SpellInfo const* immunitySourceSpell = sSpellMgr->GetSpellInfo(entry.second, DIFFICULTY_NONE))
7525 if (immunitySourceSpell->HasAttribute(SPELL_ATTR1_IMMUNITY_PURGES_EFFECT))
7534 if (hasImmunity(idList, spellInfo->
Id))
7543 if (hasImmunity(dispelList, dispel))
7551 if (hasImmunity(mechanicList, mechanic))
7555 bool immuneToAllEffects =
true;
7560 if (!spellEffectInfo.IsEffect())
7564 immuneToAllEffects =
false;
7571 if (immuneToAllEffects)
7576 uint32 schoolImmunityMask = 0;
7578 for (
auto itr = schoolList.begin(); itr != schoolList.end(); ++itr)
7580 if ((itr->first & schoolMask) == 0)
7584 if (requireImmunityPurgesEffectAttribute)
7594 schoolImmunityMask |= itr->first;
7596 if ((schoolImmunityMask & schoolMask) == schoolMask)
7607 for (
auto itr = schoolList.begin(); itr != schoolList.end(); ++itr)
7617 for (
auto itr = damageList.begin(); itr != damageList.end(); ++itr)
7627 for (
auto itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
7628 mask |= (
UI64LIT(1) << itr->first);
7637 for (
auto itr = damageList.begin(); itr != damageList.end(); ++itr)
7650 if ((schoolImmunityMask & schoolMask) == schoolMask)
7655 if ((damageImmunityMask & schoolMask) == schoolMask)
7676 uint32 schoolImmunityMask = 0;
7677 for (
auto&& [immunitySchoolMask, immunityAuraId] : container)
7686 schoolImmunityMask |= immunitySchoolMask;
7690 return (schoolImmunityMask & schoolMask) == schoolMask;
7706 bool requireImmunityPurgesEffectAttribute )
const
7720 if (!requireImmunityPurgesEffectAttribute)
7721 return range.
begin() != range.
end();
7723 return std::any_of(range.
begin(), range.
end(), [](SpellImmuneContainer::value_type
const& entry)
7725 if (SpellInfo const* immunitySourceSpell = sSpellMgr->GetSpellInfo(entry.second, DIFFICULTY_NONE))
7726 if (immunitySourceSpell->HasAttribute(SPELL_ATTR1_IMMUNITY_PURGES_EFFECT))
7735 if (hasImmunity(effectList, spellEffectInfo.
Effect))
7741 if (hasImmunity(mechanicList, mechanic))
7750 if (hasImmunity(list, aura))
7759 if (!(immuneAuraApply->GetMiscValue() & spellInfo->
GetSchoolMask()))
7786 uint32 schoolImmunityMask = 0;
7787 for (
auto&& [immunitySchoolMask, immunityAuraId] : container)
7793 schoolImmunityMask |= immunitySchoolMask;
7797 return (schoolImmunityMask & schoolMask) == schoolMask;
7810 if (!pVictim || damage == 0)
7816 int32 DoneFlatBenefit = 0;
7849 float DoneTotalMod = 1.0f;
7859 float maxModDamagePercentSchool = 0.0f;
7863 if (schoolMask & (1 << i))
7864 maxModDamagePercentSchool = std::max(maxModDamagePercentSchool, thisPlayer->m_activePlayerData->ModDamageDonePercent[i]);
7869 DoneTotalMod *= maxModDamagePercentSchool;
7877 AddPct(DoneTotalMod, autoAttackDamage->GetAmount());
7901 else if (spellProto && spellProto->
Mechanic)
7909 float damageF = float(damage + DoneFlatBenefit) * DoneTotalMod;
7917 return int32(std::max(damageF, 0.0f));
7925 int32 TakenFlatBenefit = 0;
7935 if ((TakenFlatBenefit < 0) && (pdamage < -TakenFlatBenefit))
7939 float TakenTotalMod = 1.0f;
7975 if (damagetype ==
DOT)
7992 AddPct(TakenTotalMod, cheatDeath->GetAmount());
8008 if (TakenTotalMod < 1.0f)
8012 float damageReduction = 1.0f - TakenTotalMod;
8014 for (
AuraEffect const* aurEff : casterIgnoreResist)
8016 if (!(aurEff->GetMiscValue() & attackSchoolMask))
8019 AddPct(damageReduction, -aurEff->GetAmount());
8022 TakenTotalMod = 1.0f - damageReduction;
8025 float tmpDamage = float(pdamage + TakenFlatBenefit) * TakenTotalMod;
8026 return int32(std::max(tmpDamage, 0.0f));
8036 for (
auto itr = bounds.first; itr != bounds.second;)
8038 if (itr->second == spellId)
8068 return std::floor((WeaponSpeed * PPM) / 600.0f);
8088 player->SendOnCancelExpectedVehicleRideAura();
8131 player->EnablePetControlsOnDismount();
8132 player->ResummonPetTemporaryUnSummonedIfAny();
8133 player->ResummonBattlePetTemporaryUnSummonedIfAny();
8159 uint32 ridingSkill = 5000;
8161 bool isSubmerged =
false;
8162 bool isInWater =
false;
8173 mountFlags = areaTable->GetMountFlags();
8183 if (!mountCapability)
8186 if (ridingSkill < mountCapability->ReqRidingSkill)
8221 if (mountCapability->
ReqMapID != -1 &&
8240 return mountCapability;
8252 if (
uint32 mountType = spellShapeshiftForm->MountTypeID)
8259 aurEff->RecalculateAmount();
8260 if (!aurEff->GetAmount())
8261 aurEff->GetBase()->Remove();
8266 if (!
HasAura(capability->ModSpellAuraID))
8267 CastSpell(
this, capability->ModSpellAuraID, aurEff);
8313 std::list<CombatReference*> toEnd;
8316 toEnd.push_back(pair.second);
8319 toEnd.push_back(pair.second);
8336 std::list<CombatReference*> toEnd;
8339 toEnd.push_back(pair.second);
8342 toEnd.push_back(pair.second);
8395 int64 val = dVal + curHealth;
8404 if (val < maxHealth)
8407 gain = val - curHealth;
8409 else if (curHealth != maxHealth)
8412 gain = maxHealth - curHealth;
8422 player->GetSession()->SendPacket(packet.
Write());
8437 int64 val = dVal + curHealth;
8445 if (val < maxHealth)
8447 else if (curHealth != maxHealth)
8448 gain = maxHealth - curHealth;
8461 uint32 triggerHealthPct = effect->GetAmount();
8462 uint32 triggerSpell = effect->GetSpellEffectInfo().TriggerSpell;
8468 if (newVal < threshold || oldVal > threshold)
8472 if (newVal > threshold || oldVal < threshold)
8496 int32 val = dVal + curPower;
8507 SetPower(power, val, withPowerUpdate);
8508 gain = val - curPower;
8510 else if (curPower != maxPower)
8512 SetPower(power, maxPower, withPowerUpdate);
8513 gain = maxPower - curPower;
8533 if (ownerPlayer->IsGroupVisibleFor(seerPlayer))
8567 int32 main_speed_mod = 0;
8568 float stack_bonus = 1.0f;
8569 float non_stack_bonus = 1.0f;
8609 int32 owner_speed_mod = 0;
8614 main_speed_mod = std::max(main_speed_mod, owner_speed_mod);
8632 TC_LOG_ERROR(
"entities.unit",
"Unit::UpdateSpeed: Unsupported move type ({})", mtype);
8637 float speed = std::max(non_stack_bonus, stack_bonus);
8639 AddPct(speed, main_speed_mod);
8662 if (speed > max_speed)
8672 if (speed < minSpeed)
8684 if (creature->HasUnitTypeMask(
UNIT_MASK_MINION) && !creature->IsInCombat())
8692 if (speed < ownerSpeed || creature->
IsWithinDist3d(followed, 10.0f))
8707 float baseMinSpeed = 1.0f;
8711 float min_speed =
CalculatePct(baseMinSpeed, minSpeedMod);
8712 if (speed < min_speed)
8731 rate = std::max(rate, 0.01f);
8773 playerMover->GetSession()->SendPacket(selfpacket.
Write());
8779 playerMover->SendMessageToSet(packet.
Write(),
false);
8815 if (!flightCapabilityEntry)
8818 auto [opcode, newValue, rateAura] = [&]
8841 return std::tuple<OpcodeServer, float, AuraType>();
8868 selfpacket.
Speed = newValue;
8869 playerMover->GetSession()->SendPacket(selfpacket.
Write());
8876 if (!flightCapabilityEntry)
8879 auto [opcode, min, max, rateAura] = [&]
8892 return std::tuple<OpcodeServer, float, float, AuraType>();
8928 playerMover->GetSession()->SendPacket(selfpacket.
Write());
8985 zoneScript->OnUnitDeath(
this);
9034 if (!target->
IsEngaged() && !canInitialAggro)
9038 targetOwner->EngageWithTarget(
this);
9042 if (myPlayerOwner && targetPlayerOwner && !(myPlayerOwner->
duel && myPlayerOwner->
duel->Opponent == targetPlayerOwner))
9056 if (minion->IsInCombat())
9070 if (interactionAllowed)
9080 if (interactionAllowed)
9119 if (currentLevel < maxLevel)
9120 diminish.
hitCount = currentLevel + 1;
9135 if (limitDuration > 0 && duration > limitDuration)
9137 Unit const* target = targetOwner ? targetOwner :
this;
9138 WorldObject const* source = casterOwner ? casterOwner : caster;
9141 duration = limitDuration;
9200 duration =
int32(duration * mod);
9201 return (duration != 0);
9211 else if (diminish.
stack)
9216 if (!diminish.
stack)
9248 return (creatureType >= 1) ? (1 << (creatureType - 1)) : 0;
9262 bool isTravelShapeshiftForm = [form]()
9266 if (shapeInfo->MountTypeID)
9276 if (onlyTravelShapeshiftForm && !isTravelShapeshiftForm)
9282 SpellInfo const* spellInfo = aurEff->GetBase()->GetSpellInfo();
9284 aurEff->GetBase()->Remove(removeMode);
9346 TC_LOG_ERROR(
"entities.unit",
"ERROR in HandleStatFlatModifier(): non-existing UnitMods or wrong UnitModifierType!");
9353 switch (modifierType)
9371 TC_LOG_ERROR(
"entities.unit",
"ERROR in ApplyStatPctModifier(): non-existing UnitMods or wrong UnitModifierType!");
9378 switch (modifierType)
9413 TC_LOG_ERROR(
"entities.unit",
"attempt to access non-existing modifier value from UnitMods!");
9424 TC_LOG_ERROR(
"entities.unit",
"attempt to access non-existing modifier value from UnitMods!");
9488 ABORT_MSG(
"Not implemented UnitMod %u", unitMod);
9584 value += createStat;
9596 TC_LOG_ERROR(
"entities.unit",
"attempt to access non-existing UnitMods in GetTotalAuraModValue()!");
9654 float baseValue = value;
9672 ap += std::max<float>(
m_unitData->MainHandWeaponAttackPower,
m_unitData->RangedWeaponAttackPower);
9675 return ap * (1.0f +
m_unitData->RangedAttackPowerMultiplier);
9683 ap += std::max<float>(
m_unitData->MainHandWeaponAttackPower,
m_unitData->RangedWeaponAttackPower);
9692 return ap * (1.0f +
m_unitData->AttackPowerMultiplier);
9720 if (player->GetGroup())
9736 if (maxHealth < val)
9748 if (player->GetGroup())
9753 if (pet->isControlled())
9774 if (pet->isControlled())
9818 packet.
Powers.emplace_back(val, power);
9827 if (player->GetGroup())
9858 if (val < cur_power)
9868 if (effect->GetMiscValue() == power)
9870 int32 effectAmount = effect->GetAmount();
9871 uint32 triggerSpell = effect->GetSpellEffectInfo().TriggerSpell;
9873 float oldValueCheck = oldVal;
9874 float newValueCheck = newVal;
9882 oldValueCheck =
GetPctOf(oldVal, maxPower);
9883 newValueCheck =
GetPctOf(newVal, maxPower);
9889 if (oldValueCheck >= effect->GetAmount() || newValueCheck < effectAmount)
9893 if (oldValueCheck <= effect->GetAmount() || newValueCheck > effectAmount)
9921 i_AIs.emplace(newAI);
10005 creature->SummonGraveyardTeleporter();
10040 if (owner->m_Controlled.find(
this) != owner->m_Controlled.end())
10042 TC_LOG_FATAL(
"entities.unit",
"Unit {} is in controlled list of {} when removed from world",
GetEntry(), owner->GetEntry());
10092 UnitAI* newAI =
nullptr;
10100 if (
CreatureAI* charmerAI = creatureCharmer->AI())
10101 newAI = charmerAI->GetAIForCharmedPlayer(
ToPlayer());
10128 ai->OnCharmed(
true);
10166 switch (missCondition)
10219 if (!damageNullified)
10282 if (
uint32 procEffectMask = aurApp->GetBase()->GetProcEffectMask(aurApp, eventInfo, now))
10284 aurApp->GetBase()->PrepareProcToTrigger(aurApp, eventInfo, now);
10285 aurasTriggeringProc.emplace_back(procEffectMask, aurApp);
10293 aurApp->GetBase()->PrepareProcChargeDrop(procEntry, eventInfo);
10294 aurasTriggeringProc.emplace_back(0, aurApp);
10300 aurApp->GetBase()->AddProcCooldown(procEntry, now);
10309 ASSERT(aurApp->GetTarget() ==
this);
10310 processAuraApplication(aurApp);
10317 processAuraApplication(itr->second);
10326 ProcEventInfo myProcEventInfo(
this, actionTarget, actionTarget, typeMaskActor, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo);
10335 if (modOwner !=
this && spell)
10338 for (
auto itr = modOwner->GetAppliedAuras().begin(); itr != modOwner->GetAppliedAuras().end(); ++itr)
10340 if (spell->
m_appliedMods.count(itr->second->GetBase()) != 0)
10341 modAuras.push_front(itr->second);
10343 modOwner->GetProcAurasTriggeredOnEvent(myAurasTriggeringProc, &modAuras, myProcEventInfo);
10349 ProcEventInfo targetProcEventInfo(
this, actionTarget,
this, typeMaskActionTarget, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo);
10351 if (typeMaskActionTarget && actionTarget)
10356 if (typeMaskActionTarget && actionTarget)
10363 bool const disableProcs = triggeringSpell && triggeringSpell->
IsProcDisabled();
10370 for (
auto const& [procEffectMask, aurApp] : aurasTriggeringProc)
10372 if (aurApp->GetRemoveMode())
10375 aurApp->GetBase()->TriggerProcOnEvent(procEffectMask, aurApp, eventInfo);
10392 petActionFeedback.
SpellID = spellId;
10405 petActionSound.
Action = pettalk;
10454 movementGenerator->Pause(timer);
10466 movementGenerator->Resume(timer);
10538 displayScale = model->DisplayScale;
10561 if (!transforms.empty())
10564 for (
auto i = transforms.begin(); i != transforms.end(); ++i)
10570 if (!ignorePositiveAurasPreventingMounting)
10571 handledAura = (*i);
10574 handledAura = (*i);
10577 if (!aurApp->IsPositive())
10579 handledAura = (*i);
10595 else if (!shapeshiftAura.empty())
10658 std::list<Unit*> targets;
10668 targets.remove(exclude);
10671 for (std::list<Unit*>::iterator tIter = targets.begin(); tIter != targets.end();)
10673 if (!
IsWithinLOSInMap(*tIter) || (*tIter)->IsTotem() || (*tIter)->IsSpiritService() || (*tIter)->IsCritter())
10674 targets.erase(tIter++);
10680 if (targets.empty())
10716 var *= (
apply ? (100.0f + val) / 100.0f : 100.0f / (100.0f + val));
10765 if (player->GetGroup())
10770 Pet* pet = ((
Pet*)
this);
10875 return !petInfo.has_value();
10878 if (freeActiveSlotItr == petStable.
ActivePets.end())
10888 TC_LOG_ERROR(
"entities.unit",
"Pet::InitStatsForLevel() failed for creature (Entry: {})!", pet->
GetEntry());
10917 TC_LOG_ERROR(
"entities.unit",
"Unit::PlayOneShotAnimKitId using invalid AnimKit ID: {}", animKitId);
10981 if (attacker && !attacker->
IsInMap(victim))
10982 attacker =
nullptr;
10985 Player* player =
nullptr;
10991 bool isRewardAllowed = attacker != victim;
10993 isRewardAllowed = isRewardAllowed && !creature->
GetTapList().empty();
10995 std::vector<Player*> tappers;
10996 if (isRewardAllowed && creature)
11000 tappers.push_back(tapper);
11003 isRewardAllowed =
false;
11008 isRewardAllowed =
false;
11012 if (isRewardAllowed)
11014 std::unordered_set<Group*> groups;
11015 for (
Player* tapper : tappers)
11017 if (
Group* tapperGroup = tapper->GetGroup())
11019 if (groups.insert(tapperGroup).second)
11022 partyKillLog.
Player = player && tapperGroup->IsMember(player->
GetGUID()) ? player->
GetGUID() : tapper->GetGUID();
11024 partyKillLog.
Write();
11026 tapperGroup->BroadcastPacket(partyKillLog.
GetRawPacket(), tapperGroup->GetMemberGroup(tapper->GetGUID()) != 0);
11029 tapperGroup->UpdateLooterGuid(creature,
true);
11035 partyKillLog.
Player = tapper->GetGUID();
11037 tapper->SendDirectMessage(partyKillLog.
Write());
11046 dungeonEncounter = instance->GetBossDungeonEncounter(creature);
11050 if (dungeonEncounter)
11056 else if (!tappers.empty())
11058 Group* group = !groups.empty() ? *groups.begin() :
nullptr;
11076 for (
Group* tapperGroup : groups)
11077 tapperGroup->UpdateLooterGuid(creature);
11082 for (
Player* tapper : tappers)
11086 if (dungeonEncounter)
11102 for (
Player* tapper : tappers)
11104 if (
Quest const* reward =
sObjectMgr->GetQuestTemplate(vignette->Data->RewardQuestID))
11107 if (vignette->Data->VisibleTrackingQuestID)
11108 tapper->SetRewardedQuest(vignette->Data->VisibleTrackingQuestID);
11116 if (attacker && (attacker->
IsPet() || attacker->
IsTotem()))
11127 for (
Player* tapper : tappers)
11128 if (tapper->IsAtGroupRewardDistance(victim))
11129 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);
11141 if (!skipSettingDeathState)
11150 for (
Player* tapper : tappers)
11152 Pet* pet = tapper->GetPet();
11167 plrVictim->SetPvPDeath(player !=
nullptr);
11174 TC_LOG_DEBUG(
"entities.unit",
"We are dead, losing {} percent durability", loss);
11176 plrVictim->DurabilityLossAll(baseLoss,
false);
11178 plrVictim->SendDurabilityLoss(plrVictim, loss);
11185 if (plrVictim->duel)
11187 plrVictim->duel->Opponent->CombatStopWithPets(
true);
11188 plrVictim->CombatStopWithPets(
true);
11197 if (!creature->
IsPet())
11219 ai->OnHealthDepleted(attacker,
true);
11220 ai->JustDied(attacker);
11225 if (
WorldObject * summoner = summon->GetSummoner())
11227 if (summoner->ToCreature() && summoner->ToCreature()->IsAIEnabled())
11228 summoner->ToCreature()->AI()->SummonedCreatureDies(creature, attacker);
11229 else if (summoner->ToGameObject() && summoner->ToGameObject()->AI())
11230 summoner->ToGameObject()->AI()->SummonedCreatureDies(creature, attacker);
11237 if (player && attacker != victim)
11240 pvp->HandleKill(player, victim);
11243 bf->HandleKill(player, victim);
11260 bg->HandleKillPlayer(playerVictim, player);
11263 bg->HandleKillUnit(victim->
ToCreature(), attacker);
11283 sScriptMgr->OnPVPKill(killerPlr, killedPlr);
11285 sScriptMgr->OnCreatureKill(killerPlr, killedCre);
11290 sScriptMgr->OnPlayerKilledByCreature(killerCre, killed);
11451 playerMover->SendDirectMessage(packet.
Write());
11471 Unit* caster =
nullptr;
11473 if (!fearAuras.empty())
11543 if (
this == charmer)
11618 if (player->isAFK())
11619 player->ToggleAFK();
11621 player->SetClientControl(
this,
false);
11692 ai->OnCharmed(
false);
11780 player->SetClientControl(
this,
true);
11795 charmedAI->OnCharmed(
false);
11833 m_vehicleKit = Trinity::make_unique_trackable<Vehicle>(
this, vehInfo, creatureEntry);
11848 if (!onRemoveFromWorld)
11879 return vehicleRoot;
11952 Group* group =
nullptr;
11962 Player* Target = itr->GetSource();
11968 TagUnitMap.push_back(Target);
11971 if (pet->IsAlive())
11972 TagUnitMap.push_back(pet);
11979 TagUnitMap.push_back(owner);
11981 if ((pet ==
this ||
IsInMap(pet)) && pet->IsAlive())
11982 TagUnitMap.push_back(pet);
11989 return entry->IsContestedGuardFaction();
12027 if (!(effMask & (1 << spellEffectInfo.EffectIndex)))
12031 effMask &= ~(1 << spellEffectInfo.EffectIndex);
12043 aura->ApplyForTargets();
12053 aura =
AddAura(spellId, target);
12100 playSpellVisualKit.
KitType = type;
12101 playSpellVisualKit.
Duration = duration;
12115 bool hasMissile =
false;
12122 if (spell->GetSpellInfo()->Id == spellId)
12124 itr.second->ScheduleAbort();
12138 packet.
Reverse = reverseMissile;
12154 Unit const* target =
nullptr;
12191 missChance += 19.0f;
12194 float resistMissChance = 100.0f;
12199 missChance -= resistMissChance - 100.0f;
12213 return std::max(missChance, 0.f);
12264 speedXY = -speedXY;
12268 float vcos = std::cos(o);
12269 float vsin = std::sin(o);
12277 return player->GetRatingBonusValue(cr);
12281 return owner->GetRatingBonusValue(cr);
12314 if (
Item* artifact = player->GetItemByGuid(artifactAura->GetCastItemGUID()))
12316 if (
ShapeshiftForm(artifactAppearance->OverrideShapeshiftFormID) == form)
12317 return artifactAppearance->OverrideShapeshiftDisplayID;
12321 bool useRandom =
false;
12337 std::vector<uint32> displayIds;
12338 displayIds.reserve(formModelData->Choices->size());
12340 for (std::size_t i = 0; i < formModelData->Choices->size(); ++i)
12347 displayIds.push_back(displayInfo->DisplayID);
12351 if (!displayIds.empty())
12356 if (
uint32 formChoice = player->GetCustomizationChoice(formModelData->OptionID))
12358 auto choiceItr = std::find_if(formModelData->Choices->begin(), formModelData->Choices->end(), [formChoice](
ChrCustomizationChoiceEntry const* choice)
12360 return choice->ID == formChoice;
12363 if (choiceItr != formModelData->Choices->end())
12365 return displayInfo->DisplayID;
12406 bool spellClickHandled =
false;
12410 auto clickBounds =
sObjectMgr->GetSpellClickInfoMapBounds(spellClickEntry);
12411 for (
auto const& clickPair : clickBounds)
12414 if (!clickPair.second.IsFitToRequirements(clicker,
this))
12418 if (!
sConditionMgr->IsObjectMeetingSpellClickConditions(spellClickEntry, clickPair.second.spellId, clicker,
this))
12421 spellClickHandled =
HandleSpellClick(clicker, seatId, clickPair.second.spellId,
flags, &clickPair.second);
12433 Unit* caster = clicker;
12434 Unit* target =
this;
12438 if (spellClickInfo)
12453 uint8 effectIndex = 0;
12454 bool hasControlVehicleAura =
false;
12459 hasControlVehicleAura =
true;
12467 if (!hasControlVehicleAura)
12469 if (!spellClickInfo)
12470 TC_LOG_ERROR(
"sql.sql",
"RideSpell {} specified in vehicle_accessory or vehicle_template_accessory is not a valid vehicle enter aura!", spellId);
12472 TC_LOG_ERROR(
"sql.sql",
"Spell {} specified in npc_spellclick_spells is not a valid vehicle enter aura!", spellId);
12481 castResult = caster->
CastSpell(target, spellId, args);
12487 bp[spellEffectInfo.EffectIndex] =
int32(spellEffectInfo.BasePoints);
12489 bp[effectIndex] = seatId;
12562 if (
CreatureGroup* creatureGroup = vehicleBaseCreature->GetFormation())
12587 for (AuraEffectList::const_iterator itr = vehicleAuras.begin(); itr != vehicleAuras.end(); ++itr)
12589 if ((*itr)->GetCasterGUID() !=
GetGUID())
12593 ASSERT(!rideVehicleEffect);
12594 rideVehicleEffect = *itr;
12598 ASSERT(rideVehicleEffect);
12636 TC_LOG_ERROR(
"entities.vehicle",
"RemovePassenger() couldn't remove current unit from vehicle. Debug info: {}",
GetDebugInfo());
12643 if (player && player->
duel && player->
duel->IsMounted)
12656 pos = *exitPosition;
12675 float height = pos.
GetPositionZ() + vehicleCollisionHeight;
12683 init.SetTransportExit();
12749 Unit* broadcastSource =
this;
12760 playerMover->SendDirectMessage(moveTeleport.
Write());
12762 broadcastSource = playerMover;
12796 TC_LOG_DEBUG(
"entities.unit",
"Unit::UpdatePosition({}, {}, {}) .. bad coordinates!", x, y, z);
12804 bool const relocated = (teleport ||
12818 for (
AuraEffect const* auraEffect : controlZoneAuras)
12838 return (relocated || turn);
12865 float addRage = baseRage;
12892 for (AttackerSet::const_iterator itr = attackers.begin(); itr != attackers.end();)
12894 if ((*itr)->GetFactionTemplateEntry()->Faction == faction_id)
12896 (*itr)->AttackStop();
12897 itr = attackers.begin();
12903 std::vector<CombatReference*> refsToEnd;
12905 if (pair.second->GetOther(
this)->GetFactionTemplateEntry()->Faction == faction_id)
12906 refsToEnd.push_back(pair.second);
12911 minion->StopAttackFaction(faction_id);
12923 std::ostringstream o;
12924 o <<
"Summon Slot: ";
12931 o <<
"Controlled List: ";
12933 o << (*itr)->GetGUID().ToString() <<
", ";
12937 o <<
"Aura List: ";
12939 o << itr->first <<
", ";
12945 o <<
"Passenger List: ";
12948 o << passenger->GetGUID().ToString() <<
", ";
12969 if (mask & (1 << i) && (!resist || *resist > schoolResistance))
12970 resist = schoolResistance;
12973 return resist.value_or(0);
13003 transport->CalculatePassengerPosition(stayPos.x, stayPos.y, stayPos.z);
13149 playerMover->SendDirectMessage(packet.
Write());
13247 playerMover->SendDirectMessage(packet.
Write());
13273 static OpcodeServer const waterWalkingOpcodeTable[2][2] =
13284 playerMover->SendDirectMessage(packet.
Write());
13311 static OpcodeServer const featherFallOpcodeTable[2][2] =
13322 playerMover->SendDirectMessage(packet.
Write());
13343 float hoverHeight =
m_unitData->HoverHeight;
13375 playerMover->SendDirectMessage(packet.
Write());
13421 static OpcodeServer const collisionOpcodeTable[2][2] =
13432 playerMover->SendDirectMessage(packet.
Write());
13461 static constexpr OpcodeServer fullSpeedTurningOpcodeTable[2] =
13472 playerMover->SendDirectMessage(packet.
Write());
13495 static OpcodeServer const swimToFlyTransOpcodeTable[2] =
13506 playerMover->SendDirectMessage(packet.
Write());
13527 static OpcodeServer const canTurnWhileFallingOpcodeTable[2] =
13538 playerMover->SendDirectMessage(packet.
Write());
13569 playerMover->SendDirectMessage(packet.
Write());
13589 static OpcodeServer const disableInertiaOpcodeTable[2] =
13600 playerMover->SendDirectMessage(packet.
Write());
13631 playerMover->SendDirectMessage(packet.
Write());
13662 playerMover->SendDirectMessage(packet.
Write());
13680 player->SendDirectMessage(moveSetVehicleRec.
Write());
13711 applyMovementForce.
Force = &force;
13712 movingPlayer->SendDirectMessage(applyMovementForce.
Write());
13718 updateApplyMovementForce.
Force = &force;
13736 moveRemoveMovementForce.
ID = id;
13737 movingPlayer->SendDirectMessage(moveRemoveMovementForce.
Write());
13762 static OpcodeServer const ignoreMovementForcesOpcodeTable[2] =
13773 movingPlayer->SendDirectMessage(packet.
Write());
13792 setModMovementForceMagnitude.
Speed = modMagnitude;
13793 movingPlayer->SendDirectMessage(setModMovementForceMagnitude.
Write());
13794 ++movingPlayer->m_movementForceModMagnitudeChanges;
13800 updateModMovementForceMagnitude.
Speed = modMagnitude;
13842 displayScale = model->DisplayScale;
13846 hoverHeight = modelData->HoverHeight * modelData->ModelScale * displayInfo->CreatureModelScale * displayScale;
13894 for (SpellSpellGroupMap::const_iterator itr = spellGroup.first; itr != spellGroup.second ; ++itr)
13899 for (AuraEffectList::const_iterator auraItr = auraEffList.begin(); auraItr != auraEffList.end(); ++auraItr)
13901 if (aurEff != (*auraItr) && (!checkMiscValue || (*auraItr)->GetMiscValue() == miscValue) &&
13902 sSpellMgr->IsSpellMemberOfSpellGroup((*auraItr)->GetSpellInfo()->Id, itr->second))
13905 if (abs(val) < abs((*auraItr)->GetAmount()))
13906 val = (*auraItr)->GetAmount();
13926 for (Unit::AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end();)
13942 if (removeOtherAuraApplications && (!base->
IsArea() || base->
GetOwner() !=
this))
13950 itr = auras.begin();
14001 return m_unitData->VirtualItems[slot].ItemID;
14009 return m_unitData->VirtualItems[slot].ItemAppearanceModID;
14027 TC_LOG_ERROR(
"entities.unit",
"WorldObject::MonsterText: `broadcast_text` (ID: {}) was not found", textId);
14060 TC_LOG_ERROR(
"entities.unit",
"WorldObject::Whisper: `broadcast_text` was not {} found", textId);
14073 clearBossEmotes.
Write();
14083 ref.GetSource()->SendDirectMessage(clearBossEmotes.
GetRawPacket());
14090 if (slot == spellId)
14105 auto findMatchingAuraEffectIn = [
this, spellInfo, &triggerFlag, context](
AuraType type) ->
SpellInfo const*
14109 bool matches = auraEffect->GetMiscValue() ?
uint32(auraEffect->GetMiscValue()) == spellInfo->
Id : auraEffect->IsAffectingSpell(spellInfo);
14110 if (matches && context->
AddSpell(auraEffect->GetAmount()))
14117 triggerFlag &= ~TRIGGERED_IGNORE_POWER_COST;
14122 triggerFlag &= ~TRIGGERED_IGNORE_SHAPESHIFT;
14134 triggerFlag &= ~TRIGGERED_IGNORE_CAST_TIME;
14150 for (
AuraEffect const* effect : visualOverrides)
14152 if (
uint32(effect->GetMiscValue()) == spellInfo->
Id)
14156 spellInfo = visualSpell;
14214 std::stringstream sstr;
14219 <<
" Class: " << std::to_string(
GetClass()) <<
"\n"
14226 size_t controlledCount = 0;
14230 sstr <<
"\n" <<
"m_Controlled " << controlledCount <<
" : " << controlled->GetGUID().ToString();
14239 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< 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
@ UnitsUseDefaultPowerOnInit
#define MAX_SPELL_EFFECTS
@ 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
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_f(float chance)
bool roll_chance_i(int chance)
if(posix_memalign(&__mallocedMemory, __align, __size)) return NULL
@ SERVERSIDE_VISIBILITY_GM
@ SERVERSIDE_VISIBILITY_GHOST
@ SPELL_ATTR11_IGNORE_SPELLCAST_OVERRIDE_SHAPESHIFT_REQUIREMENTS
@ SPELL_ATTR10_RESET_COOLDOWN_ON_ENCOUNTER_END
@ SPELL_ATTR9_ALLOW_CAST_WHILE_CHANNELING
@ SPELL_ATTR9_IGNORE_CASTER_HEALING_MODIFIERS
@ SPELL_ATTR9_CANNOT_KILL_TARGET
#define MAX_POWERS_PER_CLASS
@ SPELL_ATTR7_DONT_CAUSE_SPELL_PUSHBACK
@ SPELL_ATTR7_DISPEL_REMOVES_CHARGES
@ SPELL_ATTR7_NO_ATTACK_PARRY
@ SPELL_ATTR7_DO_NOT_COUNT_FOR_PVP_SCOREBOARD
@ SPELL_ATTR7_NO_ATTACK_MISS
@ SPELL_ATTR7_NO_ATTACK_DODGE
@ SPELL_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_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_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_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
@ 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_CAN_TURN_WHILE_FALLING
@ MOVEMENTFLAG2_IGNORE_MOVEMENT_FORCES
@ MOVEMENTFLAG2_FULL_SPEED_TURNING
#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_CANT_SWIM
@ MOVEMENTFLAG3_DISABLE_INERTIA
@ 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
#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
#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
SpellInfo const * GetSpellInfo() const
AuraType GetAuraType() const
void HandleEffect(AuraApplication *aurApp, uint8 mode, bool apply, AuraEffect const *triggeredBy=nullptr)
bool CanBeRecalculated() const
SpellEffectInfo const & GetSpellEffectInfo() const
bool IsAffectingSpell(SpellInfo const *spell) const
void ChangeAmount(int32 newAmount, bool mark=true, bool onStackOrReapply=false, AuraEffect const *triggeredBy=nullptr)
int32 GetMiscValueB() const
int32 GetMiscValue() const
int32 GetBaseAmount() 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
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
int32 GetDuration() const
void UpdateOwner(uint32 diff, WorldObject *owner)
void UnregisterSingleTarget()
bool IsDeathPersistent() const
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 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
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
GroupReference * GetFirstMember()
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
void PlayerRelocation(Player *, float x, float y, float z, float orientation)
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)
MovementGeneratorType GetCurrentMovementGeneratorType() const
void MoveFleeing(Unit *enemy, Milliseconds time=0ms, Optional< Scripting::v2::ActionResultSetter< MovementStopReason > > &&scriptResult={})
void PropagateSpeedChange()
void MoveKnockbackFrom(Position const &origin, float speedXY, float speedZ, Movement::SpellEffectExtraData const *spellEffectExtraData=nullptr)
void MoveJumpTo(float angle, float speedXY, float speedZ)
void Remove(MovementGenerator *movement, MovementSlot slot=MOTION_SLOT_ACTIVE)
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)
static Creature * ToCreature(Object *o)
float GetObjectScale() const
static Unit * ToUnit(Object *o)
ObjectGuid const & GetGUID() const
bool HasDynamicFlag(uint32 flag) const
void RemoveUpdateFieldFlagValue(UF::UpdateFieldSetter< T > setter, typename UF::UpdateFieldSetter< T >::value_type flag)
void BuildValuesUpdateBlockForPlayerWithFlag(UpdateData *data, UF::UpdateFieldFlag flags, Player const *target) const
virtual void DestroyForPlayer(Player *target) const
CreateObjectBits m_updateFlag
void SetUpdateFieldFlagValue(UF::UpdateFieldSetter< T > setter, typename UF::UpdateFieldSetter< T >::value_type flag)
virtual void ClearUpdateMask(bool remove)
void SetUpdateFieldValue(UF::UpdateFieldSetter< T > setter, typename UF::UpdateFieldSetter< T >::value_type value)
UF::UpdateFieldHolder m_values
static ObjectGuid GetGUID(Object const *o)
WowCS::EntityFragmentsHolder m_entityFragments
virtual void SetObjectScale(float scale)
void ForceUpdateFieldChange(UF::UpdateFieldSetter< T > const &)
static Player * ToPlayer(Object *o)
void ApplyPercentModUpdateFieldValue(UF::UpdateFieldSetter< T > setter, float percent, bool apply)
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
bool HaveAtClient(Object const *u) 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
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)
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)
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
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
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
bool IsRangedWeaponSpell() const
EnumFlag< SpellAuraInterruptFlags > AuraInterruptFlags
bool HasAura(AuraType aura) const
bool HasAuraInterruptFlag(SpellAuraInterruptFlags flag) const
bool HasLabel(uint32 labelId) const
bool IsSingleTarget() const
static CreatureImmunities const * GetCreatureImmunities(int32 creatureImmunitiesId)
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
void CalculatePassengerPosition(float &x, float &y, float &z, float *o=nullptr) 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
void KnockbackFrom(Position const &origin, float speedXY, float speedZ, Movement::SpellEffectExtraData const *spellEffectExtraData=nullptr)
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)
virtual void UpdateResistances(uint32 school)
bool HealthAbovePct(int32 pct) const
void RemoveGameObject(GameObject *gameObj, bool del)
bool isTargetableForAttack(bool checkFakeDeath=true) const
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
uint32 GetSchoolImmunityMask() const
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)
void JumpTo(float speedXY, float speedZ, float angle, Optional< Position > dest={})
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
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
AreaTriggerList m_areaTrigger
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)
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 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)
virtual void Say(std::string_view text, Language language, WorldObject const *target=nullptr)
void PropagateSpeedChange()
-------—End of Pet responses methods-------—
bool HasBreakableByDamageCrowdControlAura(Unit *excludeCasterChannel=nullptr) const
void DelayOwnedAuras(uint32 spellId, ObjectGuid caster, int32 delaytime)
void SetControlled(bool apply, UnitState state)
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
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 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)
bool IsImmunedToSpell(SpellInfo const *spellInfo, WorldObject const *caster, bool requireImmunityPurgesEffectAttribute=false) const
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 RemoveAllAurasExceptType(AuraType type)
void DealSpellDamage(SpellNonMeleeDamage const *damageInfo, bool durabilityLoss)
uint32 CalculateDamage(WeaponAttackType attType, bool normalized, bool addTotalPct) const
uint32 _lastExtraAttackSpell
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)
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 ResumeMovement(uint32 timer=0, uint8 slot=0)
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
int32 GetMaxNegativeAuraModifier(AuraType auraType) const
void UpdateSplineMovement(uint32 t_diff)
uint32 GetDamageReduction(uint32 damage) const
std::array< float, MAX_STATS > m_floatStatPosBuff
void SetUnitFlag2(UnitFlags2 flags)
bool HasUnitFlag2(UnitFlags2 flags) const
std::string GetDebugInfo() const override
std::pair< AuraMap::const_iterator, AuraMap::const_iterator > AuraMapBounds
virtual bool IsLoading() const
uint32 BuildAuraStateUpdateForTarget(Unit const *target) const
bool isInFrontInMap(Unit const *target, float distance, float arc=float(M_PI)) const
float m_auraFlatModifiersGroup[UNIT_MOD_END][MODIFIER_TYPE_FLAT_END]
void SetImmuneToNPC(bool apply, bool keepCombat)
void PauseMovement(uint32 timer=0, uint8 slot=0, bool forced=true)
void SetPetNameTimestamp(uint32 timestamp)
bool IsSplineEnabled() const
std::array< uint32, MAX_ATTACK > m_baseAttackSpeed
void RemoveAllAurasRequiringDeadTarget()
void UpdateAuraForGroup()
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 GetMaxNegativeAuraModifierByMiscMask(AuraType auraType, uint32 misc_mask) const
void RemoveAllAreaTriggers()
int32 HealBySpell(HealInfo &healInfo, bool critical=false)
void AddPlayerToVision(Player *player)
void RemoveNpcFlag(NPCFlags flags)
void SendHealSpellLog(HealInfo &healInfo, bool critical=false)
int32 GetMaxPositiveAuraModifier(AuraType auraType) const
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
int32 GetMechanicResistChance(SpellInfo const *spellInfo) const
int32 GetMaxPositiveAuraModifierByMiscValue(AuraType auraType, int32 misc_value) const
void RemoveUnitFlag3(UnitFlags3 flags)
AuraMap::iterator m_auraUpdateIterator
Unit * GetMeleeHitRedirectTarget(Unit *victim, SpellInfo const *spellInfo=nullptr)
void DestroyForPlayer(Player *target) const override
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 RemoveAurasWithAttribute(uint32 flags)
void RemoveAllFollowers()
virtual void SetInteractionAllowedWhileHostile(bool interactionAllowed)
void UpdateMountCapability()
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
int32 GetTotalAuraModifierByMiscMask(AuraType auraType, uint32 misc_mask) const
void AddUnitState(uint32 f)
static void ApplyResilience(Unit const *victim, int32 *damage)
float GetTotalAuraMultiplier(AuraType auraType) const
void Mount(uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
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
int32 GetMaxNegativeAuraModifierByMiscValue(AuraType auraType, int32 misc_value) const
uint32 getAttackTimer(WeaponAttackType type) const
bool IsDuringRemoveFromWorld() const
void SendPlaySpellVisual(Unit *target, uint32 spellVisualId, uint16 missReason, uint16 reflectStatus, float travelSpeed, bool speedAsTime=false, float launchDelay=0.0f)
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)
bool IsPlayingHoverAnim() const
void _ApplyAllAuraStatMods()
bool SetMoveCantSwim(bool cantSwim)
void SetBattlePetCompanionNameTimestamp(uint32 timestamp)
bool IsImmunedToAuraPeriodicTick(WorldObject const *caster, SpellInfo const *spellInfo, SpellEffectInfo const *spellEffectInfo=nullptr) const
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
int32 GetHighestExclusiveSameEffectSpellGroupValue(AuraEffect const *aurEff, AuraType auraType, bool checkMiscValue=false, int32 miscValue=0) const
bool HasNegativeAuraWithInterruptFlag(InterruptFlags flag, ObjectGuid guid=ObjectGuid::Empty) const
bool IsThreatened() const
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)
int32 GetMaxPositiveAuraModifierByMiscMask(AuraType auraType, uint32 misc_mask, AuraEffect const *except=nullptr) const
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)
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
bool HealthBelowPct(int32 pct) const
uint64 GetMaxHealth() const
void ApplyControlStatesIfNeeded()
void SetRooted(bool apply, bool packetOnly=false)
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)
bool SetCanTurnWhileFalling(bool enable)
std::multimap< uint32, Aura * > AuraMap
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 AddInterruptMask(SpellAuraInterruptFlags flags, SpellAuraInterruptFlags2 flags2)
void NearTeleportTo(Position const &pos, bool casting=false)
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
void RemoveAllDynObjects()
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
int32 GetTotalAuraModifier(AuraType auraType) const
void SetFullPower(Powers power)
void RemoveAurasWithInterruptFlags(InterruptFlags flag, SpellInfo const *source=nullptr)
void SetMovementAnimKitId(uint16 animKitId)
void ClearUpdateMask(bool remove) override
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 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)
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
int32 SpellBaseHealingBonusDone(SpellSchoolMask schoolMask) const
uint64 CountPctFromMaxHealth(int32 pct) 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 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)
int32 GetMaxPositiveAuraModifierByAffectMask(AuraType auraType, SpellInfo const *affectedSpell) const
std::vector< DynamicObject * > GetDynObjects(uint32 spellId) const
virtual float GetHealthMultiplierForTarget(WorldObject const *) const
void DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
uint16 _movementAnimKitId
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 SendPlaySpellVisualKit(uint32 id, uint32 type, uint32 duration) const
AuraApplicationMap m_appliedAuras
CharmInfo * InitCharmInfo()
void RemoveAllAttackers()
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 GetTotalAuraModifierByMiscValue(AuraType auraType, int32 misc_value) 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
ObjectGuid GetCharmerGUID() const
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
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)
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)
int32 GetMaxNegativeAuraModifierByAffectMask(AuraType auraType, SpellInfo const *affectedSpell) const
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)
int32 GetTotalAuraModifierByAffectMask(AuraType auraType, SpellInfo const *affectedSpell) const
bool ApplyDiminishingToDuration(SpellInfo const *auraSpellInfo, int32 &duration, WorldObject *caster, DiminishingLevels previousLevel) const
bool IsUninteractible() const
std::vector< AreaTrigger * > GetAreaTriggers(uint32 spellId) const
virtual void ProcessTerrainStatusUpdate(ZLiquidStatus oldLiquidStatus, Optional< LiquidData > const &newLiquidData)
std::vector< GameObject * > GetGameObjects(uint32 spellId) const
std::array< uint32, MAX_ATTACK > m_attackTimer
bool IsServiceProvider() const
MountCapabilityEntry const * GetMountCapability(uint32 mountType) const
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)
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()
bool IsHighestExclusiveAuraEffect(SpellInfo const *spellInfo, AuraType auraType, int32 effectAmount, uint32 auraEffectMask, bool removeOtherAuraApplications=false)
void SetStatFlatModifier(UnitMods unitMod, UnitModifierFlatType modifierType, float val)
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)
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)
GetCastSpellInfoResult GetCastSpellInfo(SpellInfo const *spellInfo) const
uint32 GetModelForForm(ShapeshiftForm form, uint32 spellId) const
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 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
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
SpellMissInfo SpellHitResult(Unit *victim, SpellInfo const *spellInfo, bool canReflect=false) 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
WorldPacket const * Write() override
Spells::SpellCastVisual Visual
Optional< Spells::ContentTuningParams > ContentTuning
WorldPacket const * Write() override
std::vector< SpellLogEffect > 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
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.
@ SMSG_MOVE_SPLINE_SET_PITCH_RATE
@ SMSG_MOVE_SET_ADV_FLYING_LAUNCH_SPEED_COEFFICIENT
@ SMSG_MOVE_UNSET_CANT_SWIM
@ 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_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_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_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_SET_CANT_SWIM
@ 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_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_SET_ADV_FLYING_AIR_FRICTION
@ SMSG_MOVE_SET_LAND_WALK
@ SMSG_MOVE_SPLINE_SET_FEATHER_FALL
@ SMSG_MOVE_SPLINE_SET_WALK_MODE
@ SMSG_MOVE_SET_FEATHER_FALL
@ CONFIG_CREATURE_FAMILY_FLEE_DELAY
@ CONFIG_DURABILITY_LOSS_IN_PVP
@ RATE_DURABILITY_LOSS_DAMAGE
@ RATE_DURABILITY_LOSS_ON_DEATH
@ CONFIG_LISTEN_RANGE_YELL
@ CONFIG_LISTEN_RANGE_SAY
@ CONFIG_LISTEN_RANGE_TEXTEMOTE
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 HashMapHolder< Player >::MapType const & GetPlayers()
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
TC_GAME_API Pet * GetPet(WorldObject 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 & SetBaseAmount(int32 const *bp)
AuraCreateInfo & SetCaster(Unit *caster)
AuraCreateInfo & SetCasterGUID(ObjectGuid const &guid)
uint32 GetAuraEffectMask() const
SpellInfo const * GetSpellInfo() const
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
float GetRelativeAngle(float x, float y) 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< float, 64, 77 > ModRangedHaste
UpdateField< uint8, 64, 65 > StandState
UpdateField< uint32, 32, 49 > AuraState
UpdateField< uint8, 64, 87 > ShapeshiftForm
UpdateFieldArray< int32, 4, 183, 192 > StatNegBuff
UpdateFieldArray< int32, 4, 183, 188 > StatPosBuff
UpdateField< float, 64, 73 > ModCastingSpeed
UpdateFieldArray< int32, 10, 135, 136 > Power
UpdateField< int32, 32, 37 > Level
UpdateField< uint8, 32, 33 > DisplayPower
UpdateField< int64, 32, 35 > Health
UpdateField< float, 32, 57 > NativeXDisplayScale
UpdateField< int32, 96, 124 > FlightCapabilityID
UpdateFieldArray< UF::VisibleItem, 3, 176, 177 > VirtualItems
UpdateField< int64, 32, 36 > MaxHealth
UpdateField< float, 64, 75 > ModSpellHaste
UpdateField< ObjectGuid, 0, 18 > SummonedBy
UpdateField< uint32, 32, 50 > RangedAttackRoundBaseTime
UpdateField< uint8, 64, 84 > SheatheState
UpdateField< ObjectGuid, 0, 17 > CharmedBy
UpdateFieldArray< int32, 10, 135, 146 > MaxPower
UpdateField< float, 64, 78 > ModHasteRegen
UpdateField< int32, 32, 56 > NativeDisplayID
UpdateField< uint32, 0, 8 > NpcFlags2
UpdateField< float, 64, 76 > ModHaste
UpdateField< int32, 0, 6 > DisplayID
UpdateField< uint32, 128, 131 > CurrentAreaID
UpdateField< float, 32, 53 > DisplayScale
UpdateField< uint8, 64, 68 > AnimTier
UpdateField< ObjectGuid, 0, 14 > Charm
UpdateField< uint32, 0, 7 > NpcFlags
UpdateFieldArray< uint32, 2, 180, 181 > AttackRoundBaseTime
UpdateField< uint16, 0, 4 > ItemAppearanceModID
UpdateField< uint16, 0, 5 > ItemVisual
UpdateField< int32, 0, 1 > ItemID
std::array< uint32, 5 > VisitedSpells
bool AddSpell(uint32 spellId)
bool operator()(AuraApplication *left, AuraApplication *right) const
VehicleExitParameters ExitParameter
int32 AbsorbedOrAmplitude
Optional< Spells::ContentTuningParams > ContentTuning
bool GenerateDataForUnits(T *attacker, U *target)
void Initialize(Unit const *unit)
void Add(EntityFragment fragment, bool update)