• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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 13
Joined
Feb 5, 2018
Messages
567
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 13
Joined
Feb 5, 2018
Messages
567
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: 18
Status
Not open for further replies.
Top