- Joined
- Jun 10, 2013
- Messages
- 473
Is their any orb or slow poison type ability which reduces attacked enemy units damage when attacked if not how would I trigger that? any help would be appreciated >
Get your hands on a DDS (Damage Detection System) from the spell section.
This question has been asked dozens of times, if you search on google or with hive's search function you'll find more detailed answers.
Use the damage event given by the DDS (there should be demos showing that)
then just set the damage variable to:
Damage = damage * 0.8
which will reduce the damage by 20%
Almost.
Look at the examples mate:
http://www.hiveworkshop.com/forums/...ev=search=damage%20engine&d=list&r=20&u=Bribe
There's even a youtube video.
Wrong event and variable for the unit.
// - Detect damage: use the event "DamageEvent Equal to 1.00"
// - To change damage before it's dealt: use the event "DamageModifierEvent Equal to 1.00"
// - Detect damage after it was applied, use the event "AfterDamageEvent Equal to 1.00"
// - Detect spell damage: use the condition "IsDamageSpell Equal to True"
// - Detect zero-damage: use the event "DamageEvent Equal to 2.00" (an AfterDamageEvent will not fire for this)
//
// You can specify the DamageEventType before dealing triggered damage. To prevent an already-improbable error, I recommend running the trigger "ClearDamageEvent (Checking Conditions)" after dealing triggered damage from within a damage event:
// - Set NextDamageType = DamageTypeWhatever
// - Unit - Cause...
// - Trigger - Run ClearDamageEvent (Checking Conditions)
//
// You can modify the DamageEventAmount and the DamageEventType from a "DamageModifierEvent Equal to 1.00" trigger.
// - If the amount is modified to negative, it will count as a heal.
// - If the amount is set to 0, no damage will be dealt.
//
// If you need to reference the original in-game damage, use the variable "DamageEventPrevAmt".
Are you sure you read it? Even with the youtube video and amount of documentation Bribe put in his code, I find it strange that you come to into the forums looking for help as if it is any better. It just seems like you're looking for someone to do the work for you.
Regardless, if you take a look at the top of the damage engine trigger, this is what it says:
JASS:// - Detect damage: use the event "DamageEvent Equal to 1.00" // - To change damage before it's dealt: use the event "DamageModifierEvent Equal to 1.00" // - Detect damage after it was applied, use the event "AfterDamageEvent Equal to 1.00" // - Detect spell damage: use the condition "IsDamageSpell Equal to True" // - Detect zero-damage: use the event "DamageEvent Equal to 2.00" (an AfterDamageEvent will not fire for this) // // You can specify the DamageEventType before dealing triggered damage. To prevent an already-improbable error, I recommend running the trigger "ClearDamageEvent (Checking Conditions)" after dealing triggered damage from within a damage event: // - Set NextDamageType = DamageTypeWhatever // - Unit - Cause... // - Trigger - Run ClearDamageEvent (Checking Conditions) // // You can modify the DamageEventAmount and the DamageEventType from a "DamageModifierEvent Equal to 1.00" trigger. // - If the amount is modified to negative, it will count as a heal. // - If the amount is set to 0, no damage will be dealt. // // If you need to reference the original in-game damage, use the variable "DamageEventPrevAmt".
Basically, it detects damage.
So, in your trigger, you need to add the event.
Setting that up right, your trigger will now fire for any instance of a unit that has been damaged.
To limit that, add the conditions.
Setting that up right, your trigger should now detect the attack of unit with Ability_X.
Now, in your actions, you still need to do the regular trigger thing; maybe create a dummy unit which casts howl of terror without any effects and apply buff to the attacked target, or cast an inner fire with negative damage, or use an aura, etc.
You have several choices on applying -dmg on the attacked unit, just be careful with buffs or abilities that you use with it because some buffs having based on the same ability will not stack.
e.g. You made a dummy skill based on Slow. Any other skills which applies a buff that uses Slow as the buff placer won't stack.
I am not descriptive enough, but I wanted you to read the documentation and find out how.
EDIT:
And guys, he is NOT trying to modify the damage being dealt within the event, but he is trying to apply a buff OR SOMETHING to an enemy unit so that the enemy unit has a minus damage so long as the attacked enemy has a buff.
Edit 2: Welp. I think you guys knew in the first place. (?) (@edit#1)
Then, use the damage detection system to reduce the damage dealt by units who have that buff.
So you mean...
Unit with Abil_X inflicts buff.
Affected Unit will have a reduced attack damage.
Is this right?
If so, in your current trigger, DamageEventTarget is the wrong variable to use.
Why not use the DDS to apply cripple to the target using a dummy unit? This will not reduce ability damage it deals but it will reduce attack damage and provide a helpful buff bar icon to inform the owner of what is going on.
Which may or may not be a good thing.But that way can be blocked by spell immunity