| 07-11-2003, 08:38 PM | #1 |
I want to make a trigger, so when a unit activates Divine Shield, he should lose 3 HP each second, as long as divine shield is activated, has tried to do this, but it doesn't work. I have TFT. |
| 07-11-2003, 08:52 PM | #2 |
What have you tried? I figure the best way is just to set up a trigger that turns on when a unit cast divine shield. Then, have it run every 3 seconds and check if a unit is affected by divine shield and then lower it's hp by 3. Turn off trigger when divine shield is not active. You could leave it run also, but that depends on how your map is set up. I believe this will work, but since I'm only just beginning to play with combo spell/triggers, perhaps someone knows a better way. |
| 07-12-2003, 07:48 AM | #3 |
I had a couple of triggers which i used when i tried. It was one that activated when a unit "started to cast an ability" with the condition "ability being cast equal to Human-Divine Shield". If this was, it turned on a trigger that would run every second. This trigger wasn't initially on. When it was turned on though, it should every second "Set life of Random Unit of Unit Type (Type of Unit) to Life of Random Unit of Unit Type (Type of unit used) -3. Used that action since the unit having divine shield will only ever be on the map once at a time. However, it only deals damage once. Of course I also had a trigger to turn the damaging trigger of. |
| 07-12-2003, 08:15 AM | #4 |
I set this up with arrays, just in case you wanted to use it for multiple players. There are 2 different triggers here. One to detect casting of divine shield, and one to subtract the life every second. Make 2 variables. DivineShieldCaster(unit(array)) will be your caster. DivineShieldOn(boolean(array)) will flag that divine shield is on. You don't have to use arrays here. If you don't, then don't use the for loop in trigger 2. Trigger1 Divine Shield On Events Unit - A unit Starts the effect of an ability Conditions (Ability being cast) Equal to Divine Shield Actions Set DivineShieldCaster[(Player number of (Owner of (Casting unit)))] = (Casting unit) Set DivineShieldOn[(Player number of (Owner of (Casting unit)))] = True -------------------------------- Trigger2 Divine Shield Drain Hps Events Time - Every 1.00 seconds of game time Conditions Actions For each (Integer A) from 1 to 12, do (Actions) Loop - Actions If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions DivineShieldOn[(Integer A)] Equal to True Then - Actions Unit - Set life of DivineShieldCaster[(Integer A)] to ((Life of DivineShieldCaster[(Integer A)]) - 3.00) Else - Actions ------------------------------- I didn't write a 3rd trigger to turn off the effect cuz you said you made one already. |
