105 for (AuraEffectList::iterator i = vCopyDamageCopy.begin(); i != vCopyDamageCopy.end(); ++i)
108 if (!((*i)->GetBase()->IsAppliedOnTarget(victim->
GetGUID())))
111 if (((*i)->GetMiscValue() & damageSchoolMask) == 0)
114 Unit* shareDamageTarget = (*i)->GetCaster();
115 if (!shareDamageTarget)
117 SpellInfo const* spell = (*i)->GetSpellInfo();
164 bool duel_hasEnded =
false;
165 bool duel_wasMounted =
false;
172 duel_hasEnded =
true;
184 duel_wasMounted =
true;
185 duel_hasEnded =
true;
213 if (health <= damage)
215 SF_LOG_DEBUG(
"entities.unit",
"DealDamage: victim just died");
220 Kill(victim, durabilityLoss);
239 victim->
AddThreat(
this,
float(damage), damageSchoolMask, spellProto);
267 if (damagetype !=
NODAMAGE && damage)
271 if (damagetype !=
DOT)
275 uint32 interruptFlags = spell->m_spellInfo->InterruptFlags;
285 uint32 channelInterruptFlags = spell->m_spellInfo->ChannelInterruptFlags;
287 spell->DelayedChannel();
312 SF_LOG_DEBUG(
"entities.unit",
"DealDamageEnd returned %d damage", damage);
333 if (!originalCaster && triggeredByAura)
336 Spell* spell =
new Spell(
this, spellInfo, triggerFlags, originalCaster);
343 spell->
prepare(&targets, triggeredByAura);
360 CastSpell(victim, spellInfo, triggerFlags, castItem, triggeredByAura, originalCaster);
372 CastSpell(targets, spellInfo, NULL, triggerFlags, castItem, triggeredByAura, originalCaster);
398 CastCustomSpell(spellId, values, target, triggerFlags, castItem, triggeredByAura, originalCaster);
412 CastSpell(targets, spellInfo, &value, triggerFlags, castItem, triggeredByAura, originalCaster);
464 if (!victim || !victim->
IsAlive())
472 bool blocked =
false;
492 uint32 crit_bonus = damage;
496 damage += crit_bonus;
499 float critPctDamageMod = 0.0f;
508 if (critPctDamageMod != 0)
509 AddPct(damage, critPctDamageMod);
556 damageInfo->
damage = damage;
573 if (spellProto == NULL)
575 SF_LOG_DEBUG(
"entities.unit",
"Unit::DealSpellDamage has wrong damageInfo->SpellID: %u", damageInfo->
SpellID);
588 damageInfo->
target = victim;
653 damageInfo->
damage = damage;
728 float reducePercent = 1 - leveldif * 0.1f;
746 resilienceReduction = damageInfo->
damage - resilienceReduction;
747 damageInfo->
damage -= resilienceReduction;
799 float percent60 = 3.0f * percent20;
800 if (offtime > percent20 && offtime <= percent60)
802 else if (offtime > percent60)
804 offtime -= 2.0f * percent20;
811 float percent60 = 3.0f * percent20;
812 if (basetime > percent20 && basetime <= percent60)
814 else if (basetime > percent60)
816 basetime -= 2.0f * percent20;
834 float Probability = 20.0f;
838 Probability = 0.65f * victim->
getLevel() + 0.5f;
843 Probability *= AttackerMeleeSkill / (float)VictimDefense * 0.16;
848 if (Probability > 40.0f)
864 for (AuraEffectList::const_iterator dmgShieldItr = vDamageShieldsCopy.begin(); dmgShieldItr != vDamageShieldsCopy.end(); ++dmgShieldItr)
866 SpellInfo const* i_spellProto = (*dmgShieldItr)->GetSpellInfo();
881 uint32 damage = (*dmgShieldItr)->GetAmount();
883 if (
Unit* caster = (*dmgShieldItr)->GetCaster())
926 data <<
uint32(overkill > 0 ? overkill : 0);
952 else if (anim_id == 483)
989 float armor = float(victim->
GetArmor());
992 int32 armorBypassPct = 0;
994 for (AuraEffectList::const_iterator i = reductionAuras.begin(); i != reductionAuras.end(); ++i)
995 if ((*i)->GetCasterGUID() ==
GetGUID())
996 armorBypassPct += (*i)->GetAmount();
997 armor =
CalculatePct(armor, 100 - std::min(armorBypassPct, 100));
1007 for (AuraEffectList::const_iterator j = resIgnoreAuras.begin(); j != resIgnoreAuras.end(); ++j)
1010 armor = floor(
AddPct(armor, -(*j)->GetAmount()));
1014 for (AuraEffectList::const_iterator k = ArPenAuras.begin(); k != ArPenAuras.end(); ++k)
1017 armor = floor(
AddPct(armor, -(*k)->GetAmount()));
1025 if (levelModifier > 85)
1026 levelModifier = levelModifier + (4.5 * (levelModifier - 59)) + (20 * (levelModifier - 80)) + (22 * (levelModifier - 85));
1027 else if (levelModifier > 80)
1028 levelModifier = levelModifier + (4.5 * (levelModifier - 59)) + (20 * (levelModifier - 80));
1029 else if (levelModifier > 59)
1030 levelModifier = levelModifier + (4.5 * (levelModifier - 59));
1032 float tmpvalue = 0.1f * armor / (8.5f * levelModifier + 40);
1033 tmpvalue = tmpvalue / (1.0f + tmpvalue);
1035 if (tmpvalue < 0.0f)
1037 if (tmpvalue > 0.75f)
1040 return std::max<uint32>(damage * (1.0f - tmpvalue), 1);
1053 uint8 const bossLevel = 83;
1054 uint32 const bossResistanceConstant = 510;
1055 uint32 resistanceConstant = 0;
1058 if (level == bossLevel)
1059 resistanceConstant = bossResistanceConstant;
1061 resistanceConstant = level * 5;
1067 baseVictimResistance -= player->GetSpellPenetrationItemMod();
1070 int32 victimResistance = std::max<int32>(baseVictimResistance, 0);
1072 if (victimResistance > 0)
1074 int32 ignoredResistance = 0;
1077 for (AuraEffectList::const_iterator itr = ResIgnoreAuras.begin(); itr != ResIgnoreAuras.end(); ++itr)
1078 if ((*itr)->GetMiscValue() & schoolMask)
1079 ignoredResistance += (*itr)->GetAmount();
1081 ignoredResistance = std::min<int32>(ignoredResistance, 100);
1082 ApplyPct(victimResistance, 100 - ignoredResistance);
1085 if (victimResistance <= 0)
1088 float averageResist = float(victimResistance) / float(victimResistance + resistanceConstant);
1090 float discreteResistProbability[11];
1091 for (
uint32 i = 0; i < 11; ++i)
1093 discreteResistProbability[i] = 0.5f - 2.5f * fabs(0.1f * i - averageResist);
1094 if (discreteResistProbability[i] < 0.0f)
1095 discreteResistProbability[i] = 0.0f;
1098 if (averageResist <= 0.1f)
1100 discreteResistProbability[0] = 1.0f - 7.5f * averageResist;
1101 discreteResistProbability[1] = 5.0f * averageResist;
1102 discreteResistProbability[2] = 2.5f * averageResist;
1107 float probabilitySum = discreteResistProbability[0];
1109 while (r >= probabilitySum && resistance < 10)
1110 probabilitySum += discreteResistProbability[++resistance];
1112 return resistance * 10;
1117 if (!victim || !victim->
IsAlive() || !damage)
1126 float auraAbsorbMod = 0;
1128 for (AuraEffectList::const_iterator itr = AbsIgnoreAurasA.begin(); itr != AbsIgnoreAurasA.end(); ++itr)
1130 if (!((*itr)->GetMiscValue() & schoolMask))
1133 if ((*itr)->GetAmount() > auraAbsorbMod)
1134 auraAbsorbMod = float((*itr)->GetAmount());
1138 for (AuraEffectList::const_iterator itr = AbsIgnoreAurasB.begin(); itr != AbsIgnoreAurasB.end(); ++itr)
1140 if (!((*itr)->GetMiscValue() & schoolMask))
1143 if (((*itr)->GetAmount() > auraAbsorbMod) && (*itr)->IsAffectingSpell(spellInfo))
1144 auraAbsorbMod = float((*itr)->GetAmount());
1155 for (AuraEffectList::iterator itr = vSchoolAbsorbCopy.begin(); (itr != vSchoolAbsorbCopy.end()) && (dmgInfo.
GetDamage() > 0); ++itr)
1168 if (currentAbsorb < 0)
1173 bool defaultPrevented =
false;
1176 currentAbsorb = tempAbsorb;
1178 if (defaultPrevented)
1182 AddPct(currentAbsorb, -auraAbsorbMod);
1189 tempAbsorb = currentAbsorb;
1205 for (AuraEffectList::const_iterator itr = vManaShieldCopy.begin(); (itr != vManaShieldCopy.end()) && (dmgInfo.
GetDamage() > 0); ++itr)
1219 if (currentAbsorb < 0)
1222 uint32 tempAbsorb = currentAbsorb;
1224 bool defaultPrevented =
false;
1227 currentAbsorb = tempAbsorb;
1229 if (defaultPrevented)
1232 AddPct(currentAbsorb, -auraAbsorbMod);
1237 int32 manaReduction = currentAbsorb;
1241 manaReduction =
int32(
float(manaReduction) * manaMultiplier);
1246 currentAbsorb = currentAbsorb ?
int32(
float(currentAbsorb) * (
float(manaTaken) /
float(manaReduction))) : 0;
1250 tempAbsorb = currentAbsorb;
1268 for (AuraEffectList::iterator itr = vSplitDamagePctCopy.begin(); itr != vSplitDamagePctCopy.end() && dmgInfo.
GetDamage() > 0; ++itr)
1276 if (!((*itr)->GetMiscValue() & schoolMask))
1280 Unit* caster = (*itr)->GetCaster();
1281 if (!caster || (caster == victim) || !caster->
IsInWorld() || !caster->
IsAlive())
1286 (*itr)->GetBase()->CallScriptEffectSplitHandlers((*itr), aurApp, dmgInfo, splitDamage);
1292 uint32 splitted = splitDamage;
1312 int32 RemainingHeal = healAmount;
1315 bool existExpired =
false;
1319 for (AuraEffectList::const_iterator i = vHealAbsorb.begin(); i != vHealAbsorb.end() && RemainingHeal > 0; ++i)
1321 if (!((*i)->GetMiscValue() & healSpell->
SchoolMask))
1325 int32 currentAbsorb = (*i)->GetAmount();
1328 if (currentAbsorb <= 0)
1330 existExpired =
true;
1336 if (RemainingHeal < currentAbsorb)
1337 currentAbsorb = RemainingHeal;
1339 RemainingHeal -= currentAbsorb;
1342 (*i)->SetAmount((*i)->GetAmount() - currentAbsorb);
1344 if ((*i)->GetAmount() <= 0)
1345 existExpired =
true;
1351 for (AuraEffectList::const_iterator i = vHealAbsorb.begin(); i != vHealAbsorb.end();)
1360 i = vHealAbsorb.begin();
1365 absorb = RemainingHeal > 0 ? (healAmount - RemainingHeal) : healAmount;
1366 healAmount = RemainingHeal;
1409 SF_LOG_DEBUG(
"entities.unit",
"AttackerStateUpdate: (Player) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.",
1412 SF_LOG_DEBUG(
"entities.unit",
"AttackerStateUpdate: (NPC) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.",
1443 SF_LOG_DEBUG(
"entities.unit",
"MELEE OUTCOME: miss %f crit %f dodge %f parry %f block %f", miss_chance, crit_chance, dodge_chance, parry_chance, block_chance);
1457 int32 skillBonus = 4 * (attackerMaxSkillValueForLevel - victimMaxSkillValueForLevel);
1458 int32 sum = 0, tmp = 0;
1459 int32 roll = std::rand() % 10000;
1461 SF_LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: skill bonus of %d for attacker", skillBonus);
1462 SF_LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: rolled %d, miss %d, dodge %d, parry %d, block %d, crit %d",
1463 roll, miss_chance, dodge_chance, parry_chance, block_chance, crit_chance);
1467 if (tmp > 0 && roll < (sum += tmp))
1469 SF_LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: MISS");
1476 SF_LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: CRIT (sitting victim)");
1485 SF_LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: attack came from behind and victim was a player.");
1491 dodge_chance -=
int32(
ToPlayer()->GetExpertiseDodgeOrParryReduction(attType) * 100);
1501 && ((tmp -= skillBonus) > 0)
1502 && roll < (sum += tmp))
1504 SF_LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: DODGE <%d, %d)", sum - tmp, sum);
1513 SF_LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: attack came from behind.");
1518 parry_chance -=
int32(
ToPlayer()->GetExpertiseDodgeOrParryReduction(attType) * 100);
1526 && (tmp2 -= skillBonus) > 0
1527 && roll < (sum += tmp2))
1529 SF_LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: PARRY <%d, %d)", sum - tmp2, sum);
1538 && (tmp -= skillBonus) > 0
1539 && roll < (sum += tmp))
1541 SF_LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: BLOCK <%d, %d)", sum - tmp, sum);
1550 if (tmp > 0 && roll < (sum += tmp))
1552 SF_LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: CRIT <%d, %d)", sum - tmp, sum);
1554 SF_LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: CRIT DISABLED)");
1566 int32 skill = attackerMaxSkillValueForLevel;
1568 tmp = (10 + (victimMaxSkillValueForLevel - skill)) * 100;
1569 tmp = tmp > 4000 ? 4000 : tmp;
1570 if (roll < (sum += tmp))
1572 SF_LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: GLANCING <%d, %d)", sum - 4000, sum);
1584 tmp = victimMaxSkillValueForLevel;
1586 tmp = attackerMaxSkillValueForLevel - tmp;
1590 tmp = tmp * 200 - 1500;
1591 if (roll < (sum += tmp))
1593 SF_LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: CRUSHING <%d, %d)", sum - tmp, sum);
1599 SF_LOG_DEBUG(
"entities.unit",
"RollMeleeOutcomeAgainst: NORMAL");
1605 float min_damage, max_damage;
1633 if (min_damage > max_damage)
1634 std::swap(min_damage, max_damage);
1636 if (max_damage == 0.0f)
1639 return std::rand() % (
uint32)max_damage + (
uint32)min_damage;
1647 float LvlPenalty = 0.0f;
1650 LvlPenalty = 20.0f - spellProto->
SpellLevel * 3.75f;
1652 if (LvlFactor > 1.0f)
1655 return AddPct(LvlFactor, -LvlPenalty);
@ CREATURE_FLAG_EXTRA_NO_BLOCK
@ CREATURE_FLAG_EXTRA_NO_CRIT
@ CREATURE_FLAG_EXTRA_NO_CRUSH
@ CREATURE_FLAG_EXTRA_NO_PARRY
@ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_RECEIVED
@ ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE
@ ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED
@ ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_DEALT
#define MAX_SPELL_EFFECTS
#define SF_LOG_DEBUG(filterType__,...)
#define SF_LOG_ERROR(filterType__,...)
@ EMOTE_ONESHOT_WOUND_CRITICAL
@ EMOTE_ONESHOT_PARRY_SHIELD
@ SPELL_EFFECT_SCHOOL_DAMAGE
@ SPELL_DAMAGE_CLASS_RANGED
@ SPELL_DAMAGE_CLASS_MAGIC
@ SPELL_DAMAGE_CLASS_NONE
@ SPELL_DAMAGE_CLASS_MELEE
@ SPELL_ATTR4_IGNORE_RESISTANCES
@ SPELL_ATTR4_DAMAGE_DOESNT_BREAK_AURAS
@ SPELL_SCHOOL_MASK_NORMAL
@ SPELL_SCHOOL_MASK_SPELL
@ SPELL_AURA_MOD_TARGET_ABSORB_SCHOOL
@ SPELL_AURA_PERIODIC_DAMAGE
@ SPELL_AURA_MOD_ATTACKER_RANGED_CRIT_DAMAGE
@ SPELL_AURA_MOD_IGNORE_TARGET_RESIST
@ SPELL_AURA_DAMAGE_SHIELD
@ SPELL_AURA_MOD_EXPERTISE
@ SPELL_AURA_SHARE_DAMAGE_PCT
@ SPELL_AURA_IGNORE_HIT_DIRECTION
@ SPELL_AURA_SCHOOL_HEAL_ABSORB
@ SPELL_AURA_BYPASS_ARMOR_FOR_CASTER
@ SPELL_AURA_MOD_ENEMY_DODGE
@ SPELL_AURA_MOD_TARGET_ABILITY_ABSORB_SCHOOL
@ SPELL_AURA_SPLIT_DAMAGE_PCT
@ SPELL_AURA_MOD_CRIT_DAMAGE_BONUS
@ SPELL_AURA_MOD_ARMOR_PENETRATION_PCT
@ SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_DAMAGE
@ SPELL_AURA_MOD_TARGET_RESISTANCE
@ SPELL_AURA_SCHOOL_ABSORB
@ SPELL_AURA_MOD_COMBAT_RESULT_CHANCE
@ SPELL_ATTR0_CU_IGNORE_ARMOR
@ PROC_FLAG_DONE_MELEE_AUTO_ATTACK
@ PROC_FLAG_DONE_MAINHAND_ATTACK
@ PROC_FLAG_TAKEN_MELEE_AUTO_ATTACK
@ PROC_FLAG_DONE_OFFHAND_ATTACK
@ AURA_INTERRUPT_FLAG_TAKE_DAMAGE
@ AURA_INTERRUPT_FLAG_DIRECT_DAMAGE
@ AURA_INTERRUPT_FLAG_MELEE_ATTACK
@ SPELLMOD_CRIT_DAMAGE_BONUS
@ HITINFO_SWINGNOHITSOUND
#define CURRENT_FIRST_NON_MELEE_SPELL
@ AURA_REMOVE_BY_ENEMY_SPELL
@ TRIGGERED_FULL_MASK
Will ignore most target checks (mostly DBC target checks).
#define CURRENT_MAX_SPELL
@ CURRENT_CHANNELED_SPELL
@ SPELL_INTERRUPT_FLAG_ABORT_ON_DMG
@ SPELL_INTERRUPT_FLAG_PUSH_BACK
@ UNIT_STATE_CANNOT_AUTOATTACK
@ UNIT_FIELD_MAX_RANGED_DAMAGE
@ UNIT_FIELD_MAX_OFF_HAND_DAMAGE
@ UNIT_FIELD_MIN_RANGED_DAMAGE
@ UNIT_FIELD_MIN_OFF_HAND_DAMAGE
@ UNIT_FIELD_NPC_EMOTESTATE
bool roll_chance_f(float chance)
T RoundToInterval(T &num, T floor, T ceil)
T ApplyPct(T &base, U pct)
T CalculatePct(T base, U pct)
SpellInfo const * GetSpellInfo() const
void SetAmount(int32 amount)
int32 GetMiscValue() const
uint32 GetEffIndex() const
uint64 GetCasterGUID() const
const AuraApplication * GetApplicationOfTarget(uint64 guid) const
void CallScriptEffectAbsorbHandlers(AuraEffect *aurEff, AuraApplication const *aurApp, DamageInfo &dmgInfo, uint32 &absorbAmount, bool &defaultPrevented)
void CallScriptEffectAfterAbsorbHandlers(AuraEffect *aurEff, AuraApplication const *aurApp, DamageInfo &dmgInfo, uint32 &absorbAmount)
void CallScriptEffectManaShieldHandlers(AuraEffect *aurEff, AuraApplication const *aurApp, DamageInfo &dmgInfo, uint32 &absorbAmount, bool &defaultPrevented)
void CallScriptEffectAfterManaShieldHandlers(AuraEffect *aurEff, AuraApplication const *aurApp, DamageInfo &dmgInfo, uint32 &absorbAmount)
virtual void Remove(AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)=0
void WriteGuidBytes(const ObjectGuid &guid, Offsets... offsets)
bool WriteBit(uint32 bit)
void WriteGuidMask(const ObjectGuid &guid, Offsets... offsets)
virtual void OwnerAttackedBy(Unit *)
virtual void AttackedBy(Unit *)
bool hasLootRecipient() const
void SetLootRecipient(Unit *unit)
CreatureTemplate const * GetCreatureTemplate() const
bool IsInEvadeMode() const
void LowerPlayerDamageReq(uint32 unDamage)
void AddSpellMod(SpellValueMod mod, int32 value)
const_iterator end() const
StorageType::const_iterator const_iterator
const_iterator begin() const
void ResistDamage(uint32 amount)
void AbsorbDamage(uint32 amount)
uint32 GetUInt32Value(uint16 index) const
uint32 GetGUIDLow() const
float GetFloatValue(uint16 index) const
bool HasFlag(uint16 index, uint32 flag) const
void SetUInt32Value(uint16 index, uint32 value)
void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float &min_damage, float &max_damage)
void DuelComplete(DuelCompleteType type)
void CastItemCombatSpell(Unit *target, WeaponAttackType attType, uint32 procVictim, uint32 procEx)
void DurabilityPointLossForEquipSlot(EquipmentSlots slot)
bool GetCommandStatus(uint32 command) const
Battleground * GetBattleground() const
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint64 miscValue1=0, uint64 miscValue2=0, uint64 miscValue3=0, Unit *unit=NULL)
void SetDst(float x, float y, float z, float orientation, uint32 mapId=MAPID_INVALID)
void SetGOTarget(GameObject *target)
void SetUnitTarget(Unit *target)
float CalcValueMultiplier(Unit *caster, Spell *spell=NULL) const
void SetSpellValue(SpellValueMod mod, int32 value)
void prepare(SpellCastTargets const *targets, AuraEffect const *triggeredByAura=NULL)
SpellEffectInfo Effects[MAX_SPELL_EFFECTS]
uint32 GetEffectMechanicMask(uint8 effIndex) const
SpellSchoolMask GetSchoolMask() const
virtual void DamageTaken(Unit *, uint32 &)
virtual void DamageDealt(Unit *, uint32 &, DamageEffectType)
int32 ModifyHealth(int32 val)
void ApplyResilience(Unit const *victim, int32 *damage, bool isCrit) const
void CastStop(uint32 except_spellid=0)
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
Spell * m_currentSpells[CURRENT_MAX_SPELL]
uint32 SpellCriticalDamageBonus(SpellInfo const *spellProto, uint32 damage, Unit *victim)
void Kill(Unit *victim, bool durabilityLoss=true)
bool isSpellBlocked(Unit *victim, SpellInfo const *spellProto, WeaponAttackType attackType=WeaponAttackType::BASE_ATTACK)
void CastSpell(SpellCastTargets const &targets, SpellInfo const *spellInfo, CustomSpellValues const *value, TriggerCastFlags triggerFlags=TRIGGERED_NONE, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, uint64 originalCaster=0)
uint32 GetResistance(SpellSchools school) const
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except=0)
Player * GetSpellModOwner() const
void SendSpellMiss(Unit *target, uint32 spellID, SpellMissInfo missInfo)
float GetUnitDodgeChance() const
void AddThreat(Unit *victim, float fThreat, SpellSchoolMask schoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell=NULL)
void HandleProcExtraAttackFor(Unit *victim)
Unit * GetCharmer() const
void SendSpellDamageImmune(Unit *target, uint32 spellId)
void DealDamageMods(Unit *victim, uint32 &damage, uint32 *absorb)
void SendAttackStateUpdate(CalcDamageInfo *damageInfo)
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
bool haveOffhandWeapon() const
uint32 MeleeDamageBonusTaken(Unit *attacker, uint32 pdamage, WeaponAttackType attType, SpellInfo const *spellProto=NULL)
MeleeHitOutcome RollMeleeOutcomeAgainst(const Unit *victim, WeaponAttackType attType) const
static bool IsDamageReducedByArmor(SpellSchoolMask damageSchoolMask, SpellInfo const *spellInfo=NULL, uint8 effIndex=MAX_SPELL_EFFECTS)
uint8 getLevelForTarget(WorldObject const *) const override
void SetLastDamagedTime(time_t val)
void CombatStart(Unit *target, bool initialAggro=true)
uint32 CalcArmorReducedDamage(Unit *victim, const uint32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType=WeaponAttackType::MAX_ATTACK)
int32 GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const
uint32 m_removedAurasCount
void SetHealth(uint32 val)
bool IsStandState() const
virtual uint32 GetBlockPercent() const
void DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss)
uint16 GetMaxSkillValueForLevel(Unit const *target=NULL) const
int32 ModifyPower(Powers power, int32 val)
uint64 GetCharmerGUID() const
uint32 getAttackTimer(WeaponAttackType type) const
Unit * GetMeleeHitRedirectTarget(Unit *victim, SpellInfo const *spellInfo=NULL)
void CalcAbsorbResist(Unit *victim, SpellSchoolMask schoolMask, DamageEffectType damagetype, uint32 const damage, uint32 *absorb, uint32 *resist, SpellInfo const *spellInfo=NULL)
uint32 DealDamage(Unit *victim, uint32 damage, CleanDamage const *cleanDamage=NULL, DamageEffectType damagetype=DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask=SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *spellProto=NULL, bool durabilityLoss=true)
uint32 CalculateDamage(WeaponAttackType attType, bool normalized, bool addTotalPct)
void CalcHealAbsorb(Unit *victim, SpellInfo const *spellInfo, uint32 &healAmount, uint32 &absorb)
uint32 CalcSpellResistance(Unit *victim, SpellSchoolMask schoolMask, SpellInfo const *spellInfo) const
void RewardRage(uint32 baseRage, bool attacker)
float GetTotalAuraMultiplier(AuraType auratype) const
bool HasAuraType(AuraType auraType) const
void setAttackTimer(WeaponAttackType type, uint32 time)
uint32 MeleeDamageBonusDone(Unit *pVictim, uint32 damage, WeaponAttackType attType, SpellInfo const *spellProto=NULL)
uint32 GetAttackTime(WeaponAttackType att) const
uint32 SpellDamageBonusDone(Unit *victim, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack=1) const
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage *log)
float GetUnitBlockChance() const
bool IsImmunedToDamage(SpellSchoolMask meleeSchoolMask) const
void DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
bool HasUnitState(const uint32 f) const
void CastCustomSpell(Unit *victim, uint32 spellId, int32 const *bp0, int32 const *bp1, int32 const *bp2, bool triggered, Item *castItem=NULL, AuraEffect const *triggeredByAura=NULL, uint64 originalCaster=0)
int32 GetTotalAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const
uint32 SpellDamageBonusTaken(Unit *caster, SpellInfo const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack=1) const
void CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType=WeaponAttackType::BASE_ATTACK, bool crit=false)
SpellInfo const * m_overrideAutoattackSpellInfo
void AttackerStateUpdate(Unit *victim, WeaponAttackType attType=WeaponAttackType::BASE_ATTACK, bool extra=false)
uint64 GetOwnerGUID() const
bool IsControlledByPlayer() const
float GetTotalAuraMultiplierByMiscMask(AuraType auratype, uint32 misc_mask) const
void HandleEmoteCommand(uint32 anim_id)
virtual SpellSchoolMask GetMeleeDamageSchoolMask() const
float GetUnitParryChance() const
Powers getPowerType() const
int32 GetTotalAuraModifier(AuraType auratype) const
std::list< AuraEffect * > AuraEffectList
uint32 SpellNonMeleeDamageLog(Unit *victim, uint32 spellID, uint32 damage)
float MeleeSpellMissChance(Unit const *victim, WeaponAttackType attType, uint32 spellId) const
float CalculateLevelPenalty(SpellInfo const *spellProto) const
void ProcDamageAndSpell(Unit *victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType=WeaponAttackType::BASE_ATTACK, SpellInfo const *procSpell=NULL, SpellInfo const *procAura=NULL)
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true)
void CalculateMeleeDamage(Unit *victim, uint32 damage, CalcDamageInfo *damageInfo, WeaponAttackType attackType=WeaponAttackType::BASE_ATTACK)
float GetUnitCriticalChance(WeaponAttackType attackType, const Unit *victim) const
void CombatStopWithPets(bool includingCast=false)
SpellMissInfo SpellHitResult(Unit *victim, SpellInfo const *spellInfo, bool canReflect=false)
bool IsWithinLOSInMap(WorldObject const *obj) const
virtual void SendMessageToSet(WorldPacket *data, bool self)
@ RATE_DURABILITY_LOSS_DAMAGE
MeleeHitOutcome hitOutCome
WeaponAttackType attackType
WeaponAttackType attackType
float GetOrientation() const
bool HasInArc(float arcangle, Position const *pos, float border=2.0f) const