summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-03-12 03:26:26 -0300
committerJesusaves <cpntb1@ymail.com>2019-03-12 03:26:26 -0300
commit030cf9c15212df4afcc0a34c1629a6c18b01c236 (patch)
treefc1bb872de4e55e645c953887d5ee96d2919611e
parentc4f76bf3561041a727c11d34e6644e13574af596 (diff)
downloadevol-hercules-030cf9c15212df4afcc0a34c1629a6c18b01c236.tar.gz
evol-hercules-030cf9c15212df4afcc0a34c1629a6c18b01c236.tar.bz2
evol-hercules-030cf9c15212df4afcc0a34c1629a6c18b01c236.tar.xz
evol-hercules-030cf9c15212df4afcc0a34c1629a6c18b01c236.zip
The last part of guild ~~functions hack~~ implementation.
setguildrole allows us to enjoy the feature (which works well as 4144 said it would) And at the same time, allows 4144 all time he wants to add that properly client side. ...Jesusalva hurries too much, doesn't him?
-rw-r--r--src/emap/init.c1
-rw-r--r--src/emap/script_buildins.c35
-rw-r--r--src/emap/script_buildins.h1
3 files changed, 37 insertions, 0 deletions
diff --git a/src/emap/init.c b/src/emap/init.c
index d8c53b0..e1f1206 100644
--- a/src/emap/init.c
+++ b/src/emap/init.c
@@ -215,6 +215,7 @@ HPExport void plugin_init (void)
addScriptCommand("getguildavg","i",getguildavg);
addScriptCommand("getguildexp","i",getguildexp);
addScriptCommand("getguildnxp","i",getguildnxp);
+ addScriptCommand("setguildrole","iiiis",setguildrole);
do_init_langs();
diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c
index 2bdc48d..330b73b 100644
--- a/src/emap/script_buildins.c
+++ b/src/emap/script_buildins.c
@@ -2431,3 +2431,38 @@ BUILDIN(getguildnxp)
}
return true;
}
+
+
+/*==========================================
+ * Change a position for the @guild_id
+ * -1 if not found
+ * This will be superseed by ManaPlus eventually
+ * and is only a quick fix until 4144 can work with GUI.
+ * Everyone knows C is easier than C++ >.>
+ * WARNING Not sanitized
+ *------------------------------------------*/
+BUILDIN(setguildrole)
+{
+ int guild_id;
+ int idx;
+ int mode;
+ int exp_mode;
+ const char *name;
+ struct guild* g;
+
+ guild_id = script_getnum(st,2);
+ idx = script_getnum(st,3);
+ mode = script_getnum(st,4);
+ exp_mode = script_getnum(st,5);
+ name = script_getstr(st,6);
+
+ if( ( g = guild->search(guild_id) ) != NULL )
+ {
+ script_pushint(st, guild->change_position(guild_id, idx, mode, exp_mode, name));
+ }
+ else
+ {
+ script_pushint(st,-1);
+ }
+ return true;
+}
diff --git a/src/emap/script_buildins.h b/src/emap/script_buildins.h
index 5961150..ad1916d 100644
--- a/src/emap/script_buildins.h
+++ b/src/emap/script_buildins.h
@@ -105,5 +105,6 @@ BUILDIN(getguildlvl);
BUILDIN(getguildavg);
BUILDIN(getguildexp);
BUILDIN(getguildnxp);
+BUILDIN(setguildrole);
#endif // EVOL_MAP_SCRIPT_BUILDINS