瀏覽代碼

- Cleaned some up the add-effect code.
- Corrected ranged add-status only triggering if the attack is arrow based.
- Updated counter add-status so they trigger on ranged attacks instead of using "arrow_atk" state.


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

skotlex 18 年之前
父節點
當前提交
22d3158a94
共有 2 個文件被更改,包括 17 次插入12 次删除
  1. 4 0
      Changelog-Trunk.txt
  2. 13 12
      src/map/skill.c

+ 4 - 0
Changelog-Trunk.txt

@@ -4,6 +4,10 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 2007/03/08
+	* Corrected ranged add-status only triggering if the attack is arrow
+	  based.
+	* Updated counter add-status so they trigger on ranged attacks instead of
+	  using "arrow_atk" state. [Skotlex]
 	* Here comes the new mapcache system! [DracoRPG]
 	- The last and only big "feature" (kind of cleanup in fact) you'll see
 	- Totally removes GRF/GAT handling from map-server that only reads from cache

+ 13 - 12
src/map/skill.c

@@ -1369,10 +1369,10 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int
 				rate += sd->addeff[i].arrow_rate;
 			if (!rate) continue;
 
-			if (!(sd->addeff[i].flag&ATF_LONG && sd->addeff[i].flag&ATF_SHORT))
+			if ((sd->addeff[i].flag&(ATF_LONG|ATF_SHORT)) != (ATF_LONG|ATF_SHORT))
 			{	//Trigger has range consideration.
-				if ((sd->addeff[i].flag&ATF_LONG && !sd->state.arrow_atk) ||
-					(sd->addeff[i].flag&ATF_SHORT && sd->state.arrow_atk))
+				if((sd->addeff[i].flag&ATF_LONG && !(attack_type&BF_LONG)) ||
+					(sd->addeff[i].flag&ATF_SHORT && !(attack_type&BF_SHORT)))
 					continue; //Range Failed.
 			}
 			type =  sd->addeff[i].id;
@@ -1542,18 +1542,17 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
 		for(i=0; i < MAX_PC_BONUS && dstsd->addeff2[i].flag; i++)
 		{
 			rate = dstsd->addeff2[i].rate;
-			type = (sd && sd->state.arrow_atk) || (status_get_range(src)>2);
-			if (type)
+			if (attack_type&BF_LONG)
 				rate+=dstsd->addeff2[i].arrow_rate;
 			if (!rate) continue;
 			
-			if (!(dstsd->addeff2[i].flag&ATF_LONG && dstsd->addeff2[i].flag&ATF_SHORT))
+			if ((dstsd->addeff2[i].flag&(ATF_LONG|ATF_SHORT)) != (ATF_LONG|ATF_SHORT))
 			{	//Trigger has range consideration.
-				if ((dstsd->addeff2[i].flag&ATF_LONG && !type) ||
-					(dstsd->addeff2[i].flag&ATF_SHORT && type))
+				if((dstsd->addeff2[i].flag&ATF_LONG && !(attack_type&BF_LONG)) ||
+					(dstsd->addeff2[i].flag&ATF_SHORT && !(attack_type&BF_SHORT)))
 					continue; //Range Failed.
 			}
-			type =  dstsd->addeff2[i].id;
+			type = dstsd->addeff2[i].id;
 			time = skill_get_time2(StatusSkillChangeTable[type],7);
 			
 			if (dstsd->addeff2[i].flag&ATF_TARGET)
@@ -7266,9 +7265,10 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
 			break;
 
 		case UNT_GOSPEL:
-			if (rand()%100 > sg->skill_lv*10)
+			if (rand()%100 > sg->skill_lv*10 || ss == bl)
 				break;
-			if (ss != bl && battle_check_target(ss,bl,BCT_PARTY)>0) { // Support Effect only on party, not guild
+			if (battle_check_target(ss,bl,BCT_PARTY)>0)
+			{ // Support Effect only on party, not guild
 				int i = rand()%13; // Positive buff count
 				type = skill_get_time2(sg->skill_id, sg->skill_lv); //Duration
 				switch (i)
@@ -7327,7 +7327,8 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
 						break;
 				}
 			}
-			else if (battle_check_target(&src->bl,bl,BCT_ENEMY)>0) { // Offensive Effect
+			else if (battle_check_target(&src->bl,bl,BCT_ENEMY)>0)
+			{ // Offensive Effect
 				int i = rand()%9; // Negative buff count
 				type = skill_get_time2(sg->skill_id, sg->skill_lv);
 				switch (i)