summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2019-09-01 19:09:49 +0300
committerAndrei Karas <akaras@inbox.ru>2019-09-18 22:31:51 +0300
commitc2445e45345967a7a80202e794f680e31b1e9b0d (patch)
tree247e69f793d67350dc5549dc86486b60aa3edffa
parente55f9bce0d224ff517d21112bb323872fbc3ba70 (diff)
downloadhercules-c2445e45345967a7a80202e794f680e31b1e9b0d.tar.gz
hercules-c2445e45345967a7a80202e794f680e31b1e9b0d.tar.bz2
hercules-c2445e45345967a7a80202e794f680e31b1e9b0d.tar.xz
hercules-c2445e45345967a7a80202e794f680e31b1e9b0d.zip
Add at command for change char sex
New at command: @changecharsex
-rw-r--r--doc/atcommands.txt6
-rw-r--r--src/map/atcommand.c13
2 files changed, 19 insertions, 0 deletions
diff --git a/doc/atcommands.txt b/doc/atcommands.txt
index 139295973..0b4dce579 100644
--- a/doc/atcommands.txt
+++ b/doc/atcommands.txt
@@ -1059,6 +1059,12 @@ Changes the gender attached to the player's account.
---------------------------------------
+@changecharsex
+
+Changes the gender attached to the player's character.
+
+---------------------------------------
+
@marry <player 1> <player 2>
@divorce <player>
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 22969606d..b472694c4 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -6750,6 +6750,18 @@ ACMD(changesex)
return true;
}
+ACMD(changecharsex)
+{
+ int i;
+
+ pc->resetskill(sd, PCRESETSKILL_CHSEX);
+ // to avoid any problem with equipment and invalid sex, equipment is unequipped.
+ for (i=0; i<EQI_MAX; i++)
+ if (sd->equip_index[i] >= 0) pc->unequipitem(sd, sd->equip_index[i], PCUNEQUIPITEM_RECALC|PCUNEQUIPITEM_FORCE);
+ chrif->changesex(sd, false);
+ return true;
+}
+
/*================================================
* @mute - Mutes a player for a set amount of time
*------------------------------------------------*/
@@ -10115,6 +10127,7 @@ static void atcommand_basecommands(void)
ACMD_DEF(clearweather),
ACMD_DEF(uptime),
ACMD_DEF(changesex),
+ ACMD_DEF(changecharsex),
ACMD_DEF(mute),
ACMD_DEF(refresh),
ACMD_DEF(refreshall),