Pārlūkot izejas kodu

Added bonus2 bHPVanishRate for Vellum weapons - http://rathena.org/board/tracker/issue-7968-vellum-weapons/

Akinari1087 11 gadi atpakaļ
vecāks
revīzija
2e21c39c9b
6 mainītis faili ar 16 papildinājumiem un 3 dzēšanām
  1. 1 0
      db/const.txt
  2. 1 0
      doc/item_bonus.txt
  3. 5 0
      src/map/battle.c
  4. 1 1
      src/map/map.h
  5. 6 0
      src/map/pc.c
  6. 2 2
      src/map/pc.h

+ 1 - 0
db/const.txt

@@ -609,6 +609,7 @@ bVariableCast	2058
 
 bSetDefRace	2059
 bSetMDefRace	2060
+bHPVanishRate	2061
 
 EQI_HEAD_TOP	1
 EQI_ARMOR	2

+ 1 - 0
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

+ 5 - 0
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] )

+ 1 - 1
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 {

+ 6 - 0
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;

+ 2 - 2
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;