summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-01 02:23:56 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-01 02:23:56 +0000
commit53796ffafd6eb381595b77cda1b039d795940e68 (patch)
treea33bec85a09564086f6b356a9e6d0e0797e9b079 /src/map/skill.c
parent454ae6b78937da966545207b94b1e0a037fdb098 (diff)
downloadhercules-53796ffafd6eb381595b77cda1b039d795940e68.tar.gz
hercules-53796ffafd6eb381595b77cda1b039d795940e68.tar.bz2
hercules-53796ffafd6eb381595b77cda1b039d795940e68.tar.xz
hercules-53796ffafd6eb381595b77cda1b039d795940e68.zip
- Added structure view_data to handle sprite information for all characters (equipment, weapons, hair, dyes, etc). Unified a bunch of clif functions now that you only need to handle the view_data (so instead of clif_spawn[pc/mob/npc/pet] you just have clif_spawn)
- Fixed the clif_change_class packet (it should check for non players classes, not a class above MAX_PC_CLASS), it fixes morphing enemies. - Rewrote the way cloth dye packets are resent to optimize bandwidth usage. - Fixed the npc_item_flag thing (enable_items/disable_items script command) - Rewrote the disguise implementation to be bandwidth friendly. - Modified the hide options to change your class to INVISIBLE_CLASS, since such classes don't even get their view packets sent around. - Rewrote several clif functions to adapt to the new view_data class; - Added class 139 to npcdb_checkid which was required by some npcs in the swordman quest? o.O git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5833 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c47
1 files changed, 14 insertions, 33 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index d30ae2d26..24054ed46 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1580,13 +1580,9 @@ int skill_blown( struct block_list *src, struct block_list *target,int count)
int dx=0,dy=0,nx,ny;
int x=target->x,y=target->y;
int dir,ret;
- struct map_session_data *sd=NULL;
- struct mob_data *md=NULL;
- struct pet_data *pd=NULL;
struct skill_unit *su=NULL;
nullpo_retr(0, src);
- nullpo_retr(0, target);
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.
@@ -1594,22 +1590,13 @@ int skill_blown( struct block_list *src, struct block_list *target,int count)
return 0; //Actual knockback distance is 0.
switch (target->type) {
- case BL_PC:
- sd=(struct map_session_data *)target;
- break;
case BL_MOB:
- md=(struct mob_data *)target;
- if (md->class_ == MOBID_EMPERIUM)
+ if (((TBL_MOB*)target)->class_ == MOBID_EMPERIUM)
return 0;
break;
- case BL_PET:
- pd=(struct pet_data *)target;
- break;
case BL_SKILL:
su=(struct skill_unit *)target;
break;
- default:
- return 0;
}
if (count&0xf00000)
@@ -1628,8 +1615,9 @@ int skill_blown( struct block_list *src, struct block_list *target,int count)
ret=path_blownpos(target->m,x,y,dx,dy,count&0xffff);
nx=ret>>16;
ny=ret&0xffff;
-
- unit_stop_walking(target,0);
+
+ if (!su)
+ unit_stop_walking(target,0);
dx = nx - x;
dy = ny - y;
@@ -1637,26 +1625,19 @@ int skill_blown( struct block_list *src, struct block_list *target,int count)
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)
- map_foreachinmovearea(clif_moboutsight,target->m,x-AREA_SIZE,y-AREA_SIZE,x+AREA_SIZE,y+AREA_SIZE,dx,dy,BL_PC,md);
- else if(pd)
- map_foreachinmovearea(clif_petoutsight,target->m,x-AREA_SIZE,y-AREA_SIZE,x+AREA_SIZE,y+AREA_SIZE,dx,dy,BL_PC,pd);
+ map_foreachinmovearea(clif_outsight,target->m,
+ x-AREA_SIZE,y-AREA_SIZE,x+AREA_SIZE,y+AREA_SIZE,
+ dx,dy,target->type==BL_PC?BL_ALL:BL_PC,target);
- if(su){
+ if(su)
skill_unit_move_unit_group(su->group,target->m,dx,dy);
- }else{
+ else
map_moveblock(target, nx, ny, gettick());
- }
-
- if(sd) /* ?面?に入ってきたので表示 */
- map_foreachinmovearea(clif_pcinsight,target->m,nx-AREA_SIZE,ny-AREA_SIZE,nx+AREA_SIZE,ny+AREA_SIZE,-dx,-dy,BL_ALL,sd);
- else if(md)
- map_foreachinmovearea(clif_mobinsight,target->m,nx-AREA_SIZE,ny-AREA_SIZE,nx+AREA_SIZE,ny+AREA_SIZE,-dx,-dy,BL_PC,md);
- else if(pd)
- map_foreachinmovearea(clif_petinsight,target->m,nx-AREA_SIZE,ny-AREA_SIZE,nx+AREA_SIZE,ny+AREA_SIZE,-dx,-dy,BL_PC,pd);
+ map_foreachinmovearea(clif_insight,target->m,
+ nx-AREA_SIZE,ny-AREA_SIZE,nx+AREA_SIZE,ny+AREA_SIZE,
+ -dx,-dy,target->type==BL_PC?BL_ALL:BL_PC,target);
+
if(!(count&0x20000))
clif_blown(target);
@@ -8826,7 +8807,7 @@ int skill_frostjoke_scream(struct block_list *bl,va_list ap)
return 0;
if (bl->type == BL_PC) {
struct map_session_data *sd = (struct map_session_data *)bl;
- if (sd && sd->sc.option & OPTION_INVISIBLE && pc_isGM(sd) > 0)
+ if (sd && sd->sc.option&OPTION_INVISIBLE)
return 0;
}
//It has been reported that Scream/Joke works the same regardless of woe-setting. [Skotlex]