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

Ability that can be cast on an immune friend and not an immune enemy

Status
Not open for further replies.
Hello guys,

Is there an ability that i can you use that can target either a friendly or enemy unit AND it can target a friendly unit that has spell immunity but cannot target an enemy unit that has spell immunity.

For example:
A friendly Footman : Can be targeted.
An Enemy Footman: Can be targeted.

A friendly Infernal: Can be targeted.
An enemy Infernal: Cannot be targeted.


Thank you. :)
 
Level 12
Joined
Feb 5, 2018
Messages
521
Holy Light or Heal maybe?

I would use Channel. And use custom script to show error message when the target is not met.

EDIT:

Something like this

  • Spell check
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Channel
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) is Magic Immune) Equal to True
          • ((Target unit of ability being cast) belongs to an enemy of (Owner of (Triggering unit)).) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Channel for (Triggering unit)) Equal to 1
            • Then - Actions
              • Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + 65.00)
            • Else - 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)
          • Set VariableSet ErrorSound = ErrorSound
          • Set VariableSet ErrorMessage = Can't target spell immune
          • Set VariableSet 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: endif
          • Custom script: call StartSound(udg_ErrorSound)
          • Custom script: endif
          • Skip remaining actions
        • Else - Actions
 
Last edited:
Level 12
Joined
Feb 5, 2018
Messages
521
Totally forgot it needs to be based on a spell that can target magic immune. I based it on ensare in my version.

And here it is. I gave footmans spell immunity, there are 2 paladins with ensare and it can target friendly units too.

Feel free to try it out :)
 

Attachments

  • TestAbilityCheck.w3m
    19.1 KB · Views: 13
Status
Not open for further replies.
Top