diff options
author | Inkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-05-07 12:15:14 +0000 |
---|---|---|
committer | Inkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-05-07 12:15:14 +0000 |
commit | 81a85e322a784f6237b1948c53dca39bffb42f18 (patch) | |
tree | 575dbb13c007d1b2e42881993c0cdd2ea86b4dfe /src/map/skill.c | |
parent | a609245253626fd1d8112d4b05959471723b7d8f (diff) | |
download | hercules-81a85e322a784f6237b1948c53dca39bffb42f18.tar.gz hercules-81a85e322a784f6237b1948c53dca39bffb42f18.tar.bz2 hercules-81a85e322a784f6237b1948c53dca39bffb42f18.tar.xz hercules-81a85e322a784f6237b1948c53dca39bffb42f18.zip |
* Fixed splash damage from Baphomet Card might miss. [Inkfish]
* Check if group unit is expired before processing it. (bugreport:3054) [Inkfish]
* Fixed Grand Corss outdated behavior (bugreport:1590) [Inkfish]
- use new damage formula
- DEF is reduced to 2/3 during cast time
- block shields switching within attack duration
- monsters don't damage themselves any more
- intervals between hits are 300ms
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13736 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r-- | src/map/skill.c | 59 |
1 files changed, 38 insertions, 21 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index a5600d74b..18c09f135 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -5567,6 +5567,9 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr data) } ud->skilltimer = INVALID_TIMER; + + if( sd && (ud->skillid == CR_GRANDCROSS || ud->skillid == NPC_GRANDDARKNESS) ) + status_calc_bl(&sd->bl, SCB_DEF); // restore original DEF } if (ud->skilltarget == id) @@ -5691,6 +5694,16 @@ int skill_castend_id(int tid, unsigned int tick, int id, intptr data) case GS_DESPERADO: sd->canequip_tick = tick + skill_get_time(ud->skillid, ud->skilllv); break; + case CR_GRANDCROSS: + case NPC_GRANDDARKNESS: + if( (sc = status_get_sc(src)) && sc->data[SC_STRIPSHIELD] ) + { + const struct TimerData *timer = get_timer(sc->data[SC_STRIPSHIELD]->timer); + if( timer && timer->func == status_change_timer && DIFF_TICK(timer->tick,gettick()+skill_get_time(ud->skillid, ud->skilllv)) > 0 ) + break; + } + sc_start2(src, SC_STRIPSHIELD, 100, 0, 1, skill_get_time(ud->skillid, ud->skilllv)); + break; } } if (skill_get_state(ud->skillid) != ST_MOVE_ENABLE) @@ -10032,27 +10045,6 @@ static int skill_unit_timer_sub (DBKey key, void* data, va_list ap) nullpo_retr(0, group); - dissonance = skill_dance_switch(unit, 0); - - if( unit->range >= 0 && group->interval != -1 ) - { - if( battle_config.skill_wall_check ) - map_foreachinshootrange(skill_unit_timer_sub_onplace, bl, unit->range, group->bl_flag, bl,tick); - else - map_foreachinrange(skill_unit_timer_sub_onplace, bl, unit->range, group->bl_flag, bl,tick); - - if(unit->range == -1) //Unit disabled, but it should not be deleted yet. - group->unit_id = UNT_USED_TRAPS; - - if( !unit->alive ) - { - if( dissonance ) skill_dance_switch(unit, 1); - return 0; - } - } - - if( dissonance ) skill_dance_switch(unit, 1); - // check for expiration if( (DIFF_TICK(tick,group->tick) >= group->limit || DIFF_TICK(tick,group->tick) >= unit->limit) ) {// skill unit expired (inlined from skill_unit_onlimit()) @@ -10173,6 +10165,31 @@ static int skill_unit_timer_sub (DBKey key, void* data, va_list ap) } } + //Don't continue if unit or even group is expired and has been deleted. + if( !group || !unit->alive ) + return 0; + + dissonance = skill_dance_switch(unit, 0); + + if( unit->range >= 0 && group->interval != -1 ) + { + if( battle_config.skill_wall_check ) + map_foreachinshootrange(skill_unit_timer_sub_onplace, bl, unit->range, group->bl_flag, bl,tick); + else + map_foreachinrange(skill_unit_timer_sub_onplace, bl, unit->range, group->bl_flag, bl,tick); + + if(unit->range == -1) //Unit disabled, but it should not be deleted yet. + group->unit_id = UNT_USED_TRAPS; + + if( !unit->alive ) + { + if( dissonance ) skill_dance_switch(unit, 1); + return 0; + } + } + + if( dissonance ) skill_dance_switch(unit, 1); + return 0; } /*========================================== |