summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-08-07 13:21:51 -0300
committershennetsind <ind@henn.et>2013-08-07 13:21:51 -0300
commit46a6fdb7374f5fe9301b9d23289f563c6f7fb4f9 (patch)
treebd4c8c4bda9e95208eed294ad09a30e6fca37ba5 /src
parentc1dca647670c1b55bcd66c82958fcd8180115fac (diff)
downloadhercules-46a6fdb7374f5fe9301b9d23289f563c6f7fb4f9.tar.gz
hercules-46a6fdb7374f5fe9301b9d23289f563c6f7fb4f9.tar.bz2
hercules-46a6fdb7374f5fe9301b9d23289f563c6f7fb4f9.tar.xz
hercules-46a6fdb7374f5fe9301b9d23289f563c6f7fb4f9.zip
Fixed skill flagging (mostly related to SKILL_FLAG_REPLACED_LV_0 )
Adjusted value as to not conflict with the perm_granted flag Special Thanks to Wildcard, malufett. Also made pc_skillup rely on the change_level_2nd/3rd vars instead of hardcoded values, and added a pc_gainexp packetver check that'd otherwise cause map server warnings when within the range. Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src')
-rw-r--r--src/common/mmo.h6
-rw-r--r--src/map/pc.c22
2 files changed, 16 insertions, 12 deletions
diff --git a/src/common/mmo.h b/src/common/mmo.h
index 34a79bbb2..a297d94d9 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -230,9 +230,11 @@ enum e_skill_flag
SKILL_FLAG_PERMANENT,
SKILL_FLAG_TEMPORARY,
SKILL_FLAG_PLAGIARIZED,
- SKILL_FLAG_REPLACED_LV_0, // Temporary skill overshadowing permanent skill of level 'N - SKILL_FLAG_REPLACED_LV_0',
+ SKILL_FLAG_UNUSED, /* needed to maintain the order since the values are saved, can be renamed and used if a new flag is necessary */
SKILL_FLAG_PERM_GRANTED, // Permanent, granted through someway (e.g. script).
- //...
+ /* */
+ /* MUST be the last, because with it the flag value stores a dynamic value (flag+lv) */
+ SKILL_FLAG_REPLACED_LV_0, // Temporary skill overshadowing permanent skill of level 'N - SKILL_FLAG_REPLACED_LV_0',
};
enum e_mmo_charstatus_opt {
diff --git a/src/map/pc.c b/src/map/pc.c
index 48172ba5c..f29c590b3 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1353,7 +1353,7 @@ static int pc_calc_skillpoint(struct map_session_data* sd)
) {
if(sd->status.skill[i].flag == SKILL_FLAG_PERMANENT)
skill_point += skill_lv;
- else if(sd->status.skill[i].flag == SKILL_FLAG_REPLACED_LV_0)
+ else if(sd->status.skill[i].flag >= SKILL_FLAG_REPLACED_LV_0)
skill_point += (sd->status.skill[i].flag - SKILL_FLAG_REPLACED_LV_0);
}
}
@@ -1606,7 +1606,7 @@ int pc_clean_skilltree(struct map_session_data *sd)
sd->status.skill[i].id = 0;
sd->status.skill[i].lv = 0;
sd->status.skill[i].flag = 0;
- } else if (sd->status.skill[i].flag == SKILL_FLAG_REPLACED_LV_0) {
+ } else if (sd->status.skill[i].flag >= SKILL_FLAG_REPLACED_LV_0) {
sd->status.skill[i].lv = sd->status.skill[i].flag - SKILL_FLAG_REPLACED_LV_0;
sd->status.skill[i].flag = 0;
}
@@ -5956,10 +5956,13 @@ int pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned int
clif->updatestatus(sd,SP_JOBEXP);
}
+#if PACKETVER >= 20091027
if(base_exp)
clif->displayexp(sd, base_exp, SP_BASEEXP, quest);
if(job_exp)
clif->displayexp(sd, job_exp, SP_JOBEXP, quest);
+#endif
+
if(sd->state.showexp) {
char output[256];
sprintf(output,
@@ -6242,9 +6245,9 @@ int pc_skillup(struct map_session_data *sd,uint16 skill_id) {
}
if( can_skip ) break;
-
- if( pts < 40 ) {
- clif->msg_value(sd, 0x61E, 40 - pts);
+
+ if( pts < sd->change_level_2nd ) {
+ clif->msg_value(sd, 0x61E, sd->change_level_2nd - pts);
return 0;
}
@@ -6271,9 +6274,9 @@ int pc_skillup(struct map_session_data *sd,uint16 skill_id) {
}
if( can_skip ) break;
-
- if( pts_second - pts < ( is_trans ? 70 : 50 ) ) {
- clif->msg_value(sd, 0x61F, ( is_trans ? 70 : 50 ) - (pts_second - pts));
+
+ if( pts_second - pts < sd->change_level_3rd ) {
+ clif->msg_value(sd, 0x61F, sd->change_level_3rd - (pts_second - pts));
return 0;
}
}
@@ -6604,8 +6607,7 @@ int pc_resetskill(struct map_session_data* sd, int flag)
}
if( sd->status.skill[i].flag == SKILL_FLAG_PERMANENT )
skill_point += lv;
- else
- if( sd->status.skill[i].flag == SKILL_FLAG_REPLACED_LV_0 )
+ else if( sd->status.skill[i].flag >= SKILL_FLAG_REPLACED_LV_0 )
skill_point += (sd->status.skill[i].flag - SKILL_FLAG_REPLACED_LV_0);
if( !(flag&2) ) {// reset