summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt4
-rw-r--r--doc/item_bonus.txt1
-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
6 files changed, 13 insertions, 19 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index d342b5636..e82fc6ce7 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -3,6 +3,10 @@ Date Added
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
+2008/07/06
+ * Slight cleanup of item-based walk speed bonuses [ultramage]
+ - removed bSpeed bonus code (was just disabled until now)
+ - changed speed_rate to use base value 0% instead of 100%
2008/07/05
* Moved the mob killmonster flag to a more appropriate area. (bugreport:1795) [SketchyPhoenix]
2008/07/04
diff --git a/doc/item_bonus.txt b/doc/item_bonus.txt
index 51da56a80..cfdc22e21 100644
--- a/doc/item_bonus.txt
+++ b/doc/item_bonus.txt
@@ -53,7 +53,6 @@ bonus bFlee,n; Flee + n
bonus bFleeRate,n; Flee + n%
bonus bFlee2,n; Perfect Dodge + n
bonus bFlee2Rate,n; Perfect Dodge + n%
-bonus bSpeed,n; Moving speed + n
bonus bSpeedRate,n; Moving speed + n% (only the highest among all is applied)
bonus bSpeedAddRate,n; Moving speed + n%
bonus bAspd,n; Attack speed + n
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)