Browse Source

* Follow up 111eb0c1, fixed Elemental Shield doesn't work for self if not in party. Thank @RagnarokNova.
* Follow up 2b870c24, 'missing' rate explanation for status_percent_change.
* Follow up 2ef7a7da, revert documentation rate for bHPVanishRate and bSPVanishRate

Signed-off-by: Cydh Ramdh <cydh@pservero.com>

Cydh Ramdh 10 years ago
parent
commit
6a5dd45fde
6 changed files with 10 additions and 7 deletions
  1. 2 2
      doc/item_bonus.txt
  2. 2 2
      src/map/battle.c
  3. 2 0
      src/map/clif.c
  4. 1 1
      src/map/skill.c
  5. 2 2
      src/map/status.c
  6. 1 0
      src/map/status.h

+ 2 - 2
doc/item_bonus.txt

@@ -336,8 +336,8 @@ bonus2 bSPDrainRate,x,n;		Adds a x/10% chance to drain n% SP when attacking
 
 
 HP/SP vanish
 HP/SP vanish
 ------------
 ------------
-bonus2 bHPVanishRate,x,n;		Add a x/100% chance of decreasing enemy's HP amount by n% when attacking
-bonus2 bSPVanishRate,x,n;		Add a x/100% chance of decreasing enemy's SP amount by n% when attacking
+bonus2 bHPVanishRate,x,n;		Add a x/10% chance of decreasing enemy's HP amount by n% when attacking
+bonus2 bSPVanishRate,x,n;		Add a x/10% chance of decreasing enemy's SP amount by n% when attacking
 
 
 bonus3 bHPVanishRaceRate,r,x,n;		Add a x/100% chance of decreasing enemy's HP amount by n% when attacking, depends on enemy race r
 bonus3 bHPVanishRaceRate,r,x,n;		Add a x/100% chance of decreasing enemy's HP amount by n% when attacking, depends on enemy race r
 bonus3 bSPVanishRaceRate,r,x,n;		Add a x/100% chance of decreasing enemy's SP amount by n% when attacking, depends on enemy race r
 bonus3 bSPVanishRaceRate,r,x,n;		Add a x/100% chance of decreasing enemy's SP amount by n% when attacking, depends on enemy race r

+ 2 - 2
src/map/battle.c

