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!
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
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)
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.
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).
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.
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.
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.
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.
I imagine it would be easy if you used damage detection. I think you would just check if damaged unit is nearby caster (using the "Math - distance between points" and if yes, you reduced income damage.
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.
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.
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.
Those are the most common Damage Detection Systems on The Hive Workshop for GUI users. Just download the map and try the demo, I guess that's the best way for you to get started.
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)
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.
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.
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)
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?
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.
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.
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.
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.
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.
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"?
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"?
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)"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.