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;
}
Bookmarks