summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-01-07 07:28:20 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-01-07 07:28:20 +0000
commitec655a58ffb1dc5d37a504aaac51f5393a1a81fb (patch)
treec3ae2a16fe13e388c611f1d9ef2003b15db01c54 /src
parent33c337fcfdde9e71a15b4f6856d1c22ce1b6a9bc (diff)
downloadhercules-ec655a58ffb1dc5d37a504aaac51f5393a1a81fb.tar.gz
hercules-ec655a58ffb1dc5d37a504aaac51f5393a1a81fb.tar.bz2
hercules-ec655a58ffb1dc5d37a504aaac51f5393a1a81fb.tar.xz
hercules-ec655a58ffb1dc5d37a504aaac51f5393a1a81fb.zip
* Added 'bDelayrate' and changed Phen card, Marduk Card and Berzebub Card's effects to use this
* Some tidying up of skill_castfix and skill_delayfix git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@928 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/map.h8
-rw-r--r--src/map/pc.c5
-rw-r--r--src/map/skill.c17
3 files changed, 17 insertions, 13 deletions
diff --git a/src/map/map.h b/src/map/map.h
index acc285d67..99e4b5285 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -240,7 +240,7 @@ struct map_session_data {
int watk,watk2,atkmods[3];
int def,def2,mdef,mdef2,critical,matk1,matk2;
int atk_ele,def_ele,star,overrefine;
- int castrate,hprate,sprate,dsprate;
+ int castrate,delayrate,hprate,sprate,dsprate;
int addele[10],addrace[12],addsize[3],subele[10],subrace[12];
int addeff[10],addeff2[10],reseff[10];
int watk_,watk_2,atkmods_[3],addele_[10],addrace_[12],addsize_[3]; //“ρ“—¬‚Μ‚½‚ί‚Ι’Η‰Α
@@ -616,11 +616,11 @@ enum {
SP_DISGUISE,SP_CLASSCHANGE, // 1077-1078
SP_HP_DRAIN_VALUE,SP_SP_DRAIN_VALUE, // 1079-1080
SP_WEAPON_ATK,SP_WEAPON_ATK_RATE, // 1081-1082
+ SP_DELAYRATE, // 1083
SP_RESTART_FULL_RECORVER=2000,SP_NO_CASTCANCEL,SP_NO_SIZEFIX,SP_NO_MAGIC_DAMAGE,SP_NO_WEAPON_DAMAGE,SP_NO_GEMSTONE, // 2000-2005
- SP_NO_CASTCANCEL2,SP_INFINITE_ENDURE,SP_UNBREAKABLE_WEAPON,SP_UNBREAKABLE_ARMOR, SP_UNBREAKABLE_HELM,
- SP_UNBREAKABLE_SHIELD, // 2006-2011
- SP_LONG_ATK_RATE // 2012 - celest
+ SP_NO_CASTCANCEL2,SP_INFINITE_ENDURE,SP_UNBREAKABLE_WEAPON,SP_UNBREAKABLE_ARMOR, SP_UNBREAKABLE_HELM, // 2006-2010
+ SP_UNBREAKABLE_SHIELD, SP_LONG_ATK_RATE // 2011-2012
};
enum {
diff --git a/src/map/pc.c b/src/map/pc.c
index 7fff1f1ae..eb22b8376 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1296,6 +1296,7 @@ int pc_calcstatus(struct map_session_data* sd,int first)
sd->hprate=battle_config.hp_rate;
sd->sprate=battle_config.sp_rate;
sd->castrate=100;
+ sd->delayrate=100;
sd->dsprate=100;
sd->base_atk=0;
sd->arrow_atk=0;
@@ -2722,6 +2723,10 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
if(sd->status.weapon == 11 && sd->state.lr_flag != 2)
sd->atk_rate += val;
break;
+ case SP_DELAYRATE:
+ if(sd->state.lr_flag != 2)
+ sd->delayrate+=val;
+ break;
default:
if(battle_config.error_log)
printf("pc_bonus: unknown type %d %d !\n",type,val);
diff --git a/src/map/skill.c b/src/map/skill.c
index c767d9f15..cf99a8615 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -7398,7 +7398,6 @@ int skill_castfix( struct block_list *bl, int time )
struct map_session_data *sd = NULL;
struct mob_data *md; // [Valaris]
struct status_change *sc_data;
- int dex;
int castrate=100;
int skill,lv;
@@ -7417,7 +7416,6 @@ int skill_castfix( struct block_list *bl, int time )
if(lv <= 0) return 0;
sc_data = battle_get_sc_data(bl);
- dex=battle_get_dex(bl);
if (skill > MAX_SKILL_DB || skill < 0)
return 0;
@@ -7430,11 +7428,9 @@ int skill_castfix( struct block_list *bl, int time )
if(time==0)
return 0;
if (sd) {
- if(skill_get_castnodex(skill, lv) > 0)
+ if(!skill_get_castnodex(skill, lv) > 0) {
castrate=((struct map_session_data *)bl)->castrate;
- else {
- castrate=((struct map_session_data *)bl)->castrate;
- time=time*castrate*(battle_config.castrate_dex_scale - dex)/(battle_config.castrate_dex_scale * 100);
+ time=time*castrate*(battle_config.castrate_dex_scale - battle_get_dex(bl))/(battle_config.castrate_dex_scale * 100);
time=time*battle_config.cast_rate/100;
}
}
@@ -7455,6 +7451,7 @@ int skill_delayfix( struct block_list *bl, int time )
struct status_change *sc_data;
struct map_session_data *sd = NULL;
int skill,lv = 0;
+ int delayrate=100;
nullpo_retr(0, bl);
@@ -7473,12 +7470,14 @@ int skill_delayfix( struct block_list *bl, int time )
time = battle_get_adelay (bl)/2;
if(sd) {
+ delayrate=((struct map_session_data *)bl)->delayrate;
+
if(battle_config.delay_dependon_dex && /* dex‚Μ‰e‹Ώ‚πŒvŽZ‚·‚ι */
!skill_get_delaynodex(skill, lv)) // if skill casttime is allowed to be reduced by dex
- time=time*(battle_config.castrate_dex_scale - battle_get_dex(bl))/battle_config.castrate_dex_scale;
+ time=time*delayrate*(battle_config.castrate_dex_scale - battle_get_dex(bl))/(battle_config.castrate_dex_scale * 100);
+
+ time=time*battle_config.delay_rate/100;
}
-
- time=time*battle_config.delay_rate/100;
/* ƒuƒ‰ƒM‚ΜŽ */
if(sc_data && sc_data[SC_POEMBRAGI].timer!=-1 )