- Joined
- Apr 24, 2012
- Messages
- 5,113
I need help here.
The Soul Group thing arc doesnt work.The missile remains in the air.
Here is the test map.
View attachment Dark Portal v1.0.w3x
The Soul Group thing arc doesnt work.The missile remains in the air.
[trigger=Init]DP SetUp
Events
Map initialization
Conditions
Actions
Custom script: set udg_DP_Hash = InitHashtable()
-------- Configuration --------
-------- Determines the time for the portal to grow --------
Set DP_PortalGrow = 1.00
-------- Determines the max size the portal can grow --------
Set DP_MaxSize = 200.00
-------- Determines the size interval --------
Set DP_SizeInterval = (DP_MaxSize x 0.03)
-------- Determines the number of AoE Indicator is created after the portal grows --------
Set DP_Sides = 12
-------- Determines the distance between each AoE --------
Set DP_Angles = (360.00 / (Real(DP_Sides)))
-------- Determines the max height the AoEs can go --------
Set DP_AoEMaxHeightX = 0.75
-------- Determines the AoE of the portal --------
Set DP_Radius = 500.00
-------- Determines the speed of the AoEs outwarding --------
Set DP_AoESpeed = (250.00 x 0.03)
-------- Determines the spinning speed of the AoEs --------
Set DP_AoEOrbitSpeed[1] = 180.00
Set DP_AoEOrbitSpeed[2] = (DP_AoEOrbitSpeed[1] x 0.03)
-------- Determines the Lightning model attached to each AoEs --------
Set DP_LModel = CLPB
-------- (Chain Lightning - Primary) --------
-------- Determines the coloration of the lightning --------
Set DP_Red = 1.00
Set DP_Green = 0.00
Set DP_Blue = 1.00
-------- Determines the souls release interval --------
Set DP_Interval = 0.20
-------- Determines the soul number hex --------
Set DP_SoulMin[1] = 1
Set DP_SoulMax[1] = 3
Set DP_SoulMin[2] = 2
Set DP_SoulMax[2] = 4
Set DP_SoulMin[3] = 3
Set DP_SoulMax[3] = 5
-------- Determines the distance hex --------
Set DP_DistanceMin = 0.00
Set DP_DistanceMax = DP_Radius
-------- Determines the arc hex --------
Set DP_ArcMin = 0.25
Set DP_ArcMax = 0.75
-------- Determines the damage dealt by the souls --------
Set DP_SoulDamage[1] = 10.00
Set DP_SoulDamage[2] = 17.50
Set DP_SoulDamage[3] = 25.00
-------- Detemines the duration of the portal effect --------
Set DP_PortalDurationGeneral[1] = 10.00
Set DP_PortalDurationGeneral[2] = 15.00
Set DP_PortalDurationGeneral[3] = 20.00
-------- Determines the time for the AoEs to return --------
Set DP_AoEReturn = 2.00
-------- Determines the Duration of the portal --------
Set DP_PortalDuration[1] = (((DP_PortalGrow + 1.00) + DP_AoEReturn) + DP_PortalDurationGeneral[1])
Set DP_PortalDuration[2] = (((DP_PortalGrow + 1.00) + DP_AoEReturn) + DP_PortalDurationGeneral[2])
Set DP_PortalDuration[3] = (((DP_PortalGrow + 1.00) + DP_AoEReturn) + DP_PortalDurationGeneral[3])
-------- Determines the SFX when the portal dies --------
Set DP_PortalDeathSFx = Objects\Spawnmodels\Undead\UCancelDeath\UCancelDeath.mdl
[/trigger][trigger=Cast]DP Cast
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Dark Portal
Actions
-------- Variables --------
Set DP_Caster = (Triggering unit)
Set DP_TargetLoc = (Target point of ability being cast)
Set DP_Owner = (Triggering player)
Set DP_Levels = (Level of Dark Portal for DP_Caster)
-------- Creating Portal --------
Unit - Create 1 DP Main for DP_Owner at DP_TargetLoc facing Default building facing degrees
Set DP_Portal = (Last created unit)
Custom script: set udg_DP_PortalKey = GetHandleId(udg_DP_Portal)
-------- Adding Duration --------
Unit - Add a DP_PortalDuration[DP_Levels] second Generic expiration timer to DP_Portal
Set DP_Timer = 0.00
Set DP_Stage = 1
-------- Saving Variables --------
Hashtable - Save DP_Timer as 0 of DP_PortalKey in DP_Hash
Hashtable - Save DP_Levels as 1 of DP_PortalKey in DP_Hash
Hashtable - Save Handle OfDP_Owner as 2 of DP_PortalKey in DP_Hash
Hashtable - Save DP_Stage as 3 of DP_PortalKey in DP_Hash
-------- Starting Loop --------
Unit Group - Add DP_Portal to DP_PortalGroup
-------- Cleaning Leaks --------
Custom script: call RemoveLocation(udg_DP_TargetLoc)
[/trigger][trigger=Loop]DP Loop
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in DP_PortalGroup and do (Actions)
Loop - Actions
Set DP_U = (Picked unit)
Custom script: set udg_DP_UKey = GetHandleId(udg_DP_U)
-------- Loading --------
Set DP_Timer = (Load 0 of DP_UKey from DP_Hash)
Set DP_Levels = (Load 1 of DP_UKey from DP_Hash)
Set DP_Owner = (Load 2 of DP_UKey in DP_Hash)
Set DP_Stage = (Load 3 of DP_UKey from DP_Hash)
Set DP_ULoc = (Position of DP_U)
-------- Checking --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(DP_U is alive) Equal to True
Then - Actions
-------- Stage 1 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_Stage Equal to 1
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_Timer Less than DP_PortalGrow
Then - Actions
Set DP_CurrentSize = (Load 4 of DP_UKey from DP_Hash)
-------- Changing Size --------
Animation - Change DP_U's size to (DP_CurrentSize%, DP_CurrentSize%, DP_CurrentSize%) of its original size
-------- Saving --------
Hashtable - Save (DP_CurrentSize + DP_SizeInterval) as 4 of DP_UKey in DP_Hash
Else - Actions
-------- Going to Stage 2 --------
Hashtable - Save 2 as 3 of DP_UKey in DP_Hash
Else - Actions
-------- Stage 2 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_Stage Equal to 2
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_Timer Greater than 2.00
Then - Actions
-------- Creating AoEs --------
For each (Integer A) from 1 to DP_Sides, do (Actions)
Loop - Actions
Unit - Create 1 DP AoE for DP_Owner at DP_ULoc facing Default building facing degrees
Custom script: set udg_DP_AoEKey = GetHandleId(GetLastCreatedUnit())
-------- Creating Lightning Coordinates --------
Custom script: set udg_DP_UX = GetUnitX(udg_DP_U)
Custom script: set udg_DP_UY = GetUnitY(udg_DP_U)
Custom script: set udg_DP_UZ = GetUnitFlyHeight(udg_DP_U)
Custom script: set udg_DP_AoEX = GetUnitX(GetLastCreatedUnit())
Custom script: set udg_DP_AoEY = GetUnitY(GetLastCreatedUnit())
Custom script: set udg_DP_AoEZ = GetUnitFlyHeight(GetLastCreatedUnit())
-------- Creating Lightning --------
Custom script: set udg_DP_Lightning = AddLightningEx(udg_DP_LModel,true,udg_DP_UX,udg_DP_UY,udg_DP_UZ,udg_DP_AoEX,udg_DP_AoEY,udg_DP_AoEZ)
Lightning - Change color of DP_Lightning to (DP_Red DP_Green DP_Blue) with 1.00 alpha
-------- Setting Variables --------
Set DP_AoEStage = 1
Set DP_AoEAngle = ((Real((Integer A))) x DP_Angles)
Set DP_MaxHeight = (DP_Radius x DP_AoEMaxHeightX)
Set DP_CurrentHeight = 0.00
Set DP_AoETimer = 2.00
-------- Saving Variables --------
Hashtable - Save DP_AoEStage as 1 of DP_AoEKey in DP_Hash
Hashtable - Save DP_AoEAngle as 2 of DP_AoEKey in DP_Hash
Hashtable - Save DP_MaxHeight as 3 of DP_AoEKey in DP_Hash
Hashtable - Save DP_CurrentHeight as 4 of DP_AoEKey in DP_Hash
Hashtable - Save Handle OfDP_Lightning as 5 of DP_AoEKey in DP_Hash
Hashtable - Save DP_AoETimer as 6 of DP_AoEKey in DP_Hash
Hashtable - Save Handle OfDP_U as 7 of DP_AoEKey in DP_Hash
Hashtable - Save DP_Levels as 8 of DP_AoEKey in DP_Hash
-------- Starting Loop --------
Unit Group - Add (Last created unit) to DP_AoEGroup
-------- Going to Stage 3 --------
Hashtable - Save 3 as 3 of DP_UKey in DP_Hash
Else - Actions
Else - Actions
-------- Stage 3 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_Stage Equal to 3
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_Timer Less than DP_PortalDurationGeneral[DP_Levels]
Then - Actions
Set DP_Intervals = (Load 5 of DP_UKey from DP_Hash)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_Intervals Greater than DP_Interval
Then - Actions
-------- Creating Souls --------
Set DP_SoulHex = (Random integer number between DP_SoulMin[DP_Levels] and DP_SoulMax[DP_Levels])
For each (Integer A) from 1 to DP_SoulHex, do (Actions)
Loop - Actions
Unit - Create 1 DP Missile for DP_Owner at DP_ULoc facing (Random angle) degrees
Custom script: set udg_DP_MissileKey = GetHandleId(GetLastCreatedUnit())
-------- Setting Variables --------
Set DP_DistanceHex = (Random real number between DP_DistanceMin and DP_DistanceMax)
Set DP_ArcHex = (Random real number between DP_ArcMin and DP_ArcMax)
Set DP_MissileDistance = DP_DistanceHex
Set DP_Arc = (DP_MissileDistance x DP_ArcHex)
Set DP_MissileHeight = 0.00
Set DP_MissileTravelled = 0.00
Set DP_MissileStage = 1
-------- Saving Variables --------
Hashtable - Save DP_MissileDistance as 1 of DP_MissileKey in DP_Hash
Hashtable - Save DP_Arc as 2 of DP_MissileKey in DP_Hash
Hashtable - Save DP_MissileHeight as 3 of DP_MissileKey in DP_Hash
Hashtable - Save DP_Levels as 4 of DP_MissileKey in DP_Hash
Hashtable - Save DP_MissileTravelled as 5 of DP_MissileKey in DP_Hash
Hashtable - Save DP_MissileStage as 6 of DP_MissileTempKey in DP_Hash
-------- Starting Loop --------
Unit Group - Add (Last created unit) to DP_SoulGroup
-------- Saving --------
Hashtable - Save (DP_Intervals x 0.00) as 5 of DP_UKey in DP_Hash
Else - Actions
Hashtable - Save (DP_Intervals + 0.03) as 5 of DP_UKey in DP_Hash
Else - Actions
-------- Going to Stage 4 --------
Hashtable - Save 4 as 3 of DP_UKey in DP_Hash
Else - Actions
-------- Stage 4 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_Stage Equal to 4
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_Timer Less than DP_PortalDuration[DP_Levels]
Then - Actions
Set DP_CurrentSize = (Load 4 of DP_UKey from DP_Hash)
-------- Changing Size --------
Animation - Change DP_U's size to (DP_CurrentSize%, DP_CurrentSize%, DP_CurrentSize%) of its original size
-------- Saving --------
Hashtable - Save (DP_CurrentSize - DP_SizeInterval) as 4 of DP_UKey in DP_Hash
Else - Actions
Else - Actions
Hashtable - Save (DP_Timer + 0.03) as 0 of DP_UKey in DP_Hash
Else - Actions
Hashtable - Clear all child hashtables of child DP_UKey in DP_Hash
Unit Group - Remove DP_U from DP_PortalGroup
Special Effect - Create a special effect at DP_ULoc using DP_PortalDeathSFx
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation(udg_DP_ULoc)
Unit Group - Pick every unit in DP_AoEGroup and do (Actions)
Loop - Actions
Set DP_AoETemp = (Picked unit)
Custom script: set udg_DP_AoETempKey = GetHandleId(udg_DP_AoETemp)
-------- Load --------
Set DP_AoEStage = (Load 1 of DP_AoETempKey from DP_Hash)
Set DP_AoEAngle = (Load 2 of DP_AoETempKey from DP_Hash)
Set DP_Lightning = (Load 5 of DP_AoETempKey in DP_Hash)
Set DP_AoETimer = (Load 6 of DP_AoETempKey from DP_Hash)
Set DP_U = (Load 7 of DP_AoETempKey in DP_Hash)
Set DP_TempLoc = (Position of DP_AoETemp)
Set DP_MaxHeight = (Load 3 of DP_AoETempKey from DP_Hash)
Set DP_CurrentHeight = (Load 4 of DP_AoETempKey from DP_Hash)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_AoETimer Less than DP_PortalDuration[DP_Levels]
Then - Actions
Set DP_AoELoc = (Position of DP_U)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_AoETimer Less than DP_PortalDurationGeneral[DP_Levels]
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_AoEStage Equal to 3
Then - Actions
Set DP_AoEOffset = (DP_AoELoc offset by 500.00 towards DP_AoEAngle degrees)
Else - Actions
Set DP_AoEOffset = (DP_AoELoc offset by ((Distance between DP_AoELoc and DP_TempLoc) + DP_AoESpeed) towards DP_AoEAngle degrees)
Else - Actions
Set DP_AoEOffset = (DP_AoELoc offset by ((Distance between DP_AoELoc and DP_TempLoc) - DP_AoEOrbitSpeed[2]) towards DP_AoEAngle degrees)
-------- Moving Lightning --------
Custom script: set udg_DP_UX = GetUnitX(udg_DP_U)
Custom script: set udg_DP_UY = GetUnitY(udg_DP_U)
Custom script: set udg_DP_UZ = GetUnitFlyHeight(udg_DP_U)
Custom script: set udg_DP_AoEX = GetUnitX(udg_DP_AoETemp)
Custom script: set udg_DP_AoEY = GetUnitY(udg_DP_AoETemp)
Custom script: set udg_DP_AoEZ = GetUnitFlyHeight(udg_DP_AoETemp)
-------- Moving --------
Custom script: call MoveLightningEx(udg_DP_Lightning,true,udg_DP_UX,udg_DP_UY,udg_DP_UZ,udg_DP_AoEX,udg_DP_AoEY,udg_DP_AoEZ)
-------- Stage 1 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_AoEStage Equal to 1
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_CurrentHeight Less than DP_MaxHeight
Then - Actions
-------- Moving Unit --------
Unit - Move DP_AoETemp instantly to DP_AoEOffset
-------- Changing Height --------
Animation - Change DP_AoETemp flying height to DP_CurrentHeight at 0.00
-------- Saving --------
Hashtable - Save (DP_CurrentHeight + (DP_MaxHeight x 0.03)) as 4 of DP_AoETempKey in DP_Hash
Else - Actions
-------- Going to Stage 2 --------
Hashtable - Save 2 as 1 of DP_AoETempKey in DP_Hash
Else - Actions
-------- Stage 2 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_AoEStage Equal to 2
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_CurrentHeight Greater than 0.00
Then - Actions
-------- Moving Unit --------
Unit - Move DP_AoETemp instantly to DP_AoEOffset
-------- Changing Height --------
Animation - Change DP_AoETemp flying height to DP_CurrentHeight at 0.00
-------- Saving --------
Hashtable - Save (DP_CurrentHeight - (DP_MaxHeight x 0.03)) as 4 of DP_AoETempKey in DP_Hash
Else - Actions
-------- Going to Stage 3 --------
Hashtable - Save 3 as 1 of DP_AoETempKey in DP_Hash
Else - Actions
-------- Stage 3 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_AoEStage Equal to 3
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_AoETimer Less than DP_PortalDurationGeneral[DP_Levels]
Then - Actions
-------- Moving Unit --------
Unit - Move DP_AoETemp instantly to DP_AoEOffset
Else - Actions
-------- Going to Stage 4 --------
Hashtable - Save 4 as 1 of DP_AoETempKey in DP_Hash
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_AoEStage Equal to 4
Then - Actions
-------- Moving Unit --------
Unit - Move DP_AoETemp instantly to DP_AoEOffset
Else - Actions
Hashtable - Save (DP_AoEAngle + DP_AoEOrbitSpeed[2]) as 2 of DP_AoETempKey in DP_Hash
Hashtable - Save (DP_AoETimer + 0.03) as 6 of DP_AoETempKey in DP_Hash
-------- Clean Leak --------
Custom script: call RemoveLocation(udg_DP_AoELoc)
Custom script: call RemoveLocation(udg_DP_AoEOffset)
Else - Actions
Unit - Kill DP_AoETemp
Lightning - Destroy DP_Lightning
Hashtable - Clear all child hashtables of child DP_AoETempKey in DP_Hash
Unit Group - Remove DP_AoETemp from DP_AoEGroup
Custom script: call RemoveLocation(udg_DP_TempLoc)
Unit Group - Pick every unit in DP_SoulGroup and do (Actions)
Loop - Actions
Set DP_MissileTemp = (Picked unit)
Custom script: set udg_DP_MissileTempKey = GetHandleId(udg_DP_MissileTemp)
-------- Load --------
Set DP_MissileDistance = (Load 1 of DP_MissileTempKey from DP_Hash)
Set DP_Arc = (Load 2 of DP_MissileTempKey from DP_Hash)
Set DP_MissileHeight = (Load 3 of DP_MissileTempKey from DP_Hash)
Set DP_Levels = (Load 4 of DP_MissileTempKey from DP_Hash)
Set DP_MissileTravelled = (Load 5 of DP_MissileTempKey from DP_Hash)
Set DP_MissileStage = (Load 6 of DP_MissileTempKey from DP_Hash)
-------- Check --------
Set DP_MissileLoc = (Position of DP_MissileTemp)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_MissileTravelled Less than DP_MissileDistance
Then - Actions
Set DP_MissileOffset = (DP_MissileLoc offset by (DP_MissileDistance x 0.03) towards (Facing of DP_MissileTemp) degrees)
-------- Stage 1 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_MissileStage Equal to 1
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_MissileHeight Less than DP_Arc
Then - Actions
-------- Moving Unit --------
Unit - Move DP_MissileTemp instantly to DP_MissileOffset
-------- Changing Height --------
Animation - Change DP_MissileTemp flying height to DP_MissileHeight at 0.00
-------- Saving --------
Hashtable - Save (DP_MissileHeight + (DP_Arc x 0.03)) as 3 of DP_MissileTempKey in DP_Hash
Else - Actions
-------- Going to Stage 2 --------
Hashtable - Save 2 as 6 of DP_MissileTempKey in DP_Hash
Else - Actions
-------- Stage 2 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_MissileStage Equal to 2
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_MissileHeight Greater than 0.00
Then - Actions
-------- Moving Unit --------
Unit - Move DP_MissileTemp instantly to DP_MissileOffset
-------- Changing Height --------
Animation - Change DP_MissileTemp flying height to DP_MissileHeight at 0.00
-------- Saving --------
Hashtable - Save (DP_MissileHeight - (DP_Arc x 0.03)) as 3 of DP_MissileTempKey in DP_Hash
Else - Actions
Unit - Kill DP_MissileTemp
-------- Dealing Damage --------
Set DP_TempGroup = (Units within 50.00 of DP_MissileLoc)
Unit Group - Pick every unit in DP_TempGroup and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
((Picked unit) is A structure) Not equal to True
((Picked unit) is Magic Immune) Not equal to True
((Picked unit) is alive) Equal to True
((Picked unit) belongs to an enemy of (Owner of DP_MissileTemp)) Not equal to True
Then - Actions
Unit - Cause DP_MissileTemp to damage (Picked unit), dealing DP_SoulDamage[DP_Levels] damage of attack type Spells and damage type Normal
Else - Actions
-------- Clean Up --------
Custom script: call DestroyGroup(udg_DP_TempGroup)
Hashtable - Clear all child hashtables of child DP_MissileTempKey in DP_Hash
Unit Group - Remove DP_MissileTemp from DP_SoulGroup
Else - Actions
Custom script: call RemoveLocation(udg_DP_MissileOffset)
Hashtable - Save (DP_MissileTravelled + (DP_MissileDistance x 0.03)) as 5 of DP_MissileTempKey in DP_Hash
Else - Actions
Custom script: call RemoveLocation(udg_DP_MissileLoc)
[/trigger]
Events
Map initialization
Conditions
Actions
Custom script: set udg_DP_Hash = InitHashtable()
-------- Configuration --------
-------- Determines the time for the portal to grow --------
Set DP_PortalGrow = 1.00
-------- Determines the max size the portal can grow --------
Set DP_MaxSize = 200.00
-------- Determines the size interval --------
Set DP_SizeInterval = (DP_MaxSize x 0.03)
-------- Determines the number of AoE Indicator is created after the portal grows --------
Set DP_Sides = 12
-------- Determines the distance between each AoE --------
Set DP_Angles = (360.00 / (Real(DP_Sides)))
-------- Determines the max height the AoEs can go --------
Set DP_AoEMaxHeightX = 0.75
-------- Determines the AoE of the portal --------
Set DP_Radius = 500.00
-------- Determines the speed of the AoEs outwarding --------
Set DP_AoESpeed = (250.00 x 0.03)
-------- Determines the spinning speed of the AoEs --------
Set DP_AoEOrbitSpeed[1] = 180.00
Set DP_AoEOrbitSpeed[2] = (DP_AoEOrbitSpeed[1] x 0.03)
-------- Determines the Lightning model attached to each AoEs --------
Set DP_LModel = CLPB
-------- (Chain Lightning - Primary) --------
-------- Determines the coloration of the lightning --------
Set DP_Red = 1.00
Set DP_Green = 0.00
Set DP_Blue = 1.00
-------- Determines the souls release interval --------
Set DP_Interval = 0.20
-------- Determines the soul number hex --------
Set DP_SoulMin[1] = 1
Set DP_SoulMax[1] = 3
Set DP_SoulMin[2] = 2
Set DP_SoulMax[2] = 4
Set DP_SoulMin[3] = 3
Set DP_SoulMax[3] = 5
-------- Determines the distance hex --------
Set DP_DistanceMin = 0.00
Set DP_DistanceMax = DP_Radius
-------- Determines the arc hex --------
Set DP_ArcMin = 0.25
Set DP_ArcMax = 0.75
-------- Determines the damage dealt by the souls --------
Set DP_SoulDamage[1] = 10.00
Set DP_SoulDamage[2] = 17.50
Set DP_SoulDamage[3] = 25.00
-------- Detemines the duration of the portal effect --------
Set DP_PortalDurationGeneral[1] = 10.00
Set DP_PortalDurationGeneral[2] = 15.00
Set DP_PortalDurationGeneral[3] = 20.00
-------- Determines the time for the AoEs to return --------
Set DP_AoEReturn = 2.00
-------- Determines the Duration of the portal --------
Set DP_PortalDuration[1] = (((DP_PortalGrow + 1.00) + DP_AoEReturn) + DP_PortalDurationGeneral[1])
Set DP_PortalDuration[2] = (((DP_PortalGrow + 1.00) + DP_AoEReturn) + DP_PortalDurationGeneral[2])
Set DP_PortalDuration[3] = (((DP_PortalGrow + 1.00) + DP_AoEReturn) + DP_PortalDurationGeneral[3])
-------- Determines the SFX when the portal dies --------
Set DP_PortalDeathSFx = Objects\Spawnmodels\Undead\UCancelDeath\UCancelDeath.mdl
[/trigger][trigger=Cast]DP Cast
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Dark Portal
Actions
-------- Variables --------
Set DP_Caster = (Triggering unit)
Set DP_TargetLoc = (Target point of ability being cast)
Set DP_Owner = (Triggering player)
Set DP_Levels = (Level of Dark Portal for DP_Caster)
-------- Creating Portal --------
Unit - Create 1 DP Main for DP_Owner at DP_TargetLoc facing Default building facing degrees
Set DP_Portal = (Last created unit)
Custom script: set udg_DP_PortalKey = GetHandleId(udg_DP_Portal)
-------- Adding Duration --------
Unit - Add a DP_PortalDuration[DP_Levels] second Generic expiration timer to DP_Portal
Set DP_Timer = 0.00
Set DP_Stage = 1
-------- Saving Variables --------
Hashtable - Save DP_Timer as 0 of DP_PortalKey in DP_Hash
Hashtable - Save DP_Levels as 1 of DP_PortalKey in DP_Hash
Hashtable - Save Handle OfDP_Owner as 2 of DP_PortalKey in DP_Hash
Hashtable - Save DP_Stage as 3 of DP_PortalKey in DP_Hash
-------- Starting Loop --------
Unit Group - Add DP_Portal to DP_PortalGroup
-------- Cleaning Leaks --------
Custom script: call RemoveLocation(udg_DP_TargetLoc)
[/trigger][trigger=Loop]DP Loop
Events
Time - Every 0.03 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in DP_PortalGroup and do (Actions)
Loop - Actions
Set DP_U = (Picked unit)
Custom script: set udg_DP_UKey = GetHandleId(udg_DP_U)
-------- Loading --------
Set DP_Timer = (Load 0 of DP_UKey from DP_Hash)
Set DP_Levels = (Load 1 of DP_UKey from DP_Hash)
Set DP_Owner = (Load 2 of DP_UKey in DP_Hash)
Set DP_Stage = (Load 3 of DP_UKey from DP_Hash)
Set DP_ULoc = (Position of DP_U)
-------- Checking --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(DP_U is alive) Equal to True
Then - Actions
-------- Stage 1 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_Stage Equal to 1
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_Timer Less than DP_PortalGrow
Then - Actions
Set DP_CurrentSize = (Load 4 of DP_UKey from DP_Hash)
-------- Changing Size --------
Animation - Change DP_U's size to (DP_CurrentSize%, DP_CurrentSize%, DP_CurrentSize%) of its original size
-------- Saving --------
Hashtable - Save (DP_CurrentSize + DP_SizeInterval) as 4 of DP_UKey in DP_Hash
Else - Actions
-------- Going to Stage 2 --------
Hashtable - Save 2 as 3 of DP_UKey in DP_Hash
Else - Actions
-------- Stage 2 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_Stage Equal to 2
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_Timer Greater than 2.00
Then - Actions
-------- Creating AoEs --------
For each (Integer A) from 1 to DP_Sides, do (Actions)
Loop - Actions
Unit - Create 1 DP AoE for DP_Owner at DP_ULoc facing Default building facing degrees
Custom script: set udg_DP_AoEKey = GetHandleId(GetLastCreatedUnit())
-------- Creating Lightning Coordinates --------
Custom script: set udg_DP_UX = GetUnitX(udg_DP_U)
Custom script: set udg_DP_UY = GetUnitY(udg_DP_U)
Custom script: set udg_DP_UZ = GetUnitFlyHeight(udg_DP_U)
Custom script: set udg_DP_AoEX = GetUnitX(GetLastCreatedUnit())
Custom script: set udg_DP_AoEY = GetUnitY(GetLastCreatedUnit())
Custom script: set udg_DP_AoEZ = GetUnitFlyHeight(GetLastCreatedUnit())
-------- Creating Lightning --------
Custom script: set udg_DP_Lightning = AddLightningEx(udg_DP_LModel,true,udg_DP_UX,udg_DP_UY,udg_DP_UZ,udg_DP_AoEX,udg_DP_AoEY,udg_DP_AoEZ)
Lightning - Change color of DP_Lightning to (DP_Red DP_Green DP_Blue) with 1.00 alpha
-------- Setting Variables --------
Set DP_AoEStage = 1
Set DP_AoEAngle = ((Real((Integer A))) x DP_Angles)
Set DP_MaxHeight = (DP_Radius x DP_AoEMaxHeightX)
Set DP_CurrentHeight = 0.00
Set DP_AoETimer = 2.00
-------- Saving Variables --------
Hashtable - Save DP_AoEStage as 1 of DP_AoEKey in DP_Hash
Hashtable - Save DP_AoEAngle as 2 of DP_AoEKey in DP_Hash
Hashtable - Save DP_MaxHeight as 3 of DP_AoEKey in DP_Hash
Hashtable - Save DP_CurrentHeight as 4 of DP_AoEKey in DP_Hash
Hashtable - Save Handle OfDP_Lightning as 5 of DP_AoEKey in DP_Hash
Hashtable - Save DP_AoETimer as 6 of DP_AoEKey in DP_Hash
Hashtable - Save Handle OfDP_U as 7 of DP_AoEKey in DP_Hash
Hashtable - Save DP_Levels as 8 of DP_AoEKey in DP_Hash
-------- Starting Loop --------
Unit Group - Add (Last created unit) to DP_AoEGroup
-------- Going to Stage 3 --------
Hashtable - Save 3 as 3 of DP_UKey in DP_Hash
Else - Actions
Else - Actions
-------- Stage 3 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_Stage Equal to 3
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_Timer Less than DP_PortalDurationGeneral[DP_Levels]
Then - Actions
Set DP_Intervals = (Load 5 of DP_UKey from DP_Hash)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_Intervals Greater than DP_Interval
Then - Actions
-------- Creating Souls --------
Set DP_SoulHex = (Random integer number between DP_SoulMin[DP_Levels] and DP_SoulMax[DP_Levels])
For each (Integer A) from 1 to DP_SoulHex, do (Actions)
Loop - Actions
Unit - Create 1 DP Missile for DP_Owner at DP_ULoc facing (Random angle) degrees
Custom script: set udg_DP_MissileKey = GetHandleId(GetLastCreatedUnit())
-------- Setting Variables --------
Set DP_DistanceHex = (Random real number between DP_DistanceMin and DP_DistanceMax)
Set DP_ArcHex = (Random real number between DP_ArcMin and DP_ArcMax)
Set DP_MissileDistance = DP_DistanceHex
Set DP_Arc = (DP_MissileDistance x DP_ArcHex)
Set DP_MissileHeight = 0.00
Set DP_MissileTravelled = 0.00
Set DP_MissileStage = 1
-------- Saving Variables --------
Hashtable - Save DP_MissileDistance as 1 of DP_MissileKey in DP_Hash
Hashtable - Save DP_Arc as 2 of DP_MissileKey in DP_Hash
Hashtable - Save DP_MissileHeight as 3 of DP_MissileKey in DP_Hash
Hashtable - Save DP_Levels as 4 of DP_MissileKey in DP_Hash
Hashtable - Save DP_MissileTravelled as 5 of DP_MissileKey in DP_Hash
Hashtable - Save DP_MissileStage as 6 of DP_MissileTempKey in DP_Hash
-------- Starting Loop --------
Unit Group - Add (Last created unit) to DP_SoulGroup
-------- Saving --------
Hashtable - Save (DP_Intervals x 0.00) as 5 of DP_UKey in DP_Hash
Else - Actions
Hashtable - Save (DP_Intervals + 0.03) as 5 of DP_UKey in DP_Hash
Else - Actions
-------- Going to Stage 4 --------
Hashtable - Save 4 as 3 of DP_UKey in DP_Hash
Else - Actions
-------- Stage 4 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_Stage Equal to 4
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_Timer Less than DP_PortalDuration[DP_Levels]
Then - Actions
Set DP_CurrentSize = (Load 4 of DP_UKey from DP_Hash)
-------- Changing Size --------
Animation - Change DP_U's size to (DP_CurrentSize%, DP_CurrentSize%, DP_CurrentSize%) of its original size
-------- Saving --------
Hashtable - Save (DP_CurrentSize - DP_SizeInterval) as 4 of DP_UKey in DP_Hash
Else - Actions
Else - Actions
Hashtable - Save (DP_Timer + 0.03) as 0 of DP_UKey in DP_Hash
Else - Actions
Hashtable - Clear all child hashtables of child DP_UKey in DP_Hash
Unit Group - Remove DP_U from DP_PortalGroup
Special Effect - Create a special effect at DP_ULoc using DP_PortalDeathSFx
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation(udg_DP_ULoc)
Unit Group - Pick every unit in DP_AoEGroup and do (Actions)
Loop - Actions
Set DP_AoETemp = (Picked unit)
Custom script: set udg_DP_AoETempKey = GetHandleId(udg_DP_AoETemp)
-------- Load --------
Set DP_AoEStage = (Load 1 of DP_AoETempKey from DP_Hash)
Set DP_AoEAngle = (Load 2 of DP_AoETempKey from DP_Hash)
Set DP_Lightning = (Load 5 of DP_AoETempKey in DP_Hash)
Set DP_AoETimer = (Load 6 of DP_AoETempKey from DP_Hash)
Set DP_U = (Load 7 of DP_AoETempKey in DP_Hash)
Set DP_TempLoc = (Position of DP_AoETemp)
Set DP_MaxHeight = (Load 3 of DP_AoETempKey from DP_Hash)
Set DP_CurrentHeight = (Load 4 of DP_AoETempKey from DP_Hash)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_AoETimer Less than DP_PortalDuration[DP_Levels]
Then - Actions
Set DP_AoELoc = (Position of DP_U)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_AoETimer Less than DP_PortalDurationGeneral[DP_Levels]
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_AoEStage Equal to 3
Then - Actions
Set DP_AoEOffset = (DP_AoELoc offset by 500.00 towards DP_AoEAngle degrees)
Else - Actions
Set DP_AoEOffset = (DP_AoELoc offset by ((Distance between DP_AoELoc and DP_TempLoc) + DP_AoESpeed) towards DP_AoEAngle degrees)
Else - Actions
Set DP_AoEOffset = (DP_AoELoc offset by ((Distance between DP_AoELoc and DP_TempLoc) - DP_AoEOrbitSpeed[2]) towards DP_AoEAngle degrees)
-------- Moving Lightning --------
Custom script: set udg_DP_UX = GetUnitX(udg_DP_U)
Custom script: set udg_DP_UY = GetUnitY(udg_DP_U)
Custom script: set udg_DP_UZ = GetUnitFlyHeight(udg_DP_U)
Custom script: set udg_DP_AoEX = GetUnitX(udg_DP_AoETemp)
Custom script: set udg_DP_AoEY = GetUnitY(udg_DP_AoETemp)
Custom script: set udg_DP_AoEZ = GetUnitFlyHeight(udg_DP_AoETemp)
-------- Moving --------
Custom script: call MoveLightningEx(udg_DP_Lightning,true,udg_DP_UX,udg_DP_UY,udg_DP_UZ,udg_DP_AoEX,udg_DP_AoEY,udg_DP_AoEZ)
-------- Stage 1 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_AoEStage Equal to 1
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_CurrentHeight Less than DP_MaxHeight
Then - Actions
-------- Moving Unit --------
Unit - Move DP_AoETemp instantly to DP_AoEOffset
-------- Changing Height --------
Animation - Change DP_AoETemp flying height to DP_CurrentHeight at 0.00
-------- Saving --------
Hashtable - Save (DP_CurrentHeight + (DP_MaxHeight x 0.03)) as 4 of DP_AoETempKey in DP_Hash
Else - Actions
-------- Going to Stage 2 --------
Hashtable - Save 2 as 1 of DP_AoETempKey in DP_Hash
Else - Actions
-------- Stage 2 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_AoEStage Equal to 2
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_CurrentHeight Greater than 0.00
Then - Actions
-------- Moving Unit --------
Unit - Move DP_AoETemp instantly to DP_AoEOffset
-------- Changing Height --------
Animation - Change DP_AoETemp flying height to DP_CurrentHeight at 0.00
-------- Saving --------
Hashtable - Save (DP_CurrentHeight - (DP_MaxHeight x 0.03)) as 4 of DP_AoETempKey in DP_Hash
Else - Actions
-------- Going to Stage 3 --------
Hashtable - Save 3 as 1 of DP_AoETempKey in DP_Hash
Else - Actions
-------- Stage 3 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_AoEStage Equal to 3
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_AoETimer Less than DP_PortalDurationGeneral[DP_Levels]
Then - Actions
-------- Moving Unit --------
Unit - Move DP_AoETemp instantly to DP_AoEOffset
Else - Actions
-------- Going to Stage 4 --------
Hashtable - Save 4 as 1 of DP_AoETempKey in DP_Hash
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_AoEStage Equal to 4
Then - Actions
-------- Moving Unit --------
Unit - Move DP_AoETemp instantly to DP_AoEOffset
Else - Actions
Hashtable - Save (DP_AoEAngle + DP_AoEOrbitSpeed[2]) as 2 of DP_AoETempKey in DP_Hash
Hashtable - Save (DP_AoETimer + 0.03) as 6 of DP_AoETempKey in DP_Hash
-------- Clean Leak --------
Custom script: call RemoveLocation(udg_DP_AoELoc)
Custom script: call RemoveLocation(udg_DP_AoEOffset)
Else - Actions
Unit - Kill DP_AoETemp
Lightning - Destroy DP_Lightning
Hashtable - Clear all child hashtables of child DP_AoETempKey in DP_Hash
Unit Group - Remove DP_AoETemp from DP_AoEGroup
Custom script: call RemoveLocation(udg_DP_TempLoc)
Unit Group - Pick every unit in DP_SoulGroup and do (Actions)
Loop - Actions
Set DP_MissileTemp = (Picked unit)
Custom script: set udg_DP_MissileTempKey = GetHandleId(udg_DP_MissileTemp)
-------- Load --------
Set DP_MissileDistance = (Load 1 of DP_MissileTempKey from DP_Hash)
Set DP_Arc = (Load 2 of DP_MissileTempKey from DP_Hash)
Set DP_MissileHeight = (Load 3 of DP_MissileTempKey from DP_Hash)
Set DP_Levels = (Load 4 of DP_MissileTempKey from DP_Hash)
Set DP_MissileTravelled = (Load 5 of DP_MissileTempKey from DP_Hash)
Set DP_MissileStage = (Load 6 of DP_MissileTempKey from DP_Hash)
-------- Check --------
Set DP_MissileLoc = (Position of DP_MissileTemp)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_MissileTravelled Less than DP_MissileDistance
Then - Actions
Set DP_MissileOffset = (DP_MissileLoc offset by (DP_MissileDistance x 0.03) towards (Facing of DP_MissileTemp) degrees)
-------- Stage 1 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_MissileStage Equal to 1
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_MissileHeight Less than DP_Arc
Then - Actions
-------- Moving Unit --------
Unit - Move DP_MissileTemp instantly to DP_MissileOffset
-------- Changing Height --------
Animation - Change DP_MissileTemp flying height to DP_MissileHeight at 0.00
-------- Saving --------
Hashtable - Save (DP_MissileHeight + (DP_Arc x 0.03)) as 3 of DP_MissileTempKey in DP_Hash
Else - Actions
-------- Going to Stage 2 --------
Hashtable - Save 2 as 6 of DP_MissileTempKey in DP_Hash
Else - Actions
-------- Stage 2 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_MissileStage Equal to 2
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DP_MissileHeight Greater than 0.00
Then - Actions
-------- Moving Unit --------
Unit - Move DP_MissileTemp instantly to DP_MissileOffset
-------- Changing Height --------
Animation - Change DP_MissileTemp flying height to DP_MissileHeight at 0.00
-------- Saving --------
Hashtable - Save (DP_MissileHeight - (DP_Arc x 0.03)) as 3 of DP_MissileTempKey in DP_Hash
Else - Actions
Unit - Kill DP_MissileTemp
-------- Dealing Damage --------
Set DP_TempGroup = (Units within 50.00 of DP_MissileLoc)
Unit Group - Pick every unit in DP_TempGroup and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
((Picked unit) is A structure) Not equal to True
((Picked unit) is Magic Immune) Not equal to True
((Picked unit) is alive) Equal to True
((Picked unit) belongs to an enemy of (Owner of DP_MissileTemp)) Not equal to True
Then - Actions
Unit - Cause DP_MissileTemp to damage (Picked unit), dealing DP_SoulDamage[DP_Levels] damage of attack type Spells and damage type Normal
Else - Actions
-------- Clean Up --------
Custom script: call DestroyGroup(udg_DP_TempGroup)
Hashtable - Clear all child hashtables of child DP_MissileTempKey in DP_Hash
Unit Group - Remove DP_MissileTemp from DP_SoulGroup
Else - Actions
Custom script: call RemoveLocation(udg_DP_MissileOffset)
Hashtable - Save (DP_MissileTravelled + (DP_MissileDistance x 0.03)) as 5 of DP_MissileTempKey in DP_Hash
Else - Actions
Custom script: call RemoveLocation(udg_DP_MissileLoc)
[/trigger]
Here is the test map.
View attachment Dark Portal v1.0.w3x