@@ -6642,12 +6642,12 @@ void battle_drain(TBL_PC *sd, struct block_list *tbl, int64 rdamage, int64 ldama
 		return;
 		return;
 
 
 	// Check for vanish HP/SP. !CHECKME: Which first, drain or vanish?
 	// Check for vanish HP/SP. !CHECKME: Which first, drain or vanish?
-	hp = sd->bonus.hp_vanish_rate + sd->hp_vanish_race[race].rate + sd->hp_vanish_race[RC_ALL].rate;
+	hp = (sd->bonus.hp_vanish_rate*10) + sd->hp_vanish_race[race].rate + sd->hp_vanish_race[RC_ALL].rate;
 	vrate_hp = cap_value(hp, 0, SHRT_MAX);
 	vrate_hp = cap_value(hp, 0, SHRT_MAX);
 	hp = sd->bonus.hp_vanish_per + sd->hp_vanish_race[race].per + sd->hp_vanish_race[RC_ALL].per;
 	hp = sd->bonus.hp_vanish_per + sd->hp_vanish_race[race].per + sd->hp_vanish_race[RC_ALL].per;
 	v_hp = cap_value(hp, INT8_MIN, INT8_MAX);
 	v_hp = cap_value(hp, INT8_MIN, INT8_MAX);
 
 
-	sp = sd->bonus.sp_vanish_rate + sd->sp_vanish_race[race].rate + sd->sp_vanish_race[RC_ALL].rate;
+	sp = (sd->bonus.sp_vanish_rate*10) + sd->sp_vanish_race[race].rate + sd->sp_vanish_race[RC_ALL].rate;
 	vrate_sp = cap_value(sp, 0, SHRT_MAX);
 	vrate_sp = cap_value(sp, 0, SHRT_MAX);
 	sp = sd->bonus.sp_vanish_per + sd->sp_vanish_race[race].per + sd->sp_vanish_race[RC_ALL].per;
 	sp = sd->bonus.sp_vanish_per + sd->sp_vanish_race[race].per + sd->sp_vanish_race[RC_ALL].per;
 	v_sp = cap_value(sp, INT8_MIN, INT8_MAX);
 	v_sp = cap_value(sp, INT8_MIN, INT8_MAX);

+ 2 - 0
src/map/clif.c

@@ -1403,6 +1403,8 @@ void clif_hominfo(struct map_session_data *sd, struct homun_data *hd, int flag)
 	int htype;
 	int htype;
 
 
 	nullpo_retv(hd);
 	nullpo_retv(hd);
+	if (!sd)
+		return;
 
 
 	status  = &hd->battle_status;
 	status  = &hd->battle_status;
 	htype = hom_class2type(hd->homunculus.class_);
 	htype = hom_class2type(hd->homunculus.class_);

+ 1 - 1
src/map/skill.c

@@ -10356,7 +10356,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
 		break;
 		break;
 
 
 	case SO_ELEMENTAL_SHIELD:
 	case SO_ELEMENTAL_SHIELD:
-		if (flag&1) {
+		if (!sd || sd->status.party_id == 0 || flag&1) {
 			skill_unitsetting(bl, MG_SAFETYWALL, skill_lv + 5, bl->x, bl->y, 0);
 			skill_unitsetting(bl, MG_SAFETYWALL, skill_lv + 5, bl->x, bl->y, 0);
 			skill_unitsetting(bl, AL_PNEUMA, 1, bl->x, bl->y, 0);
 			skill_unitsetting(bl, AL_PNEUMA, 1, bl->x, bl->y, 0);
 		}
 		}

+ 2 - 2
src/map/status.c

@@ -1713,8 +1713,8 @@ int status_heal(struct block_list *bl,int64 hhp,int64 hsp, int flag)
  * If a mob is killed this way and there is no src, no EXP/Drops will be awarded.
  * If a mob is killed this way and there is no src, no EXP/Drops will be awarded.
  * @param src: Object initiating HP/SP modification [PC|MOB|PET|HOM|MER|ELEM]
  * @param src: Object initiating HP/SP modification [PC|MOB|PET|HOM|MER|ELEM]
  * @param target: Object to modify HP/SP
  * @param target: Object to modify HP/SP
- * @param hp_rate: Percentage of HP to modify
- * @param sp_rate: Percentage of SP to modify
+ * @param hp_rate: Percentage of HP to modify. If > 0:percent is of current HP, if < 0:percent is of max HP
+ * @param sp_rate: Percentage of SP to modify. If > 0:percent is of current SP, if < 0:percent is of max SP
  * @param flag: \n
  * @param flag: \n
  *		0: Heal target \n 
  *		0: Heal target \n 
  *		1: Use status_damage \n 
  *		1: Use status_damage \n 

+ 1 - 0
src/map/status.h

@@ -2000,6 +2000,7 @@ int64 status_charge(struct block_list* bl, int64 hp, int64 sp);
 int status_percent_change(struct block_list *src, struct block_list *target, int8 hp_rate, int8 sp_rate, uint8 flag);
 int status_percent_change(struct block_list *src, struct block_list *target, int8 hp_rate, int8 sp_rate, uint8 flag);
 //Easier handling of status_percent_change
 //Easier handling of status_percent_change
 #define status_percent_heal(bl, hp_rate, sp_rate) status_percent_change(NULL, bl, -(hp_rate), -(sp_rate), 0)
 #define status_percent_heal(bl, hp_rate, sp_rate) status_percent_change(NULL, bl, -(hp_rate), -(sp_rate), 0)
+/// Deals % damage from 'src' to 'target'. If rate is > 0 is % of current HP/SP, < 0 % of MaxHP/MaxSP
 #define status_percent_damage(src, target, hp_rate, sp_rate, kill) status_percent_change(src, target, hp_rate, sp_rate, (kill)?1:2)
 #define status_percent_damage(src, target, hp_rate, sp_rate, kill) status_percent_change(src, target, hp_rate, sp_rate, (kill)?1:2)
 //Instant kill with no drops/exp/etc
 //Instant kill with no drops/exp/etc
 #define status_kill(bl) status_percent_damage(NULL, bl, 100, 0, true)
 #define status_kill(bl) status_percent_damage(NULL, bl, 100, 0, true)