• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Mind control v1.1

This is a MUI spell that I created by myself.

Description : Controls the targeted ennemy for a short period of time. If the caster stops channeling, if the timer expires or if the controled unit goes away the maximum distance from the caster, the spell will be canceled.

Give credits if you use it in your map(s).


v1.0 released !
v1.1 : - Fixed a glitch where the caster continued to channel the spell while it could walk, during when it was targeting another unit with the spell. This was caused if the second target was at a longer distance away from the caster than the previous one.
I was forced to introduce a third trigger to prevent this from happening.
- Changed the periodic event to apply every 0.03 seconds instead of 0.01 seconds.
- Added another hero to prove the efficiency of the spell.
- Added new documentation.


For the (old) triggering, please check in the comments below.
I'd appreciate if anybody could post the newest version of the triggers tho, as I'm using a French version of the World Editor.

Keywords:
Mind, Control, Soul, Ghost, Banshee.
Contents

Mind control v1.1 (Map)

Reviews
21:21, 4th Jan 2010 The_Reborn_Devil: The triggers look ok, and there are no leaks. Status: Approved Rating: Useful

Moderator

M

Moderator

21:21, 4th Jan 2010
The_Reborn_Devil:
The triggers look ok, and there are no leaks.

Status: Approved
Rating: Useful
 
Here you have the english triggers.
CnP the stuff below.. (If you want to use it)




