- Joined
- Aug 29, 2004
- Messages
- 159
Hi guys,
This is a custom special ability i have made using triggers(don't want to use JASS).
The effect of the ability is: When you cast the ability (Chaotic Energy) a little ball of energy (Orb of Corruption Model) begins circling around you (Kil'Jaeden) on the sprite attatchment (im not sure if he even has one :? ) You can cast the ability up to three times to get three different energy balls circling around you (all on different sprite attatchments), so the trigger will check how many you have and attatch them accordingly. It also creates a EnergyUnit to follow behind you (its locustified and invisible). WHen an enemy comes within 512 of your hero, then the trigger should register this and univisible one of the EnergyUnits, which moves to the enemy unit and attacks it: because the EnergyUnit has a poisoned attack, this will drain X health per second off the enemy for a minute.
The only problem is i spent an hour writing the trigger and it doesnt work
So can anyone notice any glaring faults in this?:
lol isnt that a lot of trigger? If anyone could be bothered reading through that, and, after reading it understand it (its about as complicated as it looks), any help would be VERY much appreciated.
Thankyou for bothering to read this. I'll give you a cookie if you can find out what's wrong
Bort
This is a custom special ability i have made using triggers(don't want to use JASS).
The effect of the ability is: When you cast the ability (Chaotic Energy) a little ball of energy (Orb of Corruption Model) begins circling around you (Kil'Jaeden) on the sprite attatchment (im not sure if he even has one :? ) You can cast the ability up to three times to get three different energy balls circling around you (all on different sprite attatchments), so the trigger will check how many you have and attatch them accordingly. It also creates a EnergyUnit to follow behind you (its locustified and invisible). WHen an enemy comes within 512 of your hero, then the trigger should register this and univisible one of the EnergyUnits, which moves to the enemy unit and attacks it: because the EnergyUnit has a poisoned attack, this will drain X health per second off the enemy for a minute.
The only problem is i spent an hour writing the trigger and it doesnt work
So can anyone notice any glaring faults in this?:
Code:
Start Energy
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Chaotic Energy (2)
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DChaoticEnergyBalls[(Player number of (Owner of (Casting unit)))] Not equal to 3
Then - Actions
Set DChaoticEnergyCaster[(Player number of (Owner of (Casting unit)))] = (Casting unit)
Set DChaoticEnergyBalls[(Player number of (Owner of (Casting unit)))] = (DChaoticEnergyBalls[(Player number of (Owner of (Casting unit)))] + 1)
If (DChaoticEnergyBalls[(Player number of (Owner of (Casting unit)))] Equal to 1) then do (Special Effect - Create a special effect attached to the sprite + first of (Casting unit) using Abilities\Spells\Items\OrbCorruption\OrbCorruption.mdl) else do (Do nothing)
Set DBallEffect1[(Player number of (Owner of (Casting unit)))] = (Last created special effect)
If (DChaoticEnergyBalls[(Player number of (Owner of (Casting unit)))] Equal to 2) then do (Special Effect - Create a special effect attached to the (sprite + second) of (Casting unit) using Abilities\Spells\Items\OrbCorruption\OrbCorruption.mdl) else do (Do nothing)
Set DBallEffect2[(Player number of (Owner of (Casting unit)))] = (Last created special effect)
If (DChaoticEnergyBalls[(Player number of (Owner of (Casting unit)))] Equal to 3) then do (Special Effect - Create a special effect attached to the (sprite + third) of (Casting unit) using Abilities\Spells\Items\OrbCorruption\OrbCorruption.mdl) else do (Do nothing)
Set DBallEffect3[(Player number of (Owner of (Casting unit)))] = (Last created special effect)
Unit - Create 1 DChaoticEnergyUnit[(Level of Chaotic Energy for (Casting unit))] for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 100.00% transparency
If (DChaoticEnergyBalls[(Player number of (Owner of (Casting unit)))] Equal to 1) then do (Set DEnergyBall1[(Player number of (Owner of (Casting unit)))] = (Last created unit)) else do (Do nothing)
If (DChaoticEnergyBalls[(Player number of (Owner of (Casting unit)))] Equal to 2) then do (Set DEnergyBall2[(Player number of (Owner of (Casting unit)))] = (Last created unit)) else do (Do nothing)
If (DChaoticEnergyBalls[(Player number of (Owner of (Casting unit)))] Equal to 3) then do (Set DEnergyBall3[(Player number of (Owner of (Casting unit)))] = (Last created unit)) else do (Do nothing)
Else - Actions
Do nothing
Code:
Move energy
Events
Time - Every 0.01 seconds of game time
Conditions
Actions
If ((Integer((Distance between (Position of (Triggering unit)) and (Position of (Triggering unit))))) Greater than 0) then do (Unit - Move (Triggering unit) instantly to (Position of (Triggering unit))) else do (Do nothing)
Code:
Energy Variables
Events
Map initialization
Conditions
Actions
Set DChaoticEnergyUnit[1] = Chaotic Energy1
Set DChaoticEnergyUnit[2] = Chaotic Energy2
Set DChaoticEnergyUnit[3] = Chaotic Energy3
Code:
AttackEnergy
Events
Time - Every 0.10 seconds of game time
Conditions
Actions
For each (Integer A) from 1 to 10, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of units in (Units within 512.00 of (Position of DChaoticEnergyCaster[(Player number of (Player((Integer A))))]))) Greater than 0
Then - Actions
Unit Group - Remove all units from DPossTargets[(Player number of (Player((Integer A))))]
Unit Group - Pick every unit in (Units within 512.00 of (Position of DChaoticEnergyCaster[(Player number of (Player((Integer A))))]) matching ((((Matching unit) belongs to an enemy of (Owner of DChaoticEnergyCaster[(Player number of (Player((Integer A))))])) Equal to True) and (((Matching u and do (Actions)
Loop - Actions
Unit Group - Add (Picked unit) to DPossTargets[(Player number of (Player((Integer A))))]
Set DTarget[(Player number of (Player((Integer A))))] = (Random unit from DPossTargets[(Player number of (Player((Integer A))))])
Unit - Order DEnergyBall1[(Player number of (Player((Integer A))))] to Move To (Position of DTarget[(Player number of (Player((Integer A))))])
Wait until ((Integer((Distance between (Position of DEnergyBall1[(Player number of (Player((Integer A))))]) and (Position of DTarget[(Player number of (Player((Integer A))))])))) Less than or equal to 50), checking every 0.10 seconds
Unit - Order DEnergyBall1[(Player number of (Player((Integer A))))] to Attack DTarget[(Player number of (Player((Integer A))))]
Animation - Change DEnergyBall1[(Player number of (Player((Integer A))))]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
Wait 0.10 seconds
Unit - Remove DEnergyBall1[(Player number of (Player((Integer A))))] from the game
For each (Integer A) from 1 to 10, do (Actions)
Loop - Actions
Set DChaoticEnergyBalls[(Integer A)] = (DChaoticEnergyBalls[(Integer A)] - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DChaoticEnergyBalls[(Integer A)] Equal to 2
Then - Actions
Set DEnergyBall1[(Integer A)] = DEnergyBall2[(Integer A)]
Set DEnergyBall2[(Integer A)] = DEnergyBall3[(Integer A)]
Set DEnergyBall3[(Integer A)] = No unit
Special Effect - Destroy DBallEffect1[(Integer A)]
Special Effect - Destroy DBallEffect2[(Integer A)]
If (DChaoticEnergyBalls[(Integer A)] Equal to 1) then do (Special Effect - Create a special effect attached to the (sprite + first) of DChaoticEnergyCaster[(Integer A)] using Abilities\Spells\Items\OrbCorruption\OrbCorruption.mdl) else do (Do nothing)
Set DBallEffect1[(Integer A)] = (Last created special effect)
If (DChaoticEnergyBalls[(Integer A)] Equal to 2) then do (Special Effect - Create a special effect attached to the (sprite + second) of DChaoticEnergyCaster[(Integer A)] using Abilities\Spells\Items\OrbCorruption\OrbCorruption.mdl) else do (Do nothing)
Set DBallEffect2[(Integer A)] = (Last created special effect)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DChaoticEnergyBalls[(Integer A)] Equal to 1
Then - Actions
Set DEnergyBall1[(Integer A)] = DEnergyBall2[(Integer A)]
Set DEnergyBall2[(Integer A)] = No unit
Special Effect - Destroy DBallEffect1[(Integer A)]
If (DChaoticEnergyBalls[(Integer A)] Equal to 1) then do (Special Effect - Create a special effect attached to the (sprite + first) of DChaoticEnergyCaster[(Integer A)] using Abilities\Spells\Items\OrbCorruption\OrbCorruption.mdl) else do (Do nothing)
Set DBallEffect1[(Integer A)] = (Last created special effect)
Else - Actions
Do nothing
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
DChaoticEnergyBalls[(Integer A)] Equal to 0
Then - Actions
Set DEnergyBall1[(Integer A)] = No unit
Else - Actions
Do nothing
Else - Actions
Do nothing
lol isnt that a lot of trigger? If anyone could be bothered reading through that, and, after reading it understand it (its about as complicated as it looks), any help would be VERY much appreciated.
Thankyou for bothering to read this. I'll give you a cookie if you can find out what's wrong
Bort