summaryrefslogtreecommitdiff
path: root/npc/guilds/bank.txt
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-03-15 09:43:23 -0300
committerJesusaves <cpntb1@ymail.com>2019-03-15 09:43:23 -0300
commit647e9ac0447606140106f2488dbe109e23957f49 (patch)
treec2f178feea25a855735dc8d32808b42f68a77542 /npc/guilds/bank.txt
parent0ef89a7106f81e02426f2fb3d6499176098085df (diff)
downloadserverdata-647e9ac0447606140106f2488dbe109e23957f49.tar.gz
serverdata-647e9ac0447606140106f2488dbe109e23957f49.tar.bz2
serverdata-647e9ac0447606140106f2488dbe109e23957f49.tar.xz
serverdata-647e9ac0447606140106f2488dbe109e23957f49.zip
Add a guild vault so guild have its money.
Only Treasurers or Leaders can withdraw money. Normal members/Recruiters/etc. can't.
Diffstat (limited to 'npc/guilds/bank.txt')
-rw-r--r--npc/guilds/bank.txt58
1 files changed, 58 insertions, 0 deletions
diff --git a/npc/guilds/bank.txt b/npc/guilds/bank.txt
new file mode 100644
index 000000000..a25f853b8
--- /dev/null
+++ b/npc/guilds/bank.txt
@@ -0,0 +1,58 @@
+// Moubootaur Legends Script
+// Author:
+// Jesusalva
+// Description:
+// Guild Facility - Guild Vault
+
+guilds,35,35,0 script Guild Vault NPC_NO_SPRITE,{
+ .@gid=getcharid(2);
+ .@role=getguildrole(.@gid, getcharid(3));
+ do
+ {
+ mesn;
+ mesc l("This vault currently have @@ GP inside.", $GUILD_BANK[.@gid]);
+ select
+ l("Okay, laters"),
+ l("Donate GP"),
+ rif(.@role == GPOS_TREASURER || .@role <= GPOS_VICELEADER, l("Withdraw GP"));
+ mes "";
+ switch (@menu)
+ {
+ case 1:
+ close;
+ case 2:
+ input .@mx;
+ if (Zeny < .@mx || .@mx < 0)
+ {
+ mesc l("Invalid amount!"), 1;
+ }
+ else
+ {
+ Zeny=Zeny-.@mx;
+ $GUILD_BANK[.@gid]+=.@mx;
+ mesc l("Donation successful!"), 3;
+ }
+ break;
+ case 3:
+ input .@mx;
+ if ($GUILD_BANK[.@gid] < .@mx || .@mx < 0)
+ {
+ mesc l("Invalid amount!"), 1;
+ }
+ else
+ {
+ $GUILD_BANK[.@gid]-=.@mx;
+ Zeny=Zeny+.@mx;
+ mesc l("Money withdrawn!"), 3;
+ }
+ break;
+ }
+
+ } while (true);
+ close;
+
+OnInit:
+ .distance=2;
+ end;
+}
+