Files
praxisandClaude Fable 5.2 45ecd73fe0 Evidence records
1888 files, from working commit b1a079a.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-19 01:32:48 +02:00

50 lines
17 KiB
JSON

{
"source_amount": {
"excerpts": [
"int32 WorldObject::CalculateSpellDamage(Unit const* target, SpellEntry const* spellProto, SpellEffectIndex effect_index, int32 const* effBasePoints, Spell* spell) const\n{\n Unit const* pUnit = ToUnit();\n Player const* pPlayer = ToPlayer();\n\n uint8 comboPoints = pPlayer ? pPlayer->GetComboPoints() : 0;\n\n int32 level = GetLevel();\n\n if (level > (int32)spellProto->maxLevel && spellProto->maxLevel > 0)\n level = (int32)spellProto->maxLevel;\n else if (level < (int32)spellProto->baseLevel)\n level = (int32)spellProto->baseLevel;\n level -= (int32)spellProto->spellLevel;\n\n int32 baseDice = int32(spellProto->EffectBaseDice[effect_index]);\n float basePointsPerLevel = spellProto->EffectRealPointsPerLevel[effect_index];\n float randomPointsPerLevel = spellProto->EffectDicePerLevel[effect_index];\n int32 basePoints = effBasePoints\n ? *effBasePoints - baseDice\n : spellProto->EffectBasePoints[effect_index];\n\n basePoints += int32(level * basePointsPerLevel);\n int32 randomPoints = int32(spellProto->EffectDieSides[effect_index] + level * randomPointsPerLevel);\n float comboDamage = spellProto->EffectPointsPerComboPoint[effect_index];\n\n switch (randomPoints)\n {\n case 0:\n case 1:\n basePoints += baseDice;\n break; // range 1..1\n default:\n {\n // range can have positive (1..rand) and negative (rand..1) values, so order its for irand\n int32 randvalue = baseDice >= randomPoints\n ? irand(randomPoints, baseDice)\n : irand(baseDice, randomPoints);\n\n if (IsPlayer() && ToPlayer()->HasOption(PLAYER_CHEAT_NO_DAMAGE_RNG))\n randvalue = 0;\n\n basePoints += randvalue;\n break;\n }\n }\n\n int32 value = basePoints;\n\n // random damage\n if (comboDamage != 0 && pPlayer && target && (target->GetObjectGuid() == pPlayer->GetComboTargetGuid()))\n value += (int32)(comboDamage * comboPoints);\n\n if (pUnit)\n {\n if (Player* modOwner = pUnit->GetSpellModOwner())\n {\n modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_ALL_EFFECTS, value, spell);\n\n if (effect_index == EFFECT_INDEX_2 && spellProto->IsFitToFamily<SPELLFAMILY_ROGUE, CF_ROGUE_HEMORRHAGE>())\n modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_EFFECT_PAST_FIRST, value, spell);\n\n // Apply speed aura mods at cast time.\n // Fixes Curse of Exhaustion not removing Amplify Curse.\n switch (spellProto->EffectApplyAuraName[effect_index])\n {\n case SPELL_AURA_MOD_INCREASE_SPEED:\n case SPELL_AURA_MOD_SPEED_ALWAYS:\n case SPELL_AURA_MOD_SPEED_NOT_STACK:\n case SPELL_AURA_MOD_DECREASE_SPEED:\n modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_SPEED, value, spell);\n break;\n }\n }\n }\n\n if (spellProto->Attributes & SPELL_ATTR_LEVEL_DAMAGE_CALCULATION && spellProto->spellLevel &&\n spellProto->Effect[effect_index] != SPELL_EFFECT_WEAPON_PERCENT_DAMAGE &&\n spellProto->Effect[effect_index] != SPELL_EFFECT_KNOCK_BACK &&\n (spellProto->Effect[effect_index] != SPELL_EFFECT_APPLY_AURA || spellProto->EffectApplyAuraName[effect_index] != SPELL_AURA_MOD_DECREASE_SPEED))\n value = int32(value * 0.25f * exp(GetLevel() * (70 - spellProto->spellLevel) / 1000.0f));\n\n return value;\n}",
"int32 WorldObject::SpellBaseHealingBonusDone(SpellSchoolMask schoolMask)\n{\n int32 AdvertisedBenefit = 0;\n\n if (Unit* pUnit = ToUnit())\n {\n Unit::AuraList const& mHealingDone = pUnit->GetAurasByType(SPELL_AURA_MOD_HEALING_DONE);\n for (const auto i : mHealingDone)\n if ((i->GetModifier()->m_miscvalue & schoolMask) != 0)\n AdvertisedBenefit += i->GetModifier()->m_amount;\n\n Unit::AuraList const& healingFromArmor = pUnit->GetAurasByType(SPELL_AURA_MOD_SPELL_HEALING_OF_ARMOR_PERCENT);\n for (const auto aura : healingFromArmor)\n if ((aura->GetModifier()->m_miscvalue & schoolMask) != 0)\n AdvertisedBenefit += int32(float(pUnit->GetArmor()) * aura->GetModifier()->m_amount / 100.0f);\n\n if (pUnit->IsPet())\n {\n if (Unit* owner = pUnit->GetOwner())\n {\n Unit::AuraList const& petSpellPowerAuras = pUnit->GetAurasByType(SPELL_AURA_MOD_PET_SPELL_DAMAGE_PERCENT_OF_OWNER);\n for (const auto aura : petSpellPowerAuras)\n if ((aura->GetModifier()->m_miscvalue & schoolMask) != 0)\n AdvertisedBenefit += int32(owner->GetTotalAttackPowerValue(RANGED_ATTACK) * aura->GetModifier()->m_amount / 100.0f);\n\n Unit::AuraList const& ownerPetSpellPowerAuras = owner->GetAurasByType(SPELL_AURA_MOD_PET_SPELL_DAMAGE_PERCENT_OF_OWNER);\n for (const auto aura : ownerPetSpellPowerAuras)\n if ((aura->GetModifier()->m_miscvalue & schoolMask) != 0)\n AdvertisedBenefit += int32(owner->GetTotalAttackPowerValue(RANGED_ATTACK) * aura->GetModifier()->m_amount / 100.0f);\n }\n }\n\n // Healing bonus of spirit, intellect and strength\n if (GetTypeId() == TYPEID_PLAYER)\n {\n // Healing bonus from stats\n Unit::AuraList const& mHealingDoneOfStatPercent = pUnit->GetAurasByType(SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT);\n for (const auto i : mHealingDoneOfStatPercent)\n {\n // 1.12.* have only 1 stat type support\n Stats usedStat = STAT_SPIRIT;\n AdvertisedBenefit += int32(pUnit->GetStat(usedStat) * i->GetModifier()->m_amount / 100.0f);\n }\n }\n }\n\n return AdvertisedBenefit;\n}",
"int32 WorldObject::SpellBaseDamageBonusDone(SpellSchoolMask schoolMask)\n{\n int32 DoneAdvertisedBenefit = 0;\n\n if (Unit* pUnit = ToUnit())\n {\n Unit::AuraList const& mDamageDone = pUnit->GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE);\n for (const auto i : mDamageDone)\n {\n if ((i->GetModifier()->m_miscvalue & schoolMask) != 0 &&\n i->GetSpellProto()->EquippedItemClass == -1 && // -1 == any item class (not wand then)\n i->GetSpellProto()->EquippedItemInventoryTypeMask == 0) // 0 == any inventory type (not wand then)\n DoneAdvertisedBenefit += i->GetModifier()->m_amount;\n }\n\n if (pUnit->IsPet())\n {\n if (Unit* owner = pUnit->GetOwner())\n {\n Unit::AuraList const& petSpellPowerAuras = pUnit->GetAurasByType(SPELL_AURA_MOD_PET_SPELL_DAMAGE_PERCENT_OF_OWNER);\n for (const auto aura : petSpellPowerAuras)\n if ((aura->GetModifier()->m_miscvalue & schoolMask) != 0)\n DoneAdvertisedBenefit += int32(owner->GetTotalAttackPowerValue(RANGED_ATTACK) * aura->GetModifier()->m_amount / 100.0f);\n\n Unit::AuraList const& ownerPetSpellPowerAuras = owner->GetAurasByType(SPELL_AURA_MOD_PET_SPELL_DAMAGE_PERCENT_OF_OWNER);\n for (const auto aura : ownerPetSpellPowerAuras)\n if ((aura->GetModifier()->m_miscvalue & schoolMask) != 0)\n DoneAdvertisedBenefit += int32(owner->GetTotalAttackPowerValue(RANGED_ATTACK) * aura->GetModifier()->m_amount / 100.0f);\n }\n }\n\n Unit::AuraList const& spellDamageOfStatAuras = pUnit->GetAurasByType(SPELL_AURA_MOD_SPELL_DAMAGE_OF_INTELLECT_PERCENT);\n for (const auto aura : spellDamageOfStatAuras)\n if ((aura->GetModifier()->m_miscvalue & schoolMask) != 0)\n DoneAdvertisedBenefit += int32(pUnit->GetStat(STAT_INTELLECT) * aura->GetModifier()->m_amount / 100.0f);\n\n if (GetTypeId() == TYPEID_PLAYER)\n {\n // Damage bonus from stats\n Unit::AuraList const& mDamageDoneOfStatPercent = pUnit->GetAurasByType(SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT);\n for (const auto i : mDamageDoneOfStatPercent)\n {\n if (i->GetModifier()->m_miscvalue & schoolMask)\n {\n // stat used stored in miscValueB for this aura\n Stats usedStat = STAT_SPIRIT;\n DoneAdvertisedBenefit += int32(pUnit->GetStat(usedStat) * i->GetModifier()->m_amount / 100.0f);\n }\n }\n }\n }\n\n return DoneAdvertisedBenefit;\n}"
],
"path": "/home/praxis/Servers/tortoise-wow/src/game/Objects/Object.cpp",
"sha256": "b488547b26216ab11c6e01a5c13ab20c7632a332a7ff440d4f846d64996c9b59"
},
"source_aura_handlers": {
"excerpts": [
"void Aura::HandleModHealingDone(bool apply, bool /*Real*/)\n{\n if (GetTarget()->GetTypeId() != TYPEID_PLAYER)\n return;\n\n // implemented in Unit::SpellHealingBonusDone\n // this information is for client side only\n ((Player*)GetTarget())->UpdateSpellDamageAndHealingBonus();\n}",
"void Aura::HandleModDamageDone(bool apply, bool Real)\n{\n Unit *target = GetTarget();\n\n // apply item specific bonuses for already equipped weapon\n if (Real && target->GetTypeId() == TYPEID_PLAYER)\n {\n for (int i = 0; i < MAX_ATTACK; ++i)\n if (Item* pItem = ((Player*)target)->GetWeaponForAttack(WeaponAttackType(i), true, false))\n ((Player*)target)->_ApplyWeaponDependentAuraDamageMod(pItem, WeaponAttackType(i), this, apply);\n }\n\n // m_modifier.m_miscvalue is bitmask of spell schools\n // 1 ( 0-bit ) - normal school damage (SPELL_SCHOOL_MASK_NORMAL)\n // 126 - full bitmask all magic damages (SPELL_SCHOOL_MASK_MAGIC) including wands\n // 127 - full bitmask any damages\n //\n // mods must be applied base at equipped weapon class and subclass comparison\n // with spell->EquippedItemClass and EquippedItemSubClassMask and EquippedItemInventoryTypeMask\n // m_modifier.m_miscvalue comparison with item generated damage types\n\n if ((m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_NORMAL) != 0)\n {\n // apply generic physical damage bonuses including wand case\n if (GetSpellProto()->EquippedItemClass == -1 || target->GetTypeId() != TYPEID_PLAYER)\n {\n target->HandleStatModifier(UNIT_MOD_DAMAGE_PHYSICAL, TOTAL_VALUE, float(m_modifier.m_amount), apply);\n }\n else\n {\n // done in Player::_ApplyWeaponDependentAuraMods\n }\n\n if (target->GetTypeId() == TYPEID_PLAYER)\n {\n if (m_positive)\n target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS, m_modifier.m_amount, apply);\n else\n target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG, m_modifier.m_amount, apply);\n }\n }\n\n // Skip non magic case for speedup\n if ((m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_MAGIC) == 0)\n return;\n\n if (GetSpellProto()->EquippedItemClass != -1 || GetSpellProto()->EquippedItemInventoryTypeMask != 0)\n {\n // wand magic case (skip generic to all item spell bonuses)\n // done in Player::_ApplyWeaponDependentAuraMods\n\n // Skip item specific requirements for not wand magic damage\n return;\n }\n\n // Magic damage modifiers implemented in Unit::SpellDamageBonusDone\n // This information for client side use only\n if (target->GetTypeId() == TYPEID_PLAYER)\n {\n if (m_positive)\n {\n for (int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)\n {\n if ((m_modifier.m_miscvalue & (1 << i)) != 0)\n target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + i, m_modifier.m_amount, apply);\n }\n }\n else\n {\n for (int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)\n {\n if ((m_modifier.m_miscvalue & (1 << i)) != 0)\n target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + i, m_modifier.m_amount, apply);\n }\n }\n Pet* pet = target->GetPet();\n if (pet)\n pet->UpdateAttackPowerAndDamage();\n }\n}"
],
"path": "/home/praxis/Servers/tortoise-wow/src/game/Spells/SpellAuras.cpp",
"sha256": "b16e4b33bf8c732aacade833a057290daf37c1823aacab7cda159925ef0f156b"
},
"source_header": {
"excerpts": [
"SPELL_AURA_MOD_DAMAGE_DONE = 13,",
"SPELL_AURA_MOD_HEALING_DONE = 135,"
],
"path": "/home/praxis/Servers/tortoise-wow/src/game/Spells/SpellAuraDefines.h",
"sha256": "ed7f67babe916cbbf91f7a1f1a9a9af694a2469d2e07eb10e94f0ae883678cb8"
},
"source_stat_presentation": {
"excerpts": [
"void Player::UpdateSpellDamageAndHealingBonus()\n{\n // Magic damage modifiers implemented in Unit::SpellDamageBonusDone\n // This information for client side use only\n // Get healing bonus for all schools\n // Get damage bonus for all schools\n for (int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)\n SetStatInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + i, SpellBaseDamageBonusDone(GetSchoolMask(i)));\n}"
],
"path": "/home/praxis/Servers/tortoise-wow/src/game/StatSystem.cpp",
"sha256": "b6eb7f28ac53c1b1d9b2e2328562110fd3a684af334268ccec0b1b5fa7271ba2"
},
"target_amount": {
"excerpts": [
"int32 Unit::SpellBaseHealingBonusDone(SpellSchoolMask schoolMask) const\n{\n if (Player const* thisPlayer = ToPlayer())\n {\n float overrideSP = thisPlayer->m_activePlayerData->OverrideSpellPowerByAPPercent;\n if (overrideSP > 0.0f)\n return int32(CalculatePct(GetTotalAttackPowerValue(BASE_ATTACK), overrideSP) + 0.5f);\n }\n\n int32 advertisedBenefit = GetTotalAuraModifier(SPELL_AURA_MOD_HEALING_DONE, [schoolMask](AuraEffect const* aurEff) -> bool\n {\n if (!aurEff->GetMiscValue() || (aurEff->GetMiscValue() & schoolMask) != 0)\n return true;\n return false;\n });\n\n // Healing bonus of spirit, intellect and strength\n if (GetTypeId() == TYPEID_PLAYER)\n {\n // Base value\n advertisedBenefit += ToPlayer()->GetBaseSpellPowerBonus();\n\n // Classic 1.60: intellect gives mana (Player::GetManaBonusFromIntellect), no healing power (retail: 1 per point)\n\n // Healing bonus from stats\n AuraEffectList const& mHealingDoneOfStatPercent = GetAuraEffectsByType(SPELL_AURA_MOD_SPELL_HEALING_OF_STAT_PERCENT);\n for (AuraEffectList::const_iterator i = mHealingDoneOfStatPercent.begin(); i != mHealingDoneOfStatPercent.end(); ++i)\n {\n // stat used dependent from misc value (stat index)\n Stats usedStat = Stats((*i)->GetSpellEffectInfo().MiscValue);\n advertisedBenefit += int32(CalculatePct(GetStat(usedStat), (*i)->GetAmount()));\n }\n }\n return advertisedBenefit;\n}",
"int32 Unit::SpellBaseDamageBonusDone(SpellSchoolMask schoolMask) const\n{\n Player const* thisPlayer = ToPlayer();\n if (thisPlayer)\n {\n float overrideSP = thisPlayer->m_activePlayerData->OverrideSpellPowerByAPPercent;\n if (overrideSP > 0.0f)\n return int32(CalculatePct(GetTotalAttackPowerValue(BASE_ATTACK), overrideSP) + 0.5f);\n }\n\n int32 DoneAdvertisedBenefit = GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_DAMAGE_DONE, schoolMask);\n\n if (thisPlayer)\n {\n // Base value\n DoneAdvertisedBenefit += thisPlayer->GetBaseSpellPowerBonus();\n\n // Classic 1.60 item stats: damage done of one school\n DoneAdvertisedBenefit += thisPlayer->GetClassicSpellDamageDone(schoolMask);\n\n // Classic 1.60: intellect gives mana (Player::GetManaBonusFromIntellect), no spell power (retail: 1 per point)\n\n // Damage bonus from stats\n AuraEffectList const& mDamageDoneOfStatPercent = GetAuraEffectsByType(SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT);\n for (AuraEffect const* aurEff : mDamageDoneOfStatPercent)\n {\n if ((aurEff->GetMiscValue() & schoolMask) != 0)\n {\n // stat used stored in miscValueB for this aura\n Stats const usedStat = static_cast<Stats>(aurEff->GetMiscValueB());\n DoneAdvertisedBenefit += static_cast<int32>(CalculatePct(GetStat(usedStat), aurEff->GetAmount()));\n }\n }\n\n }\n\n return DoneAdvertisedBenefit;\n}"
],
"path": "../servers/trinity-forever/src/server/game/Entities/Unit/Unit.cpp",
"sha256": "70895cc85720f42319ead6ff1eaebd3272f36b1f87db96905dfa7df668d5ebbd"
},
"target_header": {
"excerpts": [
"SPELL_AURA_MOD_DAMAGE_DONE = 13,",
"SPELL_AURA_MOD_HEALING_DONE = 135,"
],
"path": "../servers/trinity-forever/src/server/game/Spells/Auras/SpellAuraDefines.h",
"sha256": "1784b495ea9704bbe12223c2ad42d9d5fea7d320f0dc6c0055cd090cb7e5498b"
}
}