فهرست منبع

- Restored the "Secret" behaviour of Blast Mine and Claymore Trap where each target is hit N times (where N is the number of mobs in the splash area at the moment of triggering).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7302 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 19 سال پیش
والد
کامیت
8033eb7d18
3فایلهای تغییر یافته به همراه16 افزوده شده و 16 حذف شده
  1. 3 0
      Changelog-Trunk.txt
  2. 0 1
      src/map/battle.c
  3. 13 15
      src/map/skill.c

+ 3 - 0
Changelog-Trunk.txt

@@ -4,6 +4,9 @@ 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.
 
 2006/06/22
+	* Restored the "Secret" behaviour of Blast Mine and Claymore Trap where
+	  each target is hit N times (where N is the number of mobs in the splash
+	  area at the moment of triggering). [Skotlex]
 	* Updated the tools/stackdump script to also handle sig-plugin generated
 	  backtraces. Now it will also auto-determine whether the exe needs a .exe at
 	  the end or not. Help me test it as I want this script on stable NOW :X

+ 0 - 1
src/map/battle.c

@@ -2395,7 +2395,6 @@ struct Damage  battle_calc_misc_attack(
 
 	if( src == NULL || target == NULL ){
 		nullpo_info(NLP_MARK);
-		memset(&md,0,sizeof(md));
 		return md;
 	}
 

+ 13 - 15
src/map/skill.c

@@ -6769,15 +6769,18 @@ int skill_unit_onplace_timer (struct skill_unit *src, struct block_list *bl, uns
 		sg->state.into_abyss = 1; //Prevent Remove Trap from giving you the trap back. [Skotlex]
 		break;
 
+	case UNT_CLAYMORETRAP:
 	case UNT_BLASTMINE:
+		//Hold number of targets (required for damage calculation)
+		type = map_foreachinrange(skill_count_target,&src->bl,
+			skill_get_splash(sg->skill_id, sg->skill_lv), sg->bl_flag, &src->bl);
 	case UNT_SHOCKWAVE:
 	case UNT_SANDMAN:
 	case UNT_FLASHER:
 	case UNT_FREEZINGTRAP:
-	case UNT_CLAYMORETRAP:
 		map_foreachinrange(skill_trap_splash,&src->bl,
 			skill_get_splash(sg->skill_id, sg->skill_lv), sg->bl_flag,
-			&src->bl,tick);
+			&src->bl,tick,type);
 		sg->unit_id = UNT_USED_TRAPS;
 		clif_changetraplook(&src->bl, UNT_USED_TRAPS);
 		sg->limit=DIFF_TICK(tick,sg->tick)+1500;
@@ -8928,18 +8931,9 @@ int skill_ganbatein (struct block_list *bl, va_list ap)
  */
 int skill_count_target (struct block_list *bl, va_list ap)
 {
-	struct block_list *src;
-	int *c;
-
-	nullpo_retr(0, bl);
-	nullpo_retr(0, ap);
-
-	if ((src = va_arg(ap,struct block_list *)) == NULL)
-		return 0;
-	if ((c = va_arg(ap,int *)) == NULL)
-		return 0;
+	struct block_list *src = va_arg(ap,struct block_list *);
 	if (battle_check_target(src,bl,BCT_ENEMY) > 0)
-		(*c)++;
+		return 1;
 	return 0;
 }
 /*==========================================
@@ -8953,10 +8947,11 @@ int skill_trap_splash (struct block_list *bl, va_list ap)
 	struct skill_unit *unit;
 	struct skill_unit_group *sg;
 	struct block_list *ss;
-
+	int i,count;
 	src = va_arg(ap,struct block_list *);
 	unit = (struct skill_unit *)src;
 	tick = va_arg(ap,int);
+	count = va_arg(ap,int);
 	
 	nullpo_retr(0, sg = unit->group);
 	nullpo_retr(0, ss = map_id2bl(sg->src_id));
@@ -8970,7 +8965,10 @@ int skill_trap_splash (struct block_list *bl, va_list ap)
 				break;
 			case UNT_BLASTMINE:
 			case UNT_CLAYMORETRAP:
-				skill_attack(BF_MISC,ss,src,bl,sg->skill_id,sg->skill_lv,tick,0);
+				//Special property: Each target is hit N times (N = number of targets on splash area)
+				if (!count) count = 1;
+				for(i=0;i<count;i++)
+					skill_attack(BF_MISC,ss,src,bl,sg->skill_id,sg->skill_lv,tick,0);
 				break;
 			case UNT_FREEZINGTRAP:
 				skill_attack(BF_WEAPON,ss,src,bl,sg->skill_id,sg->skill_lv,tick,0);