diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-12-12 14:53:53 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-12-12 14:53:53 +0000 |
commit | 3fec823429f792645dfd3ad34aed536086f81dfa (patch) | |
tree | 6b8edceeb025455619ff9e20b8f64f5dd547a024 /src | |
parent | 61622fe4e4875e2cadc8ede3f1a60f5e8cca89a5 (diff) | |
download | hercules-3fec823429f792645dfd3ad34aed536086f81dfa.tar.gz hercules-3fec823429f792645dfd3ad34aed536086f81dfa.tar.bz2 hercules-3fec823429f792645dfd3ad34aed536086f81dfa.tar.xz hercules-3fec823429f792645dfd3ad34aed536086f81dfa.zip |
- Modified the skill damage packet and the knockback packets to mimic aegis sent packets for such skills.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9471 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/map/clif.c | 26 | ||||
-rw-r--r-- | src/map/clif.h | 2 | ||||
-rw-r--r-- | src/map/script.c | 4 | ||||
-rw-r--r-- | src/map/skill.c | 18 | ||||
-rw-r--r-- | src/map/unit.c | 2 |
5 files changed, 32 insertions, 20 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index bc4ade158..a1fc5447d 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -1865,8 +1865,8 @@ int clif_changemapserver(struct map_session_data *sd, char *mapname, int x, int int clif_blown(struct block_list *bl) { //Aegis packets says fixpos, but it's unsure whether slide works better or not. -// return clif_fixpos(bl); - return clif_slide(bl, bl->x, bl->y); + return clif_fixpos(bl); +// return clif_slide(bl, bl->x, bl->y); } /*========================================== * @@ -4515,7 +4515,7 @@ int clif_skill_fail(struct map_session_data *sd,int skill_id,int type,int btype) *------------------------------------------ */ int clif_skill_damage(struct block_list *src,struct block_list *dst, - unsigned int tick,int sdelay,int ddelay,int damage,int div,int skill_id,int skill_lv,int type) + unsigned int tick,int sdelay,int ddelay,int damage,int div,int skill_id,int skill_lv,int type,int flag) { unsigned char buf[64]; struct status_change *sc; @@ -4540,13 +4540,19 @@ int clif_skill_damage(struct block_list *src,struct block_list *dst, WBUFL(buf,12)=tick; WBUFL(buf,16)=sdelay; WBUFL(buf,20)=ddelay; + WBUFW(buf,26)=skill_lv; + WBUFW(buf,28)=div; + if (flag && src->type == BL_PC) + { //Needed for appropiate knockback on the receiving client. + WBUFW(buf,24)=-30000; + WBUFB(buf,30)=6; + clif_send(buf,packet_len_table[0x114],src,SELF); + } if (battle_config.hide_woe_damage && map_flag_gvg(src->m)) { WBUFW(buf,24)=damage?div:0; } else { WBUFW(buf,24)=damage; } - WBUFW(buf,26)=skill_lv; - WBUFW(buf,28)=div; WBUFB(buf,30)=type; clif_send(buf,packet_len_table[0x114],src,AREA); if(disguised(src)) { @@ -4571,13 +4577,19 @@ int clif_skill_damage(struct block_list *src,struct block_list *dst, WBUFL(buf,12)=tick; WBUFL(buf,16)=sdelay; WBUFL(buf,20)=ddelay; + WBUFW(buf,28)=skill_lv; + WBUFW(buf,30)=div; + if (flag && src->type == BL_PC) + { //Needed for appropiate knockback on the receiving client. + WBUFL(buf,24)=-30000; + WBUFB(buf,32)=6; + clif_send(buf,packet_len_table[0x114],src,SELF); + } if (battle_config.hide_woe_damage && map_flag_gvg(src->m)) { WBUFL(buf,24)=damage?div:0; } else { WBUFL(buf,24)=damage; } - WBUFW(buf,28)=skill_lv; - WBUFW(buf,30)=div; WBUFB(buf,32)=type; clif_send(buf,packet_len_table[0x1de],src,AREA); if(disguised(src)) { diff --git a/src/map/clif.h b/src/map/clif.h index 70b28acc2..7fabcb68a 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -176,7 +176,7 @@ int clif_skillcastcancel(struct block_list* bl); int clif_skill_fail(struct map_session_data *sd,int skill_id,int type,int btype); int clif_skill_damage(struct block_list *src,struct block_list *dst, unsigned int tick,int sdelay,int ddelay,int damage,int div, - int skill_id,int skill_lv,int type); + int skill_id,int skill_lv,int type, int flag); int clif_skill_damage2(struct block_list *src,struct block_list *dst, unsigned int tick,int sdelay,int ddelay,int damage,int div, int skill_id,int skill_lv,int type); diff --git a/src/map/script.c b/src/map/script.c index eb9abb8a3..1703aac8f 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -8688,8 +8688,8 @@ static int buildin_maprespawnguildid_sub_pc(DBKey key, void *data, va_list ap) if(!sd || sd->bl.m != m) return 0; if( - ((sd->status.guild_id == g_id) && flag&1) || //Warp out owners - ((sd->status.guild_id != g_id) && flag&2) || //Warp out outsiders + (sd->status.guild_id == g_id && flag&1) || //Warp out owners + (sd->status.guild_id != g_id && flag&2) || //Warp out outsiders (sd->status.guild_id == 0) // Warp out players not in guild [Valaris] ) pc_setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,3); diff --git a/src/map/skill.c b/src/map/skill.c index c623edd7f..fc440ecf0 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -1731,7 +1731,6 @@ int skill_break_equip (struct block_list *bl, unsigned short where, int rate, in 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 skill_unit *su=NULL; @@ -1767,15 +1766,15 @@ int skill_blown (struct block_list *src, struct block_list *target, int count) dy = -diry[dir]; } - ret=path_blownpos(target->m,x,y,dx,dy,count&0xffff); + ret=path_blownpos(target->m,target->x,target->y,dx,dy,count&0xffff); nx=ret>>16; ny=ret&0xffff; if (!su) unit_stop_walking(target,0); - dx = nx - x; - dy = ny - y; + dx = nx - target->x; + dy = ny - target->y; if (!dx && !dy) //Could not knockback. return 0; @@ -1794,8 +1793,9 @@ int skill_blown (struct block_list *src, struct block_list *target, int count) if(!(count&0x20000)) clif_blown(target); - if(target->type == BL_PC && map_getcell(target->m,x,y,CELL_CHKNPC)) - npc_touch_areanpc((TBL_PC*)target,target->m,x,y); //Invoke area NPC + if(target->type == BL_PC && + map_getcell(target->m, target->x, target->y, CELL_CHKNPC)) + npc_touch_areanpc((TBL_PC*)target, target->m, target->x, target->y); //Invoke area NPC return (count&0xFFFF); //Return amount of knocked back cells. } @@ -2017,7 +2017,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds //Display damage. switch(skillid){ case PA_GOSPEL: //Should look like Holy Cross [Skotlex] - dmg.dmotion = clif_skill_damage(dsrc,bl,tick,dmg.amotion,dmg.dmotion, damage, dmg.div_, CR_HOLYCROSS, -1, 5); + dmg.dmotion = clif_skill_damage(dsrc,bl,tick,dmg.amotion,dmg.dmotion, damage, dmg.div_, CR_HOLYCROSS, -1, 5, dmg.blewcount); break; //Skills that need be passed as a normal attack for the client to display correctly. case HVAN_EXPLOSION: @@ -2045,7 +2045,7 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds //Disabling skill animation doesn't works on multi-hit. dmg.dmotion = clif_skill_damage(dsrc,bl,tick, dmg.amotion, dmg.dmotion, damage, dmg.div_, skillid, flag&SD_LEVEL?-1:skilllv, - (flag&SD_ANIMATION && dmg.div_ < 2?5:type)); + (flag&SD_ANIMATION && dmg.div_ < 2?5:type), dmg.blewcount); break; } @@ -5771,7 +5771,7 @@ int skill_castend_id (int tid, unsigned int tick, int id, int data) if (unit_movepos(src, src->x+dx, src->y+dy, 1, 1)) { //Display movement + animation. clif_slide(src,src->x,src->y); - clif_skill_damage(src,target,tick,sd->battle_status.amotion,0,0,1,ud->skillid, ud->skilllv, 5); + clif_skill_damage(src,target,tick,sd->battle_status.amotion,0,0,1,ud->skillid, ud->skilllv, 5, 0); } clif_skill_fail(sd,ud->skillid,0,0); } diff --git a/src/map/unit.c b/src/map/unit.c index f48f4a951..4997f13b2 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -145,7 +145,7 @@ static int unit_walktoxy_timer(int tid,unsigned int tick,int id,int data) // バシリカ判定 - map_foreachinmovearea(clif_outsight,bl, AREA_SIZE, + map_foreachinmovearea(clif_outsight, bl, AREA_SIZE, dx, dy, sd?BL_ALL:BL_PC, bl); x += dx; |