• 🏆 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!

Hunger System made using Using "Noobsmoke's Buff System 1.8" Help

Status
Not open for further replies.
Level 5
Joined
Feb 13, 2019
Messages
128
Okay so let's say I made 3 buffs, (Probably more in the map but for sake of simplicity at this moment we'll do 3)

Well Fed - Let's say it gives you 2% Move Speed (MS) and Maybe 5% HP Regen, +1 all Stats?

Fed - Adds and takes no stats.


Hungry - A -2% MS Debuff, and -1 all stats.


(Honestly, the effects of the buff/debuffs don't really matter here it's just to help paint the idea here.)


and I want the buffs to always be running on all players, so what I was thinking was, if you don't "eat", which would be using a food item within a certain amount of time, the Well Fed could drop to Fed, then to Hungry, and you could bring the buffs back up through Hungry, Fed, Well Fed, by using the food items or "eating".


The Buff System and it's buffs are GUI Triggers:


Run Buffing

  • Run Buffing
    • Events
    • Conditions
    • Actions
      • Set BS_Recycle = True
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (BS_Buffed_Unit[BS_Index2] is alive) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (BS_Buffed_Unit[BS_Index2] is Magic Immune) Equal to True
              • BS_MagicImmune[BS_Index2] Equal to False
            • Then - Actions
              • Set BS_Recycle = False
            • Else - Actions
        • Else - Actions
          • Set BS_Recycle = False
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BS_Recycle Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (BS_Buffed_Unit[BS_Index2] has buff BS_Buff[BS_Index2]) Equal to True
            • Then - Actions
              • For each (Integer BS_Index3) from 1 to (BS_Index2 - 1), do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • BS_Buffed_Unit[BS_Index3] Equal to BS_Buffed_Unit[BS_Index2]
                      • BS_Buff[BS_Index3] Equal to BS_Buff[BS_Index2]
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • BS_Stack[BS_Index3] Less than BS_MaxStack[BS_Index3]
                        • Then - Actions
                          • Set BS_Stack[BS_Index3] = (BS_Stack[BS_Index3] + 1)
                        • Else - Actions
                      • Set BS_Buffing_Unit[BS_Index3] = BS_Buffing_Unit[BS_Index2]
                      • Set BS_Buffed_Unit[BS_Index3] = BS_Buffed_Unit[BS_Index2]
                      • Set BS_Buff_Ability[BS_Index3] = BS_Buff_Ability[BS_Index2]
                      • Set BS_Bonus_Ability[BS_Index3] = BS_Bonus_Ability[BS_Index2]
                      • Set BS_Use_Bonus[BS_Index3] = BS_Use_Bonus[BS_Index2]
                      • Set BS_Buff[BS_Index3] = BS_Buff[BS_Index2]
                      • Set BS_Buff_Duration[BS_Index3] = BS_Buff_Duration[BS_Index2]
                      • Set BS_Buff_Category[BS_Index3] = BS_Buff_Category[BS_Index2]
                      • Set BS_MaxStack[BS_Index3] = BS_MaxStack[BS_Index2]
                      • Set BS_Buff_Type[BS_Index3] = BS_Buff_Type[BS_Index2]
                      • Set BS_Permanent[BS_Index3] = BS_Permanent[BS_Index2]
                      • Set BS_MagicImmune[BS_Index3] = BS_MagicImmune[BS_Index2]
                      • Set BS_Index2 = (BS_Index2 - 1)
                      • Set BS_Event_Index = BS_Index3
                      • Set BS_Buffed_Event = 3.00
                      • Set BS_Buffed_Event = 0.00
                      • Set BS_Buff_Duration[BS_Index3] = BS_Buff_Duration[BS_Event_Index]
                    • Else - Actions
            • Else - Actions
              • Set BS_Event_Index = BS_Index2
              • Set BS_Buffed_Event = 1.00
              • Set BS_Buffed_Event = 0.00
              • Set BS_Buff_Duration[BS_Index2] = BS_Buff_Duration[BS_Event_Index]
              • For each (Integer BS_IntegerA) from 1 to 14, do (Actions)
                • Loop - Actions
                  • Player - Disable BS_Buff_Ability[BS_Index2] for (Player(BS_IntegerA))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BS_Buff_Duration[BS_Index2] Greater than 0.00
                • Then - Actions
                  • Unit - Add BS_Buff_Ability[BS_Index2] to BS_Buffed_Unit[BS_Index2]
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • BS_Use_Bonus[BS_Index2] Equal to True
                    • Then - Actions
                      • Player - Disable BS_Bonus_Ability[BS_Index2] for (Owner of BS_Buffed_Unit[BS_Index2])
                      • Unit - Add BS_Bonus_Ability[BS_Index2] to BS_Buffed_Unit[BS_Index2]
                    • Else - Actions
                • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Buff Periodic <gen> is on) Not equal to True
            • Then - Actions
              • Trigger - Turn on Buff Periodic <gen>
            • Else - Actions
        • Else - Actions
