114 : m_attacker(attacker), m_victim(victim), m_damage(damage), m_spellInfo(spellInfo), m_schoolMask(schoolMask), m_damageType(damageType), m_attackType(attackType),
115 m_absorb(0), m_resist(0), m_block(0), m_hitMask(0)
120 : 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)),
121 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)
130 : m_attacker(dmgInfo.Attacker), m_victim(dmgInfo.Target), m_damage(dmgInfo.Damages[damageIndex].Damage), m_spellInfo(nullptr), m_schoolMask(
SpellSchoolMask(dmgInfo.Damages[damageIndex].DamageSchoolMask)),
131 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)
172 if (!damageNullified)
176 if (!damageNullified)
183 : m_attacker(spellNonMeleeDamage.attacker), m_victim(spellNonMeleeDamage.target), m_damage(spellNonMeleeDamage.damage),
184 m_spellInfo(
sSpellMgr->GetSpellInfo(spellNonMeleeDamage.SpellID)), m_schoolMask(
SpellSchoolMask(spellNonMeleeDamage.schoolMask)), m_damageType(damageType),
185 m_attackType(attackType), m_absorb(spellNonMeleeDamage.absorb), m_resist(spellNonMeleeDamage.resist), m_block(spellNonMeleeDamage.blocked), m_hitMask(hitMask)
187 if (spellNonMeleeDamage.
blocked)
189 if (spellNonMeleeDamage.
absorb)
238 : _healer(healer), _target(target), _heal(heal), _effectiveHeal(0), _absorb(0), _spellInfo(spellInfo), _schoolMask(schoolMask), _hitMask(0)
244 amount = std::min(amount,
GetHeal());
262 _actor(actor), _actionTarget(actionTarget),
263 _typeMask(typeMask), _spellTypeMask(spellTypeMask),
264 _spellPhaseMask(spellPhaseMask), _hitMask(hitMask), _spell(spell),
265 _damageInfo(damageInfo), _healInfo(healInfo)
291 _aura(aura), _chance(dispelChance), _charges(dispelCharges)
303 WorldObject(isWorldObject), m_lastSanctuaryTime(0), LastCharmerGUID(), movespline(new
Movement::MoveSpline()),
304 m_ControlledByPlayer(false), m_AutoRepeatFirstCast(false), m_procDeep(0), m_transformSpell(0),
305 m_removedAurasCount(0), m_charmer(nullptr), m_charmed(nullptr),
306 i_motionMaster(new
MotionMaster(this)), m_regenTimer(0), m_vehicle(nullptr), m_vehicleKit(nullptr),
307 m_unitTypeMask(
UNIT_MASK_NONE), m_Diminishing(), m_combatManager(this), m_threatManager(this),
308 m_aiLocked(false), m_comboTarget(nullptr), m_comboPoints(0), _spellHistory(new
SpellHistory(this))
459 uint32 count = itr->second;
513 return player->GetWeaponForAttack(
OFF_ATTACK,
true) !=
nullptr;
522 init.MoveTo(x, y, z, generatePath, forceDestination);
523 init.SetVelocity(speed);
560 transport->CalculatePassengerPosition(loc.x, loc.y, loc.z, &loc.
orientation);
611 float distsq = dx * dx + dy * dy + dz * dz;
614 float maxdist = dist2compare + sizefactor;
616 return distsq < maxdist * maxdist;
627 float distsq = dx*dx + dy*dy + dz*dz;
631 return distsq <= maxdist * maxdist;
664 m_interruptMask |= (*i)->GetBase()->GetSpellInfo()->AuraInterruptFlags;
676 for (AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
677 if (
SpellInfo const* iterSpellProto = (*itr)->GetSpellInfo())
678 if (iterSpellProto->SpellFamilyName == familyName && iterSpellProto->SpellFamilyFlags & familyFlags)
686 for (AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
687 if ((!excludeAura || excludeAura != (*itr)->GetSpellInfo()->Id) &&
697 excludeAura = currentChanneledSpell->GetSpellInfo()->Id;
721 victimAI->DamageTaken(attacker, damage, damagetype, spellProto);
723 if (
UnitAI* attackerAI = attacker ? attacker->
GetAI() :
nullptr)
724 attackerAI->DamageDealt(victim, damage, damagetype);
727 sScriptMgr->OnDamage(attacker, victim, damage);
730 if (attacker != victim && damagetype !=
DOT)
734 if (
CreatureAI* controlledAI = cControlled->AI())
735 controlledAI->OwnerAttackedBy(attacker);
761 uint32 interruptFlags = spell->m_spellInfo->InterruptFlags;
772 for (AuraEffectList::iterator i = vCopyDamageCopy.begin(); i != vCopyDamageCopy.end(); ++i)
775 if (!((*i)->GetBase()->IsAppliedOnTarget(victim->
GetGUID())))
778 if (((*i)->GetMiscValue() & damageSchoolMask) == 0)
781 Unit* shareDamageTarget = (*i)->GetCaster();
782 if (!shareDamageTarget)
784 SpellInfo const* spell = (*i)->GetSpellInfo();
797 uint32 weaponSpeedHitFactor;
806 weaponSpeedHitFactor *= 2;
808 attacker->
RewardRage(rage_damage, weaponSpeedHitFactor,
true);
830 bool duel_hasEnded =
false;
831 bool duel_wasMounted =
false;
841 duel_hasEnded =
true;
847 if (victimRider && victimRider->
duel && victimRider->
duel->IsMounted)
856 duel_wasMounted =
true;
857 duel_hasEnded =
true;
861 if (attacker && attacker != victim)
886 if (health <= damage)
925 rage_damage = damage + (cleanDamage ? cleanDamage->
absorbed_damage : 0);
939 if (damagetype !=
NODAMAGE && damagetype !=
DOT && damage)
947 uint32 interruptFlags = spell->m_spellInfo->InterruptFlags;
957 spell->DelayedChannel();
973 he->
duel->Opponent->CombatStopWithPets(
true);
1001 if (!victim || !victim->
IsAlive())
1025 uint32 crit_bonus = damage;
1029 damage += crit_bonus;
1032 float critPctDamageMod = 0.0f;
1044 if (critPctDamageMod != 0)
1045 AddPct(damage, critPctDamageMod);
1060 damage -= damageInfo->
blocked;
1094 damageInfo->
damage = damage;
1122 if (spellProto ==
nullptr)
1124 TC_LOG_DEBUG(
"entities.unit",
"Unit::DealSpellDamage has wrong damageInfo->SpellID: {}", damageInfo->
SpellID);
1137 damageInfo->
Target = victim;
1180 uint8 immunedMask = 0;
1183 immunedMask |= (1 << i);
1185 if (immunedMask == ((1 << 0) | (1 << 1)))
1199 if (immunedMask & (1 << i))
1307 uint8 fullBlockMask = 0;
1310 if (remainingBlock && remainingBlock >= damageInfo->
Damages[i].
Damage)
1312 fullBlockMask |= (1 << i);
1327 if (fullBlockMask == ((1 << 0) | (1 << 1)))
1330 damageInfo->
Blocked -= remainingBlock;
1351 int32 const reductionMax = leveldif * 10;
1352 int32 const reductionMin = std::max(1, reductionMax - 10);
1354 float reducePercent = 1.f -
irand(reductionMin, reductionMax) / 100.0f;
1388 resilienceReduction = damageInfo->
Damages[i].
Damage - resilienceReduction;
1437 auto canTakeMeleeDamage = [&]()
1442 if (!canTakeMeleeDamage())
1455 float percent60 = 3.0f * percent20;
1456 if (offtime > percent20 && offtime <= percent60)
1458 else if (offtime > percent60)
1460 offtime -= 2.0f * percent20;
1467 float percent60 = 3.0f * percent20;
1468 if (basetime > percent20 && basetime <= percent60)
1470 else if (basetime > percent60)
1472 basetime -= 2.0f * percent20;
1494 float chance = 20.0f;
1498 chance = 0.65f * victim->
GetLevel() + 0.5f;
1503 chance *= attackerMeleeSkill / float(victimDefense) * 0.16f;
1523 for (
AuraEffect const* aurEff : vDamageShieldsCopy)
1525 SpellInfo const* spellInfo = aurEff->GetSpellInfo();
1542 uint32 damage = aurEff->GetAmount();
1543 if (
Unit* caster = aurEff->GetCaster())
1545 damage = caster->SpellDamageBonusDone(
this, spellInfo, damage,
SPELL_DIRECT_DAMAGE, aurEff->GetSpellEffectInfo(), { });
1559 data <<
uint32(std::max(overkill, 0));
1587 float armor = float(victim->
GetArmor());
1599 for (
AuraEffect const* aurEff : resIgnoreAurasAb)
1602 armor = std::floor(
AddPct(armor, -aurEff->GetAmount()));
1606 for (
AuraEffect const* aurEff : resIgnoreAuras)
1609 armor = std::floor(
AddPct(armor, -aurEff->GetAmount()));
1626 float maxArmorPen = 0.f;
1628 maxArmorPen = float(400 + 85 * victim->
GetLevel());
1630 maxArmorPen = 400 + 85 * victim->
GetLevel() + 4.5f * 85 * (victim->
GetLevel() - 59);
1633 maxArmorPen = std::min((armor + maxArmorPen) / 3.f, armor);
1642 float levelModifier = attacker ? attacker->
GetLevel() : attackerLevel;
1643 if (levelModifier > 59.f)
1644 levelModifier = levelModifier + 4.5f * (levelModifier - 59.f);
1646 float damageReduction = 0.1f * armor / (8.5f * levelModifier + 40.f);
1647 damageReduction /= (1.0f + damageReduction);
1650 return uint32(std::ceil(std::max(damage * (1.0f - damageReduction), 0.0f)));
1671 float discreteResistProbability[11] = { };
1672 if (averageResist <= 0.1f)
1674 discreteResistProbability[0] = 1.0f - 7.5f * averageResist;
1675 discreteResistProbability[1] = 5.0f * averageResist;
1676 discreteResistProbability[2] = 2.5f * averageResist;
1680 for (
uint32 i = 0; i < 11; ++i)
1681 discreteResistProbability[i] = std::max(0.5f - 2.5f * std::fabs(0.1f * i - averageResist), 0.0f);
1685 float probabilitySum = 0.0f;
1688 for (; resistance < 11; ++resistance)
1689 if (roll < (probabilitySum += discreteResistProbability[resistance]))
1692 float damageResisted = damage * resistance / 10.f;
1693 if (damageResisted > 0.0f)
1695 int32 ignoredResistance = 0;
1708 ignoredResistance = std::min<int32>(ignoredResistance, 100);
1709 ApplyPct(damageResisted, 100 - ignoredResistance);
1715 float armorReduction = damage - damageAfterArmor;
1718 damageResisted = std::min(damageResisted, armorReduction);
1722 damageResisted = std::max(damageResisted, 0.f);
1723 return uint32(damageResisted);
1728 float victimResistance = float(victim->
GetResistance(schoolMask));
1735 victimResistance -= float(player->GetSpellPenetrationItemMod());
1737 else if (
Unit const* unitCaster = caster->
ToUnit())
1743 victimResistance = 0.0f;
1747 victimResistance = 0.0f;
1749 victimResistance = std::max(victimResistance, 0.0f);
1756 static uint32 const BOSS_LEVEL = 83;
1757 static float const BOSS_RESISTANCE_CONSTANT = 510.0f;
1759 float resistanceConstant = 0.0f;
1761 if (level == BOSS_LEVEL)
1762 resistanceConstant = BOSS_RESISTANCE_CONSTANT;
1764 resistanceConstant = level * 5.0f;
1766 return victimResistance / (victimResistance + resistanceConstant);
1777 float auraAbsorbMod = 0.f;
1783 if (!(aurEff->GetMiscValue() & damageInfo.GetSchoolMask()))
1786 if (!aurEff->IsAffectingSpell(damageInfo.GetSpellInfo()))
1809 for (AuraEffectList::iterator itr = vSchoolAbsorbCopy.begin(); (itr != vSchoolAbsorbCopy.end()) && (damageInfo.
GetDamage() > 0); ++itr)
1822 if (currentAbsorb < 0)
1827 bool defaultPrevented =
false;
1830 currentAbsorb = tempAbsorb;
1832 if (defaultPrevented)
1840 tempAbsorb = currentAbsorb;
1856 for (AuraEffectList::const_iterator itr = vManaShieldCopy.begin(); (itr != vManaShieldCopy.end()) && (damageInfo.
GetDamage() > 0); ++itr)
1870 if (currentAbsorb < 0)
1873 uint32 tempAbsorb = currentAbsorb;
1875 bool defaultPrevented =
false;
1878 currentAbsorb = tempAbsorb;
1880 if (defaultPrevented)
1886 int32 manaReduction = currentAbsorb;
1890 manaReduction =
int32(
float(manaReduction) * manaMultiplier);
1895 currentAbsorb = currentAbsorb ?
int32(
float(currentAbsorb) * (
float(manaTaken) /
float(manaReduction))) : 0;
1899 tempAbsorb = currentAbsorb;
1919 for (AuraEffectList::iterator itr = vSplitDamageFlatCopy.begin(); (itr != vSplitDamageFlatCopy.end()) && (damageInfo.
GetDamage() > 0); ++itr)
1922 if (!((*itr)->GetBase()->IsAppliedOnTarget(damageInfo.
GetVictim()->
GetGUID())))
1929 Unit* caster = (*itr)->GetCaster();
1933 int32 splitDamage = (*itr)->GetAmount();
1947 uint32 splitted = splitDamage;
1948 uint32 splitted_absorb = 0;
1952 attacker->SendSpellNonMeleeDamageLog(caster, (*itr)->GetSpellInfo()->Id, splitted, damageInfo.
GetSchoolMask(), splitted_absorb, 0, damageInfo.
GetDamageType() ==
DOT, 0,
false,
true);
1961 for (AuraEffectList::iterator itr = vSplitDamagePctCopy.begin(); itr != vSplitDamagePctCopy.end() && damageInfo.
GetDamage() > 0; ++itr)
1973 Unit* caster = (*itr)->GetCaster();
1979 (*itr)->GetBase()->CallScriptEffectSplitHandlers((*itr), aurApp, damageInfo, splitDamage);
1997 attacker->SendSpellNonMeleeDamageLog(caster, (*itr)->GetSpellInfo()->Id, splitDamage, damageInfo.
GetSchoolMask(), split_absorb, 0, damageInfo.
GetDamageType() ==
DOT, 0,
false,
true);
2014 int32 absorbAmount = 0;
2017 bool existExpired =
false;
2021 for (AuraEffectList::const_iterator i = vHealAbsorb.begin(); i != vHealAbsorb.end() && absorbAmount <= healing; ++i)
2027 int32 currentAbsorb = (*i)->GetAmount();
2030 if (currentAbsorb <= 0)
2032 existExpired =
true;
2038 if (healing < currentAbsorb + absorbAmount)
2039 currentAbsorb = healing - absorbAmount;
2041 absorbAmount += currentAbsorb;
2044 (*i)->SetAmount((*i)->GetAmount() - currentAbsorb);
2046 if ((*i)->GetAmount() <= 0)
2047 existExpired =
true;
2053 for (AuraEffectList::const_iterator i = vHealAbsorb.begin(); i != vHealAbsorb.end();)
2062 i = vHealAbsorb.begin();
2067 if (absorbAmount > 0)
2117 TC_LOG_DEBUG(
"entities.unit",
"AttackerStateUpdate: {} attacked {} for {} dmg, absorbed {}, blocked {}, resisted {}.",
2138 targetGUID = selection;
2172 int32 sum = 0, tmp = 0;
2185 canParryOrBlock =
false;
2190 if (tmp > 0 && roll < (sum += tmp))
2202 && roll < (sum += tmp))
2207 if (canParryOrBlock)
2211 && roll < (sum += tmp))
2222 int32 skill = attackerWeaponSkill;
2223 int32 maxskill = attackerMaxSkillValueForLevel;
2224 skill = (skill > maxskill) ? maxskill : skill;
2228 tmp = 600 + (victimDefenseSkill - skill) * 120;
2229 tmp = std::min(tmp, 4000);
2230 if (tmp > 0 && roll < (sum += tmp))
2235 if (canParryOrBlock)
2239 && roll < (sum += tmp))
2245 if (tmp > 0 && roll < (sum += tmp))
2256 tmp = victimDefenseSkill;
2258 tmp = std::min(tmp, victimMaxSkillValueForLevel);
2260 tmp = attackerMaxSkillValueForLevel - tmp;
2262 tmp = std::max(tmp, 20);
2265 tmp = tmp * 200 - 1500;
2266 if (tmp > 0 && roll < (sum += tmp))
2276 float minDamage = 0.0f;
2277 float maxDamage = 0.0f;
2279 if (normalized || !addTotalPct || itemDamagesMask)
2282 if (!itemDamagesMask)
2283 itemDamagesMask = (1 << 0) | (1 << 1);
2287 if (itemDamagesMask & (1 << i))
2289 float minTmp, maxTmp;
2291 minDamage += minTmp;
2292 maxDamage += maxTmp;
2317 minDamage = std::max(0.f, minDamage);
2318 maxDamage = std::max(0.f, maxDamage);
2320 if (minDamage > maxDamage)
2321 std::swap(minDamage, maxDamage);
2331 return std::max(0.0f, std::min(1.0f, (22.0f + spellInfo->
MaxLevel -
GetLevel()) / 20.0f));
2364 int32 resistMech = 0;
2367 if (!effect.IsEffect())
2374 if (resistMech < temp)
2379 return std::max(resistMech, 0);
2407 int32 attackerWeaponSkill;
2426 tmp += resist_chance;
2436 bool canBlock =
true;
2456 tmp += deflect_chance;
2485 if (!aurEff->IsAffectingSpell(spellInfo))
2488 switch (aurEff->GetMiscValue())
2500 TC_LOG_DEBUG(
"entities.unit",
"Spell {} SPELL_AURA_IGNORE_COMBAT_RESULT has unhandled state {}", aurEff->GetId(), aurEff->GetMiscValue());
2509 if (dodgeChance < 0)
2512 if (roll < (tmp += dodgeChance))
2520 if (parryChance < 0)
2531 if (blockChance < 0)
2545 if (value >= hard_cap)
2547 value = (soft_cap + hard_cap) / 2;
2549 else if (value > soft_cap)
2551 value = soft_cap + ((value - soft_cap) / 2);
2576 int32 const skillDiff = victimMaxSkillValueForLevel - attackerWeaponSkill;
2578 float chance = 0.0f;
2579 float skillBonus = 0.0f;
2583 skillBonus = 0.04f * skillDiff;
2592 if (skillDiff <= 10)
2593 skillBonus = skillDiff * 0.1f;
2595 skillBonus = 1.0f + (skillDiff - 10) * 0.1f;
2599 chance += skillBonus;
2612 return std::max(chance, 0.0f);
2619 int32 const skillDiff = victimMaxSkillValueForLevel - attackerWeaponSkill;
2621 float chance = 0.0f;
2622 float skillBonus = 0.0f;
2625 if (playerVictim->CanParry())
2629 tmpitem = playerVictim->GetWeaponForAttack(
OFF_ATTACK,
true);
2634 skillBonus = 0.04f * skillDiff;
2644 if (skillDiff <= 10)
2645 skillBonus = skillDiff * 0.1f;
2647 skillBonus = 1.0f + (skillDiff - 10) * 1.6f;
2651 chance += skillBonus;
2658 return std::max(chance, 0.0f);
2663 float miss_chance = 5.0f;
2666 miss_chance += player->GetMissPercentageFromDefense();
2675 int32 const skillDiff = victimMaxSkillValueForLevel - attackerWeaponSkill;
2677 float chance = 0.0f;
2678 float skillBonus = 0.0f;
2681 if (playerVictim->CanBlock())
2687 skillBonus = 0.04f * skillDiff;
2698 if (skillDiff <= 10)
2699 skillBonus = skillDiff * 0.1f;
2701 skillBonus = 1.0f + (skillDiff - 10) * 0.1f;
2705 chance += skillBonus;
2706 return std::max(chance, 0.0f);
2748 int32 const skillDiff = victimDefenseSkill - attackerWeaponSkill;
2750 float skillBonus = 0.0f;
2751 float chance = critDone;
2768 skillBonus = -skillDiff * 0.04f;
2771 skillBonus = -skillDiff * 0.12f;
2772 if (skillDiff >= 15)
2776 chance += skillBonus;
2777 return std::max(chance, 0.f);
2791 Item* item = player->GetWeaponForAttack(attType,
true);
2807 ? player->GetMaxSkillValue(skill)
2808 : player->GetSkillValue(skill);
2868 if (i->second->IsExpired())
2877 if (itr->second->IsNeedClientUpdate())
2878 itr->second->ClientUpdate();
2884 GameObjectList::iterator itr;
2887 if (!(*itr)->isSpawned())
2890 (*itr)->SetRespawnTime(0);
2910 if (autoRepeatSpellInfo->
Id != 75)
2928 if (autoRepeatSpellInfo->
Id != 75)
3039 spell->
cancel(result, resultOther);
3137 if (spell->GetSpellInfo()->IsMoveAllowedChannel())
3225 createInfo.
Caster =
nullptr;
3247 AuraEffect const* auraEff = foundAura->GetEffect(spellEffectInfo.EffectIndex);
3251 int32 bp = spellEffectInfo.BasePoints;
3253 bp = *(createInfo.
BaseAmount + spellEffectInfo.EffectIndex);
3260 if (castItemGUID != foundAura->GetCastItemGUID())
3263 *oldGUID = castItemGUID;
3298 for (Unit::AuraList::iterator itr = scAuras.begin(); itr != scAuras.end();)
3300 if ((*itr) != aura &&
3304 itr = scAuras.begin();
3323 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());
3341 m_appliedAuras.insert(AuraApplicationMap::value_type(aurId, aurApp));
3382 uint32 aStateMask = (1 << (aState - 1));
3414 player->UpdateVisibleGameobjectsOrSpellClicks();
3430 TC_LOG_DEBUG(
"spells",
"Aura {} now is remove mode {}", aura->
GetId(), removeMode);
3448 bool auraStateFound =
false;
3452 bool canBreak =
false;
3454 for (AuraStateAurasMap::iterator itr =
m_auraStateAuras.lower_bound(auraState); itr !=
m_auraStateAuras.upper_bound(auraState) && !(auraStateFound && canBreak);)
3456 if (itr->second == aurApp)
3463 auraStateFound =
true;
3491 if (!auraStateFound)
3496 uint32 aStateMask = (1 << (auraState - 1));
3506 player->UpdateVisibleGameobjectsOrSpellClicks();
3519 for (AuraApplicationMap::iterator iter = range.first; iter != range.second;)
3521 if (iter->second == aurApp)
3563 Aura* aura = i->second;
3585 if (((itr->second->GetEffectMask() & reqEffMask) == reqEffMask) && (!casterGUID || itr->second->GetCasterGUID() == casterGUID))
3603 TC_LOG_ERROR(
"spells",
"Unit::RemoveOwnedAura() called with unallowed removeMode AURA_REMOVE_NONE, spellId {}", aura->
GetId());
3610 for (AuraMap::iterator itr = range.first; itr != range.second; ++itr)
3612 if (itr->second == aura)
3625 for (AuraMap::const_iterator itr = range.first; itr != range.second; ++itr)
3627 if (((itr->second->GetEffectMask() & reqEffMask) == reqEffMask)
3628 && (!casterGUID || itr->second->GetCasterGUID() == casterGUID)
3629 && (!itemCasterGUID || itr->second->GetCastItemGUID() == itemCasterGUID)
3630 && (!except || except != itr->second))
3654 for (AuraApplicationMap::iterator iter = range.first; iter != range.second;)
3656 Aura const* aura = iter->second->GetBase();
3691 for (AuraApplicationMap::iterator iter = range.first; iter != range.second;)
3693 if (aurApp == iter->second)
3715 if (check(iter->second))
3728 if (check(iter->second))
3741 if (check(iter->second))
3755 if (check(iter->second))
3767 for (AuraEffectList::iterator iter =
m_modAuras[auraType].begin(); iter !=
m_modAuras[auraType].end();)
3769 Aura* aura = (*iter)->GetBase();
3788 Aura const* aura = iter->second->GetBase();
3803 for (AuraMap::iterator iter = range.first; iter != range.second;)
3805 Aura* aura = iter->second;
3820 for (AuraMap::iterator iter = range.first; iter != range.second;)
3822 Aura* aura = iter->second;
3825 DispelInfo dispelInfo(dispeller, dispellerSpellId, chargesRemoved);
3848 for (AuraMap::iterator iter = range.first; iter != range.second;)
3850 Aura* aura = iter->second;
3856 uint8 recalculateMask = 0;
3866 recalculateMask |= (1<<i);
3884 oldAura->ModCharges(1);
3886 oldAura->ModStackAmount(1);
3887 oldAura->SetDuration(
int32(dur));
3903 if (newAura->IsSingleTarget())
3905 newAura->UnregisterSingleTarget();
3912 newAura->ApplyForTargets();
3933 if (iter->second->GetBase()->GetCastItemGUID() == castItemGuid)
3945 for (AuraEffectList::iterator iter =
m_modAuras[auraType].begin(); iter !=
m_modAuras[auraType].end();)
3947 Aura* aura = (*iter)->GetBase();
3952 if (aura != except && (!casterGUID || aura->
GetCasterGUID() == casterGUID)
3967 SpellInfo const* spell = iter->second->GetBase()->GetSpellInfo();
3988 Aura const* aura = iter->second;
4009 for (AuraList::iterator iter = scAuras.begin(); iter != scAuras.end();)
4015 iter = scAuras.begin();
4030 Aura* aura = (*iter)->GetBase();
4044 && (spell->m_spellInfo->ChannelInterruptFlags & flag)
4045 && spell->m_spellInfo->Id != except)
4055 Aura const* aura = iter->second->GetBase();
4079 std::vector<Aura*> aurasToUpdateTargets;
4083 if (exceptSpellId && aura->
GetId() == exceptSpellId)
4087 if (!(appliedMechanicMask & mechanicMaskToRemove))
4095 aurasToUpdateTargets.push_back(aura);
4099 for (
Aura* aura : aurasToUpdateTargets)
4101 aura->UpdateTargetMap(aura->GetCaster());
4104 if (!aura->IsPassive() && aura->GetOwner() ==
this && !aura->GetApplicationOfTarget(
GetGUID()))
4105 aura->Remove(removeMode);
4114 Aura const* aura = iter->second->GetBase();
4129 Aura* aura = iter->second;
4132 for (Aura::ApplicationMap::const_iterator itr = appMap.begin(); itr!= appMap.end();)
4148 if (iter->second->GetBase()->GetOwner() !=
this)
4163 AuraApplicationMap::iterator aurAppIter;
4167 AuraMap::iterator aurIter;
4171 const int maxIteration = 50;
4173 if (counter >= maxIteration)
4175 std::stringstream sstr;
4176 sstr <<
"Unit::RemoveAllAuras() iterated " << maxIteration <<
" times already but there are still "
4182 sstr <<
"m_appliedAuras:" <<
"\n";
4184 for (std::pair<uint32 const, AuraApplication*>& auraAppPair :
m_appliedAuras)
4185 sstr << auraAppPair.second->GetDebugInfo() <<
"\n";
4190 sstr <<
"m_ownedAuras:" <<
"\n";
4193 sstr << aura->GetDebugInfo() <<
"\n";
4234 Aura const* aura = iter->second->GetBase();
4243 Aura* aura = iter->second;
4255 Aura const* aura = iter->second->GetBase();
4264 Aura* aura = iter->second;
4276 Aura const* aura = iter->second->GetBase();
4285 Aura* aura = iter->second;
4297 Aura const* aura = iter->second->GetBase();
4306 Aura* aura = iter->second;
4318 Aura* aura = iter->second;
4331 for (; range.first != range.second; ++range.first)
4333 Aura* aura = range.first->second;
4362 for (AuraApplicationMap::const_iterator itr = range.first; itr != range.second; ++itr)
4364 if (itr->second->HasEffect(effIndex)
4365 && (!caster || itr->second->GetBase()->GetCasterGUID() == caster))
4380 rankSpell =
sSpellMgr->GetNextSpellInChain(rankSpell);
4388 for (Unit::AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
4390 if (effIndex != (*itr)->GetEffIndex())
4392 SpellInfo const* spell = (*itr)->GetSpellInfo();
4402 for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
4404 SpellInfo const* spell = (*i)->GetSpellInfo();
4407 if (!casterGUID.
IsEmpty() && (*i)->GetCasterGUID() != casterGUID)
4423 for (; range.first != range.second; ++range.first)
4431 && (!except || except != app))
4442 return aurApp ? aurApp->
GetBase() :
nullptr;
4452 rankSpell =
sSpellMgr->GetNextSpellInChain(rankSpell);
4460 return aurApp ? aurApp->
GetBase() :
nullptr;
4470 for (
auto itr = auras.begin(); itr != auras.end(); ++itr)
4472 Aura* aura = itr->second;
4500 dispelList.emplace_back(aura, chance, charges);
4508 for (AuraApplicationMap::const_iterator itr = range.first; itr != range.second; ++itr)
4510 if (itr->second->HasEffect(effIndex)
4511 && (!caster || itr->second->GetBase()->GetCasterGUID() == caster))
4524 for (AuraApplicationMap::const_iterator itr = range.first; itr != range.second; ++itr)
4526 if (itr->second->GetBase()->GetStackAmount() == 0)
4529 count += (
uint32)itr->second->GetBase()->GetStackAmount();
4550 if (caster == eff->GetCasterGUID())
4558 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
4559 if (miscvalue == (*i)->GetMiscValue())
4567 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
4568 if ((*i)->IsAffectingSpell(affectedSpell))
4576 for (AuraEffectList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
4577 if (value == (*i)->GetAmount())
4585 if (aura->GetSpellEffectInfo().TriggerSpell == triggerSpell)
4596 if (!(*iter)->IsPositive() && (*iter)->GetBase()->GetSpellInfo()->AuraInterruptFlags & flag && (!guid || (*iter)->GetBase()->GetCasterGUID() == guid))
4606 SpellInfo const* spellInfo = iter->second->GetBase()->GetSpellInfo();
4611 if (iter->second->HasEffect(spellEffectInfo.EffectIndex) && spellEffectInfo.IsEffect() && spellEffectInfo.Mechanic)
4612 if (mechanicMask & (1 << spellEffectInfo.Mechanic))
4625 SpellInfo const* spellInfo = itr->second->GetBase()->GetSpellInfo();
4632 if (newDuration > 0 && newDuration < existingDuration)
4642 for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
4644 if ((*i)->GetMiscValue() == script)
4645 if ((*i)->IsAffectingSpell(spell))
4653 static const AuraType diseaseAuraTypes[] =
4660 for (
AuraType aType : diseaseAuraTypes)
4666 && (*itr)->GetCasterGUID() == casterGUID)
4672 RemoveAura((*itr)->GetId(), (*itr)->GetCasterGUID());
4685 static const AuraType diseaseAuraTypes[] =
4696 for (AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
4699 if ((*i)->GetCasterGUID() == casterGUID)
4709 if (mTotalAuraList.empty())
4712 std::map<SpellGroup, int32> sameEffectSpellGroup;
4715 for (
AuraEffect const* aurEff : mTotalAuraList)
4717 if (predicate(aurEff))
4721 if (!
sSpellMgr->AddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(),
static_cast<uint32>(auraType), aurEff->GetAmount(), sameEffectSpellGroup))
4722 modifier += aurEff->GetAmount();
4727 for (
auto itr = sameEffectSpellGroup.begin(); itr != sameEffectSpellGroup.end(); ++itr)
4728 modifier += itr->second;
4736 if (mTotalAuraList.empty())
4739 std::map<SpellGroup, int32> sameEffectSpellGroup;
4740 float multiplier = 1.0f;
4742 for (
AuraEffect const* aurEff : mTotalAuraList)
4744 if (predicate(aurEff))
4748 if (!
sSpellMgr->AddSameEffectStackRuleSpellGroups(aurEff->GetSpellInfo(),
static_cast<uint32>(auraType), aurEff->GetAmount(), sameEffectSpellGroup))
4749 AddPct(multiplier, aurEff->GetAmount());
4754 for (
auto itr = sameEffectSpellGroup.begin(); itr != sameEffectSpellGroup.end(); ++itr)
4755 AddPct(multiplier, itr->second);
4763 if (mTotalAuraList.empty())
4767 for (
AuraEffect const* aurEff : mTotalAuraList)
4769 if (predicate(aurEff))
4770 modifier = std::max(modifier, aurEff->GetAmount());
4779 if (mTotalAuraList.empty())
4783 for (
AuraEffect const* aurEff : mTotalAuraList)
4785 if (predicate(aurEff))
4786 modifier = std::min(modifier, aurEff->GetAmount());
4836 if (except != aurEff && (aurEff->
GetMiscValue() & miscMask) != 0)
4934 float modPos = 0.0f;
4935 float modNeg = 0.0f;
4971 float modPos = 0.0f;
4972 float modNeg = 0.0f;
4973 float factor = 0.0f;
4986 modValue =
static_cast<Guardian*
>(
this)->GetBonusStatFromOwner(stat);
5040 std::vector<DynamicObject*> dynamicobjects =
GetDynObjects(spellId);
5041 return dynamicobjects.empty() ? nullptr : dynamicobjects.front();
5046 std::vector<DynamicObject*> dynamicobjects;
5047 for (DynObjectList::const_iterator i =
m_dynObj.begin(); i !=
m_dynObj.end(); ++i)
5048 if ((*i)->GetSpellId() == spellId)
5049 dynamicobjects.push_back(*i);
5051 return dynamicobjects;
5080 return gameobjects.empty() ? nullptr : gameobjects.front();
5085 std::vector<GameObject*> gameobjects;
5086 for (GameObjectList::const_iterator i =
m_gameObj.begin(); i !=
m_gameObj.end(); ++i)
5087 if ((*i)->GetSpellId() == spellId)
5088 gameobjects.push_back(*i);
5152 GameObjectList::iterator i, next;
5156 if (spellid == 0 || (*i)->GetSpellId() == spellid)
5161 (*i)->SetRespawnTime(0);
5177 GameObjectList::iterator i =
m_gameObj.begin();
5179 (*i)->SetRespawnTime(0);
5193 data <<
uint32(overkill > 0 ? overkill : 0);
5227 log.
damage = damage - absorbedDamage - resist - blocked;
5228 log.
absorb = absorbedDamage;
5243 if (typeMaskActor && actor)
5246 if (typeMaskActionTarget && actionTarget)
5250 actor->
TriggerAurasProcOnEvent(actionTarget, typeMaskActor, typeMaskActionTarget, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo);
5326 size_t const maxsize = 4+5+5+4+4+1+(4+4+4)*2+4*2+4*2+1+4+4+4+4+4*12;
5334 data <<
uint32(overkill < 0 ? 0 : overkill);
5335 data <<
uint8(count);
5337 for (
uint32 i = 0; i < count; ++i)
5346 for (
uint32 i = 0; i < count; ++i)
5352 for (
uint32 i = 0; i < count; ++i)
5393 dmgInfo.
Damages[0].
Damage = Damage - AbsorbDamage - Resist - BlockedAmount;
5404 dmgInfo.
Blocked = BlockedAmount;
5425 if (pet->isControlled())
5437 switch (new_powertype)
5483 displayPower =
Powers(powerDisplay->ActualType);
5491 else if (pet->IsPetGhoul() || pet->IsRisenAlly())
5537 if (!victim || victim ==
this)
5638 if (
CreatureAI* controlledAI = cControlled->AI())
5639 controlledAI->OwnerAttacked(victim);
5665 creature->SetNoCallAssistance(
false);
5678 for (
Unit* attacker : attackers)
5679 if (!attacker->IsValidAttackTarget(
this))
5680 toRemove.push_back(attacker);
5682 for (
Unit* attacker : toRemove)
5683 attacker->AttackStop();
5715 minion->CombatStop(includingCast);
5724 if ((*itr)->isAttackingPlayer())
5730 if (summon->isAttackingPlayer())
5741 if (!(*iter)->AttackStop())
5743 TC_LOG_ERROR(
"entities.unit",
"WORLD: Unit has an attacker that isn't attacking it!");
5759 for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr)
5764 if (!spellInfo || !spellInfo->
IsPassive())
5772 for (PetSpellMap::const_iterator itr = pet->m_spells.begin(); itr != pet->m_spells.end(); ++itr)
5777 if (!spellInfo || !spellInfo->
IsPassive())
5792 for (Unit::AuraApplicationMap::iterator itr = tAuras.begin(); itr != tAuras.end();)
5794 SpellInfo const* spellProto = itr->second->GetBase()->GetSpellInfo();
5809 if (itr->second->GetBase()->GetCasterGUID() == target->
GetGUID())
5810 auraStates |= (1 << (itr->first - 1));
5830 for (AuraStateAurasMap::const_iterator itr = range.first; itr != range.second; ++itr)
5831 if (itr->second->GetBase()->GetCasterGUID() == Caster->
GetGUID())
5871 return master->GetControllingPlayer();
5887 TC_LOG_ERROR(
"entities.unit",
"Unit::GetFirstMinion: Minion {} not exist.", pet_guid.
ToString());
5903 TC_LOG_FATAL(
"entities.unit",
"Unit::GetGuardianPet: Guardian {} not exist.", pet_guid.
ToString());
5943 if (oldPet != minion && (oldPet->IsPet() || minion->
IsPet() || oldPet->GetEntry() != minion->
GetEntry()))
5946 if (
Pet* oldPetAsPet = oldPet->
ToPet())
6028 if (
GetGUID() == (*itr)->GetCharmerGUID())
6032 if ((*itr)->GetOwnerGUID() !=
GetGUID())
6035 (*itr)->OutDebugInfo();
6048 if ((*itr)->IsPet())
6172 victimAI->HealReceived(healer, addhealth);
6174 if (
UnitAI* healerAI = healer ? healer->
GetAI() :
nullptr)
6175 healerAI->HealDone(victim, addhealth);
6183 Unit* unit = healer;
6224 for (AuraEffectList::const_iterator i = hitTriggerAuras.begin(); i != hitTriggerAuras.end(); ++i)
6226 if (
Unit* magnet = (*i)->GetBase()->GetCaster())
6268 TC_LOG_ERROR(
"entities.unit",
"Unit {} is trying to release unit {} which is neither charmed nor owned by it",
GetEntry(), target->
GetEntry());
6293 return u->isPossessed();
6303 return const_cast<Unit*
>(
this);
6308 Player* player =
nullptr;
6332 std::vector<Unit*> nearMembers;
6337 if (
Player* Target = itr->GetSource())
6341 nearMembers.push_back(Target);
6346 nearMembers.push_back(pet);
6349 if (nearMembers.empty())
6352 uint32 randTarget =
urand(0, nearMembers.size()-1);
6353 return nearMembers[randTarget];
6400 if (OldTotem->IsSummon())
6401 OldTotem->ToTempSummon()->UnSummon();
6415 data <<
uint8(critical ? 1 : 0);
6435 data <<
uint32(powerType);
6436 data <<
int32(damage);
6465 return owner->SpellDamageBonusDone(victim, spellProto, pdamage, damagetype, spellEffectInfo, donePctTotal, stack);
6467 float ApCoeffMod = 1.0f;
6468 int32 DoneTotal = 0;
6469 float DoneTotalMod = donePctTotal ? *donePctTotal :
SpellDamagePctDone(victim, spellProto, damagetype);
6508 for (
auto itr = playerSpells.begin(); itr != playerSpells.end(); ++itr)
6537 DoneAdvertisedBenefit +=
static_cast<Guardian const*
>(
this)->GetBonusDamage();
6547 if (damagetype ==
DOT)
6549 coeff = bonus->dot_damage;
6550 if (bonus->ap_dot_bonus > 0)
6551 DoneTotal +=
int32(bonus->ap_dot_bonus * stack * ApCoeffMod * APbonus);
6555 coeff = bonus->direct_damage;
6556 if (bonus->ap_bonus > 0)
6557 DoneTotal +=
int32(bonus->ap_bonus * stack * ApCoeffMod * APbonus);
6564 return uint32(std::max(pdamage * DoneTotalMod, 0.0f));
6568 if (DoneAdvertisedBenefit)
6581 DoneTotal +=
int32(DoneAdvertisedBenefit * coeff * factorMod);
6584 float tmpDamage = float(
int32(pdamage) + DoneTotal) * DoneTotalMod;
6590 return uint32(std::max(tmpDamage, 0.0f));
6609 return owner->SpellDamagePctDone(victim, spellProto, damagetype);
6612 float DoneTotalMod = 1.0f;
6618 float maxModDamagePercentSchool = 0.0f;
6628 DoneTotalMod *= maxModDamagePercentSchool;
6649 for (AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
6651 if (!(*i)->IsAffectingSpell(spellProto))
6654 switch ((*i)->GetMiscValue())
6663 AddPct(DoneTotalMod, (*i)->GetAmount());
6671 int32 maxPercent = (*i)->GetAmount();
6675 int32 modPercent = 0;
6677 for (AuraApplicationMap::const_iterator itr = victimAuras.begin(); itr != victimAuras.end(); ++itr)
6679 Aura const* aura = itr->second->GetBase();
6684 if (modPercent >= maxPercent)
6686 modPercent = maxPercent;
6690 AddPct(DoneTotalMod, modPercent);
6697 AddPct(DoneTotalMod, (*i)->GetAmount());
6702 AddPct(DoneTotalMod, (*i)->GetAmount());
6710 if ((*i)->GetSpellInfo()->SpellIconID == 2656)
6713 AddPct(DoneTotalMod, (*i)->GetAmount());
6720 AddPct(DoneTotalMod, (*i)->GetAmount());
6729 AddPct(DoneTotalMod, (*i)->GetSpellInfo()->GetRank() * 2.0f);
6736 AddPct(DoneTotalMod, (*i)->GetAmount());
6747 AddPct(DoneTotalMod, (*i)->GetAmount());
6759 int32 bonus = -(*i)->GetBase()->GetEffect(0)->GetAmount();
6760 AddPct(DoneTotalMod, bonus);
6778 DoneTotalMod *= 4.0f;
6780 DoneTotalMod *= 3.0f;
6790 for (AuraEffectList::const_iterator i = mDumyAuras.begin(); i != mDumyAuras.end(); ++i)
6792 if ((*i)->GetSpellInfo()->SpellIconID == 3263)
6794 AddPct(DoneTotalMod, (*i)->GetAmount());
6841 for (Unit::AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
6843 if (((*itr)->GetId() == 31803 || (*itr)->GetId() == 53742) && (*itr)->GetCasterGUID() ==
GetGUID())
6845 stacks = (*itr)->GetBase()->GetStackAmount();
6851 AddPct(DoneTotalMod, 10 * stacks);
6870 AddPct(DoneTotalMod, aurEFf->GetAmount());
6876 AddPct(DoneTotalMod, 15 * count);
6884 DoneTotalMod = 1.0f;
6907 return DoneTotalMod;
6915 float TakenTotalMod = 1.0f;
6930 for (AuraEffectList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i)
6932 switch ((*i)->GetSpellInfo()->SpellIconID)
6942 AddPct(TakenTotalMod, std::max(mod,
float((*i)->GetAmount())));
6968 if (caster && TakenTotalMod < 1.0f)
6970 float damageReduction = 1.0f - TakenTotalMod;
6972 for (
AuraEffect const* aurEff : casterIgnoreResist)
6974 if (!(aurEff->GetMiscValue() & spellProto->
GetSchoolMask()))
6977 AddPct(damageReduction, -aurEff->GetAmount());
6980 TakenTotalMod = 1.0f - damageReduction;
6983 float tmpDamage = pdamage * TakenTotalMod;
6984 return uint32(std::max(tmpDamage, 0.0f));
6998 for (
AuraEffect const* aurEff : mDamageDoneOfStatPercent)
7000 if ((aurEff->GetMiscValue() & schoolMask) != 0)
7003 Stats const usedStat =
static_cast<Stats>(aurEff->GetMiscValueB());
7012 return DoneAdvertisedBenefit;
7025 float crit_chance = 0.0f;
7031 auto getPhysicalCritChance = [&]
7036 auto getMagicCritChance = [&]
7045 crit_chance = std::max(crit_chance, getPhysicalCritChance());
7048 crit_chance = std::max(crit_chance, getMagicCritChance());
7066 return std::max(crit_chance, 0.0f);
7075 float crit_chance = doneChance;
7098 for (
AuraEffect const* aurEff : mOverrideClassScript)
7100 if (!aurEff->IsAffectingSpell(spellInfo))
7103 float modChance = 0.f;
7104 switch (aurEff->GetMiscValue())
7117 crit_chance += modChance;
7121 crit_chance += aurEff->GetAmount();
7126 crit_chance += aurEff->GetAmount();
7140 crit_chance += aurEff->GetAmount();
7146 crit_chance += aurEff->GetAmount();
7156 crit_chance += aurEff->GetAmount();
7171 crit_chance += aura->GetAmount();
7198 crit_chance -= levelDiff * 0.7f;
7217 crit_chance += rendAndTear->GetAmount();
7227 crit_chance += aurEff->GetAmount();
7254 return std::max(crit_chance, 0.0f);
7260 int32 crit_bonus = damage;
7261 float crit_mod = 0.0f;
7268 crit_bonus += damage;
7271 crit_bonus += damage / 2;
7282 if (crit_bonus != 0)
7283 AddPct(crit_bonus, crit_mod);
7285 crit_bonus -= damage;
7287 if (damage >
uint32(crit_bonus))
7294 crit_bonus += damage;
7309 crit_bonus = damage;
7312 crit_bonus = damage / 2;
7326 damage += crit_bonus;
7339 return owner->SpellHealingBonusDone(victim, spellProto, healamount, damagetype, spellEffectInfo, donePctTotal, stack);
7345 float ApCoeffMod = 1.0f;
7346 int32 DoneTotal = 0;
7347 float DoneTotalMod = donePctTotal ? *donePctTotal :
SpellHealingPctDone(victim, spellProto);
7352 for (
AuraEffect const* aurEff : mOverrideClassScript)
7354 if (!aurEff->IsAffectingSpell(spellProto))
7357 switch (aurEff->GetMiscValue())
7362 DoneTotal += aurEff->GetAmount();
7377 for (
auto itr = playerSpells.begin(); itr != playerSpells.end(); ++itr)
7406 DoneAdvertisedBenefit +=
static_cast<Guardian const*
>(
this)->GetBonusDamage();
7416 if (damagetype ==
DOT)
7418 coeff = bonus->dot_damage;
7419 if (bonus->ap_dot_bonus > 0)
7420 DoneTotal +=
int32(bonus->ap_dot_bonus * stack * ApCoeffMod * APbonus);
7424 coeff = bonus->direct_damage;
7425 if (bonus->ap_bonus > 0)
7426 DoneTotal +=
int32(bonus->ap_bonus * stack * ApCoeffMod * APbonus);
7433 return uint32(std::max(healamount * DoneTotalMod, 0.0f));
7437 if (DoneAdvertisedBenefit)
7450 DoneTotal +=
int32(DoneAdvertisedBenefit * coeff * factorMod);
7455 switch (otherSpellEffect.ApplyAuraName)
7469 float heal = float(
int32(healamount) + DoneTotal) * DoneTotalMod;
7475 return uint32(std::max(heal, 0.0f));
7483 return owner->SpellHealingPctDone(victim, spellProto);
7497 float DoneTotalMod = 1.0f;
7505 for (
AuraEffect const* aurEff : mOverrideClassScript)
7507 if (!aurEff->IsAffectingSpell(spellProto))
7510 switch (aurEff->GetMiscValue())
7516 AddPct(DoneTotalMod, aurEff->GetAmount());
7521 AddPct(DoneTotalMod, aurEff->GetAmount());
7526 int32 stepPercent = aurEff->GetAmount();
7527 int32 modPercent = 0;
7529 for (AuraApplicationMap::const_iterator itr = victimAuras.begin(); itr != victimAuras.end(); ++itr)
7531 Aura const* aura = itr->second->GetBase();
7541 AddPct(DoneTotalMod, modPercent);
7547 AddPct(DoneTotalMod, aurEff->GetAmount());
7555 return DoneTotalMod;
7560 float TakenTotalMod = 1.0f;
7565 AddPct(TakenTotalMod, minval);
7569 AddPct(TakenTotalMod, maxval);
7577 TakenTotalMod *= 1.2f;
7580 if (damagetype ==
DOT)
7585 AddPct(TakenTotalMod, minval_hot);
7589 AddPct(TakenTotalMod, maxval_hot);
7602 float heal = healamount * TakenTotalMod;
7603 return uint32(std::max(heal, 0.0f));
7623 for (AuraEffectList::const_iterator i = mHealingDoneOfStatPercent.begin(); i != mHealingDoneOfStatPercent.end(); ++i)
7626 Stats usedStat =
Stats((*i)->GetSpellEffectInfo().MiscValue);
7632 for (AuraEffectList::const_iterator i = mHealingDonebyAP.begin(); i != mHealingDonebyAP.end(); ++i)
7633 if ((*i)->GetMiscValue() & schoolMask)
7636 return advertisedBenefit;
7646 if ((schoolImmunityMask & schoolMask) == schoolMask)
7651 if ((damageImmunityMask & schoolMask) == schoolMask)
7672 uint32 schoolImmunityMask = 0;
7674 for (
auto itr = schoolList.begin(); itr != schoolList.end(); ++itr)
7676 schoolImmunityMask |= itr->first;
7679 if ((schoolImmunityMask & schoolMask) == schoolMask)
7684 if ((damageImmunityMask & schoolMask) == schoolMask)
7699 if (!requireImmunityPurgesEffectAttribute)
7700 return range.
begin() != range.
end();
7702 return std::any_of(range.
begin(), range.
end(), [](SpellImmuneContainer::value_type
const& entry)
7704 if (SpellInfo const* immunitySourceSpell = sSpellMgr->GetSpellInfo(entry.second))
7705 if (immunitySourceSpell->HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY))
7714 if (hasImmunity(idList, spellInfo->
Id))
7723 if (hasImmunity(dispelList, dispel))
7731 if (hasImmunity(mechanicList, mechanic))
7735 bool immuneToAllEffects =
true;
7740 if (!spellEffectInfo.IsEffect())
7745 immuneToAllEffects =
false;
7750 if (immuneToAllEffects)
7755 uint32 schoolImmunityMask = 0;
7757 for (
auto itr = schoolList.begin(); itr != schoolList.end(); ++itr)
7759 if ((itr->first & schoolMask) == 0)
7763 if (requireImmunityPurgesEffectAttribute)
7771 schoolImmunityMask |= itr->first;
7774 if ((schoolImmunityMask & schoolMask) == schoolMask)
7785 for (
auto itr = schoolList.begin(); itr != schoolList.end(); ++itr)
7795 for (
auto itr = damageList.begin(); itr != damageList.end(); ++itr)
7805 for (
auto itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
7806 mask |= (1 << itr->first);
7812 bool requireImmunityPurgesEffectAttribute )
const
7814 if (!spellInfo || !spellEffectInfo.
IsEffect())
7823 if (!requireImmunityPurgesEffectAttribute)
7824 return range.
begin() != range.
end();
7826 return std::any_of(range.
begin(), range.
end(), [](SpellImmuneContainer::value_type
const& entry)
7828 if (SpellInfo const* immunitySourceSpell = sSpellMgr->GetSpellInfo(entry.second))
7829 if (immunitySourceSpell->HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY))
7838 if (hasImmunity(effectList, spellEffectInfo.
Effect))
7844 if (hasImmunity(mechanicList, mechanic))
7853 if (hasImmunity(list, aura))
7861 for (AuraEffectList::const_iterator iter = immuneAuraApply.begin(); iter != immuneAuraApply.end(); ++iter)
7862 if (((*iter)->GetMiscValue() & spellInfo->
GetSchoolMask()) &&
7873 if (!victim || pdamage == 0)
7879 int32 DoneFlatBenefit = 0;
7912 float DoneTotalMod = 1.0f;
7922 float maxModDamagePercentSchool = 0.0f;
7926 if (schoolMask & (1 << i))
7932 DoneTotalMod *= maxModDamagePercentSchool;
7947 if (spellProto && spellProto->
Mechanic)
7953 for (AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
7955 if (!(*i)->IsAffectingSpell(spellProto))
7958 switch ((*i)->GetMiscValue())
7965 if ((*i)->GetSpellInfo()->SpellIconID == 2656)
7968 AddPct(DoneTotalMod, (*i)->GetAmount());
7975 AddPct(DoneTotalMod, (*i)->GetAmount());
7983 AddPct(DoneTotalMod, (*i)->GetSpellInfo()->GetRank() * 2.0f);
7994 AddPct(DoneTotalMod, (*i)->GetAmount());
8004 int32 bonus = -(*i)->GetBase()->GetEffect(0)->GetAmount();
8005 AddPct(DoneTotalMod, bonus);
8027 float tmpDamage = float(
int32(pdamage) + DoneFlatBenefit) * DoneTotalMod;
8030 return uint32(std::max(tmpDamage, 0.0f));
8038 int32 TakenFlatBenefit = 0;
8048 if ((TakenFlatBenefit < 0) && (pdamage <
static_cast<uint32>(-TakenFlatBenefit)))
8052 float TakenTotalMod = 1.0f;
8088 for (AuraEffectList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i)
8090 switch ((*i)->GetSpellInfo()->SpellIconID)
8100 AddPct(TakenTotalMod, std::max(mod,
float((*i)->GetAmount())));
8121 if (TakenTotalMod < 1.0f)
8125 float damageReduction = 1.0f - TakenTotalMod;
8127 for (
AuraEffect const* aurEff : casterIgnoreResist)
8129 if (!(aurEff->GetMiscValue() & attackSchoolMask))
8132 AddPct(damageReduction, -aurEff->GetAmount());
8135 TakenTotalMod = 1.0f - damageReduction;
8138 float tmpDamage = float(pdamage + TakenFlatBenefit) * TakenTotalMod;
8139 return uint32(std::max(tmpDamage, 0.0f));
8149 for (
auto itr = bounds.first; itr != bounds.second;)
8151 if (itr->second == spellId)
8181 return std::floor((WeaponSpeed * PPM) / 600.0f);
8201 data <<
uint32(VehicleId);
8204 player->SendOnCancelExpectedVehicleRideAura();
8212 Pet* pet = player->GetPet();
8220 player->UnsummonPetTemporaryIfAny();
8228 player->SendMovementSetCollisionHeight(player->GetCollisionHeight());
8243 thisPlayer->SendMovementSetCollisionHeight(thisPlayer->GetCollisionHeight());
8268 if (
Pet* pPet = player->GetPet())
8274 player->ResummonPetTemporaryUnSummonedIfAny();
8324 std::list<CombatReference*> toEnd;
8327 toEnd.push_back(pair.second);
8330 toEnd.push_back(pair.second);
8347 std::list<CombatReference*> toEnd;
8350 toEnd.push_back(pair.second);
8353 toEnd.push_back(pair.second);
8390 int32 val = dVal + curHealth;
8399 if (val < maxHealth)
8402 gain = val - curHealth;
8404 else if (curHealth != maxHealth)
8407 gain = maxHealth - curHealth;
8422 int32 val = dVal + curHealth;
8430 if (val < maxHealth)
8432 else if (curHealth != maxHealth)
8433 gain = maxHealth - curHealth;
8448 int32 val = dVal + curPower;
8459 SetPower(power, val, withPowerUpdate);
8460 gain = val - curPower;
8462 else if (curPower != maxPower)
8464 SetPower(power, maxPower, withPowerUpdate);
8465 gain = maxPower - curPower;
8474 return (
uint32)f_BaseAttackTime;
8491 if (ownerPlayer->IsGroupVisibleFor(seerPlayer))
8525 int32 main_speed_mod = 0;
8526 float stack_bonus = 1.0f;
8527 float non_stack_bonus = 1.0f;
8567 int32 owner_speed_mod = 0;
8572 main_speed_mod = std::max(main_speed_mod, owner_speed_mod);
8590 TC_LOG_ERROR(
"entities.unit",
"Unit::UpdateSpeed: Unsupported move type ({})", mtype);
8595 float speed = std::max(non_stack_bonus, stack_bonus);
8597 AddPct(speed, main_speed_mod);
8615 uint32 immuneMask = creature->GetCreatureTemplate()->MechanicImmuneMask;
8622 if (speed > max_speed)
8633 if (creature->HasUnitTypeMask(
UNIT_MASK_MINION) && !creature->IsInCombat())
8641 if (speed < ownerSpeed || creature->
IsWithinDist3d(followed, 10.0f))
8656 float baseMinSpeed = 1.0f;
8660 float min_speed =
CalculatePct(baseMinSpeed, minSpeedMod);
8661 if (speed < min_speed)
8711 pet->SetSpeedRate(mtype, rate);
8772 zoneScript->OnUnitDeath(
this);
8793 if (!target->
IsEngaged() && !canInitialAggro)
8797 targetOwner->EngageWithTarget(
this);
8802 creature->SetLootRecipient(
this);
8806 if (myPlayerOwner && targetPlayerOwner && !(myPlayerOwner->
duel && myPlayerOwner->
duel->Opponent == targetPlayerOwner))
8820 if (minion->IsInCombat())
8854 if (currentLevel < maxLevel)
8855 diminish.
hitCount = currentLevel + 1;
8871 if (limitDuration > 0 && duration > limitDuration)
8873 Unit const* target = targetOwner ? targetOwner :
this;
8874 WorldObject const* source = casterOwner ? casterOwner : caster;
8877 duration = limitDuration;
8913 duration =
int32(duration * mod);
8914 return (duration != 0);
8924 else if (diminish.
stack)
8929 if (!diminish.
stack)
8961 return (creatureType >= 1) ? (1 << (creatureType - 1)) : 0;
8987 if (!(shapeshift->
Flags & 0x1))
9022 TC_LOG_ERROR(
"entities.unit",
"ERROR in HandleStatFlatModifier(): non-existing UnitMods or wrong UnitModifierType!");
9029 switch (modifierType)
9046 TC_LOG_ERROR(
"entities.unit",
"ERROR in ApplyStatPctModifier(): non-existing UnitMods or wrong UnitModifierType!");
9053 switch (modifierType)
9088 TC_LOG_ERROR(
"entities.unit",
"attempt to access non-existing modifier value from UnitMods!");
9099 TC_LOG_ERROR(
"entities.unit",
"attempt to access non-existing modifier value from UnitMods!");
9246 TC_LOG_ERROR(
"entities.unit",
"attempt to access non-existing UnitMods in GetTotalAuraModValue()!");
9354 if (player->GetGroup())
9370 if (maxHealth < val)
9379 if (player->GetGroup())
9384 if (pet->isControlled())
9409 if (pet->isControlled())
9423 if (!force &&
GetPower(power) == val)
9432 if (withPowerUpdate)
9436 data <<
uint8(power);
9444 if (player->GetGroup())
9449 if (pet->isControlled())
9475 if (pet->isControlled())
9483 if (val < cur_power)
9526 i_AIs.emplace(newAI);
9638 if (owner->m_Controlled.find(
this) != owner->m_Controlled.end())
9640 TC_LOG_FATAL(
"entities.unit",
"Unit {} is in controlled list of {} when removed from world",
GetEntry(), owner->GetEntry());
9698 if (
CreatureAI* charmerAI = creatureCharmer->AI())
9699 newAI = charmerAI->GetAIForCharmedPlayer(
ToPlayer());
9726 ai->OnCharmed(
true);
9750 _isCommandAttack(false), _isCommandFollow(false), _isAtStay(false), _isFollowing(false), _isReturning(false),
9751 _stayX(0.0f), _stayY(0.0f), _stayZ(0.0f)
9960 auto iter = tokens.begin();
9966 if (!type || !action)
10007 switch (missCondition)
10060 if (!damageNullified)
10089 !procTarget->
IsPet()
10167 ASSERT(aurApp->GetTarget() ==
this);
10168 if (
uint8 procEffectMask = aurApp->GetBase()->GetProcEffectMask(aurApp, eventInfo, now))
10170 aurApp->GetBase()->PrepareProcToTrigger(aurApp, eventInfo, now);
10171 aurasTriggeringProc.emplace_back(procEffectMask, aurApp);
10180 if (
uint8 procEffectMask = itr->second->GetBase()->GetProcEffectMask(itr->second, eventInfo, now))
10182 itr->second->GetBase()->PrepareProcToTrigger(itr->second, eventInfo, now);
10183 aurasTriggeringProc.emplace_back(procEffectMask, itr->second);
10192 ProcEventInfo myProcEventInfo(
this, actionTarget, typeMaskActor, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo);
10201 if (modOwner !=
this && spell)
10204 for (
auto itr = modOwner->GetAppliedAuras().begin(); itr != modOwner->GetAppliedAuras().end(); ++itr)
10206 if (spell->
m_appliedMods.count(itr->second->GetBase()) != 0)
10207 modAuras.push_back(itr->second);
10209 modOwner->GetProcAurasTriggeredOnEvent(myAurasTriggeringProc, &modAuras, myProcEventInfo);
10216 ProcEventInfo targetProcEventInfo(
this, actionTarget, typeMaskActionTarget, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo);
10217 if (typeMaskActionTarget && actionTarget)
10228 bool const disableProcs = triggeringSpell && triggeringSpell->
IsProcDisabled();
10232 for (
auto const& aurAppProc : aurasTriggeringProc)
10235 uint8 procEffectMask;
10236 std::tie(procEffectMask, aurApp) = aurAppProc;
10263 petActionFeedback.
SpellID = spellId;
10272 petActionSound.
Action = action;
10333 movementGenerator->Pause(timer);
10345 movementGenerator->Resume(timer);
10373 data << (
uint8)state;
10420 if (!transforms.empty())
10423 for (
auto i = transforms.rbegin(); i != transforms.rend(); ++i)
10428 handledAura = (*i);
10430 if (!aurApp->IsPositive())
10432 handledAura = (*i);
10447 else if (!shapeshiftAura.empty())
10507 playerMe->SendDirectMessage(&data);
10511 Player* owner =
nullptr;
10514 if (movingMe || owner)
10523 if (owner && owner != movingMe)
10593 std::list<Unit*> targets;
10603 targets.remove(exclude);
10606 for (std::list<Unit*>::iterator tIter = targets.begin(); tIter != targets.end();)
10608 if (!
IsWithinLOSInMap(*tIter) || (*tIter)->IsTotem() || (*tIter)->IsSpiritService() || (*tIter)->IsCritter())
10609 targets.erase(tIter++);
10615 if (targets.empty())
10624 var *= (apply ? (100.0f + val) / 100.0f : 100.0f / (100.0f + val));
10665 if (CastingTime > 7000) CastingTime = 7000;
10666 if (CastingTime < 1500) CastingTime = 1500;
10669 CastingTime = 3500;
10671 int32 overTime = 0;
10673 bool DirectDamage =
false;
10674 bool AreaEffect =
false;
10678 switch (spellEffectInfo.Effect)
10686 DirectDamage =
true;
10689 switch (spellEffectInfo.ApplyAuraName)
10707 if (spellEffectInfo.IsTargetingArea())
10712 if (overTime > 0 && DirectDamage)
10716 if (OriginalCastTime > 7000) OriginalCastTime = 7000;
10717 if (OriginalCastTime < 1500) OriginalCastTime = 1500;
10719 float PtOT = (overTime / 15000.0f) / ((overTime / 15000.0f) + (OriginalCastTime / 3500.0f));
10721 if (damagetype ==
DOT)
10722 CastingTime =
uint32(CastingTime * PtOT);
10723 else if (PtOT < 1.0f)
10724 CastingTime =
uint32(CastingTime * (1 - PtOT));
10745 for (
uint8 i = 0; i < effects; ++i)
10746 CastingTime *= 0.95f;
10748 return CastingTime;
10757 if (player->GetGroup())
10760 player->SetAuraUpdateMaskForRaid(slot);
10765 Pet* pet = ((
Pet*)
this);
10792 float DotFactor = 1.0f;
10793 if (damagetype ==
DOT)
10796 if (!spellInfo->
IsChanneled() && DotDuration > 0)
10797 DotFactor = DotDuration / 15000.0f;
10800 DotFactor /= DotTicks;
10808 return (CastingTime / 3500.0f) * DotFactor;
10916 TC_LOG_ERROR(
"entities.unit",
"Pet::InitStatsForLevel() failed for creature (Entry: {})!", pet->
GetEntry());
10936 if (attacker && !attacker->
IsInMap(victim))
10937 attacker =
nullptr;
10940 Player* player =
nullptr;
10946 bool isRewardAllowed =
true;
10950 if (!isRewardAllowed)
10954 if (isRewardAllowed && creature)
10959 if (!creature->
IsInMap(lootRecipient))
10963 for (
GroupReference* itr = group->GetFirstMember(); itr !=
nullptr; itr = itr->next())
10965 Player* member = itr->GetSource();
10966 if (!member || !creature->
IsInMap(member))
10981 isRewardAllowed =
false;
10985 if (isRewardAllowed && player && player != victim)
10991 Player* looter = player;
10993 bool hasLooterGuid =
false;
11007 hasLooterGuid =
true;
11020 data2 << creature->
GetGUID();
11047 if (!loot->
empty())
11056 if (attacker && (attacker->
IsPet() || attacker->
IsTotem()))
11077 bool spiritOfRedemption =
false;
11090 victim->
CastSpell(victim, 27827, aurEff);
11091 spiritOfRedemption =
true;
11094 if (!spiritOfRedemption)
11120 plrVictim->SetPvPDeath(player !=
nullptr);
11126 TC_LOG_DEBUG(
"entities.unit",
"We are dead, losing {} percent durability", baseLoss);
11127 plrVictim->DurabilityLossAll(baseLoss,
false);
11129 plrVictim->SendDurabilityLoss();
11136 if (plrVictim->duel)
11138 plrVictim->duel->Opponent->CombatStopWithPets(
true);
11139 plrVictim->CombatStopWithPets(
true);
11148 if (!creature->
IsPet())
11163 ai->JustDied(attacker);
11167 if (
WorldObject * summoner = summon->GetSummoner())
11169 if (summoner->ToCreature() && summoner->ToCreature()->IsAIEnabled())
11170 summoner->ToCreature()->AI()->SummonedCreatureDies(creature, attacker);
11171 else if (summoner->ToGameObject() && summoner->ToGameObject()->AI())
11172 summoner->ToGameObject()->AI()->SummonedCreatureDies(creature, attacker);
11195 if (save->GetResetTime() < resettime)
11196 save->SetResetTime(resettime);
11204 if (player && attacker != victim)
11207 pvp->HandleKill(player, victim);
11210 bf->HandleKill(player, victim);
11223 bg->HandleKillPlayer(playerVictim, player);
11225 bg->HandleKillUnit(victim->
ToCreature(), player);
11244 sScriptMgr->OnPVPKill(killerPlr, killedPlr);
11246 sScriptMgr->OnCreatureKill(killerPlr, killedCre);
11251 sScriptMgr->OnPlayerKilledByCreature(killerCre, killed);
11415 data.
Initialize(rootOpcodeTable[apply][2], 64);
11438 Unit* caster =
nullptr;
11440 if (!fearAuras.empty())
11506 if (
this == charmer)
11582 if (player->isAFK())
11583 player->ToggleAFK();
11585 player->SetClientControl(
this,
false);
11653 creature->RefreshCanSwimFlag();
11659 ai->OnCharmed(
false);
11755 player->SetClientControl(
this,
true);
11770 charmedAI->OnCharmed(
false);
11802 m_vehicleKit = Trinity::make_unique_trackable<Vehicle>(
this, vehInfo, creatureEntry);
11841 return vehicleRoot;
11914 Group* group =
nullptr;
11924 Player* Target = itr->GetSource();
11930 TagUnitMap.push_back(Target);
11933 if (pet->IsAlive())
11934 TagUnitMap.push_back(pet);
11941 TagUnitMap.push_back(owner);
11943 if ((pet ==
this ||
IsInMap(pet)) && pet->IsAlive())
11944 TagUnitMap.push_back(pet);
11951 return entry->IsContestedGuardFaction();
11989 if (!(effMask & (1 << spellEffectInfo.EffectIndex)))
11993 effMask &= ~(1 << spellEffectInfo.EffectIndex);
12004 aura->ApplyForTargets();
12014 aura =
AddAura(spellId, target);
12038 Unit const* target =
nullptr;
12113 missChance += 19.0f;
12117 int32 diff = -skillDiff;
12119 missChance += diff > 0 ? diff * 0.04f : diff * 0.02f;
12122 missChance += diff > 10 ? 1 + (diff - 10) * 0.4f : diff * 0.1f;
12124 if (levelFactor < 10.f)
12125 missChance *= (levelFactor / 10.f);
12129 float resistMissChance = 100.0f;
12135 missChance -= resistMissChance - 100.0f;
12149 return std::max(missChance, 0.f);
12165 (*itr)->SetPhaseMask(newPhaseMask,
true);
12170 summon->SetPhaseMask(newPhaseMask,
true);
12198 data << TaggedPosition<Position::XY>(vcos, vsin);
12199 data << float(speedXY);
12200 data << float(speedZ);
12224 return player->GetRatingBonusValue(cr);
12228 return owner->GetRatingBonusValue(cr);
12260 switch (player->GetHairColorId())
12280 uint8 skinColor = player->GetSkinId();
12342 switch (player->GetHairColorId())
12361 uint8 skinColor = player->GetSkinId();
12456 float angle = forward ? 0 : float(
M_PI);
12480 bool spellClickHandled =
false;
12484 auto clickBounds =
sObjectMgr->GetSpellClickInfoMapBounds(spellClickEntry);
12485 for (
auto const& clickPair : clickBounds)
12488 if (!clickPair.second.IsFitToRequirements(clicker,
this))
12492 if (!
sConditionMgr->IsObjectMeetingSpellClickConditions(spellClickEntry, clickPair.second.spellId, clicker,
this))
12505 bool valid =
false;
12518 TC_LOG_ERROR(
"sql.sql",
"Spell {} specified in npc_spellclick_spells is not a valid vehicle enter aura!", clickPair.second.spellId);
12527 caster->
CastSpell(target, clickPair.second.spellId, args);
12533 bp[spellEffectInfo.EffectIndex] = spellEffectInfo.BasePoints;
12561 spellClickHandled =
true;
12614 if (
CreatureGroup* creatureGroup = vehicleBaseCreature->GetFormation())
12615 sFormationMgr->RemoveCreatureFromGroup(creatureGroup, vehicleBaseCreature);
12645 for (AuraEffectList::const_iterator itr = vehicleAuras.begin(); itr != vehicleAuras.end(); ++itr)
12647 if ((*itr)->GetCasterGUID() !=
GetGUID())
12651 ASSERT(!rideVehicleEffect);
12652 rideVehicleEffect = *itr;
12656 ASSERT(rideVehicleEffect);
12694 TC_LOG_ERROR(
"entities.vehicle",
"RemovePassenger() couldn't remove current unit from vehicle. Debug info: {}",
GetDebugInfo());
12701 if (player && player->
duel && player->
duel->IsMounted)
12720 pos = *exitPosition;
12739 float height = pos.
GetPositionZ() + vehicleCollisionHeight;
12747 init.SetTransportExit();
12779 *data << TaggedPosition<Position::XYZO>(pos);
12785 *data << TaggedPosition<Position::XYZO>(transportPos);
12795 *data << float(movementInfo.
pitch);
12861 if (!teleportingTransport)
12865 transportBase->CalculatePassengerOffset(x, y, z, &o);
12866 transportPos.
Relocate(x, y, z, o);
12879 moveTeleport <<
uint32(0);
12895 TC_LOG_DEBUG(
"entities.unit",
"Unit::UpdatePosition({}, {}, {}) .. bad coordinates!", x, y, z);
12903 bool const relocated = (teleport ||
12924 return (relocated || turn);
12970 return pendingChange.movementChangeType == changeType;
13001 TC_LOG_INFO(
"cheat",
"Unit::CheckPendingMovementAcks: Player GUID: {} took too long to acknowledge a movement change. He was therefore kicked.", controller->
GetBasePlayer()->
GetGUID().
ToString());
13009 float speedFlat = pendingChange->newValue;
13012 switch (changeType)
13031 if (informObservers)
13051 rageconversion += 13.27f * (
GetLevel() - 70);
13055 addRage = (damage / rageconversion * 7.5f + weaponSpeedHitFactor) / 2;
13062 addRage = damage / rageconversion * 2.5f;
13091 for (AttackerSet::const_iterator itr = attackers.begin(); itr != attackers.end();)
13093 if ((*itr)->GetFactionTemplateEntry()->Faction == faction_id)
13095 (*itr)->AttackStop();
13096 itr = attackers.begin();
13102 std::vector<CombatReference*> refsToEnd;
13104 if (pair.second->GetOther(
this)->GetFactionTemplateEntry()->Faction == faction_id)
13105 refsToEnd.push_back(pair.second);
13110 minion->StopAttackFaction(faction_id);
13122 std::ostringstream o;
13123 o <<
"Summon Slot: ";
13130 o <<
"Controlled List: ";
13132 o << (*itr)->GetGUID().ToString() <<
", ";
13136 o <<
"Aura List: ";
13138 o << itr->first <<
", ";
13144 o <<
"Passenger List: ";
13147 o << passenger->GetGUID().ToString() <<
", ";
13200 transport->CalculatePassengerPosition(stayPos.x, stayPos.y, stayPos.z);
13309 WorldPacket data(gravityOpcodeTable[disable][1], 12);
13321 WorldPacket data(gravityOpcodeTable[disable][0], 9);
13433 static OpcodeServer const waterWalkingOpcodeTable[2][2] =
13443 WorldPacket data(waterWalkingOpcodeTable[enable][1], 12);
13455 WorldPacket data(waterWalkingOpcodeTable[enable][0], 9);
13473 static OpcodeServer const featherFallOpcodeTable[2][2] =
13483 WorldPacket data(featherFallOpcodeTable[enable][1], 12);
13495 WorldPacket data(featherFallOpcodeTable[enable][0], 9);
13539 WorldPacket data(hoverOpcodeTable[enable][1], 12);
13551 WorldPacket data(hoverOpcodeTable[enable][0], 9);
13586 if (target ==
this)
13608 updateMask.
SetBit(index);
13618 fieldBuffer <<
uint32(appendValue);
13644 appendValue &= ~UNIT_FLAG_UNINTERACTIBLE;
13646 fieldBuffer <<
uint32(appendValue);
13659 for (
SpellEffectInfo const& spellEffectInfo : transform->GetEffects())
13665 cinfo = transformInfo;
13677 fieldBuffer <<
uint32(displayId);
13702 fieldBuffer << dynamicFlags;
13735 data->
append(fieldBuffer);
13757 for (SpellSpellGroupMap::const_iterator itr = spellGroup.first; itr != spellGroup.second ; ++itr)
13762 for (AuraEffectList::const_iterator auraItr = auraEffList.begin(); auraItr != auraEffList.end(); ++auraItr)
13764 if (aurEff != (*auraItr) && (!checkMiscValue || (*auraItr)->GetMiscValue() == miscValue) &&
13765 sSpellMgr->IsSpellMemberOfSpellGroup((*auraItr)->GetSpellInfo()->Id, itr->second))
13768 if (abs(val) < abs((*auraItr)->GetAmount()))
13769 val = (*auraItr)->GetAmount();
13790 for (Unit::AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end();)
13797 int32 diff = abs(effectAmount) - abs(existingAurEff->
GetAmount());
13806 if (removeOtherAuraApplications && (!base->
IsArea() || base->
GetOwner() !=
this))
13814 itr = auras.begin();
13880 TC_LOG_ERROR(
"entities.unit",
"WorldObject::MonsterText: `broadcast_text` (ID: {}) was not found", textId);
13913 TC_LOG_ERROR(
"entities.unit",
"WorldObject::MonsterWhisper: `broadcast_text` was not {} found", textId);
13952 std::stringstream sstr;
13957 <<
" Class: " << std::to_string(
GetClass()) <<
"\n"
13965 size_t controlledCount = 0;
13969 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
@ SPELL_HIT_TYPE_HIT_DEBUG
@ SPELL_HIT_TYPE_ATTACK_TABLE_DEBUG
@ SPELL_HIT_TYPE_CRIT_DEBUG
@ 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_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_DAMAGE_FROM_CASTER
@ 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
@ UNIT_MOD_ATTACK_POWER_RANGED
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
static size_t BuildChatPacket(WorldPacket &data, ChatMsg chatType, Language language, ObjectGuid senderGUID, ObjectGuid receiverGUID, std::string_view message, uint8 chatTag, std::string const &senderName="", std::string const &receiverName="", uint32 achievementId=0, bool gmMessage=false, std::string const &channelName="")
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 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()
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()
virtual void SetTarget(ObjectGuid)=0
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 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)
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 RemoveAurasWithAttribute(uint32 flags)
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
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
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)
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
void SendMeleeAttackStop(Unit *victim=nullptr)
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)
void GetAllMinionsByEntry(std::list< Creature * > &Minions, uint32 entry)
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
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 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
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_SPELLNONMELEEDAMAGELOG
@ 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_ATTACKERSTATEUPDATE
@ 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
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