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!
Hey, I want to have this spell that heals allies for x hp at lvl 1, x hp at lvl 2, etc in 900 range of the triggering unit.
I used the Resurrection as the spell base, because of the effect when casted.
I would also like this effect to happen on the healed allied units (within 900 range).
What I have so far affects all units, and I'm not sure how to make it affect only allied units.
Heal
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Heal
Actions
Unit Group - Pick every unit in (Units within 900.00 of (Position of (Casting unit))) and do (Actions)
Loop - Actions
Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 900.00)
When you say you used the resurrection spell as the spell base, do you mean, you made a custom spell, based off of the Paladin's Resurrect spell? I think you're after a single target spell, like storm bolt.
Make an integer, then do
set <integer name> to (hero level of spell being cast * X)
Then in your for loop, where your setting the life of the unit, have, set life of picked unit to life of picked unit + <integer name>
Remember that in the object manager you can change the special effects of spells, and the spell data. So, you can make it so spells don't perform their actual actions, and you can change things to be how you want them to.
Remember to use: A unit Starts the effect of an ability, for the event, otherwise the trigger will fire, but the spell wont drain mana or use the cooldown.
When you cast this ability, do you want to be able to target who you want to heal?
Example: You click spell. You then click on which ally you want to heal. Heal then restores HP to primary target, and heals all nearby friends.
In that case, you need conditions (and probably a new base spell).
AoE Heal Example
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to AoE Heal
Actions
Set Temp_Point = (Position of (Triggering unit))
Set Temp_Group = (Units within 400.00 of Temp_Point matching ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an ally of (Owner of (Triggering unit))) Equal to True)))
Unit Group - Pick every unit in Temp_Group and do (Actions)
Loop - Actions
Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 100.00)
Floating Text - Create floating text that reads +100 above (Picked unit) with Z offset 60.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 15.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 1.70 seconds
That is a unit spell I made a while ago (there was a damage portion I snipped out). You can disable the Floating Text if you want (I like seeing that it heals, personally). Temp_Point is a Location Variable, Temp_Group is a Unit Group Variable. It is leakless (as far as I know).
If you want to add levels, do something like this:
Holy Nova Copy
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to (Archbishop) Holy Nova
Actions
Set Temp_Point = (Position of (Triggering unit))
Set Temp_Group = (Units within 400.00 of Temp_Point matching ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an ally of (Owner of (Triggering unit))) Equal to True)))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of (Archbishop) Holy Nova for (Triggering unit)) Equal to 1
Then - Actions
Unit Group - Pick every unit in Temp_Group and do (Actions)
Loop - Actions
Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 100.00)
Floating Text - Create floating text that reads +100 above (Picked unit) with Z offset 60.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 15.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 1.70 seconds
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of (Archbishop) Holy Nova for (Triggering unit)) Equal to 2
Then - Actions
Unit Group - Pick every unit in Temp_Group and do (Actions)
Loop - Actions
Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 100.00)
Floating Text - Create floating text that reads +100 above (Picked unit) with Z offset 60.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 15.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 1.70 seconds
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of (Archbishop) Holy Nova for (Triggering unit)) Equal to 3
Then - Actions
Unit Group - Pick every unit in Temp_Group and do (Actions)
Loop - Actions
Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 100.00)
Floating Text - Create floating text that reads +100 above (Picked unit) with Z offset 60.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 15.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 1.70 seconds
Of course, if you don't want Floating Combat Text, then it's a lot shorter (and simpler), just change the values. If you want the AoE to grow bigger per level, you set the Variables inside of the If/Then/Else(Multiple Functions) section, on a per-level basis.
Or do you want the heal to heal the user, and all nearby allies just upon being clicked (like Resurrection is, you don't pick a target)?
Example: You click spell. The unit heals him/herself, and all nearby allies receive health as well.
In that case, you can modify the Obsidian Statue ability, "Essence of Blight", which is an auto-castable AoE heal that restores health to all nearby allies. You can adjust the cost and cooldown to make it balanced, and when you convert it to a Hero Ability, you can change the AoE, cooldown, mana cost, and healing done. Just remember to change the Stats - Levels field.
EDIT: Didn't see your response. Your trigger's condition is incorrect. I would use:
Heal
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Heal
Actions
Set Spell_Heal_PointofCastingUnit = (Position of (Triggering unit))
Set Spell_Heal_AmountHealed = (((Level of Heal for (Triggering unit)) x 300) + ((Intelligence of (Triggering unit) (Include bonuses)) x 3))
Unit Group - Pick every unit in (Units within 900.00 of Spell_Heal_PointofCastingUnit) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) belongs to an ally of (Owner of (Triggering unit))) Equal to True
Then - Actions
Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (Real(Spell_Heal_AmountHealed)))
Else - Actions
Do nothing
This is because in your condition, you were picking every unit within a range, not picking a player. Thus, "picked player" can't be used, but "picked unit belongs to an ally of (owner of triggering unit)" will work.
Also, your trigger leaks a unit group. Setting the unit group into a variable, like in my example above, then destroying the unit group would be leakless. Your version is only a small leak though, and you probably won't notice it if you don't change it.
Set Spell_Heal_PointofCastingUnit = (Position of (Triggering unit))
Set Spell_Heal_AmountHealed = (((Level of Heal for (Triggering unit)) x 300) + ((Intelligence of (Triggering unit) (Include bonuses)) x 3))
Unit Group - Pick every unit in (Units within 900.00 of Spell_Heal_PointofCastingUnit) Matching player owner of unit is an ally of triggering unit do (Actions)
Loop - Actions
Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (Real(Spell_Heal_AmountHealed)))
Ok, I'm trying this now..
(Reason I'm not using custom script is it causes the trigger to be turned off)
(Still doesn't work)
Heal
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Heal
Actions
Set Spell_Temp_Heal_Point = (Position of (Triggering unit))
Set Spell_Temp_Heal_Group = (Units within 900.00 of Spell_Temp_Heal_Point matching ((((Matching unit) is A structure) Equal to False) and (((Matching player) is an ally of (Owner of (Triggering unit))) Equal to True)))
Set Spell_Heal_AmountHealed = (((Level of Heal for (Triggering unit)) x 300) + ((Intelligence of (Triggering unit) (Include bonuses)) x 3))
Unit Group - Pick every unit in Spell_Temp_Heal_Group and do (Actions)
Loop - Actions
Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (Real(Spell_Heal_AmountHealed)))
Floating Text - Create floating text that reads (String(Spell_Heal_AmountHealed)) above (Picked unit) with Z offset 60.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 15.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 1.70 seconds
"Set Spell_Temp_Heal_Group = (Units within 900.00 of Spell_Temp_Heal_Point matching ((((Matching unit) is A structure) Equal to False) and (((Matching Unit) belongs to an ally of (Owner of (Triggering unit))) Equal to True)))"
Boolean Comparison - Function: Unit - Unit Belongs To An Ally Of Player
Edit: Proper custom script shouldn't disable a trigger. For the variables you have, you will want them to read:
Custom script: call RemoveLocation(udg_Spell_Temp_Heal_Point)
Custom script: call DestroyGroup(udg_Spell_Temp_Heal_Group)
But if it's still causing the triggers to turn off, it's not that important yet. Let's get it working, then we can make it leakless.
Thanks Matt, that helped.
Now, I added a damage to it, but, it kills everything (more damage than health obviously) instead of just enemies.
Any help?
(I didn't finish destroying the temporary variables, because I wasn't sure how to)
Heal
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Heal
Actions
Set Spell_Heal_Temp_Point = (Position of (Triggering unit))
Set Spell_Heal_Temp_Level = (Level of Heal for (Triggering unit))
Set Spell_Heal_Temp_Ally_Group = (Units within 900.00 of Spell_Heal_Temp_Point matching ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an ally of (Triggering player)) Equal to True)))
Set Spell_Heal_Temp_AmountHealed = ((Spell_Heal_Temp_Level x 300) + ((Intelligence of (Triggering unit) (Include bonuses)) x 3))
Unit Group - Pick every unit in Spell_Heal_Temp_Ally_Group and do (Actions)
Loop - Actions
Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + (Real(Spell_Heal_Temp_AmountHealed)))
Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\Resurrect\ResurrectCaster.mdl
Floating Text - Create floating text that reads (String(Spell_Heal_Temp_AmountHealed)) above (Picked unit) with Z offset 60.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 15.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 1.70 seconds
Set Spell_Heal_Temp_Enemy_Group = (Units within ((Real(Spell_Heal_Temp_Level)) x 300.00) of Spell_Heal_Temp_Point matching ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of (Triggering player)) Equal to True)))
Set Spell_Heal_Temp_AmountDamage = (50 x ((Level of Heal for (Triggering unit)) x 3))
Unit Group - Pick every unit in Spell_Heal_Temp_Enemy_Group and do (Actions)
Loop - Actions
Unit - Cause (Triggering unit) to damage circular area after 0.00 seconds of radius ((Real(Spell_Heal_Temp_Level)) x 300.00) at Spell_Heal_Temp_Point, dealing (Real(Spell_Heal_Temp_AmountDamage)) damage of attack type Spells and damage type Normal
Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Undead\RegenerationAura\ObsidianRegenAura.mdl
Floating Text - Create floating text that reads (String(Spell_Heal_Temp_AmountDamage)) above (Picked unit) with Z offset 60.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 15.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 1.70 seconds
Ok, so it looks like it's killing everything because you are picking every unit in the group, then doing an AoE damage, so if you have 10 units nearby, 5 friendly ones get healed, but then it does 10 explosions that don't pick friend from foe.
Change the "damage circular area" to just "Cause (Triggering unit) to damage (picked unit).
EDIT: I suggest changing the color of the text between the heal and damage. I personally use Red for damage (color (100.00%,0.00%,0.00%)) and Blue for healing (color (0.00%,100.00%,0.00%)). You can preview what colors the percentages will be when you edit them, but when you have 20 numbers pop up over enemies and allies alike, color distinguishing or +/-s help determine if it worked correctly.
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.