Damage detection from normal attacks with GUI

Status
Not open for further replies.
Level 4
Joined
Nov 18, 2021
Messages
41
Is there a way I can make game check whether or not unit took damage from normal attack without using code? The "unit is attacked" event can be cheesed by stopping the attack in the middle..
 
Level 4
Joined
Nov 18, 2021
Messages
41
I thought about using orb effect that does nothing besides applying buff on attack, but theres no event that checks if a unit got a buff either, which is frustrating.
I can't make the game check 1000+ uinits on the map on whether or not they have an orb effect on them every 0,01 seconds or it will lag as hell
 
Level 4
Joined
Nov 18, 2021
Messages
41
Whats the reason for not wanting to use code? Have you considered using a damage engine like Damage Engine 5.7.1.2 ?
I don't want to use any code because its like using stuff u don't understand. I want to understand what I'm doing
On the other hand, I hate programming so I don't want to learn JAAS, unless my qustion can be fixed with just a couple of lines of code.
 
Level 12
Joined
May 7, 2008
Messages
346
I don't want to use any code because its like using stuff u don't understand. I want to understand what I'm doing
On the other hand, I hate programming so I don't want to learn JAAS, unless my qustion can be fixed with just a couple of lines of code.

You don't have to learn Jass to use Bribe's Damage Engine.

Even a dummy like me understands it to a certain point and I'm a 100% GUI user.

Here's a simple demonstration of how his engine works:

  • Game - DamageEvent becomes Equal to 1.00
You use this whenever you want to identify any type of damage in the game, be that spell, ranged, melee, physical, etc.

  • IsDamageAttack Equal to True
This identifies if the damage is attack.

  • (Owner of DamageEventTarget) Equal to Player 9 (Gray)
This determines who's the owner of the damage. (just an example)

DamageEventTarget - units who take the damage
DamageEventSource - units who are dealing damage

And then you can use any type of action to your benefit from this point onward.
 
Level 4
Joined
Nov 18, 2021
Messages
41
Ok, I've managed to use orb effect to bypass the need to use code.
The logic behind the ability is simple - it steals 5 mana per attack.
Upon successful attack it slaps a buff that does nothing and lasts 60 seconds. It could last for less time, but I use it on a hero who has illusions and since buff-applying is an orb effect, illusions can't do it themselves
1638584414574.png

1638584289163.png

Thank god I've avoided code. Only took me about 6 hours.
 
Level 12
Joined
May 7, 2008
Messages
346
Ok, I've managed to use orb effect to bypass the need to use code.
The logic behind the ability is simple - it steals 5 mana per attack.
Upon successful attack it slaps a buff that does nothing and lasts 60 seconds. It could last for less time, but I use it on a hero who has illusions and since buff-applying is an orb effect, illusions can't do it themselves
View attachment 391094
View attachment 391093
Thank god I've avoided code. Only took me about 6 hours.

You could've just used the code and do it in 1 minute or less.

It's fine if you've managed to not use the code, but there will be times when you will have to detect something else and Bribe's Damage Engine will still be an better option.

Unless you strictly want to use stock abilities from the game, I say go for that then, but you're making it harder for yourself for no reason.

PS - Avoid using waits as much as you can, cause it can often lead to unwanted results if used too much.
 

Uncle

Warcraft Moderator
Level 71
Joined
Aug 10, 2018
Messages
7,615
There's a million and 1 problems with your trigger Aiun. Your only good option is the Damage Engine or a system like it.

Here's a simple trigger:
  • Example
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Unit-type of DamageEventSource) Equal to Samuro
      • (DamageEventTarget belongs to an enemy of (Owner of DamageEventSource).) Equal to True
      • IsDamageAttack Equal to True
    • Actions
      • -------- Source = Attacking unit (damaging unit) --------
      • -------- Target = Attacked unit (damaged unit) --------
      • Set VariableSet Mana = (Mana of DamageEventTarget)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Mana Greater than 5.00
        • Then - Actions
          • Set VariableSet Mana = 5.00
        • Else - Actions
      • Unit - Set mana of DamageEventSource to ((Mana of DamageEventSource) + Mana)
      • Unit - Set mana of DamageEventTarget to ((Mana of DamageEventTarget) - Mana)
This will also steal mana even if the target has less than 5. I thought this was a nice change since Feedback and other mana burning abilities work this way. Of course you could change it to work your way instead.
 
Last edited:
Status
Not open for further replies.
Top