GuildBank Script release

Join Discord

Inflikted

LOMCN Veteran
Veteran
Aug 4, 2003
256
7
114
Made this a while ago, its mostly an SQL based script that allows a guildbank to be created for each individual guild, guildleader can withdraw money out, and guildmembers can put money into their guild bank. This is just a basic script for those learning SQL to get started with :)
you will need to make a new table named "TBL_GUILDBANK"
and 2 fields
"FLD_GUILD" set this to varchar
"FLD_GOLD" set this to varchar
before proceeding.. its advisable that you have a little background on how to add new tables and databases in SQL, which I won't be covering with this :)
let me no if you have questions

Code:
begin
[@main]
#IF
    HasGuild
#ACT
    FormatStr "FLD_GUILD='%s'" %GUILDNAME
    ReadValueSql  "TBL_GUILDBANK"  %A9  "FLD_GUILD,FLD_GOLD" [@THegoldstuff1]
#ELSESAY
You dont have a guild.\

[@THegoldstuff1()]
#ACT
    Mov    D1      %ARG(2)    ;Retrieves gold amount
    Mov   A3      %ARG(1)     ;Retrieve guild name
#IF
   Equal  A3   ""     ;If there is no guild listed under this name it makes an entry below
#ACT
    FormatStr "'%s',%s" %GUILDNAME 0
    Mov A8 %A9
    FormatStr "FLD_GUILD='%s'" %GUILDNAME 
    Mov A2 %A9
    WriteValueSql "TBL_GUILDBANK" %A2 "FLD_GUILD,FLD_GOLD" %A8
    goto @menu
#ELSEACT
goto @menu

[@menu]
#SAY
Welcome to the {FCOLOR/10}RNDPRO{FCOLOR/12} Guild Bank\
{FCOLOR/11}<$OUTPUT(A3)>{FCOLOR/12} guild has {FCOLOR/1}<$OUTPUT(D1)>{FCOLOR/12} Guild Gold.\
You cannot reconvert your famepoints to RNDPro points.\
<[ Donate Money to Bank  ]/@AddGold>\
<[ Retreive Money from Bank ]/@getstuff1>\
<[ Exit  ]/@exit>\\\

[@finallyadd]
#SAY
{FCOLOR/11}<$OUTPUT(A3)>{FCOLOR/12} guild has {FCOLOR/1}<$OUTPUT(D1)>{FCOLOR/12} Guild Gold.
How Much gold would you like to donate to your guild bank?\
<Amount of Gold/@@goldamount>
[@@goldamount]
#ACT
Mov D6 %INPUTSTR
goto @checkgold

[@checkgold]
#IF
checkgold %D6       ;Does goldcheck for amount you entered
#ACT
Inc D1 %D6         ;Adds your gold to the current gold amount in bank
   FormatStr "FLD_GUILD='%s'" %GUILDNAME
   Mov   A8     %A9
   FormatStr "FLD_GOLD='%s'" %D1
   UPDATEVALUESQL "TBL_GUILDBANK" %A8 %A9
take gold %D6
#SAY
{FCOLOR/10}<$OUTPUT(A3)>{FCOLOR/10} now has {FCOLOR/11}<$OUTPUT(D2)>{FCOLOR/10} gold in the bank.\
<[ Exit  ]/@exit>\\\


[@getstuff1]
#IF
IsGuildMaster
#SAY
{FCOLOR/11}<$OUTPUT(A3)>{FCOLOR/12} guild has {FCOLOR/1}<$OUTPUT(D1)>{FCOLOR/12} Guild Gold.
How Much gold would you like to take out of your guild bank?\
<Amount of Gold/@@takethegold>
[@@takethegold]
#ACT
Mov D4 %INPUTSTR
goto @goldcheck

[@goldcheck]
#IF
ELARGE D1 %D4      ;If D1, which is the guildbank gold is larger than the amount you want to take out, it will allow it
#ACT
Dec D1 %D4
   FormatStr "FLD_GUILD='%s'" %GUILDNAME
   Mov   A8     %A9
   FormatStr "FLD_GOLD='%s'" %D1
   UPDATEVALUESQL "TBL_GUILDBANK" %A8 %A9
