Jump to content
  • 0
ThyroDree

Adding Limit or Cap Resistance, Reflect Chance, and Skill Delay

Question

  • How can I put CAP Resistance to a Certain Race? Example instead of 100% resist, i will only cap it to 50% even he/she has equipment with 100% resist.
  • Same goes to Reflect Change (Physical and Magical Reflect) to cap the limit only 50%
  • For Skill Delay, how can I set a general after cast delay cap to 50% (even he/she has equipment with 100% after cast delay, only 50% will apply due to capping.)

 

On my test server with Edit High Level and stat, I find some job became OP. That's why i think of capping makes it balance to other jobs.

Share this post


Link to post
Share on other sites

10 answers to this question

Recommended Posts

  • 1

Okay.
First of all: I'M STUPID!

Second of all: I'M STUPID!

And thirdly: I'M STUPID!

Change "max" to "min" and 150 back to 50....

 

Did I mention, that I'm stupid?

 

 

~Kenpachi

Share this post


Link to post
Share on other sites
  • 0

Hi.

 

  • Quote

    How can I put CAP Resistance to a Certain Race? Example instead of 100% resist, i will only cap it to 50% even he/she has equipment with 100% resist.


    In src/map/status.c -> function status_calc_pc_() find this line (#3099 in current release):
    status->copy(&sd->battle_status, bstatus);

    Add above (replace <your_race_here> with the race you want to modify):

    #ifdef RENEWAL
    	sd->race_tolerance[<your_race_here>] = max(sd->race_tolerance[<your_race_here>], 50);
    #else
    	sd->subrace[<your_race_here>] = max(sd->subrace[<your_race_here>], 50);
    #endif


     

  • Quote

    Same goes to Reflect Change (Physical and Magical Reflect) to cap the limit only 50%

    In src/map/pc.c -> function pc_bonus() find this block:

    		case SP_SHORT_WEAPON_DAMAGE_RETURN:
    			if(sd->state.lr_flag != 2)
    				sd->bonus.short_weapon_damage_return += val;
    			break;
    		case SP_LONG_WEAPON_DAMAGE_RETURN:
    			if(sd->state.lr_flag != 2)
    				sd->bonus.long_weapon_damage_return += val;
    			break;
    		case SP_MAGIC_DAMAGE_RETURN: //AppleGirl Was Here
    			if(sd->state.lr_flag != 2)
    				sd->bonus.magic_damage_return += val;
    			break;

    Replace it with:

    		case SP_SHORT_WEAPON_DAMAGE_RETURN:
    			if (sd->state.lr_flag != 2)
    				sd->bonus.short_weapon_damage_return += val;
    
    			sd->bonus.short_weapon_damage_return = max(sd->bonus.short_weapon_damage_return, 50);
    			break;
    		case SP_LONG_WEAPON_DAMAGE_RETURN:
    			if (sd->state.lr_flag != 2)
    				sd->bonus.long_weapon_damage_return += val;
    
    			sd->bonus.long_weapon_damage_return = max(sd->bonus.long_weapon_damage_return, 50);
    			break;
    		case SP_MAGIC_DAMAGE_RETURN: //AppleGirl Was Here
    			if (sd->state.lr_flag != 2)
    				sd->bonus.magic_damage_return += val;
    
    			sd->bonus.magic_damage_return = max(sd->bonus.magic_damage_return, 50);
    			break;


     

  • Quote

    For Skill Delay, how can I set a general after cast delay cap to 50% (even he/she has equipment with 100% after cast delay, only 50% will apply due to capping.)

    In src/map/status.c -> function status_calc_pc_() find this block:

    	//Underflow protections.
    	if(sd->dsprate < 0)
    		sd->dsprate = 0;
    	if(sd->castrate < 0)
    		sd->castrate = 0;
    	if(sd->delayrate < 0)
    		sd->delayrate = 0;
    	if(sd->hprecov_rate < 0)
    		sd->hprecov_rate = 0;
    	if(sd->sprecov_rate < 0)
    		sd->sprecov_rate = 0;

    Add below:

    	sd->delayrate = max(sd->delayrate, 50);

 

 

Don't forget to re-compile. 😉


~Kenpachi

 

Share this post


Link to post
Share on other sites
  • 0
2 hours ago, Kenpachi said:

Hi.

 


  • In src/map/status.c -> function status_calc_pc_() find this line (#3099 in current release):status->copy(&sd->battle_status, bstatus);
    
    status->copy(&sd->battle_status, bstatus);

    Add above (replace <your_race_here> with the race you want to modify):

    #ifdef RENEWAL sd->race_tolerance[<your_race_here>] = max(sd->race_tolerance[<your_race_here>], 50); #else sd->subrace[<your_race_here>] = max(sd->subrace[<your_race_here>], 50); #endif
    
    #ifdef RENEWAL
    	sd->race_tolerance[<your_race_here>] = max(sd->race_tolerance[<your_race_here>], 50);
    #else
    	sd->subrace[<your_race_here>] = max(sd->subrace[<your_race_here>], 50);
    #endif


     

  • In src/map/pc.c -> function pc_bonus() find this block:

    case SP_SHORT_WEAPON_DAMAGE_RETURN: if(sd->state.lr_flag != 2) sd->bonus.short_weapon_damage_return += val; break; case SP_LONG_WEAPON_DAMAGE_RETURN: if(sd->state.lr_flag != 2) sd->bonus.long_weapon_damage_return += val; break; case SP_MAGIC_DAMAGE_RETURN: //AppleGirl Was Here if(sd->state.lr_flag != 2) sd->bonus.magic_damage_return += val; break;
    
    		case SP_SHORT_WEAPON_DAMAGE_RETURN:
    			if(sd->state.lr_flag != 2)
    				sd->bonus.short_weapon_damage_return += val;
    			break;
    		case SP_LONG_WEAPON_DAMAGE_RETURN:
    			if(sd->state.lr_flag != 2)
    				sd->bonus.long_weapon_damage_return += val;
    			break;
    		case SP_MAGIC_DAMAGE_RETURN: //AppleGirl Was Here
    			if(sd->state.lr_flag != 2)
    				sd->bonus.magic_damage_return += val;
    			break;

    Replace it with:

    case SP_SHORT_WEAPON_DAMAGE_RETURN: if (sd->state.lr_flag != 2) sd->bonus.short_weapon_damage_return += val; sd->bonus.short_weapon_damage_return = max(sd->bonus.short_weapon_damage_return, 50); break; case SP_LONG_WEAPON_DAMAGE_RETURN: if (sd->state.lr_flag != 2) sd->bonus.long_weapon_damage_return += val; sd->bonus.long_weapon_damage_return = max(sd->bonus.long_weapon_damage_return, 50); break; case SP_MAGIC_DAMAGE_RETURN: //AppleGirl Was Here if (sd->state.lr_flag != 2) sd->bonus.magic_damage_return += val; sd->bonus.magic_damage_return = max(sd->bonus.magic_damage_return, 50); break;
    
    		case SP_SHORT_WEAPON_DAMAGE_RETURN:
    			if (sd->state.lr_flag != 2)
    				sd->bonus.short_weapon_damage_return += val;
    
    			sd->bonus.short_weapon_damage_return = max(sd->bonus.short_weapon_damage_return, 50);
    			break;
    		case SP_LONG_WEAPON_DAMAGE_RETURN:
    			if (sd->state.lr_flag != 2)
    				sd->bonus.long_weapon_damage_return += val;
    
    			sd->bonus.long_weapon_damage_return = max(sd->bonus.long_weapon_damage_return, 50);
    			break;
    		case SP_MAGIC_DAMAGE_RETURN: //AppleGirl Was Here
    			if (sd->state.lr_flag != 2)
    				sd->bonus.magic_damage_return += val;
    
    			sd->bonus.magic_damage_return = max(sd->bonus.magic_damage_return, 50);
    			break;


     

  • In src/map/status.c -> function status_calc_pc_() find this block:

    //Underflow protections. if(sd->dsprate < 0) sd->dsprate = 0; if(sd->castrate < 0) sd->castrate = 0; if(sd->delayrate < 0) sd->delayrate = 0; if(sd->hprecov_rate < 0) sd->hprecov_rate = 0; if(sd->sprecov_rate < 0) sd->sprecov_rate = 0;
    
    	//Underflow protections.
    	if(sd->dsprate < 0)
    		sd->dsprate = 0;
    	if(sd->castrate < 0)
    		sd->castrate = 0;
    	if(sd->delayrate < 0)
    		sd->delayrate = 0;
    	if(sd->hprecov_rate < 0)
    		sd->hprecov_rate = 0;
    	if(sd->sprecov_rate < 0)
    		sd->sprecov_rate = 0;

    Add below:

    sd->delayrate = max(sd->delayrate, 50);
    
    	sd->delayrate = max(sd->delayrate, 50);

 

 

Don't forget to re-compile. 😉


~Kenpachi

 

Thank you @Kenpachi will try this, sorry for reviving old topics :(

Share this post


Link to post
Share on other sites
  • 0

If i wanted on all race, 

#ifdef RENEWAL
	sd->race_tolerance[RC_ALL] = max(sd->race_tolerance[RC_ALL], 50);
#else
	sd->subrace[RC_ALL] = max(sd->subrace[RC_ALL], 50);
#endif

this will make max resist for all Race only 50% right? EDIT: Doesn;t work with RC_ALL (added each one of Race, excluding 

RC_NonDemiHuman,RC_NonPlayer,RC_DemiPlayer,RC_NonDemiPlayer,RC_All which gives me problem compiling when those are included.)

Also, im currently using Pre Renewal, does this work also on pre renewal if compiled?

Edited by ThyroDree
Addition question, tried RC_ALL

Share this post


Link to post
Share on other sites
  • 0
Quote

this will make max resist for all Race only 50% right?

No, since you can't use RC_ALL.

 

 

Quote

EDIT: Doesn;t work with RC_ALL (added each one of Race, excluding 

RC_NonDemiHuman,RC_NonPlayer,RC_DemiPlayer,RC_NonDemiPlayer,RC_All which gives me problem compiling when those are included.)

You can only use the following races. The other ones are combined types.

RC_FORMLESS	///< Formless
RC_UNDEAD	///< Undead
RC_BRUTE	///< Beast/Brute
RC_PLANT	///< Plant
RC_INSECT	///< Insect
RC_FISH		///< Fish
RC_DEMON	///< Demon
RC_DEMIHUMAN	///< Demi-Human (not including Player)
RC_ANGEL	///< Angel
RC_DRAGON	///< Dragon
RC_PLAYER	///< Player
RC_BOSS		///< Boss
RC_NONBOSS	///< Non-boss

 

 

Quote

Also, im currently using Pre Renewal, does this work also on pre renewal if compiled?

Yes.  The renewal code won't be compiled. But if you want to, you can add only pre-RE code. (Note the 'n' in #ifndef. This means "if NOT defined RENEWAL".)

#ifndef RENEWAL
	sd->subrace[RC_FORMLESS] = max(sd->subrace[RC_FORMLESS], 50);
	sd->subrace[RC_UNDEAD] = max(sd->subrace[RC_UNDEAD], 50);
	sd->subrace[RC_BRUTE] = max(sd->subrace[RC_BRUTE], 50);
	sd->subrace[RC_PLANT] = max(sd->subrace[RC_PLANT], 50);
	sd->subrace[RC_INSECT] = max(sd->subrace[RC_INSECT], 50);
	sd->subrace[RC_FISH] = max(sd->subrace[RC_FISH], 50);
	sd->subrace[RC_DEMON] = max(sd->subrace[RC_DEMON], 50);
	sd->subrace[RC_DEMIHUMAN] = max(sd->subrace[RC_DEMIHUMAN], 50);
	sd->subrace[RC_ANGEL] = max(sd->subrace[RC_ANGEL], 50);
	sd->subrace[RC_DRAGON] = max(sd->subrace[RC_DRAGON], 50);
	sd->subrace[RC_PLAYER] = max(sd->subrace[RC_PLAYER], 50);
	sd->subrace[RC_BOSS] = max(sd->subrace[RC_BOSS], 50);
	sd->subrace[RC_NONBOSS] = max(sd->subrace[RC_NONBOSS], 50);
#endif

 

 

~Kenpachi

Share this post


Link to post
Share on other sites
  • 0

Hi sir @Kenpachi,

about my previous request and just tested this.

Quote

How can I put CAP Resistance to a Certain Race? Example instead of 100% resist, i will only cap it to 50% even he/she has equipment with 100% resist.

I used this line on my status.c

#ifndef RENEWAL
	sd->subrace[RC_FORMLESS] = max(sd->subrace[RC_FORMLESS], 50);
	sd->subrace[RC_UNDEAD] = max(sd->subrace[RC_UNDEAD], 50);
	sd->subrace[RC_BRUTE] = max(sd->subrace[RC_BRUTE], 50);
	sd->subrace[RC_PLANT] = max(sd->subrace[RC_PLANT], 50);
	sd->subrace[RC_INSECT] = max(sd->subrace[RC_INSECT], 50);
	sd->subrace[RC_FISH] = max(sd->subrace[RC_FISH], 50);
	sd->subrace[RC_DEMON] = max(sd->subrace[RC_DEMON], 50);
	sd->subrace[RC_DEMIHUMAN] = max(sd->subrace[RC_DEMIHUMAN], 50);
	sd->subrace[RC_ANGEL] = max(sd->subrace[RC_ANGEL], 50);
	sd->subrace[RC_DRAGON] = max(sd->subrace[RC_DRAGON], 50);
	sd->subrace[RC_PLAYER] = max(sd->subrace[RC_PLAYER], 50);
	sd->subrace[RC_BOSS] = max(sd->subrace[RC_BOSS], 50);
	sd->subrace[RC_NONBOSS] = max(sd->subrace[RC_NONBOSS], 50);
#endif

This works but it resist all races already without equipping resist items / equipment.

(When this is uncommented in my status.c, my damage is someething line 5k~ish below with full equip, then tried disabling, it changed my damage to 10k-15k~)

 

 

Sorry it look like you misunderstood, sorry again for my bad explanation.

To make more simple, this is like one of my previous request. Like Capping or Limiting the healpower (limit to 100%, even equipping too much bacsojin card that may exceed 100%, it will only read up to 100% heal power) or after cast delay(limit to 50%, same even if exceeds the limit, it will only read 50%) . That is also the same with here for Resist Capping or Limiting.

 

Share this post


Link to post
Share on other sites
  • 0

Okay, I misunderstood you here. The code I posted caps the total tolerance at 50%, but - if I get it right - you want to cap the additional (respectively bonus) tolerance at 50%.

Now you have to be a bit more specific because the tolerances are modified by 3 different things:

  • Skills - for example Dragonology (SA_DRAGONOLOGY) or Eucharistica (AB_EUCHARISTICA)
  • Status changes - for example Skull Scroll (ID: 12745) (SC_SKELSCROLL) or Royal Scroll (ID: 12747) (SC_ROYALSCROLL)
  • Equipment bonuses - for example Weeder Knife (ID: 1227) or Combat Knife (ID: 1228)

 

If you don't want to distinguish between those 3 cases, you just have to replace the 50 with 150. This way the bonus tolerance is capped at 50% regardless of how the bones was applied.

Otherwise please tell me how to handle each case.

 

//BTW: I'll move this topic to the Source Support section.

 

 

~Kenpachi

Share this post


Link to post
Share on other sites
  • 0
#ifndef RENEWAL
	sd->subrace[RC_FORMLESS] = max(sd->subrace[RC_FORMLESS], 150);
	sd->subrace[RC_UNDEAD] = max(sd->subrace[RC_UNDEAD], 150);
	sd->subrace[RC_BRUTE] = max(sd->subrace[RC_BRUTE], 150);
	sd->subrace[RC_PLANT] = max(sd->subrace[RC_PLANT], 150);
	sd->subrace[RC_INSECT] = max(sd->subrace[RC_INSECT], 150);
	sd->subrace[RC_FISH] = max(sd->subrace[RC_FISH], 150);
	sd->subrace[RC_DEMON] = max(sd->subrace[RC_DEMON], 150);
	sd->subrace[RC_DEMIHUMAN] = max(sd->subrace[RC_DEMIHUMAN], 150);
	sd->subrace[RC_ANGEL] = max(sd->subrace[RC_ANGEL], 150);
	sd->subrace[RC_DRAGON] = max(sd->subrace[RC_DRAGON], 150);
	sd->subrace[RC_PLAYER] = max(sd->subrace[RC_PLAYER], 150);
	sd->subrace[RC_BOSS] = max(sd->subrace[RC_BOSS], 150);
	sd->subrace[RC_NONBOSS] = max(sd->subrace[RC_NONBOSS], 150);
#endif

Is this correct sir, tried to apply this lines damage still reduced without any resist equip,buff or stat.

The Storm Gust normal damage without this line is almost 15K, then with this line damage is only 7K.

 


 

Quote

 

Okay, I misunderstood you here. The code I posted caps the total tolerance at 50%, but - if I get it right - you want to cap the additional (respectively bonus) tolerance at 50%.

Now you have to be a bit more specific because the tolerances are modified by 3 different things: 

Skills - for example Dragonology (SA_DRAGONOLOGY) or Eucharistica (AB_EUCHARISTICA)

Status changes - for example Skull Scroll (ID: 12745) (SC_SKELSCROLL) or Royal Scroll (ID: 12747) (SC_ROYALSCROLL)

Equipment bonuses - for example Weeder Knife (ID: 1227) or Combat Knife (ID: 1228)

 

yes, like all subrace resist from Skill, Status Changes, and Equipment Resist will be capped 50%

Share this post


Link to post
Share on other sites
  • 0
27 minutes ago, Kenpachi said:

Okay.
First of all: I'M STUPID!

Second of all: I'M STUPID!

And thirdly: I'M STUPID!

Change "max" to "min" and 150 back to 50....

 

Did I mention, that I'm stupid?

 

 

~Kenpachi

No, didn't saw that min max too --

Well your not, you helped me alot!

Will try this~

Share this post


Link to post
Share on other sites
  • 0

This works, thanks!

#ifndef RENEWAL
	sd->subrace[RC_FORMLESS] = min(sd->subrace[RC_FORMLESS], 50);
	sd->subrace[RC_UNDEAD] = min(sd->subrace[RC_UNDEAD], 50);
	sd->subrace[RC_BRUTE] = min(sd->subrace[RC_BRUTE], 50);
	sd->subrace[RC_PLANT] = min(sd->subrace[RC_PLANT], 50);
	sd->subrace[RC_INSECT] = min(sd->subrace[RC_INSECT], 50);
	sd->subrace[RC_FISH] = min(sd->subrace[RC_FISH], 50);
	sd->subrace[RC_DEMON] = min(sd->subrace[RC_DEMON], 50);
	sd->subrace[RC_DEMIHUMAN] = min(sd->subrace[RC_DEMIHUMAN], 50);
	sd->subrace[RC_ANGEL] = min(sd->subrace[RC_ANGEL], 50);
	sd->subrace[RC_DRAGON] = min(sd->subrace[RC_DRAGON], 50);
	sd->subrace[RC_PLAYER] = min(sd->subrace[RC_PLAYER], 50);
	sd->subrace[RC_BOSS] = min(sd->subrace[RC_BOSS], 50);
	sd->subrace[RC_NONBOSS] = min(sd->subrace[RC_NONBOSS], 50);
#endif

 

Edited by ThyroDree

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...

×
×
  • Create New...

Important Information

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