# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: /home/lighta/Documents/Myscript/RO/Servs/ramerge/src/map
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: clif.c
--- clif.c Base (BASE)
+++ clif.c Locally Modified (Based On LOCAL)
@@ -4384,46 +4362,68 @@
}
+
/// Notifies the client of a skill unit.
/// 011f <id>.L <creator id>.L <x>.W <y>.W <unit id>.B <visible>.B (ZC_SKILL_ENTRY)
/// 01c9 <id>.L <creator id>.L <x>.W <y>.W <unit id>.B <visible>.B <has msg>.B <msg>.80B (ZC_SKILL_ENTRY2)
-static void clif_getareachar_skillunit(struct map_session_data *sd, struct skill_unit *unit)
+/// 08c7 <lenght>.W <id> L <creator id>.L <x>.W <y>.W <unit id>.B <range>.B <visible>.B (ZC_SKILL_ENTRY3)
+/// 099f <lenght>.W <id> L <creator id>.L <x>.W <y>.W <unit id>.L <range>.B <visible>.B (ZC_SKILL_ENTRY4)
+static void clif_getareachar_skillunit(int type,struct map_session_data *sd, struct skill_unit *unit)
{
int fd = sd->fd;
+ int header=0, unit_id=0, pos=0;
if( unit->group->state.guildaura )
return;
+ if (battle_config.traps_setting&1 && skill_get_inf2(unit->group->skill_id)&INF2_TRAP)
+ unit_id=UNT_DUMMYSKILL; //Use invisible unit id for traps.
+ else if (skill_get_unit_flag(unit->group->skill_id) & UF_RANGEDSINGLEUNIT && !(unit->val2 & UF_RANGEDSINGLEUNIT))
+ unit_id=UNT_DUMMYSKILL; //Use invisible unit id for other case of rangedsingle unit
+ else
+ unit_id=unit->group->unit_id;
+ switch(type){
+ case 2: header=0x1c9; break;
+ case 3: header=0x8c7; break;
+ case 4: header=0x99f; break;
+ default:
+ case 1: header=0x11f; break;
+ }
+
#if PACKETVER >= 3
if(unit->group->unit_id==UNT_GRAFFITI) { // Graffiti [Valaris]
- WFIFOHEAD(fd,packet_len(0x1c9));
- WFIFOW(fd, 0)=0x1c9;
- WFIFOL(fd, 2)=unit->bl.id;
- WFIFOL(fd, 6)=unit->group->src_id;
- WFIFOW(fd,10)=unit->bl.x;
- WFIFOW(fd,12)=unit->bl.y;
- WFIFOB(fd,14)=unit->group->unit_id;
- WFIFOB(fd,15)=1;
- WFIFOB(fd,16)=1;
- safestrncpy((char*)WFIFOP(fd,17),unit->group->valstr,MESSAGE_SIZE);
- WFIFOSET(fd,packet_len(0x1c9));
- return;
+ clif_getareachar_skillunit(2,sd,unit);
}
#endif
- WFIFOHEAD(fd,packet_len(0x11f));
- WFIFOW(fd, 0)=0x11f;
- WFIFOL(fd, 2)=unit->bl.id;
- WFIFOL(fd, 6)=unit->group->src_id;
- WFIFOW(fd,10)=unit->bl.x;
- WFIFOW(fd,12)=unit->bl.y;
- if (battle_config.traps_setting&1 && skill_get_inf2(unit->group->skill_id)&INF2_TRAP)
- WFIFOB(fd,14)=UNT_DUMMYSKILL; //Use invisible unit id for traps.
- else if (skill_get_unit_flag(unit->group->skill_id) & UF_RANGEDSINGLEUNIT && !(unit->val2 & UF_RANGEDSINGLEUNIT))
- WFIFOB(fd,14)=UNT_DUMMYSKILL; //Use invisible unit id for traps.
- else
- WFIFOB(fd,14)=unit->group->unit_id;
- WFIFOB(fd,15)=1; // ignored by client (always gets set to 1)
- WFIFOSET(fd,packet_len(0x11f));
+ WFIFOHEAD(fd,packet_len(header));
+ WFIFOW(fd,pos)=header;
+ if(type==3 || type==4){
+ WFIFOW(fd, pos+2)=packet_len(header);
+ pos +=2;
+ }
+ WFIFOL(fd,pos+2)=unit->bl.id;
+ WFIFOL(fd,pos+6)=unit->group->src_id;
+ WFIFOW(fd,pos+10)=unit->bl.x;
+ WFIFOW(fd,pos+12)=unit->bl.y;
+ switch(type){
+ case 1: WFIFOB(fd,pos+14)=unit_id;
+ WFIFOB(fd,pos+15)=1;
+ break;
+ case 2: WFIFOB(fd,pos+14)=unit_id;
+ WFIFOB(fd,pos+15)=1;
+ WFIFOB(fd,pos+16)=1;
+ safestrncpy((char*)WFIFOP(fd,pos+17),unit->group->valstr,MESSAGE_SIZE);
+ break;
+ case 3: WFIFOB(fd,pos+14)=unit_id;
+ WFIFOB(fd,pos+15)=unit->range;
+ WFIFOB(fd,pos+15)=1; //visible
+ break;
+ case 4: WFIFOL(fd,pos+14)=unit_id; pos += 3;
+ WFIFOB(fd,pos+15)=unit->range;
+ WFIFOB(fd,pos+15)=1;
+ break;
+ }
+ WFIFOSET(fd,packet_len(header));
if(unit->group->skill_id == WZ_ICEWALL)
clif_changemapcell(fd,unit->bl.m,unit->bl.x,unit->bl.y,5,SELF);
@@ -4495,7 +4495,7 @@
clif_getareachar_item(sd,(struct flooritem_data*) bl);
break;
case BL_SKILL:
- clif_getareachar_skillunit(sd,(TBL_SKILL*)bl);
+ clif_getareachar_skillunit(1,sd,(TBL_SKILL*)bl);
break;
default:
if(&sd->bl == bl)
@@ -4519,8 +4519,7 @@
sd = BL_CAST(BL_PC, bl);
tsd = BL_CAST(BL_PC, tbl);
- if (tsd && tsd->fd)
- { //tsd has lost sight of the bl object.
+ if (tsd && tsd->fd) { //tsd has lost sight of the bl object.
switch(bl->type){
case BL_PC:
if (sd->vd.class_ != INVISIBLE_CLASS)
@@ -4552,8 +4551,7 @@
break;
}
}
- if (sd && sd->fd)
- { //sd is watching tbl go out of view.
+ if (sd && sd->fd) { //sd is watching tbl go out of view.
if (((vd=status_get_viewdata(tbl)) && vd->class_ != INVISIBLE_CLASS) &&
!(tbl->type == BL_NPC && (((TBL_NPC*)tbl)->sc.option&OPTION_INVISIBLE)))
clif_clearunit_single(tbl->id,CLR_OUTSIGHT,sd->fd);
@@ -4575,22 +4573,20 @@
sd = BL_CAST(BL_PC, bl);
tsd = BL_CAST(BL_PC, tbl);
- if (tsd && tsd->fd)
- { //Tell tsd that bl entered into his view
+ if (tsd && tsd->fd) { //Tell tsd that bl entered into his view
switch(bl->type){
case BL_ITEM:
clif_getareachar_item(tsd,(struct flooritem_data*)bl);
break;
case BL_SKILL:
- clif_getareachar_skillunit(tsd,(TBL_SKILL*)bl);
+ clif_getareachar_skillunit(1,tsd,(TBL_SKILL*)bl);
break;
default:
clif_getareachar_unit(tsd,bl);
break;
}
}
- if (sd && sd->fd)
- { //Tell sd that tbl walked into his view
+ if (sd && sd->fd) { //Tell sd that tbl walked into his view
clif_getareachar_unit(sd,tbl);
}
return 0;