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

Trigger Help: Hero Gains Stats when killing other Heroes

Status
Not open for further replies.
Level 9
Joined
Apr 14, 2020
Messages
63
I am trying to create a gameplay incentive to have one specific hero gain 10 bonus stats to str agi and intelligence whenever he kills an enemy hero and have it trigger a message.

Since I can't think how to do that really, and am still green in trigger making, I developed a specific poison that only hits heroes as one of his abilities (when he melee attacks). The trigger I developed is as follows, but it won't trigger. I ultimately want it to only occur once per unique hero and perhaps limit it at 10, but having it trigger in the first place would be nice. I have tested him killing a neutral hostile hero, an enemy hero, and an ally hero, all have the poison on them, but it doesn't trigger. Any thoughts on how to fix, or even an entirely new way to tackle it that would be more efficient in the long run? Thank you!

upload_2020-4-25_15-47-53.png
 
Level 28
Joined
Feb 18, 2014
Messages
3,580
A unit Dies

((Dying unit) is a Hero) Equal to True
((Dying unit) belongs to an enemy of (Owner of (Killing unit))) Equal to TRUE
(Killing unit) Equal to Ruler of the Shen'dralar 0854 <gen>

Hero - Modifiy Intelligence of Ruler of the Shen'dralar 0854 <gen>: Add 10.
Hero - Modifiy Agility of Ruler of the Shen'dralar 0854 <gen>: Add 10.
Hero - Modifiy Strength of Ruler of the Shen'dralar 0854 <gen>: Add 10.
 
Last edited:
Level 25
Joined
Sep 26, 2009
Messages
2,381
It may be that when your trigger is fired, the unit is already dead and does not have the poison buff.
The best thing would be to use Damage Detection System (DDS), capture when unit takes damage, check if the damage would kill the unit and if yes, check if the unit-to-die has the poison buff. If yes, add stats to killing unit (damage source).

As for giving these bonus stats only once per hero, you could use a unit group variable. Before you add stats to killing unit, check if the unit is not inside the unit group - if not, add stats and add the unit to the unit group. If the unit is already in the unit group, then don't add stats.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,569
@Nichilus I think the Damage Engine stuff is overkill as he doesn't actually need the buff. He was using the buff to determine the Killing Unit which can be done easily with "Killing unit equal to X".

So basically use Warseeker's trigger and add in the Unit Group functionality that Nichilus mentioned to limit which unit's add stats. You can also use an Integer to further limit it.
  • Add Stats
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
      • ((Dying unit) belongs to an enemy of (Owner of (Killing unit)).) Equal to True
      • (Killing unit) Equal to Ruler of the Shen'dralar 0854 <gen>
      • ((Dying unit) is in ShenKillGroup.) Equal to False
      • ShenKillLimit Less than 10
    • Actions
      • Hero - Modify Strength of (Killing unit): Add 10.
      • Hero - Modify Agility of (Killing unit): Add 10.
      • Hero - Modify Intelligence of (Killing unit): Add 10.
      • Unit Group - Add (Dying unit) to ShenKillGroup
      • Set VariableSet ShenKillLimit = (ShenKillLimit + 1)
 

Attachments

  • Add Stats Trigger.w3m
    16.4 KB · Views: 29
Level 9
Joined
Apr 14, 2020
Messages
63
@Nichilus I think the Damage Engine stuff is overkill as he doesn't actually need the buff. He was using the buff to determine the Killing Unit which can be done easily with "Killing unit equal to X".

So basically use Warseeker's trigger and add in the Unit Group functionality that Nichilus mentioned to limit which unit's add stats. You can also use an Integer to further limit it.
  • Add Stats
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
      • ((Dying unit) belongs to an enemy of (Owner of (Killing unit)).) Equal to True
      • (Killing unit) Equal to Ruler of the Shen'dralar 0854 <gen>
      • ((Dying unit) is in ShenKillGroup.) Equal to False
      • ShenKillLimit Less than 10
    • Actions
      • Hero - Modify Strength of (Killing unit): Add 10.
      • Hero - Modify Agility of (Killing unit): Add 10.
      • Hero - Modify Intelligence of (Killing unit): Add 10.
      • Unit Group - Add (Dying unit) to ShenKillGroup
      • Set VariableSet ShenKillLimit = (ShenKillLimit + 1)
I like where you are going with this, however, the reason I developed the poison was because I didn't want him to have to have the last hit to trigger this, I just wanted the hero to have to deal SOME damage to the dying hero to get it to trigger. I thought that having the poison buff from being hit would solve this. But, like stated above, I think the trigger is firing after death and the buff is no longer there.
 
Level 9
Joined
Apr 14, 2020
Messages
63
It may be that when your trigger is fired, the unit is already dead and does not have the poison buff.
The best thing would be to use Damage Detection System (DDS), capture when unit takes damage, check if the damage would kill the unit and if yes, check if the unit-to-die has the poison buff. If yes, add stats to killing unit (damage source).

As for giving these bonus stats only once per hero, you could use a unit group variable. Before you add stats to killing unit, check if the unit is not inside the unit group - if not, add stats and add the unit to the unit group. If the unit is already in the unit group, then don't add stats.
With the DDS, can I use that to detect 1 damage from the hero, and then as long as the hero dies within x time it triggers? I don't want the hero to have to have the last hit or all of the damage
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,569
My mistake, I take back what I said about not using a DDS :p Damage Engine 5.6.0.0

You can use the buff method with the DDS like this:
  • Add Stats Damage Event
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • ((Life of DamageEventTarget) - DamageEventAmount) Less than 0.41
      • (DamageEventTarget belongs to an enemy of (Owner of DamageEventSource).) Equal to True
      • (DamageEventTarget is A Hero) Equal to True
      • (DamageEventTarget has buff Slow Poison (Stacking)) Equal to True
      • (DamageEventTarget is in StatGroup.) Equal to False
      • StatLimit Less than 10
    • Actions
      • Special Effect - Create a special effect attached to the origin of DamageEventSource using Abilities\Spells\Items\AIim\AIimTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Hero - Modify Strength of Paladin 0000 <gen>: Add 10.
      • Hero - Modify Agility of Paladin 0000 <gen>: Add 10.
      • Hero - Modify Intelligence of Paladin 0000 <gen>: Add 10.
      • Unit Group - Add DamageEventTarget to StatGroup
      • Set VariableSet StatLimit = (StatLimit + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • StatLimit Equal to 10
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
Change Paladin to your Hero and Slow Poison (Stacking) to your Buff.


A much more simple method that comes to mind would be using a modified Black Arrow (The passive orb version) that summons a unique Dummy unit. A unit spawns a summoned unit -> Unit-type equal to your unique Dummy -> Remove the Dummy, Add stats, etc...
 

Attachments

  • Add Stats.w3m
    45.9 KB · Views: 24
Last edited:
Status
Not open for further replies.
Top