diff --git a/db/const.txt b/db/const.txt index d805aba916..85a70c148d 100644 --- a/db/const.txt +++ b/db/const.txt @@ -609,6 +609,7 @@ bVariableCast 2058 bSetDefRace 2059 bSetMDefRace 2060 +bHPVanishRate 2061 EQI_HEAD_TOP 1 EQI_ARMOR 2 diff --git a/doc/item_bonus.txt b/doc/item_bonus.txt index ce35aa764b..fde8687bff 100644 --- a/doc/item_bonus.txt +++ b/doc/item_bonus.txt @@ -151,6 +151,7 @@ bonus2 bIgnoreMdefRate,n,x; Disregard x% of the target's MDEF if the target bel bonus2 bHPDrainRate,n,x; n/10 % probability to drain x% HP when attacking bonus2 bSPDrainRate,n,x; n/10 % probability to drain x% SP when attacking bonus2 bSPVanishRate,n,x; Add the (n/10)% chance of decreasing enemy's SP (player) amount by x% when attacking +bonus2 bHPVanishRate,n,x; Add the (n/10)% chance of decreasing enemy's HP (player) amount by x% when attacking bonus2 bAddMonsterDropItem,n,x; Adds a x/100% chance for item n to be dropped, when killing any monster. If 'x' is negative value, then it's a part of formula chance = -x*(killed_mob_level/10)+1 diff --git a/src/map/battle.c b/src/map/battle.c index e60cd60dfb..2075f83cc4 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -5980,6 +5980,11 @@ void battle_drain(TBL_PC *sd, struct block_list *tbl, int64 rdamage, int64 ldama if (sd->bonus.sp_vanish_rate && rnd()%1000 < sd->bonus.sp_vanish_rate) status_percent_damage(&sd->bl, tbl, 0, (unsigned char)sd->bonus.sp_vanish_per, false); + if (sd->bonus.hp_vanish_rate && rnd()%1000 < sd->bonus.hp_vanish_rate + && tbl->type == BL_PC && (map[sd->bl.m].flag.pvp || map[sd->bl.m].flag.gvg)) + status_percent_damage(&sd->bl, tbl, (unsigned char)sd->bonus.hp_vanish_per, 0, false); + + if( sd->sp_gain_race_attack[race] ) tsp += sd->sp_gain_race_attack[race]; if( sd->hp_gain_race_attack[race] ) diff --git a/src/map/map.h b/src/map/map.h index 420b7e8e5e..c5846718e4 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -427,7 +427,7 @@ enum _sp { SP_EMATK, SP_SP_GAIN_RACE_ATTACK, SP_HP_GAIN_RACE_ATTACK, SP_SKILL_USE_SP_RATE, //2046-2049 SP_SKILL_COOLDOWN,SP_SKILL_FIXEDCAST, SP_SKILL_VARIABLECAST, SP_FIXCASTRATE, SP_VARCASTRATE, //2050-2054 SP_SKILL_USE_SP,SP_MAGIC_ATK_ELE, SP_ADD_FIXEDCAST, SP_ADD_VARIABLECAST, //2055-2058 - SP_DEF_SET,SP_MDEF_SET //2059-2060 + SP_DEF_SET,SP_MDEF_SET,SP_HP_VANISH_RATE //2059-2061 }; enum _look { diff --git a/src/map/pc.c b/src/map/pc.c index 19421e8b0e..f8b2fcd557 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -2939,6 +2939,12 @@ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val) sd->bonus.sp_vanish_per += val; } break; + case SP_HP_VANISH_RATE: + if(sd->state.lr_flag != 2) { + sd->bonus.hp_vanish_rate += type2; + sd->bonus.hp_vanish_per += val; + } + break; case SP_GET_ZENY_NUM: if(sd->state.lr_flag != 2 && sd->bonus.get_zeny_rate < val) { sd->bonus.get_zeny_rate = val; diff --git a/src/map/pc.h b/src/map/pc.h index 081a2ce289..ecc9dc0625 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -368,8 +368,8 @@ struct map_session_data { short add_steal_rate; short add_heal_rate, add_heal2_rate; short sp_gain_value, hp_gain_value, magic_sp_gain_value, magic_hp_gain_value; - short sp_vanish_rate; - short sp_vanish_per; + short sp_vanish_rate, hp_vanish_rate; + short sp_vanish_per, hp_vanish_per; unsigned short unbreakable; // chance to prevent ANY equipment breaking [celest] unsigned short unbreakable_equip; //100% break resistance on certain equipment unsigned short unstripable_equip;