• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Spell] Selective Spell Immunity?

Status
Not open for further replies.
That's just for targeted spells, though. For AOE and other affects you'll probably have to check on a per-spell basis.

Sorry, but can you elaborate on that a bit more? This is the first time I'm trying to make a spell like this so I don't really know how to go about it without detailed instructions.

Oh, and I have a question about the first trigger...if you were playing against the AI, wouldn't that make it stop periodically or something like that? Because the AI wouldn't know you have a spell immunity passive and thus would just stop and then try to cast the spell again on you?
 
If AI is an important part of your map, you'd have to re-order the AI to do something else.

Do you intend to use this more for standard abilities? My earlier statement was based on the assumption that almost all abilities would be custom.
If indeed so, maybe you can try this:
whenever a unit starts the effect of an ability targeting the immune unit, you temporarily give it the real Spell Immunity ability to negate the effects. Or a dummy unit that casts Anti-Magic Shell.

Basically, it's not really an easy thing to make. There are a lot of workarounds involved.
 
Yeah, the AI is an important part of the map. The spell immunity would only apply to standard abilities. And yeah, making the spell isn't as easy as I first thought it would.

Anyway, would adding the magic immune classification to the unit work? If not then I'll add the real spell immunity to negate the effects.

As for non-target spells, what if I pick every unit within the playable map, or at least within a certain distance of the caster with the condition of having the selective immunity and add real spell immunity the moment an enemy casts a spell?

If that works, for how long should the spell immunity last? And what when multiple enemies cast a spell? Wouldn't that interfere with allies targeting the unit?

Edit: Actually, I think I found a better way. What if I put spell immunity in a disabled spellbook and every time an enemy unit casts a spell, I add it to the unit and every time an ally casts a spell, I remove the spellbook? Would that work?
 
I've just done some tests using variations of:
events - order, starts effect of ability, beings casting ability
actions - add/remove spell immunity (instantly), add/remove invulnerability (instantly), order caster to stop.

None of these work. I'm trying a few more things.

EDIT: here's a method that sort of works:
  • spell immune
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Set writeIndex = (writeIndex + 1)
      • Set immuneUnit[writeIndex] = (Target unit of ability being cast)
      • Wait 1.00 seconds
      • Set readIndex = (readIndex + 1)
      • Unit - Add Spell Immunity to immuneUnit[readIndex]
      • Unit - Remove Spell Immunity from immuneUnit[readIndex]
It's a delayed spell immunity - 1 second after a spell is cast, the target receives spell immunity. The test map had banshees vs sorceresses, and both succeeded in losing the buffs. Then you'd have to work mana/cooldown refunds into it somehow.

The other problem we have is damage abilities.
 
You could try a different route without any triggering but requires more object editor work.
Make all unit spells that can target allies be able to target magic immune units. This can be done by changing the ability to a hero spell, setting the required level to 2, and then changing the ability back to a unit spell.

This wouldn't really work well for hero abilities and wouldn't be appropriate for all abilities like those that can target allies and enemies.
 

Attachments

The troll is not supposed to be able to use Inner Fire on the spellbreaker like the spell tooltip says; only the priest can.

My above post stated the method to make an ability target a magic immune unit. If you didn't understand, this is the basic object editor work for a unit ability:

  1. Set Stats - Hero Ability to true.
  2. Set Stats - Required Level to 2.
  3. Set Stats - Hero Ability to false.
 
Status
Not open for further replies.
Back
Top