- Joined
- Mar 30, 2009
- Messages
- 256
hi.
well i tried to make a GUI spell on my own... yeah i pretty much suck at triggering but i just wanted to create something for public...
so i though: "hey make a spellpack" ... ^^
i beg you guys to look through my code, and help me to optimize it (since i know its pretty shitty coded)
also look at it ingame please.
Edit: fixed the leaks... someone may know how to improve the sfx? (i made it with the region.. i think it kinda sucks...)
i will give rep and credits...
im glad to learn
well i tried to make a GUI spell on my own... yeah i pretty much suck at triggering but i just wanted to create something for public...
so i though: "hey make a spellpack" ... ^^
i beg you guys to look through my code, and help me to optimize it (since i know its pretty shitty coded)
also look at it ingame please.
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to Freezing Area
-
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
FA_i1 Less than or equal to 0
-
-
Then - Actions
-
Trigger - Turn on Freezing Area loop <gen>
-
-
Else - Actions
-
-
-------- ------------------------------ Setups ------------------------------ --------
-
Set FA_i1 = (FA_i1 + 1)
-
Set FA_i2 = (FA_i2 + 1)
-
Set FA_Caster[FA_i2] = (Triggering unit)
-
-------- -------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
-
-------- ------------------------------ Sets the Damage dealt per second ------------------------------ --------
-
Set FA_DamagePerSecond[FA_i2] = (10.00 x (Real((Level of (Ability being cast) for FA_Caster[FA_i2]))))
-
-------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
-
-------- ------------------------------ How long should the spell last? set it here! ------------------------------ --------
-
Set FA_SpellDuration[FA_i2] = (7.00 x (Real((Level of (Ability being cast) for FA_Caster[FA_i2]))))
-
-------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- --------
-
Set FA_LoopOn[FA_i2] = True
-
-
Events
-
Time - Every 0.05 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer FA_i3) from 1 to FA_i2, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
FA_LoopOn[FA_i3] Equal to True
-
-
Then - Actions
-
Set FA_WaitCounter[FA_i3] = (FA_WaitCounter[FA_i3] + 0.05)
-
Set FA_WaitCounter_2[FA_i3] = (FA_WaitCounter_2[FA_i3] + 0.05)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
FA_WaitCounter[FA_i3] Less than or equal to FA_SpellDuration[FA_i3]
-
-
Then - Actions
-
Set FA_PointIndex[FA_i3] = (Position of FA_Caster[FA_i3])
-
-------- ------------------------------ Clearing Leaks ------------------------------ --------
-
Custom script: set bj_wantDestroyGroup = true
-
-------- ------------------------------------------------------------------------------------------------------ --------
-
-------- ------------------------------ Damage ------------------------------ --------
-
-------- ------------------------------------------------------------------------------------------------------ --------
-
-------- ------------------------------ Slowing Dummies ------------------------------ --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
FA_WaitCounter_2[FA_i3] Greater than or equal to 1.00
-
-
Then - Actions
-
Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units within 800.00 of FA_PointIndex[FA_i3] matching ((((Matching unit) belongs to an enemy of (Owner of FA_Caster[FA_i3])) Equal to True) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((((Matching and do (Actions)
-
Loop - Actions
-
Unit - Cause FA_Caster[FA_i3] to damage (Picked unit), dealing FA_DamagePerSecond[FA_i3] damage of attack type Spells and damage type Normal
-
Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Weapons\FrostWyrmMissile\FrostWyrmMissile.mdl
-
Special Effect - Destroy (Last created special effect)
-
Unit - Create 1 FA_Dummy for (Owner of FA_Caster[FA_i3]) at FA_PointIndex[FA_i3] facing Default building facing (270.0) degrees
-
Unit - Order (Last created unit) to Attack (Picked unit)
-
Unit - Add a 0.75 second Generic expiration timer to (Last created unit)
-
Custom script: call RemoveLocation(udg_FA_PointIndex[udg_FA_i3])
-
Set FA_WaitCounter_2[FA_i3] = 0.00
-
-
-
-
Else - Actions
-
-
-------- ------------------------------------------------------------------------------------------------------ --------
-
For each (Integer FA_i4) from 1 to 3, do (Actions)
-
Loop - Actions
-
Set FA_PointIndex[FA_i3] = (Position of FA_Caster[FA_i3])
-
Set FA_Region[FA_i3] = (Rect centered at FA_PointIndex[FA_i3] with size (800.00, 800.00))
-
Set FA_PointIndex[FA_i4] = (Random point in FA_Region[FA_i3])
-
Special Effect - Create a special effect at FA_PointIndex[FA_i4] using Abilities\Spells\Undead\FrostArmor\FrostArmorDamage.mdl
-
Special Effect - Destroy (Last created special effect)
-
Custom script: call RemoveLocation(udg_FA_PointIndex[udg_FA_i3])
-
Custom script: call RemoveRect (udg_FA_Region[udg_FA_i3])
-
-
-
-
Else - Actions
-
Custom script: call RemoveLocation(udg_FA_PointIndex[udg_FA_i3])
-
Set FA_WaitCounter[FA_i3] = 0.00
-
Set FA_LoopOn[FA_i3] = False
-
Set FA_i1 = (FA_i1 - 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
FA_i1 Less than or equal to 0
-
-
Then - Actions
-
Set FA_i2 = 0
-
Trigger - Turn off (This trigger)
-
-
Else - Actions
-
-
-
-
-
Else - Actions
-
-
-
-
i will give rep and credits...
im glad to learn
Attachments
Last edited: