• 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.

[Trigger] AOE Detect Life Spell - MUI Spell

Status
Not open for further replies.
Level 4
Joined
Sep 25, 2018
Messages
81
Trying to create a spell which adds a special effect to the position (visible and invisible) of all units/heroes in an area around the caster.

Here is the basic idea of the spell I am trying to create.

Hero casts his ability; Detect Life (Based on Immolation, wanted a spell which can be turned on/off)

Hero turns on the spell which drains 25/20/15/10 mana every second. All units within a 1200 radius are given a debuff and have a special effect placed at their position which follows them while they are debuffed.
Once turned off/unit dies/unit no longer has debuff, the special effect is lost. (using "Abilities\Spells\Other\GeneralAuraTarget\GeneralAuraTarget.mdl" as the special effect which follows each unit).

Here is what I have so far as the start for the MUI spell. I just have not managed to work out how what I need to differentiate between each different special effect and their corresponding unit.

  • DetectLifeCast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Detect Life
    • Actions
      • Set DetectLife_Index = (DetectLife_Index + 1)
      • Set DetectLife_Cast[DetectLife_Index] = (Casting unit)
      • Set DetectLife_Group[DetectLife_Index] = (Units within 1200.00 of (Position of DetectLife_Cast[DetectLife_Index]) matching (((Matching unit) has buff Detect Life) Equal to True))
      • Set DetectLife_Counter[DetectLife_Index] = 0.00
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DetectLife_Index Equal to 1
        • Then - Actions
          • Trigger - Turn on DetectLifeEffect <gen>
        • Else - Actions
  • DetectLifeEffect
    • Events
      • Time - Every 0.25 seconds of game time
    • Conditions
    • Actions
      • For each (Integer DetectLife_Loop) from 1 to DetectLife_Index, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • DetectLife_Counter[DetectLife_Loop] Greater than or equal to 1.00
                  • (DetectLife_Cast[DetectLife_Loop] is dead) Equal to True
            • Then - Actions
              • Set DetectLife_Cast[DetectLife_Loop] = DetectLife_Cast[DetectLife_Index]
              • Set DetectLife_Group[DetectLife_Loop] = DetectLife_Group[DetectLife_Index]
              • Set DetectLife_Counter[DetectLife_Loop] = DetectLife_Counter[DetectLife_Index]
              • Set DetectLife_Loop = (DetectLife_Loop - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DetectLife_Loop Less than or equal to 0
                • Then - Actions
                  • Special Effect - Destroy (Last created special effect)
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
              • Unit Group - Pick every unit in DetectLife_Group[DetectLife_Loop] and do (Actions)
                • Loop - Actions
                  • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Other\GeneralAuraTarget\GeneralAuraTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
I am completely lost, please help!
 
Level 9
Joined
Jul 30, 2018
Messages
445
So all you want to do is create a special effect? You could just create a dummy aura ability that has the effect and then add and remove it every time you turn on and off the toggle ability. You can hide the button if you put 0,-11 as its button positions. (Creating the aura SFX with triggers is quite tricky, because you would have to store each SFX to a variable so that they wouldn't leak and could be destroyed. Some models only have one animation so they can be created and destroyed right away and they will still run the animation. The aura model has a different stand and death animations, so if you destroy it right away, it will not show up at all.)
 
Level 4
Joined
Sep 25, 2018
Messages
81
So all you want to do is create a special effect? You could just create a dummy aura ability that has the effect and then add and remove it every time you turn on and off the toggle ability. You can hide the button if you put 0,-11 as its button positions. (Creating the aura SFX with triggers is quite tricky, because you would have to store each SFX to a variable so that they wouldn't leak and could be destroyed. Some models only have one animation so they can be created and destroyed right away and they will still run the animation. The aura model has a different stand and death animations, so if you destroy it right away, it will not show up at all.)
Sorry for the late response, I was trying to sort out the "AOE Blinding Spell - MUI Spell".

Basically, I've attempted to take what you showed me for the "AOE Blinding Spell - MUI Spell", and try to piece together an trigger/idea which could potentially work.
You could just create a dummy aura ability that has the effect
Unfortunately, this would not work, because the effect of the aura would disappear when the unit goes invisible. The spell is supposed to be almost like another way to detect if there are invisible units in an area (among other potential applications).

So the idea so far.

  • DetectLifeCast
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Level of Detect Life for (Triggering unit)) Greater than 0
      • Or - Any (Conditions) are true
        • Conditions
          • (Issued order) Equal to (Order(immolation))
          • (Issued order) Equal to (Order(unimmolation))
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Issued order) Equal to (Order(immolation))
        • Then - Actions
          • Set DL_CastUnit = (Triggering unit)
          • Set DL_CastHandle = (Triggering unit)
          • Trigger - Turn on DetectLifeRegion <gen>
        • Else - Actions
          • Trigger - Turn off DetectLifeRegion <gen>
  • DetectLifeRegion
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units within 1200.00 of (Position of DL_CastUnit)) and do (Actions)
        • Loop - Actions
          • Set DL_TempUnit = (Picked unit)
          • Set DL_TempHandle = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (DL_TempUnit is alive) Equal to True
              • (DL_TempUnit belongs to an enemy of (Owner of DL_CastUnit)) Equal to True
            • Then - Actions
            • Else - Actions
Obviously, this doesn't work at the moment because I haven't fully got to grips with using Hashtables, but hopefully, the theory works? I need to be able to save who the caster is initially, so it can be used to update the region if the casters moves. I have an idea on how to make the special effect appear and how to move it to the position of all affected units (and also remove it when they no longer have the debuff). Just having trouble saving who the caster is so it can be an MUI spell.
 
Last edited:
Status
Not open for further replies.
Top