summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-01 14:40:49 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-04-01 14:40:49 +0000
commit11aa43448a18e4334f6ddc89711d15f73273484d (patch)
tree1c7dfa37df1c89642ca5f6f529b4f116e8435f90
parentb11dfba7a7ce1b7b5cfd114c066c0eb8614958c4 (diff)
downloadhercules-11aa43448a18e4334f6ddc89711d15f73273484d.tar.gz
hercules-11aa43448a18e4334f6ddc89711d15f73273484d.tar.bz2
hercules-11aa43448a18e4334f6ddc89711d15f73273484d.tar.xz
hercules-11aa43448a18e4334f6ddc89711d15f73273484d.zip
- Removed bonus 'bAspdAddRate'. bAspdRate now behaves on a stackable matter, so it's no longer needed.
- Reimplemented the bonus 'bAspd' - Renamed variable aspd_add_rate to aspd_add, since bAspdAddRate was removed, this variable now holds the absolute aspd bonuses. - Added define status_base_amotion_pc to get the base amotion value. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10107 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt4
-rw-r--r--db/const.txt2
-rw-r--r--src/map/map.h5
-rw-r--r--src/map/pc.c18
-rw-r--r--src/map/status.c37
5 files changed, 24 insertions, 42 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 2c2df8c03..d6fe0a309 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.
+2007/04/02
+ * Removed bonus 'bAspdAddRate'. bAspdRate now behaves on a stackable
+ matter, so it's no longer needed.
+ * Reimplemented the bonus 'bAspd' (raw Aspd increase) [Skotlex]
2007/03/31
* Added all the missing defines for ctype.h functions and converted all
the direct uses to the defines. [FlavioJS]
diff --git a/db/const.txt b/db/const.txt
index 46ec509e8..6aad5661e 100644
--- a/db/const.txt
+++ b/db/const.txt
@@ -302,7 +302,7 @@ bIgnoreDefEle 1026
bIgnoreDefRace 1027
bAtkRate 1028
bSpeedAddRate 1029
-bAspdAddRate 1030
+
bMagicAtkDef 1031
bMiscAtkDef 1032
bIgnoreMdefEle 1033
diff --git a/src/map/map.h b/src/map/map.h
index 5e8b788bd..14fbf6e31 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -704,7 +704,7 @@ struct map_session_data {
int hp_loss_rate;
int sp_loss_rate;
int classchange; // [Valaris]
- int speed_add_rate, aspd_add_rate;
+ int 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;
@@ -1149,7 +1149,7 @@ enum _sp {
SP_CRITICAL_DEF,SP_NEAR_ATK_DEF,SP_LONG_ATK_DEF, // 1019-1021
SP_DOUBLE_RATE, SP_DOUBLE_ADD_RATE, SP_FREE2, SP_MATK_RATE, // 1022-1025
SP_IGNORE_DEF_ELE,SP_IGNORE_DEF_RACE, // 1026-1027
- SP_ATK_RATE,SP_SPEED_ADDRATE,SP_ASPD_ADDRATE, // 1028-1030
+ SP_ATK_RATE,SP_SPEED_ADDRATE,SP_FREE3, // 1028-1030
SP_MAGIC_ATK_DEF,SP_MISC_ATK_DEF, // 1031-1032
SP_IGNORE_MDEF_ELE,SP_IGNORE_MDEF_RACE, // 1033-1034
SP_MAGIC_ADDELE,SP_MAGIC_ADDRACE,SP_MAGIC_ADDSIZE, // 1035-1037
@@ -1179,6 +1179,7 @@ enum _sp {
SP_ADD_SKILL_BLOW, SP_SP_VANISH_RATE //2041
//Before adding another, note that these are free:
//1024 (SP_FREE2, previous matk)
+ //1030 (SP_FREE3, previous AspdAddRate)
//2022 (SP_FREE, previous bDefIgnoreMob)
};
diff --git a/src/map/pc.c b/src/map/pc.c
index 2c473eec2..6f9a3c4d8 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1528,20 +1528,12 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
sd->speed_add_rate -= val;
break;
case SP_ASPD: //Raw increase
-// if(sd->state.lr_flag != 2)
-// status->amotion -= val*10;
- if (battle_config.error_log)
- ShowError("pc_bonus: bonus bAspd is no longer supported!\n");
- break;
- case SP_ASPD_RATE: //Non stackable increase
- if(val >= 0) { //Let negative ASPD bonuses become AddRate ones.
- if(sd->state.lr_flag != 2 && status->aspd_rate > 1000-val*10)
- status->aspd_rate = 1000-val*10;
- break;
- }
- case SP_ASPD_ADDRATE: //Stackable increase - Made it linear as per rodatazone
if(sd->state.lr_flag != 2)
- sd->aspd_add_rate -= val;
+ sd->aspd_add -= 10*val;
+ break;
+ case SP_ASPD_RATE: //Stackable increase - Made it linear as per rodatazone
+ if(sd->state.lr_flag != 2)
+ status->aspd_rate -= 10*val;
break;
case SP_HP_RECOV_RATE:
if(sd->state.lr_flag != 2)
diff --git a/src/map/status.c b/src/map/status.c
index 8d4084f28..d1442e4bf 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -1170,6 +1170,14 @@ int status_check_visibility(struct block_list *src, struct block_list *target)
void status_calc_bl(struct block_list *bl, unsigned long flag);
+ // Basic ASPD value
+#define status_base_amotion_pc(sd,status) (sd->aspd_add + \
+ (sd->status.weapon < MAX_WEAPON_TYPE? \
+ (1000 -4*status->agi -status->dex)*aspd_base[sd->status.class_][sd->status.weapon]/1000:\
+ (1000 -4*status->agi -status->dex)*(\
+ aspd_base[sd->status.class_][sd->weapontype1]+\
+ aspd_base[sd->status.class_][sd->weapontype2])*2/3000))
+
static int status_base_atk(struct block_list *bl, struct status_data *status)
{
int flag = 0, str, dex, dstr;
@@ -1692,7 +1700,7 @@ int status_calc_pc(struct map_session_data* sd,int first)
+ sizeof(sd->sp_loss_rate)
+ sizeof(sd->classchange)
+ sizeof(sd->speed_add_rate)
- + sizeof(sd->aspd_add_rate)
+ + sizeof(sd->aspd_add)
+ sizeof(sd->setitem_hash)
+ sizeof(sd->setitem_hash2)
// shorts
@@ -1882,8 +1890,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->aspd_add_rate)
- status->aspd_rate += 10*sd->aspd_add_rate;
if(sd->speed_add_rate)
sd->speed_rate += sd->speed_add_rate;
@@ -2166,18 +2172,7 @@ int status_calc_pc(struct map_session_data* sd,int first)
// Unlike other stats, ASPD rate modifiers from skills/SCs/items/etc are first all added together, then the final modifier is applied
// Basic ASPD value
- if (sd->status.weapon < MAX_WEAPON_TYPE)
- i = (1000 -4*status->agi -status->dex)
- *aspd_base[sd->status.class_][sd->status.weapon]/1000;
- else
- i = ((
- (1000 -4*status->agi -status->dex)
- *aspd_base[sd->status.class_][sd->weapontype1]/1000
- )+(
- (1000 -4*status->agi -status->dex)
- *aspd_base[sd->status.class_][sd->weapontype2]/1000
- )) *2/3; //From what I read in rodatazone, 2/3 should be more accurate than 0.7 -> 140 / 200; [Skotlex]
-
+ i = status_base_amotion_pc(sd,status);
status->amotion = cap_value(i,battle_config.max_aspd,2000);
// Relative modifiers from passive skills
@@ -2696,18 +2691,8 @@ void status_calc_bl_sub_pc(struct map_session_data *sd, unsigned long flag)
}
if(flag&(SCB_ASPD|SCB_AGI|SCB_DEX)) {
flag|=SCB_ASPD;
- if (sd->status.weapon < MAX_WEAPON_TYPE)
- skill = (1000 -4*status->agi -status->dex)
- *aspd_base[sd->status.class_][sd->status.weapon]/1000;
- else
- skill = ((
- (1000 -4*status->agi -status->dex)
- *aspd_base[sd->status.class_][sd->weapontype1]/1000
- )+(
- (1000 -4*status->agi -status->dex)
- *aspd_base[sd->status.class_][sd->weapontype2]/1000
- )) *2/3;
+ skill = status_base_amotion_pc(sd,status);
status->aspd_rate = status_calc_aspd_rate(&sd->bl, &sd->sc , b_status->aspd_rate);
// Apply all relative modifiers