diff options
author | Inkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-05-29 14:25:14 +0000 |
---|---|---|
committer | Inkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-05-29 14:25:14 +0000 |
commit | 4b1d3c2d3884f6555afece768870910c9e9e7775 (patch) | |
tree | 485965116918b2a453a96dceaf89e16b0450d908 /src | |
parent | 560fb33ed7fc650fd7f5a4e5f4eec423202ca6d5 (diff) | |
download | hercules-4b1d3c2d3884f6555afece768870910c9e9e7775.tar.gz hercules-4b1d3c2d3884f6555afece768870910c9e9e7775.tar.bz2 hercules-4b1d3c2d3884f6555afece768870910c9e9e7775.tar.xz hercules-4b1d3c2d3884f6555afece768870910c9e9e7775.zip |
* Added a new battle flag for telling which skills can have bHealPower effect.
* Added documentation for bHealPower.
* Fixed some behaviors for healing skills, (thanks to L0ne_W0lf)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13821 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/map/battle.c | 5 | ||||
-rw-r--r-- | src/map/battle.h | 5 | ||||
-rw-r--r-- | src/map/pc.c | 12 | ||||
-rw-r--r-- | src/map/skill.c | 49 | ||||
-rw-r--r-- | src/map/skill.h | 2 |
5 files changed, 42 insertions, 31 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index 205d6c4f6..74ad8fe60 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -2280,7 +2280,7 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list case AL_HEAL: case PR_BENEDICTIO: case PR_SANCTUARY: - ad.damage = skill_calc_heal(src, target, skill_num, skill_lv)/2; + ad.damage = skill_calc_heal(src, target, skill_num, skill_lv, false); break; case PR_ASPERSIO: ad.damage = 40; @@ -2671,7 +2671,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list * md.dmotion = 0; //No flinch animation. break; case NPC_EVILLAND: - md.damage = skill_calc_heal(src,target,skill_num,skill_lv); + md.damage = skill_calc_heal(src,target,skill_num,skill_lv,false); break; } @@ -3813,6 +3813,7 @@ static const struct _battle_data { { "gm_viewequip_min_lv", &battle_config.gm_viewequip_min_lv, 0, 0, 99, }, { "homunculus_auto_vapor", &battle_config.homunculus_auto_vapor, 0, 0, 1, }, { "display_status_timers", &battle_config.display_status_timers, 1, 0, 1, }, + { "skill_add_heal_rate", &battle_config.skill_add_heal_rate, 7, 0, INT_MAX, }, // BattleGround Settings { "bg_update_interval", &battle_config.bg_update_interval, 1000, 100, INT_MAX, }, { "bg_short_attack_damage_rate", &battle_config.bg_short_damage_rate, 80, 0, INT_MAX, }, diff --git a/src/map/battle.h b/src/map/battle.h index dd3d95a42..b09041ef4 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -462,8 +462,9 @@ extern struct Battle_Config int auction_feeperhour; int auction_maximumprice; int gm_viewequip_min_lv; - int homunculus_auto_vapor; //Keep Homunculus from Vaporizing when master dies. [L0ne_W0lf] - int display_status_timers; //Show or hide skill buff/delay timers in recent clients [Sara] + int homunculus_auto_vapor; //Keep Homunculus from Vaporizing when master dies. [L0ne_W0lf] + int display_status_timers; //Show or hide skill buff/delay timers in recent clients [Sara] + int skill_add_heal_rate; //skills that bHealPower has effect on [Inkfish] // [BattleGround Settings] int bg_update_interval; int bg_short_damage_rate; diff --git a/src/map/pc.c b/src/map/pc.c index 5606eb7ae..cbee0b000 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -5245,6 +5245,18 @@ int pc_skillheal_bonus(struct map_session_data *sd, int skill_num) { int i, bonus = sd->add_heal_rate; + if( bonus ) + { + switch( skill_num ) + { + case AL_HEAL: if( !(battle_config.skill_add_heal_rate&1) ) bonus = 0; break; + case PR_SANCTUARY: if( !(battle_config.skill_add_heal_rate&2) ) bonus = 0; break; + case AM_POTIONPITCHER: if( !(battle_config.skill_add_heal_rate&4) ) bonus = 0; break; + case CR_SLIMPITCHER: if( !(battle_config.skill_add_heal_rate&8) ) bonus = 0; break; + case BA_APPLEIDUN: if( !(battle_config.skill_add_heal_rate&16) ) bonus = 0; break; + } + } + ARR_FIND(0, ARRAYLENGTH(sd->skillheal), i, sd->skillheal[i].id == skill_num); if( i < ARRAYLENGTH(sd->skillheal) ) bonus += sd->skillheal[i].val; diff --git a/src/map/skill.c b/src/map/skill.c index 3bfd03866..1546bcb47 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -269,9 +269,9 @@ int skill_get_range2 (struct block_list *bl, int id, int lv) return range; } -int skill_calc_heal(struct block_list *src, struct block_list *target, int skill_id, int skill_lv) +int skill_calc_heal(struct block_list *src, struct block_list *target, int skill_id, int skill_lv, bool heal) { - int skill, heal; + int skill, hp; struct map_session_data *sd = map_id2sd(src->id); struct map_session_data *tsd = map_id2sd(target->id); struct status_change* sc; @@ -279,50 +279,47 @@ int skill_calc_heal(struct block_list *src, struct block_list *target, int skill switch( skill_id ) { case BA_APPLEIDUN: - heal = 30+5*skill_lv+5*(status_get_vit(src)/10); // HP recovery + hp = 30+5*skill_lv+5*(status_get_vit(src)/10); // HP recovery if( sd ) - heal += 5*pc_checkskill(sd,BA_MUSICALLESSON); + hp += 5*pc_checkskill(sd,BA_MUSICALLESSON); break; case PR_SANCTUARY: - heal = (skill_lv>6)?777:skill_lv*100; + hp = (skill_lv>6)?777:skill_lv*100; break; case NPC_EVILLAND: - heal = (skill_lv>6)?666:skill_lv*100; + hp = (skill_lv>6)?666:skill_lv*100; break; default: if (skill_lv >= battle_config.max_heal_lv) return battle_config.max_heal; - heal = ( status_get_lv(src)+status_get_int(src) )/8 *(4+ skill_lv*8); + hp = ( status_get_lv(src)+status_get_int(src) )/8 *(4+ skill_lv*8); if( sd && ((skill = pc_checkskill(sd, HP_MEDITATIO)) > 0) ) - heal += heal * skill * 2 / 100; + hp += hp * skill * 2 / 100; else if( src->type == BL_HOM && (skill = merc_hom_checkskill(((TBL_HOM*)src), HLIF_BRAIN)) > 0 ) - heal += heal * skill * 2 / 100; + hp += hp * skill * 2 / 100; break; } - //FIXME: Is NPC_EVILLAND or BA_APPLEIDUN really an exception or we failed to add them to the original code? [Inkfish] - if( target && target->type == BL_MER && skill_id != NPC_EVILLAND ) - heal >>= 1; + if( ( (target && target->type == BL_MER) || !heal ) && skill_id != NPC_EVILLAND ) + hp >>= 1; if( sd && (skill = pc_skillheal_bonus(sd, skill_id)) ) - heal += heal*skill/100; + hp += hp*skill/100; if( tsd && (skill = pc_skillheal2_bonus(tsd, skill_id)) ) - heal += heal*skill/100; + hp += hp*skill/100; - //FIXME: Is offensive heal affected by the following status? [Inkfish] - //According to the original code, HEAL is but SANCTUARY isn't. Is that true? sc = status_get_sc(target); if( sc && sc->count ) { - if( sc->data[SC_CRITICALWOUND] ) - heal -= heal * sc->data[SC_CRITICALWOUND]->val2/100; - if( sc->data[SC_INCHEALRATE] ) //FIXME: BA_APPLEIDUN not affected by this one? [Inkfish] - heal += heal * sc->data[SC_INCHEALRATE]->val1/100; + if( sc->data[SC_CRITICALWOUND] && heal ) // Critical Wound has no effect on offensive heal. [Inkfish] + hp -= hp * sc->data[SC_CRITICALWOUND]->val2/100; + if( sc->data[SC_INCHEALRATE] && skill_id != NPC_EVILLAND && skill_id != BA_APPLEIDUN ) + hp += hp * sc->data[SC_INCHEALRATE]->val1/100; // Only affects Heal, Sanctuary and PotionPitcher.(like bHealPower) [Inkfish] } - return heal; + return hp; } // Making plagiarize check its own function [Aru] @@ -3173,7 +3170,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in case HLIF_HEAL: //[orn] case AL_HEAL: { - int heal = skill_calc_heal(src, bl, skillid, skilllv); + int heal = skill_calc_heal(src, bl, skillid, skilllv, true); int heal_get_jobexp; if( status_isimmune(bl) || (dstmd && (dstmd->class_ == MOBID_EMPERIUM || mob_is_battleground(dstmd))) ) @@ -5559,7 +5556,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in bl = map_id2bl(battle_gettarget(src)); if (!bl) bl = src; - i = skill_calc_heal(src, bl, skillid, 1+rand()%skilllv); + i = skill_calc_heal(src, bl, skillid, 1+rand()%skilllv, true); //Eh? why double skill packet? clif_skill_nodamage(src,bl,AL_HEAL,i,1); clif_skill_nodamage(src,bl,skillid,i,1); @@ -7315,7 +7312,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns } else { - int heal = skill_calc_heal(ss,bl,sg->skill_id,sg->skill_lv); + int heal = skill_calc_heal(ss,bl,sg->skill_id,sg->skill_lv,true); struct mob_data *md = BL_CAST(BL_MOB, bl); if( md && mob_is_battleground(md) ) break; @@ -7339,7 +7336,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns if(battle_check_target(&src->bl,bl,BCT_ENEMY)>0) skill_attack(BF_MISC, ss, &src->bl, bl, sg->skill_id, sg->skill_lv, tick, 0); } else { - int heal = skill_calc_heal(ss,bl,sg->skill_id,sg->skill_lv); + int heal = skill_calc_heal(ss,bl,sg->skill_id,sg->skill_lv,true); if (tstatus->hp >= tstatus->max_hp) break; if (status_isimmune(bl)) @@ -7500,7 +7497,7 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns int heal; if( sg->src_id == bl->id && !(tsc && tsc->data[SC_SPIRIT] && tsc->data[SC_SPIRIT]->val2 == SL_BARDDANCER) ) break; // affects self only when soullinked - heal = skill_calc_heal(ss,bl,sg->skill_id, sg->skill_lv); + heal = skill_calc_heal(ss,bl,sg->skill_id, sg->skill_lv, true); clif_skill_nodamage(&src->bl, bl, AL_HEAL, heal, 1); status_heal(bl, heal, 0, 0); break; diff --git a/src/map/skill.h b/src/map/skill.h index 03c87c180..ae970cb37 100644 --- a/src/map/skill.h +++ b/src/map/skill.h @@ -318,7 +318,7 @@ void skill_identify(struct map_session_data *sd,int idx); void skill_weaponrefine(struct map_session_data *sd,int idx); // [Celest] int skill_autospell(struct map_session_data *md,int skillid); -int skill_calc_heal(struct block_list *src, struct block_list *target, int skill_id, int skill_lv); +int skill_calc_heal(struct block_list *src, struct block_list *target, int skill_id, int skill_lv, bool heal); bool skill_check_cloaking(struct block_list *bl, struct status_change_entry *sce); |