ChaosWarlock
New Member
- Reaction score
- 7
I am creating an ability that increases the damage that a unit takes from attacks by a certain percent. If someone could help with a couple issues I am having that would be greatly appreciated.
1. I don't really understand "Damage taken" it seems. I thought it would refer to the damage that the triggering unit just took from the attack but it seems that is not the case. I added a message to see how much "Damage taken" was and it comes up as 0.00 every time. I want to have the unit that is being attacked to take an extra 25% damage from all attacks (but not spells) when it has this buff.
2. I would like the attack type and the damage type to match that of the attacking unit. I didn't see any options for setting this. I even tried to use a variable but when you set the variable it only allows presets.
Thanks in advance!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
EDIT: Here are the solutions I have found from this thread. Thank you to everyone who contributed!
1.
2.
Possible solution is using "Point Values" which I know nothing about.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The solution I have found to work for the ability I was working on is below. The ability has a chance on attack to open a deep wound causing the affected unit to take increased damage from attacks for a short period of time. The first trigger is the one I was having trouble with but I added the second one here in case anyone wanted the whole spell.
1. I don't really understand "Damage taken" it seems. I thought it would refer to the damage that the triggering unit just took from the attack but it seems that is not the case. I added a message to see how much "Damage taken" was and it comes up as 0.00 every time. I want to have the unit that is being attacked to take an extra 25% damage from all attacks (but not spells) when it has this buff.
2. I would like the attack type and the damage type to match that of the attacking unit. I didn't see any options for setting this. I even tried to use a variable but when you set the variable it only allows presets.
Code:
Open Wound Damage
Events
Unit - A unit Is attacked
Conditions
((Triggering unit) has buff Open Wound ) Equal to True
Actions
[COLOR="Red"]Game - Display to (All players) the text: (String((Damage taken)))[/COLOR]
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 [COLOR="Red"](Damage taken)[/COLOR]) damage of [COLOR="RoyalBlue"]attack type Hero and damage type Normal[/COLOR]
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)
Thanks in advance!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
EDIT: Here are the solutions I have found from this thread. Thank you to everyone who contributed!
1.
Damage taken only applies to the event Unit takes damage
2.
Possible solution is using "Point Values" which I know nothing about.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The solution I have found to work for the ability I was working on is below. The ability has a chance on attack to open a deep wound causing the affected unit to take increased damage from attacks for a short period of time. The first trigger is the one I was having trouble with but I added the second one here in case anyone wanted the whole spell.
Trigger:
- Open Wound Attacker
- Events
- Unit - A unit Is attacked
- Conditions
- Actions
- Set Trig_Unit = (Triggering unit)
- Set Atk_Unit = (Attacking unit)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Trig_Unit has buff Open Wound ) Equal to False
- Then - Actions
- Unit - Remove Open Wound (Attacker) from Atk_Unit
- Else - Actions
- Unit - Add Open Wound (Attacker) to Atk_Unit
- If - Conditions
- Set Trig_Unit = No unit
- Set Atk_Unit = No unit
- Events
Trigger:
- Open Wound Buff
- Events
- Unit - A unit Is attacked
- Conditions
- (Level of Open Wound for (Attacking unit)) Greater than 0
- Actions
- Set Atk_Unit = (Attacking unit)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Random integer number between 1 and 100) Less than or equal to (8 + (3 x (Level of Open Wound for Atk_Unit)))
- Then - Actions
- Set Trig_Unit = (Triggering unit)
- Set Point1 = (Position of Trig_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 - Add Open Wound (Buff) to Last_Unit
- Unit - Set level of Open Wound (Buff) for Last_Unit to (Level of Open Wound for Atk_Unit)
- Unit - Order Last_Unit to Neutral Fire Lord - Soul Burn Trig_Unit
- Unit - Add a 3.00 second Generic expiration timer to Last_Unit
- Set Trig_Unit = No unit
- Custom script: call RemoveLocation(udg_Point1)
- Set Owner_Atk_Unit = (Picked player)
- Else - Actions
- If - Conditions
- Set Atk_Unit = No unit
- Events