1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Seek unity between the elements in the 22nd Terraining Contest Poll.
    Dismiss Notice
  3. Seize the moment! The 18th Mini Mapping Contest has commenced.
    Dismiss Notice
  4. The heavens smile on the old faithful. The 16th Techtree Contest has begun.
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Dialog Bank Storage

Submitted by HellvsHeaven
This bundle is marked as approved. It works and satisfies the submission rules.
Originally, ap0calypse, made this system for me, so all credits to him. I decided to upload the system because I thought It would be useful to users. Anyway, here are the triggers.

The Triggers


Bank System Setup
  • Bank System Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- === Setup System === --------
      • -------- There can only be a maximum of 672 stored items for each player --------
      • -------- (which is 84 pages with 8 items/page or 96 pages with 7 items/page) --------
      • Set bankItemsPerPage = 6
      • Set bankPageAmount = 6
      • -------- Item colors (will overwrite default item colors) --------
      • Set bankColor1 = |c00ff8800
      • -------- "Next Page" color --------
      • Set bankColor2 = |c00666fff
      • -------- "Cancel" color --------
      • Set bankColor3 = |c00aa0000
      • -------- === Add Events === --------
      • For each (Integer bankLoop) from 1 to 12, do (Actions)
        • Loop - Actions
          • Custom script: set udg_bankDialog[udg_bankLoop] = DialogCreate()
          • Trigger - Add to Dialog Buttons <gen> the event (Dialog - A dialog button is clicked for bankDialog[bankLoop])
          • Trigger - Add to Esc Pressed <gen> the event (Player - (Player(bankLoop)) skips a cinematic sequence)

