Test Mushroom
Posts: 10,045
Threads: 1,506
Joined: 2008-06
Gender: Male
Sexual Orientation: Straight
Country Flag: usa
IGN: GuavaCowboy
Server: Zenith
Level: 10x
Job: Jett
Guild: L>
2010-07-29, 08:34 PM
(This post was last modified: 2010-08-04, 08:41 PM by Fiel.)
Here's what I've come up with so far:
This is what happens if a mob damages you
ORDER OF EVENTS: - Check if the mob missed the attack. If so, return 0 damage.
- The mob's attack is fetched
- If the mob is affected by Threaten, reduce it's WATK value by the percentage given in the skill OR if a mob is influenced by a damage increasing skill, increase the WATK. Precedence is on Threaten.
- Constrain mob attack between 29,999 and 1.
- Calculate mob base damage
- MobMin = mobAttack * 0.85
- MobMax = mobAttack
- return (MobMin - MobMax) * MobMin * 0.000000100000010000001 + MobMax;
- Calculate Player PDD - this NEVER takes into account StandardPDD.img - this img file is never used.
- Then perform the following calculation on PDD --> pdd = math.round(totalPDD * 0.25, 0)
- Subtract pdd from mob base damage
- Multiply the damage according to damage reduction skills (Achilles, Combo Barrier)
- Factor in Meso Guard
- Constrain the damage between 999,999 and 1
- Return damage
Global Moderator
Posts: 8,286
Threads: 1,081
Joined: 2008-07
Gender: Male
Sexual Orientation: Straight
Country Flag: canada
Are skills like Fake applied before the avoid formula?
Posting Freak
Posts: 2,177
Threads: 78
Joined: 2008-08
Gender: Female
Country Flag: California
IGN: MsJudith
Server: Windia
Level: 130
Job: aran
Guild: n/a
Guild Alliance: n/a
Fiel Wrote:Here's what I've come up with so far:
This is what happens if a mob damages you
ORDER OF EVENTS:- Check if the mob missed the attack. If so, return 0 damage.
- The mob's attack is fetched
- If the mob is affected by Threaten, reduce it's WATK value by the percentage given in the skill OR if a mob is influenced by a damage increasing skill, increase the WATK. Precedence is on Threaten.
- Bounds checking - If WATK is less than 0, WATK = 0. If WATK is greater than 30000, WATK = 30000
- Calculate mob base damage
- MobMin = mobAttack * 0.85
- MobMax = mobAttack
- return (MobMin - MobMax) * MobMin * 0.000000100000010000001 + MobMax;
- Calculate Player BasePDD (see spoiler #1)
The above bolded is dangerously close to being 1/9,999,999
This is about as far as I've gotten in about 1 hour. X_X
Posting Freak
Posts: 3,213
Threads: 466
Joined: 2008-07
It is 1/9,999,999 due to limits of float values. Just compiler-optimization.
Posting Freak
Posts: 2,177
Threads: 78
Joined: 2008-08
Gender: Female
Country Flag: California
IGN: MsJudith
Server: Windia
Level: 130
Job: aran
Guild: n/a
Guild Alliance: n/a
Gotta admit though... I'm a complete nerd. The moment I saw that number... before properly counting the zeros: "hey! isn't that 1/9,999,999".
So... question... what the hell's up with such a weird number being used here 0.o
Posting Freak
Posts: 3,054
Threads: 142
Joined: 2008-07
Gender: Male
Country Flag: Massachusetts
IGN: flarfek
Server: Scania
Level: 150
Job: ILAM
Why do mobs get 85% mastery? :<
I'm interested to see how defense factors in now. I hope it's not useless anymore.
Posting Freak
Posts: 8,478
Threads: 128
Joined: 2008-07
Gender: Neuter
Country Flag: canada
IGN: Oooh
Server: Bera
Job: Empress
Farm: Stereo
shouri Wrote:Gotta admit though... I'm a complete nerd. The moment I saw that number... before properly counting the zeros: "hey! isn't that 1/9,999,999".
So... question... what the hell's up with such a weird number being used here 0.o
Coder types
a = x/9999999
Compiler converts this to
a = x*0.000000100000010000001
Multiplication is a much faster operation than division. Why they do 9999999? Same reason damage cap is 199,999 I guess... they just like 9s.
Senior Member
Posts: 400
Threads: 6
Joined: 2010-07
Gender: Male
Sexual Orientation: Straight
Country Flag: netherlands
IGN: Huskey
Server: KradiaEMS
Level: 160
Job: Aran
Guild: UndiesPatrol
Guild Alliance: UndiesUnited
Hm... How higher the mobAttack is, the lower the % of that mobAttack is returned at that 'return'. But at 30k mobAttack, it still returns 99,96% of it (coming to 29988)... Is this info of any relevancy? And why did they use this formula if at the max mobAttack is changed with 0,04% at max? D=
Just testing a bit with numbers as I have no idea how that programming code in the spoiler works... =P
Member
Posts: 54
Threads: 2
Joined: 2009-08
2010-07-30, 03:13 PM
(This post was last modified: 2010-08-05, 12:21 PM by 50504724.)
Since standardPDD is still keep in Base.wz,
I assume pdd formula will not change a lot.
At last NX forget to remove the img file = =
Seems that 4 pdd means 1 HP... So easy XD
Round works everywhere... instead of FLOOR.
Posting Freak
Posts: 8,478
Threads: 128
Joined: 2008-07
Gender: Neuter
Country Flag: canada
IGN: Oooh
Server: Bera
Job: Empress
Farm: Stereo
Quote: v2 = this;
v3 = _ZtlSecureFuse((this + 36), *(this + 44));
v4 = _ZtlSecureFuse((v2 + 48), *(v2 + 56));
v5 = _ZtlSecureFuse((v2 + 72), *(v2 + 80));
return (_ZtlSecureFuse((v2 + 60), *(v2 + 68)) * 0.4 + (v5 + v4) * 0.5 + v3 * 1.2);
v3 = str
v4 = dex
*(v2 + 68) = int
v5 = luk
Gives 44 56 68 80 or 36 48 60 72 offsets, a reasonable way to lay out str/dex/int/luk.
Which would mean it's returning
0.4 * INT + (DEX + LUK)*0.5 + STR * 1.2
Test Mushroom
Posts: 10,045
Threads: 1,506
Joined: 2008-06
Gender: Male
Sexual Orientation: Straight
Country Flag: usa
IGN: GuavaCowboy
Server: Zenith
Level: 10x
Job: Jett
Guild: L>
2010-07-30, 04:40 PM
(This post was last modified: 2010-07-31, 05:10 PM by Fiel.)
-- EDITED OUT ---
Test Mushroom
Posts: 10,045
Threads: 1,506
Joined: 2008-06
Gender: Male
Sexual Orientation: Straight
Country Flag: usa
IGN: GuavaCowboy
Server: Zenith
Level: 10x
Job: Jett
Guild: L>
Base Magic and Physical Accuracy are calculated differently:
Base Magic Accuracy = INT + LUK * 1.2
Base Magic Avoid = INT + LUK * 2
Base Magic Defense = STR * 0.4 + (DEX + LUK) * 0.5 + INT * 1.2
Base Physical Accuracy = LUK + DEX * 1.2
Base Physical Avoid = DEX + LUK * 2
Base Physical Defense = INT * 0.4 + (LUK + DEX) * 0.5 + STR * 1.2
Won't Be Coming Back
Posts: 1,822
Threads: 200
Joined: 2009-10
Fiel Wrote:-- EDITED OUT ---
Sorry if this is off-topic, but why did you NOT just delete your post?
Test Mushroom
Posts: 10,045
Threads: 1,506
Joined: 2008-06
Gender: Male
Sexual Orientation: Straight
Country Flag: usa
IGN: GuavaCowboy
Server: Zenith
Level: 10x
Job: Jett
Guild: L>
I don't have mod powers and I don't want them.
Senior Member
Posts: 470
Threads: 36
Joined: 2008-07
Fiel Wrote:Base Magic and Physical Accuracy are calculated differently:
Base Magic Accuracy = INT + LUK * 1.2
Base Magic Avoid = INT + LUK * 2
Base Magic Defense = STR * 0.4 + (DEX + LUK) * 0.5 + INT * 1.2
Base Physical Accuracy = LUK + DEX * 1.2
Base Physical Avoid = DEX + LUK * 2
Base Physical Defense = INT * 0.4 + (LUK + DEX) * 0.5 + STR * 1.2
That definitely makes a whole lot more sense! Finally STR factors into physical defense! =_=
Is it base stats only? Or total?
Test Mushroom
Posts: 10,045
Threads: 1,506
Joined: 2008-06
Gender: Male
Sexual Orientation: Straight
Country Flag: usa
IGN: GuavaCowboy
Server: Zenith
Level: 10x
Job: Jett
Guild: L>
Test Mushroom
Posts: 10,045
Threads: 1,506
Joined: 2008-06
Gender: Male
Sexual Orientation: Straight
Country Flag: usa
IGN: GuavaCowboy
Server: Zenith
Level: 10x
Job: Jett
Guild: L>
I finished out the formula.
There are some parts of it that I left out because I couldn't figure it out. For example, I think there are further PDD penalties for being below the mob's level or the mob being a boss. This calculation should prove useful for +90% of mobs, though.
A few things to take from the formula:
1. The mob will never do more damage than its attack value states unless it's being buffed by a friend.
2. Threaten works on enemy attack before any mob calculations are taken place.
3. Achilles and Combo Barrier work after the damage is calculated and reduced.
Another fun fact - Threaten will work on bosses, but the code expressly forbids Threaten from working on any mob that begins with "882". This number represents Pink Bean and, should Nexon ever have the cojones to create it, Chaos Pink Bean.
Posting Freak
Posts: 9,882
Threads: 342
Joined: 2009-01
Fiel Wrote:Base Magic and Physical Accuracy are calculated differently:
Base Magic Accuracy = INT + LUK * 1.2
Base Magic Avoid = INT + LUK * 2
Base Magic Defense = STR * 0.4 + (DEX + LUK) * 0.5 + INT * 1.2
Base Physical Accuracy = LUK + DEX * 1.2
Base Physical Avoid = DEX + LUK * 2
Base Physical Defense = INT * 0.4 + (LUK + DEX) * 0.5 + STR * 1.2
Brawlers don't get a hax physical avoid formula anymore or just not worth the trouble to scrounge through for one class's mechanics? Somewhat disappoint if it is.
Senior Member
Posts: 365
Threads: 7
Joined: 2009-08
Now if we can find out how much damage is reduced by defense (assuming it too is changed). Paladins already will have uber defensive since max STR (23 DEX, 4 INT/LUK) provides 1214 weapon defense base according to the formulas above. That's a 607 damage reduction if the system is the same. with crazy potential items, it is possible to get over 4000 defense. Paladins get Shield Mastery which, if it works the way I translated, will triple your defense while wearing a shield. Is there something I'm missing? 12,000 defense is crazy since it would require monsters to have 6,002 attack power to cause more than a point of damage. There's probably a lot I'm wrong with, so I could really use some aid with this.
EDIT:
With those stats pre-BB, he would have 5,397 weapon defense post-BB at level 200.
Test Mushroom
Posts: 10,045
Threads: 1,506
Joined: 2008-06
Gender: Male
Sexual Orientation: Straight
Country Flag: usa
IGN: GuavaCowboy
Server: Zenith
Level: 10x
Job: Jett
Guild: L>
Uhhh, that is included with the original post. PDD = WDEF.
|