summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
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 /src/map/atcommand.c
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
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c13
1 files changed, 13 insertions, 0 deletions
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),