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

Aoe shield

Status
Not open for further replies.
Level 7
Joined
Dec 5, 2013
Messages
280
I am trying to create spell that works like mana shield but is aoe effect, all units in X range are shielded from damage. I tried to change area of effect in mana shield editor but it didnt change anything.

I tried to change death and decay "buff" to mana shield but it didnt do anything
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
There is no spell that works like that.
Buffs have no effect on what spell does, so even if you changed it to Immolation buff, it would still be Death and Decay.

Buffs are meant only as a check for the spell's effect and for visual representation on unit (icon and effect).


I think you will need to trigger the whole ability (but that would require damage detection system), or use triggers to add and remove "Hardened Skin" (which reduces 100% of all income physical damage) in spellbook and spell immunity (this will make them immune, but I'm not aware of any spell that allows you to reduce magical damage taken by 100% and not make that unit immune to magic)
 
Level 7
Joined
Dec 5, 2013
Messages
280
I just need spell to shield all units in area from all damage and every hit takes 1 mana from caster. If damage detection is complicated then I just want damage shield in area.
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
Dude, you don't get it => There is no base ability, which acts as an AoE and reduces all incoming damage at the expense of the caster's mana. This is why you have to trigger the whole spell.
If the ability can be (de)activated or not is not much of a change really, it's just a change in an event in trigger (and in caster's spell, but that is not relevant to triggers).
 
Level 7
Joined
Dec 5, 2013
Messages
280
How to create trigger where hero casts aoe spell and all units inside the triggering spell area get hardened skin? Units should be able to enter and leave the area. The triggering spell should also be activated spell.
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
Depends how it should work. Is the spell requiring target point (e.g. it works like for example Blizzard, where you select the area where the spell takes effect) or is it an ability that you activate/deactivate?

Then it is just periodically picking nearby units, giving them Hardened Skin and adding them to a group; and also going through the group and checking if all units with the Hardened Skin are close enough to the caster - if not, remove Hardened Skin and remove from group.
 
Level 7
Joined
Dec 5, 2013
Messages
280
I created custom immolate, and I am trying to figure out how to create trigger where all units in immolate range get hardened skin.
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
To catch the event when unit activates or deactivates immolation, use this:
  • Spell
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to *Your custom hero* // so it doesn't get confused with Demon Hunter activating his own Immolation
      • 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
          • Game - Display to (All players) the text: STARTED
        • Else - Actions
          • Game - Display to (All players) the text: SWITCHED OFF
After that it is like any other spell really => if it's supposed to be MUI, you index the caster and then it is what I wrote in previous post - you pick units nearby caster and add them to caster-specific group and give them Hardened Skin.
Then you pick all units in the caster-specific group and check their distance from caster. If they are too far away, you remove Hardened Skin and remove them from caster-specific group.
 
Level 7
Joined
Dec 5, 2013
Messages
280
But how to trigger the area where units get the hardened skin? I dont understand that "group" solution

What is "MUI"? I am making multiplayer game where both players are able to play same heroes.

Since I have no idea what is that "group", isnt it possible to just create something like "units in range" and give hardened skin?
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
  • Actions
    • Set loc = (Position of *Your caster*) // point variable
    • Unit Group - Pick every unit in casters_group and do (Actions)
      • Loop - Actions
        • Set u = (Picked unit) // unit variable
        • Set p = (Position of u) // point variable
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Or - Any (Conditions) are true
              • Conditions
                • (Distance between loc and p) Greater than 512.00 // Real => Math - distance between points
                • (u is dead) Equal to True
                • (u belongs to an enemy of (Owner of *Your caster*)) Equal to True // in case that unit got Possessed by Banshee, etc.
          • Then - Actions
            • Unit Group - Remove u from casters_group
            • Unit - Remove Hardened Skin from u
          • Else - Actions
        • Custom script: call RemoveLocation(udg_p)
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units within 512.00 of loc) and do (Actions)
      • Loop - Actions
        • Set u = (Picked unit)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (u is alive) Equal to True
            • (u is in casters_group) Equal to False
            • (u belongs to an ally of (Owner of *Your caster*)) Equal to False
          • Then - Actions
            • Unit Group - Add u to casters_group
            • Unit - Add Hardened Skin to u
          • Else - Actions
    • Custom script: call RemoveLocation(udg_loc)
Such trigger would need to be called periodically (like every 1 second or so). Also, the trigger I posted is not MUI, it is just an example of what I meant (though it may not be MUI, the actual MUI trigger will be practically the same, althought groups would be arrays, etc.)


