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

Buff Engine

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.

Buff Engine

Created by X-OMG-X


Description

The system contains 5 triggers.
Only two of them is important. "Buff Engine" and "Buff Init".
The other 3 triggers is only example triggers to show how the system works.
You're able to make both self and target buffs.
The things you're able to configure are:

Movementspeed decrease/increase
Deal damage
Heal unit(s)
Create special effects
Set the duration

This system is MUI, MPI, leakless, bugless and laggless.
All credits goes to X-OMG-X. Please respect his time spent on this.
How to Use

Copy/Paste one of the example triggers.
Set the settings to some values that you find okay.
Go to Object Editor and create a new spell.
Set every single value to zero, so it doesnt do anything.
Go to your pasted trigger and change the event to your spell.
You're done!
How to Import

Copy/Paste the "Buff Manager" folder into your map.
Repair broken links in the triggers.
Follow the "How to Use" in the trigger folder.
You're done!
Triggers

  • Example 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Buff [Example1]
    • Actions
      • -------- --------
      • -------- Indexing --------
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Buff_IndexSize Less than Buff_IndexMax
        • Then - Actions
          • Set Buff_IndexSize = (Buff_IndexSize + 1)
        • Else - Actions
          • Set Buff_IndexSize = 0
      • Set Buff_Index = Buff_IndexSize
      • -------- --------
      • -------- Settings --------
      • -------- --------
      • Set Buff_Caster[Buff_Index] = (Triggering unit)
      • Set Buff_SpecialEffect[Buff_Index] = Abilities\Spells\Items\AIre\AIreTarget.mdl
      • Set Buff_Position[Buff_Index] = (Position of Buff_Caster[Buff_Index])
      • Set Buff_Movementspeed[Buff_Index] = (500.00 + (100.00 x (Real((Level of Buff [Example1] for Buff_Caster[Buff_Index])))))
      • Set Buff_Heal[Buff_Index] = 0.00
      • Set Buff_Damage[Buff_Index] = 25.00
      • Set Buff_Duration[Buff_Index] = 5.00
      • -------- --------
      • -------- Starting Up --------
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Buff Engine <gen> is on) Equal to True
        • Then - Actions
        • Else - Actions
          • Trigger - Turn on Buff Engine <gen>
      • Custom script: call RemoveLocation(udg_Buff_Position[udg_Buff_Index])
  • Buff Engine
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Buff_Index) from 1 to Buff_IndexSize, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Buff_Caster[Buff_Index] Not equal to No unit
            • Then - Actions
              • Set Buff_Position[Buff_Index] = (Position of Buff_Caster[Buff_Index])
              • Set Buff_Timer[Buff_Index] = (Buff_Timer[Buff_Index] + 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • Buff_Timer[Buff_Index] Greater than or equal to (Integer(Buff_Duration[Buff_Index]))
                      • (Buff_Caster[Buff_Index] is alive) Equal to False
                • Then - Actions
                  • Set Buff_Caster[Buff_Index] = No unit
                  • Unit - Set Buff_Caster[Buff_Index] movement speed to (Default movement speed of Buff_Caster[Buff_Index])
                • Else - Actions
                  • Set Buff_Duration[Buff_Index] = (Buff_Duration[Buff_Index] - 1.00)
                  • Special Effect - Create a special effect at Buff_Position[Buff_Index] using Buff_SpecialEffect[Buff_Index]
                  • Special Effect - Destroy (Last created special effect)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Buff_Damage[Buff_Index] Greater than 0.00
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Life of Buff_Caster[Buff_IndexSize]) Greater than Buff_Damage[Buff_Index]
                        • Then - Actions
                          • Unit - Cause Buff_Caster[Buff_Index] to damage Buff_Caster[Buff_Index], dealing Buff_Damage[Buff_Index] damage of attack type Spells and damage type Normal
                        • Else - Actions
                          • Unit - Set life of Buff_Caster[Buff_Index] to 1.00
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Buff_Heal[Buff_Index] Greater than 0.00
                    • Then - Actions
                      • Unit - Cause Buff_Caster[Buff_Index] to damage Buff_Caster[Buff_Index], dealing (0.00 - Buff_Heal[Buff_Index]) damage of attack type Spells and damage type Normal
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Buff_Movementspeed[Buff_Index] Greater than 0.00
                    • Then - Actions
                      • Unit - Set Buff_Caster[Buff_Index] movement speed to ((Default movement speed of Buff_Caster[Buff_Index]) + Buff_Movementspeed[Buff_Index])
                    • Else - Actions
              • Custom script: call RemoveLocation(udg_Buff_Position[udg_Buff_Index])
            • Else - Actions
Changelog

v1.0 - Resource uploaded.
v1.1 - Minor changes, removed unneeded material.
v1.2 - Moved an init function to "Buff Init".
Keywords:
system, buff, buffs, damage, heal, move, movement, speed, movementspeed, effect, special, x-omg-x, unique, configure
Contents

Buff Engine (Map)

Reviews
12th Dec 2015 IcemanBo: Too long time as NeedsFix. Rejected. 19:34, 17th Jun 2010 The_Reborn_Devil: You don't recycle your indexes correctly. You should look at this...
uses custom value as well ... just create an attached integer to your unit ...

The custom value is one of the unused lines i forgot to remove after i remade the system. As well as a unit group. But i got time to fix it now.

@Kingz, i've tried to make it recycling. But seems like it was a kinda fail. Going to see if i can do it right this time.

[EDIT]

Changes made. Check the changelog for more information.
Going to try to fix the recycling later or maybe tomorrow.

Keep the suggestions coming! :)
 
  • Set Buff_IndexMax = 50
Is a constant, you don't need to set it everytime a spell is cast.

I just put it in the cast trigger, cuz else i would have to make an extra trigger. But i can change it.

[EDIT]

Updated. "Buff_IndexMax" is set in an init trigger.

Btw, could anyone help me to make the system recycling? I think i dont get how to make recycling, if this isnt recycling.
 
Last edited:
Top