summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-07-06 03:46:00 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-07-06 03:46:00 +0000
commited6aaf0aa423a591b60626befda015997d3ea83c (patch)
treedc33d2be04f0057641c1f4550c5b4f6a121b259a /src
parente290f7f88054c00c44e00fc1e76fb158c549051e (diff)
downloadhercules-ed6aaf0aa423a591b60626befda015997d3ea83c.tar.gz
hercules-ed6aaf0aa423a591b60626befda015997d3ea83c.tar.bz2
hercules-ed6aaf0aa423a591b60626befda015997d3ea83c.tar.xz
hercules-ed6aaf0aa423a591b60626befda015997d3ea83c.zip
* Slight cleanup of item-based walk speed bonuses
- removed bSpeed bonus code (was just disabled until now) - changed speed_rate to use base value 0% instead of 100% git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12915 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/map.h3
-rw-r--r--src/map/pc.c10
-rw-r--r--src/map/pc.h4
-rw-r--r--src/map/status.c10
4 files changed, 9 insertions, 18 deletions
diff --git a/src/map/map.h b/src/map/map.h
index 03e96d831..afa63c182 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -289,7 +289,7 @@ enum _sp {
SP_MAGIC_ADDELE,SP_MAGIC_ADDRACE,SP_MAGIC_ADDSIZE, // 1035-1037
SP_PERFECT_HIT_RATE,SP_PERFECT_HIT_ADD_RATE,SP_CRITICAL_RATE,SP_GET_ZENY_NUM,SP_ADD_GET_ZENY_NUM, // 1038-1042
SP_ADD_DAMAGE_CLASS,SP_ADD_MAGIC_DAMAGE_CLASS,SP_ADD_DEF_CLASS,SP_ADD_MDEF_CLASS, // 1043-1046
- SP_ADD_MONSTER_DROP_ITEM,SP_DEF_RATIO_ATK_ELE,SP_DEF_RATIO_ATK_RACE,SP_ADD_SPEED, // 1047-1050
+ SP_ADD_MONSTER_DROP_ITEM,SP_DEF_RATIO_ATK_ELE,SP_DEF_RATIO_ATK_RACE,SP_FREE3, // 1047-1050
SP_HIT_RATE,SP_FLEE_RATE,SP_FLEE2_RATE,SP_DEF_RATE,SP_DEF2_RATE,SP_MDEF_RATE,SP_MDEF2_RATE, // 1051-1057
SP_SPLASH_RANGE,SP_SPLASH_ADD_RANGE,SP_AUTOSPELL,SP_HP_DRAIN_RATE,SP_SP_DRAIN_RATE, // 1058-1062
SP_SHORT_WEAPON_DAMAGE_RETURN,SP_LONG_WEAPON_DAMAGE_RETURN,SP_WEAPON_COMA_ELE,SP_WEAPON_COMA_RACE, // 1063-1066
@@ -316,6 +316,7 @@ enum _sp {
//Before adding new bonuses, reuse the currently free slots:
//2020 (SP_FREE) (previously SP_ADD_DAMAGE_BY_CLASS)
//2033 (SP_FREE2) (previously SP_ADDEFF_WHENHIT_SHORT)
+ //1050 (SP_FREE3) (previously SP_ADD_SPEED)
};
enum _look {
diff --git a/src/map/pc.c b/src/map/pc.c
index 08d91c24b..95c265fad 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1654,15 +1654,9 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
break;
}
break;
- case SP_ADD_SPEED: //Raw increase
- if(sd->state.lr_flag != 2) {
- bonus = status->speed - val;
- status->speed = cap_value(bonus, 0, USHRT_MAX);
- }
- break;
case SP_SPEED_RATE: //Non stackable increase
- if(sd->state.lr_flag != 2 && sd->speed_rate > 100-val)
- sd->speed_rate = 100-val;
+ if(sd->state.lr_flag != 2)
+ sd->speed_rate = min(sd->speed_rate, -val);
break;
case SP_SPEED_ADDRATE: //Stackable increase
if(sd->state.lr_flag != 2)
diff --git a/src/map/pc.h b/src/map/pc.h
index f09a45f35..81a1e9a75 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -247,7 +247,7 @@ struct map_session_data {
int break_weapon_rate,break_armor_rate;
int crit_atk_rate;
int classchange; // [Valaris]
- int speed_add_rate, aspd_add;
+ int speed_rate, speed_add_rate, aspd_add;
unsigned int setitem_hash, setitem_hash2; //Split in 2 because shift operations only work on int ranges. [Skotlex]
short splash_range, splash_add_range;
@@ -263,7 +263,7 @@ struct map_session_data {
int castrate,delayrate,hprate,sprate,dsprate;
int atk_rate;
- int speed_rate,hprecov_rate,sprecov_rate;
+ int hprecov_rate,sprecov_rate;
int matk_rate;
int critical_rate,hit_rate,flee_rate,flee2_rate,def_rate,def2_rate,mdef_rate,mdef2_rate;
diff --git a/src/map/status.c b/src/map/status.c
index cb04563f7..26b0f061b 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1643,7 +1643,6 @@ int status_calc_pc(struct map_session_data* sd,int first)
sd->castrate=100;
sd->delayrate=100;
sd->dsprate=100;
- sd->speed_rate = 100;
sd->hprecov_rate = 100;
sd->sprecov_rate = 100;
sd->atk_rate = sd->matk_rate = 100;
@@ -1757,6 +1756,7 @@ int status_calc_pc(struct map_session_data* sd,int first)
+ sizeof(sd->break_armor_rate)
+ sizeof(sd->crit_atk_rate)
+ sizeof(sd->classchange)
+ + sizeof(sd->speed_rate)
+ sizeof(sd->speed_add_rate)
+ sizeof(sd->aspd_add)
+ sizeof(sd->setitem_hash)
@@ -1939,8 +1939,6 @@ int status_calc_pc(struct map_session_data* sd,int first)
sd->double_rate += sd->double_add_rate;
sd->perfect_hit += sd->perfect_hit_add;
sd->splash_range += sd->splash_add_range;
- if(sd->speed_add_rate)
- sd->speed_rate += sd->speed_add_rate;
// Damage modifiers from weapon type
sd->right_weapon.atkmods[0] = atkmods[0][sd->weapontype1];
@@ -2194,10 +2192,8 @@ int status_calc_pc(struct map_session_data* sd,int first)
// ----- WALKING SPEED CALCULATION -----
- if(sd->speed_rate < 0)
- sd->speed_rate = 0;
- if(sd->speed_rate != 100)
- status->speed = status->speed*sd->speed_rate/100;
+ sd->speed_rate += sd->speed_add_rate;
+ status->speed += status->speed * sd->speed_rate/100;
// Relative modifiers from passive skills
if((sd->class_&MAPID_UPPERMASK) == MAPID_ASSASSIN && (skill=pc_checkskill(sd,TF_MISS))>0)