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

Buff doesn't appear when I cast defend

Status
Not open for further replies.
Level 4
Joined
Jun 10, 2011
Messages
81
I know there are a lot of threads how to modify the defend ability that it blocks all incomming damage
but i have one problem
my defend shall be a hero one with 8 levels 5,10,15,20,25,30,35,40% block of incomming damage

I created a buff for each level and 8 extra abilities for the dmg reduce one for each level
but my buff doesnt appear when i cast my defend
why?

or are there other ways to do it over triggers?
so I mean that every level gets it own added ability
but I dont know how to check the level of the casted spell
 
If you wish to create ability that blocks all imcoming damage (or a % of it) it's not a wac3 ladder defence, it will ignore melee attacks. you have to trigger it, and use damage detection system. Since i see that u aren't experienced enough, i recommend GUI friendly damage detection: here.
You will quickly get how to use it, if you read the instruction, and after just use Action that Sets unit life to Current life of given unit + 40% of damage taken - which means 40% damage was blocked.
 
Level 7
Joined
May 13, 2011
Messages
310
You must make sure that you have added your buff in the Stats - Buffs field for each level. If not, then it will obviously not show.
However, unfortunately there is no way to add buffs to a unit using triggers.

Still, to check the level of an ability for any other reason, use an Integer Comparison as a condition, like so:

  • Lvl 2 Holy Light
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Holy Light
      • (Level of Holy Light for (Casting unit)) Equal to 2
    • Actions
      • Game - Display to (All players) the text: (Level 2 Holy Light is being cast upon a + (Name of (Target unit of ability being cast)))
 
Level 4
Joined
Jun 10, 2011
Messages
81
thank you puggsoy for that
it seems logical for me but it still does not work

my trigger looks now like this

  • Defend Level 1
  • Events
  • Unit - A unit Begins casting an ability
  • Conditions
  • (Ability being cast) Equal to Defend
  • (Level of Defend for (Casting unit)) Equal to 1
  • Actions
  • Unit - Add Defend Trigger 1 to (Casting Unit)
"Defend" is now my hero spell
"Defend Trigger 1" is a modified version of Anubaraks passive


I tried it now with "unit begins casting an ability" and also "unit starts the effect of an ability" but it still does not work

my "buff" in the method I used before was a "Zauberverstärker" dont know the english name but in the object editor it is the section right of the ability section.

So why does my "Zauberverstärker" not appear if I activate my defend spell?

But thank you alot from this point
 
Level 7
Joined
May 13, 2011
Messages
310
Well I did a quick Google and figured that abilities that don't initially have buffs can't have buffs added to them. Apparently Defend is one of these. And, as I said earlier, there isn't a command to add buffs via triggers.
However, there is one way to add buffs to a unit through triggers. Make a dummy unit cast and ability on the unit which should have the buff, and make sure that the ability doesn't do anything except add a buff.

So, for example, you'd do something like this:

  • Defend Buff
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Defend
      • (Level of Defend for (Casting unit)) Equal to 1
    • Actions
      • Unit - Create 1 DefendDummy1 for Player 1 (Red) at (Position of (Casting unit)) facing Default building facing degrees
      • Unit - Hide (Last created unit)
      • Unit - Order (Last created unit) to Human Sorceress - Slow (Casting unit)
      • Unit - Kill (Last created unit)
In this we would assume that I have made a unit called DefendDummy1 who has an ability that casts your desired buff for Level 1 Defend. This spell is based off Slow, therefore we order the unit to cast it.
 
Status
Not open for further replies.
Top