Tom_Kazansky
--- wraith it ! ---
- Reaction score
- 157
Warp Field
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Warps space time arround the caster, creating a barrier through which enemies cannot pass, but friendly units can.
All enemy units within the barrier when this spell is cast are forced out. While the Warp Field is active you have vision of it.
Also damage enemies.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Warps space time arround the caster, creating a barrier through which enemies cannot pass, but friendly units can.
All enemy units within the barrier when this spell is cast are forced out. While the Warp Field is active you have vision of it.
Also damage enemies.
- MUI: Yes
- GUI/JASS: GUI
- Leakless: Yes (I think)
- Lagless: I think it has lags but not too much
A spell I saw at theHive (Warp Field by Cromatycha) but Cromatycha's triggering is not good, and the effect is rather fun and cool, so I decide to remake it and also, someone request me to do it
- Screenshot:
- Code
Trigger:- WarpField Init
- Events
- Map initialization
- Conditions
- Actions
- -------- set the number of dummies --------
- -------- recommended 18 --------
- Set WarpField_NumberDummies = 18
- -------- push speed, because we use 0.025s timer, the PushSpeed must be only equal to 0.025 x of actual speed --------
- Set WarpField_PushSpeed = 15.00
- Events
Trigger:- WarpField Cast
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Warp Field
- Actions
- Set TempUnit = (Triggering unit)
- Set WarpField_InsCount = (WarpField_InsCount + 1)
- Set WarpField_Caster[WarpField_InsCount] = TempUnit
- Set WarpField_Pos[WarpField_InsCount] = (Position of TempUnit)
- -------- 10 seconds duration + 1 duration of fade in/out => 11 seconds total --------
- -------- 11 seconds / 0.025s timer = 440 ticks --------
- Set WarpField_Tick[WarpField_InsCount] = 440
- Set WarpField_TotalTick[WarpField_InsCount] = 440
- -------- damage per second --------
- Set WarpField_Damage[WarpField_InsCount] = (50.00 + (50.00 x (Real((Level of Warp Field for TempUnit)))))
- -------- set damage to zero to disable damaging --------
- -------- damage per 0.025s --------
- Set WarpField_Damage[WarpField_InsCount] = (WarpField_Damage[WarpField_InsCount] / 40.00)
- Custom script: set udg_WarpField_Dummies[udg_WarpField_InsCount] = CreateGroup()
- For each (Integer TempInt) from 1 to WarpField_NumberDummies, do (Actions)
- Loop - Actions
- Unit - Create 1 Dummy - Warp Field for (Owner of TempUnit) at WarpField_Pos[WarpField_InsCount] facing ((Real(TempInt)) x (360.00 / (Real(WarpField_NumberDummies)))) degrees
- Set TempUnit2 = (Last created unit)
- Unit Group - Add TempUnit2 to WarpField_Dummies[WarpField_InsCount]
- Unit - Add Crow Form to TempUnit2
- Unit - Remove Crow Form from TempUnit2
- Animation - Change TempUnit2 flying height to 65.00 at 0.00
- Animation - Play TempUnit2's Birth animation
- Animation - Queue TempUnit2's Stand animation
- Animation - Change TempUnit2's animation speed to 180.00% of its original speed
- Loop - Actions
- -------- we have to use Custom Script (JASS) for MUI sound --------
- Custom script: set udg_WarpField_Sound[udg_WarpField_InsCount] = CreateSound( "Abilities\\Spells\\Human\\CloudOfFog\\CloudOfFogLoop1.wav", true, true, false, 100, 100, "SpellsEAX" )
- Sound - Play WarpField_Sound[WarpField_InsCount] at 100.00% volume, located at WarpField_Pos[WarpField_InsCount] with Z offset 0.00
- Events
Trigger:- WarpField Act
- Events
- Time - Every (1.00 / 40.00) seconds of game time
- Conditions
- Actions
- For each (Integer WarpField_Looper) from 1 to WarpField_InsCount, do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- WarpField_Tick[WarpField_Looper] Greater than 0
- Then - Actions
- -------- animating --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- WarpField_Tick[WarpField_Looper] Equal to (WarpField_TotalTick[WarpField_Looper] - 20)
- Then - Actions
- Unit Group - Pick every unit in WarpField_Dummies[WarpField_Looper] and do (Actions)
- Loop - Actions
- Set TempUnit = (Picked unit)
- Animation - Change TempUnit's animation speed to 100.00% of its original speed
- Animation - Play TempUnit's Stand animation
- Loop - Actions
- Destructible - Pick every destructible within 500.00 of WarpField_Pos[WarpField_Looper] and do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Max life of (Picked destructible)) Equal to 50.00
- Then - Actions
- Destructible - Kill (Picked destructible)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- Unit Group - Pick every unit in WarpField_Dummies[WarpField_Looper] and do (Actions)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- WarpField_Tick[WarpField_Looper] Equal to 20
- Then - Actions
- Unit Group - Pick every unit in WarpField_Dummies[WarpField_Looper] and do (Actions)
- Loop - Actions
- Set TempUnit = (Picked unit)
- Animation - Change TempUnit's animation speed to 350.00% of its original speed
- Animation - Play TempUnit's Death animation
- Loop - Actions
- Unit Group - Pick every unit in WarpField_Dummies[WarpField_Looper] and do (Actions)
- Else - Actions
- If - Conditions
- -------- Fade In --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- WarpField_Tick[WarpField_Looper] Greater than or equal to (WarpField_TotalTick[WarpField_Looper] - 20)
- Then - Actions
- Unit Group - Pick every unit in WarpField_Dummies[WarpField_Looper] and do (Actions)
- Loop - Actions
- Set TempUnit = (Picked unit)
- Animation - Change TempUnit's vertex coloring to (100.00%, 100.00%, 100.00%) with (5.00 x (Real((20 - (WarpField_TotalTick[WarpField_Looper] - WarpField_Tick[WarpField_Looper])))))% transparency
- Loop - Actions
- Unit Group - Pick every unit in WarpField_Dummies[WarpField_Looper] and do (Actions)
- Else - Actions
- If - Conditions
- -------- Warping --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- WarpField_Tick[WarpField_Looper] Less than (WarpField_TotalTick[WarpField_Looper] - 20)
- WarpField_Tick[WarpField_Looper] Greater than 20
- Then - Actions
- Set TempGroup = (Units within 435.00 of WarpField_Pos[WarpField_Looper] matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of WarpField_Caster[WarpField_Looper])) Equ
- Unit Group - Pick every unit in TempGroup and do (Actions)
- Loop - Actions
- Set TempUnit = (Picked unit)
- Set TempLoc = (Position of TempUnit)
- Set TempLoc2 = (TempLoc offset by WarpField_PushSpeed towards (Angle from WarpField_Pos[WarpField_Looper] to TempLoc) degrees)
- -------- check pathing --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Terrain pathing at TempLoc2 of type Walkability is off) Equal to True
- Then - Actions
- -------- cannot move --------
- -------- this move unit action will interrupt unit's order --------
- Unit - Move TempUnit instantly to TempLoc2
- Else - Actions
- -------- can move --------
- -------- these two don't interrupt unit's order --------
- Custom script: call SetUnitX( udg_TempUnit, GetLocationX(udg_TempLoc2 ) )
- Custom script: call SetUnitY( udg_TempUnit, GetLocationY(udg_TempLoc2 ) )
- If - Conditions
- -------- --- --------
- Special Effect - Create a special effect at TempLoc2 using Abilities\Spells\Undead\AbsorbMana\AbsorbManaBirthMissile.mdl
- Special Effect - Destroy (Last created special effect)
- Custom script: call RemoveLocation( udg_TempLoc )
- Custom script: call RemoveLocation( udg_TempLoc2 )
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- WarpField_Damage[WarpField_Looper] Greater than 0.00
- Then - Actions
- Unit - Cause WarpField_Caster[WarpField_Looper] to damage TempUnit, dealing WarpField_Damage[WarpField_Looper] damage of attack type Spells and damage type Magic
- Else - Actions
- If - Conditions
- Loop - Actions
- Custom script: call DestroyGroup( udg_TempGroup )
- Else - Actions
- If - Conditions
- -------- Fade Out --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- WarpField_Tick[WarpField_Looper] Less than or equal to 20
- Then - Actions
- Unit Group - Pick every unit in WarpField_Dummies[WarpField_Looper] and do (Actions)
- Loop - Actions
- Set TempUnit = (Picked unit)
- Animation - Change TempUnit's vertex coloring to (100.00%, 100.00%, 100.00%) with (5.00 x (Real(WarpField_Tick[WarpField_Looper])))% transparency
- Loop - Actions
- Unit Group - Pick every unit in WarpField_Dummies[WarpField_Looper] and do (Actions)
- Else - Actions
- If - Conditions
- -------- --- --------
- Set WarpField_Tick[WarpField_Looper] = (WarpField_Tick[WarpField_Looper] - 1)
- Else - Actions
- Unit Group - Pick every unit in WarpField_Dummies[WarpField_Looper] and do (Actions)
- Loop - Actions
- Unit - Remove (Picked unit) from the game
- Loop - Actions
- Custom script: call RemoveLocation( udg_WarpField_Pos[udg_WarpField_Looper] )
- Custom script: call DestroyGroup( udg_WarpField_Dummies[udg_WarpField_Looper] )
- Sound - Stop WarpField_Sound[WarpField_Looper] After fading
- Sound - Destroy WarpField_Sound[WarpField_Looper]
- Set WarpField_Caster[WarpField_Looper] = WarpField_Caster[WarpField_InsCount]
- Set WarpField_Dummies[WarpField_Looper] = WarpField_Dummies[WarpField_InsCount]
- Set WarpField_Sound[WarpField_Looper] = WarpField_Sound[WarpField_InsCount]
- Set WarpField_Pos[WarpField_Looper] = WarpField_Pos[WarpField_InsCount]
- Set WarpField_Tick[WarpField_Looper] = WarpField_Tick[WarpField_InsCount]
- Set WarpField_TotalTick[WarpField_Looper] = WarpField_TotalTick[WarpField_InsCount]
- Set WarpField_InsCount = (WarpField_InsCount - 1)
- -------- -- --------
- Set WarpField_Looper = (WarpField_Looper - 1)
- Unit Group - Pick every unit in WarpField_Dummies[WarpField_Looper] and do (Actions)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- For each (Integer WarpField_Looper) from 1 to WarpField_InsCount, do (Actions)
- Events
- WarpField Init
- Readme
How to import:
- Copy ability: Warp Field (A000)
- Copy triggers: WarpField Init, WarpField Cast, WarpField Act.
Remember to check: File \ Preferences \ General \ Automatically create unknown variables while pasting trigger data
Modification:
- Change WarpField_Tick for the duration of the spell
- Change WarpField_Damage for the damage of the spell
- Change WarpField_PushSpeed for the pushing speed of the spell
- Change WarpField_NumberDummies for the number of dummy units
Note:
- You can set 'Initial Value' for "WarpField_NumberDummies" and "WarpField_PushSpeed" so you wont need trigger WarpField Init
Credit:
- Thank Cromatycha for the idea.
EDIT: first update: fix a leak and timer duration
Attachments
-
337.7 KB Views: 1,928
-
51 KB Views: 549