HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

"Unit Takes Damage" - Changing the 'unit'.

08-05-2007, 08:11 PM#1
Damage
Greetings, I'm currently in th early stages of creating a World of Warcraft Hero arena, where the player selects one of the 9 classes from World of Warcraft, and is then allied with other players and fights are played against one-another. At the end of a round, all the teams are randomised again, all hero levels are increased by 1, and gold is awarded to the winners. Gold is then used to buy items, and the 2nd round begins. After 30 rounds, the individual with the most points wins the game...


BUT..

One of the abilities in my game, Hemorrhage, increases damage taken from melee attacks by a set amount (increased by the level of the ability and the stats of the caster). Another ability, Divine Shield, makes the caster invulnerable, but unable to attack.

Divine Shield has a trigger which means that when something with the Divine Shield attempts to attack, it is told to Stop. The Hemorrhage checks for when a target is attacked with the debuff, and adds the appropriate extra damage.

The issue I have is, when Divine Shield is active, the unit re-acquires its target immediatly and attacks again, and is told to stop again... reacquires. Etc etc. If the target has Hemorrhage, the individual is spammed with extra damage from Hemorrhage due to the Event being "A unit is Attacked".

I noticed in the trigger editor that it is not possible to set a defineable variable as "<Unit> Takes Damage". It only accepts units that are already placed on the map, which obviously, is completely useless as the Hemorrhage ability could be applied to loads of different targets which will not be placed before the start of the game.

So... a solution to the problem will be nice, but I have *no* experience of JASS coding, only Warcraft 3's trigger coding (which I'm very familiar with), so if you suggest JASS, you'll have to give me the exact coding.

Thanks.

(Damn that was longer a post than I expected O.o)

EDIT: I've noticed a lot of people are having problems with this, but I think the "Trigger - Add Event" function would not work in my case, as the ability also has to be removed, and some units will enter the game without triggers spawning them (such as say, A totem spell for the shaman hero does not spawn its totems with triggers), and if a unit is hemorrhaged once, the buff fades and is reapplied later, the trigger would go off twice due to duplicate events on one trigger = /
08-09-2007, 02:18 PM#2
Vexorian
You'll have to learn Jass eventually.

And after finding such weakness in GUI is the perfect time to start.

This is actually hard (yes) you need a dynamic trigger and to use gamecache or something to attach to the trigger.

---

Nah, know this: Even with the best Jass solution for this, you won't have an easy way to recognize whether the hit was from a melee weapon or not.

There are a couple of abilities like hardened skin and (defend (item)?) that passively block or reduce damage. Do a research, you can then just add the ability temporarily with a trigger.
08-22-2007, 10:54 PM#3
Damage
Quote:
Originally Posted by Vexorian
Nah, know this: Even with the best Jass solution for this, you won't have an easy way to recognize whether the hit was from a melee weapon or not.
Well, actually that bit was very easy. The GUI has a condition "Unit is a melee attacker equal to True/False".

About the rather extremely difficult hit-scan thingy-ma-jigger, I've decided instead to go for an unconvential route:
The paladin instead when he activates divine shield spawns a dummy unit with a 20000 range aura which only affects player units (player will only own the paladin in the game anyway) which reduces his attack speed by a massive amount. Reduces it so much in fact that he'd only get at maximum 1 attack in the entire duration of the shield - more or less not being able to attack.

So, the trigger works as it did before: increases melee damage, but now I've removed the hideous extra damage spam when teamed with the paladin. I've also put a nifty timer on it (sets a variable to false when triggered, and back to true after 0.5 secs) to stop a player abusing it by repeatedly pressing the Stop command.

Well, thanks for the reply anyways
08-22-2007, 11:01 PM#4
Pyrogasm
Quote:
Originally Posted by Damage
Well, actually that bit was very easy. The GUI has a condition "Unit is a melee attacker equal to True/False".
Yes, but a melee attacker can still cast a spell that deals damage.
Quote:
Originally Posted by Damage
About the rather extremely difficult hit-scan thingy-ma-jigger, I've decided instead to go for an unconvential route:
The paladin instead when he activates divine shield spawns a dummy unit with a 20000 range aura which only affects player units (player will only own the paladin in the game anyway) which reduces his attack speed by a massive amount. Reduces it so much in fact that he'd only get at maximum 1 attack in the entire duration of the shield - more or less not being able to attack.
It would be better to use a cripple-based dummy ability so you don't have to deal with the aura refresh rate.