Custom Aura (advanced help requied)

ultimate11

Active Member
Reaction score
25
Hello helpers.
I`v created an aura based on devation aura (just for buff effect :D) that increases friendly hero units their stats (int,str,agi) by (for exemple at aura lv.3) 60% of primary attribute and 30% of secondary attribute.
The system that recognize hero primary attribute is based of hero selection and each hero get and integer as his own custom value 1 = strenght 2 = agility 3 = intelligence
Aura work`s very very fine with no issue is adding the correct amount of status then when hero is not in range of aura is taking back the added value of status as should be.
The only problem is that I can`t make it MUI.
Maybe can somebody give me some hint :D.Here are the triggers:
Trigger:
  • Aura
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • -------- Buffing --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Buffer is alive) Equal to True
        • Then - Actions
          • Special Effect - Create a special effect attached to the origin of Buffer using war3mapImported\LawOfBloodScroll_Cast.mdx
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
      • Set Buffed_group = (Units in (Entire map) matching (((Matching unit) has buff Brilliance Aura (custom)) Equal to True))
      • Unit Group - Pick every unit in Buffed_group and do (Actions)
        • Loop - Actions
          • Set Buffed = (Load 1 of (Key (Picked unit)) from MY_hashtable)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Buffed Equal to False
            • Then - Actions
              • Hashtable - Save True as 1 of (Key (Picked unit)) in MY_hashtable
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Custom value of (Picked unit)) Equal to 1
                • Then - Actions
                  • Set Buff_lvl = (Level of Briliance Aura for Buffer)
                  • Set Buff_val_int = (Integer(((Real((Intelligence of (Picked unit) (Include bonuses)))) x (0.10 x (Real(Buff_lvl))))))
                  • Set Buff_val_str = (Integer(((Real((Strength of (Picked unit) (Include bonuses)))) x (0.20 x (Real(Buff_lvl))))))
                  • Set Buff_val_agi = (Integer(((Real((Agility of (Picked unit) (Include bonuses)))) x (0.10 x (Real(Buff_lvl))))))
                  • Hero - Modify Intelligence of (Picked unit): Add Buff_val_int
                  • Hero - Modify Strength of (Picked unit): Add Buff_val_str
                  • Hero - Modify Agility of (Picked unit): Add Buff_val_agi
                  • Hashtable - Save Buff_val_str as 2 of (Key (Picked unit)) in MY_hashtable
                  • Hashtable - Save Buff_val_agi as 3 of (Key (Picked unit)) in MY_hashtable
                  • Hashtable - Save Buff_val_int as 4 of (Key (Picked unit)) in MY_hashtable
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Custom value of (Picked unit)) Equal to 2
                • Then - Actions
                  • Set Buff_lvl = (Level of Briliance Aura for Buffer)
                  • Set Buff_val_int = (Integer(((Real((Intelligence of (Picked unit) (Include bonuses)))) x (0.10 x (Real(Buff_lvl))))))
                  • Set Buff_val_str = (Integer(((Real((Strength of (Picked unit) (Include bonuses)))) x (0.10 x (Real(Buff_lvl))))))
                  • Set Buff_val_agi = (Integer(((Real((Agility of (Picked unit) (Include bonuses)))) x (0.20 x (Real(Buff_lvl))))))
                  • Hero - Modify Intelligence of (Picked unit): Add Buff_val_int
                  • Hero - Modify Strength of (Picked unit): Add Buff_val_str
                  • Hero - Modify Agility of (Picked unit): Add Buff_val_agi
                  • Hashtable - Save Buff_val_str as 2 of (Key (Picked unit)) in MY_hashtable
                  • Hashtable - Save Buff_val_agi as 3 of (Key (Picked unit)) in MY_hashtable
                  • Hashtable - Save Buff_val_int as 4 of (Key (Picked unit)) in MY_hashtable
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Custom value of (Picked unit)) Equal to 3
                • Then - Actions
                  • Set Buff_lvl = (Level of Briliance Aura for Buffer)
                  • Set Buff_val_int = (Integer(((Real((Intelligence of (Picked unit) (Include bonuses)))) x (0.20 x (Real(Buff_lvl))))))
                  • Set Buff_val_str = (Integer(((Real((Strength of (Picked unit) (Include bonuses)))) x (0.10 x (Real(Buff_lvl))))))
                  • Set Buff_val_agi = (Integer(((Real((Agility of (Picked unit) (Include bonuses)))) x (0.10 x (Real(Buff_lvl))))))
                  • Hero - Modify Intelligence of (Picked unit): Add Buff_val_int
                  • Hero - Modify Strength of (Picked unit): Add Buff_val_str
                  • Hero - Modify Agility of (Picked unit): Add Buff_val_agi
                  • Hashtable - Save Buff_val_str as 2 of (Key (Picked unit)) in MY_hashtable
                  • Hashtable - Save Buff_val_agi as 3 of (Key (Picked unit)) in MY_hashtable
                  • Hashtable - Save Buff_val_int as 4 of (Key (Picked unit)) in MY_hashtable
                • Else - Actions
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Custom value of (Picked unit)) Equal to 1
                • Then - Actions
                  • Set Buff_lvl = (Level of Briliance Aura for Buffer)
                  • Set Buff_val_int = (Integer(((Real(((Intelligence of (Picked unit) (Include bonuses)) - (Load 4 of (Key (Picked unit)) from MY_hashtable)))) x (0.20 x (Real(Buff_lvl))))))
                  • Set Buff_val_str = (Integer(((Real(((Strength of (Picked unit) (Include bonuses)) - (Load 4 of (Key (Picked unit)) from MY_hashtable)))) x (0.10 x (Real(Buff_lvl))))))
                  • Set Buff_val_agi = (Integer(((Real(((Agility of (Picked unit) (Include bonuses)) - (Load 4 of (Key (Picked unit)) from MY_hashtable)))) x (0.10 x (Real(Buff_lvl))))))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • Buff_val_str Not equal to (Load 2 of (Key (Picked unit)) from MY_hashtable)
                          • Buff_val_agi Not equal to (Load 3 of (Key (Picked unit)) from MY_hashtable)
                          • Buff_val_int Not equal to (Load 4 of (Key (Picked unit)) from MY_hashtable)
                    • Then - Actions
                      • Hero - Modify Intelligence of (Picked unit): Subtract (Load 4 of (Key (Picked unit)) from MY_hashtable)
                      • Hero - Modify Strength of (Picked unit): Subtract (Load 2 of (Key (Picked unit)) from MY_hashtable)
                      • Hero - Modify Agility of (Picked unit): Subtract (Load 3 of (Key (Picked unit)) from MY_hashtable)
                      • Set Buff_val_int = (Integer(((Real((Intelligence of (Picked unit) (Include bonuses)))) x (0.10 x (Real(Buff_lvl))))))
                      • Set Buff_val_str = (Integer(((Real((Strength of (Picked unit) (Include bonuses)))) x (0.20 x (Real(Buff_lvl))))))
                      • Set Buff_val_agi = (Integer(((Real((Strength of (Picked unit) (Include bonuses)))) x (0.10 x (Real(Buff_lvl))))))
                      • Hero - Modify Intelligence of (Picked unit): Add Buff_val_int
                      • Hero - Modify Strength of (Picked unit): Add Buff_val_str
                      • Hero - Modify Agility of (Picked unit): Add Buff_val_agi
                      • Hashtable - Save Buff_val_str as 2 of (Key (Picked unit)) in MY_hashtable
                      • Hashtable - Save Buff_val_agi as 3 of (Key (Picked unit)) in MY_hashtable
                      • Hashtable - Save Buff_val_int as 4 of (Key (Picked unit)) in MY_hashtable
                    • Else - Actions
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Custom value of (Picked unit)) Equal to 2
                • Then - Actions
                  • Set Buff_lvl = (Level of Briliance Aura for Buffer)
                  • Set Buff_val_int = (Integer(((Real(((Intelligence of (Picked unit) (Include bonuses)) - (Load 4 of (Key (Picked unit)) from MY_hashtable)))) x (0.10 x (Real(Buff_lvl))))))
                  • Set Buff_val_str = (Integer(((Real(((Strength of (Picked unit) (Include bonuses)) - (Load 4 of (Key (Picked unit)) from MY_hashtable)))) x (0.10 x (Real(Buff_lvl))))))
                  • Set Buff_val_agi = (Integer(((Real(((Agility of (Picked unit) (Include bonuses)) - (Load 4 of (Key (Picked unit)) from MY_hashtable)))) x (0.20 x (Real(Buff_lvl))))))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • Buff_val_str Not equal to (Load 2 of (Key (Picked unit)) from MY_hashtable)
                          • Buff_val_agi Not equal to (Load 3 of (Key (Picked unit)) from MY_hashtable)
                          • Buff_val_int Not equal to (Load 4 of (Key (Picked unit)) from MY_hashtable)
                    • Then - Actions
                      • Hero - Modify Intelligence of (Picked unit): Subtract (Load 4 of (Key (Picked unit)) from MY_hashtable)
                      • Hero - Modify Strength of (Picked unit): Subtract (Load 2 of (Key (Picked unit)) from MY_hashtable)
                      • Hero - Modify Agility of (Picked unit): Subtract (Load 3 of (Key (Picked unit)) from MY_hashtable)
                      • Set Buff_val_int = (Integer(((Real((Intelligence of (Picked unit) (Include bonuses)))) x (0.20 x (Real(Buff_lvl))))))
                      • Set Buff_val_str = (Integer(((Real((Strength of (Picked unit) (Include bonuses)))) x (0.10 x (Real(Buff_lvl))))))
                      • Set Buff_val_agi = (Integer(((Real((Strength of (Picked unit) (Include bonuses)))) x (0.10 x (Real(Buff_lvl))))))
                      • Hero - Modify Intelligence of (Picked unit): Add Buff_val_int
                      • Hero - Modify Strength of (Picked unit): Add Buff_val_str
                      • Hero - Modify Agility of (Picked unit): Add Buff_val_agi
                      • Hashtable - Save Buff_val_str as 2 of (Key (Picked unit)) in MY_hashtable
                      • Hashtable - Save Buff_val_agi as 3 of (Key (Picked unit)) in MY_hashtable
                      • Hashtable - Save Buff_val_int as 4 of (Key (Picked unit)) in MY_hashtable
                    • Else - Actions
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Custom value of (Picked unit)) Equal to 3
                • Then - Actions
                  • Set Buff_lvl = (Level of Briliance Aura for Buffer)
                  • Set Buff_val_int = (Integer(((Real(((Intelligence of (Picked unit) (Include bonuses)) - (Load 4 of (Key (Picked unit)) from MY_hashtable)))) x (0.20 x (Real(Buff_lvl))))))
                  • Set Buff_val_str = (Integer(((Real(((Strength of (Picked unit) (Include bonuses)) - (Load 4 of (Key (Picked unit)) from MY_hashtable)))) x (0.10 x (Real(Buff_lvl))))))
                  • Set Buff_val_agi = (Integer(((Real(((Agility of (Picked unit) (Include bonuses)) - (Load 4 of (Key (Picked unit)) from MY_hashtable)))) x (0.10 x (Real(Buff_lvl))))))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • Buff_val_str Not equal to (Load 2 of (Key (Picked unit)) from MY_hashtable)
                          • Buff_val_agi Not equal to (Load 3 of (Key (Picked unit)) from MY_hashtable)
                          • Buff_val_int Not equal to (Load 4 of (Key (Picked unit)) from MY_hashtable)
                    • Then - Actions
                      • Hero - Modify Intelligence of (Picked unit): Subtract (Load 4 of (Key (Picked unit)) from MY_hashtable)
                      • Hero - Modify Strength of (Picked unit): Subtract (Load 2 of (Key (Picked unit)) from MY_hashtable)
                      • Hero - Modify Agility of (Picked unit): Subtract (Load 3 of (Key (Picked unit)) from MY_hashtable)
                      • Set Buff_val_int = (Integer(((Real((Intelligence of (Picked unit) (Include bonuses)))) x (0.20 x (Real(Buff_lvl))))))
                      • Set Buff_val_str = (Integer(((Real((Strength of (Picked unit) (Include bonuses)))) x (0.10 x (Real(Buff_lvl))))))
                      • Set Buff_val_agi = (Integer(((Real((Strength of (Picked unit) (Include bonuses)))) x (0.10 x (Real(Buff_lvl))))))
                      • Hero - Modify Intelligence of (Picked unit): Add Buff_val_int
                      • Hero - Modify Strength of (Picked unit): Add Buff_val_str
                      • Hero - Modify Agility of (Picked unit): Add Buff_val_agi
                      • Hashtable - Save Buff_val_str as 2 of (Key (Picked unit)) in MY_hashtable
                      • Hashtable - Save Buff_val_agi as 3 of (Key (Picked unit)) in MY_hashtable
                      • Hashtable - Save Buff_val_int as 4 of (Key (Picked unit)) in MY_hashtable
                    • Else - Actions
                • Else - Actions
      • Custom script: call DestroyGroup(udg_Buffed_group)
      • -------- Debuffing --------
      • Set Buffed_group = (Units in (Entire map) matching ((((Matching unit) is A Hero) Equal to True) and (((Matching unit) has buff Brilliance Aura (custom)) Equal to False)))
      • Unit Group - Pick every unit in Buffed_group and do (Actions)
        • Loop - Actions
          • Set Buffed = (Load 1 of (Key (Picked unit)) from MY_hashtable)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Buffed Equal to True
            • Then - Actions
              • Hashtable - Save False as 1 of (Key (Picked unit)) in MY_hashtable
              • Set Buff_val_int = (Load 4 of (Key (Picked unit)) from MY_hashtable)
              • Set Buff_val_str = (Load 2 of (Key (Picked unit)) from MY_hashtable)
              • Set Buff_val_agi = (Load 3 of (Key (Picked unit)) from MY_hashtable)
              • Hero - Modify Intelligence of (Picked unit): Subtract Buff_val_int
              • Hero - Modify Strength of (Picked unit): Subtract Buff_val_str
              • Hero - Modify Agility of (Picked unit): Subtract Buff_val_agi
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in MY_hashtable
            • Else - Actions
      • Custom script: call DestroyGroup(udg_Buffed_group)

Trigger:
  • Aura learn
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Briliance Aura
    • Actions
      • Set Buffer = (Triggering unit)
      • Trigger - Turn on Aura <gen>
      • Trigger - Turn off (This trigger)
 

inevit4ble

Well-Known Member
Reaction score
38
Tbh, when I see this I almost feel like it could be done quite easily with vJASS
true but hey,

You can use a hashtable for each stat. Instead of "MyHashtable" you would have "StrTable, AgiTable, IntTable" but I dont think thats an issue.

Having "buffer" more than once is the issue. An array how sort of help. You could save the unit dependent on OwningPlayers Number but if the player has more than one unit with this aura it won't work either, so another hashtable for that would work.

Things to note: Note sure if the buffs are stackable but if a unit has one buff and is surrounded by 3 units with this aura, the buffed unit will get 3 x the Bonuses. IDK if thats desired
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
have you thought about using a hashtable with the units as the key and saving the values like that to make it MUI?
edit: nvm i see you are doing that...
as far as i can see you are doing it correctly for mui, the only problem i forsee is extreme lag if you are picking every unit not in an auras range of a unit every second

you should add the units to a unit group and remove them via:

Trigger:
  • Events
    • A unit increases the level of <spell>
    • Conditions
      • Level of <spell> for triggering unit is equal to 1
    • Actions
      • Unit Group - Add triggering unit to Has_Aura
      • Unit Group - Add triggering unit to Aura_Active_Group (unless u dont want the aura carrier to be affected)
      • Trigger - Add event (A unit comes within <aura range> of triggering unit to Trigger 2 <gen>
      • Trigger - Add event (A unit leaves <aura range> of triggering unit to Trigger 2 <gen>


Trigger 2:
Trigger:
  • Events
    • Conditions
    • Actions
      • Set Still_Affected = true
      • Unit Group - Pick all units in Has_Aura matching condition (within <aura range> of triggering unit) and do actions
        • Actions
          • Set Still_Affected = False
      • If Then Else
        • If
          • Still Affected is equal to true
          • Triggering unit is a Hero is equal to true
        • Then
          • Unit Group - Add unit to Aura_Active_Group
        • Else


Trigger:
  • Events
    • Time - Periodic Event every (however many seconds you want) seconds
    • Conditions
    • Actions
      • Unit Group - pick all units in Aura_Active_Group and do actions
        • Actions
          • <---- Here is where you add the aura effects
 

ultimate11

Active Member
Reaction score
25
@GFreak not lag it`s a problem,aura dont leak ,dont lag dont make any possible problem.The problem is me that I cant find a solution to make it MUI.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
as far as i could tell your version should work for mui... thats what concerned me as for how it was done, it could not be working because of some odd glitch, and the way you did it seems kinda all over the place... was just suggesting a way that might work
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top