浏览代码

- Moved the SD_PREAMBLE code to skill_area_sub
- Added SD_SPLASH to let skill_area_sub do the target counter.
- Updated splash skills to use these defines.
- The NPC_WIDE* skills now use SD_PREAMBLE to correctly display their animation.


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

skotlex 17 年之前
父节点
当前提交
61093d095a
共有 3 个文件被更改,包括 24 次插入27 次删除
  1. 5 2
      Changelog-Trunk.txt
  2. 14 21
      src/map/skill.c
  3. 5 4
      src/map/skill.h

+ 5 - 2
Changelog-Trunk.txt

@@ -4,7 +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.
 
 2008/05/07
-	* Fixed Sense messing up with Spiderweb. [Skotlex]
+	* Did some cleanup of the splash code, the NPC_WIDE* skills now send the
+	  'preamble' packet, which for the most part correct their skill animation
+	  display.
+	* Fixed Sense messing up with Spiderweb.
 	* Added Throw tomahawk to the list of items that do not trigger the
 	  equipment breaking code.
 	* Probably fixed Moonlight petals pushing back the casters.
@@ -12,7 +15,7 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 	* Infinite Endure is no longer saved on logout.
 	* Added check to avoid gms opening vending shops if they don't have the
 	  required level.
-	* Fixed the flee penalty not applying when you walk into a gvg map.
+	* Fixed the flee penalty not applying when you walk into a gvg map. [Skotlex]
 2008/05/03
 	* NPC_GUIDEDATTACK is not supposed to bypass pneuma/safetywall [ultramage]
 2008/05/02

+ 14 - 21
src/map/skill.c

@@ -1557,10 +1557,6 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
 		}
 	}
 
-	// Cart Revolution and Grimtooth need this weirdo dummy packet for the first target to display correctly
-	if( flag&SD_PREAMBLE )
-		clif_skill_damage(dsrc,bl,tick, dmg.amotion, dmg.dmotion, -30000, dmg.div_, skillid, skilllv, 6);
-
 	//Display damage.
 	switch( skillid )
 	{
@@ -1744,8 +1740,14 @@ int skill_area_sub (struct block_list *bl, va_list ap)
 	func=va_arg(ap,SkillFunc);
 
 	if(battle_check_target(src,bl,flag) > 0)
+	{
+		if (flag&(SD_SPLASH|SD_PREAMBLE)) {
+			if (flag&SD_PREAMBLE && !skill_area_temp[2])
+				clif_skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
+			skill_area_temp[2]++;
+		}
 		return func(src,bl,skill_id,skill_lv,tick,flag);
-
+	}
 	return 0;
 }
 
@@ -2477,11 +2479,12 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
 
 	//Splash attack skills.
 	case AS_GRIMTOOTH:
+	case MC_CARTREVOLUTION:	
+	case NPC_SPLASHATTACK:
+		flag |= SD_PREAMBLE; // a fake packet will be sent for the first target to be hit
 	case AS_SPLASHER:
 	case SM_MAGNUM:
 	case HT_BLITZBEAT:
-	case MC_CARTREVOLUTION:	
-	case NPC_SPLASHATTACK:
 	case AC_SHOWER:	
 	case MG_NAPALMBEAT:
 	case MG_FIREBALL:
@@ -2505,11 +2508,8 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
 				sflag |= SD_LEVEL; // -1 will be used in packets instead of the skill level
 			if( skill_area_temp[1] != bl->id && !(skill_get_inf2(skillid)&INF2_NPC_SKILL) )
 				sflag |= SD_ANIMATION; // original target gets no animation (as well as all NPC skills)
-			if( skill_area_temp[2] == 0 && (skillid == AS_GRIMTOOTH || skillid == MC_CARTREVOLUTION || skillid == NPC_SPLASHATTACK) )
-				sflag |= SD_PREAMBLE; // a fake packet will be sent for the first target to be hit
 
 			skill_attack(skill_get_type(skillid), src, src, bl, skillid, skilllv, tick, sflag);
