summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorrud0lp20 <rud0lp20@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-06-29 15:52:29 +0000
committerrud0lp20 <rud0lp20@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-06-29 15:52:29 +0000
commit86aafca6da0a843db09a33e74faf8d9bb77e2508 (patch)
treeae44006b9f05054ccdf479780b2d0a03743252e4 /src/map/skill.c
parent05972632af5de3ddce35ea54797bf3a0598368b2 (diff)
downloadhercules-86aafca6da0a843db09a33e74faf8d9bb77e2508.tar.gz
hercules-86aafca6da0a843db09a33e74faf8d9bb77e2508.tar.bz2
hercules-86aafca6da0a843db09a33e74faf8d9bb77e2508.tar.xz
hercules-86aafca6da0a843db09a33e74faf8d9bb77e2508.zip
Implemented new item script bonuses:
- bSkillCooldown,n,x; - bSkillFixedCast,n,x; - *bSkillVariableCast,n,x; - bFixedCastrate,x; - *bVariableCastrate,x; *Pending until RE Casting system is fully implemented. ATM bCastrate is used to manipulate variable cast time where it should not. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16355 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 3a479e4bc..8854cf2cc 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -8837,8 +8837,16 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr_t data)
if( !sd || sd->skillitem != ud->skillid || skill_get_delay(ud->skillid,ud->skilllv) )
ud->canact_tick = tick + skill_delayfix(src, ud->skillid, ud->skilllv); //Tests show wings don't overwrite the delay but skill scrolls do. [Inkfish]
- if( sd && skill_get_cooldown(ud->skillid,ud->skilllv) > 0 )
- skill_blockpc_start(sd, ud->skillid, skill_get_cooldown(ud->skillid, ud->skilllv));
+ if( sd && skill_get_cooldown(ud->skillid,ud->skilllv) > 0 ){
+ int i, cooldown = skill_get_cooldown(ud->skillid, ud->skilllv);
+ for (i = 0; i < ARRAYLENGTH(sd->skillcooldown) && sd->skillcooldown[i].id; i++) { // Increases/Decreases cooldown of a skill by item/card bonuses.
+ if (sd->skillcooldown[i].id == ud->skillid){
+ cooldown += sd->skillcooldown[i].val;
+ break;
+ }
+ }
+ skill_blockpc_start(sd, ud->skillid, cooldown);
+ }
if( battle_config.display_status_timers && sd )
clif_status_change(src, SI_ACTIONDELAY, 1, skill_delayfix(src, ud->skillid, ud->skilllv), 0, 0, 0);
if( sd )
@@ -13001,12 +13009,24 @@ int skill_castfix (struct block_list *bl, int skill_id, int skill_lv)
*------------------------------------------*/
int skill_castfix_sc (struct block_list *bl, int time, int skill_id, int skill_lv) {
struct status_change *sc = status_get_sc(bl);
+ struct map_session_data *sd = BL_CAST(BL_PC,bl);
#ifdef RENEWAL_CAST
int fixed = skill_get_fixed_cast(skill_id, skill_lv);
if( !fixed ) {
fixed = skill_get_cast(skill_id, skill_lv);
fixed = ( fixed > 1 ? ( fixed * 20 / 100 ) : 0 );
}
+ if(sd){// Increases/Decreases fixed cast time of a skill by item/card bonuses.
+ int i;
+ if( sd->fixcastrate != 100 )
+ fixed = fixed * sd->fixcastrate / 100;
+ for (i = 0; i < ARRAYLENGTH(sd->skillfixcast) && sd->skillfixcast[i].id; i++) {
+ if (sd->skillfixcast[i].id == skill_id){
+ fixed += sd->skillfixcast[i].val;
+ break;
+ }
+ }
+ }
#endif
if (sc && sc->count) {
if (sc->data[SC_SLOWCAST])
@@ -13038,7 +13058,7 @@ int skill_castfix_sc (struct block_list *bl, int time, int skill_id, int skill_l
/**
* WL_RADIUS decreases 10/15/20% fixed cast time from warlock skills
**/
- if( bl->type == BL_PC && skill_id >= WL_WHITEIMPRISON && skill_id <= WL_FREEZE_SP && ( skill_lv = pc_checkskill((TBL_PC*)bl, WL_RADIUS) ) )
+ if( sd && skill_id >= WL_WHITEIMPRISON && skill_id <= WL_FREEZE_SP && ( skill_lv = pc_checkskill(sd, WL_RADIUS) ) )
fixed -= fixed * (5+(skill_lv*5)) / 100;
return (time > 0 || fixed > 0) ? cap_value( time , fixed , INT_MAX ) : 0;
#else