• 🏆 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!

Death Aura + Immunity

Status
Not open for further replies.
Level 7
Joined
Feb 20, 2016
Messages
274
How do I create a an aura of death that kills everything in a radius or a unit standing in front?
And how do I then make a passive ability that makes a unit immune to this aura?
 
Last edited:
Level 4
Joined
Jan 17, 2018
Messages
112
Not at home to do this, but let me take a crack at it:

Unit - A unit learns an ability

Condition:
Ability = Aura of death (Go into abilities and make a dummy aura off of an offensive one and make the values zero)

Actions:
Set point = position of trigger unit
set killtargets = enemy units within 700 range of point
custom script: destroy group killtargets (Can't remember the exact wording)
if
An enemy unit enters killtargets
then:
Unit - Kill

Something like that.

In order to make someone immune just give them spell immunity (I think).
 
Level 22
Joined
Aug 27, 2013
Messages
3,973
@Marcell , that only works when the hero learns the ability. Nothing happens afterwards.

How do I create a an aura of death that kills everything in a radius or a unit standing in front?
And how do I then make an ability that makes a unit immune to this aura?
You can create a custom ability based on passive buff available in game, it can be both positive or negative buff. For example, endurance aura, you can change the targets allowed to enemies instead of allies and set all the values to zero except for the area of effect. Set the area of effect value to your liking. Then create a custom buff and assign it to your ability.

Create a trigger with periodic timer event (1 or 2 seconds should be enough). Check if anyone has the buff and not immune. If yes, kill. Make sure you keep the trigger turned off until your hero learns the ability.

  • Example Trigger 1
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to YourAbility
    • Actions
      • Trigger - Turn on Example Trigger 2 <gen>
  • Example Trigger 2
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff YourBuff) Equal to True
              • ((Picked unit) is Magic Immune) Equal to False
            • Then - Actions
              • Unit - Kill (Picked unit)
            • Else - Actions
This isn't the most efficient way to achieve it but at least this can do the job.
Isn't death aura kinda OP, though?
 
Level 21
Joined
Apr 8, 2017
Messages
1,534
@Marcell , that only works when the hero learns the ability. Nothing happens afterwards.


You can create a custom ability based on passive buff available in game, it can be both positive or negative buff. For example, endurance aura, you can change the targets allowed to enemies instead of allies and set all the values to zero except for the area of effect. Set the area of effect value to your liking. Then create a custom buff and assign it to your ability.

Create a trigger with periodic timer event (1 or 2 seconds should be enough). Check if anyone has the buff and not immune. If yes, kill. Make sure you keep the trigger turned off until your hero learns the ability.

  • Example Trigger 1
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to YourAbility
    • Actions
      • Trigger - Turn on Example Trigger 2 <gen>
  • Example Trigger 2
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff YourBuff) Equal to True
              • ((Picked unit) is Magic Immune) Equal to False
            • Then - Actions
              • Unit - Kill (Picked unit)
            • Else - Actions
This isn't the most efficient way to achieve it but at least this can do the job.
Isn't death aura kinda OP, though?
"set bj_wantDestroyGroup = true" works to remove the incoming group, its a leakless way to create groups?
 
"set bj_wantDestroyGroup = true" will destroy the group used by the next group action after the action is done (random unit, count, Pick units, is in group ...).
It is a good way in GUI to get rid of temp groups, which you access only once.
But it bugs with one(or all) of the pick "units of UnitType" functions, but I forget which one it was.

The Flag will reset to false, after each usage.
It's destroying powers is equal to DestroyGroup(udg_Group).
 
Level 21
Joined
Apr 8, 2017
Messages
1,534
"set bj_wantDestroyGroup = true" will destroy the group used by the next group action after the action is done (random unit, count, Pick units, is in group ...).
It is a good way in GUI to get rid of temp groups, which you access only once.
But it bugs with one(or all) of the pick "units of UnitType" functions, but I forget which one it was.

The Flag will reset to false, after each usage.
It's destroying powers is equal to DestroyGroup(udg_Group).
Hmm thanks ;) so it is leakless?
 
As leakless as the GUI group functions can be.

Edit: The Group object is destroyed.

But the problem is: The function beeing used to create Groups with "Pick units in range" / rect / player / Type, it does not matter which one, does not clear the local reference to the group object inside the "Pick Units" function located inside "blizzard.j". "blizzard.j" is a file containing the actions one uses.​

