• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Spell resist reduction aura

Status
Not open for further replies.
Level 6
Joined
Feb 6, 2008
Messages
166
I've been trying to develop an aura that lowers the spell resist of enemies (and neutral creep). It should be designed with Altered Melee in mind, and must be MUI. At the moment, I only know GUI triggering. If someone wants to help in JASS or vJASS, I might need thorough step-by-step explanations, but I'm willing to try to understand it. I just haven't had much progress from tutorials yet.

This is what I'm using right now, but I'm not sure if it works. Theoretically, it should, but I've overlooked mistakes before. On a related question: Do neutral hostile units (creep) count as enemy of all players? [yes]
  • Infernal Haze
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Infernal Haze
      • ((Triggering unit) is in Haze_Group) Equal to False
    • Actions
      • Unit Group - Add (Triggering unit) to Haze_Group
      • Trigger - Turn on Haze Pick Units <gen>
  • Haze Pick Units
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Haze_Group and do (Actions)
        • Loop - Actions
          • Set Haze_Temp_Unit_1 = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Haze_Temp_Unit_1 is alive) Equal to True
            • Then - Actions
              • Set Haze_Temp_Loc_1 = (Position of Haze_Temp_Unit_1)
              • Set Haze_Temp_Group_1 = (Units within 600.00 of Haze_Temp_Loc_1 matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of Haze_Temp_Unit_1)) Equal to True))))
              • -------- If they are in aura now, but not earlier, then decrease spell resistance. --------
              • Unit Group - Pick every unit in Haze_Temp_Group_1 and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is in Haze_Temp_Group_2) Equal to False
                    • Then - Actions
                      • -------- Add Spell Resistance ability with negative value to unit --------
                      • Unit - Add Infernal Haze (hidden passive debuff) to (Picked unit)
                    • Else - Actions
              • -------- If they were in aura earlier, but not now, then remove spell resistance penalty. --------
              • Unit Group - Pick every unit in Haze_Temp_Group_2 and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is in Haze_Temp_Group_1) Equal to False
                    • Then - Actions
                      • -------- Remove Spell Resistance ability with negative value from unit --------
                      • Unit - Remove Infernal Haze (hidden passive debuff) from (Picked unit)
                    • Else - Actions
              • Set Haze_Temp_Group_2 = Haze_Temp_Group_1
              • Custom script: call DestroyGroup(udg_Haze_Temp_Group_1)
              • Custom script: call RemoveLocation(udg_Haze_Temp_Loc_1)
            • Else - Actions

Can someone please check if this version of the trigger is MUI? A "second opinion" would be nice.
Infernal Haze Add:
This trigger catches when a hero learns Infernal Haze, a dummy skill using Tornado (Slow Aura) as a base skill. The buff icons on enemy units must have red labels, not green. Haze_Group is a unit group consisting of heroes who are the aura sources (owners) of Infernal Haze. After the first time this trigger is run, Haze Pick Units is turned on.
  • Infernal Haze Add
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Infernal Haze (Dummy Aura)
      • ((Triggering unit) is in Haze_Group) Equal to False
    • Actions
      • Unit Group - Add (Triggering unit) to Haze_Group
      • Trigger - Turn on Haze Pick Units <gen>
Infernal Haze Remove:
This trigger catches when a hero uses a Tome of Retraining. All skills are removed and skill points are given back for the player to spend. Because the new dummy skill is based off of an aura that places a dummy buff, this trigger is no longer necessary. Despite the hero still belonging in Haze_Group, there are no units within the checked range with the buff anyways, and nothing will be done. Removing the hero from Haze_Group simply cuts back on unnecessary "pick units" and boolean checks. In addition, if by some chance all heroes with the skill decide to unlearn them via Tome of Retraining, there is no need for the Haze Pick Units trigger to be running until a hero learns it again.
  • Infernal Haze Remove
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Tome of Retraining
      • ((Triggering unit) is in Haze_Group) Equal to True
    • Actions
      • Unit Group - Remove (Triggering unit) from Haze_Group
      • If ((Number of units in Haze_Group) Equal to 0) then do (Trigger - Turn off Haze Pick Units <gen>) else do (Do nothing)
