summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-03-25 14:49:46 +0300
committerAndrei Karas <akaras@inbox.ru>2015-03-25 14:49:46 +0300
commit5d279bc95153b0785c844f88f02ef5239e9d9753 (patch)
treec81398fd0caa6edf9160bea880bfaaf5ebd219a0 /src/map/atcommand.c
parent92ba7ee3b19bc4151d69700e9b1b5484298cbcbf (diff)
downloadevol-hercules-5d279bc95153b0785c844f88f02ef5239e9d9753.tar.gz
evol-hercules-5d279bc95153b0785c844f88f02ef5239e9d9753.tar.bz2
evol-hercules-5d279bc95153b0785c844f88f02ef5239e9d9753.tar.xz
evol-hercules-5d279bc95153b0785c844f88f02ef5239e9d9753.zip
Add gm command for set player skill level. It also allow add/delete skills.
New gm command: @setskill skill level
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 7f4c779..cd972ad 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -12,7 +12,10 @@
#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 "map/atcommand.h"
#include "map/lang.h"
@@ -53,3 +56,29 @@ const char* eatcommand_msgfd(int *fdPtr, int *msgPtr)
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;
+}