summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-05-14 20:33:05 +0200
committerHaru <haru@dotalux.com>2015-05-17 01:03:43 +0200
commit5be01dc1fe3f75e3a099f52dee2affb0c01f45a7 (patch)
tree790ad3595e895956b0ff50e41a25e9ed207356a8 /src/map/skill.c
parent6f2b524a4f1349a588bd5db4526b485eda7a6d2d (diff)
downloadhercules-5be01dc1fe3f75e3a099f52dee2affb0c01f45a7.tar.gz
hercules-5be01dc1fe3f75e3a099f52dee2affb0c01f45a7.tar.bz2
hercules-5be01dc1fe3f75e3a099f52dee2affb0c01f45a7.tar.xz
hercules-5be01dc1fe3f75e3a099f52dee2affb0c01f45a7.zip
Added bonus4 variant of bAddEff to specify a duration
- When a duration value is specified, the effect will have a fixed, non-reducible duration, as required by item scripts. - Special thanks to Michieru Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index fa1dd44cb..64b0cebe8 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -671,7 +671,7 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1
if( skill_id != WS_CARTTERMINATION && skill_id != AM_DEMONSTRATION && skill_id != CR_REFLECTSHIELD && skill_id != MS_REFLECTSHIELD && skill_id != ASC_BREAKER ) {
// Trigger status effects
enum sc_type type;
- int i;
+ int i, flag;
for( i = 0; i < ARRAYLENGTH(sd->addeff) && sd->addeff[i].flag; i++ ) {
rate = sd->addeff[i].rate;
if( attack_type&BF_LONG ) // Any ranged physical attack takes status arrows into account (Grimtooth...) [DracoRPG]
@@ -695,13 +695,22 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1
}
type = sd->addeff[i].id;
- temp = skill->get_time2(status->sc2skill(type),7);
+
+ if (sd->addeff[i].duration > 0) {
+ // Fixed duration
+ temp = sd->addeff[i].duration;
+ flag = SCFLAG_NOAVOID;
+ } else {
+ // Default duration
+ temp = skill->get_time2(status->sc2skill(type),7);
+ flag = SCFLAG_NONE;
+ }
if (sd->addeff[i].flag&ATF_TARGET)
- status->change_start(src,bl,type,rate,7,0,(type == SC_BURNING)?src->id:0,0,temp,SCFLAG_NONE);
+ status->change_start(src,bl,type,rate,7,0,(type == SC_BURNING)?src->id:0,0,temp,flag);
if (sd->addeff[i].flag&ATF_SELF)
- status->change_start(src,src,type,rate,7,0,(type == SC_BURNING)?src->id:0,0,temp,SCFLAG_NONE);
+ status->change_start(src,src,type,rate,7,0,(type == SC_BURNING)?src->id:0,0,temp,flag);
}
}