Haze Pick Units: (Initially Off)
This trigger has two main overall actions. The first action says to pick all units belonging to Haze_Group. This means it picks heroes owning the aura, one at a time. For each hero, it finds all surrounding units with the negative buff and defines it as a subgroup (Temp Group 1). Then, if the units in the subgroup aren't in the overall "affected units" group (Temp Group 2), it adds them to it and gives them the passive ability which passively reduces their spell resistance. Once this has run for each hero concerned, Temp Group 2 should include all units with the aura's negative buff. The second action says to pick all units in the overall group (Temp Group 2) that no longer have the negative buff. These units are units that are no longer affected by the aura, so they are to be removed from Temp Group 2 and they are to have their passive skill removed.
  • Haze Pick Units
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • -------- This first set of actions makes sure all affected units around each hero are all added into the overall group, Temp Group 2, and given the passive skill. --------
      • Unit Group - Pick every unit in Haze_Group and do (Actions)
        • Loop - Actions
          • -------- For this hero who owns Infernal Haze... --------
          • Set Haze_Temp_Unit_1 = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Haze_Temp_Unit_1 is alive) Equal to True
            • Then - Actions
              • Set Haze_Temp_Loc_1 = (Position of Haze_Temp_Unit_1)
              • -------- Temp Group 1 = Subgroup of all affected units --------
              • Set Haze_Temp_Group_1 = (Units within 750.00 of Haze_Temp_Loc_1 matching (((Matching unit) has buff Infernal Haze ) Equal to True))
              • Custom script: call RemoveLocation(udg_Haze_Temp_Loc_1)
              • -------- Temp Group 2 = Overall group of all affected units --------
              • Unit Group - Pick every unit in Haze_Temp_Group_1 and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is in Haze_Temp_Group_2) Equal to False
                    • Then - Actions
                      • Unit Group - Add (Picked unit) to Haze_Temp_Group_2
                      • Unit - Add Infernal Haze (hidden passive debuff) to (Picked unit)
                    • Else - Actions
            • Else - Actions
      • -------- If the unit was added before to Temp Group 2 and no longer has the aura buff, remove the unit from the group and remove the passive skill. --------
      • Unit Group - Pick every unit in Haze_Temp_Group_2 and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Infernal Haze ) Equal to False
            • Then - Actions
              • Unit Group - Remove (Picked unit) from Haze_Temp_Group_2
              • Unit - Remove Infernal Haze (hidden passive debuff) from (Picked unit)
            • Else - Actions
 
Last edited:
1) Yes, Neutral Hostile does count as an enemy, in order to prevent counting them, use ((Owner of (Matching unit)) Controller Equal to User).

2)
  • Set Haze_Temp_Group_2 = Haze_Temp_Group_1
Remove it.

3) In the second group pick (Haze_Temp_Group_2), use
  • Unit Group - Pick every unit in Haze_Temp_Group_2 and do (Actions)
    • Loop - Actions
      • Set Haze_Temp_Loc_2 = (Position of (Picked unit))
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Distance between Haze_Temp_Loc_1 and Haze_Temp_Loc_2) Greater than 601.00
          • Then - Actions
            • -------- Remove Spell Resistance ability with negative value from unit --------
            • Unit - Remove Infernal Haze (hidden passive debuff) from (Picked unit)
            • Unit Group - Remove (Picked unit) from Haze_Temp_Group_2
          • Else - Actions
      • Custom script: call RemoveLocation (udg_Haze_Temp_Loc_2)
This trigger is not MUI, because that would require a local group to be saved on the hero, when they learn the skill for the first time, along with a comparison of (Level of Infernal Haze Equal to 1).
 
Level 7
Joined
Apr 1, 2010
Messages
289
change your condition in the pick every unit in( Haze_Temp)
to
  • Conditions
    • ((Picked unit) has buff (custom aura Buff)) Equal to True
Replace your set variable with

  • Unit Group - Add all units of Haze_Temp_Group1 to Haze_Temp_Group_2
change this
  • et Haze_Temp_Group_1 = (Units within 600.00 of Haze_Temp_Loc_1 matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of (Owner of Haze_Temp_Unit_1)) Equal to True))))
to this

  • Set Haze_Temp_Group_1 = (matching unit has buff (custom aura Buff) Equal to True)
you will have to make a custom buff, but it will be alot easier to do,and it will be mui and act like regular aura effects.
 
Level 6
Joined
Feb 6, 2008
Messages
166
Pharaoh, I see what you mean.

Narogog, if for example, I create a custom aura based off of Endurance Aura, won't that interfere with when an ally trains a Tauren Chieftain and learns the real Endurance Aura? What happens when a unit is inside both auras?
 
