mushroom911
I think I should change my avatar
- Reaction score
- 43
Hi again, for my 0.16 version i was thinking of adding airplanes... but they... kinda work like overpowered choppers atm. so what i want them to be able to do is, that when they attack they continue moving to a random point after they attack.
Heres the trigger im using: i admit it has alot of leaks and is spamming if then else..
anyways it doesnt do anything i want the plane to do except teh atack part... plz help :banghead:
Heres the trigger im using: i admit it has alot of leaks and is spamming if then else..
Code:
Aircraft shooting
Events
Unit - A unit Is attacked
Conditions
(Mana of (Attacking unit)) Not equal to 0.00
(Unit-type of (Attacking unit)) Equal to Mini airplane
Actions
Set attackerloc = (Position of (Attacking unit))
Set Attaim = (Position of (Attacked unit))
Set Attdistance = (Distance between attackerloc and Attaim)
Set randomnumber = (Random real number between 1.00 and 10.00)
Set move2 = (Attaim offset by ((Random real number between -1000.00 and 1000.00), (Random real number between -1000.00 and 1000.00)))
Set Attactualhit = (Attaim offset by ((Random real number between (-0.10 x Attdistance) and (0.10 x Attdistance)), (Random real number between (-0.15 x Attdistance) and (0.15 x Attdistance))))
Unit - Order (Attacking unit) to Move To move2
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Attacked unit) has buff Heavy cover ) Equal to True
Then - Actions
Unit - Cause (Attacking unit) to damage circular area after 0.01 seconds of radius (0.02 x (Attdistance / 2.00)) at Attactualhit, dealing ((Random real number between 400.00 and 1000.00) / (Square root(Attdistance))) damage of attack type Pierce and damage type Divine
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Attacked unit) has buff Medium cover ) Equal to True
Then - Actions
Unit - Cause (Attacking unit) to damage circular area after 0.01 seconds of radius (0.04 x (Attdistance / 2.00)) at Attactualhit, dealing ((Random real number between 400.00 and 1000.00) / (Square root(Attdistance))) damage of attack type Pierce and damage type Divine
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Attacked unit) has buff Light cover ) Equal to True
Then - Actions
Unit - Cause (Attacking unit) to damage circular area after 0.01 seconds of radius (0.06 x (Attdistance / 2.00)) at Attactualhit, dealing ((Random real number between 400.00 and 1000.00) / (Square root(Attdistance))) damage of attack type Pierce and damage type Divine
Else - Actions
Unit - Cause (Attacking unit) to damage circular area after 0.01 seconds of radius (0.10 x (Attdistance / 2.00)) at Attactualhit, dealing ((Random real number between 400.00 and 1000.00) / (Square root(Attdistance))) damage of attack type Pierce and damage type Divine
Special Effect - Create a special effect at Attactualhit using Abilities\Weapons\GyroCopter\GyroCopterImpact.mdl
Special Effect - Destroy (Last created special effect)
Wait 0.10 seconds
Unit - Set mana of (Attacking unit) to ((Mana of (Attacking unit)) - randomnumber)
Wait 7.00 seconds
Unit - Order (Attacking unit) to Attack-Move To (Position of (Attacked unit))
Custom script: call RemoveLocation(udg_attackerloc)
Custom script: call RemoveLocation(udg_Attactualhit)
Custom script: call RemoveLocation(udg_Attaim)