summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.c2
-rw-r--r--src/map/chrif.c4
-rw-r--r--src/map/clif.c57
-rw-r--r--src/map/clif.h2
-rw-r--r--src/map/pc.c6
-rw-r--r--src/map/skill.c8
6 files changed, 71 insertions, 8 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index d0910265b..ceb8ddb42 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -3705,7 +3705,7 @@ int atcommand_lostskill(const int fd, struct map_session_data* sd, const char* c
sd->status.skill[skill_id].lv = 0;
sd->status.skill[skill_id].flag = 0;
- clif_skillinfoblock(sd);
+ clif_deleteskill(sd,skill_id);
clif_displaymessage(fd, msg_txt(71)); // You have forgotten the skill.
return 0;
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 9b0f7f875..eaedb8a4d 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -928,7 +928,7 @@ int chrif_deadopt(int father_id, int mother_id, int child_id)
sd->status.skill[WE_CALLBABY].id = 0;
sd->status.skill[WE_CALLBABY].lv = 0;
sd->status.skill[WE_CALLBABY].flag = 0;
- clif_skillinfoblock(sd);
+ clif_deleteskill(sd,WE_CALLBABY);
}
if( mother_id && (sd = map_charid2sd(mother_id)) != NULL && sd->status.child == child_id )
@@ -937,7 +937,7 @@ int chrif_deadopt(int father_id, int mother_id, int child_id)
sd->status.skill[WE_CALLBABY].id = 0;
sd->status.skill[WE_CALLBABY].lv = 0;
sd->status.skill[WE_CALLBABY].flag = 0;
- clif_skillinfoblock(sd);
+ clif_deleteskill(sd,WE_CALLBABY);
}
return 0;
diff --git a/src/map/clif.c b/src/map/clif.c
index f9981d176..5b0b17b59 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -4103,6 +4103,58 @@ int clif_skillinfoblock(struct map_session_data *sd)
return 1;
}
+int clif_addskill(struct map_session_data *sd, int id )
+{
+ int fd;
+
+ nullpo_retr(0, sd);
+
+ fd = sd->fd;
+ if (!fd) return 0;
+
+ if( sd->status.skill[id].id <= 0 )
+ return 0;
+
+ WFIFOHEAD(fd, packet_len(0x111));
+ WFIFOW(fd,0) = 0x111;
+ WFIFOW(fd,2) = id;
+ WFIFOW(fd,4) = sd->status.skill[id].lv;
+ WFIFOW(fd,6) = 0;
+ if( (id == MO_EXTREMITYFIST && sd->state.combo&1) || (id == TK_JUMPKICK && sd->state.combo&2) )
+ WFIFOW(fd,8) = INF_SELF_SKILL;
+ else
+ WFIFOW(fd,8) = skill_get_inf(id);
+ WFIFOW(fd,10) = skill_get_sp(id,sd->status.skill[id].lv);
+ WFIFOW(fd,12)= skill_get_range2(&sd->bl, id,sd->status.skill[id].lv);
+ safestrncpy((char*)WFIFOP(fd,14), skill_get_name(id), NAME_LENGTH);
+ if( sd->status.skill[id].flag == 0 )
+ WFIFOB(fd,38) = (sd->status.skill[id].lv < skill_tree_get_max(id, sd->status.class_))? 1:0;
+ else
+ WFIFOB(fd,38) = 0;
+ WFIFOSET(fd,packet_len(0x111));
+
+ return 1;
+}
+
+int clif_deleteskill(struct map_session_data *sd, int id)
+{
+#if PACKETVER >= 20081217
+ int fd;
+
+ nullpo_retr(0, sd);
+ fd = sd->fd;
+ if( !fd ) return 0;
+
+ WFIFOHEAD(fd,packet_len(0x441));
+ WFIFOW(fd,0) = 0x441;
+ WFIFOW(fd,2) = id;
+ WFIFOSET(fd,packet_len(0x441));
+ return 1;
+#else
+ return clif_skillinfoblock(sd);
+#endif
+}
+
/*==========================================
* スキル割り振り通知
*------------------------------------------*/
@@ -9509,6 +9561,9 @@ void clif_parse_ChangeCart(int fd,struct map_session_data *sd)
{
int type;
+ if( sd && pc_checkskill(sd, MC_CHANGECART) < 1 )
+ return;
+
type = (int)RFIFOW(fd,2);
if( (type == 5 && sd->status.base_level > 90) ||
@@ -13691,7 +13746,7 @@ static int packetdb_readdb(void)
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 25,
//#0x0440
- 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 4, 0, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
diff --git a/src/map/clif.h b/src/map/clif.h
index fd9bea645..719c3029e 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -192,6 +192,8 @@ int clif_mob_equip(struct mob_data *md,int nameid); // [Valaris]
int clif_skillinfo(struct map_session_data *sd,int skillid,int type,int range);
int clif_skillinfoblock(struct map_session_data *sd);
int clif_skillup(struct map_session_data *sd,int skill_num);
+int clif_addskill(struct map_session_data *sd, int skill);
+int clif_deleteskill(struct map_session_data *sd, int skill);
int clif_skillcasting(struct block_list* bl,int src_id,int dst_id,int dst_x,int dst_y,int skill_num,int pl,int casttime);
int clif_skillcastcancel(struct block_list* bl);
diff --git a/src/map/pc.c b/src/map/pc.c
index 5f724012f..c853bd452 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -2961,10 +2961,14 @@ int pc_skill(TBL_PC* sd, int id, int level, int flag)
sd->status.skill[id].lv = level;
sd->status.skill[id].flag = 0;
if( !level ) //Remove skill.
+ {
sd->status.skill[id].id = 0;
+ clif_deleteskill(sd,id);
+ }
+ else
+ clif_addskill(sd,id);
if( !skill_get_inf(id) ) //Only recalculate for passive skills.
status_calc_pc(sd, 0);
- clif_skillinfoblock(sd);
break;
case 2: //Add skill bonus on top of what you had.
if( sd->status.skill[id].id == id ){
diff --git a/src/map/skill.c b/src/map/skill.c
index 52b96383f..621454760 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1864,18 +1864,20 @@ int skill_attack (int attack_type, struct block_list* src, struct block_list *ds
tsd->status.skill[tsd->cloneskill_id].id = 0;
tsd->status.skill[tsd->cloneskill_id].lv = 0;
tsd->status.skill[tsd->cloneskill_id].flag = 0;
+ clif_deleteskill(tsd,tsd->cloneskill_id);
}
if ((type = pc_checkskill(tsd,RG_PLAGIARISM)) < lv)
lv = type;
tsd->cloneskill_id = skillid;
+ pc_setglobalreg(tsd, "CLONE_SKILL", skillid);
+ pc_setglobalreg(tsd, "CLONE_SKILL_LV", lv);
+
tsd->status.skill[skillid].id = skillid;
tsd->status.skill[skillid].lv = lv;
tsd->status.skill[skillid].flag = 13;//cloneskill flag
- pc_setglobalreg(tsd, "CLONE_SKILL", skillid);
- pc_setglobalreg(tsd, "CLONE_SKILL_LV", lv);
- clif_skillinfoblock(tsd);
+ clif_addskill(tsd,skillid);
}
}
if( skillid != WZ_SIGHTRASHER &&