• 🏆 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!

[Spell] A unit takes damage issue - disease cloud - GUI (~SOLVED)

Status
Not open for further replies.

deepstrasz

Map Reviewer
Level 69
Joined
Jun 4, 2009
Messages
18,828
Hey Hive, I'm having problems with one of my units being affected by disease cloud. I have a trigger that whenever that unit is hit it spawns four dummy units which deal damage to nearby enemy units.
I've tried putting any of these four as conditions:
  1. Damage Source is a Plagued Unit (Bolean Classification Check Condition)
  2. Damage Source is not a Disease Cloud Unit Type (Unit Type Condition)
  3. Damage Source does not have Disease Cloud (Bolean Unit Buff Condition)
  4. Damage Source does not have Disease (Bolean Unit Buff Condition)
(two disease buffs because one is on the unit which has the spell and one on the affected unit)
but when affected by an enemy unit's disease spell, my unit spawns those four dummies.

Any ideas how I can bypass this through GUI?
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
You can't really detect where the damage came from, unless you prepare it before dealing damage in some way. This is not possible with most standard abilities though.
If you trigger the damage or use a dummy ability in a certain way you can detect the damage came from a certain ability. I don't see this being possible with Disease Cloud though.
Triggering it is also quite much work.

Assuming that Disease Cloud deals very little damage you could make a minimum damage requirement.
Otherwise use a very uniquie damage number for Disease Cloud. Let's say your disease cloud deals 1 damage, change it to 1.01 and make a condition damage not equal to 1.01
The likelyhood of anything else dealing exactly 1.01 damage is quite low.
Remember that heroes and archers take less damage from disease cloud. Runed Bracers can also reduce the damage.

Alternatively, if you use Damage Engine, you can make things like let disease cloud deal like 11435 damage. Then you can easily detect Disease Cloud (no other thing will deal this amount of damage) and revert the damage to the actual damage you want using the Damage Engine.
 

deepstrasz

Map Reviewer
Level 69
Joined
Jun 4, 2009
Messages
18,828
Assuming that Disease Cloud deals very little damage you could make a minimum damage requirement.
Otherwise use a very uniquie damage number for Disease Cloud. Let's say your disease cloud deals 1 damage, change it to 1.01 and make a condition damage not equal to 1.01
The likelyhood of anything else dealing exactly 1.01 damage is quite low.
Remember that heroes and archers take less damage from disease cloud. Runed Bracers can also reduce the damage.
Good stuff although as you've written it's very dependent on damage resistance.

Another possibility would be to set the level of Disease Cloud to a (high) level no unit has.
Tried it but doesn't work because I guess Disease Cloud isn't considered the unit that actually deals damage to the hero. It's not the unit that deals damage but the ability. I guess that means an internal trigger or something.
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
the problem with this is, that there are really only 3 things you can get from the "a unit is damaged"-event:
damage source: this unit could deal damage through another ability, by attacking or even by thorns aura, so this information is useless
damaged unit: does not tell us anything where the damage came from
damage amount: by default this does not help us either, but you can use some special values for disiease cloud only, that are unlikely to be used anywhere else

Disease Cloud is a very complex ability. There are a lot of different possibilities to apply it.
Abomination for example has an aura and creates the Disease Cloud unit if it dies, if I remeber correctly
Meat Wagon creates the Disease Cloud unit at the attacked location

Abomination and Meat Wagon seem to be the damaging units. However if they die and decay, the damage over time effect persists, but the damage source is undefined. Because of this damage source is even more useless.

So my best idea is to use a ridiculous number and correct it with Damage Engine. Damage Engine is a really great tool and works without any problems even in these extreme scenarios from my experience.
 

deepstrasz

Map Reviewer
Level 69
Joined
Jun 4, 2009
Messages
18,828
damage amount: by default this does not help us either, but you can use some special values for disiease cloud only, that are unlikely to be used anywhere else
Yeah, but how do I get past the armour and magic resistance to get the exact amount? I don't think I could make disease deal chaos damage. A higher damage isn't a good idea as I am working on something based on melee Warcraft III.
Abomination for example has an aura and creates the Disease Cloud unit if it dies, if I remeber correctly
Not only. It also works like Immolation but the buff remains on the affected unit for the specified period and damage is dealt each second to it.
Damage Engine is a really great tool and works without any problems even in these extreme scenarios from my experience.
Thanks but seems a bit too much for me right now.
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
Yeah, but how do I get past the armour and magic resistance to get the exact amount? I don't think I could make disease deal chaos damage. A higher damage isn't a good idea as I am working on something based on melee Warcraft III.
Disease Cloud deals spell damage, so by default is reduced by 30% against hero armor and is further reduced by Runed Bracers or Elune's Grace. Armor does not reduce damage.
Using the Damage Engine, you can have high damage in the ability. Let's say 25000 damage.
You have a trigger that fire when a unit is damaged.
If the damage is > 10000 (25000*0.7*0.67=11725 > 10000) you know that the damage came from Disease Cloud.
If that is the case, you use the damage engine to change the damage back to 1 or whatever you want.
If the damage is not > 10000, you do the actual effect you wanted to trigger.