[trigger="Mind control cast"]
Mind control cast
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Mind control (channeling)
Actions
-------- -------------------------------- --------
-------- DOCUMENTATION --------
-------- -------------------------------- --------
-------- This checks if the spell is already running. If it does, it destroys the last one and creates a new one. --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Casting unit) is in MC_Group) Equal to True
Then - Actions
Special Effect - Destroy MC_AttachedEffect[(Custom value of (Casting unit))]
Floating Text - Destroy MC_TextTimer[(Custom value of (Casting unit))]
Lightning - Destroy MC_LightningChain[(Custom value of (Casting unit))]
Unit Group - Remove (Casting unit) from MC_Group
Unit - Change ownership of MC_Target[(Custom value of (Casting unit))] to MC_TargetPlayer[(Custom value of (Casting unit))] and Change color
Game - Display to (All players) the text: !
Set MC_TimeElapsed[(Custom value of (Casting unit))] = 0.00
Set MC_Integer[2] = (MC_Integer[2] - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MC_Integer[2] Equal to 0
Then - Actions
Set MC_Integer[1] = 0
Trigger - Turn off Mind control loop <gen>
Else - Actions
Else - Actions
-------- This add an Integer to the index system. --------
Set MC_Integer[1] = (MC_Integer[1] + 1)
-------- This sets the caster. --------
Set MC_Caster[MC_Integer[1]] = (Casting unit)
-------- This sets the controled unit. --------
Set MC_Target[MC_Integer[1]] = (Target unit of ability being cast)
-------- This sets level settings. --------
Set MC_Level[MC_Integer[1]] = (Level of (Ability being cast) for MC_Caster[MC_Integer[1]])
-------- verify if (or eventually and directly sets to) LEVEL 1 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MC_Level[MC_Integer[1]] Equal to 1
Then - Actions
-------- This sets the maximum time of how long the unit will be controled. (The target) --------
Set MC_Time[MC_Integer[1]] = 10.00
-------- This sets the maximum distance between the caster and the target. --------
Set MC_MaxDistance[MC_Integer[1]] = 1000.00
Else - Actions
-------- if not LEVEL 1, verify (and eventually sets to) LEVEL 2 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MC_Level[MC_Integer[1]] Equal to 2
Then - Actions
Set MC_Time[MC_Integer[1]] = 20.00
Set MC_MaxDistance[MC_Integer[1]] = 1100.00
Else - Actions
-------- if not LEVEL 2, verify (and eventually sets to) LEVEL 3 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MC_Level[MC_Integer[1]] Equal to 3
Then - Actions
Set MC_Time[MC_Integer[1]] = 30.00
Set MC_MaxDistance[MC_Integer[1]] = 1200.00
Else - Actions
-------- This sets the owner of the target. --------
Set MC_TargetPlayer[MC_Integer[1]] = (Owner of MC_Target[MC_Integer[1]])
-------- This sets the 2 points needed for the following actions. --------
Set MC_TempPoint1 = (Position of MC_Caster[MC_Integer[1]])
Set MC_TempPoint2 = (Position of MC_Target[MC_Integer[1]])
Set MC_TempPoint3 = (MC_TempPoint2 offset by 40.00 towards (Angle from MC_TempPoint1 to MC_TempPoint2) degrees)
-------- This creates the timer text. --------
Set MC_TimerInteger[MC_Integer[1]] = (Integer((MC_Time[MC_Integer[1]] - MC_TimeElapsed[MC_Integer[1]])))
Floating Text - Create floating text that reads (String(MC_TimerInteger[MC_Integer[1]])) at MC_TempPoint3 with Z offset 0.00, using font size 11.00, color (50.00%, 50.00%, 100.00%), and 0.00% transparency
Set MC_TextTimer[MC_Integer[1]] = (Last created floating text)
-------- This creates and set the lightning effect between the caster and the target. --------
Lightning - Create a Drain Mana lightning effect from source MC_TempPoint1 to target MC_TempPoint2
Set MC_LightningChain[MC_Integer[1]] = (Last created lightning effect)
-------- This creates and set the effect over the head of the target. --------
Special Effect - Create a special effect attached to the overhead of MC_Target[MC_Integer[1]] using Abilities\Spells\NightElf\shadowstrike\shadowstrike.mdl
Set MC_AttachedEffect[MC_Integer[1]] = (Last created special effect)
-------- This instantly change the owner of the target. --------
Unit - Change ownership of MC_Target[MC_Integer[1]] to (Owner of MC_Caster[MC_Integer[1]]) and Retain color
-------- This add the Caster to the group to verify that he is always channeling the spell. --------
Unit Group - Add MC_Caster[MC_Integer[1]] to MC_Group
-------- Set the custom value to the index Integer. --------
Unit - Set the custom value of MC_Caster[MC_Integer[1]] to MC_Integer[1]
-------- Removing the location created. --------
Custom script: call RemoveLocation(udg_MC_TempPoint1)
Custom script: call RemoveLocation(udg_MC_TempPoint2)
Custom script: call RemoveLocation(udg_MC_TempPoint3)
-------- This add one more Integer[2] to make the Integer[1] null and stop the loop integer when he is null. --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MC_Integer[2] Equal to 0
Then - Actions
Trigger - Turn on Mind control loop <gen>
Else - Actions
Set MC_Integer[2] = (MC_Integer[2] + 1)

[/trigger]


[trigger="Mind control loop"]
Mind control loop
Events
Time - Every 0.01 seconds of game time
Conditions
Actions
For each (Integer MC_Integer[3]) from 1 to MC_Integer[1], do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(MC_Caster[MC_Integer[3]] is in MC_Group) Equal to True
Then - Actions
Set MC_TempPoint1 = (Position of MC_Caster[MC_Integer[3]])
Set MC_TempPoint2 = (Position of MC_Target[MC_Integer[3]])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Distance between MC_TempPoint1 and MC_TempPoint2) Less than MC_MaxDistance[MC_Integer[3]]
(MC_Caster[MC_Integer[3]] is alive) Equal to True
(MC_Target[MC_Integer[3]] is alive) Equal to True
(Current order of MC_Caster[MC_Integer[3]]) Equal to (Order(unrobogoblin))
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MC_TimeElapsed[MC_Integer[3]] Less than MC_Time[MC_Integer[3]]
Then - Actions
Set MC_TimeElapsed[MC_Integer[3]] = (MC_TimeElapsed[MC_Integer[3]] + 0.01)
Lightning - Move MC_LightningChain[MC_Integer[3]] to source MC_TempPoint1 and target MC_TempPoint2
Set MC_TempPoint3 = (MC_TempPoint2 offset by 40.00 towards (Angle from MC_TempPoint1 to MC_TempPoint2) degrees)
Set MC_TimerInteger[MC_Integer[3]] = (Integer((MC_Time[MC_Integer[3]] - MC_TimeElapsed[MC_Integer[3]])))
Floating Text - Destroy MC_TextTimer[MC_Integer[3]]
Floating Text - Create floating text that reads (String(MC_TimerInteger[MC_Integer[3]])) at MC_TempPoint3 with Z offset 0.00, using font size 11.00, color (50.00%, 50.00%, 100.00%), and 0.00% transparency
Set MC_TextTimer[MC_Integer[3]] = (Last created floating text)
Custom script: call RemoveLocation(udg_MC_TempPoint3)
Else - Actions
Special Effect - Destroy MC_AttachedEffect[MC_Integer[3]]
Floating Text - Destroy MC_TextTimer[MC_Integer[3]]
Lightning - Destroy MC_LightningChain[MC_Integer[3]]
Unit Group - Remove MC_Caster[MC_Integer[3]] from MC_Group
Unit - Change ownership of MC_Target[MC_Integer[3]] to MC_TargetPlayer[MC_Integer[3]] and Change color
Set MC_TimeElapsed[MC_Integer[3]] = 0.00
Set MC_Integer[2] = (MC_Integer[2] - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MC_Integer[2] Equal to 0
Then - Actions
Trigger - Turn off (This trigger)
Else - Actions
Else - Actions
Special Effect - Destroy MC_AttachedEffect[MC_Integer[3]]
Floating Text - Destroy MC_TextTimer[MC_Integer[3]]
Lightning - Destroy MC_LightningChain[MC_Integer[3]]
Unit Group - Remove MC_Caster[MC_Integer[3]] from MC_Group
Unit - Change ownership of MC_Target[MC_Integer[3]] to MC_TargetPlayer[MC_Integer[3]] and Change color
Unit - Order MC_Caster[MC_Integer[3]] to Stop
Set MC_TimeElapsed[MC_Integer[3]] = 0.00
Set MC_Integer[2] = (MC_Integer[2] - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
MC_Integer[2] Equal to 0
Then - Actions
Set MC_Integer[1] = 0
Trigger - Turn off (This trigger)
Else - Actions
Custom script: call RemoveLocation(udg_MC_TempPoint1)
Custom script: call RemoveLocation(udg_MC_TempPoint2)
Else - Actions

[/trigger]

 
Top