- Joined
- Nov 9, 2006
- Messages
- 2,561
Hey, so i have this channeling spell where a few target units will slowly walk towards the casters. It's similar to DOTA2 Lich's Sinister Gaze except it has more targets. Adding 2/3/4 of the closest units to the spell as well. The problem i've got is that the spell doesn't work on the same units the second time i'm casting it.
Part 1: Casting the spell, adding units to group and adding buff
Part 1: Casting the spell, adding units to group and adding buff
-
Mesmerize2 Start Cast
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Mesmerize
-
-
Actions
-
Game - Display to (All players) the text: Start Casting
-
Unit Group - Add (Triggering unit) to Spell_SongofSiren_Group
-
Unit Group - Remove all units from Spell_SongofSiren_HitGroup[(Player number of (Owner of (Triggering unit)))]
-
-------- --------
-
Unit Group - Add (Target unit of ability being cast) to Spell_SongofSiren_HitGroup[(Player number of (Owner of (Triggering unit)))]
-
-------- --------
-
Game - Display to (All players) the text: (String((Number of units in Spell_SongofSiren_HitGroup[Integer1])))
-
Set Spell_Mesmerize_TempPoint[1] = (Position of (Target unit of ability being cast))
-
For each (Integer Integer3) from 1 to ((Level of (Ability being cast) for (Triggering unit)) + 1), do (Actions)
-
Loop - Actions
-
Set Spell_Mesmerize_TempUnit = No unit
-
Set Real1 = 400.01
-
Set Spell_Mesmerize_TempGroup[1] = (Units within 400.00 of Spell_Mesmerize_TempPoint[1] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is Mechanical) Equal to False) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal)
-
-------- --------
-
Unit Group - Pick every unit in Spell_Mesmerize_TempGroup[1] and do (Actions)
-
Loop - Actions
-
Set Spell_Mesmerize_TempPoint[2] = (Position of (Picked unit))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Distance between Spell_Mesmerize_TempPoint[1] and Spell_Mesmerize_TempPoint[2]) Less than Real1
-
((Picked unit) is in Spell_SongofSiren_HitGroup[(Player number of (Owner of (Triggering unit)))]) Equal to False
-
-
Then - Actions
-
Set Real1 = (Distance between Spell_Mesmerize_TempPoint[1] and Spell_Mesmerize_TempPoint[2])
-
Set Spell_Mesmerize_TempUnit = (Picked unit)
-
-
Else - Actions
-
-
Custom script: call RemoveLocation(udg_Spell_Mesmerize_TempPoint[2])
-
-
-
Custom script: call DestroyGroup(udg_Spell_Mesmerize_TempGroup[1])
-
-------- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Spell_Mesmerize_TempUnit Not equal to No unit
-
-
Then - Actions
-
-------- --------
-
Unit Group - Add Spell_Mesmerize_TempUnit to Spell_SongofSiren_HitGroup[(Player number of (Owner of (Triggering unit)))]
-
-
Else - Actions
-
-
Set Spell_Mesmerize_TempUnit = No unit
-
-
-
Custom script: call RemoveLocation(udg_Spell_Mesmerize_TempPoint[1])
-
-------- Apply Slow --------
-
Unit Group - Pick every unit in Spell_SongofSiren_HitGroup[(Player number of (Owner of (Triggering unit)))] and do (Actions)
-
Loop - Actions
-
Set Spell_Mesmerize_TempPoint[2] = (Position of (Picked unit))
-
Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at Spell_Mesmerize_TempPoint[2] facing Default building facing degrees
-
Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
-
Unit - Add Effect: Mesmerize: Cast Slow to (Last created unit)
-
Unit - Set level of Effect: Mesmerize: Cast Slow for (Last created unit) to (Level of (Ability being cast) for (Triggering unit))
-
Unit - Order (Last created unit) to Human Sorceress - Slow Spell_Mesmerize_TempUnit
-
Custom script: call RemoveLocation(udg_Spell_Mesmerize_TempPoint[2])
-
-
-
-------- Loop --------
-
Trigger - Turn on Mesmerize2 Loop <gen>
-
-
-
Mesmerize2 Loop
-
Events
-
Time - Every 0.05 seconds of game time
-
-
Conditions
-
Actions
-
Unit Group - Pick every unit in Spell_SongofSiren_Group and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in Spell_SongofSiren_Group) Greater than 0
-
-
Then - Actions
-
Set Spell_Mesmerize_TempUnit = (Picked unit)
-
Set Integer1 = (Player number of (Owner of Spell_Mesmerize_TempUnit))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in Spell_SongofSiren_HitGroup[Integer1]) Greater than 0
-
-
Then - Actions
-
Game - Display to (All players) the text: (String((Number of units in Spell_SongofSiren_HitGroup[Integer1])))
-
Set Spell_Mesmerize_TempPoint[1] = (Position of Spell_Mesmerize_TempUnit)
-
Unit Group - Pick every unit in Spell_SongofSiren_HitGroup[Integer1] and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Picked unit) has buff #Mesmerize ) Equal to True
-
-
Then - Actions
-
Game - Display to (All players) the text: Has buff
-
Set Spell_Mesmerize_TempPoint[2] = (Position of (Picked unit))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Distance between Spell_Mesmerize_TempPoint[1] and Spell_Mesmerize_TempPoint[2]) Greater than or equal to 128.00
-
-
Then - Actions
-
Set Spell_Mesmerize_TempPoint[3] = (Spell_Mesmerize_TempPoint[1] offset by 90.00 towards (Angle from Spell_Mesmerize_TempPoint[1] to Spell_Mesmerize_TempPoint[2]) degrees)
-
Unit - Order (Picked unit) to Move To Spell_Mesmerize_TempPoint[3]
-
Unit - Cause Spell_Mesmerize_TempUnit to damage (Picked unit), dealing 0.01 damage of attack type Spells and damage type Universal
-
Custom script: call RemoveLocation(udg_Spell_Mesmerize_TempPoint[3])
-
-
Else - Actions
-
Unit - Order (Picked unit) to Stop
-
-
-
Custom script: call RemoveLocation(udg_Spell_Mesmerize_TempPoint[2])
-
-
Else - Actions
-
Game - Display to (All players) the text: (Removed + (Name of (Picked unit)))
-
Unit - Order (Picked unit) to Stop
-
Unit Group - Remove (Picked unit) from Spell_SongofSiren_HitGroup[Integer1]
-
-
-
-
-
Custom script: call RemoveLocation(udg_Spell_Mesmerize_TempPoint[1])
-
-
Else - Actions
-
Game - Display to (All players) the text: (String((Number of units in Spell_SongofSiren_HitGroup[Integer1])))
-
Unit - Order Spell_Mesmerize_TempUnit to Stop
-
-
-
Set Spell_Mesmerize_TempUnit = No unit
-
-
Else - Actions
-
Trigger - Turn off (This trigger)
-
-
-
-
-
-
-
Mesmerize2 Stop Cast
-
Events
-
Unit - A unit Stops casting an ability
-
-
Conditions
-
(Ability being cast) Equal to Mesmerize
-
-
Actions
-
Game - Display to (All players) the text: Stop Casting
-
Unit Group - Remove (Triggering unit) from Spell_SongofSiren_Group
-
Unit Group - Remove all units from Spell_SongofSiren_HitGroup[(Player number of (Owner of (Triggering unit)))]
-
Unit Group - Pick every unit in Spell_SongofSiren_HitGroup[(Player number of (Owner of (Triggering unit)))] and do (Actions)
-
Loop - Actions
-
Unit - Remove Effect: Mesmerize: Slow from (Picked unit)
-
Unit - Order (Picked unit) to Stop
-
Unit Group - Remove (Picked unit) from Spell_SongofSiren_HitGroup[(Player number of (Owner of (Triggering unit)))]
-
-
-
Custom script: call DestroyGroup(udg_Spell_SongofSiren_HitGroup[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit() ) ) ] )
-
-