It is important to note that this should run before any other trigger that runs from damage events. Otherwise other triggers that use the damage engine event will think the damage was > 10000
So basically I only use the insanely high number to detect, that the damage comes from Disease Cloud. It should in no way affect gameplay in any way.


disease cloud damage is 25000 per second

a unit is damaged

if damage > 10000
set damage to 1 * (damage dealt / 25000)
else
if damaged unit has your spawn ability
spawn units, deal damage

run all other "a unit is damaged triggers"

Not only. It also works like Immolation but the buff remains on the affected unit for the specified period and damage is dealt each second to it.
That's what I meant, but I expressed it a bit unclear.

Thanks but seems a bit too much for me right now.
Damage Engine is not that hard to use. It's probably the best GUI-friendly Damage Detection System.
I have attached a map that shows how this will work. Disease Cloud damage is set to 25000 and Damage is changed as if Disease Cloud would deal only 1 damage.
 

Attachments

  • Detect Disease Cloud.w3x
    35 KB · Views: 55

deepstrasz

Map Reviewer
Level 69
Joined
Jun 4, 2009
Messages
18,828
@Jampion hey, thanks really but it's still cryptic to me whilst the reals are in that custom script trigger.
I succeeded in making it work with the condition: Damage Taken Greater than 1. But now I need to figure out how to make it work when Mana Shield is activated. It seems damage is transformed into some value or something. I mean if I cut the condition, the trigger works because the hero still takes damage but if I leave it, the Greater than 1 isn't valid anymore with Mana Shield on.

EDIT: I set the Greater Than to -1 and it at least worked with Mana Shield as if the condition wasn't there. Weird thing is if I set it to Greater Than 0 it doesn't work anymore. I tried lowering as much as I could but the max the editor can go to is -0.01 and I still get the four dummies spawned because of the cloud with Mana Shield on.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,197
Disease Cloud is one of 2 abilities I know of that are not negative healing abilities which do not deal damage. The other is Goblin Sapper Kaboom. They directly modify health and will bypass both armor type modification and mana shield. This means they might not trigger the damage event, similar to how being healed by negative healing will not trigger a damage event.
 

deepstrasz

Map Reviewer
Level 69
Joined
Jun 4, 2009
Messages
18,828
Disease Cloud is one of 2 abilities I know of that are not negative healing abilities which do not deal damage. The other is Goblin Sapper Kaboom. They directly modify health and will bypass both armor type modification and mana shield. This means they might not trigger the damage event, similar to how being healed by negative healing will not trigger a damage event.
Disease works with the A Unit Takes Damage trigger.
 

deepstrasz

Map Reviewer
Level 69
Joined
Jun 4, 2009
Messages
18,828
Guess it just has crazy damage mechanics then.
You could potentially reproduce it through triggers but it requires a lot of unit detection grouping and buff dummy casters while a periodic event deals checks for the buff and deals the damage through a dummy unit.
But yeah, seems pretty complex.

Mana Shield's damage absorbance is also weird. I mean, damage less than 0 is considered damage when having it on.

EDIT: It even works with equal to 0. So I guess the damage dealt to Mana Shield users is 0 and below :D, null?
 
Last edited:
Level 13
Joined
Jul 15, 2007
Messages
763
Meat Wagons and Abominations "own" the Disease Clouds they create, which means when these Disease Clouds cause damage, the "summoner" of these Clouds are the ones that get damage credit (and yes this is very inconsistent with all other abilities in the game with similiar function). My guess it is the way Disease Cloud is coded (the summoned clouds are locust-like whilst preplaced ones are typical units).

However, if you create a free floating Disease Cloud via a trigger or preplacement, then its the Disease Cloud that gets damage credit. You can use this to potentially filter out but you'd need to recreate Disease Cloud functionality on Abominations and Meat Wagons via triggers, i.e.
  1. When an Abomination dies, create a Disease Cloud (easy)
  2. When a Meat Wagon attacks ground, it spawns a Disease Cloud at the target location (possible)
  3. Abominations periodically plague nearby enemies like an aura (you would need to code this from scratch)
But you could be creative and redesign them slightly to make it easier for you e.g. if a Meat Wagon kills a unit, create a Disease Cloud, if an Abomination takes damage, create a Disease Cloud (10 sec CD).
 
Status
Not open for further replies.
Top