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

Magic Immunity research

Status
Not open for further replies.
Level 9
Joined
Mar 1, 2009
Messages
280
i can't find anything on this but how do allow magic immunity only through research?

i train dragonspawn

dragonspawn isn't immune

research magic immunity upgrade

dragonspawn is now magic immune

the current spells night elf and neutral magic immunity don't work....

is their any other way other than replacing the unit? or triggering them to gain magic immunity 1 by 1?
 
Level 9
Joined
Mar 1, 2009
Messages
280
yea I'm saying that's not working.... am I altering the wrong spell immunity?

what happens is that the passive ability looks like it requires research but then in reality the unit is immune to spells regardless of the research...

Does it work for you guys?
 
Last edited:
Level 21
Joined
Mar 29, 2020
Messages
1,237
this is an interesting bug.

I tried it too. with both the unit ability and the item version.

it seems magic immunity is hardcoded to always apply even if it is supposed to be dependent on an upgrade. it even has the tooltips demanding that it needs the upgrade, but applies anyways.

The simplest way around this would probably be to have a dummy "magic immunity" spell that needs the upgrade but actually does nothing, and apply the magic immunity with triggers.
 
Level 19
Joined
Feb 27, 2019
Messages
590
Yea, I tried using the Spell Immunity (Item) ability that requires a research aswell but the units were already immune to magic before it was researched.

Can be triggered like this instead:
When Magic Immunity is researched add the Spell Immunity (Item) to the units that already exist in the map.
Change a boolean from UpgMagicImmune() = false to UpgMagicImmune() = true
Have another trigger that checks for new units of that kind that enter Playable map area and if UpgMagicImmune() = true then add the Spell Immunity (Item) to those units.

If that works the last part is to hide the ability in the interface.

However now that I read a bit closer what you said... I bet some kind of research like Troll Berzerker upgrade that replaces the unit with a new unit that has the ability SHOULD work aswell. One could even play around with the Chaos ability requiring a research.
 
Last edited:
Status
Not open for further replies.
Top