| 05-05-2004, 02:43 PM | #1 | |
Okey, I did this: When your Hero uses an ability (Sleep) on himself, He will start sleeping for 10 seconds. After each second he will get 10 HP and 10 Mana (Max HP / Mana = 100). That's what I could do myself. Problem: When he's attacked (While sleeping) he will be able to move again, BUT he will still regenerate HP / Mana until these 10 seconds is over. Here's the trigger: Quote:
And I want it to stop regenerate his HP / Mana when he is attacked.. :> |
| 05-05-2004, 03:46 PM | #2 |
Code:
Events
A unit Starts the effect of an ability
Conditions
((Ability being cast) Equal to Sleep) and ((Target unit of ability being cast) Equal to (Casting unit))
Actions
Set HeroSleeping = (Casting unit)
Start SleepTimer as a One-shot timer that will expire in 1.00 secondCode:
Events
SleepTimer expires
Actions
If - Conditions
((HeroSleeping) has buff Sleep) Equal to True
Then - Actions
Set life of (HeroSleeping) to ((Life of (HeroSleeping)) + 10.00)
Start SleepTimer as a One-shot timer that will expire in 1.00 seconds
Else - Actions
Set HeroSleeping = No unit |
| 05-05-2004, 05:01 PM | #3 |
Thanks :D |
| 05-05-2004, 05:10 PM | #4 |
You know, you could just cast the healing salve and clarity potion spells on him... Just convert the item abilities to unit abilities and make a dummy unit with both. |
| 05-05-2004, 05:36 PM | #5 |
Or the scroll of restoration. Or, you could use the Staff that one of the melee racial shops sells that teleports a unit, stuns them for a length of time, and heals them over time. Might not want just that effect, though. At any rate, trigger-based questions belong in the Trigger Haven. |
| 05-05-2004, 06:03 PM | #6 |
Just curious, but how do you make a Item ability a Unit ability? |
| 05-05-2004, 06:07 PM | #7 |
Just set the 'item abillity - true' to be false and then it is an unit abillity. |
| 05-05-2004, 06:09 PM | #8 |
Hmm, I can't find it (Looking at Healing Salve). I must be blind, checked the column like 5 times.. o_O Edit: Eh, lol.. Found it ;DD |
| 05-05-2004, 10:27 PM | #9 | |
Quote:
insert this IF/THE/ELSE after each healing action IF Unit(sleeping unit) has buff (sleep) equal to true THEN do nothing ELSE do skip remeining conditions should work if you do it right |
| 05-05-2004, 10:27 PM | #10 |
You should be able to do this simply by using this trigger: [edit] This is basically a formatted, tested version of the above (I hadn't refreshed during my test, so I didn't notice it...) Code:
Sleep
Events
Unit - A unit Begins casting an ability
Conditions
((Ability being cast) Equal to Sleep) and ((Target unit of ability being cast) Equal to (Casting unit))
Actions
Wait 1.00 seconds
Game - Display to (All players) the text: +10!
Unit - Set life of (Casting unit) to ((Life of (Casting unit)) + 10.00)
Unit - Set mana of (Casting unit) to ((Mana of (Casting unit)) + 10.00)
For each (Integer A) from 1 to 10, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Casting unit) has buff Sleep) Equal to True
Then - Actions
Unit - Set life of (Casting unit) to ((Life of (Casting unit)) + 10.00)
Unit - Set mana of (Casting unit) to ((Mana of (Casting unit)) + 10.00)
Wait 1.00 seconds
Else - Actions
Set UnitVariable = No unit
Skip remaining actions |
