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.
Changelog
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
Triggers
Initialize
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 -------- -------------------- --------
Activate Spell
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 -------- -------------------- -------- Custom script: call RemoveLocation(udg_Temp_Loc_2) -------- -------------------- --------
Else - Actions
-------- -------------------- -------- -------- Turn on triggers that need to be turned on -------- -------- -------------------- -------- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Holy Dragging Spell Group <gen> is on) Equal to False
Then - Actions
Trigger - Turn on Holy Dragging Spell Group <gen>
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Holy Dragging Spell Lightning <gen> is on) Equal to False
Then - Actions
Trigger - Turn on Holy Dragging Spell Lightning <gen>
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Holy Dragging Spell Cancel <gen> is on) Equal to False
Then - Actions
Trigger - Turn on Holy Dragging Spell Cancel <gen>
Unit Group - Pick every unit in Holy_Dragging_Spell_Group and do (Actions)
Loop - Actions
Set Temp_Unit_1 = (Picked unit) Set Temp_Unit_2 = (Load (Key beacon) of (Key (Picked unit)) in Holy_Dragging_Spell_Hash) Set Temp_Real_1 = (Load (Key distance) of (Key (Picked unit)) from Holy_Dragging_Spell_Hash) -------- -------------------- -------- -------- If beacon isn't there or unit has escaped the dragging distance, remove from group -------- -------- -------------------- -------- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Temp_Unit_2 is alive) Equal to True Temp_Real_1 Less than HDS_Catch_Range
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Temp_Real_1 Greater than or equal to 33.00
Then - Actions
Set Temp_Loc_1 = (Position of Temp_Unit_1) -------- -------------------- -------- Set Temp_Real_3 = (Load (Key angle) of (Key (Picked unit)) from Holy_Dragging_Spell_Hash) -------- -------------------- -------- Set Temp_Real_4 = (X of Temp_Loc_1) Set Temp_Real_5 = (Y of Temp_Loc_1) -------- -------------------- -------- Set Temp_Real_4 = (Temp_Real_4 + (HDS_Drag_Speed x (Cos(Temp_Real_3)))) Set Temp_Real_5 = (Temp_Real_5 + (HDS_Drag_Speed x (Sin(Temp_Real_3)))) -------- -------------------- -------- Set Temp_Loc_2 = (Point(Temp_Real_4, Temp_Real_5)) -------- -------------------- -------- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain pathing at Temp_Loc_2 of type Walkability is off) Equal to False
-------- -------------------- -------- -------- 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 -------- -------------------- -------- Custom script: call RemoveLocation(udg_Temp_Loc_1)
Else - Actions
Set Temp_Loc_2 = (Load (Key center) of (Key (Picked unit)) in Holy_Dragging_Spell_Hash) Custom script: call RemoveLocation(udg_Temp_Loc_2) -------- -------------------- -------- 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
Special Effects
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 Custom script: call UnitAddAbility(GetLastCreatedUnit(), 'Aloc') 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 -------- -------------------- -------- Custom script: call RemoveLocation(udg_Temp_Loc_2) -------- -------------------- -------- Trigger - Turn on Holy Dragging Spell Group <gen>
Custom script: call DestroyGroup(udg_Temp_Group_1) -------- -------------------- -------- Special Effect - Create a special effect attached to the origin of Temp_Unit_1 using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl Special Effect - Destroy (Last created special effect) Special Effect - Create a special effect attached to the origin of Temp_Unit_1 using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl Special Effect - Destroy (Last created special effect) -------- -------------------- -------- Hashtable - Save (Temp_Real_1 - 0.25) as (Key timer) of (Key (Picked unit)) in Holy_Dragging_Spell_Hash
Else - Actions
Set Temp_Loc_1 = (Load (Key center) of (Key (Picked unit)) in Holy_Dragging_Spell_Hash) Custom script: call RemoveLocation(udg_Temp_Loc_1) -------- -------------------- -------- 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_Lightning -------- -------------------- -------- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Holy_Dragging_Spell_Lightning is empty) Equal to True
Then - Actions
Trigger - Turn off (This trigger) Trigger - Turn off Holy Dragging Spell Cancel <gen>
Else - Actions
Cancel Spell
Holy Dragging Spell Cancel
Events
Unit - A unit Stops casting an ability
Conditions
(Ability being cast) Equal to Holy Dragging Spell
Actions
Unit - Kill (Load (Key beacon) of (Key (Triggering unit)) in Holy_Dragging_Spell_Hash) Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in Holy_Dragging_Spell_Hash
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
it is either not MUI or bugged
sometimes I cast it without anything happening
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.
Quote:
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 :P.
Anyway my rating for this spell would be 4/5. :)
__________________
Ако се деси чудо, ту ћу да будем.(If a miracle happens, I'll be there)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Holy_Dragging_Spell_Lightning is empty) Equal to True
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions
to the end of the trigger
so it will be executed only once and have the same effect
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.
Quote:
your variable names are weird
sometimes you call the HDS_ and sometimes Holy_Dragging_Spell_
Typo: Holy_Daragging_Spell_Group
All HDS_something are what you can configure. But yeah, I guess they could all begin with HDS_
Quote:
the hotkey is wrong
you wrote Q but it is B
Thanks for pointing that out.
Quote:
...check if the order of the caster is equal to channel and
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.
Quote:
if random integer between x and y equal to x
What do you mean by that? What do I need to randomize?
Quote:
-hashtables are SLOW
-arrays are FAST
In my eyes hashtables are fast enough.
Quote:
-making the same unit be able to cast a spell more then once at a runtime is much easier with arrays...
Yeah, but this spell is meant to have longer cooldown than it's duration is. Otherwise it would be way overpowered.
Thanks for your comments
Quote:
Originally Posted by Shdow89
- Try using SetUnitX(whichUnit, newX) and SetUnitY(whichUnit, newY) instead using Unit - Move Instantly.
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 ()
Good Coding ()
Mui ()
Some Bugs ()
Easy to Customize ()
So my rate is >> 4/5 <<
enjoy
__________________
We need your ideas (hero and matching spells,single spells or just heroes and their history):