Spell Resistance

D

DsD)Core(

Guest
How do you put a percentage of spell resistance on items? You see, the thing is, I have alot of trigger enhanced spell that don't actually do spell damage but simply set the life of a target unit to X.

What would be a logical (I'm not saying easy, it doesn't have to be easy, as long as it works well) way to make a unit resist lets say 15% of the damage that any spell does to him if he carries item X that has this property?

What I started doing is making my event that catches a unit for my damage meter, also put the catched unit into a trigger that checks if the damage taking unit has the item with spell resist. If it does, it checks if it was the target of OR OR OR OR (any of my 40-ish spells I have in the map) and then supposed to check the amount of damage done, and give 15% back.

But half way when I was doing that, I thought there MUST be better way, since units can still die from abilities if they do more damage than the life they had, before the trigger can give the 15% back, right?

+++rep for anything that will point me in the right direction, big thanks in advance.
 
D

DsD)Core(

Guest
Yeah I got that far but how would you do it for huge spells that are scripted with life substraction rather than spell damage? Or would I really have to rework those spells?
 

Tiber

Member
Reaction score
4
You can add an If, Then, Else function to check if the unit has the item which reduces spell damage, and multiply the end result of the damage done by '1 - 0.33' (assuming 33% is the spell resistance value). Of course, that means you have to do it for every triggered spell with life substraction. Note that you might run into problems when the spell doesn't contain the caster in the event fields, but there are ways around this. Then again, if your spells aren't very complex, you shouldn't have any problems.
 
D

DsD)Core(

Guest
Hehe alot of them really are complex, but if I recall correct I only used life substraction for two spells. Rescripting that is then. I was too lazy to use dummies because they were already alot of work and used life substraction. Now I'll just make dummies anyway and change it to spell damage and I guess everything will be fine.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top