summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-13 21:37:10 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-13 21:37:10 +0000
commita92c2e8b2d21660dea89d6c21cc33b5d11744c4f (patch)
tree32b60e479fd9f10785e48d0b953fee6469ba84d6 /src/map
parent4cbf988c6707a3cfee4376acad2f96c118fbe149 (diff)
downloadhercules-a92c2e8b2d21660dea89d6c21cc33b5d11744c4f.tar.gz
hercules-a92c2e8b2d21660dea89d6c21cc33b5d11744c4f.tar.bz2
hercules-a92c2e8b2d21660dea89d6c21cc33b5d11744c4f.tar.xz
hercules-a92c2e8b2d21660dea89d6c21cc33b5d11744c4f.zip
- Added battle config sc_def_rate which adjusts natural defense of characters against status changes.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5275 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/battle.c2
-rw-r--r--src/map/battle.h1
-rw-r--r--src/map/status.c10
3 files changed, 10 insertions, 3 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index f096ab117..35bc48183 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3828,6 +3828,7 @@ static const struct battle_data_short {
{ "allow_skill_without_day", &battle_config.allow_skill_without_day}, // [Komurka]
{ "skill_caster_check", &battle_config.skill_caster_check },
{ "status_cast_cancel", &battle_config.sc_castcancel },
+ { "status_def_rate", &battle_config.sc_def_rate },
};
static const struct battle_data_int {
@@ -4217,6 +4218,7 @@ void battle_set_defaults() {
battle_config.skill_caster_check = 1;
battle_config.sc_castcancel = 0;
+ battle_config.sc_def_rate = 100;
}
void battle_validate_conf() {
diff --git a/src/map/battle.h b/src/map/battle.h
index 5511f6bee..fc4af0788 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -419,6 +419,7 @@ extern struct Battle_Config {
unsigned short cell_stack_limit; // [Skotlex]
unsigned short skill_caster_check; // [Skotlex]
unsigned short sc_castcancel; // [Skotlex]
+ unsigned short sc_def_rate; // [Skotlex]
} battle_config;
void do_init_battle(void);
diff --git a/src/map/status.c b/src/map/status.c
index 5841c38d9..3efe688be 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -3587,16 +3587,19 @@ int status_get_sc_def(struct block_list *bl, int type)
return 0; //Effect that cannot be reduced? Likely a buff.
}
+ sc_def*=100; //Send it on the interval 0->10000
+ if (battle_config.sc_def_rate != 100)
+ sc_def = sc_def*battle_config.sc_def_rate/100;
+
sc = status_get_sc(bl);
if (sc && sc->count)
{
if (sc->data[SC_SCRESIST].timer != -1)
- sc_def += sc->data[SC_SCRESIST].val1; //Status resist
+ sc_def += 100*sc->data[SC_SCRESIST].val1; //Status resist
else if (sc->data[SC_SIEGFRIED].timer != -1)
- sc_def += sc->data[SC_SIEGFRIED].val2; //Status resistance.
+ sc_def += 100*sc->data[SC_SIEGFRIED].val2; //Status resistance.
}
- sc_def*=100; //Send it on the interval 0->10000
if(bl->type == BL_MOB && sc_def > 5000)
sc_def = 5000; //Are mobs really capped to 50% defense?
@@ -3726,6 +3729,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val
if (race)
rate -= rate*race/10000;
}
+
if (!(rand()%10000 < rate))
return 0;
}