• 🏆 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] Help me make a bonus effect fade after an amount of time

Status
Not open for further replies.
Level 6
Joined
Jul 21, 2019
Messages
168
Hello, i made an ability that gives bonus attack damage to the hero for every enemy unit it kills, it stacks up to ten times, everything works as intended but i need to make it so it loses the effect after 10 seconds without killing an unit, here are the triggers:

For the stacking part, i made an integrer variable

  • BL Stacking
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Killing unit)) Equal to Tryndamere
      • ((Dying unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
      • (Level of Bloodlust for (Killing unit)) Greater than or equal to 1
      • BL_Stacks Less than 10
    • Actions
      • Set BL_Stacks = (BL_Stacks + 1)
      • Set BL_Killer = (Killing unit)
  • BL Stack Cap
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
      • BL_Stacks Greater than 10
    • Actions
      • Set BL_Stacks = 10
For this ability i use item attack bonus with many levels and set the level of the ability based on the BL_Stack variable and the level of the actual spell that has the passive effect, the unit with the ability has a hidden spellbook with the custom item attack bonus ability, level 1 of the ability adds 0 damage.

Here is a sample of the damage bonus being added to the unit (won't post all the triggers because they are a lot):

  • BL 1 Stack LVL 1
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Killing unit)) Equal to Tryndamere
      • ((Dying unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
      • (Level of Bloodlust for (Killing unit)) Equal to 1
      • BL_Stacks Equal to 1
    • Actions
      • Unit - Set level of Bloodlust Damage Bonus for BL_Killer to 2
..and the trigger that removes the damage when BL_Stacks reaches zero:
  • BL 0 Stack
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
      • BL_Stacks Equal to 0
    • Actions
      • Unit - Set level of Bloodlust Damage Bonus for BL_Killer to 1
There is also a trigger that removes the bonus when an ability is cast (The main ability can be cast to trade the damage bonus for a heal)

  • BL Heal LVL 1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Bloodlust
      • (Level of Bloodlust for (Triggering unit)) Equal to 1
    • Actions
      • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + ((Real(BL_Stacks)) x 30.00))
      • Set BL_Stacks = 0
      • Unit - Set level of Bloodlust Damage Bonus for (Triggering unit) to 1
all i need is a trigger that sets BL_Stacks to 0 and Bloodlust Damage Bonus to 1 when BL_Killer hasn't killed an unit in 10 seconds

Thanks in advance!

EDIT: in order to avoid double posting, i will make my second request on this same thread:

I have one small gripe with this ability, when you have some bonus damage already stacked at the time you learn the next level of the ability, it doesn't "update", like, level 1 gives +2 damage for each kill, so with it fully stacked it gives +20, but level 2 gives 3 damage for each kill, meaning +30 at 10 stacks, however, when you learn level 2 while already having stacks, the stacks have the bonus from level 1 (+20) even though your ability is level 2 (should be +30 now), i know it is because my trigger adds the bonus only when an unit is killed, but i don't know how to make it interact with the hero learning the next level, need help there too
 
Last edited:
Level 24
Joined
Feb 9, 2009
Messages
1,787
Stacking damage on kill - (Credits to @Uncle and his breakthrough in finding a solution to leveling such a finicky thing.)
  1. Stacks damage on kill up to 10 stacks.
  2. Stacks "decay" after 10 seconds, dropping one stack every 0.5 seconds until zero.
  3. Damage from stacks "Update" upon leveling.
  4. Ability can be activated to heal for 50 + (30 per stack) which consumes the stacks.
Note: I made this with 1.31.1
 
Last edited:
Level 6
Joined
Jul 21, 2019
Messages
168
Damn, thank you so much man, i refused to keep requesting your help because i know you spent a shitload of time back then, i realized i was asking too much stuff, was hyped to have it working xd, but i don't have 1.31 anymore, does this system use natives exclusive to newer versions? if not could you please paste the triggers here so i can recreate it on my version (using 1.26 now)? i actually have a 1.29 backup, but i have no idea how to make it work without a cd key (my brother refunded reforged too but didn't uninstall the game from his laptop so i stole his w3 folder before he uninstalled xD

EDIT: i also realized this is actually better than what i asked for, it makes more sense to lose 1 stack every x amount of time instead of all at once, if that's possible to achieve on 1.26, please enlighten me
 
Last edited:
Level 24
Joined
Feb 9, 2009
Messages
1,787
Like I said before, these bite sized projects and puzzles are fun, the time I spent was insignificant to some other projects that I have started and abandoned due to frustration for this oh-wonderous-and-oh-so-lovely-editor...
O
n the subject of version, you'll have to try replicating it if you want an answer, I fear two warcrafts on my tiny computer are enough, three and I will be chased out of town for being a perverted fanatic.
Finally, as much as Uncle does deserve credit, I am responsible for the triggers currently in the map, I simply credited him for the work around that allows one to meddle with item attack bonus damage when I made this thread.
 
Level 6
Joined
Jul 21, 2019
Messages
168
Hahahaha okay, well i got in mind the following:

a periodic event every 10 seconds of game time that sets BL_stacks to (BL_Stacks) - 1

that's easy enough (i suppose), but how do i make it *reset* whenever BL_Killer kills a new unit?, like i would make the 10 second periodic event that removes 1 stack always active, but somehow reset the time whenever the unit kills anything? i'm guessing i need a timer right?

EDIT: i misread what you initially wrote and believed Uncle made the whole thing, my bad

EDIT 2: found a flaw on my idea already >"make the 10 second periodic event that removes 1 stack always active"< i'm guessing that if the timer is always active, and you happen to kill an unit when the timer is already a high value, like 8 or 9, you would almost instantly lose the gained stack xd, so basically what i actually need is a way to reset a periodic event (?)
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,536
Devalut's method is a lot better and MUI but here's something you could do if you only have 1 Tryndamere hero in your map and you want it to be compatible with older versions (I THINK this should be compatible):
Have 5 abilities that add Bonus Attack Damage all with 10 levels. Blood Oath 1, 2, 3, etc...
  • Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set VariableSet Tryndamere = Paladin 0001 <gen>
      • Set VariableSet PreviousBloodOath = Blood Oath 1
      • Set VariableSet CurrentBloodOath = Blood Oath 1
      • -------- -------------------------------------------------------------- --------
      • Set VariableSet BloodOathAbilities[1] = Blood Oath 1
      • Set VariableSet BloodOathAbilities[2] = Blood Oath 2
      • Set VariableSet BloodOathAbilities[3] = Blood Oath 3
      • Set VariableSet BloodOathAbilities[4] = Blood Oath 4
      • Set VariableSet BloodOathAbilities[5] = Blood Oath 5
  • Kill
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Level of Blood Oath for (Killing unit)) Greater than 0
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BloodStacks Less than 10
        • Then - Actions
          • Set VariableSet BloodStacks = (BloodStacks + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BloodStacks Equal to 1
            • Then - Actions
              • Unit - Add CurrentBloodOath to Tryndamere
            • Else - Actions
              • Unit - Set level of CurrentBloodOath for Tryndamere to BloodStacks
        • Else - Actions
      • -------- -------------------------------------------------------------- --------
      • Countdown Timer - Start BloodTimer as a One-shot timer that will expire in 10.00 seconds
  • Timer
    • Events
      • Time - BloodTimer expires
    • Conditions
    • Actions
      • Unit - Remove CurrentBloodOath from Tryndamere
      • Set VariableSet BloodStacks = 0
  • Learn
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Blood Oath
    • Actions
      • Set VariableSet PreviousBloodOath = CurrentBloodOath
      • Set VariableSet BloodLevel = (Level of Blood Oath for Tryndamere)
      • Set VariableSet CurrentBloodOath = BloodOathAbilities[BloodLevel]
      • -------- -------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BloodStacks Greater than 0
        • Then - Actions
          • Unit - Remove PreviousBloodOath from Tryndamere
          • Unit - Add CurrentBloodOath to Tryndamere
          • Unit - Set level of CurrentBloodOath for Tryndamere to BloodStacks
        • Else - Actions
  • Heal
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Blood Oath
    • Actions
      • Unit - Set life of Tryndamere to ((Life of Tryndamere) + (50.00 + (30.00 x (Real(BloodStacks)))))
      • Unit - Remove CurrentBloodOath from Tryndamere
      • Set VariableSet BloodStacks = 0
 
Status
Not open for further replies.
Top