From 32822845ab08504aa6069edf5c7fb46f2563ec7d Mon Sep 17 00:00:00 2001 From: skotlex Date: Tue, 7 Mar 2006 17:06:15 +0000 Subject: - 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 --- Changelog-Trunk.txt | 3 +++ src/map/battle.c | 3 +++ src/map/skill.c | 10 +++++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 788e0e64a..9de514881 100644 --- a/Changelog-Trunk.txt +++ b/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] 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) -- cgit v1.2.3-70-g09d2