L2JMobius

Why not use rounded numbers for npc stats?

babyjason · 4 · 2024

Offline babyjason

  • Heir
  • **
    • Posts: 17
Hello,
Why are the npc stats with even 10 decimals instead of rounded numbers? any special reason? is it better for java to have lots of decimals for some reason?
Exemple:

Quote
<vitals hp="387.381703470032" hpRegen="3.5" mp="218.167072181671" mpRegen="1.5" />
         <attack physical="71.6625716625717" magical="36.2281126933207" random="10" critical="4" accuracy="5" attackSpeed="253" type="SWORD" range="40" distance="80" width="120" />
         <defence physical="74.2500742500742" magical="80.2920510949708" />
      


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16134
1. Double is double not mater how much you round it.
2. That double will return proper value after stats calculation, rounded value will be off.


Offline babyjason

  • Heir
  • **
    • Posts: 17
1. Double is double not mater how much you round it.
2. That double will return proper value after stats calculation, rounded value will be off.

are these value from sniffer? does .0 count as double? i ask because i wish to add custom stats , thank you for answering this weird question, but is kinda important.

"2. That double will return proper value after stats calculation, rounded value will be off."

stats of what? if u have max hp = 1.2312413 vs max hp 1.0  why is 1.232143 better?


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16134
There are other things that modify HP.
CON stat and effects from passive skills or buffs.

Put 100 HP on any monster and see how much it is ingame.