summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/constants.conf2
-rw-r--r--npc/functions/guild.txt42
-rw-r--r--npc/guilds/management.txt16
-rw-r--r--npc/guilds/storage.txt5
-rw-r--r--npc/scripts.conf1
5 files changed, 63 insertions, 3 deletions
diff --git a/db/constants.conf b/db/constants.conf
index bf63ed611..ccdd1553b 100644
--- a/db/constants.conf
+++ b/db/constants.conf
@@ -3826,7 +3826,7 @@ constants_db: {
GPOS_GUILDMASTER: 0
GPOS_VICELEADER: 1 // pos2
GPOS_RECRUITER: 2 // pos3
- GPOS_4: 3 // pos4
+ GPOS_TREASURER: 3 // pos4
GPOS_5: 4 // pos5
GPOS_NEWBIE: 19
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";
+ }
+}
diff --git a/npc/guilds/management.txt b/npc/guilds/management.txt
index 4b099adee..cd1f5ae78 100644
--- a/npc/guilds/management.txt
+++ b/npc/guilds/management.txt
@@ -14,9 +14,13 @@ guilds,35,30,0 script Guild Management NPC_NO_SPRITE,{
else
mesc l("Guild Lv @@, @@/@@ EXP to level up", getguildlvl(.@gid), getguildexp(.@gid), "???");
+ // mesc l("The average player level is @@", getguildavg(.@gid));
+ mesc l("Your position on the guild: @@", getguildrole(.@gid, getcharid(3), true));
+
// I forgot a function to get player title and allow any guildmaster to change this
if (strcharinfo(0) == getguildmaster(.@gid))
{
+ next;
do
{
gmaster();
@@ -35,8 +39,8 @@ guilds,35,30,0 script Guild Management NPC_NO_SPRITE,{
l("Guild Master"), GPOS_GUILDMASTER,
l("Vice Leader"), GPOS_VICELEADER,
l("Recruiter"), GPOS_RECRUITER,
- l("Position 4"), GPOS_4,
- l("Position 5"), GPOS_5,
+ l("Treasurer"), GPOS_TREASURER,
+ l("Normal Member"), GPOS_5,
l("Newbie"), GPOS_NEWBIE;
mes "";
.@idx=0+@menuret;
@@ -60,6 +64,14 @@ guilds,35,30,0 script Guild Management NPC_NO_SPRITE,{
.@name$="Recruiter";
.@perm=GPERM_INVITE;
break;
+ case GPOS_TREASURER:
+ .@name$="Treasurer";
+ .@perm=0;
+ break;
+ case GPOS_5:
+ .@name$="Member";
+ .@perm=0;
+ break;
case GPOS_NEWBIE:
.@name$="Newbie";
.@perm=0;
diff --git a/npc/guilds/storage.txt b/npc/guilds/storage.txt
index 97218fbb1..316071d9f 100644
--- a/npc/guilds/storage.txt
+++ b/npc/guilds/storage.txt
@@ -12,6 +12,11 @@ guilds,33,28,0 script Guild Storage NPC_NO_SPRITE,{
}
else
{
+ if (getguildrole(.@gid, getcharid(3)) > GPOS_5)
+ {
+ dispbottom l("Your position must be the one of a regular member or above.");
+ end;
+ }
if (guildopenstorage())
{
npctalkonce l("Someone else is using the guild storage right now. Please wait.");
diff --git a/npc/scripts.conf b/npc/scripts.conf
index 448596ddc..892e15718 100644
--- a/npc/scripts.conf
+++ b/npc/scripts.conf
@@ -41,6 +41,7 @@
"npc/functions/doors.txt",
"npc/functions/event.txt",
"npc/functions/fishing.txt",
+"npc/functions/guild.txt",
"npc/functions/hammocks.txt",
"npc/functions/lockpicks.txt",
"npc/functions/TODO.txt",