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

Problem with a Trigger that Gives Crit for a certain numer of Attacks

Status
Not open for further replies.
Level 2
Joined
Feb 27, 2013
Messages
17
Hi, I wanted to ask help to you guys about an ability that i'm triggering. The ability works like this:

Sudden Death

When activated, the Hero gains the ability to do a critical strike for a certain number of attacks or until the ability expires. Last 15 seconds.

Level 1 - Critical Strike for one attack.
Level 2 - Critical Strike for two attacks.
Level 3 - Critical Strike for three attacks.

I coded in Gui the critical strike myself, so i won't be using the vanilla passive. The Crit itself works fine, the problem is actually in the fact that the critical strike won't "disappear" after landing the attacks needed to clear the "Sudden Death" buff away, the Hero will continue to Crit until the 15 seconds have passed.

Here, im posting the two triggers that I used to code this ability.

  • Critical Strike
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventSource has buff Sudden Death ) Equal to TRUE
    • Actions
      • Set Hero = DamageEventSource
      • Set Crit_Strike_Number = (Level of Sudden Death (Neutrale-Ostile) for Hero)
      • Trigger - Turn on Critical Strike Count <gen>
      • Set DamageEventAmount = (DamageEventAmount x 2.00)
      • Animation - Reset Hero's animation
      • Animation - Play Hero's slam animation
      • Floating text - Create floating text that reads (|c00cc0000 + ((String((Integer(DamageEventAmount)))) + (! + |r))) above DamageEventTarget with Z offset 0.00, using font size 11.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating text - Change (Last created floating text): Turn off permanence
      • Floating text - Change the lifespan of (Last created floating text) to 3.00 seconds
      • Floating text - Change the fading age of (Last created floating text) to 2.00 seconds
      • Floating text - Set the velocity of (Last created floating text) to 60.00 towards 90.00 degrees
  • Critical Strike Count
    • Events
      • Game - DamageEventAmount becomes Equal to 1.00
    • Conditions
      • (DamageEventSource has buff Sudden Death ) Equal to TRUE
      • Crit_Strike_Number Equal or greater then 1
    • Actions
      • Set Crit_Strike_Number = (Crit_Strike_Number - 1)
      • If (Crit_Strike_Number Equal to 0) then do (Unit* - Remove Sudden Death buff from DamageEventSource) else do (Do nothing)
      • Trigger - Turn off (This trigger)
Thanks for your time in advance :infl_thumbs_up:
 
Last edited:
Level 17
Joined
Mar 21, 2011
Messages
1,597
cause the trigger is off.
both trigger have the same event, so they will trigger at the same time.
well, but the second trigger will be switched on after the event, so it wont be triggered.
my suggestion: make another trigger which triggers if you cast the ability, and with this trigger, you can control ON/OFF

i'm not 100% sure if its right what i'm saying, but give it a try
also: pls translate everything into english
 
Level 2
Joined
Feb 27, 2013
Messages
17
I tried to do what you told me with this


  • test
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sudden Death
    • Actions
      • Trigger - Turn on Critical Strike Count <gen>
Didn't work. Maybe i'm missing something obvious?

P.S. ALso translated the first post as best as i could.
 
Level 2
Joined
Feb 27, 2013
Messages
17
Mmmmmmm, I wanted to have a unit variable specific for THAT hero but maybe it was useless lol. By merging the two triggers you are referring to the initial one? I think i'll try, but i don't know where to put the "If" at glance.

EDIT:

I came up with this

  • Critical Strike
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Condizions
      • (DamageEventSource has buff Sudden Death ) Equal to TRUE
    • Actions
      • Set Crit_Strike_Number = (Level of Sudden Death for DamageEventSource)
      • If (Crit_Strike_Number Equal to 0) then do (Unit - Remove Sudden Death buff from DamageEventSource) else do (Set Crit_Strike_Number = (Crit_Strike_Number - 1))
      • Set DamageEventAmount = (DamageEventAmount x 2.00)
      • Animation - Reset DamageEventSource's animation
      • Animation - Play DamageEventSource's slam animation
      • Floating text - Create floating text that reads (|c00cc0000 + ((String((Integer(DamageEventAmount)))) + (! + |r))) above DamageEventTarget with Z offset 0.00, using font size 11.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating text - Change (Last created floating text): Turn off permanence
      • Floating text - Change the lifespan of (Last created floating text) to 3.00 seconds
      • Floating text - Change the fading age of (Last created floating text) to 2.00 seconds
      • Floating text - Set the velocity of (Last created floating text) to 60.00 towards 90.00 degrees
Still same problem ç_ç



Edit 2: I resolved the problem guys so i thought I'd share the solution with everyone! :)

I found the problem by simply verifying if the counter that was decreasing the "Crit_Number_of_Hits" variable was actually doing its job, by simply adding a floating text that showed me the number stored in the variable. Found out that it wasn't because the numbers were going like this: 3 -> 2 -> 3 -> 2 and so on.
The reason was simple. At the beginning of the trigger there is the
  • Actions
    • Set Crit_Strike_Number = (Level of Sudden Death for DamageEventSource)
.
In short, this action was resetting the counter every damn time i was hitting the enemy unit with my personal ability up. So i had to create another trigger.

The solution to the problem comes in the form of this two triggers:

  • Critical Strike
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventSource has buff Sudden Death ) Equal to TRUE
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Crit_Strike_Number Equal to 0
        • Then - Actions
          • Unit - Remove Sudden Death buff from DamageEventSource
        • Else - Actions
          • Set Crit_Strike_Number = (Crit_Strike_Number - 1)
      • Set DamageEventAmount = (DamageEventAmount x 2.00)
      • Animation - Reset DamageEventSource's animation
      • Animation - Play DamageEventSource's slam animation
      • Floating text - Create floating text that reads (|c00cc0000 + ((String((Integer(DamageEventAmount)))) + (! + |r))) above DamageEventTarget with Z offset 0.00, using font size 11.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating text - Change (Last created floating text): Turn off permanence
      • Floating text - Change the lifespan of (Last created floating text) to 3.00 seconds
      • Floating text - Change the fading age of (Last created floating text) to 2.00 seconds
      • Floating text - Set the velocity of (Last created floating text) to 60.00 towards 90.00 degrees
  • Critical Strike Count
    • Events
      • Unit - A unit start di effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sudden Death
    • Actions
      • Set Crit_Strike_Number = ((Level of Sudden Death for (Triggering unit)) - 1)
Thanks to the ones who helped me +rep ^^
 
Last edited:
Status
Not open for further replies.
Top