From b3b97640f916a93e193e491b156877824649d25c Mon Sep 17 00:00:00 2001 From: skotlex Date: Mon, 29 May 2006 15:25:28 +0000 Subject: - Cleaned up some status_get functions. - Optimized a bit the SC_PROVOKE code (to use val3/val4) - Fixed draining when the amount drained is negative (invoke zap rather than heal) - Implemented GS_FLING as per the current skill description. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6819 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/battle.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/map/battle.c') diff --git a/src/map/battle.c b/src/map/battle.c index 71c5c8411..5e2a0d1b6 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -2463,6 +2463,7 @@ struct Damage battle_calc_misc_attack( //Misc Settings switch(skill_num){ case PA_PRESSURE: + case GS_FLING: flag.elefix = flag.cardfix = 0; case HT_BLITZBEAT: case TF_THROWSTONE: @@ -2551,6 +2552,9 @@ struct Damage battle_calc_misc_attack( if(map_flag_vs(target->m) || is_boss(target)) md.damage>>=1; //temp value break; + case GS_FLING: + md.damage = sd?sd->status.job_level:status_get_lv(src); + break; } damage_div_fix(md.damage, md.div_); @@ -2741,7 +2745,17 @@ void battle_drain(TBL_PC *sd, TBL_PC* tsd, int rdamage, int ldamage, int race, i } if (!thp && !tsp) return; - status_heal(&sd->bl, thp, tsp, battle_config.show_hp_sp_drain?3:1); + //Split'em up as Hp/Sp could be drained/leeched. + if(thp> 0) + status_heal(&sd->bl, thp, 0, battle_config.show_hp_sp_drain?3:1); + else if (thp < 0) + status_zap(&sd->bl, thp, 0); + + if(tsp > 0) + status_heal(&sd->bl, 0, tsp, battle_config.show_hp_sp_drain?3:1); + else if (tsp < 0) + status_zap(&sd->bl, 0, tsp); + if (tsd) { if (rhp || rsp) -- cgit v1.2.3-70-g09d2