Jump to content
  • 0
Sign in to follow this  
joecalis

Custom Passive Skill (Incease MATK)

Question

So I've been working on a couple of passive skills, all were fine except for this one.

I'm not gonna post all the codes in diff files because there are just too many, but here

is the part I am mostly having a problem on.

 

I need to have this skill add 1% Base MATK (the first number that shows in the stat window under MATK) every skill level heres what I have in Status.c

 

// ----- MATK CALCULATION -----if((skill_lv=pc->checkskill(sd,CS_MATK_MASTERY))>0){	bstatus->matk_min += (int)status->base_matk(bstatus,sd->status.base_level)*skill_lv/100;	if(bstatus->matk_min > bstatus->matk_max)		bstatus->matk_max = bstatus->matk_min;}

if you are wondering the

 

(int)status->base_matk(bstatus,sd->status.base_level)*skill_lv/100;

part is just to get the characters current base_matk which works perfectly fine as I have tried it.

The part I am so confuzzled about is changing "bstatus->matk_min" or "bstatus->matk_max" does not change the character's current matk stat.

But "bstatus->batk" and all other "bstatus->etc." works except for matk_min and matk_max.

 

So my question is which is the right "bstatus" or any other code thingamajigie to change to be able to modify my character's current matk which shows at the stat window?

Edited by joecalis

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

NVM I figured it out, it turned out that "status->base_matk" actually calculates and sets the char's base matk.

I modified a few things to make the passive work, I will share what I did for people who wants to do the same thing I did.

 

in status.c

find:

unsigned short status_base_matk(const struct status_data *st, int level) {#ifdef RENEWAL    return st->int_+(st->int_/2)+(st->dex/5)+(st->luk/3)+(level/4);#else    return 0;#endif}

change to:

unsigned short status_base_matk(const struct status_data *st, int level, struct map_session_data *sd) {int skill_lv, total = 0;#ifdef RENEWAL	total = st->int_+(st->int_/2)+(st->dex/5)+(st->luk/3)+(level/4);	if((skill_lv=pc->checkskill(sd,CS_MATK_MASTERY))>0)		total += total*skill_lv/100;	return total;#else	return 0;#endif}

find:

st->matk_min = st->matk_max = bl->type == BL_PC ? status->base_matk(st, level) : level + st->int_;

change to:

st->matk_min = st->matk_max = bl->type == BL_PC ? status->base_matk(st, level, sd) : level + st->int_;

find:

*matk_min = status->base_matk(st, status->get_lv(bl));

change to:

*matk_min = status->base_matk(st, status->get_lv(bl), sd);

 

in status.h

find:

unsigned short (*base_matk) (const struct status_data *st, int level);

change to:

unsigned short (*base_matk) (const struct status_data *st, int level, struct map_session_data *sd);

 

in pc.h

find:

#define pc_leftside_matk(sd) (status->base_matk(status->get_status_data(&(sd)->bl), (sd)->status.base_level))

change to:

#define pc_leftside_matk(sd) (status->base_matk(status->get_status_data(&(sd)->bl), (sd)->status.base_level, (sd)))

 

in skill.c

find:

heal = 5 * status->get_lv(&hd->bl) + status->base_matk(&hd->battle_status, status->get_lv(&hd->bl));

change to:

heal = 5 * status->get_lv(&hd->bl) + status->base_matk(&hd->battle_status, status->get_lv(&hd->bl),sd);

 

Share this post


Link to post
Share on other sites
  • 0

min_matk and max_matk are hidden attribute of a player if your using renewal..therefore the value in the stat window is the base matk..

 

:meow:

Share this post


Link to post
Share on other sites
  • 0

So which is the right code to change the base matk because there is no "bstatus->base_matk" and the base_matk I used to get the char's current base matk is a function not a bstatus data therefore I could not change it's value.

Edited by joecalis

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.