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

Cripple on strike

Status
Not open for further replies.
Level 36
Joined
Feb 5, 2009
Messages
4,630
I want an ability where on each attack a unit has a 20% chance to reduce the target unit's attack (attack only, no speed :p). I tried using the Slow Orb ability, but encountered the problem of it not wanting to work consistantly. I first of all tested it with 100% chance, but it would do nothing unless I actually targeted a unit or ordered it to attack move. I'm not sure if this is easily fixed or not, but I do know that I would like to use the Slow Orb ability if it weren't for that inconvenience.

My other alternative was to do it with a Dummy Caster via triggers, but this leads to another problem, which is much worse. The way I've done it causes 2 problems at the moment: One, it over rides the attack, simply reducing the attack of the enemy without dealing any damage (which is not what I want), and two, the Dummy Caster has a tendency to stay there, for what reason I do not know.

If anyone has the answer to this question, plz help me as soon as possible. Thanks in advance.
 
Level 3
Joined
Apr 24, 2005
Messages
61
My suggestion would be to mess around with the values for the spells, but I guess you've already tried that.

Try posting how you did spell/dummy spell along with a description of what it is, precisely, you want. It's easier giving feedback when you have the product in need of feedback in front of you.
 
Level 11
Joined
Feb 16, 2009
Messages
760
Use this trigger
Example.jpg


Edit cripple's data fields to get the desired effect.
 
Level 3
Joined
Apr 24, 2005
Messages
61
Oops , aw well its clear. Rest of trigger is correct right?

It looks right, except that under some circumstances it would bug. If the attacking unit had an attack range of 1000 and cripple range is what, 5-600?
Create the unit at position of attacked unit to prevent that scenario.

But that's circumstance specific, the above would of course work in melee combat.
 
Level 36
Joined
Feb 5, 2009
Messages
4,630
Sorry, Child of Bodom, but that's what I tried using in the first place. The trouble with the Orb Effect (this is also to you, I0git3c) is that it requires the player to right-click an enemy for there to even be a chance of the effect happening. However, that is interesting that the system can be tripped. Apart from that glitch, I've got it working 100%. Well, there is also another small detail, which must be dealt with.

You see, this is in fact a unit ability, and many units are going to be casting the ability. With that in mind, the trigger waits 1 second before removing the last created unit (which is essential for the unit to actually be able to cast its dummy ability). So, I made it that all dummy casters go into a unit group and are removed all at the same time. This means, unfortunately, that if a dummy caster is removed before it gets to cast its ability, the ability... won't be... cast... well, that's kind of obvious after how I started that sentence...

However, I think that is a minor inconvenience and can probably make it better by only removing the units that are owned by that owner of the attacking unit. The main issue now is what I0git3c has brought up (thx, BTW). How do you mean a damage detect system? Do you mean a condition that simply checks if the attacked unit has taken damage or not? Or do you mean something more complex? I'll try seeing what I can do, but I doubt I'll get that far (I usually take a while to think of a fix in the triggers, and when I do it's never really 100% functional... :'( 'Tis my bane).

Oh, and to M4stah and Jerrin, thx for the original trigger XD! Really helpful! I had something similar (minus the number check just for testing, although I was thinking of having a variable, so I'm glad you showed me that as it saves me a bit of trouble XD), but I think the main problem was not giving the dummy caster 1 second to actually cast the spell :p. Thx guys, I'm happy with this feedback! Now all that's left is that system...
 
Level 36
Joined
Feb 5, 2009
Messages
4,630
Well, Smiddle, I had a look for that event that says a unit takes damage, but there was none. I think it dissappeared just to peeve me... lol, jks. It's not there, anyway, nice suggestion, anyway. However, I did manage to find a solution. After an initial problem of making an integer comparison and seeing if the damage taken was greater than 0, I realised that instead of converting real to integer for the purpose of such a condition I could just do a real comparison. So, now it works like a dream XD! Thanks all, you've been a great help! Consider this post 'Solved'!

Oh, and I wouldn't want to leave without saying what it's for (I don't know why I didn't say it earlier, sry). Basically, me and Gjallarhorn are working on a HoMM mod and I was trying to finish the Black Knights/Death Knights Curse ability where there is a 20% to reduce the enemy's attack on a strike.

Additional: I also managed to completely hide the casting unit and made it so it can't be selected by classifying it as a tree and a ward. I think classifying it as a ward may be pointless, but it's not going to hurt if I keep it like that :p. Thanks again, guys, very much appreciated!
 
Level 6
Joined
Jan 27, 2007
Messages
208
  • Actions
    • Trigger - Add to (Your Trigger) the event (Unit - (Attacked unit) Takes damage)
this is the event

but as far as i know, it will leaks in GUI no matter what, so you must do it in JASS if you still want to use detect damage system
 
Level 8
Joined
Mar 12, 2008
Messages
437
Well, Smiddle, I had a look for that event that says a unit takes damage, but there was none. I think it dissappeared just to peeve me... lol, jks. It's not there, anywas, nice suggestion, anyway. However, I did manage to find a solution.

Argh, I keep forgetting that there is no event such as "a unit takes damage", only "(specific unit) takes damage". It is however possible to make two triggers; one for the trigger itself and another that adds something like "Triggering unit takes damage" to the first trigger. Probably leaks as hell however.
 
Status
Not open for further replies.
Top