- Joined
- Jul 27, 2011
- Messages
- 27
Use a unit variable
Set unit = random 1 unit from units within x of position matching matching unit is alive and owner of matching unit is an enemy of owner of caster
cause caster to damage unit
'ln_' prefixes should be 'DP_'
and DON'T null DP_Caster . . . .
and use 'Unit - Add expiration time' instead of REMOVING it with no waits (and please don't use wait, that will cause bug)
http://www.hiveworkshop.com/forums/miscellaneous-tutorials-456/how-easily-post-triggers-163285/
Replace the owner of matching unit == random player condition with the is an enemy condition I posted. It is a boolean comparison.
Still not working.. :S
- Actions
- -------- Set target --------
- Set DP_Target = (Random unit from (Units within 500.00 of (Position of DP_Caster) matching ((((Matching unit) is alive) Equal to True) and (((Owner of DP_Target) is an enemy of (Owner of DP_Caster)) Equal to True))))
- -------- Create Dummy --------
- Unit - Create 1 DUMMY CASTER for (Owner of DP_Caster) at (Position of DP_Caster) facing Default building facing degrees
- Unit - Add a 0.50 second Generic expiration timer to DP_Dummy
- Set DP_Dummy = (Last created unit)
- -------- Apply Stun --------
- Unit - Add Ministun to DP_Dummy
- Unit - Order DP_Dummy to Human Mountain King - Storm Bolt In_Target
- -------- Damage target / create SFX --------
- Unit - Cause DP_Caster to damage DP_Target, dealing 100.00 damage of attack type Spells and damage type Normal
- Special Effect - Create a special effect attached to the overhead of DP_Target using Abilities\Spells\Demon\DarkPortal\DarkPortalTarget.mdl
- -------- Clear Variables --------
- Set DP_Target = No unit
here what's wrong:
DP_Target should be Matching unit in this case . . .
- Set DP_Target = (Random unit from (Units within 500.00 of (Position of DP_Caster) matching ((((Matching unit) is alive) Equal to True) and (((Owner of Matching unit) is an enemy of (Owner of DP_Caster)) Equal to True))))
In_Target ?_? . . . should be DP_Target, and here's a bit of damage types
- Unit - Order DP_Dummy to Human Mountain King - Storm Bolt DP_Target
All attack types other than spells follow the armor reduction rules
Spells attack type with Physical/Normal damage type will follow armor reduction rules, and the damaged unit's armor and Spell Damage Reduction item ability
Spells attack type with Magic damage type will follow Spell Damage Reduction item ability, and magic damage reduction rules, ignoring armor rules
Spells attack type with Universal damage type will only follow Spell Damage Reduction item ability, and no other else . . .
add that please ~.~
- Set DP_Dummy = No unit
or just remove both of those, since it's unnecessary . . . .
you use it again and again, no need of nulling . .
and make sure your Dummy unit's Art - Spell cast animation is 0.000
Owner of DP_target
^You use that before the variable is set.
for the first part . . .
if you use that, you will check DP_Target's last value, not current DP_Target . .
since it's not yet assigned . . .
therefore, use Matching Unit instead . . . . .
no ~.~
use Matching Unit inside Pick Units actions . . . . .
if you use Set DP_Target = (Matching unit), then it will has no value . . . . (or another value, that doesn't match with your prob at all)