• 🏆 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!

armor trigger not working

Status
Not open for further replies.
Level 5
Joined
Jan 22, 2023
Messages
51
I'd be delighted if someone would take a look and see why that doesn't work
  • Infernal Bulwark
    • Events
      • Unit - A unit starts the effect of an Ability
    • Conditions
      • (Ability being cast) Equal to Infernal Bulwark
    • Actions
      • Set Tempplayer = (Triggering player)
      • Set Tempunit = (Triggering unit)
      • Set Temppoint = (Position of (Triggering unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Tempunit has buff Infernal Bulwark ) Equal to True
          • (Tempunit has buff Infernal Bulwark Armor) Equal to False
        • Then - Actions
          • Unit - Create 1 Dummy for Tempplayer at Temppoint facing default building facing degrees
          • Custom script: call RemoveLocation(udg_Temppoint)
          • Set Dummy = (Last created unit)
          • Unit - Add Infernal Bulwark armor to Dummy
          • Unit - Add a 0.20 second generic expiration timer to Dummy
          • Unit - Order Dummy to Human Priest: Inner Fire Tempunit
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Tempunit has buff Infernalny Bulwark) Equal to False
            • Then - Actions
              • Unit - Remove Infernal Bulwark Armor buff from Tempunit
            • Else - Actions
        • Else - Actions
I'm afraid that maybe the trigger starts working before an unit gets the Infernal Bulwark buff, so it reads as "false" and nothing happens
 
Level 5
Joined
Jan 22, 2023
Messages
51
Yes I did double check it
Infernal Bulwark is based on the Illidan's spell that sets himself on fire but at the cost of mana. All i wanted to do is add armor while the Infernal Bulwark is active. That's why I wanted to do something like "if an unit has the infernal bulwark buff, then cast inner fire on the unit" also added the condition so the trigger will run only if the unit doesnt have inner fire on itself already (so it doesnt buff the unit infinitely, right. at least i think that it would work this way lol"
and at the end of the trigger i made (i think) that it will remove the inner fire from an unit as soon as the Infernal bulwark buff will come off (or the unit turns off the Infernal Bulwark because of the mana drain)

I think i just used wrong Event but I don't know tbh what event to use to make this work
 
Level 25
Joined
Sep 26, 2009
Messages
2,378
I'm afraid that maybe the trigger starts working before an unit gets the Infernal Bulwark buff, so it reads as "false" and nothing happens
You are correct here. When the 'Unit starts the effect of an ability' event has been fired, the target unit does not have a buff at that point. The unit will have the buff during the next frame. So what you would have to do is start a count down timer with 0.00 time, have another trigger that fires when that count down timer has expired and check there if the unit has buff.
  • Starts effect
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Inner Fire
    • Actions
      • Set VariableSet Target = (Target unit of ability being cast)
      • Countdown Timer - Start TestTimer as a One-shot timer that will expire in 0.00 seconds
  • Timer
    • Events
      • Time - TestTimer expires
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Target has buff Inner Fire) Equal to True
        • Then - Actions
          • //unit should have the buff at this point
        • Else - Actions
If I understand correctly your second post, you just want to add bonus armor while Immolation is active. Spells like immolation (and for example Footman's Defend) have two different orders for turning the ability on and off.
For immolation, turning on is done by order 'immolation' while turning off is done by order 'unimmolation'
So you could just make a trigger that checks the orders for a unit and add or removes bonus armor based on the issued order
  • ImmolationOrders
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Level of Your_Custom_immolation_ability for (Triggering unit)) Greater than 0
      • Or - Any (Conditions) are true
        • Conditions
          • (Issued order) Equal to (Order(immolation))
          • (Issued order) Equal to (Order(unimmolation))
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Issued order) Equal to (Order(immolation))
        • Then - Actions
          • -------- add bonus armor --------
        • Else - Actions
          • -------- remove bonus armor --------
Do note that if the caster has not enough mana to sustain active immolation, it will deactivate without issuing the 'unimmolation' order. But you can catch that by keeping track of the caster's mana
 
Also most abilities/buffs don't stack with themselves so you don't need to worry about checking if the unit already has the buff. You can test this yourself by getting a priest to cast inner fire on a unit then getting him to cast it again and see that the armour and damage remains the same and doesn't stack.
 
Status
Not open for further replies.
Top