ok, im making a map and the idea is:all movement is arrow keys, there are 3-4 units (so far) each unit has triggered attacks (a melee, missile, homing missile) and the aim is to kill the enemies. iv done the melee but im stuck on the missile, here is my triggeres:
the problems are: sometimes the projectile will just die randomly, it deals tooo much damage. what its supposed to do: create a projectile that moves forward from the caster for 4 seconds, if an enemy unit is in a certain range of the projectil it makes the caster deal 55 damage and the projectile dies. if it doesn't hit a unit in 4 seconds it dies.
any and all help is appreciated
Trigger:
- Missile atk
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Holy Lance
- Actions
- Set caster_holylance = (Casting unit)
- Unit - Create 1 Holy lance missie for (Owner of caster_holylance) at (Position of caster_holylance) facing (Facing of caster_holylance) degrees
- Special Effect - Create a special effect attached to the origin of dummy_holylance using Abilities\Weapons\BloodElfMissile\BloodElfMissile.mdl
- Set dummy_holylance = (Last created unit)
- Trigger - Turn on misile atk periodic <gen>
- Wait 4.00 seconds
- Unit - Kill dummy_holylance
- Trigger - Turn off misile atk periodic <gen>
- Events
Trigger:
- misile atk periodic
- Events
- Time - Every 0.04 seconds of game time
- Conditions
- Actions
- Set damage_holylance = (Units within 100.00 of (Position of dummy_holylance) matching ((((Matching unit) belongs to an enemy of (Owner of dummy_holylance)) Equal to True) and ((((Matching unit) has buff Acid Bomb) Equal to False) and (((Matching unit) is alive) Equal to True))))
- Unit - Move dummy_holylance instantly to ((Position of dummy_holylance) offset by 30.00 towards (Facing of dummy_holylance) degrees), facing (Facing of dummy_holylance) degrees
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Number of units in damage_holylance) Greater than 0
- Then - Actions
- Unit Group - Pick every unit in damage_holylance and do (Actions)
- Loop - Actions
- Unit - Cause caster_holylance to damage (Picked unit), dealing 55.00 damage of attack type Pierce and damage type Normal
- Unit - Kill dummy_holylance
- Custom script: call DestroyGroup( udg_damage_holylance )
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Number of units in damage_holylance) Less than 1
- Then - Actions
- Custom script: call DestroyGroup( udg_damage_holylance )
- Else - Actions
- If - Conditions
- Unit Group - Pick every unit in damage_holylance and do (Actions)
- Else - Actions
- If - Conditions
- Events
the problems are: sometimes the projectile will just die randomly, it deals tooo much damage. what its supposed to do: create a projectile that moves forward from the caster for 4 seconds, if an enemy unit is in a certain range of the projectil it makes the caster deal 55 damage and the projectile dies. if it doesn't hit a unit in 4 seconds it dies.
any and all help is appreciated