Klein~
TH.net Regular
- Reaction score
- 0
Based on undead skill: Carrion Swarm
I'm having trouble with this part:
Either these two code parts aren't working. I mean, when the ability is used the dummy is moved towards the enemy but does not damages it.
I think it may be wrong use of 'Matching unit', 'Picked unit' and 'Triggering unit'.
Thanks for helping.
Trigger:
- Firebolt
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Firebolt
- Actions
- Set HeroInt = (Real((Intelligence of (Triggering unit) (Include bonuses))))
- Unit - Create 1 DUMMY-Firebolt for (Triggering player) at ((Position of (Triggering unit)) offset by 110.00 towards (Facing of (Triggering unit)) degrees) facing (Target point of ability being cast)
- Unit - Add a 2.50 second Generic expiration timer to (Last created unit)
- Unit Group - Add (Last created unit) to Firebolt
Trigger:
- Firebolt2
- Events
- Time - Every 0.01 seconds of game time
- Conditions
- Actions
- Unit Group - Pick every unit in Firebolt and do (Actions)
- Loop - Actions
- Set FireboltU = (Picked unit)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Number of units in (Units within 70.00 of (Position of (Picked unit)) matching ((((Matching unit) is alive) Equal to True) or (((Matching unit) belongs to an enemy of (Triggering player)) Equal to True)))) Greater than 0
- Then - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Number of units in (Units within 70.00 of (Position of (Picked unit)) matching ((Number of units in (Units within 70.00 of (Position of (Picked unit)) matching ((((Matching unit) is A Hero) Equal to True) and (((Matching unit) belongs to an enemy of (Trigger Greater than 0
- Then - Actions
- <b>Unit Group - Add all units of (Units within 100.00 of (Position of FireboltU) matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Triggering player)) Equal to True))) to FireboltTarget</b>
- Unit Group - Pick every unit in FireboltTarget and do (Actions)
- Loop - Actions
- <b>Unit - Cause FireboltU to damage (Picked unit), dealing (((1.00 + ((HeroInt x 2.00) / 100.00)) x 150.00) / (Real((Number of units in (Units within 100.00 of (Position of (Triggering unit)) matching ((((Picked unit) is alive) Equal to True) and (((Picked unit) belongs to an enemy of (Triggering player)) Equal to Tr damage of attack type Spells and damage type Fire</b>
- Unit Group - Remove (Picked unit) from FireboltTarget
- Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 22.00 towards (Facing of (Picked unit)) degrees)
- Sound - Play Incinerate1 <gen>
- Set FireboltEffect = (Position of (Picked unit))
- Special Effect - Create a special effect at FireboltEffect using Abilities\Weapons\SteamTank\SteamTankImpact.mdl
- Special Effect - Destroy (Last created special effect)
- Custom script: call RemoveLocation (udg_FireboltEffect)
- Else - Actions
- Unit Group - Add all units of (Units within 100.00 of (Position of (Picked unit)) matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Triggering player)) Equal to True))) to FireboltTarget
- Unit Group - Pick every unit in FireboltTarget and do (Actions)
- Loop - Actions
- Unit - Cause FireboltU to damage (Picked unit), dealing (((1.00 + ((HeroInt x 1.00) / 100.00)) x 90.00) / (Real((Number of units in (Units within 100.00 of (Position of (Triggering unit)) matching ((((Picked unit) is alive) Equal to True) and (((Picked unit) belongs to an enemy of (Triggering player)) Equal to Tru damage of attack type Spells and damage type Fire
- Unit Group - Remove (Picked unit) from FireboltTarget
- Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 18.00 towards (Facing of (Picked unit)) degrees)
- Sound - Play Incinerate1 <gen>
- Set FireboltEffect = (Position of (Picked unit))
- Special Effect - Create a special effect at FireboltEffect using Abilities\Weapons\SteamTank\SteamTankImpact.mdl
- Special Effect - Destroy (Last created special effect)
- Custom script: call RemoveLocation (udg_FireboltEffect)
- Else - Actions
- Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 18.00 towards (Facing of (Picked unit)) degrees)
Trigger:
- Firebolt3
- Events
- Unit - A unit Dies
- Conditions
- (Unit-type of (Triggering unit)) Equal to DUMMY-Firebolt
- Actions
- Special Effect - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\Other\Doom\DoomDeath.mdl
- Sound - Play Incinerate1 <gen> at 100.00% volume, located at (Position of (Triggering unit)) with Z offset 0.00
- Special Effect - Destroy (Last created special effect)
- Unit - Remove (Triggering unit) from the game
I'm having trouble with this part:
Unit Group - Add all units of (Units within 100.00 of (Position of FireboltU) matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Triggering player)) Equal to True))) to FireboltTarget
Unit - Cause FireboltU to damage (Picked unit), dealing (((1.00 + ((HeroInt x 2.00) / 100.00)) x 150.00) / (Real((Number of units in (Units within 100.00 of (Position of (Triggering unit)) matching ((((Picked unit) is alive) Equal to True) and (((Picked unit) belongs to an enemy of (Triggering player)) Equal to Tr damage of attack type Spells and damage type Fire
Either these two code parts aren't working. I mean, when the ability is used the dummy is moved towards the enemy but does not damages it.
I think it may be wrong use of 'Matching unit', 'Picked unit' and 'Triggering unit'.
Thanks for helping.