This handle reference leak is only minor and has almost no influence onto the game, if it is not applied atleast 10k times, which can only happen with a trigger with the event: " every x second of game time " (with x below 1.0).​
 
Last edited:
Level 7
Joined
Feb 20, 2016
Messages
274
Marcell
Rheiko



Ok I made the 2 triggers but I ain't killing anything. It's the triggers that do the killing and not the stats in the ability or buffs (buffs is just for art I think) I see by looking at the triggers. I gave the hero Death Aura to the Death Knight and ran close to troll creeps.

Also, I don't want it to be a hero ability but normal unit ability, I can't find one for unit that's same to "(Learned Hero Skill)".

"((Picked unit) is Magic Immune) Equal to False" this means I will have to make all my units magic immune...is there anyway I can not make them all magic immune but just have a passive ability that makes it immune only to Death Aura?
 
Last edited:
Level 21
Joined
Apr 8, 2017
Messages
1,534
As leakless as the GUI group functions can be.

Edit: The Group object is destroyed.

But the problem is: The function beeing used to create Groups with "Pick units in range" / rect / player / Type, it does not matter which one, does not clear the local reference to the group object inside the "Pick Units" function located inside "blizzard.j". "blizzard.j" is a file containing the actions one uses.​

This handle reference leak is only minor and has almost no influence onto the game, if it is not applied atleast 10k times, which can only happen with a trigger with the event: " every x second of game time " (with x below 1.0).​
How can i use it correctly?
 
Doit as rheiko showed, (first set bj_wantDestroyGroup, then do the group action), this small handle leak does not matter as long as it is not applied hundreds of tousands times.
This is Pick Units in range in jass:
JASS:
function GetUnitsInRangeOfLocMatching takes real radius, location whichLocation, boolexpr filter returns group
    local group g = CreateGroup()  // <- this local reference to group g is never nulled and therefore this reference kees existing
//globals
    call GroupEnumUnitsInRangeOfLoc(g, whichLocation, radius, filter)
    call DestroyBoolExpr(filter)
    return g
endfunction

@warcraftmodding123, add the "level of ability for picked unit == 0" into the condition instead of magic immune, then units with the buff and without passive will die.
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Level of Your Passive for (Picked unit)) equal to 0
      • ((Picked unit) has buff Your Buff) Equal to True
    • Then - Actions
      • -------- Kills --------
    • Else - Actions
 
Last edited:
Level 7
Joined
Feb 20, 2016
Messages
274
That doesn't work either.

Btw I had left the "Unit - Kill (Picked unit)" the first try and it instantly ended the game when I started. I replaced the the comment "Kills" but still the aura does nothing.
 
Level 7
Joined
Feb 20, 2016
Messages
274
Not even attacking works, but I want the units that are basically touching the aura carrying unit to die without needing to be attacked. It would be better if just the unit in front dies.
I don't know how to make it look like triggers but here's what my 2 triggers look like.

Code:
death aura 1
    Events
        Unit - A unit Learns a skill
    Conditions
        (Learned Hero Skill) Equal to Death Aura
    Actions
        Trigger - Turn on death aura 2 <gen>


Code:
death aura 2
    Events
        Time - Elapsed game time is 1.00 seconds
    Conditions
    Actions
        Custom script:   set bj_wantDestroyGroup = true
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Level of Death Aura  for (Picked unit)) Equal to 0
                        ((Triggering unit) is Magic Immune) Equal to False
                    Then - Actions
                        -------- Kills --------
                    Else - Actions
 
Level 13
Joined
Oct 12, 2016
Messages
769
I don't want it to be a hero ability but normal unit ability
OK, so the unit will have this "Death" aura.
Just one question to clarify something. Like what Dr Super Good said:
You will want to kill the units by inflicting damage to them. This is so the kills are credited properly to the unit with the aura and not like the units committed suicide.

Do you want the unit/hero to get credit for these kills (like, for experience?), or do you just want these units dead?
 
Level 7
Joined
Feb 20, 2016
Messages
274
OK, so the unit will have this "Death" aura.
Just one question to clarify something. Like what Dr Super Good said:


Do you want the unit/hero to get credit for these kills (like, for experience?), or do you just want these units dead?

I don't intend at the moment to use the ability with heroes, just units so experience won't be necessary. So yeah I want the enemy units to just die when at point blank to my units (without the need of attacking them).
 
Status
Not open for further replies.
Top