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

[General] Trying to disable and enable attack

Status
Not open for further replies.
I know I can do it with silence, but I;m trying another method. To remove the spell and later add it. So I do this:

  • remove
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Custom script: call UnitRemoveAbilityBJ( 'Aatk', udg_pal )
      • Trigger - Turn off (This trigger)
      • Trigger - Turn on add <gen>
+
  • add
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Custom script: call UnitAddAbilityBJ( 'Aatk', udg_pal )
      • Trigger - Turn off (This trigger)
      • Trigger - Turn on remove <gen>
Remove trigger removes it, but then when I press esc again attack is not added...

Edit: I tried to use cargo hold(orc burrow) with 0 capacity, but it only removes the attack icon, not the attack itself
 
Last edited:
Level 13
Joined
Mar 24, 2013
Messages
1,105
Yes, Attack cannot be added back once removed.

Also the point of Cargo Hold is so you can "disable" i.e. remove the ability to attack and then "enable" it again. So yes the UI of mindmg-maxdmg will still be there because all Cargo Hold does is suspend the ability to attack/hides the ability it does not remove it.
 
Level 8
Joined
Jan 28, 2016
Messages
486
Edit: I tried to use cargo hold(orc burrow) with 0 capacity, but it only removes the attack icon, not the attack itself

As @pOke stated, Cargo Hold (Orc Burrow) does indeed disable the Attack command when you add it to a unit; it won't be able to attack even though it still appears in the UI. And just to simplify your trigger, try this:

  • Disable Attack
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Cargo Hold (Custom) for (Triggering unit)) Equal to 0
        • Then - Actions
          • Unit - Add Cargo Hold (Custom) to (Triggering unit)
        • Else - Actions
          • Unit - Remove Cargo Hold (Custom) from (Triggering unit)
 
Status
Not open for further replies.
Top