summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-10-19 22:49:18 -0300
committerJesusaves <cpntb1@ymail.com>2019-10-19 22:49:18 -0300
commit14faa4b22f37a7c7b75b3937efd1da71ce1ef5cb (patch)
treec42b0461d9d170cf6bb9e492061bbb141bb59860
parent2b1948fb9004a66450192405f3ebd258d0b22837 (diff)
downloadevol-hercules-14faa4b22f37a7c7b75b3937efd1da71ce1ef5cb.tar.gz
evol-hercules-14faa4b22f37a7c7b75b3937efd1da71ce1ef5cb.tar.bz2
evol-hercules-14faa4b22f37a7c7b75b3937efd1da71ce1ef5cb.tar.xz
evol-hercules-14faa4b22f37a7c7b75b3937efd1da71ce1ef5cb.zip
Add a function to retrieve EXP tax for a certain guild role.
There's a prototype (WIP) to retrieve the configured role name. That would allow us in a future to allow guild role name customization
-rw-r--r--src/emap/init.c2
-rw-r--r--src/emap/script_buildins.c54
-rw-r--r--src/emap/script_buildins.h2
3 files changed, 58 insertions, 0 deletions
diff --git a/src/emap/init.c b/src/emap/init.c
index 1d21149..c04b764 100644
--- a/src/emap/init.c
+++ b/src/emap/init.c
@@ -221,6 +221,8 @@ HPExport void plugin_init (void)
addScriptCommand("getguildavg","i",getguildavg);
addScriptCommand("getguildexp","i",getguildexp);
addScriptCommand("getguildnxp","i",getguildnxp);
+ addScriptCommand("getguildpostax","ii",getguildpostax);
+ addScriptCommand("getguildpostitle","ii",getguildpostitle);
addScriptCommand("setguildrole","iiiis",setguildrole);
addScriptCommand("getguildmember","i?",getguildmember);
addScriptCommand("gethomunexp","i",gethomunexp);
diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c
index 89c2aab..23de383 100644
--- a/src/emap/script_buildins.c
+++ b/src/emap/script_buildins.c
@@ -2614,6 +2614,60 @@ BUILDIN(getguildnxp)
/*==========================================
+ * Return the EXP tax for (guild, position)
+ * -1 if not found
+ *------------------------------------------*/
+BUILDIN(getguildpostax)
+{
+ int guild_id, gpos;
+ struct guild* g;
+
+ guild_id = script_getnum(st,2);
+ gpos = script_getnum(st,3);
+
+ if( ( g = guild->search(guild_id) ) != NULL )
+ {
+ script_pushint(st,g->position[gpos].exp_mode);
+ }
+ else
+ {
+ script_pushint(st,-1);
+ }
+ return true;
+}
+
+
+/*==========================================
+ * Return the title (guild, position)
+ * "" if not found
+ *------------------------------------------*/
+BUILDIN(getguildpostitle)
+{
+ ShowError("getguildpostitle is NOT working - Or rather, it is, but with a free error. So DO NOT USE.\n");
+ script_pushstr(st,"NotYetImplemented");
+ return true;
+
+ int guild_id, gpos;
+ struct guild* g;
+ char* pname;
+
+ guild_id = script_getnum(st,2);
+ gpos = script_getnum(st,3);
+
+ if( ( g = guild->search(guild_id) ) != NULL )
+ {
+ pname=g->position[gpos].name;
+ script_pushstr(st, pname);
+ }
+ else
+ {
+ script_pushstr(st,"");
+ }
+ return true;
+}
+
+
+/*==========================================
* Change a position for the @guild_id
* -1 if not found
* This will be superseed by ManaPlus eventually
diff --git a/src/emap/script_buildins.h b/src/emap/script_buildins.h
index cca24cd..5abcb68 100644
--- a/src/emap/script_buildins.h
+++ b/src/emap/script_buildins.h
@@ -108,6 +108,8 @@ BUILDIN(getguildlvl);
BUILDIN(getguildavg);
BUILDIN(getguildexp);
BUILDIN(getguildnxp);
+BUILDIN(getguildpostax);
+BUILDIN(getguildpostitle);
BUILDIN(setguildrole);
BUILDIN(getguildmember);
BUILDIN(gethomunexp);