Browse Source

- skill_blown flag&0x40000 now knocks back in a random direction.
- Some small cleanups to prevent skill_blown execution when the distance is 0 or the target couldn't be knocked back.
- WZ_STORMGUST now knocks back on a random direction.


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

skotlex 19 năm trước cách đây
mục cha
commit
39b2650cf0
3 tập tin đã thay đổi với 15 bổ sung1 xóa
  1. 3 0
      Changelog-Trunk.txt
  2. 3 0
      src/map/battle.c
  3. 9 1
      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.  EVERYTHING ELSE
 GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
 
+2006/03/07
+	* Storm Gust now knocks back on a random direction instead of away from the
+	  storm. [Skotlex]
 2006/03/06
 	* Some fixes due to the guild-skill changing location (being moved from
 	  500->900 within the code) [Skotlex]

+ 3 - 0
src/map/battle.c

@@ -2416,6 +2416,9 @@ struct Damage battle_calc_magic_attack(
 			} else
 				ad.blewcount |= 0x10000;
 			break;
+		case WZ_STORMGUST: //Should knockback randomly.
+			ad.blewcount|=0x40000;
+			break;
 		case PR_SANCTUARY:
 			ad.blewcount|=0x10000;
 		case AL_HEAL:

+ 9 - 1
src/map/skill.c

@@ -1466,6 +1466,7 @@ int skill_break_equip(struct block_list *bl, unsigned short where, int rate, int
  If count&0xf00000, the direction is send in the 6th byte.
  If count&0x10000, the direction is to the back of the target, otherwise is away from the src.
  If count&0x20000, position update packets must not be sent.
+ IF count&0X40000, direction is random.
 -------------------------------------------------------------------------*/
 int skill_blown( struct block_list *src, struct block_list *target,int count)
 {
@@ -1482,7 +1483,9 @@ int skill_blown( struct block_list *src, struct block_list *target,int count)
 
 	if (src != target && map_flag_gvg(target->m) && target->type != BL_SKILL)
 		return 0; //No knocking back in WoE, except for skills... because traps CAN be knocked back.
-
+	if (!count&0xffff)
+		return 0; //Actual knockback distance is 0.
+	
 	switch (target->type) {
 		case BL_PC:
 			sd=(struct map_session_data *)target;
@@ -1504,6 +1507,8 @@ int skill_blown( struct block_list *src, struct block_list *target,int count)
 		dir = (count>>20)&0xf;
 	else if (count&0x10000 || (target->x==src->x && target->y==src->y))
 		dir = status_get_dir(target);
+	else if (count&0x40000) //Flag for random pushing.
+		dir = rand()%8;
 	else
 		dir = map_calc_dir(target,src->x,src->y);
 	if (dir>=0 && dir<8){
@@ -1520,6 +1525,9 @@ int skill_blown( struct block_list *src, struct block_list *target,int count)
 	dx = nx - x;
 	dy = ny - y;
 
+	if (!dx && !dy) //Could not knockback.
+		return 0;
+	
 	if(sd)	/* ?–ÊŠO‚É?o‚½‚Ì‚Å?Á‹Ž */
 		map_foreachinmovearea(clif_pcoutsight,target->m,x-AREA_SIZE,y-AREA_SIZE,x+AREA_SIZE,y+AREA_SIZE,dx,dy,BL_ALL,sd);
 	else if(md)