give gold %D4
#SAY
{FCOLOR/10}<$OUTPUT(A3)>{FCOLOR/10} now has {FCOLOR/11}<$OUTPUT(D1)>{FCOLOR/10} gold in the bank.\
#ELSESAY
You are taking too much gold!\
 
Last edited:

Amenovis

Golden Oldie
Golden Oldie
Loyal Member
Jan 9, 2006
1,105
0
143
Germany
nice one rly i ever was searching for something like that also i asked me if its possible to get a guildstore where all member can put staff in but only guildleader can get staff out ??
 

Inflikted

LOMCN Veteran
Veteran
Aug 4, 2003
256
7
114
thats an interesting idea, i have one way of doing it maybe.. but it think it would be a bit difficult lol and not very good. usergoodmarkets is hardcoded.. so we cant use that either.
unless there is a way to be able to.. say list items? from SQL.. but i dont think this is possible. correct me if im wrong hehe :) maybe i havent seen the command to list things from SQL.. onto mir3.

:)
 

Amenovis

Golden Oldie
Golden Oldie
Loyal Member
Jan 9, 2006
1,105
0
143
Germany
mhh i dont was thinking of usergoodmarkets or hardcoded storage scripts i mean it nearly the same way like ur bank script with a new sql table
tbl fields:
Guildname
Guildleader
Guildmember
Item (and what is needed for that items like dura etc)

than a script that check guildname member or leader what u wanna do put item in store (writevalue xyz) get out of store (writevalue) save value

something like that its in my head but i have no idea with sql :( if u look u see how much probs i have with variables and sql is really much to high for me
:(

EDIT: to list something can u dont use readvalue? ahh i belive i know what u mean mhh a display what is in the store what who put in a overview mhh dunno
 
Last edited:

Inflikted

LOMCN Veteran
Veteran
Aug 4, 2003
256
7
114
yes you can use readvalue
however you must store this into a mir3 variable.. and these mir3 variables can only store one thing, not a list :)

maybe idabiga or chimera knows? :P its beyond me hehe
 

idaBigA

Holley Mir 3!!
VIP
Oct 28, 2003
1,966
110
310
Stoke, UK
It was done as a script on (I Believe) Vital Elements (or whatever it was called). I saw a video of the script in use.

Anybody could put it into the store, but only the guild leader could get items out. And to get the items out, the system Mailed them to the player who wanted them. I can't find the video any more, but was well impressive.

To get it to store the ACTUAL item is not really possible as you would need to store the item code, which can only be obtained from a click event where it then stores the number in P9. It must be possible, as it was done via this video.. hmm... hows this..

Each Guild Can Store 20 Items

Click NPC
Select an Empty Item Slot (1 to 20)
Select Which Item you want to Store (Must be on Body) (Can Either use a full item list, or can use an Alphabet on Screen to store the Item Name)
Using HLSCRIPT find out exactly what added stats you have on that item
Remove Item (Checking that those stats are still present to ensure no item swapping)..
Store in SQL Fields (Item Slot, Item Name, Guild Name, Added MC, Added DC, Added Element ETC ETC)

Guild Leader Looks @ Item List
i.e.
GuildName, Slot1, Load Values, Store in String
GuildName, Slot2, Load Values, Add to String
GuildName, Slot3, Load Values, Add to String etc

So, the Guild Leader would see

1 - JudgementMace DC+1, MC+1, Luck+1, Added by idaBigA\
2 - Blah Blah Blah

Now, to remove, you just need to add those items stats along with a new Item Number into the Mail system with the relevent persons name for the To Field.. which is the only way, I can think of, that will make an item with added stats.

What you reckon?
 

Amenovis

Golden Oldie
Golden Oldie
Loyal Member
Jan 9, 2006
1,105
0
143
Germany
mhh sounds well but ill think that way would be also hard to get mhh how is it if u use an account create all member that are member of the guild can put in cause the script read the id and pass from that storage without showing it and the guildleader als but he can put items out from that account without changing to it i mean also a check if guildleader than the script take the info from the account db id passwort or from the char dunno if or how possible and store it like in a own store mhh i hope it was understandable

oh how is it with a list and a inputstring? for player its possible to put them on a list like addnamelist so if u got a list of the items that are in store the leader can chose what he need by using inputstr
 
Last edited:

Inflikted

LOMCN Veteran
Veteran
Aug 4, 2003
256
7
114
i get what your saying idabiga, it would be a very complex script hehe. with aloto of fields to create.
 

Falador

Dedicated Member
Dedicated Member
May 13, 2007
221
1
64
Hello,

yes work in 3.55 very fine :)
in 3.56 work, here is the Problem never here can programm a client what the Server fine Connect, i pers. search 6 Month for a client that can connect with 3.56, any1 can help me a 3.56 Server to run pls pm me :)
 

