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 created this spell for Revolve, who then wanted this spell to be uploaded.
The caster of the spell conjures a becon of holy magic. The beacon pulls all units except the caster towards it's center. If a unit enters the pull radius while the beacon is active, it also starts to get pulled towards the center. Units inside the radius get slowed down to make escaping more difficult, but with frantic clicking they can make it
If a unit gets pulled too close to the beacon, it will damage enemies and heal allies. If the caster stops casting the spell, it disappears immediately.
Credits:
Revolve for a good spell idea.
Vexorian for custom dummy unit model.
v1.00
First release
v1.01
Using SetUnitX and SetUnitY instead of Move unit instantly. The spell now constantly pulls, which is cool.
Hotkey fixed.
Set pull speed to customizeable variable.
v1.03
Fixed the issue of units no being picked when they entered the AoE of the spell after the spell was cast.
The slow buff on units is now removed when the spell ends.
Dummy spells and unit renamed to make it easier to differentiate them from standard unit/abilities.
Replaced some (picked unit) and (triggering unit) with variables.
v1.05
Improved dummy settings
Made dragging allies optional
Added configurable variables for dummy unit type, ability and buff for easier importing
Added importing instructions
Holy Dragging Spell Init
Events
Map initialization
Conditions
Actions
-------- -------------------- --------
Hashtable - Create a hashtable
Set Holy_Dragging_Spell_Hash = (Last created hashtable)
-------- -------------------- --------
Set HDS_Ability = Holy Dragging Spell
Set HDS_Dummy = Footman - (HDS_Dummy)
Set HDS_Slow_Buff = Slow - (HDS)
Set HDS_Pulls_Allies = False
-------- -------------------- --------
Set HDS_Duration = 6.00
Set HDS_Damage = 50.00
Set HDS_Drag_Speed = 4.50
Set HDS_Catch_Range = 500.00
Set HDS_Damage_Range = 175.00
-------- -------------------- --------
Holy Dragging Spell
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to HDS_Ability
Actions
Set Temp_Unit_1 = (Triggering unit)
-------- -------------------- --------
Set Temp_Loc_1 = (Target point of ability being cast)
-------- -------------------- --------
-------- Create a dummy unit at the center of the beacon --------
-------- -------------------- --------
Unit - Create 1 HDS_Dummy for Neutral Passive at Temp_Loc_1 facing Default building facing degrees
Set Temp_Unit_3 = (Last created unit)
-------- -------------------- --------
-------- Scale the dummy, so the special effect gets scaled too --------
-------- -------------------- --------
Animation - Change Temp_Unit_3's size to (200.00%, 200.00%, 200.00%) of its original size
-------- -------------------- --------
-------- Set the time for the beacon --------
-------- -------------------- --------
Unit - Add a HDS_Duration second Generic expiration timer to Temp_Unit_3
-------- -------------------- --------
Unit Group - Add Temp_Unit_3 to Holy_Dragging_Spell_Lightning
-------- -------------------- --------
-------- Store things we need to know about the spell --------
-------- -------------------- --------
-------- Timer used for the life time of the beacon --------
Hashtable - Save (HDS_Duration + 0.01) as (Key timer) of (Key (Last created unit)) in Holy_Dragging_Spell_Hash
-------- Store the caster of the beacon --------
Hashtable - Save Handle OfTemp_Unit_1 as (Key caster) of (Key (Last created unit)) in Holy_Dragging_Spell_Hash
-------- Store the beacon unit for the triggering unit --------
Hashtable - Save Handle Of(Last created unit) as (Key beacon) of (Key (Triggering unit)) in Holy_Dragging_Spell_Hash
-------- -------------------- --------
Set Temp_Group_1 = (Units within HDS_Catch_Range of Temp_Loc_1 matching (((((Matching unit) is alive) Equal to True) and ((Matching unit) Not equal to Temp_Unit_1)) and (((Matching unit) Not equal to Temp_Unit_1) and (((Unit-type of (Matching unit)) Not equal to Footman - (HDS_
Unit Group - Pick every unit in Temp_Group_1 and do (Actions)
Loop - Actions
Set Temp_Unit_2 = (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Temp_Unit_2 belongs to an enemy of (Triggering player)) Equal to True
Then - Actions
Set Temp_Loc_2 = (Position of Temp_Unit_2)
Set Temp_Real_2 = (Angle from Temp_Loc_2 to Temp_Loc_1)
-------- -------------------- --------
-------- Create a dummy that casts slow on picked unit --------
-------- -------------------- --------
Unit - Create 1 HDS_Dummy for Neutral Passive at Temp_Loc_2 facing Temp_Real_2 degrees
Unit - Order (Last created unit) to Undead Necromancer - Cripple Temp_Unit_2
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
-------- -------------------- --------
Unit Group - Add Temp_Unit_2 to Holy_Dragging_Spell_Group
-------- -------------------- --------
Hashtable - Save HDS_Drag_Speed as (Key escape_timer) of (Key (Picked unit)) in Holy_Dragging_Spell_Hash
Hashtable - Save Temp_Real_2 as (Key angle) of (Key (Picked unit)) in Holy_Dragging_Spell_Hash
Hashtable - Save ((HDS_Damage x (1.00 x 0.03)) x (Real((Level of Holy Dragging Spell for Temp_Unit_1)))) as (Key damage) of (Key (Picked unit)) in Holy_Dragging_Spell_Hash
Hashtable - Save Handle OfTemp_Loc_1 as (Key center) of (Key (Picked unit)) in Holy_Dragging_Spell_Hash
Hashtable - Save (Distance between Temp_Loc_1 and Temp_Loc_2) as (Key distance) of (Key (Picked unit)) in Holy_Dragging_Spell_Hash
Hashtable - Save Handle OfTemp_Unit_1 as (Key caster) of (Key (Picked unit)) in Holy_Dragging_Spell_Hash
Hashtable - Save Handle OfTemp_Unit_3 as (Key beacon) of (Key (Picked unit)) in Holy_Dragging_Spell_Hash
-------- Check if unit´is close enough to the beacon to be damaged or healed --------
-------- -------------------- --------
Set Temp_Loc_1 = (Position of Temp_Unit_1)
Set Temp_Loc_2 = (Load (Key center) of (Key (Picked unit)) in Holy_Dragging_Spell_Hash)
-------- -------------------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Distance between Temp_Loc_1 and Temp_Loc_2) Less than HDS_Damage_Range
Then - Actions
Set Temp_Unit_2 = (Load (Key caster) of (Key (Picked unit)) in Holy_Dragging_Spell_Hash)
-------- -------------------- --------
-------- Damage enemies, heal allies --------
-------- -------------------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of Temp_Unit_1) is an enemy of (Owner of Temp_Unit_2)) Equal to True
Then - Actions
Unit - Cause Temp_Unit_2 to damage Temp_Unit_1, dealing (Load (Key damage) of (Key (Picked unit)) from Holy_Dragging_Spell_Hash) damage of attack type Chaos and damage type Normal
Else - Actions
Unit - Set life of Temp_Unit_1 to ((Life of Temp_Unit_1) + ((Max life of Temp_Unit_1) x (0.01 / 8.00)))
Else - Actions
-------- -------------------- --------
Hashtable - Save (Angle from Temp_Loc_1 to Temp_Loc_2) as (Key angle) of (Key (Picked unit)) in Holy_Dragging_Spell_Hash
Hashtable - Save (Distance between Temp_Loc_2 and Temp_Loc_1) as (Key distance) of (Key (Picked unit)) in Holy_Dragging_Spell_Hash
Unit - Remove HDS_Slow_Buff buff from (Picked unit)
-------- -------------------- --------
Hashtable - Clear all child hashtables of child (Key (Picked unit)) in Holy_Dragging_Spell_Hash
-------- -------------------- --------
Unit Group - Remove Temp_Unit_1 from Holy_Dragging_Spell_Group
-------- -------------------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Holy_Dragging_Spell_Group is empty) Equal to True
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions
Holy Dragging Spell Lightning
Events
Time - Every 0.25 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in Holy_Dragging_Spell_Lightning and do (Actions)
Loop - Actions
Set Temp_Unit_1 = (Picked unit)
Set Temp_Unit_2 = (Load (Key caster) of (Key (Picked unit)) in Holy_Dragging_Spell_Hash)
Set Temp_Real_1 = (Load (Key timer) of (Key (Picked unit)) from Holy_Dragging_Spell_Hash)
-------- -------------------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Temp_Real_1 Greater than 0.01
(Temp_Unit_1 is alive) Equal to True
Then - Actions
Set Temp_Loc_1 = (Position of Temp_Unit_1)
Set Temp_Group_1 = (Units within HDS_Catch_Range of Temp_Loc_1 matching (((((Matching unit) is alive) Equal to True) and ((Matching unit) Not equal to Temp_Unit_2)) and (((Matching unit) Not equal to Temp_Unit_1) and (((Unit-type of (Matching unit)) Not equal to Footman - (HDS_
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Temp_Group_1 is empty) Equal to False
Then - Actions
Unit Group - Pick every unit in Temp_Group_1 and do (Actions)
Loop - Actions
Set Temp_Unit_3 = (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Temp_Unit_3 is in Holy_Dragging_Spell_Group) Equal to False
Then - Actions
Set Temp_Loc_2 = (Position of Temp_Unit_3)
-------- -------------------- --------
Unit - Create 1 Footman - (HDS_Dummy) for Neutral Passive at Temp_Loc_2 facing Temp_Real_2 degrees
Unit - Order (Last created unit) to Undead Necromancer - Cripple Temp_Unit_3
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
-------- -------------------- --------
Set Temp_Real_2 = (Angle from Temp_Loc_2 to Temp_Loc_1)
-------- -------------------- --------
Unit Group - Add Temp_Unit_2 to Holy_Dragging_Spell_Group
-------- -------------------- --------
Hashtable - Save Handle OfTemp_Loc_1 as (Key center) of (Key (Picked unit)) in Holy_Dragging_Spell_Hash
Hashtable - Save Temp_Real_2 as (Key angle) of (Key (Picked unit)) in Holy_Dragging_Spell_Hash
Hashtable - Save HDS_Drag_Speed as (Key escape_timer) of (Key (Picked unit)) in Holy_Dragging_Spell_Hash
Hashtable - Save (Distance between Temp_Loc_1 and Temp_Loc_2) as (Key distance) of (Key (Picked unit)) in Holy_Dragging_Spell_Hash
Hashtable - Save ((HDS_Damage x (1.00 x 0.03)) x (Real((Level of Holy Dragging Spell for Temp_Unit_2)))) as (Key damage) of (Key (Picked unit)) in Holy_Dragging_Spell_Hash
Hashtable - Save Handle OfTemp_Unit_1 as (Key beacon) of (Key (Picked unit)) in Holy_Dragging_Spell_Hash
Hashtable - Save Handle OfTemp_Unit_2 as (Key caster) of (Key (Picked unit)) in Holy_Dragging_Spell_Hash
-------- -------------------- --------
Unit Group - Add Temp_Unit_3 to Holy_Dragging_Spell_Group
it is either not MUI or bugged
sometimes I cast it without anything happening
edit:
hashtables
of cause it's bugged
and 4 triggers for a channel spell....
you could check if the order is == channel and merge the other trigger somehow (usually every spell is possible with 2 triggers but sometimes 3 are easier)
however all the other stuff seems to be good
you remove leaks
LOTS of documentation
new idea
ingame screenshot
you don't have to make it with indexing but fix the bug mentioned on top
(gl finding it)
I just don't like hashtables
After testing a bit, I coudn't make it bug. Could you tell when it bugs for you? I'll try to test some more.
hashtables of cause it's bugged
and 4 triggers for a channel spell....
you could check if the order is == channel and merge the other trigger somehow (usually every spell is possible with 2 triggers but sometimes 3 are easier)
I've never had anything bug due to it being made with hashtables, and I've done a lot of spells. Don't let your bias cloud your vision.
The first trigger fires when the spell is cast, it is needed.
The second trigger takes care of dragging units in, it's needed.
The third trigger adds units entering the area into unit group of units being dragged. It also creates special effects. The time interval of trigger #3 is much greater than the interval of trigger #2 (0,25 s vs 0,03 s). It's actually better to divide these into two different trigger, to make the spell require less CPU time.
The fourth trigger just cancels the spell. Can't do without it.
To me it sounds like you don't know what you're talking about. The number of triggers by itself doesn't make a spell any better/worse.
Saying "OMG it haz 4 trigggers, make it less" isn't worth anything. If you can give some advice and/or idea how to actually squezze it in three triggers without compromizing performance too much, I'm all ears.
I thank you for taking the time to have a look at the spell.
Well I like the spell, effects are good, and executed well. Though I really don't like GUI, 'cause of 1000 of variables and triggers.
I would just give one comment on how to improve:
- Try using SetUnitX(whichUnit, newX) and SetUnitY(whichUnit, newY) instead using Unit - Move Instantly. It's really simple to use and units (ofc. if the speed is reasonable) can still move and be dragged (pulled), and it doesn't reset their commands. Not to mention it looks nicer .
Now it gets executed as many times as there are units in the group. It only gets executed when a unit is removed form the group. 6 units in a group -> executed 6 times per spell cast.
If it is at the end of the trigger, it gets executed 1/(0.03)*6=200 times per spell cast. This is for the "group trigger". For the other trigger, it is one time per spell cast as it is now, or 1/(0.25)*6=24 times per spell cast.
So no, I won't put it at the end of the trigger.
your variable names are weird
sometimes you call the HDS_ and sometimes Holy_Dragging_Spell_
Typo: Holy_Daragging_Spell_Group
That would be slower solution than what it is now. There's absolutely no need to squeeze it in three triggers, unless there's some performance gain to be had by doing so.
v1.01
Using SetUnitX and SetUnitY instead of Move unit instantly. The spell now constantly pulls, which is cool.
Hotkey fixed.
Set pull speed to customizeable variable.
That SetUnitX/Y tip was golden. Awesome really. +rep coming your way.
spell looks realy nice, but i found a big bug.
If you set the spell point out of the map, in the black area around the map, the moving units, going to be bugged. please fix it!
BTW. nice idea.
Looks nice thumbs_up
Good Coding thumbs_up
Mui thumbs_up
Some Bugs thumbs_down
Easy to Customize thumbs_up
Yeah, you need to import the dummy.mdx and use it for your dummy unit. The special effects are attached to the dummy model, that's why they won't work if you don't have that model/dummy.
Seriously this is a reason for not being approved?
The name can be edited by any user who downloads it and same for the mana cost.
And for the leak,ok..Maker can fix it... BUT I have seen approved spells leaking...and not only once.
I updated the mana cost to 125, it was 5 for testing purposes and forgot to change it.
It does not leak to my knowledge, I save the handle of Temp_Loc_1 for all units that are picked (key = center), and then remove the location when the spell ends in Holy Dragging Spell Group -trigger.
Nice work, although testing it with benchmarks, i found another ther is a leak.
hmm... maybe some unit group... i dunno it seems very good and i trust you as triggerer
generally monitored the memory consumpion in bytes for wc3. in normall, it takes memory in a special space for replay, but i used do not ssve replay. after that it shouldnt increase in space, but it did (a eakless map, does never increase in space after Donotsavereplay())
generally monitored the memory consumpion in bytes for wc3. in normall, it takes memory in a special space for replay, but i used do not ssve replay. after that it shouldnt increase in space, but it did (a eakless map, does never increase in space after Donotsavereplay())
that's because every time you create a unitgroup and destroy it it will leak a little memory
you can't do much about it though
JASS functions don't create unitgroups but add all units passing a certain filter to a group instead of creating the group and then adding all the units to it
of cause you can access these enumeration functions in custom script but it might be slow in a special case
"null" is the place for the filter function
usually you create a function in JASS which is like the following
JASS:
function filter takes nothing returns boolean
return GetUnitLife(GetFilterUnit())>0.405
endfunction
and you convert it to a filter using "Condition(function filter)" and replace the "null" with it
but you can't declare functions in GUI so you will have to use the null-filter version
actually this is damn fast (faster than anything else) if there is no unit, or only a few units which would pass the filter anyway, around but if there are MANY (50+) units within the area of effect which do NOT fullfill the given conditions it will be slower
this is because if you use a null-filter all units are added to the group and you have to check every unit in the pick-all-units-in-group-loop
checking within the condition is waaaay faster
you also could just make a few JASS filter functions and continue using them in GUI but some dumbass will mostlikely reply that if you are using JASS already you should make the whole spell with JASS and if you do it you will have to switch to vJASS because another dumbass will reply that it is much easier than JASS (which is true anyway but requires JNGP) and so it would not be GUI anymore
you mostlikely forgot something
are all triggers working?
did you check if the ability codes are correct?
what about the imports?
and dummy units? (but if the slow works it's unlikely that you forgot to copy them x)
If I want this awesome spell to be 3 levels instead of 2, can I just add one more level at the ability in "Object Editor", and then the triggers will multiply dmg/duration/speed etc. with the ability level? Thanks
that comment really explains your problem, be more specific. But from my experience you most likely forget to reconnect the conditions with the spell in trigger editor.
hello ! i imported your spell, everything seems to work fine but i got one problem. the spell description says that allies should also get healed, well they don't any idea what's the problem?
hello ! i imported your spell, everything seems to work fine but i got one problem. the spell description says that allies should also get healed, well they don't any idea what's the problem?
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.