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?
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?
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?
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...
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>
I have the solution for the defend spell. It's a template I made long time ago but which will prove extremely useful if you know how to use it of course. I did my best to explain its implementation.