From 035d1f870aa7e55825c8fe473c1132d2479b8631 Mon Sep 17 00:00:00 2001 From: skotlex Date: Thu, 23 Mar 2006 13:56:45 +0000 Subject: - Fixed Potion Pitcher sometimes crashing the server. - Fixed a compile warning by adjusting the acid demonstration formula. - Added flag 2 to the skill_castnodex_db file for skills that shouldn't be affected by delay/cast reducing skills/effects. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5714 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/battle.c | 14 ++++++------ src/map/skill.c | 67 +++++++++++++++++++++++++++++++------------------------- 2 files changed, 44 insertions(+), 37 deletions(-) (limited to 'src') diff --git a/src/map/battle.c b/src/map/battle.c index 9c8c94d57..dbd706e07 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -2807,13 +2807,13 @@ struct Damage battle_calc_misc_attack( aflag = (aflag&~BF_RANGEMASK)|BF_LONG; break; case CR_ACIDDEMONSTRATION: - //This equation is not official, but it's the closest to the official one - //that Viccious Pucca and the other folks at the forums could come up with. [Skotlex] - // updated the formula based on a Japanese formula found to be exact [Reddozen] - damage = (int)((0.7 * status_get_vit(target) * (int_ * int_)) / (status_get_vit(target) + int_)); - if (tsd) damage/=2; - aflag = (aflag&~BF_RANGEMASK)|BF_LONG; - break; + { // updated the formula based on a Japanese formula found to be exact [Reddozen] + int vit = status_get_vit(target); + damage = 7*(vit*int_*int_) / (10*(vit+int_)); + if (tsd) damage/=2; + aflag = (aflag&~BF_RANGEMASK)|BF_LONG; + break; + } case NJ_ZENYNAGE: { int dmgnage = (500*skill_lv)+rand()%(500*skill_lv); diff --git a/src/map/skill.c b/src/map/skill.c index 8facca717..6bcd82c4b 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -4544,6 +4544,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in hp = hp * (100 + pc_checkskill(dstsd,SM_RECOVERY)*10) / 100; } tbl.id = 0; + tbl.type = BL_NUL; tbl.m = src->m; tbl.x = src->x; tbl.y = src->y; @@ -8224,6 +8225,7 @@ int skill_check_condition(struct map_session_data *sd,int skill, int lv, int typ int skill_castfix( struct block_list *bl, int skill_id, int skill_lv, int time) { struct status_change *sc; + int castnodex = skill_get_castnodex(skill_id, skill_lv); nullpo_retr(0, bl); @@ -8232,7 +8234,7 @@ int skill_castfix( struct block_list *bl, int skill_id, int skill_lv, int time) nullpo_retr(0, sd); // calculate base cast time (reduced by dex) - if (!skill_get_castnodex(skill_id, skill_lv) > 0) { + if (castnodex&~1) { int scale = battle_config.castrate_dex_scale - status_get_dex(bl); if (scale > 0) // not instant cast time = time * scale / battle_config.castrate_dex_scale; @@ -8247,28 +8249,30 @@ int skill_castfix( struct block_list *bl, int skill_id, int skill_lv, int time) if (sd->castrate != 100) time -= time * (100 - sd->castrate) / 100; } else if (bl->type == BL_PET) { //Skotlex: Simple scaling - int scale = battle_config.castrate_dex_scale - status_get_dex(bl); - if (scale > 0) // not instant cast - time = time * scale / battle_config.castrate_dex_scale; - else return 0; // instant cast - + if (castnodex&~1) { + int scale = battle_config.castrate_dex_scale - status_get_dex(bl); + if (scale > 0) // not instant cast + time = time * scale / battle_config.castrate_dex_scale; + else return 0; // instant cast + } if (battle_config.cast_rate != 100) time = time * battle_config.cast_rate / 100; } - // calculate cast time reduced by skill bonuses - sc = status_get_sc(bl); - /* ƒTƒtƒ‰ƒMƒEƒ€ */ - if (sc && sc->count) { - if (sc->data[SC_SUFFRAGIUM].timer != -1) { - time -= time * (sc->data[SC_SUFFRAGIUM].val1 * 15) / 100; - status_change_end(bl, SC_SUFFRAGIUM, -1); + if (castnodex&~2) + { // calculate cast time reduced by skill bonuses + sc = status_get_sc(bl); + /* ƒTƒtƒ‰ƒMƒEƒ€ */ + if (sc && sc->count) { + if (sc->data[SC_SUFFRAGIUM].timer != -1) { + time -= time * (sc->data[SC_SUFFRAGIUM].val1 * 15) / 100; + status_change_end(bl, SC_SUFFRAGIUM, -1); + } + /* ƒuƒ‰ƒM‚ÌŽ? */ + if (sc->data[SC_POEMBRAGI].timer != -1) + time -= time * sc->data[SC_POEMBRAGI].val2 / 100; } - /* ƒuƒ‰ƒM‚ÌŽ? */ - if (sc->data[SC_POEMBRAGI].timer != -1) - time -= time * sc->data[SC_POEMBRAGI].val2 / 100; } - // return final cast time return (time > 0) ? time : 0; } @@ -8278,7 +8282,8 @@ int skill_castfix( struct block_list *bl, int skill_id, int skill_lv, int time) */ int skill_delayfix( struct block_list *bl, int skill_id, int skill_lv, int time ) { - struct status_change *sc; + struct status_change *sc; + int delaynodex = skill_get_delaynodex(skill_id, skill_lv); nullpo_retr(0, bl); @@ -8295,13 +8300,13 @@ int skill_delayfix( struct block_list *bl, int skill_id, int skill_lv, int time } else if (time < 0) time = -time + status_get_amotion(bl); // if set to <0, the attack motion is added. - if (battle_config.delay_dependon_dex && /* dex‚̉e‹¿‚ðŒvŽZ‚·‚é */ - !skill_get_delaynodex(skill_id, skill_lv)) // if skill casttime is allowed to be reduced by dex - { + if (battle_config.delay_dependon_dex && delaynodex&~1) + { // if skill casttime is allowed to be reduced by dex int scale = battle_config.castrate_dex_scale - status_get_dex(bl); - if (scale < 0) - scale = 0; - time = time * scale / battle_config.castrate_dex_scale; + if (scale > 0) + time = time * scale / battle_config.castrate_dex_scale; + else + time = battle_config.min_skill_delay_limit; } if (battle_config.delay_rate != 100) @@ -8314,12 +8319,13 @@ int skill_delayfix( struct block_list *bl, int skill_id, int skill_lv, int time time = battle_config.min_skill_delay_limit; } - /* ƒuƒ‰ƒM‚ÌŽ? */ - sc= status_get_sc(bl); - if (sc && sc->count) { - if (sc->data[SC_POEMBRAGI].timer != -1) - time -= time * sc->data[SC_POEMBRAGI].val3 / 100; - if (sc->data[SC_SPIRIT].timer != -1) + if (delaynodex&~2) + { /* ƒuƒ‰ƒM‚ÌŽ? */ + sc= status_get_sc(bl); + if (sc && sc->count) { + if (sc->data[SC_POEMBRAGI].timer != -1) + time -= time * sc->data[SC_POEMBRAGI].val3 / 100; + if (sc->data[SC_SPIRIT].timer != -1) switch (skill_id) { case CR_SHIELDBOOMERANG: if (sc->data[SC_SPIRIT].val2 == SL_CRUSADER) @@ -8330,6 +8336,7 @@ int skill_delayfix( struct block_list *bl, int skill_id, int skill_lv, int time time /= 2; break; } + } } return (time > 0) ? time : 0; -- cgit v1.2.3-70-g09d2