Buff Periodic

  • Buff Periodic
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • For each (Integer BS_Index1) from 1 to BS_Index2, do (Actions)
        • Loop - Actions
          • Set BS_Recycle = False
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BS_Buff_Duration[BS_Index1] Greater than or equal to 0.05
              • (BS_Buffed_Unit[BS_Index1] is alive) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (BS_Buffed_Unit[BS_Index1] is Magic Immune) Equal to True
                  • BS_MagicImmune[BS_Index1] Equal to False
                • Then - Actions
                  • Set BS_Recycle = True
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • BS_Permanent[BS_Index1] Equal to False
                    • Then - Actions
                      • Set BS_Buff_Duration[BS_Index1] = (BS_Buff_Duration[BS_Index1] - 0.05)
                    • Else - Actions
            • Else - Actions
              • Set BS_Recycle = True
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BS_Recycle Equal to True
            • Then - Actions
              • Set BS_Event_Index = BS_Index1
              • Set BS_Buffed_Event = 2.00
              • Set BS_Buffed_Event = 0.00
              • Unit - Remove BS_Buff_Ability[BS_Index1] from BS_Buffed_Unit[BS_Index1]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BS_Use_Bonus[BS_Index1] Equal to True
                • Then - Actions
                  • Unit - Remove BS_Bonus_Ability[BS_Index1] from BS_Buffed_Unit[BS_Index1]
                • Else - Actions
              • Unit - Remove BS_Buff[BS_Index1] buff from BS_Buffed_Unit[BS_Index1]
              • Set BS_Buffing_Unit[BS_Index1] = BS_Buffing_Unit[BS_Index2]
              • Set BS_Buffed_Unit[BS_Index1] = BS_Buffed_Unit[BS_Index2]
              • Set BS_Buff_Ability[BS_Index1] = BS_Buff_Ability[BS_Index2]
              • Set BS_Bonus_Ability[BS_Index1] = BS_Bonus_Ability[BS_Index2]
              • Set BS_Use_Bonus[BS_Index1] = BS_Use_Bonus[BS_Index2]
              • Set BS_Buff[BS_Index1] = BS_Buff[BS_Index2]
              • Set BS_Buff_Duration[BS_Index1] = BS_Buff_Duration[BS_Index2]
              • Set BS_Buff_Category[BS_Index1] = BS_Buff_Category[BS_Index2]
              • Set BS_Stack[BS_Index1] = BS_Stack[BS_Index2]
              • Set BS_MaxStack[BS_Index1] = BS_MaxStack[BS_Index2]
              • Set BS_Buff_Type[BS_Index1] = BS_Buff_Type[BS_Index2]
              • Set BS_Permanent[BS_Index1] = BS_Permanent[BS_Index2]
              • Set BS_MagicImmune[BS_Index1] = BS_MagicImmune[BS_Index2]
              • Set BS_Index2 = (BS_Index2 - 1)
              • Set BS_Index1 = (BS_Index1 - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BS_Index2 Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
Bloodlust (Example Buff)

  • Bloodlust
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Bloodlust (Dummy)
    • Actions
      • -------- -------------------- --------
      • -------- System Setup --------
      • -------- -------------------- --------
      • Set BS_Index2 = (BS_Index2 + 1)
      • Set BS_Buffing_Unit[BS_Index2] = (Triggering unit)
      • Set BS_Buffed_Unit[BS_Index2] = (Target unit of ability being cast)
      • Set BS_Buff_Ability[BS_Index2] = Bloodlust (Buff Book)
      • Set BS_Bonus_Ability[BS_Index2] = Bloodlust (Bonus Book)
      • Set BS_Use_Bonus[BS_Index2] = True
      • Set BS_Buff[BS_Index2] = Bloodlust (Buff)
      • Set BS_Buff_Duration[BS_Index2] = 10.00
      • Set BS_Buff_Category[BS_Index2] = 1
      • Set BS_Stack[BS_Index2] = 0
      • Set BS_MaxStack[BS_Index2] = 0
      • Set BS_Buff_Type[BS_Index2] = 1
      • Set BS_Permanent[BS_Index2] = False
      • Set BS_MagicImmune[BS_Index2] = True
      • Trigger - Run Run Buffing <gen> (ignoring conditions)
      • -------- -------------------- --------
      • -------- Finish Setup --------
      • -------- -------------------- --------


Am I on the right track here for a Leakless MUI/MPI setup with this trigger or?

  • Hungerdrop1
    • Events
      • Time - Every 1800.00 seconds of game time
    • Conditions
      • (BS_Buffed_Unit[1] has buff Well Fed (Buff)) Equal to True
    • Actions
      • -------- -------------------- --------
      • -------- System Setup --------
      • -------- -------------------- --------
      • Set BS_Index2 = (BS_Index2 + 1)
      • Set BS_Buffed_Unit[BS_Index2] = (Triggering Unit)
      • Set BS_Buff_Ability[BS_Index2] = Fed (Buff Book)
      • Set BS_Bonus_Ability[BS_Index2] = Fed (Bonus Book)
      • Set BS_Use_Bonus[BS_Index2] = True
      • Set BS_Buff[BS_Index2] = Fed (Buff)
      • Set BS_Buff_Duration[BS_Index2] = 10.00
      • Set BS_Buff_Category[BS_Index2] = 1
      • Set BS_Stack[BS_Index2] = 0
      • Set BS_MaxStack[BS_Index2] = 0
      • Set BS_Buff_Type[BS_Index2] = 1
      • Set BS_Permanent[BS_Index2] = True
      • Set BS_MagicImmune[BS_Index2] = True
      • Trigger - Run Run Buffing <gen> (ignoring conditions)
      • -------- -------------------- --------
      • -------- Finish Setup --------
      • -------- -------------------- --------
Also would it be possible to set the whole "Hunger system" up in a single trigger? Would that be more efficient? Or would it be best to make separate triggers? Should I just use a dummy to cast the buffs on the units instead maybe? and maybe set it up so like (IF a buff expires apply the next)?
 
Last edited:
Level 5
Joined
Feb 13, 2019
Messages
128
Variables:

BS_Index2 - Used as index for the current instance. Don't touch it unless you know what you are doing.
BS_Buffing_Unit - Stores the casting unit / buff owner.
BS_Buffed_Unit - Stores the unit who got buffed.
BS_Buff_Ability - Stores the ability book.
BS_Bonus_Ability - Stores the bonus book.
BS_Use_Bonus - If true, the system will add bonus book when unit gets buffed.
BS_Buff - Stores the buff.
BS_Buff_Duration - Stores duration of the buff.
BS_Buff_Category - Stores the category in which the buff belongs.
BS_Stack - Stores the current amount of stacks of the buff.
BS_MaxStack - Stores the maximum amount of stacks that current buff can have.
BS_Buff_Type - Set it to 1 if you want a positive buff and 0 if you want a negative buff.
BS_Permanent - If checked, the duration will be ignored and the buff cannot be dispelled.
BS_MagicImmune - If it's true it means that buff can affect magic immune units. Se
 
Status
Not open for further replies.
Top