HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Loose hp each second!?

08-23-2004, 11:29 AM#1
Necron.
ok here's a tricky one, how do i make a unit which is affected by my spell that freezes him in like a giant ice cube loose f.ex 4 hp each second?
08-23-2004, 12:07 PM#2
iNfraNe
You could use a spell like poison arrows, or.. another spell that does damage over time as base spell, or, you could do it in this trigger:

Events
Periodic Event - Every 1.00 seconds of the game
Actions:
Unit Group - Pick every unit in (playable map) and do
If (Unit has your buff) then
unit - set picked unit life to (life of picked unit - 4)

This is probably not the best solution 'cause it will pick every unit in the map each second... which will cause lag.
Edit: Better solution:
Trigger 1
Events:
A unit casts an ability
Condition:
Ability being cast is equal to your ability
Actions:
Unit Group - Add unit to VariableGroup

Trigger 2
Events
Periodic Event - Every 1.00 seconds of the game
Actions:
Pick every unit in VariableGroup and do
unit - set picked unit life to (life of picked unit - 4)
08-23-2004, 12:19 PM#3
Necron.
Woa! there is nothing you guys cant do ;) thanks! and Btw can someone pls tell me what is wrong with this trigger? (and dont call me a noob at triggering, cuz i already know that i am)

Event- a unit starts casting an ability
Conditions- Ability beeing cast equal to Triple Flame Strike
Actions- Create 1 dummy2 for player 11(dark green)
at target point of ability beeing cast

- Set DummyCasters = Last created unit

wait 6 seconds

unit order Dummy2 To Human Bloodmage Flame Strike at Target point of ability beeing cast

wait 6 seconds

unit order Dummy2 To Human Bloodmage Flame Strike at Target point of ability beeing cast

wait 2 seconds
Kill Dummycasters

and yes, the dummy has flamestrike, no manacost and a cooldown at 0.. :god_help_us:
08-23-2004, 12:25 PM#4
iNfraNe
Quote:
Originally Posted by Necron.
Woa! there is nothing you guys cant do ;) thanks! and Btw can someone pls tell me what is wrong with this trigger? (and dont call me a noob at triggering, cuz i already know that i am)

Event- a unit starts casting an ability
Conditions- Ability beeing cast equal to Triple Flame Strike
Actions- Create 1 dummy2 for player 11(dark green)
at target point of ability beeing cast

- Set DummyCasters = Last created unit

wait 6 seconds

unit order Dummy2 To Human Bloodmage Flame Strike at Target point of ability beeing cast

wait 6 seconds

unit order Dummy2 To Human Bloodmage Flame Strike at Target point of ability beeing cast

wait 2 seconds
Kill Dummycasters
Well, there are a few mistakes, first, use the event a unit starts the effects of an ability, this trigger will also run when the unit cancels his spell at the last moment. Second, the variable you use will be overwritten each time a unit casts this ability, u must use an array or unit group. Third, I dont know if your dummy2 has a custom ability of flamestrike with no cooldown and no mana cost, but if it doesnt, make that, cause else he will not flamestrike probably
08-23-2004, 12:30 PM#5
Necron.
ok here's what i made, of the spell, and it wont work ofcourse

every 1 second
conditions triggering unit has buff Freezed
Set FreezedVictim = Triggering unit

and the 2 trigger

every 1 second
set life of FreezedVictim -4

and that didnt work, i think the fault lies in trigger 1


and i tried to set a unit's life -4.. he dies instantly cuz the editor thinks it is -4 in hp, witch is wrong
08-23-2004, 04:15 PM#6
Clyner
Trigger 2

Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Unit - Set life of FreezedVictim to ((Life of (Triggering unit)) - 4.00)


**************************************************
You will have to choose 'Unit - Set Life (To Value)' as action. Switch the
'(Triggering unit)' to 'FreezedVictim'. Then press '(Life of (Triggering unit)'.
Change the function to Arithmetic, then click the first '1.00'. In there change
back to 'Unit - Property' and change '(Triggering unit)' to 'FreezedVictim'. Be
sure to change the '+' to '-' and the '1.00' to value of 4.00.

**************************************************

I hope this helps. If it doesn't I'd be glad to help you further personally on any Instant Messenger of your choice. :8
08-23-2004, 04:50 PM#7
weaaddar
You should use the new damage natives added in 1.17 or else the attacking unit will not be credited for the kill.
08-23-2004, 04:56 PM#8
Necron.
thanks guys, almost got it, but there's something, Msn would be fine?
[email protected] hey wait! i think i got it :) but you can add me to msn if you want, or incase i need a problemsolver ^^
08-23-2004, 05:13 PM#9
Clyner
I'll add you, Neocron!