Name | Type | is_array | initial_value |
OB_Caster | unit | No | |
OB_CasterAR | unit | Yes | |
OB_CastInvisibility | abilcode | No | |
OB_CastTeleport | abilcode | No | |
OB_CheckFunc | boolean | Yes | |
OB_DisableAttackAbil | abilcode | No | |
OB_Dur | real | Yes | |
OB_Instance1 | integer | No | |
OB_Instance2 | integer | No | |
OB_InstanceARRAY | integer | Yes | |
OB_InstanceLOOP | integer | No | |
OB_InstanceMAX | integer | No | |
OB_InvisibilityAbil | abilcode | No | |
OB_InvisibilityBaseDuration | real | No | |
OB_InvisibilityDuration | real | No | |
OB_Level | integer | No | |
OB_Loc1 | location | No | |
OB_Loc2 | location | No | |
OB_SfxTeleport | string | No | |
OB_TeleporterAR | unit | Yes | |
OB_TeleporterType | unitcode | No | |
OB_Timer | timer | No | |
OBT_Angle | real | No | |
OBT_Caster | unit | Yes | |
OBT_Check | boolean | Yes | |
OBT_DamagerU | unit | Yes | |
OBT_DummyCasterType | unitcode | No | |
OBT_GroupInvisible | group | No | |
OBT_GroupStun | group | No | |
OBT_Index1 | integer | No | |
OBT_Index2 | integer | No | |
OBT_IndexARRAY | integer | Yes | |
OBT_IndexLOOP | integer | No | |
OBT_IndexMAX | integer | No | |
OBT_Portal | unit | Yes | |
OBT_StunAbil | abilcode | No | |
OBT_StunAndDamAbil | abilcode | No | |
OBT_StunUnitsAoE | real | No | |
OBT_Target | unit | Yes | |
OBT_Timer | timer | No | |
OBT_Waiting | real | Yes |
//TESH.scrollpos=0
//TESH.alwaysfold=0
[COLOR="yellow"][SIZE="3"][B]Spell Name: Obscuration (my entry for ZephyrContest#9)
Description:[/B][/SIZE][/COLOR]
The hero will be invisible but can't attack and use other spells. In this state, he has a sub ability to teleport an enemy ground unit to the caster's position.
The target is invulnerable and can't move when teleported state and stuns nearby enemy units for 5 seconds. After teleporting, 6 firebolts will hit the target, dealing damage and stun.
|cffffcc00Teleport timer:|r 14 seconds or you can use the Obscuration ability to teleport prematurely and disables the Teleport ability.
|cffffcc00Level 1|r - Invisibility lasts 10 seconds, fire damage deals 5 each.
|cffffcc00Level 2|r - Invisibility lasts 15 seconds, fire damage deals 10 each.
|cffffcc00Level 3|r - Invisibility lasts 20 seconds, fire damage deals 15 each.
|cffffcc00Level 4|r - Invisibility lasts 25 seconds, fire damage deals 20 each.
|cffffcc00Level 5|r - Invisibility lasts 30 seconds, fire damage deals 25 each.
[COLOR="yellow"][SIZE="3"][B]Instructions:[/B][/SIZE][/COLOR]
- Be sure to check the [COLOR="Yellow"]Automatically create unknown variables while passing trigger data[/COLOR], via File>Preferences>General tab.
- In the object editor, copy all the custom Unit and Abilities to your map.
- Copy all that is written from the [COLOR="yellow"]Obscuration[/COLOR] folder to your map.
- Be sure to input the right configutation from the [COLOR="Yellow"]Setup[/COLOR] trigger
[COLOR="yellow"][SIZE="3"][B]Triggers:[/B][/SIZE][/COLOR]
[hidden=]
[trigger]
Setup
Events
Map initialization
Conditions
Actions
-------- The invisibility cast --------
Set OB_CastInvisibility = Obscuration
-------- The teleport cast to target --------
Set OB_CastTeleport = Teleport
-------- The invisibility ability, NEVER TOUCH THIS coz this is not a custom abiity --------
Set OB_InvisibilityAbil = Ghost
-------- The invisibility base duration multiplier --------
Set OB_InvisibilityBaseDuration = 5.00
-------- The effect of the teleport --------
Set OB_SfxTeleport = Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
-------- The dummy SFX of the teleport, this is a unit --------
Set OB_TeleporterType = MDX [Teleporter]
-------- This will stun ONLY the enemies in the StunUnitsAoE --------
Set OBT_StunAbil = Stun
-------- This will stun and damage the target after being teleported --------
Set OBT_StunAndDamAbil = Stun and Damage
-------- Disables the attack of the caster once he is invisible --------
Set OB_DisableAttackAbil = Cargo Hold (Orc Burrow)
-------- The dummy caster, in the object editor, the CAST BACKSWING and CAST POINT MUST be 0 --------
-------- Only 1 dummy is created per cast --------
Set OBT_DummyCasterType = DUMMY_CASTER
-------- The stunning AOE of all enemies around the target, this should be less than the CAST RANGE of the STUN ability --------
Set OBT_StunUnitsAoE = 500.00
-------- Preloadings, NEVER TOUCH THIS --------
Set OB_Loc1 = (Random point in (Playable map area))
Unit - Create 1 OB_TeleporterType for Neutral Passive at OB_Loc1 facing Default building facing degrees
Unit - Kill (Last created unit)
Unit - Create 1 OBT_DummyCasterType for Neutral Passive at OB_Loc1 facing Default building facing degrees
Unit - Add OBT_StunAbil to (Last created unit)
Unit - Add OBT_StunAndDamAbil to (Last created unit)
Unit - Add OB_CastTeleport to (Last created unit)
Unit - Add OB_DisableAttackAbil to (Last created unit)
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
Custom script: call RemoveLocation(udg_OB_Loc1)
Custom script: call Preload("Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl")
[/trigger]
[trigger]
Obscuration
Events
Unit - A unit Starts the effect of an ability
Conditions
Or - Any (Conditions) are true
Conditions
(Ability being cast) Equal to OB_CastInvisibility
(Ability being cast) Equal to OB_CastTeleport
Actions
Set OB_Caster = (Triggering unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Ability being cast) Equal to OB_CastInvisibility
Then - Actions
Set OB_Level = (Level of OB_CastInvisibility for OB_Caster)
Custom script: call ExecuteFunc("OB_CastInvisibility")
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Ability being cast) Equal to OB_CastTeleport
Then - Actions
Set OB_Level = (Level of OB_CastTeleport for OB_Caster)
Custom script: call ExecuteFunc("OB_Teleporting")
Else - Actions
Custom script: endfunction
-------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
Custom script: function OB_TeleportingLoop takes nothing returns nothing
For each (Integer OBT_IndexLOOP) from 1 to OBT_Index1, do (Actions)
Loop - Actions
Set OBT_Index2 = OBT_IndexARRAY[OBT_IndexLOOP]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(OBT_Caster[OBT_Index2] is alive) Equal to True
(OBT_Target[OBT_Index2] is alive) Equal to True
(Level of OB_InvisibilityAbil for OBT_Caster[OBT_Index2]) Greater than 0
Then - Actions
Set OBT_Waiting[OBT_Index2] = (OBT_Waiting[OBT_Index2] + 0.20)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
OBT_Waiting[OBT_Index2] Equal to 1.00
Then - Actions
Animation - Play OBT_Portal[OBT_Index2]'s stand animation
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
OBT_Waiting[OBT_Index2] Equal to 4.00
Then - Actions
Set OB_Loc1 = (Position of OBT_Portal[OBT_Index2])
Set OBT_GroupStun = (Units within OBT_StunUnitsAoE of OB_Loc1 matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of OBT_Portal[OBT_Index2])) Equal to True) and (True Equal to True))))
Unit Group - Pick every unit in OBT_GroupStun and do (Actions)
Loop - Actions
Unit - Order OBT_Portal[OBT_Index2] to Neutral - Firebolt (Picked unit)
Custom script: call RemoveLocation(udg_OB_Loc1)
Custom script: call DestroyGroup(udg_OBT_GroupStun)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
OBT_Waiting[OBT_Index2] Equal to 13.00
Then - Actions
Set OB_Loc1 = (Position of OBT_Portal[OBT_Index2])
Special Effect - Create a special effect at OB_Loc1 using OB_SfxTeleport
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation(udg_OB_Loc1)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
OBT_Waiting[OBT_Index2] Equal to 14.00
Then - Actions
Unit - Add a 2.00 second Generic expiration timer to OBT_DamagerU[OBT_Index2]
Unit - Make OBT_Target[OBT_Index2] Vulnerable
Unit - Unpause OBT_Target[OBT_Index2]
Unit - Kill OBT_Portal[OBT_Index2]
Set OB_Loc1 = (Position of OBT_Caster[OBT_Index2])
Special Effect - Create a special effect at OB_Loc1 using OB_SfxTeleport
Special Effect - Destroy (Last created special effect)
Unit - Move OBT_Target[OBT_Index2] instantly to OB_Loc1, facing Default building facing degrees
Custom script: call RemoveLocation(udg_OB_Loc1)
Set OB_Loc1 = (Position of OBT_Target[OBT_Index2])
Set OBT_Angle = 0.00
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Set OB_Loc2 = (OB_Loc1 offset by 500.00 towards OBT_Angle degrees)
Unit - Move OBT_DamagerU[OBT_Index2] instantly to OB_Loc2, facing Default building facing degrees
Unit - Order OBT_DamagerU[OBT_Index2] to Neutral - Firebolt OBT_Target[OBT_Index2]
Set OBT_Angle = (OBT_Angle + 60.00)
Custom script: call RemoveLocation(udg_OB_Loc2)
Custom script: call RemoveLocation(udg_OB_Loc1)
Else - Actions
Else - Actions
Set OBT_Check[OBT_Index2] = True
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
OBT_Waiting[OBT_Index2] Equal to 14.40
OBT_Check[OBT_Index2] Equal to True
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
OBT_Check[OBT_Index2] Equal to True
Then - Actions
Unit - Add a 2.00 second Generic expiration timer to OBT_DamagerU[OBT_Index2]
Unit - Make OBT_Target[OBT_Index2] Vulnerable
Unit - Unpause OBT_Target[OBT_Index2]
Set OB_Loc1 = (Position of OBT_Portal[OBT_Index2])
Special Effect - Create a special effect at OB_Loc1 using OB_SfxTeleport
Special Effect - Destroy (Last created special effect)
Custom script: call RemoveLocation(udg_OB_Loc1)
Unit - Kill OBT_Portal[OBT_Index2]
Set OB_Loc1 = (Position of OBT_Caster[OBT_Index2])
Special Effect - Create a special effect at OB_Loc1 using OB_SfxTeleport
Special Effect - Destroy (Last created special effect)
Unit - Move OBT_Target[OBT_Index2] instantly to OB_Loc1, facing Default building facing degrees
Custom script: call RemoveLocation(udg_OB_Loc1)
Set OB_Loc1 = (Position of OBT_Target[OBT_Index2])
Set OBT_Angle = 0.00
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Set OB_Loc2 = (OB_Loc1 offset by 500.00 towards OBT_Angle degrees)
Unit - Move OBT_DamagerU[OBT_Index2] instantly to OB_Loc2, facing Default building facing degrees
Unit - Order OBT_DamagerU[OBT_Index2] to Neutral - Firebolt OBT_Target[OBT_Index2]
Set OBT_Angle = (OBT_Angle + 60.00)
Custom script: call RemoveLocation(udg_OB_Loc2)
Custom script: call RemoveLocation(udg_OB_Loc1)
Else - Actions
-------- Recycle --------
Set OBT_IndexARRAY[OBT_IndexLOOP] = OBT_IndexARRAY[OBT_Index1]
Set OBT_IndexARRAY[OBT_Index1] = OBT_Index2
Set OBT_IndexLOOP = (OBT_IndexLOOP - 1)
Set OBT_Index1 = (OBT_Index1 - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
OBT_Index1 Equal to 0
Then - Actions
Custom script: call PauseTimer(udg_OBT_Timer)
Else - Actions
Else - Actions
Custom script: endfunction
-------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
Custom script: function OB_Teleporting takes nothing returns nothing
Set OB_Caster = (Triggering unit)
Set OB_Loc1 = (Position of (Target unit of ability being cast))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
OBT_Index1 Equal to 0
Then - Actions
Custom script: call TimerStart(udg_OBT_Timer, 0.2, true, function OB_TeleportingLoop)
Else - Actions
Set OBT_Index1 = (OBT_Index1 + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
OBT_Index1 Greater than OBT_IndexMAX
Then - Actions
Set OBT_IndexARRAY[OBT_Index1] = OBT_Index1
Set OBT_IndexMAX = OBT_Index1
Else - Actions
Set OBT_Index2 = OBT_IndexARRAY[OBT_Index1]
-------- setting all --------
Set OBT_Caster[OBT_Index2] = (Triggering unit)
Set OBT_Target[OBT_Index2] = (Target unit of ability being cast)
Unit - Pause OBT_Target[OBT_Index2]
Unit - Make OBT_Target[OBT_Index2] Invulnerable
Set OBT_Waiting[OBT_Index2] = 0.00
Set OBT_Check[OBT_Index2] = False
-------- adding the teleporter --------
Unit - Create 1 OB_TeleporterType for (Triggering player) at OB_Loc1 facing Default building facing degrees
Set OBT_Portal[OBT_Index2] = (Last created unit)
Custom script: call UnitRemoveAbility(bj_lastCreatedUnit,'Amov')
Animation - Play (Last created unit)'s birth animation
Custom script: call UnitAddAbility(udg_OBT_Portal[udg_OBT_Index2], udg_OBT_StunAbil)
-------- adding the damager --------
Unit - Create 1 OBT_DummyCasterType for (Triggering player) at OB_Loc1 facing Default building facing degrees
Set OBT_DamagerU[OBT_Index2] = (Last created unit)
Unit - Set level of OBT_StunAndDamAbil for OBT_DamagerU[OBT_Index2] to OB_Level
Custom script: call UnitRemoveAbility(bj_lastCreatedUnit,'Amov')
Custom script: call RemoveLocation(udg_OB_Loc1)
Custom script: endfunction
-------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
Custom script: function OB_Looper takes nothing returns nothing
For each (Integer OB_InstanceLOOP) from 1 to OB_Instance1, do (Actions)
Loop - Actions
Set OB_Instance2 = OB_InstanceARRAY[OB_InstanceLOOP]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(OB_CasterAR[OB_Instance2] is alive) Equal to True
OB_Dur[OB_Instance2] Greater than or equal to 0.00
(Level of OB_InvisibilityAbil for OB_CasterAR[OB_Instance2]) Greater than 0
Then - Actions
Set OB_Dur[OB_Instance2] = (OB_Dur[OB_Instance2] - 0.10)
Else - Actions
Unit - Remove OB_InvisibilityAbil from OB_CasterAR[OB_Instance2]
Unit - Remove OB_DisableAttackAbil from OB_CasterAR[OB_Instance2]
Unit - Remove OB_CastTeleport from OB_CasterAR[OB_Instance2]
Unit Group - Remove OB_CasterAR[OB_Instance2] from OBT_GroupInvisible
-------- Recycle --------
Set OB_InstanceARRAY[OB_InstanceLOOP] = OB_InstanceARRAY[OB_Instance1]
Set OB_InstanceARRAY[OB_Instance1] = OB_Instance2
Set OB_InstanceLOOP = (OB_InstanceLOOP - 1)
Set OB_Instance1 = (OB_Instance1 - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
OB_Instance1 Equal to 0
Then - Actions
Custom script: call PauseTimer(udg_OB_Timer)
Else - Actions
Custom script: endfunction
-------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --------
Custom script: function OB_CastInvisibility takes nothing returns nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(OB_Caster is in OBT_GroupInvisible) Equal to False
Then - Actions
Unit - Add OB_InvisibilityAbil to OB_Caster
Unit - Add OB_DisableAttackAbil to OB_Caster
Unit - Add OB_CastTeleport to OB_Caster
Unit - Set level of OB_CastTeleport for OB_Caster to OB_Level
Unit Group - Add OB_Caster to OBT_GroupInvisible
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
OB_Instance1 Equal to 0
Then - Actions
Custom script: call TimerStart(udg_OB_Timer, 0.1, true, function OB_Looper)
Else - Actions
Set OB_Instance1 = (OB_Instance1 + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
OB_Instance1 Greater than OB_InstanceMAX
Then - Actions
Set OB_InstanceARRAY[OB_Instance1] = OB_Instance1
Set OB_InstanceMAX = OB_Instance1
Else - Actions
Set OB_Instance2 = OB_InstanceARRAY[OB_Instance1]
-------- setting all --------
Set OB_CasterAR[OB_Instance2] = OB_Caster
-------- 10/15/20/25/30 --------
Set OB_Dur[OB_Instance2] = (((Real(OB_Level)) x OB_InvisibilityBaseDuration) + 5.00)
Set OB_CheckFunc[OB_Instance2] = True
Else - Actions
Unit - Remove OB_InvisibilityAbil from OB_Caster
Unit - Remove OB_DisableAttackAbil from OB_Caster
Unit - Remove OB_CastTeleport from OB_Caster
Unit Group - Remove OB_Caster from OBT_GroupInvisible
[/trigger]
[trigger]
ObscutationCantUse
Events
Unit - A unit Starts the effect of an ability
Conditions
Or - Any (Conditions) are true
Conditions
(Ability being cast) Not equal to OB_CastInvisibility
(Ability being cast) Not equal to OB_CastTeleport
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Triggering unit) is in OBT_GroupInvisible) Equal to True
Then - Actions
Unit - Order (Triggering unit) to Stop
Else - Actions
[/trigger]
[/hidden]
[hidden=Changelogs]
v1.1
- Added Sfx and Aoe configurations
- Added more information about the configurations
[/hidden]
[youtube=]http://www.youtube.com/watch?v=xdu-X62RBC0&feature=youtu.be[/youtube]