edit: though, if you used damage detection system, I imagine the whole spell would be simpler and more efficient.
 
Level 7
Joined
Dec 5, 2013
Messages
280
Why is it so hard to create simple spell? That trigger is extremely complicated.

Should be simple to just create custom aura which grants damage reduction for all units in range.
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
The one which activates/deactivates should basically be the trigger I posted in post #10.

It basically works like this:
Hero activates the ability => trigger in post #10 fires - it indexes the hero into variable array.
Then there is a second trigger which is a periodic one. This trigger loop through each indexed hero and basically does all the things I posted in post #12.

Last, when hero deactivates the ability, the same trigger in post #10 will fire again, but now it will get in "Else" section in the If/Then/Else. In this section you should deindex the hero and his group.

In conclusion:
You need two triggers => one for when you switch the ability on/off; the other is a periodic loop which adds/removes Hardened Skin.


Isnt it possible to just give all units affected by X aura hardened skin?
Sure is. Didn't know you wanted to give it a buff as well (though I should have foreseen it).
It will still require 2 triggers though. One will be same as the one in post #10 (but in this case, when you activate the ability, you add to the hero a hidden aura ability that gives the buff; in case when you deactivate the ability, you remove the hidden aura ability from hero).
The other is once again a periodic loop, which will work on similar principle like the one in post #12. It will need a unit group (only one in this case) and will do the following:
1) Go through the unit group (in this group you store all units which you gave Hardened Skin) and check if each unit has the aura buff from any caster. If not, you remove it from group and remove Hardened Skin from it.

2) Pick every unit in playable map area who have the aura buff, but are not in group. You add Hardened Skin to it and add it to group.
 
Level 7
Joined
Dec 5, 2013
Messages
280
I dont understand those triggers, they are too complicated and I think there must be far more simple solution to this issue.

Isnt it possible to create trigger where all units affected by certain aura gain hardened skin? And the aura is linked with some on/off spell.
 
Level 19
Joined
Mar 18, 2012
Messages
1,716
Hi Foxace,
the spell you are requesting is very complexe and difficult to code. The reason is that JASS has no specified API for shield spells.
Furthermore there is no base spell in the object editor, which allows you to "put a shield over a unit for x seconds".
Iirc there is one resource in the JASS section called "shield" by Cokemonkey (it requires vJass knowledge for proper usage) and an unfinished request in the Kawaii-Spell-Workshop.

There is a very simple, but also very limited solution:
If you want a flat damage modifier for shielded units for instance 35% reduced damage,
you can use any "Damage Detection System" and add on damage event a unique condition (UnitHasBuff or UnitIsInGroup or LoadedHandleId is not 0, etc)
If true ---> damage = damage*0.65.
 
Level 7
Joined
Dec 5, 2013
Messages
280
Cant I trigger units to get hardened skin if affected by certain aura like endurance aura?
 
Level 7
Joined
Dec 5, 2013
Messages
280
Where is the unit indexer trigger? that only has damage engine

I dont really understand any of that. I would appreciate trigger which gives buff X to units with buff Z
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
I made the spell using aura and Hardened skin.