Level 6
Joined
Feb 6, 2008
Messages
166
Alright, does this fix the mentioned issues?

Infernal Haze Add:
This trigger catches when a hero learns Infernal Haze, a dummy skill using Tornado (Slow Aura) as a base skill. The buff icons on enemy units must have red labels, not green. Haze_Group is a unit group consisting of heroes who are the aura sources (owners) of Infernal Haze. After the first time this trigger is run, Haze Pick Units is turned on.
  • Infernal Haze Add
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Infernal Haze (Dummy Aura)
      • ((Triggering unit) is in Haze_Group) Equal to False
    • Actions
      • Unit Group - Add (Triggering unit) to Haze_Group
      • Trigger - Turn on Haze Pick Units <gen>
Infernal Haze Remove:
This trigger catches when a hero uses a Tome of Retraining. All skills are removed and skill points are given back for the player to spend. Because the new dummy skill is based off of an aura that places a dummy buff, this trigger is no longer necessary. Despite the hero still belonging in Haze_Group, there are no units within the checked range with the buff anyways, and nothing will be done. Removing the hero from Haze_Group simply cuts back on unnecessary "pick units" and boolean checks. In addition, if by some chance all heroes with the skill decide to unlearn them via Tome of Retraining, there is no need for the Haze Pick Units trigger to be running until a hero learns it again.
  • Infernal Haze Remove
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Tome of Retraining
      • ((Triggering unit) is in Haze_Group) Equal to True
    • Actions
      • Unit Group - Remove (Triggering unit) from Haze_Group
      • If ((Number of units in Haze_Group) Equal to 0) then do (Trigger - Turn off Haze Pick Units <gen>) else do (Do nothing)
Haze Pick Units: (Initially Off)
This trigger has two main overall actions. The first action says to pick all units belonging to Haze_Group. This means it picks heroes owning the aura, one at a time. For each hero, it finds all surrounding units with the negative buff and defines it as a subgroup (Temp Group 1). Then, if the units in the subgroup aren't in the overall "affected units" group (Temp Group 2), it adds them to it and gives them the passive ability which passively reduces their spell resistance. Once this has run for each hero concerned, Temp Group 2 should include all units with the aura's negative buff. The second action says to pick all units in the overall group (Temp Group 2) that no longer have the negative buff. These units are units that are no longer affected by the aura, so they are to be removed from Temp Group 2 and they are to have their passive skill removed.
  • Haze Pick Units
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • -------- This first set of actions makes sure all affected units around each hero are all added into the overall group, Temp Group 2, and given the passive skill. --------
      • Unit Group - Pick every unit in Haze_Group and do (Actions)
        • Loop - Actions
          • -------- For this hero who owns Infernal Haze... --------
          • Set Haze_Temp_Unit_1 = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Haze_Temp_Unit_1 is alive) Equal to True
            • Then - Actions
              • Set Haze_Temp_Loc_1 = (Position of Haze_Temp_Unit_1)
              • -------- Temp Group 1 = Subgroup of all affected units --------
              • Set Haze_Temp_Group_1 = (Units within 750.00 of Haze_Temp_Loc_1 matching (((Matching unit) has buff Infernal Haze ) Equal to True))
              • Custom script: call RemoveLocation(udg_Haze_Temp_Loc_1)
              • -------- Temp Group 2 = Overall group of all affected units --------
              • Unit Group - Pick every unit in Haze_Temp_Group_1 and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Picked unit) is in Haze_Temp_Group_2) Equal to False
                    • Then - Actions
                      • Unit Group - Add (Picked unit) to Haze_Temp_Group_2
                      • Unit - Add Infernal Haze (hidden passive debuff) to (Picked unit)
                    • Else - Actions
            • Else - Actions
      • -------- If the unit was added before to Temp Group 2 and no longer has the aura buff, remove the unit from the group and remove the passive skill. --------
      • Unit Group - Pick every unit in Haze_Temp_Group_2 and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Infernal Haze ) Equal to False
            • Then - Actions
              • Unit Group - Remove (Picked unit) from Haze_Temp_Group_2
              • Unit - Remove Infernal Haze (hidden passive debuff) from (Picked unit)
            • Else - Actions
As far as I can tell, this new version should be MUI, as well as make use of an already-existing aura to do a majority of the work for me.

Edit: Can someone help me double check? especially the MUI aspect?

Edit 2: Can someone please check if this version of the trigger is MUI? A "second opinion" would be nice.
 
Last edited:
Status
Not open for further replies.
Top