Setup Dialogs
  • Setup Dialogs
    • Events
    • Conditions
    • Actions
      • Dialog - Clear bankDialog[bankPlayerId]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • bankInt1 Equal to 0
        • Then - Actions
          • -------- === Main Dialog === --------
          • Dialog - Change the title of bankDialog[bankPlayerId] to ((Name of (Player(bankPlayerId))) + 's Bank)
          • Dialog - Create a dialog button for bankDialog[bankPlayerId] labelled (bankColor1 + Withdraw Items)
          • Set bankDialogButton[(8099 + bankPlayerId)] = (Last created dialog Button)
          • Dialog - Create a dialog button for bankDialog[bankPlayerId] labelled (bankColor1 + Deposit Items)
          • Set bankDialogButton[(8111 + bankPlayerId)] = (Last created dialog Button)
          • Dialog - Create a dialog button for bankDialog[bankPlayerId] labelled (bankColor3 + Cancel)
          • Set bankDialogButton[(8087 + bankPlayerId)] = (Last created dialog Button)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • bankInt1 Equal to 1
            • Then - Actions
              • -------- === Withdraw Dialog === --------
              • -------- Dialog --------
              • Dialog - Change the title of bankDialog[bankPlayerId] to ((Name of (Player(bankPlayerId))) + ('s Bank (Page + ((String((bankPlayerCurrentPage[bankPlayerId] + 1))) + ))))
              • Set bankInt3 = 0
              • For each (Integer bankLoop) from (bankPlayerCurrentPage[bankPlayerId] x bankItemsPerPage) to (((bankPlayerCurrentPage[bankPlayerId] + 1) x bankItemsPerPage) - 1), do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • bankPlayerItems[bankPlayerId] Greater than bankLoop
                    • Then - Actions
                      • Set bankInt2 = ((672 x (bankPlayerId - 1)) + ((bankPlayerCurrentPage[bankPlayerId] x bankItemsPerPage) + bankInt3))
                      • Set bankInt3 = (bankInt3 + 1)
                      • Dialog - Create a dialog button for bankDialog[bankPlayerId] labelled (((String(bankInt3)) + . ) + (bankColor1 + bankItemName[bankInt2]))
                      • Set bankDialogButton[bankInt2] = (Last created dialog Button)
                    • Else - Actions
                      • Set bankLoop = 700
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • bankPlayerPages[bankPlayerId] Greater than 1
                • Then - Actions
                  • Dialog - Create a dialog button for bankDialog[bankPlayerId] labelled (bankColor2 + > Next Page >)
                  • Set bankDialogButton[(8063 + bankPlayerId)] = (Last created dialog Button)
                  • Dialog - Create a dialog button for bankDialog[bankPlayerId] labelled (bankColor2 + < Previous Page <)
                  • Set bankDialogButton[(8075 + bankPlayerId)] = (Last created dialog Button)
                • Else - Actions
              • Dialog - Create a dialog button for bankDialog[bankPlayerId] labelled (bankColor3 + Cancel)
              • Set bankDialogButton[(8087 + bankPlayerId)] = (Last created dialog Button)
            • Else - Actions
              • -------- === Deposit Dialog === --------
              • Set bankIsDepositing[bankPlayerId] = True
              • Dialog - Change the title of bankDialog[bankPlayerId] to ((Name of (Player(bankPlayerId))) + 's Inventory)
              • Set bankInt3 = 0
              • For each (Integer bankLoop) from 1 to 6, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Item carried by bankHero[bankPlayerId] in slot bankLoop) Not equal to No item
                    • Then - Actions
                      • Set bankInt2 = (((bankPlayerId - 1) x 12) + bankLoop)
                      • Set bankInt3 = (bankInt3 + 1)
                      • Dialog - Create a dialog button for bankDialog[bankPlayerId] labelled (((String(bankInt3)) + . ) + (bankColor1 + (Name of (Item carried by bankHero[bankPlayerId] in slot bankLoop))))
                      • Set bankDialogButton[bankInt2] = (Last created dialog Button)
                    • Else - Actions
              • Dialog - Create a dialog button for bankDialog[bankPlayerId] labelled (bankColor3 + Cancel)
              • Set bankDialogButton[(8087 + bankPlayerId)] = (Last created dialog Button)
      • Dialog - Show bankDialog[bankPlayerId] for (Player(bankPlayerId))

Dialog Buttons
  • Dialog Buttons
    • Events
    • Conditions
    • Actions
      • Set bankPlayerId = (Player number of (Triggering player))
      • -------- === Next Page === --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to bankDialogButton[(8063 + bankPlayerId)]
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • bankPlayerCurrentPage[bankPlayerId] Equal to (bankPlayerPages[bankPlayerId] - 1)
            • Then - Actions
              • Set bankPlayerCurrentPage[bankPlayerId] = 0
            • Else - Actions
              • Set bankPlayerCurrentPage[bankPlayerId] = (bankPlayerCurrentPage[bankPlayerId] + 1)
          • Set bankInt1 = 1
          • Trigger - Run Setup Dialogs <gen> (checking conditions)
          • Skip remaining actions
        • Else - Actions
      • -------- === Previous Page === --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to bankDialogButton[(8075 + bankPlayerId)]
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • bankPlayerCurrentPage[bankPlayerId] Equal to 0
            • Then - Actions
              • Set bankPlayerCurrentPage[bankPlayerId] = (bankPlayerPages[bankPlayerId] - 1)
            • Else - Actions
              • Set bankPlayerCurrentPage[bankPlayerId] = (bankPlayerCurrentPage[bankPlayerId] - 1)
          • Set bankInt1 = 1
          • Trigger - Run Setup Dialogs <gen> (checking conditions)
          • Skip remaining actions
        • Else - Actions
      • -------- === Cancel === --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to bankDialogButton[(8087 + bankPlayerId)]
        • Then - Actions
          • Dialog - Hide bankDialog[bankPlayerId] for (Triggering player)
          • Set bankIsDepositing[bankPlayerId] = False
          • Set bankLoop = 13
          • Skip remaining actions
        • Else - Actions
      • -------- === Withdraw Items-menu === --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to bankDialogButton[(8099 + bankPlayerId)]
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • bankRememberPage[bankPlayerId] Equal to False
            • Then - Actions
              • Set bankPlayerCurrentPage[bankPlayerId] = 0
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • bankPlayerCurrentPage[bankPlayerId] Greater than or equal to bankPlayerPages[bankPlayerId]
                • Then - Actions
                  • Set bankPlayerCurrentPage[bankPlayerId] = (bankPlayerCurrentPage[bankPlayerId] - 1)
                • Else - Actions
          • Set bankInt1 = 1
          • Trigger - Run Setup Dialogs <gen> (checking conditions)
          • Skip remaining actions
        • Else - Actions
      • -------- === Deposit Items-menu === --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to bankDialogButton[(8111 + bankPlayerId)]
        • Then - Actions
          • Set bankInt1 = 2
          • Trigger - Run Setup Dialogs <gen> (checking conditions)
          • Skip remaining actions
        • Else - Actions
      • -------- === Withdraw Items === --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • bankIsDepositing[bankPlayerId] Equal to False
        • Then - Actions
          • For each (Integer bankLoop) from 0 to (bankItemsPerPage - 1), do (Actions)
            • Loop - Actions
              • Set bankInt2 = (((bankPlayerId - 1) x 672) + ((bankPlayerCurrentPage[bankPlayerId] x bankItemsPerPage) + bankLoop))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Clicked dialog button) Equal to bankDialogButton[bankInt2]
                • Then - Actions
                  • Item - Show bankStoredItem[bankInt2]
                  • Hero - Give bankStoredItem[bankInt2] to bankHero[bankPlayerId]
                  • Set bankPlayerItems[bankPlayerId] = (bankPlayerItems[bankPlayerId] - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • bankPlayerItems[bankPlayerId] Equal to (bankItemsPerPage x (bankPlayerPages[bankPlayerId] - 1))
                    • Then - Actions
                      • Set bankPlayerPages[bankPlayerId] = (bankPlayerPages[bankPlayerId] - 1)
                    • Else - Actions
                  • Set bankLoop = 20
                • Else - Actions
          • -------- Recycle --------
          • For each (Integer bankLoop) from bankInt2 to (bankInt2 + bankPlayerItems[bankPlayerId]), do (Actions)
            • Loop - Actions
              • Set bankStoredItem[bankLoop] = bankStoredItem[(bankLoop + 1)]
              • Set bankItemName[bankLoop] = bankItemName[(bankLoop + 1)]
              • Set bankItemCharges[bankLoop] = bankItemCharges[(bankLoop + 1)]
          • Skip remaining actions
        • Else - Actions
      • -------- === Deposit Items === --------
      • For each (Integer bankLoop) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set bankIsDepositing[bankPlayerId] = False
          • Set bankInt2 = (((bankPlayerId - 1) x 672) + bankPlayerItems[bankPlayerId])
          • Set bankInt3 = (((bankPlayerId - 1) x 12) + bankLoop)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to bankDialogButton[bankInt3]
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • bankPlayerItems[bankPlayerId] Equal to 672
                      • bankPlayerItems[bankPlayerId] Equal to (bankItemsPerPage x bankPageAmount)
                • Then - Actions
                  • Game - Display to (All players) the text: |c00ffcc00Error:|r ...
                  • Skip remaining actions
                • Else - Actions
              • Set bankPlayerItems[bankPlayerId] = (bankPlayerItems[bankPlayerId] + 1)
              • Set bankStoredItem[bankInt2] = (Item carried by bankHero[bankPlayerId] in slot bankLoop)
              • Set bankItemName[bankInt2] = (Name of (Item carried by bankHero[bankPlayerId] in slot bankLoop))
              • Set bankItemCharges[bankInt2] = (Charges remaining in (Item carried by bankHero[bankPlayerId] in slot bankLoop))
              • Hero - Drop the item from slot bankLoop of bankHero[bankPlayerId]
              • Item - Hide bankStoredItem[bankInt2]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • bankPlayerItems[bankPlayerId] Equal to ((bankItemsPerPage x bankPlayerPages[bankPlayerId]) + 1)
                • Then - Actions
                  • Set bankPlayerPages[bankPlayerId] = (bankPlayerPages[bankPlayerId] + 1)
                • Else - Actions
              • Set bankLoop = 6
            • Else - Actions

Esc Pressed
  • Esc Pressed
    • Events
    • Conditions
    • Actions
      • Set bankInt1 = 0
      • Set bankPlayerId = (Player number of (Triggering player))
      • Trigger - Run Setup Dialogs <gen> (checking conditions)




How Does the System Work?
First, gather some items into the standard inventory of your predefined unit. Second, press Esc and when a dialog box opens, choose Deposit. Deposit opens a second dialog, where dialog buttons for every item that your predefined unit carries are shown. Lastly, click any of the dialog buttons, except Cancel, to store an item.

In order to view your stored items or get them back, click Withdraw instead after you press Esc. Then do the same as if you pressed Deposit.


Change Log
The system no longer destroys or recreates items to work. Instead, it hides items to store and shows the items again to retrieve.

Bug Fixing
1. Fixed item charge glitch

Added New Features:
1. Access to Withdraw and Deposit dialogs via commands for faster access
2. Saves item cooldown
Contents

Dialog Bank Storage (Map)

Reviews
Moderator
A nice system that could be useful. The system could offer an alternative metod of using it. Bank System Setup leaks one dialog. The system could detect which players are present and create dialogs and register events only for them.
  1. Reviewed by Maker, Dialog Bank Storage, 29th Dec 2012

    A nice system that could be useful.

    The system could offer an alternative metod of using it.
    Bank System Setup leaks one dialog.
    The system could detect which players are present and create
    dialogs and register events only for them.
     
  2. doomhammer99

    doomhammer99

    Joined:
    Dec 5, 2011
    Messages:
    319
    Resources:
    5
    Models:
    1
    Spells:
    3
    Tutorials:
    1
    Resources:
    5
    The codes are cool.
    But you really need to Prove that this works.
    (Documentation)
    Improve the Description.
     
    Last edited: Dec 20, 2012
  3. HellvsHeaven

    HellvsHeaven

    Joined:
    Nov 24, 2011
    Messages:
    30
    Resources:
    1
    Spells:
    1
    Resources:
    1
    So...you want more documentation? To prove the system works, users could test the system in game or I could explain or upload a video.
     
    Last edited: Dec 19, 2012
  4. doomhammer99

    doomhammer99

    Joined:
    Dec 5, 2011
    Messages:
    319
    Resources:
    5
    Models:
    1
    Spells:
    3
    Tutorials:
    1
    Resources:
    5
    Just explain it please :D
     
  5. aaron

    aaron

    Joined:
    Oct 18, 2008
    Messages:
    512
    Resources:
    6
    Maps:
    2
    Spells:
    4
    Resources:
    6
    a bank system? Magnificent for MMO/rpg maps.
     
  6. userid907

    userid907

    Joined:
    Jun 17, 2014
    Messages:
    205
    Resources:
    1
    Spells:
    1
    Resources:
    1
    thanks for creating this system bro!!! it is very useful for my map!!! :D