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

Counter Attack

Status
Not open for further replies.
Level 3
Joined
Oct 30, 2005
Messages
51
Hey all, i thought of giving a custom spell to this unit called the defender, who is mostly full of defense spells. Basically, i thought that it would be pretty cool if i could create a spell where the defender would have a certain percentage to strike back at an enemy. I also wanted to add in this special effect such that when he counter attacks, there would be some kinda glowing light on him or something like that. The problem is, i cant figure out how to set the percentage thing and i also cant figure out where to base the spell off. . .Any help?Anybody?
 
Level 3
Joined
Oct 30, 2005
Messages
51
that's what i tried man. . .The problem is, it's not really realistic. . .Imagine yourself getting attacked and imagine yourself counter attacking every hit in a split second. . it's a bit strange isn't it? :?
 
Level 3
Joined
Oct 30, 2005
Messages
51
oh yea, i forgot to add this in. I also wanted to create a spell off the ability called defend, only that this one has an added characteristic. This defend is supposed to be something like the ability is activated and it drains mana per second. It also has to be something that absorbs damage. Like a percentage chance to completely "block" a hit. I also thought of adding the "defend" special effect to the spell, such that when the defender blocks a hit, there would be the special effect for defend being added to the shield. Any ideas how to carry out all that stuff? :idea:
 
Level 3
Joined
Oct 21, 2004
Messages
72
Event:
A unit is attacked
Conditons:
Unit being attacked is equal to <hero>
Random integer between 1 and 10 equal to 1
Actions:
Reduce attacking units health by <amount>
Add effects to attacked unit
etc...

Would that work?
 
Level 3
Joined
Oct 30, 2005
Messages
51
well. . .it might. . but the problem is, there must be a certain percentage. . i cant find a way to do that. . .and also another problem is the idea of trying to create an animation. . .i thought of somehting like this

event:
A unit is attacked(im not sure how to set percentage)
condition:
attacked unit has <ability>
action:
set unit attack cooldown to 0 sec (im not sure if this is possible. . .)
order attacked unit to attack attacking unit
wait for 0.5 seconds
set unit attack cooldown to <regular cooldown>

any guys got any opinion?
 
Level 3
Joined
Oct 21, 2004
Messages
72
The random integer takes care of the percent.

1 in 10 is 10%.

Ordering the unit to just do a normal attack also takes up an attack, unless that's what you want.

You only get so many attacks a minute, using one of them for a counter attack is probally defeating the purpose.

The best thing to do is order the animation in the direction of the unit he's counter attacking and then just do Unit>Set health to
 
Status
Not open for further replies.
Top