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!
You are using an out of date browser. It may not display this or other websites correctly. You should upgrade or use an alternative browser.
Triggers
Morphing Ray v0.01.w3x
Variables
Initialization
Initialization
Spell
Morphing Ray Cast
Morphing Ray Channel
Morphing Ray Interupt
Enter map-specific custom script code below. This text will be included in the map script after variables are declared and before any trigger code.
Name
Type
is_array
initial_value
Caster
unit
No
Hashtable
hashtable
No
Lightning
lightning
No
Points
location
Yes
RayCasters
group
No
Real
real
Yes
Target
unit
No
Initialization
Events
Map initialization
Map initialization
Conditions
Actions
Visibility - Disable fog of war
Visibility - Disable black mask
Hashtable - Create a hashtable
Set Variable Set Hashtable = (Last created hashtable)
Morphing Ray spell.
Made by G00dG4m3.
Channels (And really, CHANNELS) a stream of mana to target, turning it into a sheep (bahhaha) and dealing % of its
max life as damage to it.
Give me credits if you use it in your map.
Morphing Ray Cast
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Morphing Ray
Actions
-------- Stores caster and target into variables --------
-------- NOTE 1: Caster is stored only because it's easier to write the script, not searching for Triggering Unit --------
Set Variable Set Caster = (Triggering unit)
Set Variable Set Target = (Target unit of ability being cast)
-------- Finds the Caster's location --------
-------- NOTE 2: Will be used later for start-end points of the lightning we will create --------
Set Variable Set Points[1] = (Position of Caster)
-------- Counts the damage dealt to target --------
-------- NOTE 3: Make your countings here --------
Set Variable Set Real[1] = (0.01 x (Real((Level of Morphing Ray for Caster))))
Set Variable Set Real[1] = ((Max life of Target) x Real[1])
-------- NOTE 4: All the counted damage MUST be multiplied by 0.03 (or divided into 33.3) --------
-------- It is a MUST, because all ticks of damage will be dealt at interval of 0.03 --------
-------- We don't want to deal 800*.05=40 damage per 0.03 or 40/0.03=1333.(3) per second, do we? --------
Set Variable Set Real[1] = (Real[1] x 0.03)
-------- Counts the duration of the Spell --------
-------- NOTE 5: Count your duration here --------
-------- NOTE 6: This must be equal to follow through time for each level --------
Set Variable Set Real[2] = (1 + (Real((Level of Morphing Ray for Caster))))
-------- Stores all information to the Hashtable --------
-------- NOTE 7: It is made to be easier to interupt the channeled effect through effect --------
-------- NOTE 8: Never, EVER, make spells w/ hashtables which is casted by CASTER and all information is attached to TARGET, cause it will get bugged! A LOT! --------
Hashtable - Save Handle Of Target as 0 of (Key (Triggering unit).) in Hashtable .
Hashtable - Save Real[1] as 1 of (Key (Triggering unit).) in Hashtable .
Hashtable - Save Real[2] as 2 of (Key (Triggering unit).) in Hashtable .
-------- NOTE 9: Lightning is created here, as I didn't want to waste an action for storing da lightning to da variable --------
-------- NOTE 10: Change your lighting type here --------
Lightning - Create a Drain Mana lightning effect from source Points[1] to target Points[1]
Hashtable - Save Handle Of (Last created lightning effect) as 3 of (Key (Triggering unit).) in Hashtable .
-------- Checks if there is any instance of spell already in on --------
-------- If not, turns the Channeled effect trigger on --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(RayCasters is empty) Equal to True
Then - Actions
Trigger - Turn on Morphing_Ray_Channel <gen>
Else - Actions
-------- Adds the Caster/Target SFX abilities to the Caster/Target. Obvious, isn't it? --------
Unit - Add SFX Caster to Caster
Unit - Add SFX Target to Target
-------- 'Sheeps' target --------
Unit - Create 1 . Dummy Caster for (Owner of Caster) at Points[1] facing Default building facing degrees
Unit - Add Polymorph to (Last created unit)
Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
Unit - Order (Last created unit) to Human Sorceress - Polymorph . Target
-------- Adds caster to the Channelers' group --------
Unit Group - Add Caster to RayCasters
-------- Fixes the Leak --------
Custom script: call RemoveLocation(udg_Points[1])
Here is a tick of the Spell
Never ever change the time between the Ticks, as comment in the Cast trigger says that tick is (and it is!) once per 0.03 second,
because of smooth sliding of lightnings and almost insta-interupt of the spell if any condition of interuption is reached.
Morphing Ray Channel
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in RayCasters and do (Actions)
Loop - Actions
-------- Stores Caster/Target into variables --------
Set Variable Set Caster = (Picked unit)
Set Variable Set Target = (Load 0 of (Key (Picked unit).) in Hashtable.)
-------- Finds locations of Caster/Target --------
-------- These locations will be used to check the distance between the Duo and move lighting if possible --------
Set Variable Set Points[1] = (Position of Caster)
Set Variable Set Points[2] = (Position of Target)
-------- Loads the Tick's damage --------
Set Variable Set Real[1] = (Load 1 of (Key (Picked unit).) from Hashtable.)
-------- Loads the duration left and reduces it by Tick interval --------
-------- NOTE 1: It MUST be equal to the interval of this Trigger, as stated above --------
Set Variable Set Real[2] = (Load 2 of (Key (Picked unit).) from Hashtable.)
Set Variable Set Real[2] = (Real[2] - 0.03)
-------- Loads the Lighting effect --------
Set Variable Set Lightning = (Load 3 of (Key (Picked unit).) in Hashtable.)
-------- Finds the Heights into which our lightning's start-end will be rised --------
Custom script: set udg_Real[3] = GetLocationZ(udg_Points[1])
Custom script: set udg_Real[4] = GetLocationZ(udg_Points[2])
Set Variable Set Real[3] = (Real[3] + ((Current flying height of Caster) + 55.00))
Set Variable Set Real[4] = (Real[4] + ((Current flying height of Target) + 20.00))
-------- If everyone in the Duo is alive, timer hasn't expired and range between the Duo isn't too big... --------
-------- NOTE 2: Change your max channel range in the conditions --------
-------- NOTE 3: if you want it be infinite, write a huge number --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Distance between Points[1] and Points[2]) Less than or equal to 800.00
Unit - Cause Caster to damage Target , dealing Real[1] damage of attack type Spells and damage type Normal
-------- Updates the time left in the timer --------
Hashtable - Save Real[2] as 2 of (Key (Picked unit).) in Hashtable .
Else - Actions
-------- Else... --------
-------- Removes SFX abilities from the Duo --------
Unit - Remove SFX Caster from Caster
Unit - Remove SFX Target from Target
-------- Removes the Transformation buff from Target. Well, if it is not dead yet --------
Unit - Remove Polymorph buff from Target
-------- Destroys the lightning --------
Lightning - Destroy Lightning
-------- Clears the Hashtable --------
Hashtable - Clear all child hashtables of child (Key (Picked unit).) in Hashtable .
-------- Removes Caster from the Channelers' group --------
Unit Group - Remove Caster from RayCasters .
-------- Orders the Caster to hold position. Well, if it is not dead yet --------
Unit - Order Caster to Hold Position .
-------- Clears the leaks --------
Custom script: call RemoveLocation(udg_Points[1])
Custom script: call RemoveLocation(udg_Points[2])
-------- Checks if there is any instance of spell left after loop --------
-------- If not, turns this trigger off --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(RayCasters is empty) Equal to True
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions
This trigger is completely formed to interupt the effects of the spell, if in any way the caster stops channeling the spell./
Don't change here anything, but I will put the comments here, if anyone would want to do something better out of it.
I don't check if I need to turn the Channeling trigger, because it will turn of itself without any side effects.
Morphing Ray Interupt
Events
Unit - A unit Stops casting an ability
Conditions
(Ability being cast) Equal to Morphing Ray
Actions
-------- Stores our Duo into variables --------
Set Variable Set Caster = (Triggering unit)
Set Variable Set Target = (Load 0 of (Key (Triggering unit).) in Hashtable.)
-------- Stores the Lightning into variable --------
Set Variable Set Lightning = (Load 3 of (Key (Triggering unit).) in Hashtable.)
-------- Clears the Hashtable, as we won't need anything anymore --------
Hashtable - Clear all child hashtables of child (Key (Triggering unit).) in Hashtable .
-------- Removes caster from channelers' group --------
Unit Group - Remove (Triggering unit) from RayCasters .
-------- Removes SFX abilities from the Duo --------
Unit - Remove SFX Caster from Caster
Unit - Remove SFX Target from Target
-------- Removes the Transformation buff from the Target --------
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.