From 848708ccba75077e519c745cf036f5ddb594ad50 Mon Sep 17 00:00:00 2001 From: skotlex Date: Wed, 14 Jun 2006 20:10:36 +0000 Subject: - Modified how luk reduces status changes by reducing the gap. Eg: resist = vit; resist += (max - resist)*luk/300; - Added battle settings pc_max_sc_luk/mob_max_sc_luk to handle which is the luk threshold at which you gain inmunity (defaults to 300). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7168 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/status.c | 54 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 19 deletions(-) (limited to 'src/map/status.c') diff --git a/src/map/status.c b/src/map/status.c index 7872771b9..1dd982372 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -3839,6 +3839,8 @@ int status_get_sc_def(struct block_list *bl, int type) int sc_def; struct status_data* status; struct status_change* sc; + struct map_session_data *sd; + nullpo_retr(0, bl); //Status that are blocked by Golden Thief Bug card or Wand of Hermod @@ -3877,16 +3879,16 @@ int status_get_sc_def(struct block_list *bl, int type) case SC_DPOISON: case SC_SILENCE: case SC_BLEEDING: - sc_def = 300 +100*status->vit +10*status->luk; + sc_def = 300 +100*status->vit; break; case SC_SLEEP: - sc_def = 300 +100*status->int_ +10*status->luk; + sc_def = 300 +100*status->int_; break; case SC_STONE: case SC_FREEZE: case SC_DECREASEAGI: case SC_COMA: - sc_def = 300 +100*status->mdef +10*status->luk; + sc_def = 300 +100*status->mdef; break; case SC_CURSE: if (status->luk > status_get_lv(bl)) @@ -3895,21 +3897,44 @@ int status_get_sc_def(struct block_list *bl, int type) sc_def = 300 +100*status->luk; break; case SC_BLIND: //TODO: These 50/50 factors are guessed. Need to find actual value. - sc_def = 300 +50*status->vit +50*status->int_ +10*status->luk; + sc_def = 300 +50*status->vit +50*status->int_; break; case SC_CONFUSION: - sc_def = 300 +50*status->str +50*status->int_ +10*status->luk; + sc_def = 300 +50*status->str +50*status->int_; break; default: return 0; //Effect that cannot be reduced? Likely a buff. } - if (bl->type == BL_PC) { + BL_CAST(BL_PC,bl,sd); + + if (sd) { + if (battle_config.pc_sc_def_rate != 100) sc_def = sc_def*battle_config.pc_sc_def_rate/100; - } else - if (battle_config.mob_sc_def_rate != 100) - sc_def = sc_def*battle_config.mob_sc_def_rate/100; + + if(SC_COMMON_MIN<=type && type<=SC_COMMON_MAX + && sd->reseff[type-SC_COMMON_MIN] > 0) + sc_def+= sd->reseff[type-SC_COMMON_MIN]; + + if (sc_def < battle_config.pc_max_sc_def) + sc_def += (battle_config.pc_max_sc_def - sc_def)* + status->luk/battle_config.pc_luk_sc_def; + else + sc_def = battle_config.pc_max_sc_def; + + } else { + + if (battle_config.mob_sc_def_rate != 100) + sc_def = sc_def*battle_config.mob_sc_def_rate/100; + + if (sc_def < battle_config.mob_max_sc_def) + sc_def += (battle_config.mob_max_sc_def - sc_def)* + status->luk/battle_config.mob_luk_sc_def; + else + sc_def = battle_config.mob_max_sc_def; + + } sc = status_get_sc(bl); if (sc && sc->count) @@ -3920,13 +3945,7 @@ int status_get_sc_def(struct block_list *bl, int type) sc_def += 100*sc->data[SC_SIEGFRIED].val3; //Status resistance. } - if(bl->type == BL_PC) { - if (sc_def > battle_config.pc_max_sc_def) - sc_def = battle_config.pc_max_sc_def; - } else if (sc_def > battle_config.mob_max_sc_def) - sc_def = battle_config.mob_max_sc_def; - - return sc_def; + return sc_def>10000?10000:sc_def; } //Reduces tick delay based on type and character defenses. @@ -4058,9 +4077,6 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val if (!(flag&(4|1))) { int def; def = flag&8?0:status_get_sc_def(bl, type); //recycling race to store the sc_def value. - //sd resistance applies even if the flag is &8 - if(sd && SC_COMMON_MIN<=type && type<=SC_COMMON_MAX && sd->reseff[type-SC_COMMON_MIN] > 0) - def+= sd->reseff[type-SC_COMMON_MIN]; if (def) rate -= rate*def/10000; -- cgit v1.2.3-70-g09d2