- 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]
Can someone please check if this version of the trigger is MUI? A "second opinion" would be nice.
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>
-
Events
-
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 - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - 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
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - 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
-
If - Conditions
-
Loop - Actions
-
Unit Group - Pick every unit in Haze_Group and do (Actions)
-
Events
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 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.
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.
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>
-
Events
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)
-
Events
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
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
- Else - Actions
-
If - Conditions
-
Loop - 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
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
Events
Last edited: