I'm trying to change the original formula that gives you Magic Attack based on INT.
So far I'm having trouble on this one and would like to use my formula:
Quote
Min Magic Attack = INT + ((INT/6) * (INT/6)) + (DEX*3/5)
Max Magic Attack = INT + ((INT/5) * (INT/5)) + (LUK*3/5)
Reading Status.c, I found the following original code line:
* Calculates minimum magic attack
*/
unsigned short status_base_matk_min(struct block_list *bl, const struct status_data* status, int level)
{
switch (bl->type) {
case BL_PET:
case BL_MOB:
case BL_MER:
case BL_ELEM:
return status->int_ + level + status->rhw.matk * 70 / 100;
case BL_HOM:
return status_get_homint(bl) + level + (status_get_homint(bl) + status_get_homdex(bl)) / 5;
case BL_PC:
default:
return status->int_ + (status->int_ / 2) + (status->dex / 5) + (status->luk / 3) + (level / 4);
}
}
/*
* Calculates maximum magic attack
*/
unsigned short status_base_matk_max(struct block_list *bl, const struct status_data* status, int level)
{
switch (bl->type) {
case BL_PET:
case BL_MOB:
case BL_MER:
case BL_ELEM:
return status->int_ + level + status->rhw.matk * 130 / 100;
case BL_HOM:
return status_get_homint(bl) + level + (status_get_homluk(bl) + status_get_homint(bl) + status_get_homdex(bl)) / 3;
case BL_PC:
default:
return status->int_ + (status->int_ / 2) + (status->dex / 5) + (status->luk / 3) + (level / 4);
}
}
#endif
I tried many different ways to tweak the code, but so far I got no lucky understanding how Am I suppose to modify it to get Magic Attack from 3 different sources.
My final attempt was to give up using the Pre-RE structure and replacing for the Renewal. Then I modified like this:
By doing so, the game reads as If I haven't changed anything. When I copy/paste the RENEWAL formula right after the #else, the game loads using RENWAL formulas, and they work.
I need some light and I really appreciate any help
Question
kyenard
I'm trying to change the original formula that gives you Magic Attack based on INT.
So far I'm having trouble on this one and would like to use my formula:
Reading Status.c, I found the following original code line:
* Calculates minimum magic attack */ unsigned short status_base_matk_min(struct block_list *bl, const struct status_data* status, int level) { switch (bl->type) { case BL_PET: case BL_MOB: case BL_MER: case BL_ELEM: return status->int_ + level + status->rhw.matk * 70 / 100; case BL_HOM: return status_get_homint(bl) + level + (status_get_homint(bl) + status_get_homdex(bl)) / 5; case BL_PC: default: return status->int_ + (status->int_ / 2) + (status->dex / 5) + (status->luk / 3) + (level / 4); } } /* * Calculates maximum magic attack */ unsigned short status_base_matk_max(struct block_list *bl, const struct status_data* status, int level) { switch (bl->type) { case BL_PET: case BL_MOB: case BL_MER: case BL_ELEM: return status->int_ + level + status->rhw.matk * 130 / 100; case BL_HOM: return status_get_homint(bl) + level + (status_get_homluk(bl) + status_get_homint(bl) + status_get_homdex(bl)) / 3; case BL_PC: default: return status->int_ + (status->int_ / 2) + (status->dex / 5) + (status->luk / 3) + (level / 4); } } #endif
I tried many different ways to tweak the code, but so far I got no lucky understanding how Am I suppose to modify it to get Magic Attack from 3 different sources.
My final attempt was to give up using the Pre-RE structure and replacing for the Renewal. Then I modified like this:
#ifndef RENEWAL unsigned short status_base_matk_min(const struct status_data* status) { return status->int_ + (status->int_ / 7) * (status->int_ / 7); } unsigned short status_base_matk_max(const struct status_data* status) { return status->int_ + (status->int_ / 5) * (status->int_ / 5); } #else unsigned short status_base_matk_min(const struct status_data* status) { return (status->int_) + ((status->int_ / 6) * (status->int_ / 6)) + (status->dex*6/5); } unsigned short status_base_matk_max(const struct status_data* status) { return (status->int_) + ((status->int_ / 6) * (status->int_ * 25/96)) + (status->luk*6/5); }
By doing so, the game reads as If I haven't changed anything. When I copy/paste the RENEWAL formula right after the #else, the game loads using RENWAL formulas, and they work.
I need some light and I really appreciate any help
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.