Browse Source

* Added a configuration for whether damage of EarthQuake with single target can be reflected.
* Fixed Wizard Spirit can block reflected magical damage other than Kaite's.(bugreport:3161)
* Fixed Kaite works against bosses.(follow up to r13857)


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@13860 54d463be-8e91-2dee-dedb-b68131a5f0ec

Inkfish 16 years ago
parent
commit
5f16111215
4 changed files with 40 additions and 30 deletions
  1. 3 0
      conf/battle/skill.conf
  2. 1 0
      src/map/battle.c
  3. 2 0
      src/map/battle.h
  4. 34 30
      src/map/skill.c

+ 3 - 0
conf/battle/skill.conf

@@ -261,3 +261,6 @@ sg_angel_skill_ratio: 10
 // Skills that bHealPower has effect on
 // Skills that bHealPower has effect on
 // 1: Heal, 2: Sanctuary, 4: Potion Pitcher, 8: Slim Pitcher, 16: Apple of Idun
 // 1: Heal, 2: Sanctuary, 4: Potion Pitcher, 8: Slim Pitcher, 16: Apple of Idun
 skill_add_heal_rate: 7
 skill_add_heal_rate: 7
+
+// Whether the damage of EarthQuake with a single target on screen is able to be reflected.
+eq_single_target_reflectable: yes

+ 1 - 0
src/map/battle.c

@@ -3822,6 +3822,7 @@ static const struct _battle_data {
 	{ "homunculus_auto_vapor",              &battle_config.homunculus_auto_vapor,           0,      0,      1,              },
 	{ "homunculus_auto_vapor",              &battle_config.homunculus_auto_vapor,           0,      0,      1,              },
 	{ "display_status_timers",              &battle_config.display_status_timers,           1,      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,        },
 	{ "skill_add_heal_rate",                &battle_config.skill_add_heal_rate,             7,      0,      INT_MAX,        },
+	{ "eq_single_target_reflectable",       &battle_config.eq_single_target_reflectable,    1,      0,      1,              },
 // BattleGround Settings
 // BattleGround Settings
 	{ "bg_update_interval",                 &battle_config.bg_update_interval,              1000,   100,    INT_MAX,        },
 	{ "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,        },
 	{ "bg_short_attack_damage_rate",        &battle_config.bg_short_damage_rate,            80,     0,      INT_MAX,        },

+ 2 - 0
src/map/battle.h

@@ -465,6 +465,8 @@ extern struct Battle_Config
 	int homunculus_auto_vapor;	//Keep Homunculus from Vaporizing when master dies. [L0ne_W0lf]
 	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 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]
 	int skill_add_heal_rate;	//skills that bHealPower has effect on [Inkfish]
+	int eq_single_target_reflectable;
+
 	// [BattleGround Settings]
 	// [BattleGround Settings]
 	int bg_update_interval;
 	int bg_update_interval;
 	int bg_short_damage_rate;
 	int bg_short_damage_rate;

+ 34 - 30
src/map/skill.c

@@ -1539,6 +1539,9 @@ static int skill_magic_reflect(struct block_list* src, struct block_list* bl, in
 	if( sd && sd->magic_damage_return && type && rand()%100 < sd->magic_damage_return )
 	if( sd && sd->magic_damage_return && type && rand()%100 < sd->magic_damage_return )
 		return 1;
 		return 1;
 
 
+	if( is_boss(src) )
+		return 0;
+
 	// status-based reflection
 	// status-based reflection
 	if( !sc || sc->count == 0 )
 	if( !sc || sc->count == 0 )
 		return 0;
 		return 0;
@@ -1551,7 +1554,7 @@ static int skill_magic_reflect(struct block_list* src, struct block_list* bl, in
 		clif_specialeffect(bl, 438, AREA);
 		clif_specialeffect(bl, 438, AREA);
 		if( --sc->data[SC_KAITE]->val2 <= 0 )
 		if( --sc->data[SC_KAITE]->val2 <= 0 )
 			status_change_end(bl, SC_KAITE, -1);
 			status_change_end(bl, SC_KAITE, -1);
-		return 1;
+		return 2;
 	}
 	}
 
 
 	return 0;
 	return 0;
@@ -1630,40 +1633,41 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
 		}
 		}
 	}
 	}
 
 