Falador

Dedicated Member
Dedicated Member
May 13, 2007
221
1
64
Hello,

you must make new DB /TBL in youre SQL show Screen than work :-P




 

Unico

Dedicated Member
Dedicated Member
Dec 15, 2007
230
1
64
i have this script working 100% :D

but i have another table ( TBL_GUILDPOINTS)

in TBL_GUILPOINTS hafe 2 columns:
FLD_GUILD
FLD_GPOINTS

what is the variable for ADD points? i have only variable for take points but not for add :(

Code:
[@Forward()]
#IF
#ACT
Mov D1 %ARG(2)
Mov A3 %ARG(1)
FormatStr "FLD_GUILD='%s'" %GUILDNAME
ReadValueSql "TBL_GUILDPOINTS" %A9 "FLD_GUILD,FLD_GPOINTS" [@Start]
#ELSESAY
You are not in a guild go away\ \
< Close/@exit>\\\
#IF
Equal A3 ""
#ACT
FormatStr "'%s',%s" %GUILDNAME 0
Mov A6 %A9
FormatStr "FLD_GUILD='%s'" %GUILDNAME
Mov A5 %A9
WriteValueSql "TBL_GUILDBANK" %A5 "FLD_GUILD,FLD_GOLD" %A6

goto @start

[@Start()]
#ACT
Mov D3 %ARG(2)
#SAY
Welcome to the {FCOLOR/10}Mythical{FCOLOR/12}\
{FCOLOR/11}<$OUTPUT(A3)>{FCOLOR/12} Currently has {FCOLOR/1}<$OUTPUT(D3)>{FCOLOR/12} Mythical

Points.\
{FCOLOR/11}<$OUTPUT(A3)>{FCOLOR/12} Currently has {FCOLOR/1}<$OUTPUT(D1)>{FCOLOR/12} Guild-

Gold.\
What would you like to do today?\ \
< Guild Shop/@Shop>\

[@Shop]
#SAY
Please keep in mind that for items that require\
{FCOLOR/10}MythicalPoints{FCOLOR/12} to Purchase you Must be a {FCOLOR/1}Guildmaster\\{FCOLOR/12}

< Buy with GuildPoints/@Shoppoints>\

[@Shoppoints]
#SAY
<$OUTPUT(A3)> Guild currently has <$OUTPUT(D3)> Points.\ \
Keeping in mind Only GuildMasters can make a transaction\
with Mythicalpoints, What would you like to buy today?\ \
< Armours/@Armours>

[@Armours]
#SAY
There is a selection of armours you can chose from.\
They are listed below for you. Each of these items will\
cost your guild 20 Guild Points.\ \
< DemonArmour(m)/@Demonm>

[@Demonm]
#IF
IsGuildMaster
ELARGE D3 20
#ACT
[COLOR=Red]Dec D3 20 ;;; I need Change this for INC D3 20 for add points? txh[/COLOR]
FormatStr "FLD_GUILD='%s'" %GUILDNAME
Mov A8 %A9
FormatStr "FLD_GPOINTS='%s'" %D3
UPDATEVALUESQL "TBL_GUILDPOINTS" %A8 %A9
give DemonArmor(M) 1
#SAY
You now have <$OUTPUT(D3)> mythical points\
< Exit/@exit>

#IF
IsGuildMaster
ELARGE D3 20
#ACT
Dec D3 20 ;;; I need Change this for INC D3 20 for add points? txh
FormatStr "FLD_GUILD='%s'" %GUILDNAME
Mov A8 %A9
FormatStr "FLD_GPOINTS='%s'" %D3
UPDATEVALUESQL "TBL_GUILDPOINTS" %A8 %A9

and what is variable for up guild lvl? for example if i have 500 guildpoints up my guild to lvl 1 :D
thx in advance
 
Last edited: