Moderator
M
Moderator
12:31, 8th Nov 2012
Magtheridon96: Approved.
This is very well-coded, short and sweet!
Good job mate
Magtheridon96: Approved.
This is very well-coded, short and sweet!
Good job mate
Arcane Judgement Configuration

Events


Map initialization

Conditions

Actions


-------- -------- --------


-------- Condition Configuration --------


-------- Unit is a ground unit --------


Set AJ_ConditionConfig[0] = True


-------- Unit is a structure --------


Set AJ_ConditionConfig[1] = False


-------- Unit is magic immune --------


Set AJ_ConditionConfig[2] = False


-------- Unit belongs to an enemy player --------


Set AJ_ConditionConfig[3] = True


-------- Unit is alive --------


Set AJ_ConditionConfig[4] = True


-------- Determines the area that will be effected by the spell --------


Set AJ_DetonationAOE = 90.00


Set AJ_AOEAccount = 50.00


Set AJ_AoeBase = 350.00


Set AJ_AoePerLevel = 100.00


-------- Determines the number of charges based on number of targets --------


Set AJ_ChargesPerTargetBase = 5


Set AJ_ChargesPerTargetPerLevel = 1


-------- Determines the target controls --------


Set AJ_TargetMaxBase = 6


Set AJ_TargetMaxPerLevel = 2


-------- Determines the damage done by the blast --------


Set AJ_DetonationDamageBase = 25.00


Set AJ_DetonationDamagePerLevel = 25.00


Set AJ_ChargeDamageBase = 10.00


Set AJ_ChargeDamagePerLevel = 5.00


-------- Determines the movement speed of the sphere --------


Set AJ_SphereSpeed = 6.00


-------- Determines how fast the Charges Spin around --------


Set AJ_ChargeSpinSpeed = 5.00


-------- Determines how far the Charges are from the Sphere --------


Set AJ_ChargeDistance = 50.00


-------- Determines how long the Sphere will last chasing its target --------


Set AJ_SphereDurationBase = 5.00


Set AJ_SphereDurationBasePerLevel = 1.00


-------- Determines how long the dummies will remain after their usefulness has ended --------


Set AJ_EffectDeathDuration = 1.20


-------- Determines the scaling of the Sphere and its SFX --------


Set AJ_EffectScalingSpheres = 100.00


Set AJ_EffectScalingSpawn = 100.00


Set AJ_EffectScalingDetonation = 125.00


Set AJ_EffectScalingCharges = 30.00


-------- Determines the Height given to the effects --------


Set AJ_EffectZSpheres = 100.00


Set AJ_EffectZCharges = 150.00


Set AJ_EffectZSpawn = 0.00


Set AJ_EffectZDetonation = 0.00


-------- Determines the unit model used as the Sphere --------


Set AJ_SphereSFX = units\nightelf\Wisp\Wisp.mdl


-------- Determines the model used for the revolving charges --------


Set AJ_ChargeSFX = units\nightelf\Wisp\Wisp.mdl


-------- Determines the unit model used as the casting effect --------


Set AJ_SpawnSFX = Abilities\Spells\NightElf\Taunt\TauntCaster.mdl


-------- Determines the SFX used upon detonation --------


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


-------- Determines the spell used to act as the activation spell --------


Set AJ_Spell = Arcane Judgement


-------- Determines the Dummy used to attach all the effects to --------


Set AJ_DummyType = Arcane Judgement Dummy
Arcane Judgement Activation

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to AJ_Spell

Actions


Set AJ_Caster = (Triggering unit)


Set AJ_TempPoint = (Position of AJ_Caster)


Set AJ_TempInteger2 = (Level of AJ_Spell for AJ_Caster)


Set AJ_TempReal = (Real(AJ_TempInteger2))


Set AJ_TempPlayer = (Owner of AJ_Caster)


Unit - Create 1 AJ_DummyType for Neutral Passive at AJ_TempPoint facing Default building facing degrees


Set AJ_TempUnit = (Last created unit)


Special Effect - Create a special effect attached to the origin of AJ_TempUnit using AJ_SpawnSFX


Animation - Change AJ_TempUnit's size to (AJ_EffectScalingSpawn%, 0.00%, 0.00%) of its original size


Animation - Change AJ_TempUnit flying height to AJ_EffectZSpawn at 0.00


Special Effect - Destroy (Last created special effect)


Unit - Add a AJ_EffectDeathDuration second Generic expiration timer to AJ_TempUnit


Set AJ_TempGroup = (Units within (AJ_AoeBase + (AJ_AoePerLevel x AJ_TempReal)) of AJ_TempPoint)


Unit Group - Pick every unit in AJ_TempGroup and do (Actions)



Loop - Actions




Set AJ_TempUnit = (Picked unit)




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





If - Conditions






(AJ_TempUnit is A ground unit) Equal to AJ_ConditionConfig[0]






(AJ_TempUnit is A structure) Equal to AJ_ConditionConfig[1]






(AJ_TempUnit is Magic Immune) Equal to AJ_ConditionConfig[2]






(AJ_TempUnit belongs to an enemy of AJ_TempPlayer) Equal to AJ_ConditionConfig[3]






(AJ_TempUnit is alive) Equal to AJ_ConditionConfig[4]





Then - Actions






Unit Group - Add AJ_TempUnit to AJ_Targets





Else - Actions


Set AJ_TempInteger = (Number of units in AJ_Targets)


Set AJ_ChargesCount = (AJ_TempInteger / (AJ_ChargesPerTargetBase - (AJ_ChargesPerTargetPerLevel x AJ_TempInteger2)))


Set AJ_TempInteger3 = (AJ_TargetMaxBase + (AJ_TargetMaxPerLevel x AJ_TempInteger))


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



If - Conditions




AJ_TempInteger Greater than AJ_TempInteger3



Then - Actions




Set AJ_TempInteger = AJ_TempInteger3



Else - Actions


Custom script: call DestroyGroup(udg_AJ_TempGroup)


For each (Integer AJ_Index) from 1 to AJ_TempInteger, do (Actions)



Loop - Actions




Unit - Create 1 AJ_DummyType for Neutral Passive at AJ_TempPoint facing Default building facing degrees




Set AJ_TempUnit = (Last created unit)




Set AJ_MaxIndex = (AJ_MaxIndex + 1)




Special Effect - Create a special effect attached to the origin of AJ_TempUnit using AJ_SphereSFX




Set AJ_SpecialEffect[AJ_MaxIndex] = (Last created special effect)




Animation - Change AJ_TempUnit's size to (AJ_EffectScalingSpheres%, 0.00%, 0.00%) of its original size




Animation - Change AJ_TempUnit flying height to AJ_EffectZSpheres at 0.00




Unit - Add a (AJ_SphereDurationBase + (AJ_SphereDurationBasePerLevel x AJ_TempReal)) second Generic expiration timer to AJ_TempUnit




Set AJ_TempUnit2 = (Random unit from AJ_Targets)




Set AJ_Target[AJ_MaxIndex] = AJ_TempUnit2




Set AJ_OriginalCaster[AJ_MaxIndex] = AJ_Caster




Set AJ_OwningPlayer[AJ_MaxIndex] = AJ_TempPlayer




Set AJ_Core[AJ_MaxIndex] = AJ_TempUnit




Set AJ_DetonationDamage[AJ_MaxIndex] = ((AJ_DetonationDamageBase + (AJ_DetonationDamagePerLevel x AJ_TempReal)) + ((Real(AJ_ChargesCount)) x (AJ_ChargeDamageBase + (AJ_ChargeDamagePerLevel x AJ_TempReal))))




Set AJ_CurrentAngle[AJ_MaxIndex] = AJ_Angle




Set AJ_UnitIndex[AJ_MaxIndex] = AJ_TempUnit




Set AJ_StageID[AJ_MaxIndex] = 1




Set AJ_Angle = 0.00




Unit Group - Remove AJ_TempUnit2 from AJ_Targets




-------- --------




-------- --------




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





If - Conditions






AJ_MaxIndex Equal to 1





Then - Actions






Trigger - Turn on Arcane Judgement Loop <gen>





Else - Actions




For each (Integer AJ_SecondaryIndex) from 1 to AJ_ChargesCount, do (Actions)





Loop - Actions






Set AJ_Angle = (AJ_Angle + (360.00 / (Real(AJ_ChargesCount))))






Set AJ_TempPoint2 = (AJ_TempPoint offset by AJ_ChargeDistance towards AJ_Angle degrees)






Set AJ_MaxIndex = (AJ_MaxIndex + 1)






Unit - Create 1 AJ_DummyType for Neutral Passive at AJ_TempPoint facing Default building facing degrees






Set AJ_TempUnit2 = (Last created unit)






Special Effect - Create a special effect attached to the origin of AJ_TempUnit2 using AJ_ChargeSFX






Set AJ_SpecialEffect[AJ_MaxIndex] = (Last created special effect)






Animation - Change AJ_TempUnit2's size to (AJ_EffectScalingCharges%, 0.00%, 0.00%) of its original size






Animation - Change AJ_TempUnit2 flying height to AJ_EffectZCharges at 0.00






Set AJ_Core[AJ_MaxIndex] = AJ_TempUnit






Set AJ_StageID[AJ_MaxIndex] = 2






Set AJ_CurrentAngle[AJ_MaxIndex] = AJ_Angle






Set AJ_UnitIndex[AJ_MaxIndex] = AJ_TempUnit2






-------- --------






Set AJ_Target[AJ_MaxIndex] = AJ_TempUnit2






Set AJ_OriginalCaster[AJ_MaxIndex] = AJ_Caster






Set AJ_OwningPlayer[AJ_MaxIndex] = AJ_TempPlayer






Set AJ_DetonationDamage[AJ_MaxIndex] = 0.00






-------- --------






Custom script: call RemoveLocation (udg_AJ_TempPoint2)


Custom script: call RemoveLocation (udg_AJ_TempPoint)


Unit Group - Remove all units from AJ_Targets
Arcane Judgement Loop

Events


Time - Every 0.03 seconds of game time

Conditions

Actions


For each (Integer AJ_Index) from 1 to AJ_MaxIndex, do (Actions)



Loop - Actions




Set AJ_Angle = 0.00




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





If - Conditions






AJ_StageID[AJ_Index] Equal to 1





Then - Actions






Custom script: set udg_AJ_TempX = GetUnitX(udg_AJ_UnitIndex[udg_AJ_Index])






Custom script: set udg_AJ_TempY = GetUnitY(udg_AJ_UnitIndex[udg_AJ_Index])






Custom script: set udg_AJ_Angle = Atan2(GetUnitY(udg_AJ_Target[udg_AJ_Index]) - udg_AJ_TempY, GetUnitX(udg_AJ_Target[udg_AJ_Index]) - udg_AJ_TempX)






Custom script: call SetUnitX(udg_AJ_UnitIndex[udg_AJ_Index], udg_AJ_TempX + udg_AJ_SphereSpeed * Cos(udg_AJ_Angle))






Custom script: call SetUnitY(udg_AJ_UnitIndex[udg_AJ_Index], udg_AJ_TempY + udg_AJ_SphereSpeed * Sin(udg_AJ_Angle))






Set AJ_TempPoint = (Position of AJ_UnitIndex[AJ_Index])






Set AJ_TempPoint2 = (Position of AJ_Target[AJ_Index])






Set AJ_TempReal = (Distance between AJ_TempPoint and AJ_TempPoint2)






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







If - Conditions








Or - Any (Conditions) are true









Conditions










AJ_TempReal Less than or equal to (AJ_DetonationAOE - AJ_AOEAccount)










(AJ_Target[AJ_Index] is dead) Equal to True







Then - Actions








Unit - Kill AJ_UnitIndex[AJ_Index]







Else - Actions






Custom script: call RemoveLocation(udg_AJ_TempPoint2)






Set AJ_TempUnit = AJ_UnitIndex[AJ_Index]






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







If - Conditions








(AJ_TempUnit is dead) Equal to True







Then - Actions








Set AJ_TempGroup = (Units within AJ_DetonationAOE of AJ_TempPoint)








Unit Group - Pick every unit in AJ_TempGroup and do (Actions)









Loop - Actions










Set AJ_TempUnit2 = (Picked unit)










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











If - Conditions












(AJ_TempUnit2 is A ground unit) Equal to AJ_ConditionConfig[0]












(AJ_TempUnit2 is A structure) Equal to AJ_ConditionConfig[1]












(AJ_TempUnit2 is Magic Immune) Equal to AJ_ConditionConfig[2]












(AJ_TempUnit2 belongs to an enemy of AJ_TempPlayer) Equal to AJ_ConditionConfig[3]












(AJ_TempUnit2 is alive) Equal to AJ_ConditionConfig[4]











Then - Actions












Unit - Cause AJ_OriginalCaster[AJ_Index] to damage AJ_TempUnit2, dealing AJ_DetonationDamage[AJ_Index] damage of attack type Spells and damage type Normal











Else - Actions








Custom script: call DestroyGroup(udg_AJ_TempGroup)








For each (Integer AJ_SecondaryIndex) from 1 to AJ_MaxIndex, do (Actions)









Loop - Actions










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











If - Conditions












AJ_Core[AJ_SecondaryIndex] Equal to AJ_TempUnit












AJ_UnitIndex[AJ_SecondaryIndex] Not equal to AJ_TempUnit











Then - Actions












Set AJ_TempUnit2 = AJ_UnitIndex[AJ_SecondaryIndex]












Special Effect - Destroy AJ_SpecialEffect[AJ_SecondaryIndex]












Set AJ_Target[AJ_SecondaryIndex] = AJ_Target[AJ_MaxIndex]












Set AJ_OriginalCaster[AJ_SecondaryIndex] = AJ_OriginalCaster[AJ_MaxIndex]












Set AJ_OwningPlayer[AJ_SecondaryIndex] = AJ_OwningPlayer[AJ_MaxIndex]












Set AJ_Core[AJ_SecondaryIndex] = AJ_Core[AJ_MaxIndex]












Set AJ_SpecialEffect[AJ_SecondaryIndex] = AJ_SpecialEffect[AJ_MaxIndex]












Set AJ_DetonationDamage[AJ_SecondaryIndex] = AJ_DetonationDamage[AJ_MaxIndex]












Set AJ_CurrentAngle[AJ_SecondaryIndex] = AJ_CurrentAngle[AJ_MaxIndex]












Set AJ_UnitIndex[AJ_SecondaryIndex] = AJ_UnitIndex[AJ_MaxIndex]












Set AJ_StageID[AJ_SecondaryIndex] = AJ_StageID[AJ_MaxIndex]












Set AJ_MaxIndex = (AJ_MaxIndex - 1)












Set AJ_SecondaryIndex = (AJ_SecondaryIndex - 1)












Unit - Remove AJ_TempUnit2 from the game











Else - Actions








Special Effect - Destroy AJ_SpecialEffect[AJ_Index]








Set AJ_Target[AJ_Index] = AJ_Target[AJ_MaxIndex]








Set AJ_OriginalCaster[AJ_Index] = AJ_OriginalCaster[AJ_MaxIndex]








Set AJ_OwningPlayer[AJ_Index] = AJ_OwningPlayer[AJ_MaxIndex]








Set AJ_Core[AJ_Index] = AJ_Core[AJ_MaxIndex]








Set AJ_SpecialEffect[AJ_Index] = AJ_SpecialEffect[AJ_MaxIndex]








Set AJ_DetonationDamage[AJ_Index] = AJ_DetonationDamage[AJ_MaxIndex]








Set AJ_CurrentAngle[AJ_Index] = AJ_CurrentAngle[AJ_MaxIndex]








Set AJ_UnitIndex[AJ_Index] = AJ_UnitIndex[AJ_MaxIndex]








Set AJ_StageID[AJ_Index] = AJ_StageID[AJ_MaxIndex]








Set AJ_MaxIndex = (AJ_MaxIndex - 1)








Set AJ_Index = (AJ_Index - 1)








Unit - Remove AJ_TempUnit from the game








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









If - Conditions










AJ_MaxIndex Equal to 0









Then - Actions










Trigger - Turn off Arcane Judgement Loop <gen>









Else - Actions








Unit - Create 1 AJ_DummyType for Neutral Passive at AJ_TempPoint facing Default building facing degrees








Set AJ_TempUnit2 = (Last created unit)








Special Effect - Create a special effect attached to the origin of AJ_TempUnit2 using AJ_DetonationSFX








Animation - Change AJ_TempUnit2's size to (AJ_EffectScalingDetonation%, 0.00%, 0.00%) of its original size








Animation - Change AJ_TempUnit2 flying height to AJ_EffectZDetonation at 0.00








Special Effect - Destroy (Last created special effect)








Unit - Add a AJ_EffectDeathDuration second Generic expiration timer to AJ_TempUnit2







Else - Actions






Custom script: call RemoveLocation(udg_AJ_TempPoint)





Else - Actions






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







If - Conditions








AJ_StageID[AJ_Index] Equal to 2







Then - Actions








Custom script: set udg_AJ_TempX = GetUnitX(udg_AJ_Core[udg_AJ_Index])








Custom script: set udg_AJ_TempY = GetUnitY(udg_AJ_Core[udg_AJ_Index])








Set AJ_CurrentAngle[AJ_Index] = (AJ_CurrentAngle[AJ_Index] + AJ_ChargeSpinSpeed)








Custom script: set udg_AJ_Angle = udg_AJ_CurrentAngle[udg_AJ_Index] * bj_DEGTORAD








Custom script: call SetUnitX(udg_AJ_UnitIndex[udg_AJ_Index], udg_AJ_TempX + udg_AJ_ChargeDistance * Cos(udg_AJ_Angle))








Custom script: call SetUnitY(udg_AJ_UnitIndex[udg_AJ_Index], udg_AJ_TempY + udg_AJ_ChargeDistance * Sin(udg_AJ_Angle))







Else - Actions
Arcane Judgement Dummy Removal

Events


Unit - A unit Dies

Conditions

Actions


Set AJ_TempUnit = (Triggering unit)


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



If - Conditions




(Unit-type of AJ_TempUnit) Equal to AJ_DummyType



Then - Actions




Unit - Remove AJ_TempUnit from the game



Else - Actions