• 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.

Reduced Magic Damage

Status
Not open for further replies.
Level 13
Joined
Oct 27, 2008
Messages
1,176
A friend is bugging me to make a skill on a character that is passive with chance on being hit to reduce spell damage for X amount of time (Skill effects amount of time)
Is it possible and how do you do it with GUI?
 
Level 27
Joined
Jul 6, 2008
Messages
11,326
There is an ability like this already. Check out that Mountain Giant or whatever unit, it has an ability that decreases recieved damage by percentage, you can set chance to reduce damage, both magical and physical damage can be set and lots of other stuff can be changed too. So try it out, no need to code or whatever.
 
Level 20
Joined
Oct 21, 2006
Messages
3,230
There is an ability like this already. Check out that Mountain Giant or whatever unit, it has an ability that decreases recieved damage by percentage, you can set chance to reduce damage, both magical and physical damage can be set and lots of other stuff can be changed too. So try it out, no need to code or whatever.
Also no need to read the whole starting post.
 
Level 8
Joined
Aug 21, 2009
Messages
333
  • trigger
    • Events
      • Unit - <PUT HERO HERE> Takes damage
    • Conditions
      • Remaining time for <SPELL COOLDOWN> Equal to 0.00
      • (Random Percentage) Less than 30.00
      • (Level of <HERO ABILITY HERE> for (Triggering unit)) Greater than 0
    • Actions
      • Unit - Add <SPELL DAMAGE REDUCTION> to (Triggering unit)
      • Countdown Timer - Start <SPELL COOLDOWN> as a One-shot timer that will expire in 30.00 seconds
      • Wait - 5.00 Seconds
      • Unit - Remove <SPELL DAMAGE REDUCTION> from (Triggering unit)
<PUT HERO HERE> is the specific unit with this ability (I'm assuming only one unit will have the ability because this spell can't be MUI without using JASS)
<SPELL COOLDOWN> is a timer variable that you will need to create
<SPELL DAMAGE REDUCTION> is a spell - base it off of the ability that the item Runed Bracers has
<HERO ABILITY HERE> is the hero spell you are making

You can adjust this to make it handle different levels of the spell. I can help you more if that doesn't make sense.
 
Level 13
Joined
Oct 27, 2008
Messages
1,176
Thank you Wont be able to try or test this till 2morrow cause I was just kicked off the computer that can run Warcraft 3
 
Level 13
Joined
Oct 27, 2008
Messages
1,176
Can't be a specfic unit cause the unit doesn't start on the map its created once pick and idk how to setup a variable for that or doesn't seem to like me
 
Level 13
Joined
Oct 27, 2008
Messages
1,176
So this should work right?
  • MD Start
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Soul Mage (Select)
      • (Level of Channel for (Triggering unit)) Greater than or equal to 1
      • (Integer((Remaining time for MD_Time))) Equal to 0
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 5) Equal to 1
        • Then - Actions
          • Set SoulMage = (Triggering unit)
          • Trigger - Run MD Effect <gen> (ignoring conditions)
        • Else - Actions
          • Do nothing
  • MD Effect
    • Events
    • Conditions
    • Actions
      • Countdown Timer - Start MD_Time as a One-shot timer that will expire in (Real(((Level of Channel for SoulMage) x 5))) seconds
      • Set MD_Time = (Last started timer)
      • Unit - Add Spell DR to SoulMage
      • Unit - Set level of Spell DR for SoulMage to (Level of Channel for SoulMage)
      • Wait (Real(((Level of Channel for SoulMage) x 3))) seconds
      • Unit - Remove Spell DR from SoulMage
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
What's the purpose of having 2 triggers when you can put actions from MD Effect instead of Run Trigger function in MD Start.
Do it like this:
  • MD Start
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Soul Mage (Select)
      • (Level of Channel for (Triggering unit)) Greater than 0
      • (Integer((Remaining time for MD_Time))) Equal to 0
      • ((Attacking unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True
      • (Random integer number between 1 and 5) Equal to 1
    • Actions
      • Countdown Timer - Start MD_Time as a One-shot timer that will expire in (Real(((Level of Channel for (Triggering unit)) x 5))) seconds
      • Unit - Add Spell DR to (Triggering unit)
      • Unit - Set level of Spell DR for (Triggering unit) to (Level of Channel for (Triggering unit))
      • Wait (Real(((Level of Channel for (Triggering unit)) x 3))) seconds
      • Unit - Remove Spell DR (Triggering unit)
 
Last edited:
Level 13
Joined
Oct 27, 2008
Messages
1,176
Um I put a buff on the Spell DR in hopes of it to be shown when the trigger works but the buff never shows up I even put it at 100% chance of going off and I still cant see if its working or not and the ability isnt showing on the hero at all
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
Remove these condition for testing purposes:
  • (Unit-type of (Triggering unit)) Equal to Soul Mage (Select) //this may return false if it's not the unit you're attacking
  • (Level of Channel for (Triggering unit)) Greater than 0 //remember to set your ability instead of channel
  • (Integer((Remaining time for MD_Time))) Equal to 0 //this should work,but try without it for test
 
Level 13
Joined
Oct 27, 2008
Messages
1,176
okay how about this the Spell Reducation as a normal Hero skill
how can I get the Icon to stay on the hero once learned.
(Friend changed his mind and going with a Perma - spell damage)
Sorry about all of this over one damn skill. just my friend wanted a Soul Mage and his designing it I'm just stuck making it seeing how he dont know anything about the editor XD
 
Level 13
Joined
Oct 27, 2008
Messages
1,176
Well I have the icons set for the skill but once the Hero learns the skill it doesnt show up as learned just that you can upgrade it with skill points
 
Status
Not open for further replies.
Top