• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Code GBS System (warning: long loading time)

Level 10
Joined
Oct 5, 2008
Messages
355
Edit:

Moved the triggers in the post to try to remove some loading time from the main post (My browser seems to try to hang itself up everytime it loads the page:

Triggers:

  • GBS Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- This is the Section where you configure your Buffs. These are used to config all buffs and manage them --------
      • -------- You can Adjust the Variables to your liking. Until you are told otherwise ;) --------
      • -------- ---------------------- --------
      • -------- GBS_Init_Timer: This real will deteminate how often the system updates durations and states. --------
      • -------- This Variable determinates the performance of the system. Higher values make the system run more smoothly, while consuming more recources. For buffs, i found a update duration of 0,1 to 0,2 seconds to be sufficient. --------
        • Set GBS_Init_Timer = 0.15
      • -------- GBS_Init_Buffamount: Tells how much buffs you want the System to support. The System iterates from 1 to GBS_Buffamount. --------
        • Set GBS_Init_BuffAmount = 0
        • -------- ---------------------- --------
      • -------- The following are now the Changeable Variables to implement your system. See the "Demo" INI trigger to see how it works --------
        • -------- ---------------------- --------
        • -------- GBS_Define_Buff: This is the Buff the players will see on their interface when clicking on the unit --------
        • -------- GBS_Define_Spellbook: This is the spellbook which contains and hides the aura --------
      • -------- GBS_Define_Positive: This tags your buff the be considered a negative one. It is, like GBS_Init_Class, a classfication --------
        • -------- GBS_Define_Space: This value determinates how many reals you save when applying the buff. Example is Damage per second or Added health --------
      • -------- The system always reserve 3 reals for the duration and its linked event and 2 integers for the paths to the unit which has the buff and the one who caused it. These are already included. --------
      • -------- We need for this buff only a real value for the damage the buff deals each interval, so this variable is set to 1. --------
      • -------- GBS_Define_Class: This is classification for your buff. This is only a usefull option if you want to handle group of buffs a special way. --------
        • -------- 1 Stands here for the classification as a venom --------
      • -------- GBS_Define_Priority: The System enable you to remove/detect/modify a single buff from a bufflclass. this is used for Spell stealing for example. --------
      • -------- This Variable sets a priority which buff these functions will catch. The buff with the highest value will be picked and the longest duration will be always aquired. --------
        • -------- GBS_Define_Stack: This classifies for the buffs stacking behaviour --------
        • -------- 0: buff should override the prior one --------
        • -------- 1: buff should override only the buff applied by the same source --------
        • -------- 2: Stacks with any other buff of the same kind, but synchronizes them to the same duration. --------
        • -------- 3 or more: buff shouldn't override any buff. Every instance of the buff work for itself --------
      • -------- GBS_Define_Stack: This classifies if the buff uses a spellbook or not. If this is the case, set this variable to false. Else, when using Slow arua without a spellbook, set this to true. --------
        • -------- ---------------------- --------
      • -------- You can add any Init Variables you want, like to show your triggers that the debuff/buff is purgeable or others --------
        • -------- ---------------------- --------
        • -------- Do NOT modify this part except when you know what you are doing --------
        • -------- ---------------------- --------
        • -------- This creates the GBS_Hash --------
        • Hashtabelle - Create a hashtable
        • Set GBS_Hash = (Last created hashtable)
        • -------- Here, the at the beginning configured timer duration gets added to the GBS Loop --------
        • Auslöser - Add to GBS Loop <gen> the event (Zeit - Every GBS_Init_Timer seconds of game time)
        • -------- If you configured any Buffs here, they will directly get disbled --------
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • 'IF'-Bedingungen
            • GBS_Init_BuffAmount Größer als 0
          • 'THEN'-Aktionen
            • For each (Integer GBS_BuffLooper) from 1 to GBS_Init_BuffAmount, do (Actions)
              • Schleifen - Aktionen
                • For each (Integer GBS_Define_Looper) from 1 to 14, do (Actions)
                  • Schleifen - Aktionen
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • 'IF'-Bedingungen
                        • GBS_Define_OnlyAura Gleich False
                      • 'THEN'-Aktionen
                        • Spieler - Deaktivieren GBS_Init_Spellbook[GBS_BuffLooper] for (Player(GBS_Define_Looper))
                      • 'ELSE'-Aktionen
          • 'ELSE'-Aktionen



  • GBS Preload
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • GBS_Init_BuffAmount Größer als 0
        • 'THEN'-Aktionen
          • -------- ---------------------- --------
          • -------- this is the preloadTrigger. After Initilizing all your buffs, you can call this trigger to preload every buff you just created. --------
            • -------- ---------------------- --------
            • Set GBS_TempPoint = (Center of (Playable map area))
            • Einheit - Create 1 Soldat for Neutral passiv at GBS_TempPoint facing Vorgabe für Gebäude-Ausrichtung degrees
            • Set GBS_Source = (Last created unit)
            • Custom script: call RemoveLocation(udg_GBS_TempPoint)
            • For each (Integer GBS_Define_Looper) from 1 to GBS_Init_BuffAmount, do (Actions)
              • Schleifen - Aktionen
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • 'IF'-Bedingungen
                    • GBS_Init_IsPreloaded[GBS_Define_Looper] Gleich False
                  • 'THEN'-Aktionen
                    • Set GBS_Init_IsPreloaded[GBS_Define_Looper] = True
                    • Einheit - Add GBS_Init_Spellbook[GBS_Define_Looper] to GBS_Source
                    • Einheit - Remove GBS_Init_Spellbook[GBS_Define_Looper] from GBS_Source
                  • 'ELSE'-Aktionen
            • Einheit - Remove GBS_Source from the game
            • Custom script: set udg_GBS_Source = null
        • 'ELSE'-Aktionen

  • GBS Initialize Buff
    • Events
    • Conditions
    • Actions
      • Set GBS_Init_BuffAmount = (GBS_Init_BuffAmount + 1)
      • Set GBS_Init_Buff[GBS_Init_BuffAmount] = GBS_Define_Buff
      • Set GBS_Init_Spellbook[GBS_Init_BuffAmount] = GBS_Define_Spellbook
      • Set GBS_Init_Positive[GBS_Init_BuffAmount] = GBS_Define_Positive
      • Set GBS_Init_Space[GBS_Init_BuffAmount] = GBS_Define_Space
      • Set GBS_Init_Class[GBS_Init_BuffAmount] = GBS_Define_Class
      • Set GBS_Init_Priority[GBS_Init_BuffAmount] = GBS_Define_Priority
      • Set GBS_Init_Stack[GBS_Init_BuffAmount] = GBS_Define_Stack
      • Set GBS_Init_OnlyAura[GBS_Init_BuffAmount] = GBS_Define_OnlyAura
      • Set GBS_Init_IsPreloaded[GBS_Init_BuffAmount] = False
      • For each (Integer GBS_Define_Looper) from 1 to 14, do (Actions)
        • Schleifen - Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • GBS_Define_OnlyAura Gleich False
            • 'THEN'-Aktionen
              • Spieler - Deaktivieren GBS_Define_Spellbook for (Player(GBS_Define_Looper))
            • 'ELSE'-Aktionen
      • Set GBS_Define_Positive = False
      • Set GBS_Define_Space = 0
      • Set GBS_Define_Class = 0
      • Set GBS_Define_Priority = 0
      • Set GBS_Define_Stack = 0
      • Set GBS_Define_OnlyAura = False

  • GBS Loop
    • Ereignisse
    • Bedingungen
    • Aktionen
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (Number of units in GBS_Buffgroup) Größer als 0
        • 'THEN'-Aktionen
          • Einheitengruppe - Pick every unit in GBS_Buffgroup and do (Actions)
            • Schleifen - Aktionen
              • Set GBS_Security = True
              • Set GBS_Target = (Picked unit)
              • -------- One part of the GBS_Hash is sorted by the Custom value of the Units. This links directly to the buffs the units currently are affected by --------
                • Set GBS_MainIndex = (Custom value of GBS_Target)
                • -------- GBS_BuffAmountOnUnit is set to the amount of buffs the Unit currently possesses. --------
                • Set GBS_BuffAmountOnUnit = (Load 1 of GBS_MainIndex from GBS_Hash)
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • 'IF'-Bedingungen
                    • GBS_BuffAmountOnUnit Größer als 0
                  • 'THEN'-Aktionen
                    • -------- This Variables are for counting of all buffs the unit possesses --------
                    • For each (Integer GBS_BuffLooper) from 1 to GBS_Init_BuffAmount, do (Actions)
                      • Schleifen - Aktionen
                        • Set GBS_BuffCounter[GBS_BuffLooper] = 0
                    • -------- -------------------- --------
                    • Set GBS_BuffLooper = 0
                    • Custom script: loop
                    • Set GBS_BuffLooper = (GBS_BuffLooper + 1)
                    • Custom script: exitwhen udg_GBS_BuffLooper > udg_GBS_BuffAmountOnUnit
                    • -------- Now the current data of the buff is loaded --------
                    • Set GBS_BuffId = (Load (2 x GBS_BuffLooper) of GBS_MainIndex from GBS_Hash)
                    • -------- The keys of the buffs within the hashtable are around 10k+The Buff Id, 10k is choosen because bribes unit indexer has an op limit of ~9,5k , so this number lets you evade any collisions --------
                      • Set GBS_BuffKey = (10000 + GBS_BuffId)
                      • Set GBS_BuffLink = (Load (1 + (GBS_BuffLooper x 2)) of GBS_MainIndex from GBS_Hash)
                      • Set GBS_BuffLinkMax = (Load 1 of (10000 + GBS_BuffId) from GBS_Hash)
                    • Set GBS_Source = UDexUnits[(Load ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 1) of GBS_BuffKey from GBS_Hash)]
                      • Set GBS_Duration = (Load ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 2) of GBS_BuffKey from GBS_Hash)
                    • Set GBS_EventDuration = (Load ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 3) of GBS_BuffKey from GBS_Hash)
                      • Set GBS_EventInterval = (Load ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 4) of GBS_BuffKey from GBS_Hash)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • 'IF'-Bedingungen
                          • GBS_Init_Space[GBS_BuffId] Größer als 0
                        • 'THEN'-Aktionen
                          • For each (Integer GBS_TempInteger) from 1 to GBS_Init_Space[GBS_BuffId], do (Actions)
                            • Schleifen - Aktionen
                              • Set GBS_InsertedReal[GBS_TempInteger] = (Load ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + (4 + GBS_TempInteger)) of GBS_BuffKey from GBS_Hash)
                        • 'ELSE'-Aktionen
                      • -------- Now the system checks if the buff needs to be removed --------
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • 'IF'-Bedingungen
                          • (GBS_Target is alive) Gleich True
                        • 'THEN'-Aktionen
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • 'IF'-Bedingungen
                              • GBS_Duration Gleich -10.00
                            • 'THEN'-Aktionen
                              • -------- When a buff gets removed by spells, it should sets the duration to -10, showing that the buff is purged --------
                                • Set GBS_Event = 0.00
                                • Set GBS_Event = 4.00
                                • Set GBS_Event = 0.00
                                • -------- Now, the System recyles the index in the hashtable --------
                                • Auslöser - Run GBS Allocate <gen> (ignoring conditions)
                            • 'ELSE'-Aktionen
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • 'IF'-Bedingungen
                                  • GBS_Duration Gleich -15.00
                                • 'THEN'-Aktionen
                                  • -------- When a Buff was overriden because it doesn't stack, then the duration is set to -15; showing that the buff got overridden --------
                                    • Set GBS_Event = 0.00
                                    • Set GBS_Event = 5.00
                                    • Set GBS_Event = 0.00
                                    • -------- Now, the System recyles the index in the hashtable --------
                                    • Auslöser - Run GBS Allocate <gen> (ignoring conditions)
                                • 'ELSE'-Aktionen
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • 'IF'-Bedingungen
                                      • Or - Any (Conditions) are true
                                        • Bedingungen
                                          • GBS_Duration Größer gleich 0.00
                                          • GBS_Duration Gleich -5.00
                                    • 'THEN'-Aktionen
                                      • -------- At this point, the trigger checks the duration and event intervals --------
                                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                          • 'IF'-Bedingungen
                                            • GBS_Duration Gleich -5.00
                                          • 'THEN'-Aktionen
                                          • 'ELSE'-Aktionen
                                            • Set GBS_Duration = (GBS_Duration - GBS_Init_Timer)
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • 'IF'-Bedingungen
                                          • GBS_EventInterval Größer als 0.00
                                        • 'THEN'-Aktionen
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • 'IF'-Bedingungen
                                              • GBS_EventDuration Gleich -5.00
                                            • 'THEN'-Aktionen
                                              • Set GBS_EventDuration = GBS_EventInterval
                                              • -------- If this Condition is true, then this function was called for the first time, thus firering an event --------
                                                • Set GBS_Event = 0.00
                                                • Set GBS_Event = 7.00
                                                • Set GBS_Event = 0.00
                                            • 'ELSE'-Aktionen
                                            • Set GBS_EventDuration = (GBS_EventDuration - GBS_Init_Timer)
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • 'IF'-Bedingungen
                                              • GBS_EventDuration Kleiner gleich 0.00
                                            • 'THEN'-Aktionen
                                              • -------- When these conditions are fulfilled, the periodic timer of the buff ran out, making it firering an event with a real equal to the buff id. --------
                                                • Set GBS_PeriodicEvent = 0.00
                                                • Set GBS_PeriodicEvent = (Real(GBS_BuffId))
                                                • Set GBS_PeriodicEvent = 0.00
                                                • -------- Then, the timer is resetted --------
                                              • Set GBS_EventDuration = (GBS_EventDuration + GBS_EventInterval)
                                            • 'ELSE'-Aktionen
                                        • 'ELSE'-Aktionen
                                      • -------- If the whole loop got completed, the system updates the hashtable (In case any event fired and updated the variables --------
                                        • Hashtabelle - Save GBS_Duration as ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 2) of GBS_BuffKey in GBS_Hash
                                        • Hashtabelle - Save GBS_EventDuration as ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 3) of GBS_BuffKey in GBS_Hash
                                        • Hashtabelle - Save GBS_EventInterval as ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 4) of GBS_BuffKey in GBS_Hash
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • 'IF'-Bedingungen
                                          • GBS_Init_Space[GBS_BuffId] Größer als 0
                                        • 'THEN'-Aktionen
                                          • For each (Integer GBS_TempInteger) from 1 to GBS_Init_Space[GBS_BuffId], do (Actions)
                                            • Schleifen - Aktionen
                                              • Hashtabelle - Save GBS_InsertedReal[GBS_TempInteger] as ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + (GBS_TempInteger + 4)) of GBS_BuffKey in GBS_Hash
                                        • 'ELSE'-Aktionen
                                        • -------- Then, then counting interval is increased --------
                                      • Set GBS_BuffCounter[GBS_BuffId] = (GBS_BuffCounter[GBS_BuffId] + 1)
                                    • 'ELSE'-Aktionen
                                      • -------- here, the duration ran out --------
                                      • Set GBS_Event = 0.00
                                      • Set GBS_Event = 2.00
                                      • Set GBS_Event = 0.00
                                      • -------- Now, the System recyles the index in the hashtable --------
                                        • Auslöser - Run GBS Allocate <gen> (ignoring conditions)
                        • 'ELSE'-Aktionen
                          • -------- At this point, the system fires GBS_Event for each removed buff --------
                          • Set GBS_Event = 0.00
                          • Set GBS_Event = 3.00
                          • Set GBS_Event = 0.00
                          • -------- Now, the System recyles the index in the hashtable --------
                          • Einheit - Remove GBS_Init_Spellbook[GBS_BuffId] from GBS_Target
                          • Auslöser - Run GBS Allocate <gen> (ignoring conditions)
                      • -------- Now TempInteger2 gets updated to see if new buffs were removed/added --------
                      • Set GBS_BuffAmountOnUnit = (Load 1 of GBS_MainIndex from GBS_Hash)
                      • Custom script: endloop
                      • For each (Integer GBS_BuffLooper) from 1 to GBS_Init_BuffAmount, do (Actions)
                        • Schleifen - Aktionen
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • 'IF'-Bedingungen
                              • GBS_BuffCounter[GBS_BuffLooper] Gleich 0
                              • (GBS_Target is alive) Gleich True
                            • 'THEN'-Aktionen
                              • Einheit - Remove GBS_Init_Spellbook[GBS_BuffLooper] from GBS_Target
                              • Einheit - Remove GBS_Init_Buff[GBS_BuffLooper] buff from GBS_Target
                            • 'ELSE'-Aktionen
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • 'IF'-Bedingungen
                                  • (GBS_Target is alive) Gleich True
                                • 'THEN'-Aktionen
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • 'IF'-Bedingungen
                                      • (Level of GBS_Init_Spellbook[GBS_BuffLooper] for GBS_Target) Größer als 0
                                    • 'THEN'-Aktionen
                                    • 'ELSE'-Aktionen
                                      • Einheit - Add GBS_Init_Spellbook[GBS_BuffLooper] to GBS_Target
                                • 'ELSE'-Aktionen
                                  • Einheit - Remove GBS_Init_Spellbook[GBS_BuffLooper] from GBS_Target
                  • 'ELSE'-Aktionen
                    • -------- If the unit got no buffs, it is removed from the Unit group and the corresponding Child is cleared --------
                      • Einheitengruppe - Remove GBS_Target from GBS_Buffgroup
                      • Hashtabelle - Clear all child hashtables of child GBS_MainIndex in GBS_Hash
                • Set GBS_Security = False
        • 'ELSE'-Aktionen
          • -------- If there are no units with buffs on the map, the hashtable cleares itself and the loop gets disabled --------
            • Auslöser - Turn off (This trigger)


  • GBS Allocate
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • GBS_BuffLooper Gleich GBS_BuffAmountOnUnit
        • 'THEN'-Aktionen
        • 'ELSE'-Aktionen
          • Hashtabelle - Save (Load (GBS_BuffAmountOnUnit x 2) of GBS_MainIndex from GBS_Hash) as (GBS_BuffLooper x 2) of GBS_MainIndex in GBS_Hash
            • Hashtabelle - Save (Load ((GBS_BuffAmountOnUnit x 2) + 1) of GBS_MainIndex from GBS_Hash) as ((GBS_BuffLooper x 2) + 1) of GBS_MainIndex in GBS_Hash
      • Hashtabelle - Save 0 as (GBS_BuffAmountOnUnit x 2) of GBS_MainIndex in GBS_Hash
      • Hashtabelle - Save 0 as ((GBS_BuffAmountOnUnit x 2) + 1) of GBS_MainIndex in GBS_Hash
      • Set GBS_BuffAmountOnUnit = (GBS_BuffAmountOnUnit - 1)
      • Hashtabelle - Save GBS_BuffAmountOnUnit as 1 of GBS_MainIndex in GBS_Hash
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • GBS_BuffLink Gleich GBS_BuffLinkMax
        • 'THEN'-Aktionen
        • 'ELSE'-Aktionen
          • -------- When we allocate a buff within the table, we need to adjust its pointer to the right position --------
          • For each (Integer GBS_TempInteger) from 1 to (Load 1 of (Load (GBS_BuffLinkMax x (5 + GBS_Init_Space[GBS_BuffId])) of GBS_BuffKey from GBS_Hash) from GBS_Hash), do (Actions)
            • Schleifen - Aktionen
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Bedingungen
                  • (Load (2 x GBS_TempInteger) of (Load (GBS_BuffLinkMax x (GBS_Init_Space[GBS_BuffId] + 5)) of GBS_BuffKey from GBS_Hash) from GBS_Hash) Gleich GBS_BuffId
                  • (Load ((GBS_TempInteger x 2) + 1) of (Load (GBS_BuffLinkMax x (GBS_Init_Space[GBS_BuffId] + 5)) of GBS_BuffKey from GBS_Hash) from GBS_Hash) Gleich GBS_BuffLinkMax
                • 'THEN'-Aktionen
                  • Hashtabelle - Save GBS_BuffLink as ((GBS_TempInteger x 2) + 1) of (Load (GBS_BuffLinkMax x (5 + GBS_Init_Space[GBS_BuffId])) of GBS_BuffKey from GBS_Hash) in GBS_Hash
                • 'ELSE'-Aktionen
          • Hashtabelle - Save (Load (GBS_BuffLinkMax x (GBS_Init_Space[GBS_BuffId] + 5)) of GBS_BuffKey from GBS_Hash) as (GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) of GBS_BuffKey in GBS_Hash
            • Hashtabelle - Save (Load ((GBS_BuffLinkMax x (GBS_Init_Space[GBS_BuffId] + 5)) + 1) of GBS_BuffKey from GBS_Hash) as ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 1) of GBS_BuffKey in GBS_Hash
          • Hashtabelle - Save (Load ((GBS_BuffLinkMax x (GBS_Init_Space[GBS_BuffId] + 5)) + 2) of GBS_BuffKey from GBS_Hash) as ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 2) of GBS_BuffKey in GBS_Hash
            • Hashtabelle - Save (Load ((GBS_BuffLinkMax x (GBS_Init_Space[GBS_BuffId] + 5)) + 3) of GBS_BuffKey from GBS_Hash) as ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 3) of GBS_BuffKey in GBS_Hash
          • Hashtabelle - Save (Load ((GBS_BuffLinkMax x (GBS_Init_Space[GBS_BuffId] + 5)) + 4) of GBS_BuffKey from GBS_Hash) as ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 4) of GBS_BuffKey in GBS_Hash
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • 'IF'-Bedingungen
                • GBS_Init_Space[GBS_BuffId] Größer als 0
              • 'THEN'-Aktionen
                • For each (Integer GBS_TempInteger) from 1 to GBS_Init_Space[GBS_BuffId], do (Actions)
                  • Schleifen - Aktionen
                    • Hashtabelle - Save (Load ((GBS_BuffLinkMax x (GBS_Init_Space[GBS_BuffId] + 5)) + (4 + GBS_TempInteger)) of GBS_BuffKey from GBS_Hash) as ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + (GBS_TempInteger + 4)) of GBS_BuffKey in GBS_Hash
              • 'ELSE'-Aktionen
      • Hashtabelle - Save 0 as (GBS_BuffLinkMax x (GBS_Init_Space[GBS_BuffId] + 5)) of GBS_BuffKey in GBS_Hash
      • Hashtabelle - Save 0 as ((GBS_BuffLinkMax x (GBS_Init_Space[GBS_BuffId] + 5)) + 1) of GBS_BuffKey in GBS_Hash
      • Hashtabelle - Save 0.00 as ((GBS_BuffLinkMax x (GBS_Init_Space[GBS_BuffId] + 5)) + 2) of GBS_BuffKey in GBS_Hash
      • Hashtabelle - Save 0.00 as ((GBS_BuffLinkMax x (GBS_Init_Space[GBS_BuffId] + 5)) + 3) of GBS_BuffKey in GBS_Hash
      • Hashtabelle - Save 0.00 as ((GBS_BuffLinkMax x (GBS_Init_Space[GBS_BuffId] + 5)) + 4) of GBS_BuffKey in GBS_Hash
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • GBS_Init_Space[GBS_BuffId] Größer als 0
        • 'THEN'-Aktionen
          • For each (Integer GBS_TempInteger) from 1 to GBS_Init_Space[GBS_BuffId], do (Actions)
            • Schleifen - Aktionen
              • Hashtabelle - Save 0.00 as ((GBS_BuffLinkMax x (GBS_Init_Space[GBS_BuffId] + 5)) + (GBS_TempInteger + 4)) of GBS_BuffKey in GBS_Hash
        • 'ELSE'-Aktionen
      • Set GBS_BuffLinkMax = (GBS_BuffLinkMax - 1)
      • Hashtabelle - Save GBS_BuffLinkMax as 1 of GBS_BuffKey in GBS_Hash
      • Set GBS_BuffLooper = (GBS_BuffLooper - 1)

  • GBS Apply Buff
    • Events
    • Conditions
    • Actions
      • -------- Picks any buff on a unit and runs the action within GBS_PickFunction --------
      • -------- Required variables: GBS_Target; GBS_Source; GBS_Duration; GBS_Interval; GBS_InsertedReal (If the buff has any reals associated with it) --------
        • -------- If you want to evade any buffs, add it to the conditions of the trigger of your liking --------
      • -------- This makes it able to remove buffs. To remove it and fire the purging Event, set the GBS_Duration to -10.00 . --------
        • -------- If you want it to look like it ran out of duration, use any negative value that isn't -10.00 --------
        • -------- --------------------------- --------
        • -------- --------------------------- --------
      • -------- The only condition that needs to be fulfilled: the unit needs to be alive, and the buff cannot be created within a GBS-Event --------
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • 'IF'-Bedingungen
            • GBS_Security Gleich False
            • (GBS_Target is alive) Gleich True
          • 'THEN'-Aktionen
            • Set GBS_EventDuration = -5.00
            • Set GBS_Security = True
            • Set GBS_Event = 0.00
            • Set GBS_Event = 1.00
            • Set GBS_Event = 0.00
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • 'IF'-Bedingungen
                • Or - Any (Conditions) are true
                  • Bedingungen
                    • GBS_Duration Gleich -5.00
                    • GBS_Duration Größer gleich 0.00
              • 'THEN'-Aktionen
                • Set GBS_MainIndex = (Custom value of GBS_Target)
                • Set GBS_BuffAmountOnUnit = (Custom value of GBS_Source)
                • Set GBS_BuffKey = (10000 + GBS_BuffId)
                • Set GBS_BuffLinkMax = (Load 1 of GBS_BuffKey from GBS_Hash)
                • Set GBS_BuffLink = 0
                • -------- Now the trigger checks the stacking behaviour of the buff and then creates the indizes --------
                • -------- 0 means that the buffs only need to be the same to be overridden --------
                • -------- 1 means that the buff also needs to be from the same source to be overriden --------
                • -------- 2 means that any found buff will be refreshed to the duration of the applied one --------
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • 'IF'-Bedingungen
                    • (Load 1 of GBS_MainIndex from GBS_Hash) Größer als 0
                    • Or - Any (Conditions) are true
                      • Bedingungen
                        • GBS_Init_Stack[GBS_BuffId] Gleich 0
                        • GBS_Init_Stack[GBS_BuffId] Gleich 1
                        • GBS_Init_Stack[GBS_BuffId] Gleich 2
                  • 'THEN'-Aktionen
                    • -------- Now it iterates through each buff the unit posses to seek a buff that is the same as the applied one --------
                      • For each (Integer GBS_TempInteger) from 1 to (Load 1 of GBS_MainIndex from GBS_Hash), do (Actions)
                        • Schleifen - Aktionen
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • 'IF'-Bedingungen
                              • (Load (GBS_TempInteger x 2) of GBS_MainIndex from GBS_Hash) Gleich GBS_BuffId
                              • Or - Any (Conditions) are true
                                • Bedingungen
                                  • GBS_Init_Stack[GBS_BuffId] Gleich 0
                                  • GBS_Init_Stack[GBS_BuffId] Gleich 2
                                  • And - All (Conditions) are true
                                    • Bedingungen
                                      • GBS_Init_Stack[GBS_BuffId] Gleich 1
                                      • (Load (((Load ((GBS_TempInteger x 2) + 1) of GBS_MainIndex from GBS_Hash) x (GBS_Init_Space[GBS_BuffId] + 5)) + 1) of GBS_BuffKey from GBS_Hash) Gleich GBS_BuffAmountOnUnit
                            • 'THEN'-Aktionen
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • 'IF'-Bedingungen
                                  • GBS_Init_Stack[GBS_BuffId] Gleich 2
                                • 'THEN'-Aktionen
                                  • -------- In this case, a buff gets refreshed to the duration of the new buff --------
                                  • Hashtabelle - Save GBS_Duration as (((Load ((GBS_TempInteger x 2) + 1) of GBS_MainIndex from GBS_Hash) x (5 + GBS_Init_Space[GBS_BuffId])) + 2) of GBS_BuffKey in GBS_Hash
                                • 'ELSE'-Aktionen
                                  • -------- In this case, a buff gets overriden, it will be set to fire an override event --------
                                    • Hashtabelle - Save -15.00 as (((Load ((GBS_TempInteger x 2) + 1) of GBS_MainIndex from GBS_Hash) x (5 + GBS_Init_Space[GBS_BuffId])) + 2) of GBS_BuffKey in GBS_Hash
                            • 'ELSE'-Aktionen
                  • 'ELSE'-Aktionen
                • -------- Now we can save our Values into the Hashtable and apply the buff --------
                • Set GBS_BuffLinkMax = (GBS_BuffLinkMax + 1)
                • Set GBS_BuffLink = GBS_BuffLinkMax
                • Hashtabelle - Save GBS_BuffLinkMax as 1 of GBS_BuffKey in GBS_Hash
                • Set GBS_BuffLooper = (Load 1 of GBS_MainIndex from GBS_Hash)
                • Set GBS_BuffLooper = (GBS_BuffLooper + 1)
                • Hashtabelle - Save GBS_BuffLooper as 1 of GBS_MainIndex in GBS_Hash
                • Hashtabelle - Save GBS_BuffId as (GBS_BuffLooper x 2) of GBS_MainIndex in GBS_Hash
                • Hashtabelle - Save GBS_BuffLink as ((GBS_BuffLooper x 2) + 1) of GBS_MainIndex in GBS_Hash
                • Hashtabelle - Save GBS_MainIndex as ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 0) of GBS_BuffKey in GBS_Hash
                • Hashtabelle - Save GBS_BuffAmountOnUnit as ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 1) of GBS_BuffKey in GBS_Hash
                  • Hashtabelle - Save GBS_Duration as ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 2) of GBS_BuffKey in GBS_Hash
                • Hashtabelle - Save GBS_EventDuration as ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 3) of GBS_BuffKey in GBS_Hash
                  • Hashtabelle - Save GBS_EventInterval as ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 4) of GBS_BuffKey in GBS_Hash
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • 'IF'-Bedingungen
                      • GBS_Init_Space[GBS_BuffId] Größer als 0
                    • 'THEN'-Aktionen
                      • For each (Integer GBS_TempInteger) from 1 to GBS_Init_Space[GBS_BuffId], do (Actions)
                        • Schleifen - Aktionen
                          • Hashtabelle - Save GBS_InsertedReal[GBS_TempInteger] as ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + (GBS_TempInteger + 4)) of GBS_BuffKey in GBS_Hash
                    • 'ELSE'-Aktionen
                  • Einheit - Add GBS_Init_Spellbook[GBS_BuffId] to GBS_Target
                  • Einheitengruppe - Add GBS_Target to GBS_Buffgroup
                  • Auslöser - Turn on GBS Loop <gen>
              • 'ELSE'-Aktionen
            • Set GBS_Security = False
          • 'ELSE'-Aktionen

  • GBS Pick every Buff
    • Events
    • Conditions
    • Actions
      • -------- Picks any buff on a unit and runs the action within GBS_PickFunction --------
      • -------- Required variables: GBS_Target (The Unit picked); GBS_PickFunction --------
      • -------- If you want to evade any buffs, add it to the conditions of the trigger of your liking --------
      • -------- This makes it able to remove buffs. To remove it and fire the purging Event, set the GBS_Duration to -10.00 . --------
        • -------- If you want it to look like it ran out of duration, use any negative value that isn't -10.00 --------
        • -------- GBS_Condition1: 1 here means the buff should be positive, 2 it should be negative and 0: doesnt matter --------
        • -------- GBS_Condition2: This looks for the classification. 0 means that classifications dont have any effect --------
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • 'IF'-Bedingungen
            • (GBS_Target is alive) Gleich True
            • GBS_Security Gleich False
          • 'THEN'-Aktionen
            • -------- One part of the GBS_Hash is sorted by the Custom value of the Units. This links directly to the buffs the units currently are affected by --------
              • Set GBS_MainIndex = (Custom value of GBS_Target)
              • -------- GBS_BuffAmountOnUnit is set to the amount of buffs the Unit currently possesses. --------
              • Set GBS_BuffAmountOnUnit = (Load 1 of GBS_MainIndex from GBS_Hash)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Bedingungen
                  • GBS_BuffAmountOnUnit Größer als 0
                • 'THEN'-Aktionen
                  • Set GBS_BuffLooper = 0
                  • Custom script: loop
                  • Set GBS_BuffLooper = (GBS_BuffLooper + 1)
                  • Custom script: exitwhen udg_GBS_BuffLooper > udg_GBS_BuffAmountOnUnit
                  • -------- Now the current data of the buff is loaded --------
                  • Set GBS_BuffId = (Load (2 x GBS_BuffLooper) of GBS_MainIndex from GBS_Hash)
                  • -------- The keys of the buffs within the hashtable are around 10k+The Buff Id, 10k is choosen because bribes unit indexer has an op limit of ~9,5k , so this number lets you evade any collisions --------
                    • Set GBS_BuffKey = (10000 + GBS_BuffId)
                    • Set GBS_BuffLink = (Load (1 + (GBS_BuffLooper x 2)) of GBS_MainIndex from GBS_Hash)
                    • Set GBS_BuffLinkMax = (Load 1 of (10000 + GBS_BuffId) from GBS_Hash)
                  • Set GBS_Source = UDexUnits[(Load ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 1) of GBS_BuffKey from GBS_Hash)]
                  • Set GBS_Duration = (Load ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 2) of GBS_BuffKey from GBS_Hash)
                  • Set GBS_EventDuration = (Load ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 3) of GBS_BuffKey from GBS_Hash)
                  • Set GBS_EventInterval = (Load ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 4) of GBS_BuffKey from GBS_Hash)
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • 'IF'-Bedingungen
                        • GBS_Init_Space[GBS_BuffId] Größer als 0
                      • 'THEN'-Aktionen
                        • For each (Integer GBS_TempInteger) from 1 to GBS_Init_Space[GBS_BuffId], do (Actions)
                          • Schleifen - Aktionen
                            • Set GBS_InsertedReal[GBS_TempInteger] = (Load ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + (4 + GBS_TempInteger)) of GBS_BuffKey from GBS_Hash)
                      • 'ELSE'-Aktionen
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • 'IF'-Bedingungen
                        • Or - Any (Conditions) are true
                          • Bedingungen
                            • GBS_Duration Größer als 0.00
                            • GBS_Duration Gleich -5.00
                      • 'THEN'-Aktionen
                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • 'IF'-Bedingungen
                            • Or - Any (Conditions) are true
                              • Bedingungen
                                • GBS_Condition2 Gleich 0
                                • GBS_Condition2 Gleich GBS_Init_Class[GBS_BuffId]
                            • Or - Any (Conditions) are true
                              • Bedingungen
                                • GBS_Condition1 Gleich 0
                                • And - All (Conditions) are true
                                  • Bedingungen
                                    • GBS_Condition1 Gleich 2
                                    • GBS_Init_Positive[GBS_BuffId] Gleich False
                                • And - All (Conditions) are true
                                  • Bedingungen
                                    • GBS_Condition1 Gleich 1
                                    • GBS_Init_Positive[GBS_BuffId] Gleich True
                          • 'THEN'-Aktionen
                            • -------- Here, the trigger found a buff and runs the choosen trigger. --------
                            • -------- If you want to evade any buffs, add it to the conditions of the trigger of your liking --------
                              • Auslöser - Run GBS_PickFunction (checking conditions)
                              • -------- ---------------- --------
                            • -------- The Trigger automatically updates the values of the buffs. no need to manually make it --------
                            • Hashtabelle - Save GBS_Duration as ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 2) of GBS_BuffKey in GBS_Hash
                              • Hashtabelle - Save GBS_EventDuration as ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 3) of GBS_BuffKey in GBS_Hash
                            • Hashtabelle - Save GBS_EventInterval as ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 4) of GBS_BuffKey in GBS_Hash
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • 'IF'-Bedingungen
                                  • GBS_Init_Space[GBS_BuffId] Größer als 0
                                • 'THEN'-Aktionen
                                  • For each (Integer GBS_TempInteger) from 1 to GBS_Init_Space[GBS_BuffId], do (Actions)
                                    • Schleifen - Aktionen
                                      • Hashtabelle - Save GBS_InsertedReal[GBS_TempInteger] as ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + (GBS_TempInteger + 4)) of GBS_BuffKey in GBS_Hash
                                • 'ELSE'-Aktionen
                          • 'ELSE'-Aktionen
                            • -------- The function wont fire when one of the conditions isnt fullfilled --------
                      • 'ELSE'-Aktionen
                        • -------- The function wont fire triggers when a buff is removed already and just needs to be cleaned up --------
                    • Custom script: endloop
                • 'ELSE'-Aktionen
                  • -------- In this case, the trigger does nothing, since there arent any buffs to pick --------
              • -------- Now the Condition Integers are cleaned --------
              • Set GBS_Condition1 = 0
              • Set GBS_Condition2 = 0
          • 'ELSE'-Aktionen

  • GBS Count buffs
    • Events
    • Conditions
    • Actions
      • -------- Required variables: GBS_Target (The Unit whose buffs are counted) --------
      • -------- This gives out GBS_BuffCounter, an array in which all buffs with their number on the unit are listed. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (GBS_Target is alive) Gleich True
        • 'THEN'-Aktionen
          • -------- One part of the GBS_Hash is sorted by the Custom value of the Units. This links directly to the buffs the units currently are affected by --------
            • Set GBS_MainIndex = (Custom value of GBS_Target)
            • -------- GBS_BuffAmountOnUnit is set to the amount of buffs the Unit currently possesses. --------
            • Set GBS_BuffAmountOnUnit = (Load 1 of GBS_MainIndex from GBS_Hash)
            • -------- Now the Array is cleaned --------
            • For each (Integer GBS_BuffLooper) from 1 to GBS_Init_BuffAmount, do (Actions)
              • Schleifen - Aktionen
                • Set GBS_BuffCounter[GBS_BuffLooper] = 0
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • 'IF'-Bedingungen
                • GBS_BuffAmountOnUnit Größer als 0
              • 'THEN'-Aktionen
                • Set GBS_BuffLooper = 0
                • Custom script: loop
                • Set GBS_BuffLooper = (GBS_BuffLooper + 1)
                • Custom script: exitwhen udg_GBS_BuffLooper > udg_GBS_BuffAmountOnUnit
                • -------- Now the necessary data of the buff is loaded --------
                • Set GBS_BuffId = (Load (2 x GBS_BuffLooper) of GBS_MainIndex from GBS_Hash)
                • Set GBS_BuffLink = (Load (1 + (GBS_BuffLooper x 2)) of GBS_MainIndex from GBS_Hash)
                • Set GBS_BuffKey = (10000 + GBS_BuffId)
                • Set GBS_Duration = (Load ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 2) of GBS_BuffKey from GBS_Hash)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • 'IF'-Bedingungen
                      • Or - Any (Conditions) are true
                        • Bedingungen
                          • GBS_Duration Größer als 0.00
                          • GBS_Duration Gleich -5.00
                    • 'THEN'-Aktionen
                      • -------- Here, the trigger found a buff and counts it --------
                      • Set GBS_BuffCounter[GBS_BuffId] = (GBS_BuffCounter[GBS_BuffId] + 1)
                    • 'ELSE'-Aktionen
                      • -------- The buffs wont be counted when a buff is removed already and just needs to be cleaned up --------
                  • Custom script: endloop
              • 'ELSE'-Aktionen
                • -------- In this case, the trigger does nothing, since there arent any buffs to pick. The Array remains empty --------
        • 'ELSE'-Aktionen


  • GBS Pick Priortity Buff
    • Events
    • Conditions
    • Actions
      • -------- Required variables: --------
      • -------- GBS_Target (The Unit whose buffs are counted) --------
      • -------- GBS_Condition1: 1 here means the buff should be positive, 2 it should be negative and 0: doesnt matter --------
      • -------- GBS_Condition2: This looks for the classification. 0 means that classifications dont have any effect --------
      • -------- GBS_PickFunction: this is the function that will be executed be done when a matching buff is found --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Conditions
          • (GBS_Target is alive) Gleich True
        • 'THEN'-Actions
          • -------- One part of the GBS_Hash is sorted by the Custom value of the Units. This links directly to the buffs the units currently are affected by --------
            • Set GBS_MainIndex = (Custom value of GBS_Target)
            • -------- GBS_BuffAmountOnUnit is set to the amount of buffs the Unit currently possesses. --------
            • Set GBS_BuffAmountOnUnit = (Load 1 of GBS_MainIndex from GBS_Hash)
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • 'IF'-Conditions
                • GBS_BuffAmountOnUnit Größer als 0
              • 'THEN'-Actions
                • Set GBS_BuffId = 0
                • Set GBS_TempInteger = 0
                • Set GBS_BuffKey = 0
                • Set GBS_BuffLooper = 0
                • Custom script: loop
                • Set GBS_BuffLooper = (GBS_BuffLooper + 1)
                • Custom script: exitwhen udg_GBS_BuffLooper > udg_GBS_BuffAmountOnUnit
                • -------- Now the necessary data of the buff is loaded --------
                • Set GBS_BuffId = (Load (GBS_BuffLooper x 2) of GBS_MainIndex from GBS_Hash)
                • Set GBS_BuffLink = (Load (1 + (GBS_BuffLooper x 2)) of GBS_MainIndex from GBS_Hash)
                • Set GBS_Duration = (Load ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 2) of (10000 + GBS_BuffId) from GBS_Hash)
                  • -------- The System checks if the requirements are fullfilled --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • 'IF'-Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • GBS_Condition2 equal 0
                          • GBS_Condition2 equal GBS_Init_Class[GBS_BuffId]
                      • Or - Any (Conditions) are true
                        • Conditions
                          • GBS_Condition1 equal 0
                          • And - All (Conditions) are true
                            • Conditions
                              • GBS_Condition1 equal 2
                              • GBS_Init_Positive[GBS_BuffId] equal False
                          • And - All (Conditions) are true
                            • Conditions
                              • GBS_Condition1 equal 1
                              • GBS_Init_Positive[GBS_BuffId] equal True
                      • Or - Any (Conditions) are true
                        • Conditions
                          • GBS_Duration greater than 0.00
                          • GBS_Duration Equal -5.00
                    • 'THEN'-Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • 'IF'-Conditions
                          • GBS_Init_Priority[GBS_TempInteger] less than GBS_Init_Priority[GBS_BuffId]
                        • 'THEN'-Actions
                          • -------- the priority of the buff is higher, it gets to be selected --------
                          • Set GBS_TempInteger = GBS_BuffId
                          • Set GBS_BuffKey = GBS_BuffLink
                        • 'ELSE'-Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • 'IF'-Conditions
                              • GBS_Init_Priority[GBS_TempInteger] greater than GBS_Init_Priority[GBS_BuffId]
                            • 'THEN'-Actions
                              • -------- the priority of the buff is lower, it can't be selected --------
                            • 'ELSE'-Actions
                              • -------- If the priority is equal, the function will retreive the buff with the highest duration --------
                                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                  • 'IF'-Conditions
                                    • Or - Any (Conditions) are true
                                      • Conditions
                                        • GBS_Duration equal -5.00
                                        • GBS_Duratiogreater than (Load ((GBS_BuffKey x (5 + GBS_Init_Space[GBS_TempInteger])) + 2) of (10000 + GBS_TempInteger) from GBS_Hash)
                                  • 'THEN'-Actions
                                    • -------- the buff lasts longer, it will get picked --------
                                    • Set GBS_TempInteger = GBS_BuffId
                                    • Set GBS_BuffKey = GBS_BuffLink
                                  • 'ELSE'-Actions
                                    • -------- the buff don't last as long, it wont be picked --------
                    • 'ELSE'-Aktionen
                  • Custom script: endloop
                  • -------- Now it is checked if a matching buff was found --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • 'IF'-Conditions
                      • GBS_TempInteger greater than 0
                    • 'THEN'-Actions
                      • Set GBS_BuffId = GBS_TempInteger
                      • Set GBS_BuffLink = GBS_BuffKey
                      • Set GBS_BuffKey = (10000 + GBS_BuffId)
                      • Set GBS_BuffLinkMax = (Load 1 of (10000 + GBS_BuffId) from GBS_Hash)
                      • Set GBS_Source = UDexUnits[(Load ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 1) of GBS_BuffKey from GBS_Hash)]
                        • Set GBS_Duration = (Load ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 2) of GBS_BuffKey from GBS_Hash)
                      • Set GBS_EventDuration = (Load ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 3) of GBS_BuffKey from GBS_Hash)
                        • Set GBS_EventInterval = (Load ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 4) of GBS_BuffKey from GBS_Hash)
                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • 'IF'-Conditions
                            • GBS_Init_Space[GBS_BuffId] greater than 0
                          • 'THEN'-Actions
                            • For each (Integer GBS_TempInteger) from 1 to GBS_Init_Space[GBS_BuffId], do (Actions)
                              • Loop - Actions
                                • Set GBS_InsertedReal[GBS_TempInteger] = (Load ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + (4 + GBS_TempInteger)) of GBS_BuffKey from GBS_Hash)
                          • 'ELSE'-Actions
                        • -------- Here, the trigger found a buff and runs the choosen trigger. --------
                      • -------- If you want to evade any buffs, add it to the conditions of the trigger of your liking --------
                        • Trigger - Run GBS_PickFunction (checking conditions)
                        • -------- ---------------- --------
                      • -------- The Trigger automatically updates the values of the buffs. no need to manually make it --------
                      • Hashtable - Save GBS_Duration as ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 2) of GBS_BuffKey in GBS_Hash
                        • Hashtable - Save GBS_EventDuration as ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 3) of GBS_BuffKey in GBS_Hash
                      • Hashtable - Save GBS_EventInterval as ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + 4) of GBS_BuffKey in GBS_Hash
                        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • 'IF'-Conditions
                            • GBS_Init_Space[GBS_BuffId] greater than 0
                          • 'THEN'-Actions
                            • For each (Integer GBS_TempInteger) from 1 to GBS_Init_Space[GBS_BuffId], do (Actions)
                              • Loop - Actions
                                • Hashtable - Save GBS_InsertedReal[GBS_TempInteger] as ((GBS_BuffLink x (GBS_Init_Space[GBS_BuffId] + 5)) + (GBS_TempInteger + 4)) of GBS_BuffKey in GBS_Hash
                          • 'ELSE'-Actions
                    • 'ELSE'-Actions
                  • -------- Now the Condition Integers are cleaned --------
                  • Set GBS_Condition1 = 0
                  • Set GBS_Condition2 = 0
              • 'ELSE'-Actions
        • 'ELSE'-Actions

If you got any ideas or feedback, i'm open for sug
Top