• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How to set Trigger to no friendly fire from spells

Status
Not open for further replies.
Level 5
Joined
Jan 5, 2019
Messages
108
Anyone ever made a Trigger that made some AOE damaging spells have no effect on friendly ally's ? it doesn't seem to allow me to manipulate Rain of Fire and Blizzard in Targets Allowance :(
 
Level 24
Joined
Feb 9, 2009
Messages
1,787
I would suggest damage detection, simply make two triggers:
  1. player 1 / host types FF ON/OFF - toggle a FF_Boolean

  2. damage modification event 1.00 -
    condition is FF_Boolean equal to false
    condition boolean is damage event target equal to ally of damage event source?
    then set damage event amount to 0.00
    else do nothing

ETA:
You can test this in map I linked and doing step 2 in the "Set Damage" trigger of the map!
 
Level 5
Joined
Jan 5, 2019
Messages
108
I would suggest damage detection, simply make two triggers:
  1. player 1 / host types FF ON/OFF - toggle a FF_Boolean

  2. damage modification event 1.00 -
    condition is FF_Boolean equal to false
    condition boolean is damage event target equal to ally of damage event source?
    then set damage event amount to 0.00
    else do nothing

ETA:
You can test this in map I linked and doing step 2 in the "Set Damage" trigger of the map!

Hmm i'm trying to figure out how to copy paste this into my map, i am just not sure how to set variables so it will work with everything. but thanks anyway :)
 
Level 24
Joined
Feb 9, 2009
Messages
1,787
Tutorial to install Damage Engine

Before you begin ensure In your editor to tick "File -> Preferences -> Check the (Automatically Create Unknown Variables While Pasting Triggers)" box
There's a video tutorial in the instructions.
Necessary: Copy & paste the Unit Indexer trigger into your map.
Necessary: Copy & paste the Damage Engine trigger into your map
Necessary: Copy the Cheat Death Ability from Object Editor, and set it to the variable DamageBlockingAbility.
Necessary: Copy the Spell Damage Detector Ability from Object Editor, and set it to the variable SpellDamageAbility.
Recommended: Mana Shield abilities need their Damage Absorbed % reduced to 0.00. The test map has this implemented already.
Recommended: Anti-Magic Shell (amount-based) has to be triggered. I included the dummy ability, as well as the trigger, in the test map.
Recommended: Locust Swarm needs its Damage Return Factor changed from 0.75 to -0.75. The test map has this implemented already.
Recommended: Unlike in PDD, do not remove the Spell Damage Reduction ability from your Runed Bracers. Instead, modify the spell damage ability (in Object Editor, go to spells tab, then to special from the left column, then under items change Spell Damage Reduction's Damage Reduction) to 1.67 instead of .33. The test map has this implemented already. If you are switching from PDD and already had that ability removed, just implement the cross-compatibility PDD script I included below.
Recommended: Spell damage is converted into negative damage values without this system, so I recommend not using the event "Unit Takes Damage" and, instead, using Damage Engine to process those events (DamageEvent becomes Equal to 1.00).
Recommended: Life Drain doesn't heal the caster. To fix this, I have created a mostly-perfect trigger which heals the caster to the correct amount at the correct time. You can find this trigger in the test map.
Note: You can configure the script to detect certain conditions that may affect its spell resistance (ie. a different item than runed bracers or different variations of Elune's Grace). You can use a "DamageModifierEvent Equal to 1.00" trigger to adjust the damage amount manually, just by checking if DamageEventTarget has a certain item or ability.
Note: There is no need for Get/SetUnitLife functions, nor UnitDamageTargetEx. The system uses a Unit State event to detect when the unit's life has been adjusted for damage, and then an "AfterDamageEvent Equal to 1.00" event is fired.
 
Level 5
Joined
Jan 5, 2019
Messages
108
Tutorial to install Damage Engine

Before you begin ensure In your editor to tick "File -> Preferences -> Check the (Automatically Create Unknown Variables While Pasting Triggers)" box
There's a video tutorial in the instructions.
Necessary: Copy & paste the Unit Indexer trigger into your map.
Necessary: Copy & paste the Damage Engine trigger into your map
Necessary: Copy the Cheat Death Ability from Object Editor, and set it to the variable DamageBlockingAbility.
Necessary: Copy the Spell Damage Detector Ability from Object Editor, and set it to the variable SpellDamageAbility.
Recommended: Mana Shield abilities need their Damage Absorbed % reduced to 0.00. The test map has this implemented already.
Recommended: Anti-Magic Shell (amount-based) has to be triggered. I included the dummy ability, as well as the trigger, in the test map.
Recommended: Locust Swarm needs its Damage Return Factor changed from 0.75 to -0.75. The test map has this implemented already.
Recommended: Unlike in PDD, do not remove the Spell Damage Reduction ability from your Runed Bracers. Instead, modify the spell damage ability (in Object Editor, go to spells tab, then to special from the left column, then under items change Spell Damage Reduction's Damage Reduction) to 1.67 instead of .33. The test map has this implemented already. If you are switching from PDD and already had that ability removed, just implement the cross-compatibility PDD script I included below.
Recommended: Spell damage is converted into negative damage values without this system, so I recommend not using the event "Unit Takes Damage" and, instead, using Damage Engine to process those events (DamageEvent becomes Equal to 1.00).
Recommended: Life Drain doesn't heal the caster. To fix this, I have created a mostly-perfect trigger which heals the caster to the correct amount at the correct time. You can find this trigger in the test map.
Note: You can configure the script to detect certain conditions that may affect its spell resistance (ie. a different item than runed bracers or different variations of Elune's Grace). You can use a "DamageModifierEvent Equal to 1.00" trigger to adjust the damage amount manually, just by checking if DamageEventTarget has a certain item or ability.
Note: There is no need for Get/SetUnitLife functions, nor UnitDamageTargetEx. The system uses a Unit State event to detect when the unit's life has been adjusted for damage, and then an "AfterDamageEvent Equal to 1.00" event is fired.

Wow Thanks this helps alot :)
 
Level 24
Joined
Feb 9, 2009
Messages
1,787
Use the edit button, it is a social faux pas to double post!
Screenshot_3.png
 
Status
Not open for further replies.
Top