Explorar o código

Fixed bHPGainValue and bSPGainValue worked on all types of attacks and was only activated on mob's death.(bugreport:3193) [Inkfish]

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@13863 54d463be-8e91-2dee-dedb-b68131a5f0ec
Inkfish %!s(int64=16) %!d(string=hai) anos
pai
achega
4a786aef74
Modificáronse 4 ficheiros con 40 adicións e 34 borrados
  1. 5 0
      Changelog-Trunk.txt
  2. 2 0
      conf/battle/skill.conf
  3. 0 7
      src/map/mob.c
  4. 33 27
      src/map/skill.c

+ 5 - 0
Changelog-Trunk.txt

@@ -3,6 +3,11 @@ Date	Added
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
+09/06/08
+	* Fixed bHPGainValue and bSPGainValue worked on all types of attacks and was only activated on mob's death.(bugreport:3193) [Inkfish]
+	* Added a configuration for whether damage of EarthQuake with single target can be reflected. [Inkfish]
+	* Fixed Wizard Spirit can block reflected magical damage other than Kaite's.(bugreport:3161) [Inkfish]
+	* Fixed Kaite works against bosses.(follow up to r13857) [Inkfish]
 09/06/07
 	* Magical damage reflection now works against boss monsters and only on target skill(but EarthQuake with one target is an exception). [Inkfish]
 	* Changed hardcoded "5" to MAX_ARROW_RESOURCE in skill_arrow_create preventing proper usage. (bugreport:3025) [Paradox924X]

+ 2 - 0
conf/battle/skill.conf

@@ -263,4 +263,6 @@ sg_angel_skill_ratio: 10
 skill_add_heal_rate: 7
 
 // Whether the damage of EarthQuake with a single target on screen is able to be reflected.
+// Note: On offcial server, EQ is reflectable when there is only one target on the screen, 
+//	 which might be an exploit to hunt the MVPs.
 eq_single_target_reflectable: yes

+ 0 - 7
src/map/mob.c

@@ -1976,13 +1976,6 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
 
 	if( sd )
 	{
-		int sp = 0, hp = 0;
-		sp += sd->sp_gain_value;
-		sp += sd->sp_gain_race[status->race];
-		sp += sd->sp_gain_race[status->mode&MD_BOSS?RC_BOSS:RC_NONBOSS];
-		hp += sd->hp_gain_value;
-		if( hp || sp )
-			status_heal(src, hp, sp, battle_config.show_hp_sp_gain?2:0);
 		if( sd->mission_mobid == md->class_)
 		{ //TK_MISSION [Skotlex]
 			if( ++sd->mission_count >= 100 && (temp = mob_get_random_id(0, 0xE, sd->status.base_level)) )

+ 33 - 27
src/map/skill.c

@@ -1237,6 +1237,17 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
 		status_heal(src, 0, status_get_lv(bl)*(95+15*rate)/100, 2);
 	}
 
+	if( sd && status_isdead(bl) && attack_type&BF_WEAPON )
+	{
+		int sp = 0, hp = 0;
+		sp += sd->sp_gain_value;
+		sp += sd->sp_gain_race[status_get_race(bl)];
+		sp += sd->sp_gain_race[is_boss(bl)?RC_BOSS:RC_NONBOSS];
+		hp += sd->hp_gain_value;
+		if( hp || sp )
+			status_heal(src, hp, sp, battle_config.show_hp_sp_gain?2:0);
+	}
+
 	// Trigger counter-spells to retaliate against damage causing skills.
 	if(dstsd && !status_isdead(bl) && dstsd->autospell2[0].id &&
 		!(skillid && skill_get_nk(skillid)&NK_NO_DAMAGE))
@@ -1640,34 +1651,29 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
 			struct block_list *tbl = bl;
 			bl = src;
 			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 Kaite's reflection
+			if( type == 2 && 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 == 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;
-					}
+				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;
 				}
 			}
 		}