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

Ability doesn't work

Status
Not open for further replies.
Level 10
Joined
Sep 29, 2006
Messages
447
I've made an ability called defensive matrix, and basically it drains mana per second and give you increased armor. However, it doesn't seem to work when I have an item that increases armor. The way I made the ability was: I used immolation so I can get the mana drain per second and I just add and remove different abilities based on Item Armor Bonus (I think this is where the conflict arises). Basically if I have an armor increasing item and I use defensive matrix, no additional armor is added. Does anybody know why this is happening and how to fix it?

I don't think this is a trigger related issue but I will post them anyway:

  • defensive matrix on
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(immolation))
      • (Unit-type of (Triggering unit)) Equal to Shock Trooper
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Defensive Matrix (Shock Trooper) for (Triggering unit)) Equal to 1
        • Then - Actions
          • Unit - Add Defensive Matrix Armor Bonus (+4) to (Triggering unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Defensive Matrix (Shock Trooper) for (Triggering unit)) Equal to 2
            • Then - Actions
              • Unit - Add Defensive Matrix Armor Bonus (+6) to (Triggering unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Defensive Matrix (Shock Trooper) for (Triggering unit)) Equal to 3
                • Then - Actions
                  • Unit - Add Defensive Matrix Armor Bonus (+8) to (Triggering unit)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Defensive Matrix (Shock Trooper) for (Triggering unit)) Equal to 4
                    • Then - Actions
                      • Unit - Add Defensive Matrix Armor Bonus (+10) to (Triggering unit)
                    • Else - Actions
  • defensive matrix off
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Issued order) Equal to (Order(unimmolation))
      • (Unit-type of (Triggering unit)) Equal to Shock Trooper
    • Actions
      • Unit - Remove Defensive Matrix Armor Bonus (+4) from (Triggering unit)
      • Unit - Remove Defensive Matrix Armor Bonus (+6) from (Triggering unit)
      • Unit - Remove Defensive Matrix Armor Bonus (+8) from (Triggering unit)
      • Unit - Remove Defensive Matrix Armor Bonus (+10) from (Triggering unit)
  • defensve matrix mana check
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set TempGroup = (Units in (Playable map area) matching ((Unit-type of (Matching unit)) Equal to Shock Trooper))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Mana of (Picked unit)) Less than 3.00
            • Then - Actions
              • Unit - Remove Defensive Matrix Armor Bonus (+4) from (Picked unit)
              • Unit - Remove Defensive Matrix Armor Bonus (+6) from (Picked unit)
              • Unit - Remove Defensive Matrix Armor Bonus (+8) from (Picked unit)
              • Unit - Remove Defensive Matrix Armor Bonus (+10) from (Picked unit)
            • Else - Actions
  • defensive matrix death
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Shock Trooper
    • Actions
      • Unit - Remove Defensive Matrix Armor Bonus (+4) from (Triggering unit)
      • Unit - Remove Defensive Matrix Armor Bonus (+6) from (Triggering unit)
      • Unit - Remove Defensive Matrix Armor Bonus (+8) from (Triggering unit)
      • Unit - Remove Defensive Matrix Armor Bonus (+10) from (Triggering unit)
 
Level 9
Joined
Apr 3, 2008
Messages
700
1. Ye. Make loop.

loop
<...>
If level of Defensive Matrix (Shock Trooper) = i
Set level of Defensive Matrix Armor Bonus = i
<...>
endloop

2. In trigger defensive matrix off just set an ability to the level that will give no bonuses. It'll reduce lags.
 
Last edited:
Level 5
Joined
Nov 7, 2007
Messages
134
I'm not sure why it isn't working the way it is now, but I have two possible alternate solutions.

Create a dummy unit when the spell is activated and give it a modified Inner Fire (modified so that it only gives armor and has an infinite duration) and make it cast it on the casting unit. Then, when the spell is deactivated, remove the Inner Fire buff through triggers.

Also, what you could possibly do is creating a dummy unit with Devotion Aura that appears next to the casting unit when the spell is activated and then follows the caster around until spell is deactivated, then the dummy is removed. I'm not sure how well this would work though, because others could get armor bonuses as well from the aura.
 
Level 9
Joined
Apr 3, 2008
Messages
700
@PrisonLove: Optimization can solve many problems =)

@Dr Super Good: Yes, you right.

@Kingz: Skill based on Item Defence Bonus must work too, i've tried that way in my map.

PrisonLove said:
Actually I changed the trigger in accordance to what was suggested above and it seems to work for some reason. Thanks anyway.

[Solved]?
 
Status
Not open for further replies.
Top