- Joined
- Aug 20, 2009
- Messages
- 1,554
I have these formulas to determine the player's magical attack damage.
this is written in C.
there is no compiler error, but the values are wrong in-game.
I wrote the formula first in Microsoft Excel, and paste it as the formula.
While I was expecting the same result as the Excel file, it does not go as intended.
While level is 75, int is 99, dex is 41, and the rest is 1 (Str, luk, agi, vit)
it is supposed to result as (Matk Min) 545 (Matk Max) 716 (As in excel file)
but in-game, it results to around 300. why..?
Someone please help me, it does not fix no matter how much I tried
This is really frustrating. :/
Please help!
Original Excel File :
If it helps at all.
http://www.hiveworkshop.com/forums/pastebin.php?id=51iifg
this is written in C.
there is no compiler error, but the values are wrong in-game.
I wrote the formula first in Microsoft Excel, and paste it as the formula.
While I was expecting the same result as the Excel file, it does not go as intended.
unsigned short status_base_matk(const struct status_data* status, int level){ return (status->int_*2)+(status->int_/2)+(status->dex/4)+(status->luk/3)+(level/2); }
float fint = status->int_;
float fdex = status->dex;
float fluk = status->luk;
float flevel = level;
float fbmatk = status_base_matk(status, level);
float fmatkmaxmod = ((fint/3) + (fdex/6) + (fluk/4));
float fmatkminmod = ((fint/4) + (fdex/8) + (fluk/6));
status->matk_max = (flevel + 20 + (fbmatk*((float)(11)/10))) + ((flevel/125) * ((fmatkmaxmod * fbmatk)/18));
status->matk_min = ((flevel/2) + 10 + fbmatk) + ((flevel/150) * ((fmatkmaxmod * fbmatk)/22));
While level is 75, int is 99, dex is 41, and the rest is 1 (Str, luk, agi, vit)
it is supposed to result as (Matk Min) 545 (Matk Max) 716 (As in excel file)
but in-game, it results to around 300. why..?
Someone please help me, it does not fix no matter how much I tried
This is really frustrating. :/
Please help!
Original Excel File :
If it helps at all.
http://www.hiveworkshop.com/forums/pastebin.php?id=51iifg
Problem solved!.
After looking the GUI display a few codes ahead,
It was taking status_base_matk directly (thus resulting 310)
rather than taking the min and max of the values.
I am sorry guys, my bad!.
The formula wasn't wrong at all.
Solved.
Last edited: