115 : m_attacker(attacker), m_victim(victim), m_damage(damage), m_spellInfo(spellInfo), m_schoolMask(schoolMask), m_damageType(damageType), m_attackType(attackType),
116 m_absorb(0), m_resist(0), m_block(0), m_hitMask(0)
121 : m_attacker(dmg1.m_attacker), m_victim(dmg1.m_victim), m_damage(dmg1.m_damage + dmg2.m_damage), m_spellInfo(dmg1.m_spellInfo), m_schoolMask(
SpellSchoolMask(dmg1.m_schoolMask | dmg2.m_schoolMask)),
122 m_damageType(dmg1.m_damageType), m_attackType(dmg1.m_attackType), m_absorb(dmg1.m_absorb + dmg2.m_absorb), m_resist(dmg1.m_resist + dmg2.m_resist), m_block(dmg1.m_block), m_hitMask(dmg1.m_hitMask | dmg2.m_hitMask)
131 : m_attacker(dmgInfo.Attacker), m_victim(dmgInfo.Target), m_damage(dmgInfo.Damages[damageIndex].Damage), m_spellInfo(nullptr), m_schoolMask(
SpellSchoolMask(dmgInfo.Damages[damageIndex].DamageSchoolMask)),
132 m_damageType(
DIRECT_DAMAGE), m_attackType(dmgInfo.AttackType), m_absorb(dmgInfo.Damages[damageIndex].Absorb), m_resist(dmgInfo.Damages[damageIndex].Resist), m_block(dmgInfo.Blocked), m_hitMask(0)
173 if (!damageNullified)
177 if (!damageNullified)
184 : m_attacker(spellNonMeleeDamage.attacker), m_victim(spellNonMeleeDamage.target), m_damage(spellNonMeleeDamage.damage),
185 m_spellInfo(
sSpellMgr->GetSpellInfo(spellNonMeleeDamage.SpellID)), m_schoolMask(
SpellSchoolMask(spellNonMeleeDamage.schoolMask)), m_damageType(damageType),
186 m_attackType(attackType), m_absorb(spellNonMeleeDamage.absorb), m_resist(spellNonMeleeDamage.resist), m_block(spellNonMeleeDamage.blocked), m_hitMask(hitMask)
188 if (spellNonMeleeDamage.
blocked)
190 if (spellNonMeleeDamage.
absorb)
239 : _healer(healer), _target(target), _heal(heal), _effectiveHeal(0), _absorb(0), _spellInfo(spellInfo), _schoolMask(schoolMask), _hitMask(0)
245 amount = std::min(amount,
GetHeal());
263 _actor(actor), _actionTarget(actionTarget),
264 _typeMask(typeMask), _spellTypeMask(spellTypeMask),
265 _spellPhaseMask(spellPhaseMask), _hitMask(hitMask), _spell(spell),
266 _damageInfo(damageInfo), _healInfo(healInfo)
292 _aura(aura), _chance(dispelChance), _charges(dispelCharges)
304 WorldObject(isWorldObject), m_lastSanctuaryTime(0), LastCharmerGUID(), movespline(new
Movement::MoveSpline()),
305 m_ControlledByPlayer(false), m_AutoRepeatFirstCast(false), m_procDeep(0), m_transformSpell(0),
306 m_removedAurasCount(0), m_charmer(nullptr), m_charmed(nullptr),
307 i_motionMaster(new
MotionMaster(this)), m_regenTimer(0), m_vehicle(nullptr), m_vehicleKit(nullptr),
308 m_unitTypeMask(
UNIT_MASK_NONE), m_Diminishing(), m_combatManager(this), m_threatManager(this),
309 m_aiLocked(false), m_comboTarget(nullptr), m_comboPoints(0), _spellHistory(new
SpellHistory(this))
467 uint32 count = itr->second;
521 return player->GetWeaponForAttack(
OFF_ATTACK,
true) !=
nullptr;
530 init.MoveTo(x, y, z, generatePath, forceDestination);
531 init.SetVelocity(speed);
568 transport->CalculatePassengerPosition(loc.x, loc.y, loc.z, &loc.
orientation);
619 float distsq = dx * dx + dy * dy + dz * dz;
622 float maxdist = dist2compare + sizefactor;
624 return distsq < maxdist * maxdist;
635 float distsq = dx*dx + dy*dy + dz*dz;
639 return distsq <= maxdist * maxdist;
672 m_interruptMask |= (*i)->GetBase()->GetSpellInfo()->AuraInterruptFlags;
684 for (AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
685 if (
SpellInfo const* iterSpellProto = (*itr)->GetSpellInfo())
686 if (iterSpellProto->SpellFamilyName == familyName && iterSpellProto->SpellFamilyFlags & familyFlags)
694 for (AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
695 if ((!excludeAura || excludeAura != (*itr)->GetSpellInfo()->Id) &&
705 excludeAura = currentChanneledSpell->GetSpellInfo()->Id;
729 victimAI->DamageTaken(attacker, damage, damagetype, spellProto);
731 if (
UnitAI* attackerAI = attacker ? attacker->
GetAI() :
nullptr)
732 attackerAI->DamageDealt(victim, damage, damagetype);
735 sScriptMgr->OnDamage(attacker, victim, damage);
738 if (attacker != victim && damagetype !=
DOT)
742 if (
CreatureAI* controlledAI = cControlled->AI())
743 controlledAI->OwnerAttackedBy(attacker);
769 uint32 interruptFlags = spell->m_spellInfo->InterruptFlags;
780 for (AuraEffectList::iterator i = vCopyDamageCopy.begin(); i != vCopyDamageCopy.end(); ++i)
783 if (!((*i)->GetBase()->IsAppliedOnTarget(victim->
GetGUID())))
786 if (((*i)->GetMiscValue() & damageSchoolMask) == 0)
789 Unit* shareDamageTarget = (*i)->GetCaster();
790 if (!shareDamageTarget)
792 SpellInfo const* spell = (*i)->GetSpellInfo();
805 uint32 weaponSpeedHitFactor;
814 weaponSpeedHitFactor *= 2;
816 attacker->
RewardRage(rage_damage, weaponSpeedHitFactor,
true);
838 bool duel_hasEnded =
false;
839 bool duel_wasMounted =
false;
849 duel_hasEnded =
true;
855 if (victimRider && victimRider->
duel && victimRider->
duel->IsMounted)
864 duel_wasMounted =
true;
865 duel_hasEnded =
true;
869 if (attacker && attacker != victim)
894 if (health <= damage)
933 rage_damage = damage + (cleanDamage ? cleanDamage->
absorbed_damage : 0);
947 if (damagetype !=
NODAMAGE && damagetype !=
DOT && damage)
957 uint32 interruptFlags = spell->m_spellInfo->InterruptFlags;
968 spell->DelayedChannel();
984 he->
duel->Opponent->CombatStopWithPets(
true);
1012 if (!victim || !victim->
IsAlive())
1036 uint32 crit_bonus = damage;
1040 damage += crit_bonus;
1043 float critPctDamageMod = 0.0f;
1055 if (critPctDamageMod != 0)
1056 AddPct(damage, critPctDamageMod);
1071 damage -= damageInfo->
blocked;
1105 damageInfo->
damage = damage;
1133 if (spellProto ==
nullptr)
1135 TC_LOG_DEBUG(
"entities.unit",
"Unit::DealSpellDamage has wrong damageInfo->SpellID: {}", damageInfo->
SpellID);
1148 damageInfo->
Target = victim;
1191 uint8 immunedMask = 0;
1194 immunedMask |= (1 << i);
1196 if (immunedMask == ((1 << 0) | (1 << 1)))
1210 if (immunedMask & (1 << i))
1318 uint8 fullBlockMask = 0;
1321 if (remainingBlock && remainingBlock >= damageInfo->
Damages[i].
Damage)
1323 fullBlockMask |= (1 << i);
1338 if (fullBlockMask == ((1 << 0) | (1 << 1)))
1341 damageInfo->
Blocked -= remainingBlock;
1362 int32 const reductionMax = leveldif * 10;
1363 int32 const reductionMin = std::max(1, reductionMax - 10);
1365 float reducePercent = 1.f -
irand(reductionMin, reductionMax) / 100.0f;
1399 resilienceReduction = damageInfo->
Damages[i].
Damage - resilienceReduction;
1448 auto canTakeMeleeDamage = [&]()
1453 if (!canTakeMeleeDamage())
1466 float percent60 = 3.0f * percent20;
1467 if (offtime > percent20 && offtime <= percent60)
1469 else if (offtime > percent60)
1471 offtime -= 2.0f * percent20;
1478 float percent60 = 3.0f * percent20;
1479 if (basetime > percent20 && basetime <= percent60)
1481 else if (basetime > percent60)
1483 basetime -= 2.0f * percent20;
1505 float chance = 20.0f;
1509 chance = 0.65f * victim->
GetLevel() + 0.5f;
1514 chance *= attackerMeleeSkill / float(victimDefense) * 0.16f;
1534 for (
AuraEffect const* aurEff : vDamageShieldsCopy)
1536 SpellInfo const* spellInfo = aurEff->GetSpellInfo();
1553 uint32 damage = aurEff->GetAmount();
1554 if (
Unit* caster = aurEff->GetCaster())
1556 damage = caster->SpellDamageBonusDone(
this, spellInfo, damage,
SPELL_DIRECT_DAMAGE, aurEff->GetSpellEffectInfo(), { });
1570 data <<
uint32(std::max(overkill, 0));
1598 float armor = float(victim->
GetArmor());
1610 for (
AuraEffect const* aurEff : resIgnoreAurasAb)
1613 armor = std::floor(
AddPct(armor, -aurEff->GetAmount()));
1617 for (
AuraEffect const* aurEff : resIgnoreAuras)
1620 armor = std::floor(
AddPct(armor, -aurEff->GetAmount()));
1637 float maxArmorPen = 0.f;
1639 maxArmorPen = float(400 + 85 * victim->
GetLevel());
1641 maxArmorPen = 400 + 85 * victim->
GetLevel() + 4.5f * 85 * (victim->
GetLevel() - 59);
1644 maxArmorPen = std::min((armor + maxArmorPen) / 3.f, armor);
1653 float levelModifier = attacker ? attacker->
GetLevel() : attackerLevel;
1654 if (levelModifier > 59.f)
1655 levelModifier = levelModifier + 4.5f * (levelModifier - 59.f);
1657 float damageReduction = 0.1f * armor / (8.5f * levelModifier + 40.f);
1658 damageReduction /= (1.0f + damageReduction);
1661 return uint32(std::ceil(std::max(damage * (1.0f - damageReduction), 0.0f)));
1682 float discreteResistProbability[11] = { };
1683 if (averageResist <= 0.1f)
1685 discreteResistProbability[0] = 1.0f - 7.5f * averageResist;
1686 discreteResistProbability[1] = 5.0f * averageResist;
1687 discreteResistProbability[2] = 2.5f * averageResist;
1691 for (
uint32 i = 0; i < 11; ++i)
1692 discreteResistProbability[i] = std::max(0.5f - 2.5f * std::fabs(0.1f * i - averageResist), 0.0f);
1696 float probabilitySum = 0.0f;
1699 for (; resistance < 11; ++resistance)
1700 if (roll < (probabilitySum += discreteResistProbability[resistance]))
1703 float damageResisted = damage * resistance / 10.f;
1704 if (damageResisted > 0.0f)
1706 int32 ignoredResistance = 0;
1719 ignoredResistance = std::min<int32>(ignoredResistance, 100);
1720 ApplyPct(damageResisted, 100 - ignoredResistance);
1726 float armorReduction = damage - damageAfterArmor;
1729 damageResisted = std::min(damageResisted, armorReduction);
1733 damageResisted = std::max(damageResisted, 0.f);
1734 return uint32(damageResisted);
1739 float victimResistance = float(victim->
GetResistance(schoolMask));
1746 victimResistance -= float(player->GetSpellPenetrationItemMod());
1748 else if (
Unit const* unitCaster = caster->
ToUnit())
1754 victimResistance = 0.0f;
1758 victimResistance = 0.0f;
1760 victimResistance = std::max(victimResistance, 0.0f);
1767 static uint32 const BOSS_LEVEL = 83;
1768 static float const BOSS_RESISTANCE_CONSTANT = 510.0f;
1770 float resistanceConstant = 0.0f;
1772 if (level == BOSS_LEVEL)
1773 resistanceConstant = BOSS_RESISTANCE_CONSTANT;
1775 resistanceConstant = level * 5.0f;
1777 return victimResistance / (victimResistance + resistanceConstant);
1788 float auraAbsorbMod = 0.f;
1794 if (!(aurEff->GetMiscValue() & damageInfo.GetSchoolMask()))
1797 if (!aurEff->IsAffectingSpell(damageInfo.GetSpellInfo()))
1820 for (AuraEffectList::iterator itr = vSchoolAbsorbCopy.begin(); (itr != vSchoolAbsorbCopy.end()) && (damageInfo.
GetDamage() > 0); ++itr)
1833 if (currentAbsorb < 0)
1838 bool defaultPrevented =
false;
1841 currentAbsorb = tempAbsorb;
1843 if (defaultPrevented)
1851 tempAbsorb = currentAbsorb;
1867 for (AuraEffectList::const_iterator itr = vManaShieldCopy.begin(); (itr != vManaShieldCopy.end()) && (damageInfo.
GetDamage() > 0); ++itr)
1881 if (currentAbsorb < 0)
1884 uint32 tempAbsorb = currentAbsorb;
1886 bool defaultPrevented =
false;
1889 currentAbsorb = tempAbsorb;
1891 if (defaultPrevented)
1897 int32 manaReduction = currentAbsorb;
1901 manaReduction =
int32(
float(manaReduction) * manaMultiplier);
1906 currentAbsorb = currentAbsorb ?
int32(
float(currentAbsorb) * (
float(manaTaken) /
float(manaReduction))) : 0;
1910 tempAbsorb = currentAbsorb;
1930 for (AuraEffectList::iterator itr = vSplitDamageFlatCopy.begin(); (itr != vSplitDamageFlatCopy.end()) && (damageInfo.
GetDamage() > 0); ++itr)
1933 if (!((*itr)->GetBase()->IsAppliedOnTarget(damageInfo.
GetVictim()->
GetGUID())))
1940 Unit* caster = (*itr)->GetCaster();
1944 int32 splitDamage = (*itr)->GetAmount();
1958 uint32 splitted = splitDamage;
1959 uint32 splitted_absorb = 0;
1964 log.
absorb = splitted_absorb;
1976 for (AuraEffectList::iterator itr = vSplitDamagePctCopy.begin(); itr != vSplitDamagePctCopy.end() && damageInfo.
GetDamage() > 0; ++itr)
1988 Unit* caster = (*itr)->GetCaster();
1994 (*itr)->GetBase()->CallScriptEffectSplitHandlers((*itr), aurApp, damageInfo, splitDamage);
2012 log.
damage = splitDamage;
2013 log.
absorb = split_absorb;
2033 int32 absorbAmount = 0;
2036 bool existExpired =
false;
2040 for (AuraEffectList::const_iterator i = vHealAbsorb.begin(); i != vHealAbsorb.end() && absorbAmount <= healing; ++i)
2046 int32 currentAbsorb = (*i)->GetAmount();
2049 if (currentAbsorb <= 0)
2051 existExpired =
true;
2057 if (healing < currentAbsorb + absorbAmount)
2058 currentAbsorb = healing - absorbAmount;
2060 absorbAmount += currentAbsorb;
2063 (*i)->SetAmount((*i)->GetAmount() - currentAbsorb);
2065 if ((*i)->GetAmount() <= 0)
2066 existExpired =
true;
2072 for (AuraEffectList::const_iterator i = vHealAbsorb.begin(); i != vHealAbsorb.end();)
2081 i = vHealAbsorb.begin();
2086 if (absorbAmount > 0)
2136 TC_LOG_DEBUG(
"entities.unit",
"AttackerStateUpdate: {} attacked {} for {} dmg, absorbed {}, blocked {}, resisted {}.",
2157 targetGUID = selection;
2191 int32 sum = 0, tmp = 0;
2204 canParryOrBlock =
false;
2209 if (tmp > 0 && roll < (sum += tmp))
2221 && roll < (sum += tmp))
2226 if (canParryOrBlock)
2230 && roll < (sum += tmp))
2241 int32 skill = attackerWeaponSkill;
2242 int32 maxskill = attackerMaxSkillValueForLevel;
2243 skill = (skill > maxskill) ? maxskill : skill;
2247 tmp = 600 + (victimDefenseSkill - skill) * 120;
2248 tmp = std::min(tmp, 4000);
2249 if (tmp > 0 && roll < (sum += tmp))
2254 if (canParryOrBlock)
2258 && roll < (sum += tmp))
2264 if (tmp > 0 && roll < (sum += tmp))
2275 tmp = victimDefenseSkill;
2277 tmp = std::min(tmp, victimMaxSkillValueForLevel);
2279 tmp = attackerMaxSkillValueForLevel - tmp;
2281 tmp = std::max(tmp, 20);
2284 tmp = tmp * 200 - 1500;
2285 if (tmp > 0 && roll < (sum += tmp))
2295 float minDamage = 0.0f;
2296 float maxDamage = 0.0f;
2298 if (normalized || !addTotalPct || itemDamagesMask)
2301 if (!itemDamagesMask)
2302 itemDamagesMask = (1 << 0) | (1 << 1);
2306 if (itemDamagesMask & (1 << i))
2308 float minTmp, maxTmp;
2310 minDamage += minTmp;
2311 maxDamage += maxTmp;
2336 minDamage = std::max(0.f, minDamage);
2337 maxDamage = std::max(0.f, maxDamage);
2339 if (minDamage > maxDamage)
2340 std::swap(minDamage, maxDamage);
2350 return std::max(0.0f, std::min(1.0f, (22.0f + spellInfo->
MaxLevel -
GetLevel()) / 20.0f));
2387 int32 resistMech = 0;
2390 if (!effect.IsEffect())
2397 if (resistMech < temp)
2402 return std::max(resistMech, 0);
2430 int32 attackerWeaponSkill;
2449 tmp += resist_chance;
2459 bool canBlock =
true;
2479 tmp += deflect_chance;
2508 if (!aurEff->IsAffectingSpell(spellInfo))
2511 switch (aurEff->GetMiscValue())
2523 TC_LOG_DEBUG(
"entities.unit",
"Spell {} SPELL_AURA_IGNORE_COMBAT_RESULT has unhandled state {}", aurEff->GetId(), aurEff->GetMiscValue());
2532 if (dodgeChance < 0)
2535 if (roll < (tmp += dodgeChance))
2543 if (parryChance < 0)
2554 if (blockChance < 0)
2568 if (value >= hard_cap)
2570 value = (soft_cap + hard_cap) / 2;
2572 else if (value > soft_cap)
2574 value = soft_cap + ((value - soft_cap) / 2);
2599 int32 const skillDiff = victimMaxSkillValueForLevel - attackerWeaponSkill;
2601 float chance = 0.0f;
2602 float skillBonus = 0.0f;
2606 skillBonus = 0.04f * skillDiff;
2615 if (skillDiff <= 10)
2616 skillBonus = skillDiff * 0.1f;
2618 skillBonus = 1.0f + (skillDiff - 10) * 0.1f;
2622 chance += skillBonus;
2635 return std::max(chance, 0.0f);
2642 int32 const skillDiff = victimMaxSkillValueForLevel - attackerWeaponSkill;
2644 float chance = 0.0f;
2645 float skillBonus = 0.0f;
2648 if (playerVictim->CanParry())
2652 tmpitem = playerVictim->GetWeaponForAttack(
OFF_ATTACK,
true);
2657 skillBonus = 0.04f * skillDiff;
2667 if (skillDiff <= 10)
2668 skillBonus = skillDiff * 0.1f;
2670 skillBonus = 1.0f + (skillDiff - 10) * 1.6f;
2674 chance += skillBonus;
2681 return std::max(chance, 0.0f);
2686 float miss_chance = 5.0f;
2689 miss_chance += player->GetMissPercentageFromDefense();
2698 int32 const skillDiff = victimMaxSkillValueForLevel - attackerWeaponSkill;
2700 float chance = 0.0f;
2701 float skillBonus = 0.0f;
2704 if (playerVictim->CanBlock())
2710 skillBonus = 0.04f * skillDiff;
2721 if (skillDiff <= 10)
2722 skillBonus = skillDiff * 0.1f;
2724 skillBonus = 1.0f + (skillDiff - 10) * 0.1f;
2728 chance += skillBonus;
2729 return std::max(chance, 0.0f);
2771 int32 const skillDiff = victimDefenseSkill - attackerWeaponSkill;
2773 float skillBonus = 0.0f;
2774 float chance = critDone;
2791 skillBonus = -skillDiff * 0.04f;
2794 skillBonus = -skillDiff * 0.12f;
2795 if (skillDiff >= 15)
2799 chance += skillBonus;
2800 return std::max(chance, 0.f);
2814 Item* item = player->GetWeaponForAttack(attType,
true);
2830 ? player->GetMaxSkillValue(skill)
2831 : player->GetSkillValue(skill);
2891 if (i->second->IsExpired())
2900 if (itr->second->IsNeedClientUpdate())
2901 itr->second->ClientUpdate();
2907 GameObjectList::iterator itr;
2910 if (!(*itr)->isSpawned())
2913 (*itr)->SetRespawnTime(0);
2933 if (autoRepeatSpellInfo->
Id != 75)
2951 if (autoRepeatSpellInfo->
Id != 75)
3062 spell->
cancel(result, resultOther);
3160 if (spell->GetSpellInfo()->IsMoveAllowedChannel())
3248 createInfo.
Caster =
nullptr;
3270 AuraEffect const* auraEff = foundAura->GetEffect(spellEffectInfo.EffectIndex);
3274 int32 bp = spellEffectInfo.BasePoints;
3276 bp = *(createInfo.
BaseAmount + spellEffectInfo.EffectIndex);
3283 if (castItemGUID != foundAura->GetCastItemGUID())
3286 *oldGUID = castItemGUID;
3321 for (Unit::AuraList::iterator itr = scAuras.begin(); itr != scAuras.end();)
3323 if ((*itr) != aura &&
3327 itr = scAuras.begin();
3346 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());
3364 m_appliedAuras.insert(AuraApplicationMap::value_type(aurId, aurApp));
3405 uint32 aStateMask = (1 << (aState - 1));
3437 player->UpdateVisibleGameobjectsOrSpellClicks();
3453 TC_LOG_DEBUG(
"spells",
"Aura {} now is remove mode {}", aura->
GetId(), removeMode);
3471 bool auraStateFound =
false;
3475 bool canBreak =
false;
3477 for (AuraStateAurasMap::iterator itr =
m_auraStateAuras.lower_bound(auraState); itr !=
m_auraStateAuras.upper_bound(auraState) && !(auraStateFound && canBreak);)
3479 if (itr->second == aurApp)
3486 auraStateFound =
true;
3514 if (!auraStateFound)
3519 uint32 aStateMask = (1 << (auraState - 1));
3529 player->UpdateVisibleGameobjectsOrSpellClicks();
3542 for (AuraApplicationMap::iterator iter = range.first; iter != range.second;)
3544 if (iter->second == aurApp)
3586 Aura* aura = i->second;
3608 if (((itr->second->GetEffectMask() & reqEffMask) == reqEffMask) && (!casterGUID || itr->second->GetCasterGUID() == casterGUID))
3626 TC_LOG_ERROR(
"spells",
"Unit::RemoveOwnedAura() called with unallowed removeMode AURA_REMOVE_NONE, spellId {}", aura->
GetId());
3633 for (AuraMap::iterator itr = range.first; itr != range.second; ++itr)
3635 if (itr->second == aura)
3648 for (AuraMap::const_iterator itr = range.first; itr != range.second; ++itr)
3650 if (((itr->second->GetEffectMask() & reqEffMask) == reqEffMask)
3651 && (!casterGUID || itr->second->GetCasterGUID() == casterGUID)
3652 && (!itemCasterGUID || itr->second->GetCastItemGUID() == itemCasterGUID)
3653 && (!except || except != itr->second))
3677 for (AuraApplicationMap::iterator iter = range.first; iter != range.second;)
3679 Aura const* aura = iter->second->GetBase();
3714 for (AuraApplicationMap::iterator iter = range.first; iter != range.second;)
3716 if (aurApp == iter->second)
3738 if (check(iter->second))
3751 if (check(iter->second))
3764 if (check(iter->second))
3778 if (check(iter->second))
3790 for (AuraEffectList::iterator iter =
m_modAuras[auraType].begin(); iter !=
m_modAuras[auraType].end();)
3792 Aura* aura = (*iter)->GetBase();
3811 Aura const* aura = iter->second->GetBase();
3826 for (AuraMap::iterator iter = range.first; iter != range.second;)
3828 Aura* aura = iter->second;
3843 for (AuraMap::iterator iter = range.first; iter != range.second;)
3845 Aura* aura = iter->second;
3848 DispelInfo dispelInfo(dispeller, dispellerSpellId, chargesRemoved);
3871 for (AuraMap::iterator iter = range.first; iter != range.second;)
3873 Aura* aura = iter->second;
3879 uint8 recalculateMask = 0;
3889 recalculateMask |= (1<<i);
3907 oldAura->ModCharges(1);
3909 oldAura->ModStackAmount(1);
3910 oldAura->SetDuration(
int32(dur));
3926 if (newAura->IsSingleTarget())
3928 newAura->UnregisterSingleTarget();
3935 newAura->ApplyForTargets();
3956 if (iter->second->GetBase()->GetCastItemGUID() == castItemGuid)
3968 for (AuraEffectList::iterator iter =
m_modAuras[auraType].begin(); iter !=
m_modAuras[auraType].end();)
3970 Aura* aura = (*iter)->GetBase();
3975 if (aura != except && (!casterGUID || aura->
GetCasterGUID() == casterGUID)
3990 SpellInfo const* spell = iter->second->GetBase()->GetSpellInfo();
4011 Aura const* aura = iter->second;
4032 for (AuraList::iterator iter = scAuras.begin(); iter != scAuras.end();)
4038 iter = scAuras.begin();
4053 Aura* aura = (*iter)->GetBase();
4067 && (spell->m_spellInfo->ChannelInterruptFlags & flag)
4068 && spell->m_spellInfo->Id != except)
4078 Aura const* aura = iter->second->GetBase();
4102 std::vector<Aura*> aurasToUpdateTargets;
4106 if (exceptSpellId && aura->
GetId() == exceptSpellId)
4110 if (!(appliedMechanicMask & mechanicMaskToRemove))
4118 aurasToUpdateTargets.push_back(aura);
4122 for (
Aura* aura : aurasToUpdateTargets)
4124 aura->UpdateTargetMap(aura->GetCaster());
4127 if (!aura->IsPassive() && aura->GetOwner() ==
this && !aura->GetApplicationOfTarget(
GetGUID()))
4128 aura->Remove(removeMode);
4137 Aura const* aura = iter->second->GetBase();
4152 Aura* aura = iter->second;
4155 for (Aura::ApplicationMap::const_iterator itr = appMap.begin(); itr!= appMap.end();)
4171 if (iter->second->GetBase()->GetOwner() !=
this)
4186 AuraApplicationMap::iterator aurAppIter;
4190 AuraMap::iterator aurIter;
4194 const int maxIteration = 50;
4196 if (counter >= maxIteration)
4198 std::stringstream sstr;
4199 sstr <<
"Unit::RemoveAllAuras() iterated " << maxIteration <<
" times already but there are still "
4205 sstr <<
"m_appliedAuras:" <<
"\n";
4207 for (std::pair<uint32 const, AuraApplication*>& auraAppPair :
m_appliedAuras)
4208 sstr << auraAppPair.second->GetDebugInfo() <<
"\n";
4213 sstr <<
"m_ownedAuras:" <<
"\n";
4216 sstr << aura->GetDebugInfo() <<
"\n";
4257 Aura const* aura = iter->second->GetBase();
4266 Aura* aura = iter->second;
4278 Aura const* aura = iter->second->GetBase();
4287 Aura* aura = iter->second;
4299 Aura const* aura = iter->second->GetBase();
4308 Aura* aura = iter->second;
4320 Aura const* aura = iter->second->GetBase();
4329 Aura* aura = iter->second;
4341 Aura* aura = iter->second;
4354 for (; range.first != range.second; ++range.first)
4356 Aura* aura = range.first->second;
4385 for (AuraApplicationMap::const_iterator itr = range.first; itr != range.second; ++itr)
4387 if (itr->second->HasEffect(effIndex)
4388 && (!caster || itr->second->GetBase()->GetCasterGUID() == caster))
4403 rankSpell =
sSpellMgr->GetNextSpellInChain(rankSpell);
4411 for (Unit::AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
4413 if (effIndex != (*itr)->GetEffIndex())
4415 SpellInfo const* spell = (*itr)->GetSpellInfo();
4425 for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
4427 SpellInfo const* spell = (*i)->GetSpellInfo();
4430 if (!casterGUID.
IsEmpty() && (*i)->GetCasterGUID() != casterGUID)
4446 for (; range.first != range.second; ++range.first)
4454 && (!except || except != app))
4465 return aurApp ? aurApp->
GetBase() :
nullptr;
4475 rankSpell =
sSpellMgr->GetNextSpellInChain(rankSpell);
4483 return aurApp ? aurApp->
GetBase() :
nullptr;
4493 for (
auto itr = auras.begin(); itr != auras.end(); ++itr)
4495 Aura* aura = itr->second;
4523 dispelList.emplace_back(aura, chance, charges);
4531 for (AuraApplicationMap::const_iterator itr = range.first; itr != range.second; ++itr)
4533 if (itr->second->HasEffect(effIndex)
4534 && (!caster || itr->second->GetBase()->GetCasterGUID() == caster))
4547 for (AuraApplicationMap::const_iterator itr = range.first; itr != range.second; ++itr)
4549 if (itr->second->GetBase()->GetStackAmount() == 0)
4552 count += (
uint32)itr->second->GetBase()->GetStackAmount();
4573 if (caster == eff->GetCasterGUID())
4581 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
4582 if (miscvalue == (*i)->GetMiscValue())
4590 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
4591 if ((*i)->IsAffectingSpell(affectedSpell))
4599 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
4600 if (value == (*i)->GetAmount())
4608 if (aura->GetSpellEffectInfo().TriggerSpell == triggerSpell)
4619 if (!(*iter)->IsPositive() && (*iter)->GetBase()->GetSpellInfo()->AuraInterruptFlags & flag && (!guid || (*iter)->GetBase()->GetCasterGUID() == guid))
4629 SpellInfo const* spellInfo = iter->second->GetBase()->GetSpellInfo();
4634 if (iter->second->HasEffect(spellEffectInfo.EffectIndex) && spellEffectInfo.IsEffect() && spellEffectInfo.Mechanic)
4635 if (mechanicMask & (1 << spellEffectInfo.Mechanic))
4648 SpellInfo const* spellInfo = itr->second->GetBase()->GetSpellInfo();
4655 if (newDuration > 0 && newDuration < existingDuration)
4665 for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
4667 if ((*i)->GetMiscValue() == script)
4668 if ((*i)->IsAffectingSpell(spell))
4676 static const AuraType diseaseAuraTypes[] =
4683 for (
AuraType aType : diseaseAuraTypes)
4689 && (*itr)->GetCasterGUID() == casterGUID)
4695 RemoveAura((*itr)->GetId(), (*itr)->GetCasterGUID());
4708 static const AuraType diseaseAuraTypes[] =
4719 for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
4722 if ((*i)->GetCasterGUID() == casterGUID)
4732 if (mTotalAuraList.empty())
4735 std::map<SpellGroup, int32> sameEffectSpellGroup;
4738 for (
AuraEffect const* aurEff : mTotalAuraList)
4740 if (predicate(aurEff))
4744 if (!
sSpellMgr->AddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(),
static_cast<uint32>(auraType), aurEff->GetAmount(), sameEffectSpellGroup))
4745 modifier += aurEff->GetAmount();
4750 for (
auto itr = sameEffectSpellGroup.begin(); itr != sameEffectSpellGroup.end(); ++itr)
4751 modifier += itr->second;
4759 if (mTotalAuraList.empty())
4762 std::map<SpellGroup, int32> sameEffectSpellGroup;
4763 float multiplier = 1.0f;
4765 for (
AuraEffect const* aurEff : mTotalAuraList)
4767 if (predicate(aurEff))
4771 if (!
sSpellMgr->AddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(),
static_cast<uint32>(auraType), aurEff->GetAmount(), sameEffectSpellGroup))
4772 AddPct(multiplier, aurEff->GetAmount());
4777 for (
auto itr = sameEffectSpellGroup.begin(); itr != sameEffectSpellGroup.end(); ++itr)
4778 AddPct(multiplier, itr->second);
4786 if (mTotalAuraList.empty())
4790 for (
AuraEffect const* aurEff : mTotalAuraList)
4792 if (predicate(aurEff))
4793 modifier = std::max(modifier, aurEff->GetAmount());
4802 if (mTotalAuraList.empty())
4806 for (
AuraEffect const* aurEff : mTotalAuraList)
4808 if (predicate(aurEff))
4809 modifier = std::min(modifier, aurEff->GetAmount());
4859 if (except != aurEff && (aurEff->
GetMiscValue() & miscMask) != 0)
4957 float modPos = 0.0f;
4958 float modNeg = 0.0f;
4994 float modPos = 0.0f;
4995 float modNeg = 0.0f;
4996 float factor = 0.0f;
5009 modValue =
static_cast<Guardian*
>(
this)->GetBonusStatFromOwner(stat);
5063 std::vector<DynamicObject*> dynamicobjects =
GetDynObjects(spellId);
5064 return dynamicobjects.empty() ? nullptr : dynamicobjects.front();
5069 std::vector<DynamicObject*> dynamicobjects;
5070 for (DynObjectList::const_iterator i =
m_dynObj.begin(); i !=
m_dynObj.end(); ++i)
5071 if ((*i)->GetSpellId() == spellId)
5072 dynamicobjects.push_back(*i);
5074 return dynamicobjects;
5103 return gameobjects.empty() ? nullptr : gameobjects.front();
5108 std::vector<GameObject*> gameobjects;
5109 for (GameObjectList::const_iterator i =
m_gameObj.begin(); i !=
m_gameObj.end(); ++i)
5110 if ((*i)->GetSpellId() == spellId)
5111 gameobjects.push_back(*i);
5140 objectSlotItr->Clear();
5178 if (spellid == 0 || (*i)->GetSpellId() == spellid)
5221 if (typeMaskActor && actor)
5224 if (typeMaskActionTarget && actionTarget)
5228 actor->
TriggerAurasProcOnEvent(actionTarget, typeMaskActor, typeMaskActionTarget, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo);
5305 packet.
OverDamage = (overkill < 0 ? 0 : overkill);
5307 for (std::size_t i = 0; i < packet.
SubDmg.size(); ++i)
5335 dmgInfo.
Damages[0].
Damage = Damage - AbsorbDamage - Resist - BlockedAmount;
5346 dmgInfo.
Blocked = BlockedAmount;
5367 if (pet->isControlled())
5379 switch (new_powertype)
5425 displayPower =
Powers(powerDisplay->ActualType);
5433 else if (pet->IsPetGhoul() || pet->IsRisenAlly())
5479 if (!victim || victim ==
this)
5580 if (
CreatureAI* controlledAI = cControlled->AI())
5581 controlledAI->OwnerAttacked(victim);
5607 creature->SetNoCallAssistance(
false);
5620 for (
Unit* attacker : attackers)
5621 if (!attacker->IsValidAttackTarget(
this))
5622 toRemove.push_back(attacker);
5624 for (
Unit* attacker : toRemove)
5625 attacker->AttackStop();
5657 minion->CombatStop(includingCast);
5666 if ((*itr)->isAttackingPlayer())
5672 if (summon->isAttackingPlayer())
5683 if (!(*iter)->AttackStop())
5685 TC_LOG_ERROR(
"entities.unit",
"WORLD: Unit has an attacker that isn't attacking it!");
5701 for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr)
5706 if (!spellInfo || !spellInfo->
IsPassive())
5714 for (PetSpellMap::const_iterator itr = pet->m_spells.begin(); itr != pet->m_spells.end(); ++itr)
5719 if (!spellInfo || !spellInfo->
IsPassive())
5734 for (Unit::AuraApplicationMap::iterator itr = tAuras.begin(); itr != tAuras.end();)
5736 SpellInfo const* spellProto = itr->second->GetBase()->GetSpellInfo();
5751 if (itr->second->GetBase()->GetCasterGUID() == target->
GetGUID())
5752 auraStates |= (1 << (itr->first - 1));
5772 for (AuraStateAurasMap::const_iterator itr = range.first; itr != range.second; ++itr)
5773 if (itr->second->GetBase()->GetCasterGUID() == Caster->
GetGUID())
5813 return master->GetControllingPlayer();
5829 TC_LOG_ERROR(
"entities.unit",
"Unit::GetFirstMinion: Minion {} not exist.", pet_guid.
ToString());
5845 TC_LOG_FATAL(
"entities.unit",
"Unit::GetGuardianPet: Guardian {} not exist.", pet_guid.
ToString());
5885 if (oldPet != minion && (oldPet->IsPet() || minion->
IsPet() || oldPet->GetEntry() != minion->
GetEntry()))
5888 if (
Pet* oldPetAsPet = oldPet->
ToPet())
5970 if (
GetGUID() == (*itr)->GetCharmerGUID())
5974 if ((*itr)->GetOwnerGUID() !=
GetGUID())
5977 (*itr)->OutDebugInfo();
5990 if ((*itr)->IsPet())
6112 victimAI->HealReceived(healer, addhealth);
6114 if (
UnitAI* healerAI = healer ? healer->
GetAI() :
nullptr)
6115 healerAI->HealDone(victim, addhealth);
6123 Unit* unit = healer;
6164 for (AuraEffectList::const_iterator i = hitTriggerAuras.begin(); i != hitTriggerAuras.end(); ++i)
6166 if (
Unit* magnet = (*i)->GetBase()->GetCaster())
6208 TC_LOG_ERROR(
"entities.unit",
"Unit {} is trying to release unit {} which is neither charmed nor owned by it",
GetEntry(), target->
GetEntry());
6233 return u->isPossessed();
6243 return const_cast<Unit*
>(
this);
6248 Player* player =
nullptr;
6272 std::vector<Unit*> nearMembers;
6277 if (
Player* Target = itr->GetSource())
6281 nearMembers.push_back(Target);
6286 nearMembers.push_back(pet);
6289 if (nearMembers.empty())
6292 uint32 randTarget =
urand(0, nearMembers.size()-1);
6293 return nearMembers[randTarget];
6340 if (OldTotem->IsSummon())
6341 OldTotem->ToTempSummon()->UnSummon();
6355 data <<
uint8(critical ? 1 : 0);
6375 data <<
uint32(powerType);
6376 data <<
int32(damage);
6405 return owner->SpellDamageBonusDone(victim, spellProto, pdamage, damagetype, spellEffectInfo, donePctTotal, stack);
6407 float ApCoeffMod = 1.0f;
6408 int32 DoneTotal = 0;
6409 float DoneTotalMod = donePctTotal ? *donePctTotal :
SpellDamagePctDone(victim, spellProto, damagetype);
6448 for (
auto itr = playerSpells.begin(); itr != playerSpells.end(); ++itr)
6477 DoneAdvertisedBenefit +=
static_cast<Guardian const*
>(
this)->GetBonusDamage();
6487 if (damagetype ==
DOT)
6489 coeff = bonus->dot_damage;
6490 if (bonus->ap_dot_bonus > 0)
6491 DoneTotal +=
int32(bonus->ap_dot_bonus * stack * ApCoeffMod * APbonus);
6495 coeff = bonus->direct_damage;
6496 if (bonus->ap_bonus > 0)
6497 DoneTotal +=
int32(bonus->ap_bonus * stack * ApCoeffMod * APbonus);
6504 return uint32(std::max(pdamage * DoneTotalMod, 0.0f));
6508 if (DoneAdvertisedBenefit)
6521 DoneTotal +=
int32(DoneAdvertisedBenefit * coeff * factorMod);
6524 float tmpDamage = float(
int32(pdamage) + DoneTotal) * DoneTotalMod;
6530 return uint32(std::max(tmpDamage, 0.0f));
6549 return owner->SpellDamagePctDone(victim, spellProto, damagetype);
6552 float DoneTotalMod = 1.0f;
6558 float maxModDamagePercentSchool = 0.0f;
6568 DoneTotalMod *= maxModDamagePercentSchool;
6589 for (AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
6591 if (!(*i)->IsAffectingSpell(spellProto))
6594 switch ((*i)->GetMiscValue())
6603 AddPct(DoneTotalMod, (*i)->GetAmount());
6611 int32 maxPercent = (*i)->GetAmount();
6615 int32 modPercent = 0;
6617 for (AuraApplicationMap::const_iterator itr = victimAuras.begin(); itr != victimAuras.end(); ++itr)
6619 Aura const* aura = itr->second->GetBase();
6624 if (modPercent >= maxPercent)
6626 modPercent = maxPercent;
6630 AddPct(DoneTotalMod, modPercent);
6637 AddPct(DoneTotalMod, (*i)->GetAmount());
6642 AddPct(DoneTotalMod, (*i)->GetAmount());
6650 if ((*i)->GetSpellInfo()->SpellIconID == 2656)
6653 AddPct(DoneTotalMod, (*i)->GetAmount());
6660 AddPct(DoneTotalMod, (*i)->GetAmount());
6669 AddPct(DoneTotalMod, (*i)->GetSpellInfo()->GetRank() * 2.0f);
6676 AddPct(DoneTotalMod, (*i)->GetAmount());
6687 AddPct(DoneTotalMod, (*i)->GetAmount());
6699 int32 bonus = -(*i)->GetBase()->GetEffect(0)->GetAmount();
6700 AddPct(DoneTotalMod, bonus);
6718 DoneTotalMod *= 4.0f;
6720 DoneTotalMod *= 3.0f;
6730 for (AuraEffectList::const_iterator i = mDumyAuras.begin(); i != mDumyAuras.end(); ++i)
6732 if ((*i)->GetSpellInfo()->SpellIconID == 3263)
6734 AddPct(DoneTotalMod, (*i)->GetAmount());
6781 for (Unit::AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
6783 if (((*itr)->GetId() == 31803 || (*itr)->GetId() == 53742) && (*itr)->GetCasterGUID() ==
GetGUID())
6785 stacks = (*itr)->GetBase()->GetStackAmount();
6791 AddPct(DoneTotalMod, 10 * stacks);
6810 AddPct(DoneTotalMod, aurEFf->GetAmount());
6816 AddPct(DoneTotalMod, 15 * count);
6824 DoneTotalMod = 1.0f;
6847 return DoneTotalMod;
6855 float TakenTotalMod = 1.0f;
6870 for (AuraEffectList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i)
6872 switch ((*i)->GetSpellInfo()->SpellIconID)
6882 AddPct(TakenTotalMod, std::max(mod,
float((*i)->GetAmount())));
6908 if (caster && TakenTotalMod < 1.0f)
6910 float damageReduction = 1.0f - TakenTotalMod;
6912 for (
AuraEffect const* aurEff : casterIgnoreResist)
6914 if (!(aurEff->GetMiscValue() & spellProto->
GetSchoolMask()))
6917 AddPct(damageReduction, -aurEff->GetAmount());
6920 TakenTotalMod = 1.0f - damageReduction;
6923 float tmpDamage = pdamage * TakenTotalMod;
6924 return uint32(std::max(tmpDamage, 0.0f));
6938 for (
AuraEffect const* aurEff : mDamageDoneOfStatPercent)
6940 if ((aurEff->GetMiscValue() & schoolMask) != 0)
6943 Stats const usedStat =
static_cast<Stats>(aurEff->GetMiscValueB());
6952 return DoneAdvertisedBenefit;
6965 float crit_chance = 0.0f;
6971 auto getPhysicalCritChance = [&]
6976 auto getMagicCritChance = [&]
6985 crit_chance = std::max(crit_chance, getPhysicalCritChance());
6988 crit_chance = std::max(crit_chance, getMagicCritChance());
7006 return std::max(crit_chance, 0.0f);
7015 float crit_chance = doneChance;
7038 for (
AuraEffect const* aurEff : mOverrideClassScript)
7040 if (!aurEff->IsAffectingSpell(spellInfo))
7043 float modChance = 0.f;
7044 switch (aurEff->GetMiscValue())
7057 crit_chance += modChance;
7061 crit_chance += aurEff->GetAmount();
7066 crit_chance += aurEff->GetAmount();
7080 crit_chance += aurEff->GetAmount();
7086 crit_chance += aurEff->GetAmount();
7096 crit_chance += aurEff->GetAmount();
7111 crit_chance += aura->GetAmount();
7138 crit_chance -= levelDiff * 0.7f;
7157 crit_chance += rendAndTear->GetAmount();
7167 crit_chance += aurEff->GetAmount();
7194 return std::max(crit_chance, 0.0f);
7200 int32 crit_bonus = damage;
7201 float crit_mod = 0.0f;
7208 crit_bonus += damage;
7211 crit_bonus += damage / 2;
7222 if (crit_bonus != 0)
7223 AddPct(crit_bonus, crit_mod);
7225 crit_bonus -= damage;
7227 if (damage >
uint32(crit_bonus))
7234 crit_bonus += damage;
7249 crit_bonus = damage;
7252 crit_bonus = damage / 2;
7266 damage += crit_bonus;
7279 return owner->SpellHealingBonusDone(victim, spellProto, healamount, damagetype, spellEffectInfo, donePctTotal, stack);
7285 float ApCoeffMod = 1.0f;
7286 int32 DoneTotal = 0;
7287 float DoneTotalMod = donePctTotal ? *donePctTotal :
SpellHealingPctDone(victim, spellProto);
7292 for (
AuraEffect const* aurEff : mOverrideClassScript)
7294 if (!aurEff->IsAffectingSpell(spellProto))
7297 switch (aurEff->GetMiscValue())
7302 DoneTotal += aurEff->GetAmount();
7317 for (
auto itr = playerSpells.begin(); itr != playerSpells.end(); ++itr)
7346 DoneAdvertisedBenefit +=
static_cast<Guardian const*
>(
this)->GetBonusDamage();
7356 if (damagetype ==
DOT)
7358 coeff = bonus->dot_damage;
7359 if (bonus->ap_dot_bonus > 0)
7360 DoneTotal +=
int32(bonus->ap_dot_bonus * stack * ApCoeffMod * APbonus);
7364 coeff = bonus->direct_damage;
7365 if (bonus->ap_bonus > 0)
7366 DoneTotal +=
int32(bonus->ap_bonus * stack * ApCoeffMod * APbonus);
7373 return uint32(std::max(healamount * DoneTotalMod, 0.0f));
7377 if (DoneAdvertisedBenefit)
7390 DoneTotal +=
int32(DoneAdvertisedBenefit * coeff * factorMod);
7395 switch (otherSpellEffect.ApplyAuraName)
7409 float heal = float(
int32(healamount) + DoneTotal) * DoneTotalMod;
7415 return uint32(std::max(heal, 0.0f));
7423 return owner->SpellHealingPctDone(victim, spellProto);
7437 float DoneTotalMod = 1.0f;
7445 for (
AuraEffect const* aurEff : mOverrideClassScript)
7447 if (!aurEff->IsAffectingSpell(spellProto))
7450 switch (aurEff->GetMiscValue())
7456 AddPct(DoneTotalMod, aurEff->GetAmount());
7461 AddPct(DoneTotalMod, aurEff->GetAmount());
7466 int32 stepPercent = aurEff->GetAmount();
7467 int32 modPercent = 0;
7469 for (AuraApplicationMap::const_iterator itr = victimAuras.begin(); itr != victimAuras.end(); ++itr)
7471 Aura const* aura = itr->second->GetBase();
7481 AddPct(DoneTotalMod, modPercent);
7487 AddPct(DoneTotalMod, aurEff->GetAmount());
7495 return DoneTotalMod;
7500 float TakenTotalMod = 1.0f;
7505 AddPct(TakenTotalMod, minval);
7509 AddPct(TakenTotalMod, maxval);
7517 TakenTotalMod *= 1.2f;
7520 if (damagetype ==
DOT)
7525 AddPct(TakenTotalMod, minval_hot);
7529 AddPct(TakenTotalMod, maxval_hot);
7542 float heal = healamount * TakenTotalMod;
7543 return uint32(std::max(heal, 0.0f));
7563 for (AuraEffectList::const_iterator i = mHealingDoneOfStatPercent.begin(); i != mHealingDoneOfStatPercent.end(); ++i)
7566 Stats usedStat =
Stats((*i)->GetSpellEffectInfo().MiscValue);
7572 for (AuraEffectList::const_iterator i = mHealingDonebyAP.begin(); i != mHealingDonebyAP.end(); ++i)
7573 if ((*i)->GetMiscValue() & schoolMask)
7576 return advertisedBenefit;
7586 if ((schoolImmunityMask & schoolMask) == schoolMask)
7591 if ((damageImmunityMask & schoolMask) == schoolMask)
7612 uint32 schoolImmunityMask = 0;
7614 for (
auto itr = schoolList.begin(); itr != schoolList.end(); ++itr)
7616 schoolImmunityMask |= itr->first;
7619 if ((schoolImmunityMask & schoolMask) == schoolMask)
7624 if ((damageImmunityMask & schoolMask) == schoolMask)
7639 if (!requireImmunityPurgesEffectAttribute)
7640 return range.
begin() != range.
end();
7642 return std::any_of(range.
begin(), range.
end(), [](SpellImmuneContainer::value_type
const& entry)
7644 if (SpellInfo const* immunitySourceSpell = sSpellMgr->GetSpellInfo(entry.second))
7645 if (immunitySourceSpell->HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY))
7654 if (hasImmunity(idList, spellInfo->
Id))
7663 if (hasImmunity(dispelList, dispel))
7671 if (hasImmunity(mechanicList, mechanic))
7675 bool immuneToAllEffects =
true;
7680 if (!spellEffectInfo.IsEffect())
7685 immuneToAllEffects =
false;
7690 if (immuneToAllEffects)
7695 uint32 schoolImmunityMask = 0;
7697 for (
auto itr = schoolList.begin(); itr != schoolList.end(); ++itr)
7699 if ((itr->first & schoolMask) == 0)
7703 if (requireImmunityPurgesEffectAttribute)
7711 schoolImmunityMask |= itr->first;
7714 if ((schoolImmunityMask & schoolMask) == schoolMask)
7725 for (
auto itr = schoolList.begin(); itr != schoolList.end(); ++itr)
7735 for (
auto itr = damageList.begin(); itr != damageList.end(); ++itr)
7745 for (
auto itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
7746 mask |= (1 << itr->first);
7752 bool requireImmunityPurgesEffectAttribute )
const
7754 if (!spellInfo || !spellEffectInfo.
IsEffect())
7763 if (!requireImmunityPurgesEffectAttribute)
7764 return range.
begin() != range.
end();
7766 return std::any_of(range.
begin(), range.
end(), [](SpellImmuneContainer::value_type
const& entry)
7768 if (SpellInfo const* immunitySourceSpell = sSpellMgr->GetSpellInfo(entry.second))
7769 if (immunitySourceSpell->HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY))
7778 if (hasImmunity(effectList, spellEffectInfo.
Effect))
7784 if (hasImmunity(mechanicList, mechanic))
7793 if (hasImmunity(list, aura))
7801 for (AuraEffectList::const_iterator iter = immuneAuraApply.begin(); iter != immuneAuraApply.end(); ++iter)
7802 if (((*iter)->GetMiscValue() & spellInfo->
GetSchoolMask()) &&
7813 if (!victim || pdamage == 0)
7819 int32 DoneFlatBenefit = 0;
7852 float DoneTotalMod = 1.0f;
7862 float maxModDamagePercentSchool = 0.0f;
7866 if (schoolMask & (1 << i))
7872 DoneTotalMod *= maxModDamagePercentSchool;
7887 if (spellProto && spellProto->
Mechanic)
7893 for (AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
7895 if (!(*i)->IsAffectingSpell(spellProto))
7898 switch ((*i)->GetMiscValue())
7905 if ((*i)->GetSpellInfo()->SpellIconID == 2656)
7908 AddPct(DoneTotalMod, (*i)->GetAmount());
7915 AddPct(DoneTotalMod, (*i)->GetAmount());
7923 AddPct(DoneTotalMod, (*i)->GetSpellInfo()->GetRank() * 2.0f);
7934 AddPct(DoneTotalMod, (*i)->GetAmount());
7944 int32 bonus = -(*i)->GetBase()->GetEffect(0)->GetAmount();
7945 AddPct(DoneTotalMod, bonus);
7967 float tmpDamage = float(
int32(pdamage) + DoneFlatBenefit) * DoneTotalMod;
7970 return uint32(std::max(tmpDamage, 0.0f));
7978 int32 TakenFlatBenefit = 0;
7988 if ((TakenFlatBenefit < 0) && (pdamage <
static_cast<uint32>(-TakenFlatBenefit)))
7992 float TakenTotalMod = 1.0f;
8028 for (AuraEffectList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i)
8030 switch ((*i)->GetSpellInfo()->SpellIconID)
8040 AddPct(TakenTotalMod, std::max(mod,
float((*i)->GetAmount())));
8061 if (TakenTotalMod < 1.0f)
8065 float damageReduction = 1.0f - TakenTotalMod;
8067 for (
AuraEffect const* aurEff : casterIgnoreResist)
8069 if (!(aurEff->GetMiscValue() & attackSchoolMask))
8072 AddPct(damageReduction, -aurEff->GetAmount());
8075 TakenTotalMod = 1.0f - damageReduction;
8078 float tmpDamage = float(pdamage + TakenFlatBenefit) * TakenTotalMod;
8079 return uint32(std::max(tmpDamage, 0.0f));
8089 for (
auto itr = bounds.first; itr != bounds.second;)
8091 if (itr->second == spellId)
8121 return std::floor((WeaponSpeed * PPM) / 600.0f);
8141 data <<
uint32(VehicleId);
8144 player->SendOnCancelExpectedVehicleRideAura();
8152 Pet* pet = player->GetPet();
8160 player->UnsummonPetTemporaryIfAny();
8168 player->SendMovementSetCollisionHeight(player->GetCollisionHeight());
8183 thisPlayer->SendMovementSetCollisionHeight(thisPlayer->GetCollisionHeight());
8208 if (
Pet* pPet = player->GetPet())
8214 player->ResummonPetTemporaryUnSummonedIfAny();
8264 std::list<CombatReference*> toEnd;
8267 toEnd.push_back(pair.second);
8270 toEnd.push_back(pair.second);
8287 std::list<CombatReference*> toEnd;
8290 toEnd.push_back(pair.second);
8293 toEnd.push_back(pair.second);
8330 int32 val = dVal + curHealth;
8339 if (val < maxHealth)
8342 gain = val - curHealth;
8344 else if (curHealth != maxHealth)
8347 gain = maxHealth - curHealth;
8362 int32 val = dVal + curHealth;
8370 if (val < maxHealth)
8372 else if (curHealth != maxHealth)
8373 gain = maxHealth - curHealth;
8388 int32 val = dVal + curPower;
8399 SetPower(power, val, withPowerUpdate);
8400 gain = val - curPower;
8402 else if (curPower != maxPower)
8404 SetPower(power, maxPower, withPowerUpdate);
8405 gain = maxPower - curPower;
8414 return (
uint32)f_BaseAttackTime;
8431 if (ownerPlayer->IsGroupVisibleFor(seerPlayer))
8465 int32 main_speed_mod = 0;
8466 float stack_bonus = 1.0f;
8467 float non_stack_bonus = 1.0f;
8507 int32 owner_speed_mod = 0;
8512 main_speed_mod = std::max(main_speed_mod, owner_speed_mod);
8530 TC_LOG_ERROR(
"entities.unit",
"Unit::UpdateSpeed: Unsupported move type ({})", mtype);
8535 float speed = std::max(non_stack_bonus, stack_bonus);
8537 AddPct(speed, main_speed_mod);
8555 uint32 immuneMask = creature->GetCreatureTemplate()->MechanicImmuneMask;
8562 if (speed > max_speed)
8573 if (creature->HasUnitTypeMask(
UNIT_MASK_MINION) && !creature->IsInCombat())
8581 if (speed < ownerSpeed || creature->
IsWithinDist3d(followed, 10.0f))
8596 float baseMinSpeed = 1.0f;
8600 float min_speed =
CalculatePct(baseMinSpeed, minSpeedMod);
8601 if (speed < min_speed)
8651 pet->SetSpeedRate(mtype, rate);
8712 zoneScript->OnUnitDeath(
this);
8733 if (!target->
IsEngaged() && !canInitialAggro)
8737 targetOwner->EngageWithTarget(
this);
8742 creature->SetLootRecipient(
this);
8746 if (myPlayerOwner && targetPlayerOwner && !(myPlayerOwner->
duel && myPlayerOwner->
duel->Opponent == targetPlayerOwner))
8760 if (minion->IsInCombat())
8794 if (currentLevel < maxLevel)
8795 diminish.
hitCount = currentLevel + 1;
8811 if (limitDuration > 0 && duration > limitDuration)
8813 Unit const* target = targetOwner ? targetOwner :
this;
8814 WorldObject const* source = casterOwner ? casterOwner : caster;
8817 duration = limitDuration;
8853 duration =
int32(duration * mod);
8854 return (duration != 0);
8864 else if (diminish.
stack)
8869 if (!diminish.
stack)
8901 return (creatureType >= 1) ? (1 << (creatureType - 1)) : 0;
8927 if (!(shapeshift->
Flags & 0x1))
8960 var *= (apply ? (100.0f + val) / 100.0f : 100.0f / (100.0f + val));
8967 TC_LOG_ERROR(
"entities.unit",
"ERROR in HandleStatFlatModifier(): non-existing UnitMods or wrong UnitModifierType!");
8974 switch (modifierType)
8991 TC_LOG_ERROR(
"entities.unit",
"ERROR in ApplyStatPctModifier(): non-existing UnitMods or wrong UnitModifierType!");
8998 switch (modifierType)
9033 TC_LOG_ERROR(
"entities.unit",
"attempt to access non-existing modifier value from UnitMods!");
9044 TC_LOG_ERROR(
"entities.unit",
"attempt to access non-existing modifier value from UnitMods!");
9095 TC_LOG_ERROR(
"entities.unit",
"ERROR in HandleAttackPowerModifier(): non-existing AttackPowerModIndex or wrong AttackPowerModType!");
9099 switch (modifierType)
9119 TC_LOG_ERROR(
"entities.unit",
"ERROR in GetAttackPowerModifierValue(): non-existing AttackPowerModIndex or wrong AttackPowerModType!");
9223 TC_LOG_ERROR(
"entities.unit",
"attempt to access non-existing UnitMods in GetTotalAuraModValue()!");
9331 if (player->GetGroup())
9347 if (maxHealth < val)
9356 if (player->GetGroup())
9361 if (pet->isControlled())
9386 if (pet->isControlled())
9400 if (!force &&
GetPower(power) == val)
9409 if (withPowerUpdate)
9413 data <<
uint8(power);
9421 if (player->GetGroup())
9426 if (pet->isControlled())
9452 if (pet->isControlled())
9460 if (val < cur_power)
9503 i_AIs.emplace(newAI);
9615 if (owner->m_Controlled.find(
this) != owner->m_Controlled.end())
9617 TC_LOG_FATAL(
"entities.unit",
"Unit {} is in controlled list of {} when removed from world",
GetEntry(), owner->GetEntry());
9675 if (
CreatureAI* charmerAI = creatureCharmer->AI())
9676 newAI = charmerAI->GetAIForCharmedPlayer(
ToPlayer());
9703 ai->OnCharmed(
true);
9727 _isCommandAttack(false), _isCommandFollow(false), _isAtStay(false), _isFollowing(false), _isReturning(false),
9728 _stayX(0.0f), _stayY(0.0f), _stayZ(0.0f)
9937 auto iter = tokens.begin();
9943 if (!type || !action)
9984 switch (missCondition)
10037 if (!damageNullified)
10066 !procTarget->
IsPet()
10144 ASSERT(aurApp->GetTarget() ==
this);
10145 if (
uint8 procEffectMask = aurApp->GetBase()->GetProcEffectMask(aurApp, eventInfo, now))
10147 aurApp->GetBase()->PrepareProcToTrigger(aurApp, eventInfo, now);
10148 aurasTriggeringProc.emplace_back(procEffectMask, aurApp);
10157 if (
uint8 procEffectMask = itr->second->GetBase()->GetProcEffectMask(itr->second, eventInfo, now))
10159 itr->second->GetBase()->PrepareProcToTrigger(itr->second, eventInfo, now);
10160 aurasTriggeringProc.emplace_back(procEffectMask, itr->second);
10169 ProcEventInfo myProcEventInfo(
this, actionTarget, typeMaskActor, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo);
10178 if (modOwner !=
this && spell)
10181 for (
auto itr = modOwner->GetAppliedAuras().begin(); itr != modOwner->GetAppliedAuras().end(); ++itr)
10183 if (spell->
m_appliedMods.count(itr->second->GetBase()) != 0)
10184 modAuras.push_back(itr->second);
10186 modOwner->GetProcAurasTriggeredOnEvent(myAurasTriggeringProc, &modAuras, myProcEventInfo);
10193 ProcEventInfo targetProcEventInfo(
this, actionTarget, typeMaskActionTarget, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo);
10194 if (typeMaskActionTarget && actionTarget)
10205 bool const disableProcs = triggeringSpell && triggeringSpell->
IsProcDisabled();
10209 for (
auto const& aurAppProc : aurasTriggeringProc)
10212 uint8 procEffectMask;
10213 std::tie(procEffectMask, aurApp) = aurAppProc;
10240 petActionFeedback.
SpellID = spellId;
10249 petActionSound.
Action = action;
10310 movementGenerator->Pause(timer);
10322 movementGenerator->Resume(timer);
10396 if (!transforms.empty())
10399 for (
auto i = transforms.rbegin(); i != transforms.rend(); ++i)
10404 handledAura = (*i);
10406 if (!aurApp->IsPositive())
10408 handledAura = (*i);
10423 else if (!shapeshiftAura.empty())
10483 playerMe->SendDirectMessage(&data);
10487 Player* owner =
nullptr;
10490 if (movingMe || owner)
10499 if (owner && owner != movingMe)
10569 std::list<Unit*> targets;
10579 targets.remove(exclude);
10582 for (std::list<Unit*>::iterator tIter = targets.begin(); tIter != targets.end();)
10584 if (!
IsWithinLOSInMap(*tIter) || (*tIter)->IsTotem() || (*tIter)->IsSpiritService() || (*tIter)->IsCritter())
10585 targets.erase(tIter++);
10591 if (targets.empty())
10636 if (CastingTime > 7000) CastingTime = 7000;
10637 if (CastingTime < 1500) CastingTime = 1500;
10640 CastingTime = 3500;
10642 int32 overTime = 0;
10644 bool DirectDamage =
false;
10645 bool AreaEffect =
false;
10649 switch (spellEffectInfo.Effect)
10657 DirectDamage =
true;
10660 switch (spellEffectInfo.ApplyAuraName)
10678 if (spellEffectInfo.IsTargetingArea())
10683 if (overTime > 0 && DirectDamage)
10687 if (OriginalCastTime > 7000) OriginalCastTime = 7000;
10688 if (OriginalCastTime < 1500) OriginalCastTime = 1500;
10690 float PtOT = (overTime / 15000.0f) / ((overTime / 15000.0f) + (OriginalCastTime / 3500.0f));
10692 if (damagetype ==
DOT)
10693 CastingTime =
uint32(CastingTime * PtOT);
10694 else if (PtOT < 1.0f)
10695 CastingTime =
uint32(CastingTime * (1 - PtOT));
10716 for (
uint8 i = 0; i < effects; ++i)
10717 CastingTime *= 0.95f;
10719 return CastingTime;
10728 if (player->GetGroup())
10731 player->SetAuraUpdateMaskForRaid(slot);
10736 Pet* pet = ((
Pet*)
this);
10763 float DotFactor = 1.0f;
10764 if (damagetype ==
DOT)
10767 if (!spellInfo->
IsChanneled() && DotDuration > 0)
10768 DotFactor = DotDuration / 15000.0f;
10771 DotFactor /= DotTicks;
10779 return (CastingTime / 3500.0f) * DotFactor;
10887 TC_LOG_ERROR(
"entities.unit",
"Pet::InitStatsForLevel() failed for creature (Entry: {})!", pet->
GetEntry());
10907 if (attacker && !attacker->
IsInMap(victim))
10908 attacker =
nullptr;
10911 Player* player =
nullptr;
10917 bool isRewardAllowed =
true;
10921 if (!isRewardAllowed)
10925 if (isRewardAllowed && creature)
10930 if (!creature->
IsInMap(lootRecipient))
10934 for (
GroupReference* itr = group->GetFirstMember(); itr !=
nullptr; itr = itr->next())
10936 Player* member = itr->GetSource();
10937 if (!member || !creature->
IsInMap(member))
10952 isRewardAllowed =
false;
10956 if (isRewardAllowed && player && player != victim)
10962 Player* looter = player;
10964 bool hasLooterGuid =
false;
10978 hasLooterGuid =
true;
10991 data2 << creature->
GetGUID();
11018 if (!loot->
empty())
11027 if (attacker && (attacker->
IsPet() || attacker->
IsTotem()))
11048 bool spiritOfRedemption =
false;
11061 victim->
CastSpell(victim, 27827, aurEff);
11062 spiritOfRedemption =
true;
11065 if (!spiritOfRedemption)
11091 plrVictim->SetPvPDeath(player !=
nullptr);
11097 TC_LOG_DEBUG(
"entities.unit",
"We are dead, losing {} percent durability", baseLoss);
11098 plrVictim->DurabilityLossAll(baseLoss,
false);
11100 plrVictim->SendDurabilityLoss();
11107 if (plrVictim->duel)
11109 plrVictim->duel->Opponent->CombatStopWithPets(
true);
11110 plrVictim->CombatStopWithPets(
true);
11119 if (!creature->
IsPet())
11134 ai->JustDied(attacker);
11138 if (
WorldObject * summoner = summon->GetSummoner())
11140 if (summoner->ToCreature() && summoner->ToCreature()->IsAIEnabled())
11141 summoner->ToCreature()->AI()->SummonedCreatureDies(creature, attacker);
11142 else if (summoner->ToGameObject() && summoner->ToGameObject()->AI())
11143 summoner->ToGameObject()->AI()->SummonedCreatureDies(creature, attacker);
11166 if (save->GetResetTime() < resettime)
11167 save->SetResetTime(resettime);
11175 if (player && attacker != victim)
11178 pvp->HandleKill(player, victim);
11181 bf->HandleKill(player, victim);
11194 bg->HandleKillPlayer(playerVictim, player);
11196 bg->HandleKillUnit(victim->
ToCreature(), player);
11215 sScriptMgr->OnPVPKill(killerPlr, killedPlr);
11217 sScriptMgr->OnCreatureKill(killerPlr, killedCre);
11222 sScriptMgr->OnPlayerKilledByCreature(killerCre, killed);
11386 data.
Initialize(rootOpcodeTable[apply][2], 64);
11409 Unit* caster =
nullptr;
11411 if (!fearAuras.empty())
11477 if (
this == charmer)
11553 if (player->isAFK())
11554 player->ToggleAFK();
11556 player->SetClientControl(
this,
false);
11624 creature->RefreshCanSwimFlag();
11630 ai->OnCharmed(
false);
11726 player->SetClientControl(
this,
true);
11741 charmedAI->OnCharmed(
false);
11773 m_vehicleKit = Trinity::make_unique_trackable<Vehicle>(
this, vehInfo, creatureEntry);
11812 return vehicleRoot;
11885 Group* group =
nullptr;
11895 Player* Target = itr->GetSource();
11901 TagUnitMap.push_back(Target);
11904 if (pet->IsAlive())
11905 TagUnitMap.push_back(pet);
11912 TagUnitMap.push_back(owner);
11914 if ((pet ==
this ||
IsInMap(pet)) && pet->IsAlive())
11915 TagUnitMap.push_back(pet);
11922 return entry->IsContestedGuardFaction();
11960 if (!(effMask & (1 << spellEffectInfo.EffectIndex)))
11964 effMask &= ~(1 << spellEffectInfo.EffectIndex);
11975 aura->ApplyForTargets();
11985 aura =
AddAura(spellId, target);
12009 Unit const* target =
nullptr;
12084 missChance += 19.0f;
12088 int32 diff = -skillDiff;
12090 missChance += diff > 0 ? diff * 0.04f : diff * 0.02f;
12093 missChance += diff > 10 ? 1 + (diff - 10) * 0.4f : diff * 0.1f;
12095 if (levelFactor < 10.f)
12096 missChance *= (levelFactor / 10.f);
12100 float resistMissChance = 100.0f;
12106 missChance -= resistMissChance - 100.0f;
12120 return std::max(missChance, 0.f);
12136 (*itr)->SetPhaseMask(newPhaseMask,
true);
12141 summon->SetPhaseMask(newPhaseMask,
true);
12169 data << TaggedPosition<Position::XY>(vcos, vsin);
12170 data << float(speedXY);
12171 data << float(speedZ);
12195 return player->GetRatingBonusValue(cr);
12199 return owner->GetRatingBonusValue(cr);
12231 switch (player->GetHairColorId())
12251 uint8 skinColor = player->GetSkinId();
12313 switch (player->GetHairColorId())
12332 uint8 skinColor = player->GetSkinId();
12427 float angle = forward ? 0 : float(
M_PI);
12451 bool spellClickHandled =
false;
12455 auto clickBounds =
sObjectMgr->GetSpellClickInfoMapBounds(spellClickEntry);
12456 for (
auto const& clickPair : clickBounds)
12459 if (!clickPair.second.IsFitToRequirements(clicker,
this))
12463 if (!
sConditionMgr->IsObjectMeetingSpellClickConditions(spellClickEntry, clickPair.second.spellId, clicker,
this))
12476 bool valid =
false;
12489 TC_LOG_ERROR(
"sql.sql",
"Spell {} specified in npc_spellclick_spells is not a valid vehicle enter aura!", clickPair.second.spellId);
12498 caster->
CastSpell(target, clickPair.second.spellId, args);
12504 bp[spellEffectInfo.EffectIndex] = spellEffectInfo.BasePoints;
12532 spellClickHandled =
true;
12585 if (
CreatureGroup* creatureGroup = vehicleBaseCreature->GetFormation())
12586 sFormationMgr->RemoveCreatureFromGroup(creatureGroup, vehicleBaseCreature);
12616 for (AuraEffectList::const_iterator itr = vehicleAuras.begin(); itr != vehicleAuras.end(); ++itr)
12618 if ((*itr)->GetCasterGUID() !=
GetGUID())
12622 ASSERT(!rideVehicleEffect);
12623 rideVehicleEffect = *itr;
12627 ASSERT(rideVehicleEffect);
12665 TC_LOG_ERROR(
"entities.vehicle",
"RemovePassenger() couldn't remove current unit from vehicle. Debug info: {}",
GetDebugInfo());
12672 if (player && player->
duel && player->
duel->IsMounted)
12691 pos = *exitPosition;
12710 float height = pos.
GetPositionZ() + vehicleCollisionHeight;
12718 init.SetTransportExit();
12750 *data << TaggedPosition<Position::XYZO>(pos);
12756 *data << TaggedPosition<Position::XYZO>(transportPos);
12766 *data << float(movementInfo.
pitch);
12831 if (!teleportingTransport)
12835 transportBase->CalculatePassengerOffset(x, y, z, &o);
12841 moveUpdateTeleport.
Status = &teleportMovementInfo;
12848 moveTeleport.
Status = &teleportMovementInfo;
12871 TC_LOG_DEBUG(
"entities.unit",
"Unit::UpdatePosition({}, {}, {}) .. bad coordinates!", x, y, z);
12879 bool const relocated = (teleport ||
12900 return (relocated || turn);
12946 return pendingChange.movementChangeType == changeType;
12977 TC_LOG_INFO(
"cheat",
"Unit::CheckPendingMovementAcks: Player GUID: {} took too long to acknowledge a movement change. He was therefore kicked.", controller->
GetBasePlayer()->
GetGUID().
ToString());
12985 float speedFlat = pendingChange->newValue;
12988 switch (changeType)
13007 if (informObservers)
13027 rageconversion += 13.27f * (
GetLevel() - 70);
13031 addRage = (damage / rageconversion * 7.5f + weaponSpeedHitFactor) / 2;
13038 addRage = damage / rageconversion * 2.5f;
13067 for (AttackerSet::const_iterator itr = attackers.begin(); itr != attackers.end();)
13069 if ((*itr)->GetFactionTemplateEntry()->Faction == faction_id)
13071 (*itr)->AttackStop();
13072 itr = attackers.begin();
13078 std::vector<CombatReference*> refsToEnd;
13080 if (pair.second->GetOther(
this)->GetFactionTemplateEntry()->Faction == faction_id)
13081 refsToEnd.push_back(pair.second);
13086 minion->StopAttackFaction(faction_id);
13098 std::ostringstream o;
13099 o <<
"Summon Slot: ";
13106 o <<
"Controlled List: ";
13108 o << (*itr)->GetGUID().ToString() <<
", ";
13112 o <<
"Aura List: ";
13114 o << itr->first <<
", ";
13120 o <<
"Passenger List: ";
13123 o << passenger->GetGUID().ToString() <<
", ";
13176 transport->CalculatePassengerPosition(stayPos.x, stayPos.y, stayPos.z);
13407 static OpcodeServer const waterWalkingOpcodeTable[2][2] =
13446 static OpcodeServer const featherFallOpcodeTable[2][2] =
13557 if (target ==
this)
13579 updateMask.
SetBit(index);
13589 fieldBuffer <<
uint32(appendValue);
13615 appendValue &= ~UNIT_FLAG_UNINTERACTIBLE;
13617 fieldBuffer <<
uint32(appendValue);
13630 for (
SpellEffectInfo const& spellEffectInfo : transform->GetEffects())
13636 cinfo = transformInfo;
13648 fieldBuffer <<
uint32(displayId);
13673 fieldBuffer << dynamicFlags;
13706 data->
append(fieldBuffer);
13728 for (SpellSpellGroupMap::const_iterator itr = spellGroup.first; itr != spellGroup.second ; ++itr)
13733 for (AuraEffectList::const_iterator auraItr = auraEffList.begin(); auraItr != auraEffList.end(); ++auraItr)
13735 if (aurEff != (*auraItr) && (!checkMiscValue || (*auraItr)->GetMiscValue() == miscValue) &&
13736 sSpellMgr->IsSpellMemberOfSpellGroup((*auraItr)->GetSpellInfo()->Id, itr->second))
13739 if (abs(val) < abs((*auraItr)->GetAmount()))
13740 val = (*auraItr)->GetAmount();
13761 for (Unit::AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end();)
13768 int32 diff = abs(effectAmount) - abs(existingAurEff->
GetAmount());
13777 if (removeOtherAuraApplications && (!base->
IsArea() || base->
GetOwner() !=
this))
13785 itr = auras.begin();
13851 TC_LOG_ERROR(
"entities.unit",
"WorldObject::MonsterText: `broadcast_text` (ID: {}) was not found", textId);
13884 TC_LOG_ERROR(
"entities.unit",
"WorldObject::MonsterWhisper: `broadcast_text` was not {} found", textId);
13923 std::stringstream sstr;
13928 <<
" Class: " << std::to_string(
GetClass()) <<
"\n"
13936 size_t controlledCount = 0;
13940 sstr <<
"\n" <<
"m_Controlled " << controlledCount <<
" : " << controlled->GetGUID().ToString();
@ CREATURE_FLAG_EXTRA_NO_BLOCK
@ CREATURE_FLAG_EXTRA_NO_CRUSHING_BLOWS
@ CREATURE_FLAG_EXTRA_NO_CRIT
@ CREATURE_FLAG_EXTRA_TRIGGER
@ CREATURE_FLAG_EXTRA_NO_PARRY_HASTEN
@ CREATURE_FLAG_EXTRA_INSTANCE_BIND
@ CREATURE_FLAG_EXTRA_OBEYS_TAUNT_DIMINISHING_RETURNS
@ CREATURE_FLAG_EXTRA_NO_PARRY
static const uint32 MAX_CREATURE_SPELLS
@ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_RECEIVED
@ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CAST
@ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED
@ ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE
@ ACHIEVEMENT_CRITERIA_TYPE_TOTAL_HEALING_RECEIVED
@ ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_PLAYER
@ ACHIEVEMENT_CRITERIA_TYPE_GAIN_AURA
@ ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE
@ ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED
@ ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE
@ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_DEALT
@ ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS
#define MAX_SPELL_EFFECTS
DBCStorage< SpellShapeshiftFormEntry > sSpellShapeshiftFormStore(SpellShapeshiftFormfmt)
DBCStorage< VehicleEntry > sVehicleStore(VehicleEntryfmt)
DBCStorage< PowerDisplayEntry > sPowerDisplayStore(PowerDisplayfmt)
DBCStorage< CreatureDisplayInfoEntry > sCreatureDisplayInfoStore(CreatureDisplayInfofmt)
DBCStorage< ChrRacesEntry > sChrRacesStore(ChrRacesEntryfmt)
DBCStorage< CreatureDisplayInfoExtraEntry > sCreatureDisplayInfoExtraStore(CreatureDisplayInfoExtrafmt)
DBCStorage< CreatureModelDataEntry > sCreatureModelDataStore(CreatureModelDatafmt)
DBCStorage< ChrClassesEntry > sChrClassesStore(ChrClassesEntryfmt)
DBCStorage< LiquidTypeEntry > sLiquidTypeStore(LiquidTypefmt)
@ CHRRACES_FLAGS_CAN_MOUNT
@ CREATURE_MODEL_DATA_FLAGS_CAN_MOUNT
std::chrono::steady_clock::time_point TimePoint
time_point shorthand typedefs
#define ASSERT_WITH_SIDE_EFFECTS
#define ASSERT_NODEBUGINFO
#define ASSERT_NOTNULL(pointer)
@ GROUP_UPDATE_FLAG_CUR_HP
@ GROUP_UPDATE_FLAG_PET_CUR_HP
@ GROUP_UPDATE_FLAG_POWER_TYPE
@ GROUP_UPDATE_FLAG_PET_CUR_POWER
@ GROUP_UPDATE_FLAG_PET_MAX_POWER
@ GROUP_UPDATE_FLAG_MAX_HP
@ GROUP_UPDATE_FLAG_PET_POWER_TYPE
@ GROUP_UPDATE_FLAG_MAX_POWER
@ GROUP_UPDATE_FLAG_PET_AURAS
@ GROUP_UPDATE_FLAG_AURAS
@ GROUP_UPDATE_FLAG_LEVEL
@ GROUP_UPDATE_FLAG_PET_MAX_HP
@ GROUP_UPDATE_FLAG_CUR_POWER
@ ITEM_SUBCLASS_WEAPON_CROSSBOW
@ ITEM_SUBCLASS_WEAPON_GUN
@ ITEM_SUBCLASS_WEAPON_AXE2
@ ITEM_SUBCLASS_WEAPON_STAFF
@ ITEM_SUBCLASS_WEAPON_MACE
@ ITEM_SUBCLASS_WEAPON_EXOTIC2
@ ITEM_SUBCLASS_WEAPON_FISHING_POLE
@ ITEM_SUBCLASS_WEAPON_MACE2
@ ITEM_SUBCLASS_WEAPON_DAGGER
@ ITEM_SUBCLASS_WEAPON_BOW
@ 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 MAX_ITEM_PROTO_DAMAGES
#define TC_LOG_DEBUG(filterType__,...)
#define TC_LOG_ERROR(filterType__,...)
#define TC_LOG_INFO(filterType__,...)
#define TC_LOG_FATAL(filterType__,...)
LootStore LootTemplates_Creature("creature_loot_template", "creature entry", true)
bool IsInvalidMovementSlot(uint8 const slot)
@ MOTION_PRIORITY_HIGHEST
#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_LEAVE_TRANSPORT
std::unordered_map< uint32, PlayerSpell > PlayerSpellMap
#define SPELL_DK_RAISE_ALLY
#define INVENTORY_SLOT_BAG_0
int32 irand(int32 min, int32 max)
uint32 urand(uint32 min, uint32 max)
bool roll_chance_f(float chance)
bool roll_chance_i(int chance)
@ SERVERSIDE_VISIBILITY_GM
@ SERVERSIDE_VISIBILITY_GHOST
@ SPELL_ATTR7_DISPEL_CHARGES
@ SPELL_ATTR7_NO_PUSHBACK_ON_DAMAGE
@ SPELL_EFFECT_POWER_BURN
@ SPELL_EFFECT_HEALTH_LEECH
@ SPELL_EFFECT_NORMALIZED_WEAPON_DMG
@ SPELL_EFFECT_ENVIRONMENTAL_DAMAGE
@ SPELL_EFFECT_POWER_DRAIN
@ SPELL_EFFECT_SCHOOL_DAMAGE
@ SPELL_EFFECT_APPLY_AURA
@ SPELL_ATTR5_REMOVE_ON_ARENA_ENTER
@ 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_CAN_TARGET_DEAD
@ SPELL_ATTR2_NOT_RESET_AUTO_ACTIONS
@ SPELL_ATTR2_UNAFFECTED_BY_AURA_SCHOOL_IMMUNE
@ SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY
@ SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE
SpellSchools GetFirstSchoolInMask(SpellSchoolMask mask)
uint32 const CREATURE_TYPEMASK_DEMON_OR_UNDEAD
@ UNIT_DYNFLAG_SPECIALINFO
@ UNIT_DYNFLAG_TAPPED_BY_PLAYER
@ UNIT_DYNFLAG_TRACK_UNIT
@ SPELL_ATTR3_TREAT_AS_PERIODIC
@ SPELL_ATTR3_DEATH_PERSISTENT
@ SPELL_ATTR3_NO_DONE_BONUS
@ SPELL_ATTR3_DISABLE_PROC
@ SPELL_ATTR3_IGNORE_HIT_RESULT
@ SPELL_DAMAGE_CLASS_RANGED
@ SPELL_DAMAGE_CLASS_MAGIC
@ SPELL_DAMAGE_CLASS_NONE
@ SPELL_DAMAGE_CLASS_MELEE
#define PER_CASTER_AURA_STATE_MASK
@ SPELLFAMILY_DEATHKNIGHT
@ SPELL_ATTR0_IMPOSSIBLE_DODGE_PARRY_BLOCK
@ SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY
@ SPELL_ATTR0_CASTABLE_WHILE_MOUNTED
@ CHAT_MSG_MONSTER_WHISPER
@ CHAT_MSG_RAID_BOSS_WHISPER
@ CHAT_MSG_RAID_BOSS_EMOTE
@ DIMINISHING_LEVEL_IMMUNE
@ DIMINISHING_LEVEL_TAUNT_IMMUNE
@ AURA_STATE_HEALTHLESS_35_PERCENT
@ AURA_STATE_HEALTH_ABOVE_75_PERCENT
@ AURA_STATE_HEALTHLESS_20_PERCENT
@ AURA_STATE_HUNTER_PARRY
#define MAX_GAMEOBJECT_SLOT
@ SPELL_ATTR4_DONT_REMOVE_IN_ARENA
@ SPELL_ATTR4_IGNORE_RESISTANCES
@ SPELL_ATTR4_FIXED_DAMAGE
@ SPELL_ATTR4_DAMAGE_DOESNT_BREAK_AURAS
@ CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT
@ SPELL_ATTR6_LIMIT_PCT_DAMAGE_MODS
@ SPELL_ATTR6_LIMIT_PCT_HEALING_MODS
@ AURA_REMOVE_BY_ENEMY_SPELL
@ AURA_EFFECT_HANDLE_STAT
@ AURA_EFFECT_HANDLE_SEND_FOR_CLIENT
@ SPELL_AURA_MOD_MELEE_ATTACK_POWER_VERSUS
@ SPELL_AURA_MOD_CRIT_PERCENT_VERSUS
@ SPELL_AURA_CLONE_CASTER
@ SPELL_AURA_RETAIN_COMBO_POINTS
@ 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_SPELL_CRIT_CHANCE_SCHOOL
@ SPELL_AURA_PERIODIC_DAMAGE
@ SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED
@ SPELL_AURA_MOD_MOUNTED_FLIGHT_SPEED_ALWAYS
@ SPELL_AURA_MOD_SPELL_DAMAGE_OF_ATTACK_POWER
@ SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_DAMAGE
@ 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_OBS_MOD_HEALTH
@ SPELL_AURA_PERIODIC_HEALTH_FUNNEL
@ SPELL_AURA_PERIODIC_MANA_LEECH
@ SPELL_AURA_MOD_POSSESS_PET
@ SPELL_AURA_MOD_INCREASE_SPEED
@ SPELL_AURA_MOD_RESISTANCE
@ SPELL_AURA_MOD_EXPERTISE
@ SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS
@ SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN
@ SPELL_AURA_MOD_CRIT_CHANCE_FOR_CASTER
@ SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_CHANCE
@ SPELL_AURA_MOD_MOUNTED_SPEED_NOT_STACK
@ SPELL_AURA_MOD_HEALING_DONE_PERCENT
@ SPELL_AURA_MOD_RANGED_ATTACK_POWER_VERSUS
@ SPELL_AURA_SHARE_DAMAGE_PCT
@ SPELL_AURA_OBS_MOD_POWER
@ SPELL_AURA_ADD_CASTER_HIT_TRIGGER
@ SPELL_AURA_SPLIT_DAMAGE_FLAT
@ SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE
@ 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_RESISTANCE_EXCLUSIVE
@ SPELL_AURA_SCHOOL_HEAL_ABSORB
@ SPELL_AURA_MOD_INCREASE_VEHICLE_FLIGHT_SPEED
@ 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_TARGET_ABILITY_ABSORB_SCHOOL
@ SPELL_AURA_MOD_DODGE_PERCENT
@ SPELL_AURA_MOD_INCREASE_SWIM_SPEED
@ SPELL_AURA_SPLIT_DAMAGE_PCT
@ 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_ATTACKER_MELEE_CRIT_CHANCE
@ SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT
@ SPELL_AURA_MOD_ARMOR_PENETRATION_PCT
@ SPELL_AURA_MOD_OFFHAND_DAMAGE_PCT
@ SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_DAMAGE
@ SPELL_AURA_MOD_ATTACKER_RANGED_HIT_CHANCE
@ 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_ATTACKER_SPELL_CRIT_CHANCE
@ 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_TARGET_RESISTANCE
@ SPELL_AURA_MOD_FLAT_SPELL_DAMAGE_VERSUS
@ SPELL_AURA_MOD_SPEED_ALWAYS
@ SPELL_AURA_MOD_DECREASE_SPEED
@ SPELL_AURA_SCHOOL_ABSORB
@ SPELL_AURA_MOD_RESISTANCE_PCT
@ SPELL_AURA_MOD_DAMAGE_DONE_FOR_MECHANIC
@ SPELL_AURA_MOD_COMBAT_RESULT_CHANCE
@ SPELL_AURA_PERIODIC_ENERGIZE
@ SPELL_AURA_MOD_MOUNTED_SPEED_ALWAYS
@ SPELL_AURA_MOD_WEAPON_CRIT_PERCENT
@ SPELL_AURA_MOD_DAMAGE_DONE_CREATURE
@ SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL
@ SPELL_AURA_MOD_SPELL_HEALING_OF_ATTACK_POWER
@ SPELL_AURA_PERIODIC_LEECH
@ SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT
@ SPELL_AURA_MOD_PERCENT_STAT
@ SPELL_AURA_MOD_DAMAGE_DONE
@ SPELL_AURA_MOD_ABILITY_IGNORE_TARGET_RESIST
@ SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN_PCT
@ SPELL_AURA_MOD_MECHANIC_RESISTANCE
@ SPELL_AURA_MOD_UNATTACKABLE
@ SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED
@ SPELL_AURA_OVERRIDE_CLASS_SCRIPTS
@ SPELL_AURA_MOD_INCREASE_MOUNTED_SPEED
@ SPELL_AURA_USE_NORMAL_MOVEMENT_SPEED
@ SPELL_AURA_MOD_BLOCK_PERCENT
@ SPELL_INTERRUPT_FLAG_ABORT_ON_DMG
@ SPELL_INTERRUPT_FLAG_MOVEMENT
@ SPELLMOD_CRIT_DAMAGE_BONUS
@ SPELLMOD_CRITICAL_CHANCE
@ SPELLMOD_BONUS_MULTIPLIER
@ SPELLMOD_PROC_PER_MINUTE
@ SPELLMOD_RESIST_MISS_CHANCE
@ TRIGGERED_FULL_MASK
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
@ TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE
Disallows proc events from triggered spell (default)
@ AURA_INTERRUPT_FLAG_TAKE_DAMAGE
@ AURA_INTERRUPT_FLAG_DIRECT_DAMAGE
@ AURA_INTERRUPT_FLAG_MOVE
@ AURA_INTERRUPT_FLAG_TURNING
@ AURA_INTERRUPT_FLAG_NOT_ABOVEWATER
@ AURA_INTERRUPT_FLAG_NOT_SEATED
@ AURA_INTERRUPT_FLAG_NOT_UNDERWATER
@ AURA_INTERRUPT_FLAG_MELEE_ATTACK
@ AURA_INTERRUPT_FLAG_LEAVE_COMBAT
@ AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT
@ AURA_INTERRUPT_FLAG_MOUNT
@ AURA_INTERRUPT_FLAG_NOT_MOUNTED
@ 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_DONE_MELEE_AUTO_ATTACK
@ PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG
@ PROC_FLAG_DONE_MAINHAND_ATTACK
@ PROC_FLAG_TAKEN_MELEE_AUTO_ATTACK
@ PROC_FLAG_DONE_OFFHAND_ATTACK
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
uint32 getMSTimeDiff(uint32 oldMSTime, uint32 newMSTime)
@ UNIT_BYTES_2_OFFSET_SHAPESHIFT_FORM
@ UNIT_BYTES_0_OFFSET_POWER_TYPE
@ 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
@ MOVEMENTFLAG_SPLINE_ENABLED
@ MOVEMENTFLAG_ONTRANSPORT
@ MOVEMENTFLAG_WATERWALKING
@ MOVEMENTFLAG_MASK_MOVING
@ MOVEMENTFLAG_DISABLE_GRAVITY
@ MOVEMENTFLAG_FALLING_SLOW
@ MOVEMENTFLAG_MASK_TURNING
@ MOVEMENTFLAG_MASK_MOVING_FLY
@ MOVEMENTFLAG_FALLING_FAR
@ MOVEMENTFLAG_SPLINE_ELEVATION
@ MOVEMENTFLAG2_ALWAYS_ALLOW_PITCHING
@ MOVEMENTFLAG2_INTERPOLATED_MOVEMENT
@ UNIT_BYTES_1_OFFSET_ANIM_TIER
@ UNIT_BYTES_1_OFFSET_STAND_STATE
@ UNIT_NPC_FLAG_TABARDDESIGNER
@ UNIT_NPC_FLAG_AUCTIONEER
@ UNIT_NPC_FLAG_BATTLEMASTER
@ UNIT_NPC_FLAG_INNKEEPER
@ UNIT_NPC_FLAG_SPELLCLICK
@ UNIT_NPC_FLAG_PLAYER_VEHICLE
@ UNIT_NPC_FLAG_FLIGHTMASTER
@ UNIT_NPC_FLAG_PETITIONER
@ UNIT_NPC_FLAG_SPIRITGUIDE
@ UNIT_NPC_FLAG_SPIRITHEALER
#define MAX_EQUIPMENT_ITEMS
@ UNIT_BYTE2_FLAG_SANCTUARY
@ 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]
uint32 createProcHitMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missCondition)
void ApplyPercentModFloatVar(float &var, float val, bool apply)
float playerBaseMoveSpeed[MAX_MOVE_TYPE]
std::unordered_multimap< uint32, uint32 > SpellImmuneContainer
@ UNIT_MASK_CONTROLABLE_GUARDIAN
#define MAX_UNIT_ACTION_BAR_INDEX
@ SPEED_CHANGE_FLIGHT_SPEED
@ SPEED_CHANGE_FLIGHT_BACK_SPEED
@ UNIT_MOD_DAMAGE_OFFHAND
@ UNIT_MOD_STAT_INTELLECT
@ UNIT_MOD_RESISTANCE_SHADOW
@ UNIT_MOD_RESISTANCE_FROST
@ UNIT_MOD_RESISTANCE_HOLY
@ UNIT_MOD_RESISTANCE_ARCANE
@ UNIT_MOD_RESISTANCE_FIRE
@ UNIT_MOD_RESISTANCE_NATURE
@ UNIT_MOD_DAMAGE_MAINHAND
TC_GAME_API float playerBaseMoveSpeed[MAX_MOVE_TYPE]
@ ACTION_BAR_INDEX_PET_SPELL_START
@ ACTION_BAR_INDEX_PET_SPELL_END
#define CURRENT_FIRST_NON_MELEE_SPELL
@ CURRENT_CHANNELED_SPELL
@ CURRENT_AUTOREPEAT_SPELL
@ UNIT_STATE_ATTACK_PLAYER
@ UNIT_STATE_UNATTACKABLE
@ UNIT_STATE_CANNOT_AUTOATTACK
@ UNIT_STATE_MELEE_ATTACKING
#define MAX_AGGRO_RESET_TIME
std::vector< DispelableAura > DispelChargesList
#define CURRENT_MAX_SPELL
@ CR_WEAPON_SKILL_OFFHAND
@ CR_WEAPON_SKILL_MAINHAND
@ REACTIVE_WOLVERINE_BITE
TC_GAME_API float baseMoveSpeed[MAX_MOVE_TYPE]
@ UPDATEFLAG_STATIONARY_POSITION
uint32 UnitUpdateFieldFlags[PLAYER_END]
@ PLAYER_RANGED_CRIT_PERCENTAGE
@ PLAYER_SPELL_CRIT_PERCENTAGE1
@ UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE
@ UNIT_FIELD_RANGEDATTACKTIME
@ UNIT_FIELD_ATTACK_POWER_MODS
@ PLAYER_PARRY_PERCENTAGE
@ PLAYER_OFFHAND_CRIT_PERCENTAGE
@ PLAYER_BLOCK_PERCENTAGE
@ UNIT_FIELD_FACTIONTEMPLATE
@ UNIT_FIELD_RANGED_ATTACK_POWER
@ UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER
@ UNIT_FIELD_MAXOFFHANDDAMAGE
@ UNIT_FIELD_MAXRANGEDDAMAGE
@ PLAYER_DODGE_PERCENTAGE
@ UNIT_FIELD_ATTACK_POWER_MULTIPLIER
@ UNIT_FIELD_ATTACK_POWER
@ UNIT_VIRTUAL_ITEM_SLOT_ID
@ UNIT_FIELD_MINRANGEDDAMAGE
@ UNIT_FIELD_RANGED_ATTACK_POWER_MODS
@ PLAYER_FIELD_MOD_DAMAGE_DONE_PCT
@ UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE
@ UNIT_FIELD_MINOFFHANDDAMAGE
@ UNIT_FIELD_BASEATTACKTIME
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
@ VEHICLE_FLAG_FIXED_POSITION
void SetRemoveMode(AuraRemoveMode mode)
uint8 GetEffectMask() const
void _HandleEffect(uint8 effIndex, bool apply)
AuraRemoveMode GetRemoveMode() const
bool HasEffect(uint8 effect) const
void ChangeAmount(int32 newAmount, bool mark=true, bool onStackOrReapply=false)
SpellInfo const * GetSpellInfo() const
AuraType GetAuraType() const
bool CanBeRecalculated() const
SpellEffectInfo const & GetSpellEffectInfo() const
void HandleEffect(AuraApplication *aurApp, uint8 mode, bool apply)
bool IsAffectingSpell(SpellInfo const *spell) const
void SetAmount(int32 amount)
int32 GetMiscValue() const
int32 GetBaseAmount() const
ObjectGuid GetCasterGUID() const
bool HasMoreThanOneEffectForType(AuraType auraType) const
virtual void _UnapplyForTarget(Unit *target, Unit *caster, AuraApplication *auraApp)
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)
Unit * GetUnitOwner() const
AuraApplication const * GetApplicationOfTarget(ObjectGuid guid) const
ObjectGuid GetCasterGUID() const
bool HasEffect(uint8 effIndex) const
float GetCritChance() const
void TriggerProcOnEvent(uint8 procEffectMask, AuraApplication *aurApp, ProcEventInfo &eventInfo)
WorldObject * GetOwner() const
bool IsSingleTargetWith(Aura const *aura) 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(uint8 effIndex) const
bool CanApplyResilience() const
void SetNeedClientUpdateForTargets() const
bool ModStackAmount(int32 num, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT, bool resetPeriodicTimer=true)
uint8 GetEffectMask() const
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
void HandleAuraSpecificMods(AuraApplication const *aurApp, Unit *caster, bool apply, bool onReapply)
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
std::unordered_map< ObjectGuid, PvPCombatReference * > const & GetPvPCombatRefs() const
void Update(uint32 tdiff)
bool HasPvECombat() const
std::unordered_map< ObjectGuid, CombatReference * > const & GetPvECombatRefs() const
bool HasPvPCombat() const
virtual void OnSpellClick(Unit *, bool)
virtual void OnSpellFailed(SpellInfo const *)
virtual void KilledUnit(Unit *)
float GetSpellDamageMod(int32 Rank) const
uint16 GetLootMode() const
uint32 m_spells[MAX_CREATURE_SPELLS]
void SetLootRecipient(Unit *unit, bool withGroup=true)
bool CanFly() const override
void SetLastDamagedTime(time_t val)
bool IsEvadingAttacks() const
void AllLootRemovedFromCorpse()
bool hasLootRecipient() const
void DespawnOrUnsummon(Milliseconds timeToDespawn=0s, Seconds forceRespawnTime=0s)
Player * GetLootRecipient() const
CreatureTemplate const * GetCreatureTemplate() const
bool IsDamageEnoughForLootingAndReward() const
bool isTappedBy(Player const *player) const
bool CanEnterWater() const override
Group * GetLootRecipientGroup() const
void SendAIReaction(AiReaction reactionType)
bool IsInEvadeMode() const
void LowerPlayerDamageReq(uint32 unDamage)
void ResistDamage(uint32 amount)
void AbsorbDamage(uint32 amount)
void ModifyDamage(int32 amount)
Unit * GetAttacker() const
SpellInfo const * GetSpellInfo() const
uint32 GetHitMask() const
void BlockDamage(uint32 amount)
DamageEffectType GetDamageType() const
WeaponAttackType GetAttackType() const
SpellSchoolMask GetSchoolMask() const
DamageInfo(DamageInfo const &dmg1, DamageInfo const &dmg2)
uint8 GetRemovedCharges() const
DispelableAura(Aura *aura, int32 dispelChance, uint8 dispelCharges)
uint32 GetSpellId() const
void KillAllEvents(bool force)
T_VALUES GetValue(FLAG_TYPE flag) const
void SetValue(FLAG_TYPE flag, T_VALUES value)
WorldSession * GetWorldSession() const
Player * GetBasePlayer() const
std::string GetDebugInfo() const
ObjectGuid GetOwnerGUID() const override
uint32 GetSpellId() const
void SetOwnerGUID(ObjectGuid owner)
void SetRespawnTime(int32 respawn)
uint8 GetMemberGroup(ObjectGuid guid) const
uint32 GetMembersCount() const
ObjectGuid GetLooterGuid() const
void BroadcastPacket(WorldPacket const *packet, bool ignorePlayersInBGRaid, int group=-1, ObjectGuid ignoredPlayer=ObjectGuid::Empty)
void UpdateLooterGuid(WorldObject *pLootedObject, bool ifneed=false)
GroupReference * GetFirstMember()
void SendLooter(Creature *creature, Player *pLooter)
bool InitStatsForLevel(uint8 level)
uint32 GetEffectiveHeal() const
SpellInfo const * GetSpellInfo() const
uint32 GetHitMask() const
void SetEffectiveHeal(uint32 amount)
SpellSchoolMask GetSchoolMask() const
void AbsorbHeal(uint32 amount)
HealInfo(Unit *healer, Unit *target, uint32 heal, SpellInfo const *spellInfo, SpellSchoolMask schoolMask)
void PermBindAllPlayers()
ItemTemplate const * GetTemplate() const
void CreatureRelocation(Creature *creature, float x, float y, float z, float ang, bool respawnRelocationOnFail=true)
bool IsRaidOrHeroicDungeon() const
float GetWaterOrGroundLevel(uint32 phasemask, float x, float y, float z, float *ground=nullptr, bool swim=false, float collisionHeight=2.03128f) const
InstanceMap * ToInstanceMap()
void PlayerRelocation(Player *, float x, float y, float z, float orientation)
Creature * GetCreature(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 MoveJump(Position const &pos, float speedXY, float speedZ, uint32 id=EVENT_JUMP, bool hasOrientation=false)
void PropagateSpeedChange()
void MoveKnockbackFrom(float srcX, float srcY, float speedXY, float speedZ)
void InterruptOnTeleport()
void MoveJumpTo(float angle, float speedXY, float speedZ)
void Remove(MovementGenerator *movement, MovementSlot slot=MOTION_SLOT_ACTIVE)
void MoveFace(float orientation, uint32 id=EVENT_FACE)
void MoveFleeing(Unit *enemy, uint32 time=0)
static void SendSpeedChangeToMover(Unit *unit, UnitMoveType mtype, float newRate)
static MovementChangeType GetChangeTypeByMoveType(UnitMoveType moveType)
static void SendSpeedChangeToObservers(Unit *unit, UnitMoveType mtype, float newRate)
static void SendSpeedChangeToAll(Unit *unit, UnitMoveType mtype, float newRate)
void Stop(bool force=false)
std::string ToString() const
Location ComputePosition() const
Vector3 const & FinalDestination() const
AnimTier GetAnimTier() const
void updateState(int32 difftime, UpdateHandler &handler)
bool HasAnimation() const
static ObjectGuid const Empty
PackedGuidWriter WriteAsPacked() const
std::string ToString() const
bool IsGameObject() const
bool IsAnyTypeCreature() const
void SetByteValue(uint16 index, uint8 offset, uint8 value)
void BuildValuesUpdateBlockForPlayer(UpdateData *data, Player const *target) const
static Creature * ToCreature(Object *o)
int32 GetInt32Value(uint16 index) const
float GetObjectScale() const
PackedGuid const & GetPackGUID() const
static Unit * ToUnit(Object *o)
uint32 GetUInt32Value(uint16 index) const
uint16 GetUInt16Value(uint16 index, uint8 offset) const
virtual void DestroyForPlayer(Player *target, bool onDeath=false) const
bool HasDynamicFlag(uint32 flag) const
bool AddGuidValue(uint16 index, ObjectGuid value)
void RemoveFieldNotifyFlag(uint16 flag)
void SetFlag(uint16 index, uint32 newFlag)
void RemoveFlag(uint16 index, uint32 oldFlag)
virtual void SetDynamicFlag(uint32 flag)
float GetFloatValue(uint16 index) const
void SetGuidValue(uint16 index, ObjectGuid value)
void SetFloatValue(uint16 index, float value)
bool RemoveGuidValue(uint16 index, ObjectGuid value)
bool HasFlag(uint16 index, uint32 flag) const
static ObjectGuid GetGUID(Object const *o)
virtual void SetObjectScale(float scale)
void SetFieldNotifyFlag(uint16 flag)
void SetUInt32Value(uint16 index, uint32 value)
ObjectGuid GetGUID() const
void SetStatInt32Value(uint16 index, int32 value)
static Player * ToPlayer(Object *o)
void ForceValuesUpdateAtIndex(uint32)
PetInfo const * GetUnslottedHunterPet() const
Optional< PetInfo > CurrentPet
void FillPetInfo(PetStable::PetInfo *petInfo) const
std::string GetDebugInfo() const override
bool CreateBaseAtCreatureInfo(CreatureTemplate const *cinfo, Unit *owner)
bool CreateBaseAtCreature(Creature *creature)
bool isControlled() const
void InitPetCreateSpells()
void SetAuraUpdateMaskForRaid(uint8 slot)
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 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()
bool isAllowedToLoot(Creature const *creature) const
void UpdatePvPState(bool onlyFFA=false)
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, WorldObject *ref=nullptr)
bool InBattleground() const
void DurabilityPointLossForEquipSlot(EquipmentSlots slot)
void PetSpellInitialize()
uint32 GetBaseSpellPowerBonus() const
Returns base spellpower bonus from spellpower stat on items.
void SetFallInformation(uint32 time, float z)
uint32 GetResurrectionSpellId()
void SendRemoveControlBar() const
WorldSession * GetSession() const
OutdoorPvP * GetOutdoorPvP() const
void CastItemCombatSpell(DamageInfo const &damageInfo)
static uint32 TeamForRace(uint8 race)
uint16 GetMaxSkillValue(uint32 skill) const
void RewardPlayerAndGroupAtKill(Unit *victim, bool isBattleGround)
PlayerSpellMap const & GetSpellMap() const
Battleground * GetBattleground() const
float GetExpertiseDodgeOrParryReduction(WeaponAttackType attType) const
bool IsGameMaster() const
void PossessSpellInitialize()
Item * GetWeaponForAttack(WeaponAttackType attackType, bool useable=false) const
std::unique_ptr< DuelInfo > duel
uint8 GetSubGroup() const
void VehicleSpellInitialize()
void SendMessageToSet(WorldPacket const *data, bool self) const override
void SetFactionForRace(uint8 race)
void SetContestedPvP(Player *attackedPlayer=nullptr)
void ResummonPetTemporaryUnSummonedIfAny()
void UpdateCombatSkills(Unit *victim, WeaponAttackType attType, bool defense)
bool CanSeeSpellClickOn(Creature const *creature) const
void UpdatePvP(bool state, bool override=false)
bool IsInSameGroupWith(Player const *p) const
SpellSchoolMask GetSchoolMask() const
ProcEventInfo(Unit *actor, Unit *actionTarget, uint32 typeMask, uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask, Spell *spell, DamageInfo *damageInfo, HealInfo *healInfo)
Spell const * GetProcSpell() const
SpellInfo const * GetSpellInfo() const
float CalcValueMultiplier(WorldObject *caster, Spell *spell=nullptr) const
SpellEffIndex EffectIndex
void SendCooldownEvent(SpellInfo const *spellInfo, uint32 itemId=0, Spell *spell=nullptr, bool startCooldown=true)
void StartCooldown(SpellInfo const *spellInfo, uint32 itemId, Spell *spell=nullptr, bool onHold=false)
uint32 GetMaxTicks() const
Mechanics GetEffectMechanic(SpellEffIndex effIndex) const
SpellInfo const * GetFirstRankSpell() const
bool IsAutocastable() const
uint32 GetCategory() const
bool IsRequiringDeadTarget() const
DiminishingLevels GetDiminishingReturnsMaxLevel(bool triggered) const
bool IsDeathPersistent() const
bool IsCooldownStartedOnEvent() const
bool IsStackableOnOneSlotWithDifferentCasters() const
uint32 GetDispelMask() const
uint32 CalcCastTime(Spell *spell=nullptr) const
SpellSpecificType GetSpellSpecific() const
bool IsMultiSlotAura() const
int32 GetMaxDuration() const
SpellCastResult CheckTarget(WorldObject const *caster, WorldObject const *target, bool implicit=true) const
DiminishingGroup GetDiminishingReturnsGroupForSpell(bool triggered) const
bool IsItemFitToSpellRequirements(Item const *item) const
uint32 GetSpellMechanicMaskByEffectMask(uint32 effectMask) const
WeaponAttackType GetAttackType() const
SpellSchoolMask GetSchoolMask() const
AuraStateType GetAuraState() const
bool HasAttribute(SpellAttr0 attribute) const
bool IsPassiveStackableWithRanks() const
int32 GetDiminishingReturnsLimitDuration(bool triggered) const
int32 GetDuration() const
SpellCastResult CheckExplicitTarget(WorldObject const *caster, WorldObject const *target, Item const *itemTarget=nullptr) const
uint32 GetAllEffectsMechanicMask() const
bool CanPierceImmuneAura(SpellInfo const *auraSpellInfo) const
bool NeedsExplicitUnitTarget() const
DiminishingReturnsType GetDiminishingReturnsGroupType(bool triggered) const
bool HasEffect(SpellEffects effect) const
bool IsRangedWeaponSpell() const
bool HasAura(AuraType aura) const
std::array< SpellEffectInfo, MAX_SPELL_EFFECTS > const & GetEffects() const
uint32 AuraInterruptFlags
bool IsPositiveEffect(uint8 effIndex) const
bool IsSingleTarget() const
SpellInfo const * GetSpellInfo() const
void cast(bool skipCheck=false)
bool IsInterruptable() const
void SendChannelUpdate(uint32 time)
bool IsProcDisabled() const
int32 GetCastTime() const
void CallScriptOnResistAbsorbCalculateHandlers(DamageInfo const &damageInfo, uint32 &resistAmount, int32 &absorbAmount)
CurrentSpellTypes GetCurrentContainer() const
void cancel(SpellCastResult result=SPELL_FAILED_INTERRUPTED, Optional< SpellCastResult > resultOther={})
SpellCastResult prepare(SpellCastTargets const &targets, AuraEffect const *triggeredByAura=nullptr)
void SetReferencedFromCurrent(bool yes)
UsedSpellMods m_appliedMods
SpellCastResult CheckCast(bool strict, uint32 *param1=nullptr, uint32 *param2=nullptr)
void finish(bool ok=true)
static void SendCastResult(Player *caster, SpellInfo const *spellInfo, uint8 castCount, SpellCastResult result, SpellCustomErrors customError=SPELL_CUSTOM_ERROR_NONE, uint32 *param1=nullptr, uint32 *param2=nullptr)
SpellInfo const *const m_spellInfo
virtual void UnSummon(uint32 msTime=0)
SummonPropertiesEntry const *const m_Properties
Unit * GetSummonerUnit() const
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
Utility class to enable range for loop syntax for multimap.equal_range uses.
constexpr end_iterator end() const
constexpr iterator begin() const
virtual void OnCharmed(bool isNew)
float GetUnitMissChance() const
float GetSpellCritChanceReduction() const
void EnterVehicle(Unit *base, int8 seatId=-1)
int32 ModifyHealth(int32 val)
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
uint32 m_reactiveTimer[MAX_REACTIVE]
Unit * GetCharmed() const
void ClearUnitState(uint32 f)
void OutDebugInfo() const
bool IsWithinMeleeRangeAt(Position const &pos, Unit const *obj) const
void SetMinion(Minion *minion, bool apply)
std::pair< AuraApplicationMap::iterator, AuraApplicationMap::iterator > AuraApplicationMapBoundsNonConst
uint32 SpellHealingBonusTaken(Unit *caster, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype) const
int32 ModifyPower(Powers power, int32 val, bool withPowerUpdate=true)
void CastStop(uint32 except_spellid=0)
bool IsUnderLastManaUseEffect() const
void SetImmuneToAll(bool apply, bool keepCombat)
void BuildValuesUpdate(uint8 updatetype, ByteBuffer *data, Player const *target) const override
void SetImmuneToPC(bool apply, bool keepCombat)
bool m_duringRemoveFromWorld
void RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Vehicle * GetVehicle() const
bool HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName, flag96 familyFlags) const
virtual bool IsMovementPreventedByCasting() const
void RemoveAurasByType(AuraType auraType, std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
void AddComboPointHolder(Unit *unit)
void JumpTo(float speedXY, float speedZ, bool forward=true, Optional< Position > dest={})
bool HealthAbovePct(int32 pct) const
void RemoveGameObject(GameObject *gameObj, bool del)
bool isTargetableForAttack(bool checkFakeDeath=true) const
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
uint32 GetSchoolImmunityMask() const
Spell * m_currentSpells[CURRENT_MAX_SPELL]
void SetAnimTier(AnimTier animTier)
bool IsCharmerOrSelfPlayer() const
float m_baseSpellCritChance
SpellImmuneContainer m_spellImmune[MAX_SPELL_IMMUNITY]
uint32 GetMechanicImmunityMask() const
void AIUpdateTick(uint32 diff)
Unit * GetCharmerOrSelf() const
virtual void RecalculateObjectScale()
void HandleAttackPowerModifier(AttackPowerModIndex index, AttackPowerModType modifierType, float amount, bool apply)
float CalculateSpellpowerCoefficientLevelPenalty(SpellInfo const *spellInfo) const
virtual MovementGeneratorType GetDefaultMovementType() const
uint32 GetUnitMovementFlags() const
LiquidTypeEntry const * _lastLiquid
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
AuraApplication * GetVisibleAura(uint8 slot) const
static uint32 SpellCriticalHealingBonus(Unit const *caster, SpellInfo const *spellProto, uint32 damage, Unit *victim)
void _UpdateAutoRepeatSpell()
void SendMoveKnockBack(Player *player, float speedXY, float speedZ, float vcos, float vsin)
float GetRangedCritChanceReduction() const
float GetTotalAuraModValue(UnitMods unitMod) const
void Heartbeat() override
void RemoveAllControlled()
bool CanHaveThreatList() const
====================== THREAT & COMBAT ====================
Movement::MoveSpline * movespline
void RemoveGameObjectImpl(GameObject *gameObj, bool del)
void RemoveAurasByShapeShift()
float GetTotalStatValue(Stats stat) const
void SetGender(Gender gender)
float GetUnitCriticalChanceTaken(Unit const *attacker, WeaponAttackType attackType, float critDone) const
bool IsContestedGuard() const
std::unordered_map< ObjectGuid, uint32 > extraAttacksTargets
std::unordered_set< Unit * > m_ComboPointHolders
void UpdateUnitMod(UnitMods unitMod)
void UpdateDamagePctDoneMods(WeaponAttackType attackType)
float GetSpeed(UnitMoveType mtype) const
bool SetFall(bool enable)
void _UnregisterDynObject(DynamicObject *dynObj)
Aura * GetAuraOfRankedSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode=AURA_REMOVE_BY_DEFAULT)
void UpdateObjectVisibility(bool forced=true) override
void SendEnergizeSpellLog(Unit *victim, uint32 spellId, int32 damage, Powers powerType)
std::shared_ptr< UnitAI > i_AI
void SetCurrentCastSpell(Spell *pSpell)
void SetMinionGUID(ObjectGuid guid)
Diminishing m_Diminishing
void UpdateHeight(float newZ)
Only server-side height update, does not broadcast to client.
void _RemoveNoStackAurasDueToAura(Aura *aura, bool owned)
void SetConfused(bool apply)
void _UpdateSpells(uint32 time)
ThreatManager & GetThreatManager()
void RemoveNotOwnSingleTargetAuras(uint32 newPhase=0x0)
void ReplaceAllPvpFlags(UnitPVPStateFlags flags)
void AddToWorld() override
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)
std::vector< std::pair< uint8, AuraApplication * > > AuraApplicationProcContainer
void SetControlled(bool apply, UnitState state)
SpellSchools GetSpellSchoolByAuraGroup(UnitMods unitMod) const
void SetStunned(bool apply)
Stats GetStatByAuraGroup(UnitMods unitMod) const
void PushPendingMovementChange(PlayerMovementPendingChange newChange)
void HandleSpellClick(Unit *clicker, int8 seatId=-1)
bool CanUseAttackType(uint8 attacktype) const
bool IsWithinCombatRange(Unit const *obj, float dist2compare) const
std::list< Aura * > AuraList
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except=0)
void SendPetAIReaction(ObjectGuid guid) const
bool HasAuraTypeWithCaster(AuraType auraType, ObjectGuid caster) const
Spell * FindCurrentSpellBySpellId(uint32 spell_id) const
uint32 GetMountDisplayId() const
void UpdateAllDamageDoneMods()
Creature * GetVehicleCreatureBase() const
void UpdateDisplayPower()
uint32 MeleeDamageBonusTaken(Unit *attacker, uint32 pdamage, WeaponAttackType attType, SpellInfo const *spellProto=nullptr, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL)
float GetCollisionHeight() const override
GameClient * _gameClientMovingMe
void RemoveAllGameObjects()
static void DealHeal(HealInfo &healInfo)
virtual SpellSchoolMask GetMeleeDamageSchoolMask(WeaponAttackType attackType=BASE_ATTACK, uint8 damageIndex=0) const =0
bool isPossessedByPlayer() const
std::multimap< uint32, AuraApplication * > AuraApplicationMap
void _RegisterDynObject(DynamicObject *dynObj)
SpellHistory * _spellHistory
void UpdateSpeed(UnitMoveType mtype)
bool IsMovedByClient() const
bool IsPolymorphed() const
ShapeshiftForm GetShapeshiftForm() const
void SetFaction(uint32 faction) override
virtual void SetPvP(bool state)
ObjectGuid GetOwnerGUID() const override
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 CalculateDefaultCoefficient(SpellInfo const *spellInfo, DamageEffectType damagetype) const
float GetCombatRatingReduction(CombatRating cr) const
void RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId, ObjectGuid casterGUID, WorldObject *dispeller, uint8 chargesRemoved=1)
AuraApplication * GetAuraApplication(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraApplication *except=nullptr) const
uint32 SpellHealingBonusDone(Unit *victim, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, SpellEffectInfo const &spellEffectInfo, Optional< float > const &donePctTotal, uint32 stack=1) const
virtual void UpdateAttackPowerAndDamage(bool ranged=false)=0
static void CalcHealAbsorb(HealInfo &healInfo)
virtual void Yell(std::string_view text, Language language, WorldObject const *target=nullptr)
void CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType=BASE_ATTACK, bool crit=false, bool blocked=false, Spell *spell=nullptr)
void StopMoving(bool force=false)
Unit * GetVehicleRoot() const
void SetCantProc(bool apply)
Unit * GetCharmer() const
void SetSpeed(UnitMoveType mtype, float newValue)
void SetStatPctModifier(UnitMods unitMod, UnitModifierPctType modifierType, float val)
Unit * getAttackerForHelper() const
float GetUnitParryChance(WeaponAttackType attType, Unit const *victim) const
void SendMeleeAttackStart(Unit *victim)
Pet * CreateTamedPetFrom(Creature *creatureTarget, uint32 spell_id=0)
Trinity::unique_trackable_ptr< Vehicle > m_vehicleKit
float GetWeaponDamageRange(WeaponAttackType attType, WeaponDamageRange type, uint8 damageIndex=0) const
bool IsInDisallowedMountForm() const
uint32 GetDefenseSkillValue(Unit const *target=nullptr) const
void ApplyStatPctModifier(UnitMods unitMod, UnitModifierPctType modifierType, float amount)
void SendSpellDamageImmune(Unit *target, uint32 spellId)
virtual bool IsImmunedToSpell(SpellInfo const *spellInfo, WorldObject const *caster, bool requireImmunityPurgesEffectAttribute=false) const
UnitPVPStateFlags GetPvpFlags() const
void SendTeleportPacket(Position const &pos, bool teleportingTransport=false)
float m_attackPowerMods[uint32(AttackPowerModIndex::End)][uint32(AttackPowerModType::End)]
virtual void UpdateDamageDoneMods(WeaponAttackType attackType, int32 skipEnchantSlot=-1)
void _removeAttacker(Unit *pAttacker)
void SendAttackStateUpdate(CalcDamageInfo *damageInfo)
uint32 GetTransformSpell() const
void RemoveAllAurasExceptType(AuraType type)
void TriggerAurasProcOnEvent(Unit *actionTarget, uint32 typeMaskActor, uint32 typeMaskActionTarget, uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask, Spell *spell, DamageInfo *damageInfo, HealInfo *healInfo)
void DealSpellDamage(SpellNonMeleeDamage const *damageInfo, bool durabilityLoss)
uint32 _lastExtraAttackSpell
static void CalcAbsorbResist(DamageInfo &damageInfo, Spell *spell=nullptr)
PlayerMovementPendingChange PopPendingMovementChange()
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
MotionMaster * i_motionMaster
virtual bool CanFly() const =0
void ReplaceAllUnitFlags(UnitFlags flags)
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 RemoveVisibleAura(uint8 slot)
GameClient * GetGameClientMovingMe() const
void SetCharm(Unit *target, bool apply)
ObjectGuid GetCharmedGUID() const
void RemoveAurasWithFamily(SpellFamilyNames family, flag96 const &familyFlag, ObjectGuid casterGUID)
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 CleanupsBeforeDelete(bool finalCleanup=true) override
uint32 GetMaxHealth() const
void ResumeMovement(uint32 timer=0, uint8 slot=0)
Aura * AddAura(uint32 spellId, Unit *target)
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
bool isAttackingPlayer() const
ObjectGuid m_ObjectSlot[MAX_GAMEOBJECT_SLOT]
float SpellDamagePctDone(Unit *victim, SpellInfo const *spellProto, DamageEffectType damagetype) const
virtual void UpdateResistances(uint32 school)=0
int32 GetMaxNegativeAuraModifier(AuraType auraType) const
void UpdateSplineMovement(uint32 t_diff)
uint32 GetSpellCritDamageReduction(uint32 damage) const
float GetMeleeCritChanceReduction() const
bool HasUnitFlag2(UnitFlags2 flags) const
std::string GetDebugInfo() const override
std::pair< AuraMap::const_iterator, AuraMap::const_iterator > AuraMapBounds
uint32 GetRangedDamageReduction(uint32 damage) const
uint32 BuildAuraStateUpdateForTarget(Unit const *target) const
bool isInFrontInMap(Unit const *target, float distance, float arc=float(M_PI)) const
float m_createStats[MAX_STATS]
float m_auraFlatModifiersGroup[UNIT_MOD_END][MODIFIER_TYPE_FLAT_END]
bool HasAuraWithMechanic(uint32 mechanicMask) const
void SetImmuneToNPC(bool apply, bool keepCombat)
void PauseMovement(uint32 timer=0, uint8 slot=0, bool forced=true)
void SetPetNameTimestamp(uint32 timestamp)
bool IsSplineEnabled() const
void RemoveAllAurasRequiringDeadTarget()
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)
std::deque< PlayerMovementPendingChange > m_pendingMovementChanges
void ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply)
int32 GetMinPower(Powers) const
std::pair< AuraApplicationMap::const_iterator, AuraApplicationMap::const_iterator > AuraApplicationMapBounds
int32 GetMaxNegativeAuraModifierByMiscMask(AuraType auraType, uint32 misc_mask) const
int32 HealBySpell(HealInfo &healInfo, bool critical=false)
void AddPlayerToVision(Player *player)
void RemoveNpcFlag(NPCFlags flags)
void SendHealSpellLog(HealInfo &healInfo, bool critical=false)
void RewardRage(uint32 damage, uint32 weaponSpeedHitFactor, bool attacker)
int32 GetMaxPositiveAuraModifier(AuraType auraType) const
GameObject * GetGameObject(uint32 spellId) const
void _ExitVehicle(Position const *exitPosition=nullptr)
float SpellCritChanceTaken(Unit const *caster, SpellInfo const *spellInfo, SpellSchoolMask schoolMask, float doneChance, WeaponAttackType attackType=BASE_ATTACK, bool isPeriodic=false) const
uint32 m_removedAurasCount
uint32 GetRangedCritDamageReduction(uint32 damage) const
void RemoveAllAurasOnDeath()
void SetHealth(uint32 val)
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage const *log)
bool IsStandState() const
TempSummon * ToTempSummon()
void SetMaxPower(Powers power, uint32 val)
bool IsGravityDisabled() const
PlayerMovementPendingChange & PeakFirstPendingMovementChange()
CharmInfo * GetCharmInfo()
bool IsInCombatWith(Unit const *who) const
ObjectGuid GetCharmerOrOwnerGUID() const override
int32 GetMechanicResistChance(SpellInfo const *spellInfo) const
int32 GetMaxPositiveAuraModifierByMiscValue(AuraType auraType, int32 misc_value) const
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0) const
AuraMap::iterator m_auraUpdateIterator
std::list< AuraApplication * > AuraApplicationList
Unit * GetMeleeHitRedirectTarget(Unit *victim, SpellInfo const *spellInfo=nullptr)
ObjectGuid _lastDamagedTargetGuid
bool SetDisableGravity(bool disable, bool updateAnimTier=true)
void SetSpeedRateReal(UnitMoveType mtype, float rate)
void RemoveAllFollowers()
bool m_AutoRepeatFirstCast
uint32 CalculateDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, uint8 itemDamagesMask=0) const
void _DeleteRemovedAuras()
uint32 m_attackTimer[MAX_ATTACK]
Unit * GetNextRandomRaidMemberOrPet(float radius)
Powers GetPowerTypeByAuraGroup(UnitMods unitMod) const
void SetVirtualItem(uint32 slot, uint32 itemId)
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)
void ClearComboPointHolders()
float SpellCritChanceDone(SpellInfo const *spellInfo, SpellSchoolMask schoolMask, WeaponAttackType attackType=BASE_ATTACK, bool isPeriodic=false) const
float GetTotalAuraMultiplier(AuraType auraType) const
void Mount(uint32 mount, uint32 vehicleId=0, uint32 creatureEntry=0)
bool IsOnVehicle(Unit const *vehicle) const
void SendSpellDamageResist(Unit *target, uint32 spellId)
void RemoveComboPointHolder(Unit *unit)
uint32 SpellDamageBonusDone(Unit *victim, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, SpellEffectInfo const &spellEffectInfo, Optional< float > const &donePctTotal, uint32 stack=1) const
bool isInAccessiblePlaceFor(Creature const *c) const
bool IsCharmedOwnedByPlayerOrPlayer() const
Unit * EnsureVictim() const
int32 GetMaxNegativeAuraModifierByMiscValue(AuraType auraType, int32 misc_value) const
uint32 getAttackTimer(WeaponAttackType type) const
void CheckPendingMovementAcks()
bool IsDuringRemoveFromWorld() const
bool m_ControlledByPlayer
void SetFeared(bool apply)
void AddInterruptMask(uint32 flags)
Unit * GetCharmerOrOwner() const
uint32 GetDiseasesByCaster(ObjectGuid casterGUID, bool remove=false)
void RemoveAurasDueToItemSpell(uint32 spellId, ObjectGuid castItemGuid)
virtual void UpdateDamagePhysical(WeaponAttackType attType)
void SetFacingToObject(WorldObject const *object, bool force=true, uint32 movementId=EVENT_FACE)
virtual Gender GetNativeGender() const
void _ApplyAllAuraStatMods()
void ProcSkillsAndReactives(bool isVictim, Unit *procTarget, uint32 typeMask, uint32 hitMask, WeaponAttackType attType)
uint32 GetCreatureType() const
void AddGameObject(GameObject *gameObj)
void RemoveAurasWithMechanic(uint32 mechanicMaskToRemove, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT, uint32 exceptSpellId=0, bool withEffectMechanics=false)
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 IsThreatened() const
bool SetSwim(bool enable)
uint32 GetWeaponSkillValue(WeaponAttackType attType, Unit const *target=nullptr) const
void SetEmoteState(Emote emote)
Aura * GetOwnedAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, Aura *except=nullptr) const
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport=false)
int32 GetHealthGain(int32 dVal)
int32 GetMaxPositiveAuraModifierByMiscMask(AuraType auraType, uint32 misc_mask, AuraEffect const *except=nullptr) const
PositionUpdateInfo _positionUpdateInfo
void SetPvpFlag(UnitPVPStateFlags flags)
bool SetCanFly(bool enable, bool packetOnly=false)
AuraApplicationList m_interruptableAuras
float GetTotalAuraMultiplierByMiscValue(AuraType auraType, int32 misc_value) const
uint32 GetDisplayId() const
uint32 GetVirtualItemId(uint32 slot) const
static float CalculateAverageResistReduction(WorldObject const *caster, SpellSchoolMask schoolMask, Unit const *victim, SpellInfo const *spellInfo=nullptr)
void ModifyAuraState(AuraStateType flag, bool apply)
uint32 GetAuraCount(uint32 spellId) const
UnitAI * GetTopAI() const
void HandleProcExtraAttackFor(Unit *victim, uint32 count)
bool isPossessing() const
uint32 GetNativeDisplayId() const
void RemoveAllGroupBuffsFromCaster(ObjectGuid casterGUID)
virtual void UpdateArmor()=0
bool HealthBelowPct(int32 pct) const
void ApplyControlStatesIfNeeded()
void SetRooted(bool apply)
void AddUnitMovementFlag(uint32 f)
ThreatManager m_threatManager
uint32 _oldFactionId
faction before charm
bool Attack(Unit *victim, bool meleeAttack)
float GetTotalAuraMultiplierByAffectMask(AuraType auraType, SpellInfo const *affectedSpell) const
float MeleeSpellMissChance(Unit const *victim, WeaponAttackType attType, int32 skillDiff, uint32 spellId) const override
void UpdateAuraForGroup(uint8 slot)
bool HasAuraEffect(uint32 spellId, uint8 effIndex, ObjectGuid caster=ObjectGuid::Empty) const
ObjectGuid GetMinionGUID() const
bool HasUnitMovementFlag(uint32 f) const
static void ProcSkillsAndAuras(Unit *actor, Unit *actionTarget, uint32 typeMaskActor, uint32 typeMaskActionTarget, uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask, Spell *spell, DamageInfo *damageInfo, HealInfo *healInfo)
bool HasNegativeAuraWithInterruptFlag(uint32 flag, ObjectGuid guid=ObjectGuid::Empty) const
AuraApplication * _CreateAuraApplication(Aura *aura, uint8 effMask)
uint32 GetMaxPower(Powers power) const
virtual void UpdateMaxPower(Powers power)=0
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true, SpellCastResult result=SPELL_FAILED_INTERRUPTED, Optional< SpellCastResult > resultOther={})
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 SetPower(Powers power, uint32 val, bool withPowerUpdate=true, bool force=false)
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
float m_weaponDamage[MAX_ATTACK][2][2]
void RemovePvpFlag(UnitPVPStateFlags flags)
void SetAI(UnitAI *newAI)
AuraEffect * GetAuraEffectOfRankedSpell(uint32 spellId, uint8 effIndex, ObjectGuid casterGUID=ObjectGuid::Empty) const
void SendPlaySpellVisualKit(uint32 id, uint32 type) const
std::multimap< uint32, Aura * > AuraMap
virtual uint32 GetShieldBlockValue() const =0
void RemoveAuraFromStack(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
bool HasAuraType(AuraType auraType) const
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
void SendPetActionSound(PetAction action) const
void EngageWithTarget(Unit *who)
void NearTeleportTo(Position const &pos, bool casting=false)
void PurgeAndApplyPendingMovementChanges(bool informObservers=true)
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)
static void ApplyResilience(Unit const *victim, float *crit, int32 *damage, bool isCrit, CombatRating type)
float m_modMeleeHitChance
virtual bool CheckAttackFitToAuraRequirement(WeaponAttackType, AuraEffect const *) const
void _RemoveAllAuraStatMods()
void SetPhaseMask(uint32 newPhaseMask, bool update) override
uint32 GetAttackTime(WeaponAttackType att) const
ObjectGuid GetCritterGUID() const
uint8 GetLevelForTarget(WorldObject const *) const override
int32 GetTotalAuraModifier(AuraType auraType) const
void RemoveAurasDueToSpellBySteal(uint32 spellId, ObjectGuid casterGUID, WorldObject *stealer)
AuraApplication * GetAuraApplicationOfRankedSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraApplication *except=nullptr) const
void SetFullPower(Powers power)
void StopAttackFaction(uint32 faction_id)
bool HasScheduledAIChange() const
uint32 GetCastingTimeForBonus(SpellInfo const *spellProto, DamageEffectType damagetype, uint32 CastingTime) const
void RemoveAreaAurasDueToLeaveWorld()
float GetAPMultiplier(WeaponAttackType attType, bool normalized) const
bool CanModifyStats() const
void BuildMovementPacket(ByteBuffer *data) const
float GetUnitCriticalChanceDone(WeaponAttackType attackType) const
void RemoveCharmedBy(Unit *charmer)
bool CreateVehicleKit(uint32 id, uint32 creatureEntry)
void _ApplyAura(AuraApplication *aurApp, uint8 effMask)
float GetSpeedRate(UnitMoveType mtype) const
virtual void SetDisplayId(uint32 modelId)
bool ApplyDiminishingToDuration(SpellInfo const *auraSpellInfo, bool triggered, int32 &duration, WorldObject *caster, DiminishingLevels previousLevel) const
std::set< Unit * > AttackerSet
virtual void SetTarget(ObjectGuid const &)=0
void RemoveAppliedAuras(std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
void CleanupBeforeRemoveFromMap(bool finalCleanup)
void SetPowerType(Powers power, bool sendUpdate=true)
void UpdatePetCombatState()
std::vector< Unit * > UnitVector
bool IsMovedByServer() const
uint32 GetExtraUnitMovementFlags() const
int32 SpellBaseHealingBonusDone(SpellSchoolMask schoolMask) const
void UpdateOrientation(float orientation)
Only server-side orientation update, does not broadcast to client.
uint32 GetMeleeCritDamageReduction(uint32 damage) const
bool IsUnderWater() const
void SetSpeedRate(UnitMoveType mtype, float rate)
void AddExtraAttacks(uint32 count)
void RemovePlayerFromVision(Player *player)
void SendFlightSplineSyncUpdate()
void EnergizeBySpell(Unit *victim, uint32 spellId, int32 damage, Powers powerType)
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
Unit * GetFirstControlled() const
float GetTotalAuraMultiplierByMiscMask(AuraType auraType, uint32 misc_mask) const
void AddComboPoints(Unit *target, int8 count)
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
void DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
float GetAttackPowerModifierValue(AttackPowerModIndex index, AttackPowerModType modifierType) const
int32 CalculateAOEAvoidance(int32 damage, uint32 schoolMask, ObjectGuid const &casterGuid) const
void UpdateResistanceBuffModsMod(SpellSchools school)
bool HasUnitState(const uint32 f) const
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply)
uint32 GetSpellDamageReduction(uint32 damage) const
void FinishSpell(CurrentSpellTypes spellType, bool ok=true)
std::unordered_set< AbstractFollower * > m_followingMe
virtual void Update(uint32 time) override
bool IsInRaidWith(Unit const *unit) const
void ProcessPositionDataChanged(PositionFullTerrainStatus const &data) override
bool IsInFeralForm() const
DynamicObject * GetDynObject(uint32 spellId) const
void SetLevel(uint8 lvl, bool sendUpdate=true)
static uint32 SpellCriticalDamageBonus(Unit const *caster, SpellInfo const *spellProto, uint32 damage, Unit *victim)
std::pair< AuraMap::iterator, AuraMap::iterator > AuraMapBoundsNonConst
void RemoveUnitMovementFlag(uint32 f)
void RemoveBindSightAuras()
AuraApplicationMap m_appliedAuras
void HandleEmoteCommand(Emote emoteId)
CharmInfo * InitCharmInfo()
void RemoveAllAttackers()
void SetClass(uint8 classId)
void SetFacingTo(float ori, bool force=true, uint32 movementId=EVENT_FACE)
virtual bool CanSwim() const
virtual float GetNativeObjectScale() const
uint32 GetDoTsByCaster(ObjectGuid casterGUID) const
void RemoveFromWorld() override
bool IsHighestExclusiveAuraEffect(SpellInfo const *spellInfo, AuraType auraType, int32 effectAmount, uint8 auraEffectMask, bool removeOtherAuraApplications=false)
void SetVisibleAura(uint8 slot, AuraApplication *aurApp)
void AttackerStateUpdate(Unit *victim, WeaponAttackType attType=BASE_ATTACK, bool extra=false)
Player * GetCharmerOrSelfPlayer() const
virtual void UpdateMaxHealth()=0
uint32 HasUnitTypeMask(uint32 mask) const
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 SetStandState(UnitStandStateType state)
float GetStat(Stats stat) const
virtual void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float &minDamage, float &maxDamage, uint8 damageIndex) const =0
int32 GetTotalAuraModifierByMiscValue(AuraType auraType, int32 misc_value) const
SpellHistory * GetSpellHistory()
void IncrDiminishing(SpellInfo const *auraSpellInfo, bool triggered)
float m_modAttackSpeedPct[MAX_ATTACK]
bool IsControlledByPlayer() const
DiminishingLevels GetDiminishing(DiminishingGroup group) const
ObjectGuid GetCharmerGUID() 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)
AuraEffect * GetDummyAuraEffect(SpellFamilyNames name, uint32 iconId, uint8 effIndex) const
bool SetWaterWalking(bool enable)
bool HasStrongerAuraWithDR(SpellInfo const *auraSpellInfo, Unit *caster, bool triggered) const
virtual void setDeathState(DeathState s)
void SetMaxHealth(uint32 val)
void SetCreatorGUID(ObjectGuid creator)
void GetPartyMembers(std::list< Unit * > &units)
virtual void AtEngage(Unit *target)
static void Kill(Unit *attacker, Unit *victim, bool durabilityLoss=true)
ObjectGuid LastCharmerGUID
uint32 GetPower(Powers power) const
uint32 GetCombatRatingDamageReduction(CombatRating cr, float rate, float cap, uint32 damage) const
void CombatStop(bool includingCast=false, bool mutualPvP=true)
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()
uint32 GetMeleeDamageReduction(uint32 damage) const
void SetUnitFlag(UnitFlags flags)
MeleeHitOutcome RollMeleeOutcomeAgainst(Unit const *victim, WeaponAttackType attType) const
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()
std::list< AuraEffect * > AuraEffectList
void RemoveMovementImpairingAuras(bool withRoot)
bool isAttackReady(WeaponAttackType type=BASE_ATTACK) const
int32 GetTotalAuraModifierByAffectMask(AuraType auraType, SpellInfo const *affectedSpell) const
void SetPetNumberForClient(uint32 petNumber)
virtual void ProcessTerrainStatusUpdate(ZLiquidStatus oldLiquidStatus, Optional< LiquidData > const &newLiquidData)
VisibleAuraMap m_visibleAuras
uint32 GetCreateMana() const
std::vector< GameObject * > GetGameObjects(uint32 spellId) const
bool IsServiceProvider() 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
float m_speed_rate[MAX_MOVE_TYPE]
AuraList & GetSingleCastAuras()
bool IsAlwaysDetectableFor(WorldObject const *seer) const override
uint32 GetMovementCounterAndInc()
void SetModCastingSpeed(float castingSpeed)
Vehicle * GetVehicleKit() const
void PushAI(UnitAI *newAI)
float m_modSpellHitChance
void ValidateAttackersAndOwnTarget()
Guardian * GetGuardianPet() const
void resetAttackTimer(WeaponAttackType type=BASE_ATTACK)
virtual void Talk(std::string_view text, ChatMsg msgType, Language language, float textRange, WorldObject const *target)
virtual bool IsEngaged() const
uint32 MeleeDamageBonusDone(Unit *pVictim, uint32 damage, WeaponAttackType attType, SpellInfo const *spellProto=nullptr, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL)
AuraEffectList m_modAuras[TOTAL_AURAS]
void _ApplyAuraEffect(Aura *aura, uint8 effIndex)
void RemoveAllMinionsByEntry(uint32 entry)
void SendPetActionFeedback(PetActionFeedback msg, uint32 spellId) const
-------—Pet responses methods--------------—
AuraMap & GetOwnedAuras()
void UpdateAllDamagePctDoneMods()
int32 SpellBaseDamageBonusDone(SpellSchoolMask schoolMask) const
virtual void Whisper(std::string_view text, Language language, Player *target, bool isBossWhisper=false)
void KnockbackFrom(float x, float y, float speedXY, float speedZ)
int32 GetCurrentSpellCastTime(uint32 spell_id) const
void RemoveAurasOnEvade()
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
ObjectGuid m_SummonSlot[MAX_SUMMON_SLOT]
uint32 GetCreatePowerValue(Powers power) const
static void DealDamageMods(Unit const *victim, uint32 &damage, uint32 *absorb)
SharedVisionList m_sharedVision
void SendMeleeAttackStop(Unit const *victim=nullptr) const
ObjectGuid GetTarget() const
bool _isWalkingBeforeCharm
Are we walking before we were charmed?
void SetMountDisplayId(uint32 mountDisplayId)
float GetTotalAttackPowerValue(WeaponAttackType attType) const
uint32 GetModelForForm(ShapeshiftForm form, uint32 spellId) const
void RemoveUnitFlag(UnitFlags flags)
void MonsterMoveWithSpeed(float x, float y, float z, float speed, bool generatePath=false, bool forceDestination=false)
uint32 GetDamageImmunityMask() const
bool HasPendingMovementChange() const
Player * GetControllingPlayer() const
float GetWeaponProcChance() const
Aura * _TryStackingOrRefreshingExistingAura(AuraCreateInfo &createInfo)
ObjectGuid GetPetGUID() const
uint32 SpellDamageBonusTaken(Unit *caster, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype) const
void RemoveAurasWithAttribute(SpellAttr0 flags)
void UpdateStatBuffMod(Stats stat)
virtual void ExitVehicle(Position const *exitPosition=nullptr)
void SendPetDismissSound() const
float m_auraPctModifiersGroup[UNIT_MOD_END][MODIFIER_TYPE_PCT_END]
uint32 GetMaxSkillValueForLevel(Unit const *target=nullptr) const
void CombatStopWithPets(bool includingCast=false)
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
void DestroyForPlayer(Player *target, bool onDeath) const override
bool BuildPacket(WorldPacket *packet)
void AppendToPacket(ByteBuffer *data)
bool GetBit(uint32 index) const
Unit * GetBase() const
May be called from scripts.
VehicleEntry const * GetVehicleInfo() const
Vehicle * RemovePassenger(Unit *passenger)
Removes the passenger from the vehicle.
bool AddPassenger(Unit *passenger, int8 seatId=-1)
Attempts to add a passenger to the vehicle on 'seatId'.
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)
int8 GetTransSeat() const
virtual void SetPhaseMask(uint32 newPhaseMask, bool update)
uint32 GetPhaseMask() 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
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
virtual bool IsAlwaysDetectableFor(WorldObject const *) 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
bool IsHostileTo(WorldObject const *target) const
ZoneScript * GetZoneScript() const
uint32 GetInstanceId() const
void setActive(bool isActiveObject)
bool InSamePhase(uint32 phasemask) const
std::string const & GetName() const
virtual bool IsAlwaysVisibleFor(WorldObject const *) const
bool IsWithinLOSInMap(WorldObject const *obj, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing) const
virtual void ProcessPositionDataChanged(PositionFullTerrainStatus const &data)
void GetContactPoint(WorldObject const *obj, float &x, float &y, float &z, float distance2d=CONTACT_DISTANCE) const
Transport * GetTransport() const
void UpdatePositionData()
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
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
int32 CalculateSpellDamage(SpellEffectInfo const &spellEffectInfo, int32 const *basePoints=nullptr) const
virtual void UpdateObjectVisibility(bool forced=true)
virtual void CleanupsBeforeDelete(bool finalCleanup=true)
void Initialize(uint16 opcode, size_t newres=200)
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::array< SubDamage, 2 > SubDmg
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
uint32 SequenceIndex
Unit movement packet index, incremented each time.
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
::PetActionFeedback Response
WorldPacket const * Write() override
WorldPacket const * Write() override
TaggedPosition< Position::XYZ > ModelPosition
WorldPacket const * Write() override
void SendPacket(WorldPacket const *packet)
Send a packet to the client.
LocaleConstant GetSessionDbLocaleIndex() const
void KickPlayer(std::string const &reason)
Kick a player out of the World.
@ SMSG_PET_UPDATE_COMBO_POINTS
@ SMSG_SPLINE_MOVE_STOP_SWIM
@ SMSG_SPLINE_MOVE_LAND_WALK
@ SMSG_SPLINE_MOVE_START_SWIM
@ SMSG_SPLINE_MOVE_SET_RUN_MODE
@ SMSG_SPLINE_MOVE_GRAVITY_DISABLE
@ SMSG_SPELLORDAMAGE_IMMUNE
@ MSG_MOVE_UPDATE_CAN_FLY
@ SMSG_MOVE_GRAVITY_DISABLE
@ SMSG_MOVE_GRAVITY_ENABLE
@ SMSG_PLAYER_VEHICLE_DATA
@ SMSG_SPLINE_MOVE_SET_HOVER
@ SMSG_UPDATE_COMBO_POINTS
@ SMSG_SPLINE_MOVE_SET_FLYING
@ SMSG_SPLINE_MOVE_UNSET_HOVER
@ SMSG_SPLINE_MOVE_UNROOT
@ SMSG_SPLINE_MOVE_NORMAL_FALL
@ SMSG_SPLINE_MOVE_FEATHER_FALL
@ SMSG_SPLINE_MOVE_SET_WALK_MODE
@ SMSG_SPLINE_MOVE_GRAVITY_ENABLE
@ SMSG_SPLINE_MOVE_UNSET_FLYING
@ SMSG_MOVE_UNSET_CAN_FLY
@ SMSG_SPLINE_MOVE_WATER_WALK
@ CONFIG_PENDING_MOVE_CHANGES_TIMEOUT
@ CONFIG_CREATURE_FAMILY_FLEE_DELAY
@ RATE_DURABILITY_LOSS_DAMAGE
@ RATE_DURABILITY_LOSS_ON_DEATH
@ CONFIG_LISTEN_RANGE_YELL
@ CONFIG_LISTEN_RANGE_SAY
@ CONFIG_LISTEN_RANGE_TEXTEMOTE
@ CONFIG_DURABILITY_LOSS_IN_PVP
@ CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP
TimePoint Now()
Current chrono steady_clock time point.
TC_GAME_API WorldObject * GetWorldObject(WorldObject const &, ObjectGuid const &)
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
TC_GAME_API Player * FindPlayer(ObjectGuid const &)
TC_GAME_API Player * GetPlayer(Map const *, ObjectGuid const &guid)
TC_GAME_API Creature * GetCreatureOrPetOrVehicle(WorldObject const &, ObjectGuid const &)
auto MapEqualRange(M &map, typename M::key_type const &key)
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
TC_COMMON_API std::vector< std::string_view > Tokenize(std::string_view str, char sep, bool keepEmpty)
bool IsValidMapCoord(float c)
AuraCreateInfo & SetBaseAmount(int32 const *bp)
AuraCreateInfo & SetCaster(Unit *caster)
uint8 GetAuraEffectMask() const
AuraCreateInfo & SetCasterGUID(ObjectGuid const &guid)
SpellInfo const * GetSpellInfo() const
std::string const & GetText(LocaleConstant locale=DEFAULT_LOCALE, uint8 gender=GENDER_MALE, bool forceGender=false) const
WeaponAttackType AttackType
struct CalcDamageInfo::@227 Damages[2]
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 LoadPetActionBar(const std::string &data)
void SetActionBar(uint8 index, uint32 spellOrAction, ActiveStates type)
bool AddSpellToActionBar(SpellInfo const *spellInfo, ActiveStates newstate=ACT_DECIDE, uint8 preferredSlot=0)
void InitPossessCreateSpells()
void SetIsAtStay(bool val)
void SetPetNumber(uint32 petnumber, bool statwindow)
void SetIsFollowing(bool val)
UnitActionBarEntry PetActionBar[MAX_UNIT_ACTION_BAR_INDEX]
void SetIsReturning(bool val)
void InitCharmCreateSpells()
void BuildActionBar(WorldPacket *data)
bool RemoveSpellFromActionBar(uint32 spell_id)
void SetSpellAutocast(SpellInfo const *spellInfo, bool state)
void GetStayPosition(float &x, float &y, float &z)
ReactStates _oldReactState
void ToggleCreatureAutocast(SpellInfo const *spellInfo, bool apply)
void InitEmptyActionBar(bool withAttack=true)
void SetIsCommandAttack(bool val)
CharmSpellInfo _charmspells[4]
bool HasFlag(ChrRacesFlags flag) const
MeleeHitOutcome hitOutCome
WeaponAttackType attackType
uint32 ExtendedDisplayInfoID
bool HasFlag(CreatureModelDataFlags flag) const
uint32 GetFirstVisibleModel() const
bool IsFriendlyTo(FactionTemplateEntry const &entry) const
uint32 GetSubClass() const
bool FillLoot(uint32 lootId, LootStore const &store, Player *lootOwner, bool personal, bool noEmptyError=false, uint16 lootMode=LOOT_MODE_DEFAULT)
void generateMoneyLoot(uint32 minAmount, uint32 maxAmount)
uint16 GetExtraMovementFlags() const
struct MovementInfo::JumpInfo jump
void RemoveMovementFlag(uint32 flag)
struct MovementInfo::TransportInfo transport
bool HasMovementFlag(uint32 flag) const
uint32 GetMovementFlags() const
void SetFallTime(uint32 val)
bool HasExtraMovementFlag(uint16 flag) const
PlayerMovementPendingChange()
MovementChangeType movementChangeType
Optional< LiquidData > liquidInfo
float GetExactDist2d(const float x, const float y) const
float GetRelativeAngle(float x, float y) const
std::string ToString() const
float GetPositionZ() const
float GetOrientation() const
bool HasInArc(float arcangle, Position const *pos, float border=2.0f) const
float GetAbsoluteAngle(float x, float y) const
void GetSinCos(float x, float y, float &vsin, float &vcos) const
void SetOrientation(float orientation)
Position GetPosition() const
float GetPositionX() const
void GetPosition(float &x, float &y) const
float GetPositionY() const
void RelocateOffset(Position const &offset)
void Relocate(float x, float y)
AuraEffect const * auraEff
uint32 CreatureDisplayID[4]
void SetActionAndType(uint32 action, ActiveStates type)
bool IsActionBarForSpell() const
void SetType(ActiveStates type)
void SetAction(uint32 action)
VehicleExitParameters ExitParameter