Moderator
M
Moderator
Energy Field 1.02 | Reviewed by Maker | 21st Aug 2013 | ||||
| APPROVED | ||||
|
Configuration

Events


Map initialization

Conditions

Actions


-------- How large the AOE is --------


Set EF_AOE = 520.00


-------- The maximum distance from the target point the energies emanate --------


Set EF_MaxDistance = (EF_AOE / 2.00)


-------- The minimum distance from the target point the energies emanate --------


Set EF_MinDistance = (EF_AOE / 4.00)


-------- The release effect --------


Set EF_ReleaseEffect = Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl


-------- The ability --------


Set EF_Ability = Energy Field


-------- How long after cast does the ability take effect --------


Set EF_CastDelay = 0.75


-------- How large the damage AOE per energy damages enemies. --------


Set EF_DamageArea = 250.00


-------- How much damage per level --------


-------- Note that a unit can be damage multiple times --------


Set EF_Damage[1] = 30.00


Set EF_Damage[2] = 40.00


Set EF_Damage[3] = 50.00


Set EF_Damage[4] = 60.00


-------- How long the spell lasts per level --------


Set EF_Duration[1] = 3.35


Set EF_Duration[2] = 4.10


Set EF_Duration[3] = 4.85


Set EF_Duration[4] = 5.60


-------- The effect of the Energies --------


Set EF_EffectModel = Objects\Spawnmodels\NightElf\NEDeathSmall\NEDeathSmall.mdl


-------- The size of the effect (%) --------


Set EF_Size = 85.00


-------- The color of the effect (RGB, the fourth one being transparency[%]) --------


Set EF_Color[1] = 100.00


Set EF_Color[2] = 100.00


Set EF_Color[3] = 100.00


Set EF_Color[4] = 0.00


-------- Attack and damage types --------


Set EF_AttackType = Spells


Set EF_DamageType = Force
Energy Field

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to EF_Ability

Actions


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




EF_Integer Equal to 0



Then - Actions




Trigger - Turn on Energy Field Loop <gen>



Else - Actions


Set EF_Integer = (EF_Integer + 1)


Set EF_Caster[EF_Integer] = (Triggering unit)


Set EF_Level[EF_Integer] = (Level of EF_Ability for EF_Caster[EF_Integer])


Set EF_Player[EF_Integer] = (Owner of EF_Caster[EF_Integer])


Set EF_TargetPoint[EF_Integer] = (Target point of ability being cast)


Set EF_Time[EF_Integer] = EF_CastDelay


Set EF_Energies[EF_Integer] = ((EF_Duration[EF_Level[EF_Integer]] - EF_CastDelay) / 0.15)
Energy Field Loop

Events


Time - Every 0.15 seconds of game time

Conditions

Actions


For each (Integer TempIndex) from 1 to EF_Integer, do (Actions)



Loop - Actions




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






EF_Time[TempIndex] Greater than 0.00





Then - Actions






Set EF_Time[TempIndex] = (EF_Time[TempIndex] - 0.15)





Else - Actions






If (All Conditions are True) then do (Then Actions) else do (Else Actions)







If - Conditions








EF_Energies[TempIndex] Greater than 0.00







Then - Actions








-------- Do not tinker with this if you don't know what you're doing --------








Set EF_Energies[TempIndex] = (EF_Energies[TempIndex] - 1.00)








Set TempReal = (Random real number between EF_MinDistance and EF_MaxDistance)








-------- Region --------








Set TempPoint = (EF_TargetPoint[TempIndex] offset by (Random real number between EF_MinDistance and EF_MaxDistance) towards (Random angle) degrees)








-------- The energy --------








Unit - Create 1 Dummy for EF_Player[TempIndex] at TempPoint facing Default building facing degrees








Set TempUnit = (Last created unit)








Special Effect - Create a special effect attached to the chest of TempUnit using EF_EffectModel








Special Effect - Destroy (Last created special effect)








Special Effect - Create a special effect attached to the chest of TempUnit using EF_ReleaseEffect








Special Effect - Destroy (Last created special effect)








Animation - Change TempUnit's size to (EF_Size%, 0.00%, 0.00%) of its original size








Animation - Change TempUnit's vertex coloring to (EF_Color[1]%, EF_Color[2]%, EF_Color[3]%) with EF_Color[4]% transparency








Unit - Add Energy Field (Dummy) to TempUnit








-------- Damage Group --------








Custom script: set bj_wantDestroyGroup = true








Unit Group - Pick every unit in (Units within EF_DamageArea of TempPoint) and do (Actions)









Loop - Actions










Custom script: set udg_TempTarget = GetEnumUnit()










If (All Conditions are True) then do (Then Actions) else do (Else Actions)











If - Conditions












(TempTarget is alive) Equal to True












(TempTarget is Magic Immune) Equal to False












(TempTarget belongs to an enemy of EF_Player[TempIndex]) Equal to True











Then - Actions












Unit - Order TempUnit to Neutral - Hurl Boulder TempTarget












Unit - Cause EF_Caster[TempIndex] to damage TempTarget, dealing EF_Damage[EF_Level[TempIndex]] damage of attack type EF_AttackType and damage type EF_DamageType











Else - Actions










Custom script: set udg_TempTarget = null








Custom script: set udg_TempUnit = null








Custom script: call RemoveLocation(udg_TempPoint)







Else - Actions








-------- Nulling and recycling of variables --------








Set EF_Caster[TempIndex] = EF_Caster[EF_Integer]








Custom script: set udg_EF_Caster[udg_EF_Integer] = null








Set EF_Level[TempIndex] = EF_Level[EF_Integer]








Custom script: call RemoveLocation(udg_EF_TargetPoint[udg_TempIndex])








Set EF_TargetPoint[TempIndex] = EF_TargetPoint[EF_Index]








Set EF_Level[TempIndex] = EF_Level[EF_Integer]








Set EF_Time[TempIndex] = EF_Time[EF_Integer]








Set EF_Integer = (EF_Integer - 1)








Set TempIndex = (TempIndex - 1)








-------- Turn off Trigger --------








If (All Conditions are True) then do (Then Actions) else do (Else Actions)









If - Conditions










EF_Integer Less than or equal to 0









Then - Actions










Trigger - Turn off (This trigger)









Else - Actions