summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conf/battle/skill.conf4
-rw-r--r--doc/item_bonus.txt3
-rw-r--r--src/map/battle.c5
-rw-r--r--src/map/battle.h5
-rw-r--r--src/map/pc.c12
-rw-r--r--src/map/skill.c49
-rw-r--r--src/map/skill.h2
7 files changed, 49 insertions, 31 deletions
diff --git a/conf/battle/skill.conf b/conf/battle/skill.conf
index 82a1c0159..42b9a8366 100644
--- a/conf/battle/skill.conf
+++ b/conf/battle/skill.conf
@@ -257,3 +257,7 @@ sg_miracle_skill_duration: 3600000
// Angel of the Sun, Moon and Stars skill ratio (100% = 10000)
sg_angel_skill_ratio: 10
+
+// Skills that bHealPower has effect on
+// 1: Heal, 2: Sanctuary, 4: Potion Pitcher, 8: Slim Pitcher, 16: Apple of Idun
+skill_add_heal_rate: 7
diff --git a/doc/item_bonus.txt b/doc/item_bonus.txt
index d3c42ecbd..7c2217c44 100644
--- a/doc/item_bonus.txt
+++ b/doc/item_bonus.txt
@@ -12,6 +12,7 @@
//= 1.1.20090122 - removed outdated bSPDrainValue command [ultramage]
//= 1.1.20090421 - added the correct bonus documentation for bSPDrainValue [Playtester]
//= 1.1.20090524 - removed outdated bMatk/bMatk1/bMatk2 doc [ultramage]
+//= 1.1.20090529 - added documentation for bHealPower, bHealPower2 [Inkfish]
//===== Description =======================================
//= List of script instructions used in item bonuses,
//= mainly bonus/bonus2/bonus3/bonus4/bonus5 arguments
@@ -112,6 +113,8 @@ bonus bNoGemStone,n; Skills requiring Gemstones do no require them
(Hocus Pocus will still require 1 Yellow Gemstone | n is meaningless)
bonus bIntravision,n; Always see Hiding and Cloaking players/mobs (n is meaningless)
+bonus bHealPower,n; Increase heal amount of all heal skills by n% (supports skill names)
+bonus bHealPower2,n; Increase heal amount if you are healed by any skills by n% (supports skill names)
bonus2 bAddEff,e,x; Adds a x/10000 chance to cause effect e to the target when attacking (e.g. x=100 makes 1% chance, x=10000 makes 100% chance, etc)
e: Eff_Blind, Eff_Sleep, Eff_Poison, Eff_Freeze, Eff_Silence, Eff_Stan, Eff_Curse, Eff_Confusion, Eff_Stone, Eff_Bleeding
bonus2 bResEff,e,x; Adds a x/10000 tolerance to effect e (e.g. x=100 makes 1% tolerance, x=10000 makes 100% tolerance, etc)
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);