summaryrefslogtreecommitdiff
path: root/npc/functions
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-03-15 09:29:31 -0300
committerJesusaves <cpntb1@ymail.com>2019-03-15 09:29:31 -0300
commit0ef89a7106f81e02426f2fb3d6499176098085df (patch)
tree29ab27c0da489c92322af7e0cace8e902051975a /npc/functions
parent6e9a11a712f320762f4eaeb206bf6aec03b64be7 (diff)
downloadserverdata-0ef89a7106f81e02426f2fb3d6499176098085df.tar.gz
serverdata-0ef89a7106f81e02426f2fb3d6499176098085df.tar.bz2
serverdata-0ef89a7106f81e02426f2fb3d6499176098085df.tar.xz
serverdata-0ef89a7106f81e02426f2fb3d6499176098085df.zip
Introduce the "Normal Member" and the "Treasurer" guild roles.
Only Normal Member and above can use the Guild Storage.
Diffstat (limited to 'npc/functions')
-rw-r--r--npc/functions/guild.txt42
1 files changed, 42 insertions, 0 deletions
diff --git a/npc/functions/guild.txt b/npc/functions/guild.txt
new file mode 100644
index 000000000..09422946d
--- /dev/null
+++ b/npc/functions/guild.txt
@@ -0,0 +1,42 @@
+// TMW2 Script
+// Author:
+// Jesusalva
+// Description:
+// Guild System Utils
+
+// Usage: getguildrole (guildid, accid, {type})
+// Returns a string if TYPE is set. Otherwise, Returns the GPOS_*
+// On failure, returns "null" or -1
+function script getguildrole {
+ .@gid=getarg(0);
+ .@aid=getarg(1);
+ .@type=getarg(2,0);
+ .@pos=-1;
+ getguildmember(.@gid, 2);
+ for (.@i=0; .@i < $@guildmembercount; .@i++) {
+ debugmes "Found AID %d - Position %d", $@guildmemberaid[.@i], $@guildmemberpos[.@i];
+ if (.@aid == $@guildmemberaid[.@i]) {
+ .@pos=$@guildmemberpos[.@i];
+ break;
+ }
+ }
+ if (!.@type)
+ return .@pos;
+
+ switch (.@pos) {
+ case GPOS_GUILDMASTER:
+ return "Guild Master";
+ case GPOS_VICELEADER:
+ return "Vice Leader";
+ case GPOS_RECRUITER:
+ return "Guild Recruiter";
+ case GPOS_TREASURER:
+ return "Guild Treasurer";
+ case GPOS_5:
+ return "Member";
+ case GPOS_NEWBIE:
+ return "Newbie";
+ default:
+ return "null";
+ }
+}