| 05-22-2008, 07:38 PM | #2 |
If I get it correctly, you want the unit to be knockbacked exactly when it takes damage from a spell. This is a tricky thing to implement in a good way, particularly with triggers(GUI). There are some good systems for this, though most are in Custom Script-form(JASS). If we were to give it a shot with triggers, you have to accept that the spell wont be MUI (Multi Unit Instanceable). In other words, you can only have 1 unit who can do the knockback (your system seem to have the same limitation, so it's not really a problem. Just keep this in mind). Trigger: ![]() Set Temp_Int = 0![]() Set Timer_Delay = 0.03![]() Set Caster = (Triggering unit)![]() Set Caster_Loc = (Position of Caster)![]() Set Knockback_Value = (0.05 x (Real((Hero experience of Caster))))![]() Set Knockback_Group = (Units owned by (Owner of (Damage source)))![]() Countdown Timer - Start Knockback_Timer as a Repeating timer that will expire in Timer_Delay seconds![]() Wait 1.25 seconds![]() Countdown Timer - Pause Knockback_Timer![]() Custom script: call RemoveLocation(udg_Caster_Loc)![]() Custom script: call DestroyGroup(udg_Knockback_Group)However, this will trigger every time the unit is attacked. To prevent this, I think it would be enough to add a boolean variable: Trigger: ![]() Knockback Cast![]() Set HasCastSpell = trueTrigger: ![]() Untitled Trigger 007![]() Conditions![]() Caster = (Damage Source)![]() HasCastSpell equal to true![]() Actions![]() Set HasCastSpell = falseEDIT: IF by any chance the damage is dealt instantly with the spell cast; you only need the last trigger. Just change (Damage Source) into (Target Unit Of Ability Being Cast). |
| 05-23-2008, 09:41 AM | #3 |
can you pls tellme what's hascastspell becouse i don't get it ;( |
| 05-25-2008, 09:43 PM | #4 |
Just a boolean variable. You can call it whatever you want to (doesn't have to be "hascastspell") More on variables: http://www.wc3campaigns.net/showthread.php?t=81210 |
