• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

How shall I make this "Grudge" ability.

Status
Not open for further replies.
Level 3
Joined
Jul 15, 2004
Messages
48
I am trying to make a spell that I saw suggested somewhere before (so maybe it is made already, which would be cool). It is a passive ability which I call Grudge, which basically causes the hero to do more damage when they have less health.

The way I would actually like it to work out is exactly like Critical Strike except instead of a set chance to strike (like 15%) it would be variable based on the hero's health so if they have 30% health left they have a 70% chance to do double damage for example.

I have thought this over endlessly but I'm having trouble actually finding a way to do it.
 
Level 3
Joined
Jul 21, 2004
Messages
20
Hmm... i can think of a way this could be done using the standard GUI triggers.

When the unit attacks, check if a random number between 1 and 100 is greater than or equal to the attacking unit's health %. If it is, then work out it's attack and subtract it from the attacked unit's health. Then create flating text equal to twice that amount in red with an exclamation mark after.
 
Level 9
Joined
Jun 10, 2004
Messages
594
Use two triggers; one that will set the damage and another one that will deal damage to the target:
1) To set the "set damage" trigger: when the unit is attacked use a formula of your choice to figure out how much additional damage you want your unit to do. Set that to the custom value of that unit. Add that unit to a unit group.
2) When a unit in that unit group attacks, set the life of the attacked unit to the life of the attacked unit - the custom value of the attacking unit.

~The_Raven
 
Level 3
Joined
Jul 15, 2004
Messages
48
Custom values are bad Raven. :wink:

Is there a way to determine the attack damage of a unit? That would be handy. Otherwise I think Critical Strike is the only way to multiply damage, rather than add damage. I was thinking I could check a random number from 1 to 100 and if it is higher than the hero's health I could add a modified critical strike ability to the hero that has a %100 chance of dealing x times damage but if it is below I would remove the ability, except the only way to trigger this is when the hero attacks, and then it would be adding the ability too late (it would work on the next attack) right? Is there a way to fire a trigger when a units health is changed? And another problem with my idea...if I'm adding and removing a modified critical strike is their a way to keep it from showing as a spell button on the hero?
 
Level 3
Joined
Jul 15, 2004
Messages
48
OK the best thing I have figured out for now is to run a trigger every 1 second, checking if the hero's health is below a random number and if so, adding a modified critical strike ability to the hero, else remove that ability.

It's not perfect but close. I'm worried though. is constantly adding and removing an ability on a unit every second hard on the cpu?
 
Level 1
Joined
Aug 14, 2004
Messages
7
dunno but it might be seriously complicated. You could make it so that the units str goes up as his hp falls, then reverse it as his hp rises. use hero-add atributes for this then use hero add atrributes with a negative integer... not sure how this would work though.... problem with wut u said above is that u couldnt make the ability better as the hero sinks valuable level up skills into that ability... so im not 100% sure at present...
 
Level 3
Joined
Jul 15, 2004
Messages
48
It works decently how I have it set up now, but I have a better idea. I just need to know how to add a hero ability that is already at a certain level. If you add an ability to a unit with a trigger it will just be at level 1 won't it? How do I add an ability that is researched to level 2 or 3???
 
Level 9
Joined
Jun 10, 2004
Messages
594
You could make a spell with just one level but with the stats of the level two spell, or you might be able to use the new Unit - Set Level of Ability for Unit function. However, you cannot add spells via Unit - Add Ability and be able to learn those spells.

~The_Raven
 
Level 2
Joined
Aug 24, 2004
Messages
18
I think this actually touches on a question I have.

Any timeframe for when this patch will come out or how to go about getting it now since you guys seem to already have it?
 
Status
Not open for further replies.
Top