Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Deserves its own topic
#1
Only open these spoilers if you can read computer code. You've been warned:

 CalcDamageByWT
 _calc_base_damage
Reply
#2
I guess the "byWT" means Weapon Type, then.

And it's still rounding down, they just added 0.5 to it. Why?
Reply
#3
just saw the function for max HP and max MP

Both maxHP and maxMP can go up to 99,999
Reply
#4
Stereo Wrote:I guess the "byWT" means Weapon Type, then.

And it's still rounding down, they just added 0.5 to it. Why?

If the resultant would "round up", by adding 0.5 to it and converting it to type int it would thus round up. If it were in a situation where it would round down, it would round down in that case still.

i.e. (int)(1.51 + 0.5) = 2
(int)(1.49 + 0.5) = 1
(int)(1.51) = 1

I find it odd they have wrote separate cases for Swords instead of putting them in the same cases as Blunt Weapons and Axes. May imply there's something else going on behind the scenes. Could of course just be idiocy seeing as they did the same for Staves and Wands.
Reply
#5
The compiler is smarter than us. It's likely an assembly optimization.
Reply
#6
if ( v4 % 1000 && v4 != 2001 )

Cygnus and Legend has it's own code Big Grin
Nexon is stupid, can't they just make a function to return true/false for Legend/Cygnus instead of repeating job % 1000 == OR != 1000 / 2001.

I see plenty of it all over their code.
Reply
#7
Way to go, data encapsulation.
Reply
#8
JoeTang Wrote:If the resultant would "round up", by adding 0.5 to it and converting it to type int it would thus round up. If it were in a situation where it would round down, it would round down in that case still.

I mean, why add the half? Was it that important that damage formulas appear to round normally, instead of being the floor?
Reply
#9
Code:
double __cdecl CalcDamage__CalcDamageByWT(int weap_type, int a2, int total_watk, int total_matk);
signed __int64 __cdecl _calc_base_damage(int prim_stat, int sec_stat_1, int sec_stat_2, signed int total_atk, double weap_multiplier);
the bits in a2 parameter in CalcDamage__CalcDamageByWT seem to define the character stats, each stat is 8 bits long and _ZtlSecureFuse is used to extract each stat from a2


WeapMultweap_type
1H Sword1.230/31/32
1H Axe1.230/31/32
1H BW1.230/31/32
Dagger1.3033
Wand1.0037/38
Staff1.0037/38
2H Sword1.3240/41/42
2H Axe1.3240/41/42
2H BW1.3240/41/42
Spear1.4943/44
Polearm1.4943/44
Bow1.2045
Crossbow1.3546
Claw1.7547
Knuckler1.7048
Gun1.5049
???1.4339

What's type 39, is it blade? It uses str as primary and dex as secondary though
Reply
#10
39 is barehands which is used for brawlers without a knuckler equipped.
Reply
#11
So this means some of the earlier discoveries of the Weapon Multipliers were wrong? Just checking =P
Reply
#12
kruimel0 Wrote:So this means some of the earlier discoveries of the Weapon Multipliers were wrong? Just checking =P

Or were rewritten.
Reply
#13
kruimel0 Wrote:So this means some of the earlier discoveries of the Weapon Multipliers were wrong? Just checking =P

Erich Wrote:Or were rewritten.

nope you guys were spot on, except barehands was left out
Reply
#14
Stereo Wrote:I mean, why add the half? Was it that important that damage formulas appear to round normally, instead of being the floor?

It's a fairly common convention to be a little more explicit in how the rounding works.
Reply
#15
What I don't like about how the client is structured is that it has a class - CalcDamage - with tower functions CalcPDamage and CalcMDamage with ifs and thens and elses and loops and function calls everywhere. You'd think they'd have delegated each skill to have a function call but noooooooo. Why make it easy?
Reply
#16
Argh. If I could only understand this without you explaining. •__•;
Reply
#17
Fiel Wrote:just saw the function for max HP and max MP

Both maxHP and maxMP can go up to 99,999

Does it mean there is no more 30000 limitation? (or only % HP/MP gear can pass this limitation?)
for example, HP washed 30000 and using HB = 48000 or still 30000?

Thanks for the information :p
Reply
#18
It means warriors with 30k base before bb will automatically have 36k base, plus +% hp equips and HB.
Reply
#19
Takebacker Wrote:It means warriors with 30k base before bb will automatically have 36k base, plus +% hp equips and HB.

Cool, so theoretically, if you save enough AP before BB, after BB, you can even HP washed to over 30k base HP? (without 20% hp boost skill, and without any % hp equips/HB)
I am wondering if nexon will release new boss that hit for over 30k damage in the future....
Reply
#20
What is ZtlSecureFuse?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)