Read all three Trigger Comments in Trigger editor, as they explain how to set things up, what to be aware of, when can this ability bug (I guess it's unavoidable)
 

Attachments

  • ProtectionBubble.w3x
    20.1 KB · Views: 42
Level 7
Joined
Dec 5, 2013
Messages
280
The spell was supposed to have area surrounded by ring or bubble, no additional effect on units themselves.

Also why is there "spell book"? why does this trigger need item?

I am trying to build trigger which gives all units affected by for an example endurance aura hardened skin.

I dont know how to define unit who has X buff and how to define unit who gets the additional buff if affected by certain buff.
 
Level 3
Joined
Mar 31, 2013
Messages
47
You know that, he can't read your mind;), he did what you requested, as BPower said, it's not easy to do such spells. By the way, use what Nichilus made for you, and for damage absorb use this http://www.hiveworkshop.com/forums/spells-569/physical-damage-detection-gui-v1-0-0-2-a-231846/. And use this trigger
  • PWS Fire
    • Events
      • Game - damageEventTrigger becomes Equal to 1.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (target has buff YourBuff ) Equal to True
        • Then - ActionsSet
          • Set amount = 0.00
        • Else - Actions
 
Level 7
Joined
Dec 5, 2013
Messages
280
I dont understand that damage detection.

For physical damage there is already devotion aura which would be good enough for me but it doesnt protect from magic damage.
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
Spell Books are needed if you want to add a passive spell to unit, but you don't want players to see that spell's icon - which is why I used them there. I don't think you would want people affected by that spell to see they suddenly have Hardened Skin ability, right?


As Xavius wrote, I do not read your mind, so suddenly writing that is is supposed to have bubble is irrelevant information.
More importantly, you should try to "read between lines" - This is not a request board. What I did was provide you with an example map of how the spell you want could work. However I never wrote it is exactly the spell you want (as you did not even give enough information about the spell itself - like with the bubble effect).

If you do not want to use damage detection, you would probably get stuck with the method I posted above, which actually does exactly what you want - in terms of how the spell works. It gives aura to the caster and gives Hardened Skin to all units affected by this aura.

You cannot *give* unit a buff through triggers, however through triggers you can make a unit cast a spell which *applies* that buff.

And lastly, about the spell I posted - I think it is a really easy thing to add a bubble effect to the caster and make affected units to not show any effect on themselves, as these are just changes in object editor.
 
Level 7
Joined
Dec 5, 2013
Messages
280
I think the easiest solution would be to make units cast spell if they have X buff. Aura spells already have built in range checkers so it should be more simple to just add/remove spell when units enter in range of aura and leave.

The problem with your trigger is that I dont understand how to fix those issues in the FAQ and I want to be able to understand triggers in the game.
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
You cannot cast passive ability if that's what you want. So you cannot cast "Hardened Skin" on another unit. You can only add/remove this ability from the unit itself.

And actually, the easiest solution is to use the damage detection system with the spell working like Xavius posted - that way there won't be any spell collision when adding Hardened Skin to unit who has Hardened Skin by default (== like Mountain Giants)
 
Level 7
Joined
Dec 5, 2013
Messages
280
But its extremely complicated and I dont understand the trigger. I want different unit to use the trigger and the mod is 2 player map where both can play the hero.

Why does the trigger need to be so complicated, why isnt it possible to create "if in aura X give buff Z" with just few lines?

I think I just use devotion aura and give magic defence another way.

How to define "triggering unit" without selecting unit from map? Hero is not in the map before player buys it so I cant have unit in the map at first.

Is it possible to change devotion aura toggleable like immolate?
 
Last edited:
Level 24
Joined
Oct 12, 2008
Messages
1,783
But its extremely complicated and I dont understand the trigger. I want different unit to use the trigger and the mod is 2 player map where both can play the hero.

Then perhaps learn to make sense of it.

Im honestly surprised no one has blasted your sickening attitude in every thread you post.
It pretty much can be summed up as this.

- You begin by asking a question.
- Someone helps but it isn't what you want. (Since you gave no details)
- Someone gives a proper solution, but you don't like it cause you give no shit to understand it.
 
Level 7
Joined
Dec 5, 2013
Messages
280
I dont want 2000 lines of triggers which I cant understand even if I spent weeks of studying.

I want to make my own map, not use extremely complicated triggers built by everyone else. I have decided to use devotion aura, but right now I need help to make it on/off spell.
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
It's actually the other way - the trigger is really simple. It's just you don't understand what each thing means, so you think it is complicated.

DeActivate Ability trigger
The problem:
There is no way to find out if unit switched ability on or off - except for the way I used.
Example of abilities that you turn on/off are Footman's Defend ability, Naga Witch's Mana Shield, Demon Hunter's Immolation, etc.

Note: Casting ability is not the same as switching that ability on or off; so events like:
  • Unit - A unit Starts the effect of an ability
will not work when (de)activating Immolation or other similar spells.


The solution:
The only way to find out if unit switched that ability on or off is when that unit is issued specific order.

There are 2 orders for each toggling ability (e.g. for Immolation).
For Immolation it is:
- when switched on: immolation
- when switched off: unimmolation


The DeActivate trigger works like this:
If unit is issued one of the 2 orders I wrote above (immolation x unimmolation) and that unit is Demon Hunter, it will
a) give him a hidden aura spell, if the order was "immolation"
b) remove the hidden aura spell, if the order was "unimmolation"


The trigget itself:
  • DeActivate Ability
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Demon Hunter
      • 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
          • Unit - Add Spell Book - Aura to (Triggering unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Loop <gen> is on) Equal to False
            • Then - Actions
              • Trigger - Turn on Loop <gen>
            • Else - Actions
        • Else - Actions
          • Unit - Remove Spell Book - Aura from (Triggering unit)
The Loop trigger:
The problem:
There is no event that would work in this sense: "Unit gains/loses a buff"

The solution:
Because of the above, you need to manually find out units which have this buff.