-			skill_area_temp[2]++;
 		}
 		else
 		{
@@ -2527,7 +2527,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, int
 				skill_area_temp[0] = map_foreachinrange(skill_area_sub, bl, (skillid == AS_SPLASHER)?1:skill_get_splash(skillid, skilllv), BL_CHAR, src, skillid, skilllv, tick, BCT_ENEMY, skill_area_sub_count);
 
 			// recursive invocation of skill_castend_damage_id() with flag|1
-			map_foreachinrange(skill_area_sub, bl, skill_get_splash(skillid, skilllv), splash_target(src), src, skillid, skilllv, tick, flag|BCT_ENEMY|1, skill_castend_damage_id);
+			map_foreachinrange(skill_area_sub, bl, skill_get_splash(skillid, skilllv), splash_target(src), src, skillid, skilllv, tick, flag|BCT_ENEMY|SD_SPLASH|1, skill_castend_damage_id);
 
 			//FIXME: move this to skill_additional_effect or some such? [ultramage]
 			if (skillid == SM_MAGNUM) {
@@ -5145,16 +5145,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
 			const enum sc_type sc[] = { SC_STUN, SC_CURSE, SC_SILENCE, SC_BLEEDING };
 			i = rand()%ARRAYLENGTH(sc);
 			sc_start(bl,sc[i],100,skilllv,skill_get_time2(skillid,i+1));
-		} else {
-			// hacked-together packet (not correct) that shows the animation 
-			clif_skill_damage(src, src, tick, 1, 1, -1, 0, skillid, skilllv, 6);
-			map_foreachinrange(skill_area_sub, bl,
-				skill_get_splash(skillid, skilllv),BL_CHAR,
-				src,skillid,skilllv,tick, flag|BCT_ENEMY|1,
-				skill_castend_nodamage_id);
+			break;
 		}
-		break;
-		
 	case NPC_WIDEBLEEDING:
 	case NPC_WIDECONFUSE:
 	case NPC_WIDECURSE:
@@ -5167,10 +5159,11 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
 		if (flag&1)
 			sc_start(bl,type,100,skilllv,skill_get_time2(skillid,skilllv));
 		else {
+			skill_area_temp[2] = 0; //For SD_PREAMBLE
 			clif_skill_nodamage(src,bl,skillid,skilllv,1);
 			map_foreachinrange(skill_area_sub, bl,
 				skill_get_splash(skillid, skilllv),BL_CHAR,
-				src,skillid,skilllv,tick, flag|BCT_ENEMY|1,
+				src,skillid,skilllv,tick, flag|BCT_ENEMY|SD_PREAMBLE|1,
 				skill_castend_nodamage_id);
 		}
 		break;

+ 5 - 4
src/map/skill.h

@@ -62,10 +62,11 @@ struct status_change_entry;
 //Walk intervals at which chase-skills are attempted to be triggered.
 #define WALK_SKILL_INTERVAL 5
 
-// Flags passed to skill_attack
-#define SD_LEVEL     0x1000 // will send -1 instead of skill level (affects display of some skills)
-#define SD_ANIMATION 0x2000 // will use '5' instead of the skill's 'type' (this makes skills show an animation)
-#define SD_PREAMBLE  0x4000 // will transmit a 'magic' damage packet (-30000 dmg) for the first target to be hit
+// Flags passed to skill_attack/skill_area_sub
+#define SD_LEVEL     0x1000 // skill_attack will send -1 instead of skill level (affects display of some skills)
+#define SD_ANIMATION 0x2000 // skill_attack will use '5' instead of the skill's 'type' (this makes skills show an animation)
+#define SD_SPLASH    0x4000 // skill_area_sub will count targets in skill_area_temp[2]
+#define SD_PREAMBLE  0x8000 // skill_area_sub will transmit a 'magic' damage packet (-30000 dmg) for the first target selected
 
 // ƒXƒLƒ‹ƒf?ƒ^ƒx?ƒX
 struct s_skill_db {