HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Use unit's attack damage in trigger?

01-03-2009, 04:13 PM#1
ChaosWarlock
Is there a way to use a units attack damage in a Trigger.

I am trying to make a trigger that increased the damage that a unit takes from attacks by 25% if it has a certain buff. I only want it to be damage taken from attacks not from spells.

This is what I have so far.

Trigger:
Open Wound Damage
Collapse Events
Unit - A unit Is attacked
Collapse Conditions
((Triggering unit) has buff Open Wound ) Equal to True
Collapse Actions
Game - Display to (All players) the text: (String((Damage taken)))
Set Trig_Unit = (Triggering unit)
Set Point1 = (Position of Trig_Unit)
Set Atk_Unit = (Attacking unit)
Set Owner_Atk_Unit = (Owner of Atk_Unit)
Unit - Create 1 Dummy for Owner_Atk_Unit at Point1 facing Default building facing degrees
Set Last_Unit = (Last created unit)
Unit - Cause Last_Unit to damage Trig_Unit, dealing (0.25 x (Damage taken)) damage of attack type Hero and damage type Normal
Unit - Add a 3.00 second Generic expiration timer to Last_Unit
Set Trig_Unit = No unit
Custom script: call RemoveLocation(udg_Point1)
Set Atk_Unit = No unit
Set Owner_Atk_Unit = (Picked player)

It doesn't recognize the "Damage taken" at the point the unit is attacked. So if I can replace the Damage taken with the attacking units attack damage I think it will work. Problem is I cant seem to find a way to get that value.

If anyone has any ideas on how to make this work please post.
01-03-2009, 07:55 PM#2
Pyrogasm
The "A unit is attacked" event doesn't trigger when a unit takes damage. Instead, it fires when a unit initiates an attack, so there is no "damage done."

Also, there's no way to get a unit's attack damage, aside from computing it manually. So your best bet is to use an attack detection system or something.
01-03-2009, 08:18 PM#3
ChaosWarlock
Thank you Pyrogasm! Can you explain more about this "attack detection system" that you mentioned. I am not familiar with that.
01-04-2009, 01:26 PM#4
Themerion
The very most simple solution to your problem is to reduce the target unit's armor by, say 4.
01-06-2009, 05:35 AM#5
Pyrogasm
Quote:
Originally Posted by ChaosWarlock
Thank you Pyrogasm! Can you explain more about this "attack detection system" that you mentioned. I am not familiar with that.
The thing is that there isn't an "any unit takes damage" event, so we have had to create our own systems to detect when a unit takes damage and then differentiate between a spell and an attack.

There are a few in the resources section.