summaryrefslogtreecommitdiff
path: root/src/emap/atcommand.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-07-04 22:37:51 +0300
committerAndrei Karas <akaras@inbox.ru>2015-07-04 22:37:51 +0300
commit58b8c8d8cb9f78537495f908887fea9d0a451637 (patch)
tree74438cc91f5c5a6a7a953c98aa52106eb88b250f /src/emap/atcommand.c
parent857c86d93ebd68e5edbbe14ce26a16a967622822 (diff)
downloadevol-hercules-58b8c8d8cb9f78537495f908887fea9d0a451637.tar.gz
evol-hercules-58b8c8d8cb9f78537495f908887fea9d0a451637.tar.bz2
evol-hercules-58b8c8d8cb9f78537495f908887fea9d0a451637.tar.xz
evol-hercules-58b8c8d8cb9f78537495f908887fea9d0a451637.zip
Rename login/char/map dirs to elogin/echar/emap for avoid conflicts with hercules.
Diffstat (limited to 'src/emap/atcommand.c')
-rw-r--r--src/emap/atcommand.c84
1 files changed, 84 insertions, 0 deletions
diff --git a/src/emap/atcommand.c b/src/emap/atcommand.c
new file mode 100644
index 0000000..c697b22
--- /dev/null
+++ b/src/emap/atcommand.c
@@ -0,0 +1,84 @@
+// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// Copyright (c) 2014 Evol developers
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "common/HPMi.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+#include "map/atcommand.h"
+#include "map/clif.h"
+#include "map/map.h"
+#include "map/pc.h"
+#include "map/skill.h"
+#include "emap/atcommand.h"
+#include "emap/lang.h"
+
+const char* eatcommand_msgsd(struct map_session_data *sd, int *msgPtr)
+{
+ const int msg_number = *msgPtr;
+ if (!(msg_number >= 0 && msg_number < MAX_MSG))
+ {
+ hookStop();
+ return "??";
+ }
+ if (*msgPtr == 1435)
+ {
+ hookStop();
+ // service message, must be not translated
+ return "You're now in the '#%s' channel for '%s'";
+ }
+ else if (*msgPtr == 1403)
+ {
+ hookStop();
+ // service message, must be not translated
+ return "You're now in the '#%s' channel for '-'";
+ }
+ hookStop();
+ return lang_pctrans(atcommand->msg_table[0][msg_number], sd);
+}
+
+const char* eatcommand_msgfd(int *fdPtr, int *msgPtr)
+{
+ const int msg_number = *msgPtr;
+ const int fd = *fdPtr;
+ struct map_session_data *sd = session_isValid(fd) ? session[fd]->session_data : NULL;
+ if (!(msg_number >= 0 && msg_number < MAX_MSG))
+ {
+ hookStop();
+ return "??";
+ }
+ hookStop();
+ return lang_pctrans(atcommand->msg_table[0][msg_number], sd);
+}
+
+ACMD2(setSkill)
+{
+ int skill_id = 0;
+ int skill_level = 0;
+
+ if (!message || !*message || sscanf(message, "%5d %2d", &skill_id, &skill_level) < 2)
+ {
+ const char* text = info->help;
+
+ if (text)
+ clif->messageln (fd, text);
+
+ return false;
+ }
+ if (!skill->get_index(skill_id))
+ {
+ clif->message(fd, msg_fd(fd,198)); // This skill number doesn't exist.
+ return false;
+ }
+
+ pc->skill(sd, skill_id, skill_level, 0);
+ clif->message(fd, msg_fd(fd,70)); // You have learned the skill.
+
+ return true;
+}