diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/clif.c | 30 | ||||
-rw-r--r-- | src/map/clif.h | 1 | ||||
-rw-r--r-- | src/map/skill.c | 12 |
3 files changed, 37 insertions, 6 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 21c8bcbcc..f43b1afbd 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2715,6 +2715,36 @@ int clif_changelook(struct block_list *bl,int type,int val) return 0;
}
+//Sends a change-base-look packet required for traps as they are triggered.
+void clif_changetraplook(struct block_list *bl,int val)
+{
+ unsigned char buf[32];
+#if PACKETVER < 4
+ WBUFW(buf,0)=0xc3;
+ WBUFL(buf,2)=bl->id;
+ WBUFB(buf,6)=LOOK_BASE;
+ WBUFB(buf,7)=val;
+ clif_send(buf,packet_len_table[0xc3],bl,AREA);
+#else
+ if (val > 255)
+ {
+ WBUFW(buf,0)=0x1d7;
+ WBUFL(buf,2)=bl->id;
+ WBUFB(buf,6)=LOOK_BASE;
+ WBUFW(buf,7)=val;
+ WBUFW(buf,9)=0;
+ clif_send(buf,packet_len_table[0x1d7],bl,AREA);
+ } else {
+ WBUFW(buf,0)=0xc3;
+ WBUFL(buf,2)=bl->id;
+ WBUFB(buf,6)=LOOK_BASE;
+ WBUFB(buf,7)=val;
+ clif_send(buf,packet_len_table[0xc3],bl,AREA);
+ }
+#endif
+
+
+}
//For the stupid cloth-dye bug. Resends the given view data
//to the area specified by bl.
void clif_refreshlook(struct block_list *bl,int id,int type,int val,int area)
diff --git a/src/map/clif.h b/src/map/clif.h index c30610cfb..252a707f8 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -77,6 +77,7 @@ int clif_changestatus(struct block_list*,int,int); //area int clif_damage(struct block_list *,struct block_list *,unsigned int,int,int,int,int,int,int); // area
#define clif_takeitem(src,dst) clif_damage(src,dst,0,0,0,0,0,1,0)
int clif_changelook(struct block_list *,int,int); // area
+void clif_changetraplook(struct block_list *bl,int val); // area
void clif_refreshlook(struct block_list *bl,int id,int type,int val,int area); //area specified in 'area'
int clif_arrowequip(struct map_session_data *sd,int val); //self
int clif_arrow_fail(struct map_session_data *sd,int type); //self
diff --git a/src/map/skill.c b/src/map/skill.c index 24054ed46..df37fd79b 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -5107,7 +5107,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in case UNT_CLAYMORETRAP:
case UNT_TALKIEBOX:
su->group->unit_id = UNT_USED_TRAPS;
- clif_changelook(bl,LOOK_BASE,su->group->unit_id);
+ clif_changetraplook(bl, UNT_USED_TRAPS);
su->group->limit=DIFF_TICK(tick+1500,su->group->tick);
su->limit=DIFF_TICK(tick+1500,su->group->tick);
}
@@ -6845,7 +6845,7 @@ int skill_unit_onplace_timer(struct skill_unit *src,struct block_list *bl,unsign {
skill_blown(&src->bl,bl,skill_get_blewcount(sg->skill_id,sg->skill_lv)|0x10000);
sg->unit_id = UNT_USED_TRAPS;
- clif_changelook(&src->bl,LOOK_BASE,sg->unit_id);
+ clif_changetraplook(&src->bl, UNT_USED_TRAPS);
sg->limit=DIFF_TICK(tick,sg->tick)+1500;
sg->val3 = BD_INTOABYSS; //Prevent Remove Trap from giving you the trap back. [Skotlex]
}
@@ -6882,7 +6882,7 @@ int skill_unit_onplace_timer(struct skill_unit *src,struct block_list *bl,unsign case UNT_LANDMINE:
skill_attack(BF_MISC,ss,&src->bl,bl,sg->skill_id,sg->skill_lv,tick,0);
sg->unit_id = UNT_USED_TRAPS;
- clif_changelook(&src->bl,LOOK_BASE,UNT_FIREPILLAR_ACTIVE);
+ clif_changetraplook(&src->bl, UNT_FIREPILLAR_ACTIVE);
sg->limit=DIFF_TICK(tick,sg->tick)+1500;
sg->val3 = BD_INTOABYSS; //Prevent Remove Trap from giving you the trap back. [Skotlex]
break;
@@ -6900,7 +6900,7 @@ int skill_unit_onplace_timer(struct skill_unit *src,struct block_list *bl,unsign skill_get_splash(sg->skill_id, sg->skill_lv), sg->bl_flag,
&src->bl,tick,splash_count);
sg->unit_id = UNT_USED_TRAPS;
- clif_changelook(&src->bl,LOOK_BASE,sg->unit_id);
+ clif_changetraplook(&src->bl, UNT_USED_TRAPS);
sg->limit=DIFF_TICK(tick,sg->tick)+1500;
sg->val3 = BD_INTOABYSS; //Prevent Remove Trap from giving you the trap back. [Skotlex]
break;
@@ -6911,7 +6911,7 @@ int skill_unit_onplace_timer(struct skill_unit *src,struct block_list *bl,unsign if (sg->val2 == 0){
clif_talkiebox(&src->bl, sg->valstr);
sg->unit_id = UNT_USED_TRAPS;
- clif_changelook(&src->bl, LOOK_BASE, sg->unit_id);
+ clif_changetraplook(&src->bl, UNT_USED_TRAPS);
sg->limit = DIFF_TICK(tick, sg->tick) + 5000;
sg->val2 = -1; //“¥‚ñ‚¾
sg->val3 = BD_INTOABYSS; //Prevent Remove Trap from giving you the trap back. [Skotlex]
@@ -9592,7 +9592,7 @@ int skill_unit_timer_sub( struct block_list *bl, va_list ap ) switch(group->unit_id){
case UNT_BLASTMINE:
group->unit_id = UNT_USED_TRAPS;
- clif_changelook(bl,LOOK_BASE,group->unit_id);
+ clif_changetraplook(bl, UNT_USED_TRAPS);
group->limit=DIFF_TICK(tick+1500,group->tick);
unit->limit=DIFF_TICK(tick+1500,group->tick);
break;
|