PDA

View Full Version : Events Triggering when being Attacked



Malle1
10-12-2009, 04:30 PM
So, I played around a bit to test how evasion and redirection (Zephyr's Wind Shield) affect the different triggers related to being attacked. I added an item with the following code:


<?xml version="1.0" encoding="UTF-8"?>
<item
name="Item_Attacktest"

icon="icon.tga"

cost="100"

actiontype="passive"
>
<onattackedstart>
<areaofeffect
radius="1000"
targetselection="all"
targetscheme="enemy_nonboss_units"
effecttype=""
>
<damage effecttype="Splash" amount="100" />
</areaofeffect>
<popup name="bonus_damage" a="1" />
</onattackedstart>

<onattackedpreimpact>
<areaofeffect
radius="1000"
targetselection="all"
targetscheme="enemy_nonboss_units"
effecttype=""
>
<damage effecttype="Splash" amount="200" />
</areaofeffect>
<popup name="bonus_damage" a="2" />
</onattackedpreimpact>

<onattackimpact>
<areaofeffect
radius="1000"
targetselection="all"
targetscheme="enemy_nonboss_units"
effecttype=""
>
<damage effecttype="Splash" amount="400" />
</areaofeffect>
<popup name="bonus_damage" a="4" />
</onattackimpact>

<ondamaged>
<areaofeffect
radius="1000"
targetselection="all"
targetscheme="enemy_nonboss_units"
effecttype=""
>
<damage effecttype="Splash" amount="800" />
</areaofeffect>
<popup name="bonus_damage" a="8" />
</ondamaged>
</item>

The onattackedstart, onattackedpreimpact and ondamaged part worked when attacked normally, but the onattackimpact did not. Is it the wrong event or am I doing something else wrong?

For reference, when evasion or redirection triggers, ondamaged does of course not trigger.

S2Ikkyo
10-13-2009, 05:53 AM
onattack* events are applied to you own attacks at the time of the attack.

onattacked* is for responding to other units' attacks.

onattacking* is for responding to your own unit's attacks (this occurs are a slightly different time than onattack*)


onattackstart
onattack
onattackpreimpact
onattackpredamage
onattackdamageevent
onattackimpact
onattackimpactinvalid
onattackend

onattackedstart
onattackedpreimpact
onattackedpredamage
onattackeddamageevent
onattackedpostimpact

onattackingstart
onattackingpreimpact
onattackingpredamage
onattackingdamageevent
onattackingpostimpact

Also, some other things that may help you:



<print text="Look, I'm text." />
<printvalue value="source_maxhealth" />
<printdebuginfo />


Documentation of all possible events, dynamic values, etc will come in the future.

Malle1
10-13-2009, 06:31 AM
Thanks, both for the list and the promise of documentation; both of them will help a lot.

Trysaeder
10-13-2009, 06:33 AM
Ikkyo could we get a Guides and Lists section soon since the stickies are getting crowded.

S2Ikkyo
10-13-2009, 06:54 AM
I think a stickied Guides and Lists post would be better.

ElementUser
01-07-2010, 06:49 PM
Moved to Guides & Lists for reference.

Yes I know the thread is old