[Solved] Stat Scaling on Thunder Clap Trigger

Level 1
Joined
Oct 18, 2017
Messages
4
I am currently trying to work out why this trigger I made is damaging the casting hero unit, and not hostile unit that receives the initial damage of Thunder Clap.

I have created a custom version of Thunder Clap, whose base AoE damage is 50.
The hero that I have given the custom ability to is a Knight that starts with 15 strength at level 1.

The trigger itself implements a scaling factor of 2.25, thus the total damage done to hostile units/structures by my custom version of Thunder Clap should be around 83.75.
(Scaling damage bonus = 15 x 2.25 = 33.75 added damage)

I have been looking through Actions list to see if there isnt a 'cause damage to affected unit' anywhere, but I am at a loss.

Below is how I currently have my trigger set up, any help to fix the issue would be appreciated!

  • TClap Strength Scaling
    • Events
      • Unit - Target Dummy 0017 <gen> Takes damage
      • Unit - A unit owned by Player 1 (Red) Finishes casting an ability
      • Unit - A unit owned by Player 2 (Blue) Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Clap
    • Actions
      • Set Strength = (Strength of (Casting unit) (Include bonuses))
      • Set Convert = (Real(Strength))
      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (Convert x 2.25) damage of attack type Hero and damage type Normal
 
Last edited:
Level 2
Joined
Oct 17, 2017
Messages
9
I`m not entirely sure but the triggering unit seems to be the dummy since it takes damage. Try to have only
Unit - A unit owned by Player 1 (Red) Finishes casting an ability
as an event. That would explain the behavior of the trigger.

EDIT: you may also want to perform a check on if the unit targeted by an ability is enemy of owner of unit casting an ability.
 
Level 1
Joined
Oct 18, 2017
Messages
4
I`m not entirely sure but the triggering unit seems to be the dummy since it takes damage. Try to have only
Unit - A unit owned by Player 1 (Red) Finishes casting an ability
as an event. That would explain the behavior of the trigger.

EDIT: you may also want to perform a check on if the unit targeted by an ability is enemy of owner of unit casting an ability.

I changed some things around and re-evaluated the way I had my trigger set up based on what you had suggested.
In its current state, the trigger now applies damage correctly to the hostile target dummy, but it also still causes my hero to damage himself for the converted
scaled value after damage mitigation is applied.

The trigger now flows like this:

  • TClap Strength Scaling
    • Events
      • Unit - A unit owned by Player 1 (Red) Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Clap
      • ((Triggering unit) is A Hero) Equal to True
      • ((Targeted unit) belongs to an enemy of Player 1 (Red)) Equal to True
    • Actions
      • Set Strength = (Strength of (Casting unit) (Include bonuses))
      • Set Convert = (Real(Strength))
      • Unit - Cause (Triggering unit) to damage circular area after 0.01 seconds of radius 225.00 at ((Position of (Triggering unit)) offset by (0.00, 0.00)), dealing (Convert x 2.25) damage of attack type Spells and damage type Normal
 
Last edited:
Level 2
Joined
Oct 17, 2017
Messages
9
The area that you cause damage in includes your hero. use something like this instead. You can use If / Then / Else multiple instead too if you want to put effects on enemies or give them a debuff like a stun. You could also affect allies in the Else section if you want to give heals, slow them without damaging them for being in the area, etc.

Unit Group - Pick every unit in (Units within 225.00 of (Position of (Triggering unit))) and do (If (((Picked unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) then do (Unit - Cause (Triggering unit) to damage (Picked unit), dealing 500.00 damage of attack type Spells and damage type Normal) else do (Do nothing))


EDIT: fixed an error in the code
 
Level 1
Joined
Oct 18, 2017
Messages
4
The area that you cause damage in includes your hero. use something like this instead. You can use If / Then / Else multiple instead too if you want to put effects on enemies or give them a debuff like a stun. You could also affect allies in the Else section if you want to give heals, slow them without damaging them for being in the area, etc.

Unit Group - Pick every unit in (Units within 225.00 of (Position of (Triggering unit))) and do (If (((Picked unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) then do (Unit - Cause (Triggering unit) to damage (Picked unit), dealing 500.00 damage of attack type Spells and damage type Normal) else do (Do nothing))


EDIT: fixed an error in the code

After some digging around in the drop down lists I found the correct selections and following your advice to a tee this worked like a charm, thank you so much man!
:)

Here is the finished trigger ;3!
  • TClap Strength Scaling
    • Events
      • Unit - A unit owned by Player 1 (Red) Finishes casting an ability
      • Unit - A unit owned by Player 2 (Blue) Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Thunder Clap
      • ((Triggering unit) is A Hero) Equal to True
      • ((Targeted unit) belongs to an enemy of Player 1 (Red)) Equal to True
    • Actions
      • Set Strength = (Strength of (Casting unit) (Include bonuses))
      • Set Convert = (Real(Strength))
      • Unit Group - Pick every unit in (Units within 225.00 of (Position of (Triggering unit))) and do (If (((Picked unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True) then do (Unit - Cause (Triggering unit) to damage (Picked unit), dealing (Convert x 2.25) damage of attack type Spells and damage type Divine) else do (Do nothing))
 
Last edited:

Dr Super Good

Spell Reviewer
Level 62
Joined
Jan 18, 2005
Messages
27,083
I don't know what that means or how to fix that. =/
In simplest form it means your map may become unplayable after it is played for a while due to low performance.

Basically you are creating objects and never remove them. After enough such "leaked" objects are created the game starts to perform badly. Frame rates might reach such low levels it is no longer possible to play. In the very worst cases the game may even crash once it runs out of either memory or finite allocateable objects.

Fixing such leaks usually involves assigning the objects to variables, using the object to do some task and then removing the object by calling the appropriate destructor function for the object. There are dozens of tutorials and thousands of topics covering WC3 trigger leaks.

Destructor function calls for groups and locations to remove the variables group G and point (location) L. Note all GUI variables are prepended with udg_. They can be mixed in with GUI triggers using a custom script action for each line.
JASS:
call RemoveLocation(udg_L)
call DestroyGroup(udg_G)
 
Last edited:
Top