• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

HI i had created custom Spell Resistant Aura and i dunno where did i do wrong.

Status
Not open for further replies.
Level 2
Joined
Jul 15, 2016
Messages
26
Spell Reduce Add
Events
Unit - A unit Learns a skill
Conditions
(Learned Hero Skill) Equal to Reduce Spell Damage Aura
((Triggering unit) is in Haze_Group) Equal to False
Actions
Unit Group - Add (Triggering unit) to Haze_Group
Trigger - Turn on Spell Reduce Pick Unit <gen>


Spell Reduce 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 Spell Reduce Pick Unit <gen>) else do (Do nothing)


Spell Reduce Pick Unit
Events
Time - Every 0.25 seconds of game time
Conditions
Actions
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 900.00 of Haze_Temp_Loc_1 matching (((Matching unit) has buff Reduce Spell Damage Aura ) 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 Spell Reduce (Reduce Spell Damage Aura) 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 Reduce Spell Damage Aura ) Equal to False
Then - Actions
Unit - Remove Spell Reduce (Reduce Spell Damage Aura) from (Picked unit)
Unit Group - Remove (Picked unit) from Haze_Temp_Group_2
Else - Actions
 
Level 2
Joined
Jul 15, 2016
Messages
26
May I know where did I do wrong?
I use the trigger similar to

Ochibi 's Spell resist reduction aura​

The Unit spell is (Elune De Grace)
The Hero spell is Reduce spell damage aura(Endurance Aura)
Buff (Reduce spell damage aura)
 

Attachments

  • Spell Resistant Aura1.w3x
    86 KB · Views: 21

Uncle

Warcraft Moderator
Level 65
Joined
Aug 10, 2018
Messages
6,687

Can't read it like that. Use the [*trigger][*/trigger] tags and post your code between them (remove the *). Or click the Gear icon.
 
Level 20
Joined
Feb 27, 2019
Messages
615
The Else - Actions condition to remove the ability from a unit in Temp_Group_2 is that Haze_Temp_Unit_1 is dead. Maybe you put the actions in that Else - Actions a bit wrong. It would only need to consider if the unit has the buff or not. I moved all the way down it so it looks like this instead and it seems to work.

  • Spell Reduce Pick Unit
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Haze_Group and do (Actions)
        • Loop - Actions
          • -------- For this hero who owns Infernal Haze... --------
          • Set VariableSet 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 VariableSet Haze_Temp_Loc_1 = (Position of Haze_Temp_Unit_1)
              • -------- Temp Group 1 = Subgroup of all affected units --------
              • Set VariableSet Haze_Temp_Group_1 = (Units within 900.00 of Haze_Temp_Loc_1 matching (((Matching unit) has buff Reduce Spell Damage Aura ) 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 Spell Reduce (Reduce Spell Damage Aura) 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 Reduce Spell Damage Aura ) Equal to False
            • Then - Actions
              • Unit - Remove Spell Reduce (Reduce Spell Damage Aura) from (Picked unit)
              • Unit Group - Remove (Picked unit) from Haze_Temp_Group_2.
            • Else - Actions

Because of the way you posted your trigger it would be almost impossible to figure out since both your non-working trigger and the updated working trigger would look EXACTLY the same. An explanation of your exact problem would also be helpful. Gj on attaching the map though.

The same trigger as above in this comment posted the way you did

Spell Reduce Pick Unit
Events
Time - Every 0.25 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in Haze_Group and do (Actions)
Loop - Actions
-------- For this hero who owns Infernal Haze... --------
Set VariableSet 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 VariableSet Haze_Temp_Loc_1 = (Position of Haze_Temp_Unit_1)
-------- Temp Group 1 = Subgroup of all affected units --------
Set VariableSet Haze_Temp_Group_1 = (Units within 900.00 of Haze_Temp_Loc_1 matching (((Matching unit) has buff Reduce Spell Damage Aura ) 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 Spell Reduce (Reduce Spell Damage Aura) 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 Reduce Spell Damage Aura ) Equal to False
Then - Actions
Unit - Remove Spell Reduce (Reduce Spell Damage Aura) from (Picked unit)
Unit Group - Remove (Picked unit) from Haze_Temp_Group_2.
Else - Actions
 
Last edited:
Level 2
Joined
Jul 15, 2016
Messages
26

Uncle I had post the trigger in a wrong way, here is my correction.​


  • Rune of Deflect Magic Pick Unit
    • 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 RuneofDeflectMagic_Group and do (Actions)
        • Loop - Actions
          • -------- For this hero who owns Infernal Haze... --------
          • Set RuneofDeflectMagic_Temp_Unit_1 = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (RuneofDeflectMagic_Temp_Unit_1 is alive) Equal to True
            • Then - Actions
              • Set RuneofDeflectMagic_Temp_Loc_1 = (Position of RuneofDeflectMagic_Temp_Unit_1)
              • -------- Temp Group 1 = Subgroup of all affected units --------
              • Set RuneofDeflectMagicTemp_Group_1 = (Units within 900.00 of RuneofDeflectMagic_Temp_Loc_1 matching (((Matching unit) has buff Rune of Deflect Magic (Rune of Deflect Magic)) Equal to True))
              • Custom script: call RemoveLocation(udg_RuneofDeflectMagic_Temp_Loc_1)
              • -------- Temp Group 2 = Overall group of all affected units --------
              • Unit Group - Pick every unit in RuneofDeflectMagicTemp_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 RuneofDeflectMagicTemp_Group_2) Equal to False
                    • Then - Actions
                      • Unit Group - Add (Picked unit) to RuneofDeflectMagicTemp_Group_2
                      • Unit - Add Rune of Deflect Magic (Rune of Deflect Magic) 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 RuneofDeflectMagicTemp_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 Rune of Deflect Magic (Rune of Deflect Magic)) Equal to False
            • Then - Actions
              • Unit - Remove Rune of Deflect Magic (Rune of Deflect Magic) from (Picked unit)
              • Unit Group - Remove (Picked unit) from RuneofDeflectMagicTemp_Group_2
            • Else - Actions
 
Status
Not open for further replies.
Top