summaryrefslogtreecommitdiff
path: root/src/emap/chrif.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emap/chrif.c')
-rw-r--r--src/emap/chrif.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/emap/chrif.c b/src/emap/chrif.c
new file mode 100644
index 0000000..91f4aa7
--- /dev/null
+++ b/src/emap/chrif.c
@@ -0,0 +1,41 @@
+// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// Copyright (c) 2014 - 2019 Evol developers
+
+#include "common/hercules.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "common/HPMi.h"
+#include "common/nullpo.h"
+#include "common/socket.h"
+#include "map/chrif.h"
+#include "map/pc.h"
+
+#include "emap/chrif.h"
+
+#include "plugins/HPMHooking.h"
+
+/**
+ * save sex change
+ */
+bool echrif_changesex(TBL_PC **sdPtr, bool *change_account __attribute__ ((unused)))
+{
+ const TBL_PC *sd = *sdPtr;
+ nullpo_retr(false, sd);
+
+ if (!chrif->isconnected())
+ return false;
+
+ WFIFOHEAD(chrif->fd, 44);
+ WFIFOW(chrif->fd, 0) = 0x2b0e;
+ WFIFOL(chrif->fd, 2) = sd->status.account_id;
+ safestrncpy(WFIFOP(chrif->fd, 6), sd->status.name, NAME_LENGTH);
+ WFIFOW(chrif->fd, 30) = CHAR_ASK_NAME_CHANGECHARSEX;
+ WFIFOB(chrif->fd, 32) = sd->status.sex;
+ WFIFOSET(chrif->fd, 44);
+
+ hookStop();
+ return true;
+}