summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/map.h5
-rw-r--r--src/map/pc.c18
-rw-r--r--src/map/status.c37
3 files changed, 19 insertions, 41 deletions
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