HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Problem with event

03-20-2008, 10:08 AM#1
Makier
I would like to make an ability like flaming arrows, which deals additional damage based on many factors. Which event can I use to detect when a unit is hit by ability like that? EVENT_PLAYER_UNIT_SPELL_EFFECT etc doesnt work...
Any ideas?
03-20-2008, 10:45 PM#2
Silvenon
You can't detect it (like you can't detect critical strike, evasion etc.).
03-21-2008, 12:25 AM#3
Gorman
well, you could use "a unit is attacked" and then check to see if they hav a buff from gettin fire arrowed.
03-21-2008, 04:10 AM#4
Castlemaster
You can detect when flaming arrows is cast, but only when its manually cast, not autocast.

In order to "detect" flaming arrows when it is autocast, you can detect it from the unit commands. What you do is create a disabled trigger that turns on when a unit issues the command with no target "flamingarrowson". The trigger that is now enabled can operate off the "unit is attacked" event, only make sure that the enabled trigger makes sure the unit has enough mana (Condition: Unit has >= X mana needed to autocast spell). Now when the unit is issued the order "flamingarrowsoff", have the enabled trigger turn off.

Making this MUI is another problem, but let me know if you need more explanation.
03-21-2008, 05:59 AM#5
UnMi
y so much trouble
Once a unit takes damage(global dynamic trigger), check if that unit has that "unique" buff you assigned your ability ("flaming arrows") with, done.
03-21-2008, 09:42 AM#6
Makier
UnMi could you give an example? There is no event like unit takes damage! Maybe there is something wrong with my world edit?
03-21-2008, 03:18 PM#7
Gorman
UnMi u copied my answer! (well not quite, but u know what i mean)
Weirdly my native for that has disapeared aswell... (yes, it is WTF)

you could just have a periodic function that pics all units with the buff that comes from the arrows and then does stuff to the unit
03-22-2008, 12:59 AM#8
UnMi
Quote:
UnMi could you give an example? There is no event like unit takes damage! Maybe there is something wrong with my world edit?
There is, in "Specified Unit Event" or something.
This means you have to have an unit variable to give this event or you just use preset units on the map.
Quote:
UnMi u copied my answer! (well not quite, but u know what i mean)
Lol, no. Unit is attacked != Unit takes damage.
03-22-2008, 07:03 AM#9
Gorman
ah yes ur right, i keep forgetting this stuff.

thats why i added the "(well not quite, but u know what i mean)" bit, so u will understand =P
my way will look retarded when used on ranged units lolol

If you dont get it Makier heres a
demo trigger


First add:
Trigger:
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Collapse Loop - Actions
Trigger - Add to (Part 2) the event (Unit - (Picked unit) Takes damage)
to your initialisation trigger, then:
Trigger:
Part 1
Collapse Events
Unit - A unit enters (Playable map area)
Conditions
Collapse Actions
Trigger - Add to (Part 2) the event (Unit - (Triggering unit) Takes damage)
which adds the event to the other trigger, which is this one:
Trigger:
Part 2
Events
Collapse Conditions
((Triggering unit) has buff Flaming Arrow) Equal to True
Collapse Actions
Do your affect which is based on many factors