-	if( dmg.flag&BF_MAGIC && ( skillid != NPC_EARTHQUAKE || (flag&0xFFF) == 1 ) )
+	if( dmg.flag&BF_MAGIC && ( skillid != NPC_EARTHQUAKE || (battle_config.eq_single_target_reflectable && (flag&0xFFF) == 1) ) )
 	{ // Earthquake on multiple targets is not counted as a target skill. [Inkfish]
 	{ // Earthquake on multiple targets is not counted as a target skill. [Inkfish]
-		if( (dmg.damage || dmg.damage2) && skill_magic_reflect(src, bl, src==dsrc) )
+		if( (dmg.damage || dmg.damage2) && (type = skill_magic_reflect(src, bl, src==dsrc)) )
 		{	//Magic reflection, switch caster/target
 		{	//Magic reflection, switch caster/target
 			struct block_list *tbl = bl;
 			struct block_list *tbl = bl;
 			bl = src;
 			bl = src;
 			src = tbl;
 			src = tbl;
-			sd = BL_CAST(BL_PC, src);
-			tsd = BL_CAST(BL_PC, bl);
-			sc = status_get_sc(bl);
-			if (sc && !sc->count)
-				sc = NULL; //Don't need it.
-			//Spirit of Wizard blocks bounced back spells.
-			if (sc && sc->data[SC_SPIRIT] &&
-				sc->data[SC_SPIRIT]->val2 == SL_WIZARD)
-			{
-				//It should only consume once per skill casted. Val3 is the skill
-				//id and val4 is the ID of the damage src, this should account for
-				//ground spells (and single target spells will be completed on
-				//castend_id) [Skotlex]
-				if (tsd && !(
-					sc->data[SC_SPIRIT]->val3 == skillid &&
-				  	sc->data[SC_SPIRIT]->val4 == dsrc->id)
-				) {	//Check if you have stone to consume.
-				  	type = pc_search_inventory (tsd, 7321);
-					if (type >= 0)
-						pc_delitem(tsd, type, 1, 0);
-				} else
-					type = 0;
-				if (type >= 0) {
-					dmg.damage = dmg.damage2 = 0;
-					dmg.dmg_lv = ATK_MISS;
-					sc->data[SC_SPIRIT]->val3 = skillid;
-					sc->data[SC_SPIRIT]->val4 = dsrc->id;
+
+			if( type == 2 )
+			{ // Kaite
+				sd = BL_CAST(BL_PC, src);
+				tsd = BL_CAST(BL_PC, bl);
+
+				sc = status_get_sc(bl);
+				if (sc && !sc->count)
+					sc = NULL; //Don't need it.
+
+				//Spirit of Wizard blocks Kaite's reflection
+				if( sc && sc->data[SC_SPIRIT] && sc->data[SC_SPIRIT]->val2 == SL_WIZARD )
+				{	//It should only consume once per skill casted. Val3 is the skill id and val4 is the ID of the damage src.
+					//This should account for ground spells (and single target spells will be completed on castend_id) [Skotlex]
+					if (tsd && !(sc->data[SC_SPIRIT]->val3 == skillid && sc->data[SC_SPIRIT]->val4 == dsrc->id) )
+					{	//Check if you have stone to consume.
+				  		type = pc_search_inventory (tsd, 7321);
+						if (type >= 0)
+							pc_delitem(tsd, type, 1, 0);
+					} else
+						type = 0;
+
+					if (type >= 0) {
+						dmg.damage = dmg.damage2 = 0;
+						dmg.dmg_lv = ATK_MISS;
+						sc->data[SC_SPIRIT]->val3 = skillid;
+						sc->data[SC_SPIRIT]->val4 = dsrc->id;
+					}
 				}
 				}
 			}
 			}
 		}
 		}