summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.c1
-rw-r--r--src/map/pc.c8
-rw-r--r--src/map/script.c1
-rw-r--r--src/map/skill.h5
4 files changed, 15 insertions, 0 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 7bab524e7..81db5731c 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -6396,6 +6396,7 @@ ACMD_FUNC(uptime)
ACMD_FUNC(changesex)
{
nullpo_retr(-1, sd);
+ pc_resetskill(sd,4);
chrif_changesex(sd);
return 0;
}
diff --git a/src/map/pc.c b/src/map/pc.c
index a91340bf8..c277279c8 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -5804,11 +5804,16 @@ int pc_resetstate(struct map_session_data* sd)
* /resetskill
* if flag&1, perform block resync and status_calc call.
* if flag&2, just count total amount of skill points used by player, do not really reset.
+ * if flag&4, just reset the skills if the player class is a bard/dancer type (for changesex.)
*------------------------------------------*/
int pc_resetskill(struct map_session_data* sd, int flag)
{
int i, lv, inf2, skill_point=0;
nullpo_ret(sd);
+
+ if( flag&4 && (sd->class_&MAPID_UPPERMASK) != MAPID_BARDDANCER )
+ return 0;
+
if( !(flag&2) ) { //Remove stuff lost when resetting skills.
/**
@@ -5865,6 +5870,9 @@ int pc_resetskill(struct map_session_data* sd, int flag)
if( i == NV_BASIC && (sd->class_&MAPID_UPPERMASK) != MAPID_NOVICE )
continue;
+ if( flag&4 && !skill_ischangesex(i) )
+ continue;
+
if( inf2&INF2_QUEST_SKILL && !battle_config.quest_skill_learn )
{ //Only handle quest skills in a special way when you can't learn them manually
if( battle_config.quest_skill_reset && !(flag&2) )
diff --git a/src/map/script.c b/src/map/script.c
index d343d23ae..512a84483 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -9326,6 +9326,7 @@ BUILDIN_FUNC(changesex)
TBL_PC *sd = NULL;
sd = script_rid2sd(st);
+ pc_resetskill(sd,4);
chrif_changesex(sd);
return 0;
}
diff --git a/src/map/skill.h b/src/map/skill.h
index 48867021c..14b051b2e 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -353,6 +353,11 @@ int skill_blockmerc_start (struct mercenary_data*,int,int);
#define skill_blockpc_start(sd, skillid, tick) skill_blockpc_start_( sd, skillid, tick, false )
+// (Epoque:) To-do: replace this macro with some sort of skill tree check (rather than hard-coded skill names)
+#define skill_ischangesex(id) ( \
+ ((id) >= BD_ADAPTATION && (id) <= DC_SERVICEFORYOU) || ((id) >= CG_ARROWVULCAN && (id) <= CG_MARIONETTE) || \
+ ((id) >= CG_LONGINGFREEDOM && (id) <= CG_TAROTCARD) || ((id) >= WA_SWING_DANCE && (id) <= WM_UNLIMITED_HUMMING_VOICE))
+
// スキル攻?一括?理
int skill_attack( int attack_type, struct block_list* src, struct block_list *dsrc,struct block_list *bl,int skillid,int skilllv,unsigned int tick,int flag );