There are 3 things you need to watch out:
a) Units, who are close enough to the caster, but they do not have Hardened Skin
b) Units, who have Hardened Skin, but are not close enough to the caster
c) There is no way to efficiently find out if unit has Hardened Skin ability or not


For those reasons, the Loop trigger does the following:
1) It uses a unit group (in here, it's called ProtectionBubble_Group) - this group contains all units, to which you add Hardened Skin ability.
This is the point "c)" in the "3 things you need to watch out for"

2) It picks each unit in the unit group and checks if they still have buff from aura (it they don't have that buff, they're not close enough to any caster)
In this case, it will remove that unit from this unit group and remove Hardened Skin ability from them.
This is the point "b)" in the "3 things you need to watch out for"

3) It picks every unit in map, who have aura buff (so they are close to any caster), but they are not yet in that unit group (meaning they do not have Hardened Skin). These units are then add to the unit group and have Hardened Skin ability add.
This is the point "a)" in the "3 things you need to watch out for"

----

The last part is for efficiency only - in case no hero has that ability activated, it will turn off this trigger.


The actual trigger:
  • Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in ProtectionBubble_Group and do (Actions)
        • Loop - Actions
          • Set u = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (u is dead) Equal to True
                  • (u has buff Protection Bubble (CUSTOM)) Equal to False
            • Then - Actions
              • Unit - Remove Spell Book - Hardened Skin from u
              • Unit Group - Remove u from ProtectionBubble_Group
            • Else - Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) has buff Protection Bubble (CUSTOM)) Equal to True) and (((Matching unit) is in ProtectionBubble_Group) Equal to False))) and do (Actions)
        • Loop - Actions
          • Set u = (Picked unit)
          • Unit Group - Add u to ProtectionBubble_Group
          • Unit - Add Spell Book - Hardened Skin to u
      • Set u = No unit
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (ProtectionBubble_Group is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions

And no, you cannot turn Devotion Aura into toggleable ability like Immolation.
Also, using Devotion aura is not the best choice for physical damage reduction, because it won't give the same % reduction.

The reason:
UnitA has 10 armor (== 40% physical damage reduction). If UnitA gains 10 armor from Devotion aura, it will have 20 armor (== 60% physical reduction).

Now you have UnitB - this unit has 20 armor (== 60% physical damage reduction). If UnitB gains 10 armor from Devotion aura, it will have 30 armor (== 68% physical damage reduction).

As you can see - both UnitA and UnitB gain same amount of armor from Devotion Aura (which is 10 armor), but the actual physical damage reduction is increased by 20% for UnitA and only 8% for UnitB.
 
Level 24
Joined
Oct 12, 2008
Messages
1,783
I dont want 2000 lines of triggers which I cant understand even if I spent weeks of studying.
I want to make my own map, not use extremely complicated triggers built by everyone else.

You could saved everyone a headache if you posted this right off the bat.
If you don't give details like this, people are gonna have to play guessing games with your request.

I have decided to use devotion aura, but right now I need help to make it on/off spell.

- You need to base your custom ability off one with a toggle function. Defend, immolation etc.
- Add your devotion aura to a dummy spellbook, this is so we can hide the UI icon.
- Disable the said spellbook
- Upon casting your ability, you add the dummy spellbook to the hero. The spellbook icon will be hidden since you disabled it, however the devotion aura inside will still give its bonuses even though its icon will be gone.
- Similarly, remove the spellbook when the ability is deactivated.


Alternatively, you can use Bear Form ability and transform the hero into an alternate version with the devotion aura ability.
Even then, you will still need to use the hidden spellbook trick unless you don't mind the Icon showing.
 
Level 7
Joined
Dec 5, 2013
Messages
280
Does that trigger work in 2 player map where both can have same hero? What is the spell book?
 
Level 7
Joined
Dec 5, 2013
Messages
280
That might be the easiest solution. But the shield needs to drain mana so bear form would not work. Would running out of mana even work as "unimmolation"?
 
Level 7
Joined
Dec 5, 2013
Messages
280
How to change the size of the spell effect on caster?

I made dummyunit with effect model but problem is that it doesnt move with the caster.
 
Level 3
Joined
Mar 31, 2013
Messages
47
Make a loop that checks every 0.03 time, set position of caster, and move your dummy everytime to it. Don't forget to remove leak with the custom code with "call RemoveLocation(udg_YourPoint)"
 
Level 3
Joined
Mar 31, 2013
Messages
47
Yes. And you must turn it on when spells is activated and turn if off when spell is deactivated.
 
Status
Not open for further replies.
Top