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

Prevent Building from Being Repaired?

Status
Not open for further replies.
  • Undying Loyalty
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Possession
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Target unit of ability being cast)) Equal to Royal Guard
        • Then - Actions
          • Unit - Order (Triggering unit) to Stop
          • Custom script: if udg_ErrorSound == null then
          • Custom script: set udg_ErrorSound = CreateSoundFromLabel( "InterfaceError",false,false,false,10,10)
          • Custom script: endif
          • Set ErrorMessage = Can't target
          • Set ErrorPlayer = (Owner of (Triggering unit))
          • Custom script: if GetLocalPlayer() == udg_ErrorPlayer then
          • Custom script: call ClearTextMessages()
          • Custom script: call DisplayTimedTextToPlayer( udg_ErrorPlayer, 0.52, 0.96, 2.00, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n|cffffcc00"+udg_ErrorMessage+"|r" )
          • Custom script: call StartSound(udg_ErrorSound)
          • Wait 0.50 seconds
          • Custom script: call DisplayTimedTextToPlayer( udg_ErrorPlayer, 0.00, 0.00, 2.00, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n|cffffcc00"+udg_ErrorMessage+"|r" )
          • Custom script: endif
        • Else - Actions
 
Since Repair is just an ability you can always prevent it from being cast in response to the unit attempting to cast it:

A unit begins casting Repair -> Target of ability == Your building -> Order (Casting unit) to Stop

At least I THINK this works. You can also try to interrupt the issued Order as well.
Glad this is an option, though I am putting this a bit on the backlist but sounds good as an alternative. Tampering order is not something I am very keen on, but there are always times when it is needed.

  • Undying Loyalty
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Possession
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Target unit of ability being cast)) Equal to Royal Guard
        • Then - Actions
          • Unit - Order (Triggering unit) to Stop
          • Custom script: if udg_ErrorSound == null then
          • Custom script: set udg_ErrorSound = CreateSoundFromLabel( "InterfaceError",false,false,false,10,10)
          • Custom script: endif
          • Set ErrorMessage = Can't target
          • Set ErrorPlayer = (Owner of (Triggering unit))
          • Custom script: if GetLocalPlayer() == udg_ErrorPlayer then
          • Custom script: call ClearTextMessages()
          • Custom script: call DisplayTimedTextToPlayer( udg_ErrorPlayer, 0.52, 0.96, 2.00, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n|cffffcc00"+udg_ErrorMessage+"|r" )
          • Custom script: call StartSound(udg_ErrorSound)
          • Wait 0.50 seconds
          • Custom script: call DisplayTimedTextToPlayer( udg_ErrorPlayer, 0.00, 0.00, 2.00, "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n|cffffcc00"+udg_ErrorMessage+"|r" )
          • Custom script: endif
        • Else - Actions
I'll be honest, I am at a loss how Possession will assist this unless you refer to the exact same strategy that Uncle implicitly hints?

I'll keep both of the suggestions in my note.
 
Glad this is an option, though I am putting this a bit on the backlist but sounds good as an alternative. Tampering order is not something I am very keen on, but there are always times when it is needed.


I'll be honest, I am at a loss how Possession will assist this unless you refer to the exact same strategy that Uncle implicitly hints?

I'll keep both of the suggestions in my note.
Yes you just need to change from Possession to Repair. I have that trigger on my map, Undying Loyalty is the name for this skill.
 
Status
Not open for further replies.
Top