• 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.

Reseting initial armor instantly

Status
Not open for further replies.
Level 6
Joined
Sep 24, 2015
Messages
174
hey guys,

I have an issue on this trigger :

  • Curse Tower Armor reduction 1
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Attacking unit)) Equal to Curse Tower 1
    • Actions
      • Set MaxArmorPercentage = (Min((Armor of (Triggering unit)), ((Armor of (Triggering unit)) x 1.00)))
      • Unit - Set Armor of (Attacked unit) to (MaxArmorPercentage - ((Armor of (Triggering unit)) x 0.01))
      • Wait 10.00 seconds
      • Unit - Set Armor of (Attacked unit) to MaxArmorPercentage
I want to reset the initial armor the unit had before attacking, but somehow it doesn't adds armor when the wait sequence ends.

I just want to reset the armor of the unit as it's inital armor before the attack action.

Help please, my knowledges are not so good for this, i already tried find a solution but i simply can't...

Thanks !
 
Last edited:
Level 4
Joined
Jul 26, 2017
Messages
66
Instead of directly triggering the armor change I would make a dummy cast faerie fire or inner fire with negative values to reduce the units' armour. that way you can just set the duration of the debuff spo it automatically falls off
 
Level 8
Joined
Dec 28, 2014
Messages
90
I think it can be fixed by using custom scripts.

  • Curse Tower Armor reduction 1
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Attacking unit)) Equal to Curse Tower 1
    • Actions
      • Custom script: local unit attacked = GetTriggerUnit()
      • Set MaxArmorPercentage = (Min((Armor of (Triggering unit)), ((Armor of (Triggering unit)) x 1.00)))
      • Unit - Set Armor of (Attacked unit) to (MaxArmorPercentage - ((Armor of (Triggering unit)) x 0.01))
      • Wait 10.00 seconds
      • Custom script: call BlzSetUnitArmor(attacked, udg_MaxArmorPercentage)
 
Level 6
Joined
Sep 24, 2015
Messages
174
Hmm, thanks for the help, but it's not working...

e.g : my tower attacks the unit then the unit loses 1% armor on each attacks during 30 seconds.

When the unit is not in range of the tower then all his armor come back, like it was before.

Cause actually reducing armor works. My unit had some armor items in inventory when he attacked, the unit drops the items and then it resets the armor yes but it counts with the items been on the inventory.

I just want to reset back the base armor.

here some scr shots of the steps, so you can understand it better maybe if i was not clear with my syntax :/


edit : in image 5 armor is "-22"
 

Attachments

  • 1.tga
    1.3 MB · Views: 67
  • 2.tga
    1.7 MB · Views: 58
  • 3.tga
    1.6 MB · Views: 58
  • 4.tga
    1.1 MB · Views: 60
  • 5.tga
    826.5 KB · Views: 86
Level 6
Joined
Sep 24, 2015
Messages
174
Still not reseting to the base armor, somehow it calculates the armor add by items and restore the same armor value when i drop the items... weird

Here,s the trigger :
  • Curse Tower Armor reduction 1
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Attacking unit)) Equal to Curse Tower 1
    • Actions
      • Custom script: local unit attacked = GetTriggerUnit()
      • Set MaxArmorPercentage = (Min((Armor of (Triggering unit)), ((Armor of (Triggering unit)) x 1.00)))
      • Unit - Set Armor of (Attacked unit) to (MaxArmorPercentage - ((Armor of (Triggering unit)) x 0.01))
      • Wait 10.00 seconds
      • Custom script: call BlzSetUnitArmor(attacked, udg_MaxArmorPercentage)
Edit : i rplaced (attacked unit) with (triggering unit)
 
Level 8
Joined
Dec 28, 2014
Messages
90
I think it happens like this:

- Hero base armor is 500
- Hero is attacked by tower, base armor is now 495
- After 10 seconds, base armor returns to 500

It looks fine now but what if it happens like this:

- Hero base armor is 500
- Hero is attacked by tower, base armor is now 495
- Hero is attacked by tower, base armor is now 490
- After 10 seconds, base armor returns to 495 (wrong)

If you drop an item.

- Hero base armor is 500
- Hero is attacked by tower, base armor is now 495
- Hero drops a 250 armor item, base armor is now 245
- After 10 seconds, base armor returns to 495 (wrong)

And also if the hero gains base armor through leveling up by gaining Agility. There is a high possibility to break the base armor again.

The remaining solutions I could think of to fix this problem are a lot more complicated.

I think Blizzard should add a feature where it can refresh to the base armor.

I suggest you should use an alternative for a moment like what Austrulex mentioned or use a bonus armor ability but with negative values.
 
Level 6
Joined
Sep 24, 2015
Messages
174
I think it happens like this:

- Hero base armor is 500
- Hero is attacked by tower, base armor is now 495
- After 10 seconds, base armor returns to 500

It looks fine now but what if it happens like this:

- Hero base armor is 500
- Hero is attacked by tower, base armor is now 495
- Hero is attacked by tower, base armor is now 490
- After 10 seconds, base armor returns to 495 (wrong)

If you drop an item.

- Hero base armor is 500
- Hero is attacked by tower, base armor is now 495
- Hero drops a 250 armor item, base armor is now 245
- After 10 seconds, base armor returns to 495 (wrong)

And also if the hero gains base armor through leveling up by gaining Agility. There is a high possibility to break the base armor again.

The remaining solutions I could think of to fix this problem are a lot more complicated.

I think Blizzard should add a feature where it can refresh to the base armor.

I suggest you should use an alternative for a moment like what Austrulex mentioned or use a bonus armor ability but with negative values.


possibiliby 3 is like this for me :


- Hero base armor is 500
- Hero is attacked by tower, base armor is now 495
- Hero drops a 250 armor item, base armor is now 495*
- After 10 seconds, base armor returns to 495 (wrong)

+4th thing happens :


- Hero base armor is 500
- Hero is attacked by tower, base armor is now 495
- Hero drops a 250 armor item, base armor is now 495*
- After 10 seconds, base armor returns to (-negative values)
- Hero pick up again items, hero base armor is now negative armor value + items armor value


Edit: And y i have an item that gives +1 agi and +1 strenght on every hit so y armor changes in same time the unit is hitted by the tower.

Maybe not doable as you said.

Thanks ayways guys !


Edit: okay i may have found the solution :
  • Curse Tower Armor reduction 1
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Attacking unit)) Equal to Curse Tower 1
    • Actions
      • Custom script: local unit attacked = GetTriggerUnit()
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 3) Equal to 3
        • Then - Actions
          • Unit - Set Armor of (Triggering unit) to ((Armor of (Triggering unit)) - ((Armor of (Triggering unit)) x 0.01))
          • Wait 10.00 seconds
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: it works
          • Unit - Set Armor of (Triggering unit) to ((Armor of (Triggering unit)) + ((Armor of (Triggering unit)) x 0.01))
        • Else - Actions
          • Do nothing
It even has 33% chance to activate the armor reduction if i did correctly.

And it works even when i add agility point per second to the unit.

It gives back the base armor + the stacked agility points !
 
Last edited:
Status
Not open for further replies.
Top