• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

trigger help)

Status
Not open for further replies.
Level 4
Joined
Oct 13, 2009
Messages
43
hi guys, need to make trigger- units in region xx take 50% less dmg from attacks. help plz :ogre_hurrhurr:
 
Level 3
Joined
Apr 18, 2012
Messages
47
As long as you don't mind having a passive icon on the units... this is probably the laziest way. I think there was a way to hide the icon but I cannot recall it.

1. Make an ability based of Spiked Carapace, we'll name it 50% less damage for easy reference.
2. Make it an unit ability by setting Stats - Hero Ability to False
3. Make it have 1 level.
4. Set Defense Bonus to 0, Received Damage Factor to 0.5 and Returned Damage Factor to 0
5. Remove everything from Stats - Buffs
6. Add these two triggers

  • Entering Damage Reduction
    • Events
      • Unit - A unit enters (region xx)
    • Conditions
    • Actions
      • Unit - Add 50% less damage to (Entering unit)
  • Exiting Damage Reduction
    • Events
      • Unit - A unit leaves (region xx)
    • Conditions
    • Actions
      • Unit - Remove 50% less damage from (Leaving unit)
EDIT: Just realized you'll need another trigger so that units that are within the region but didn't enter it receive the ability. Such units like those that you place in that region with the editor manually.

  • Init Damage Reduction
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set DmgRedGroup = (Units in region xx)
      • Unit Group - Pick every unit in DmgRedGroup and do (Unit - Add 50% less damage to (Picked unit))
      • Custom script: call DestroyGroup (udg_DmgRedGroup)
 
Level 4
Joined
Oct 13, 2009
Messages
43
indeed, ty ) and there a one more thing, is this "reciaved damege factor 0.5" <--- IS this that option that will reduce demage to 50%? i did what u say and i think damege is not reduced =D
 
Level 3
Joined
Apr 18, 2012
Messages
47
It's working on my side. Here's the map. I added a few triggers that test it. The map will print out how much damage the unit is taking (except for the first hit, it will show 0 on the first hit for some reason). The region is the size of the grass that the footman and knight are om.

If you're on the grass (in the region) the footman will take 51-52 damage (50% of the knight's damage) and if it's off the grass (outside of the region) it will take 101-102 damage (full damage). I set the Knight's damage type to Chaos because it deals full damage to all armor types and set the footman's armor to 0 for testing purposes.

I've noticed another downside to this lazyman method: the spiked carapace model appears on the knight, I can't seem to figure out how to remove it...
 

Attachments

  • damagereduction.w3x
    18 KB · Views: 43
Level 4
Joined
Oct 13, 2009
Messages
43
i will just use "Mana Shiel" spell ) it absorbs 2 dmg per 1point of mana same as 50%(will remove mana dependance) and thats it. ) ty for triggers again.
 
Level 4
Joined
Oct 13, 2009
Messages
43
mana shield" buff is on unit ) + it gets removed when unit is attacked )) will just follow your way.
 
Level 3
Joined
Apr 18, 2012
Messages
47
Yeah, if the fact that the spiked carapace model is displaying on units bothers you we could try different solutions.

You could just heal the unit for half of the damage when it gets hit, you don't even need an ability for this, the only downside is that the last hit will deal full damage (since the unit dies, it cannot be healed).

I'm pretty sure that there are entire systems that handle these kind of things, but I'm unfamiliar with them, and I do believe this requires jass.
 
Level 4
Joined
Oct 13, 2009
Messages
43
demage from ranged attacks is not reduced..... =x i need exactly ranged attack reduction trigger...!!!
 
Level 4
Joined
Oct 13, 2009
Messages
43
spiked corpace model is displayng on very few units ) so its ok in my map but, it only reducec demage from melee attacks.
 
Last edited:
Level 3
Joined
Apr 18, 2012
Messages
47
Goddamn, forgot about that, sorry. There's no way for it to work on ranged attacks, as far as I know, it's hard coded. The only other solution I know is to heal half of the damage after it's been done. Like I said, it won't work on the last hit, can't heal a dead unit. If you're okay with that and you don't know how to do it I can cook up some triggers.
 
Status
Not open for further replies.
Top