summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-07 17:06:15 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-07 17:06:15 +0000
commit32822845ab08504aa6069edf5c7fb46f2563ec7d (patch)
tree22869496a98e41fd6444968a5deecf9a2435247d /src
parent0ab69f954771d77c509022c4dd6fc968b6bf4691 (diff)
downloadhercules-32822845ab08504aa6069edf5c7fb46f2563ec7d.tar.gz
hercules-32822845ab08504aa6069edf5c7fb46f2563ec7d.tar.bz2
hercules-32822845ab08504aa6069edf5c7fb46f2563ec7d.tar.xz
hercules-32822845ab08504aa6069edf5c7fb46f2563ec7d.zip
- 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5484 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/battle.c3
-rw-r--r--src/map/skill.c10
2 files changed, 12 insertions, 1 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index a215f3af9..81d7a5d11 100644
--- a/src/map/battle.c
+++ b/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:
diff --git a/src/map/skill.c b/src/map/skill.c
index 2ebca1544..c1fab8d91 100644
--- a/src/map/skill.c
+++ b/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たので?チ去 */
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)