Here's the formula. I'm still trying to figure out the variables:

adjust_base_dispense

Code:double __cdecl _adjust_base_depense(double mob_base_damage, signed int PDD, int mobLevel, int charLevel, int a5) { int v5; // edi@1 double PDDMultsqrt; // st7@1 double PDDMult; // st7@1 int v8; // eax@2 int v9; // eax@4 double result; // st7@7 double v11; // [sp+18h] [bp+8h]@7 signed int PDDRounded; // [sp+20h] [bp+10h]@1 PDDMult = PDD * 0.25; PDDRounded = (PDDMult + 0.5); PDDMultsqrt = sqrt(PDDMult); v5 = (a5 * PDDMultsqrt) / 100 + PDDMultsqrt; if ( charLevel < mobLevel ) { v8 = 4 * abs(mobLevel - charLevel); if ( v8 >= PDDRounded ) v8 = PDDRounded; PDDRounded -= v8; v9 = 2 * abs(mobLevel - charLevel); if ( v9 >= v5 ) v9 = (a5 * PDDMultsqrt) / 100 + PDDMultsqrt; v5 -= v9; } result = mob_base_damage - PDDRounded; v11 = (100 - v5) * mob_base_damage * 0.01; if ( result >= v11 ) result = v11; if ( result <= 1.0 ) result = 1.0; return result; }

CalcDamage::PDamage

Code:int __thiscall CalcDamage__PDamage(void *this, int MobData, __int64 CharacterData, int BasicStat, int MobAttackInfo, unsigned int a6, char a7, int a8, int a9, unsigned int MobID, int a11, int a12) { int v12; // edx@1 int v13; // ecx@1 int result; // eax@6 double v15; // st7@10 double v16; // st7@11 signed __int64 v17; // qax@13 int v18; // eax@15 signed int v19; // ecx@19 unsigned int RandNum; // eax@23 double mob_base_damage; // ST3C_8@23 int charLevel; // ST28_4@23 int mobLevel; // ST24_4@23 __int32 basePDD; // eax@23 signed int SecondaryStat:GetPDD; // eax@23 double v26; // ST3C_8@23 double v27; // ST3C_8@23 double damage; // st7@27 double v29; // [sp+24h] [bp-20h]@23 int v30; // [sp+2Ch] [bp-18h]@1 int v31; // [sp+30h] [bp-14h]@1 void *v32; // [sp+34h] [bp-10h]@1 signed int v33; // [sp+50h] [bp+Ch]@26 signed int mobAttack; // [sp+5Ch] [bp+18h]@21 signed int v35; // [sp+60h] [bp+1Ch]@7 v32 = this; v13 = 0; v12 = 0; v30 = 0; v31 = 0; if ( a8 ) { v12 = *(a8 + 28); v30 = *(a8 + 32); v13 = *(a8 + 20); v31 = *(a8 + 40); } if ( CalcDamage__CheckPDamageMiss(MobData, CharacterData, HIDWORD(CharacterData), BasicStat, a6, v13, v12) ) { if ( a8 ) ZRef_PassiveSkillData____ReleaseRaw(0); result = 0; } else { _ZtlSecureFuse((HIDWORD(CharacterData) + 24), *(HIDWORD(CharacterData) + 32)); v35 = *(MobData + 40); if ( *(MobData + 40) && *(MobData + 44) == 1201006 && MobID / 0x2710 != 882 ) // 1201006 = Threaten... The 882 check is to see if the mobID is Pink Bean { v15 = v35 * 0.01 + 1.0; if ( MobAttackInfo ) v16 = v15 * *(MobAttackInfo + 24); else v16 = v15 * *(MobData + 36); v17 = v16; } else { if ( MobAttackInfo ) v18 = *(MobAttackInfo + 24); else v18 = *(MobData + 36); LODWORD(v17) = v35 + v17; } if ( v17 <= 0 ) v19 = 0; else v19 = v17; mobAttack = v19; if ( v19 >= 29999 ) mobAttack = 29999; _ZtlSecureFuse((HIDWORD(CharacterData) + 12), *(HIDWORD(CharacterData) + 20)); RandNum = CRand32__Random(v32 + 160); mob_base_damage = _calc_mob_base_damamge(mobAttack, RandNum); charLevel = _ZtlSecureFuse((HIDWORD(CharacterData) + 12), *(HIDWORD(CharacterData) + 20)); mobLevel = *MobData; basePDD = BasicStat__CalcBasePDD(HIDWORD(CharacterData)); SecondaryStat:GetPDD = SecondaryStat__GetPDD(BasicStat, basePDD, CharacterData, v30, 0, a11, a12); v26 = _adjust_base_depense(mob_base_damage, SecondaryStat:GetPDD, mobLevel, charLevel, v31); v27 = v26 - _ZtlSecureFuse((BasicStat + 780), *(BasicStat + 788)) * v26 * 0.01; v29 = v27 - _ZtlSecureFuse((BasicStat + 4360), *(BasicStat + 4368)) * v27 * 0.01; if ( _ZtlSecureFuse((BasicStat + 1260), *(BasicStat + 1268)) ) { if ( a9 ) *a9 = CalcDamage__GetMesoGuardReduce(CharacterData, v29); } v33 = *(MobData + 212); if ( v33 ) damage = v33 * v29 * 0.01; else damage = v29; if ( damage <= 1.0 ) damage = 1.0; if ( damage >= 999999.0 ) damage = 999999.0; if ( a8 ) ZRef_PassiveSkillData____ReleaseRaw(0); result = damage; } return result; }

adjust_mob_damamge

Code:double __cdecl _calc_mob_base_damamge(signed int mobAttack, unsigned int randNum) { double mobAttackcpy; // st7@1 double v4; // st7@3 int mobMin[2]; // [sp+0h] [bp-10h]@1 double MobMax; // [sp+8h] [bp-8h]@1 mobAttackcpy = mobAttack; *mobMin = mobAttackcpy * 0.85; MobMax = mobAttackcpy; if ( *mobMin < mobAttackcpy ) { zswap(&MobMax, mobMin); LABEL_3: v4 = *mobMin - MobMax; mobMin[1] = 0; mobMin[0] = randNum % (&loc_98967F + 1); return v4 * *mobMin * 0.000000100000010000001 + MobMax; } if ( MobMax != *mobMin ) goto LABEL_3; return MobMax; }

## Bookmarks