• 🏆 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] LoL Kalista Rend: Stacking local variables on a unit per Attack

Status
Not open for further replies.
Level 4
Joined
Jul 14, 2012
Messages
100
So I want to make a hero ability similar to one that League of Legend's Kalista has.

Her ability is called Rend and has a passive effect as well as an activate effect. The passive effect is that her auto attacks store "spears" in the enemies that she strikes, with no limit on how many spears she can stack in them. If she does not attack the target again within several seconds, all the spears in them disappear. This passive does no inherent damage.

However, the active effect is that all enemies with at least 1 "spear" in them consume all the "spear" stacks they have to deal damage (increasing based on how many spears they have) as well as slowing them.

I want to make an ability similar to this, but my WC3 hero has a "passive" ability at level 1 that lets them start stacking these "spears" (in this case called "sins"). I want the hero to stack "Sins" in enemy units struck on each basic attack, stacking infinitely and stacking separately for each unit struck. And if a unit is not attacked within 5 seconds, they lose all the "Sins" stacked on them.

That's the trigger I'm stuck with right now because I have no idea where to begin in doing this. I tried making a boolean variable check true if the unit was attacked, and then after a 5 second wait, set the boolean to false. And then have a separate periodic event trigger (every 0.5 seconds) check all units that might have the boolean = false and to set their number of Sins to 0. But I don't know how to give each unit an individual counter for Sins. I am already using the trigger function Custom Value for something else and I'd rather not use that.

But I feel like my periodic trigger is very bad and will lag the crap out of the game and I don't even think it will work since i dont know how to make the boolean indepedent for each unit.

Please help??
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
You need a custom buff system.
My Effect Over Time (may be the only one that) works with normal buffs, but is quite heavy to work with it.
In any case, in that one, you can create your own buff and give it some parameters like "source", "duration" and even custom variables for example "sins"/"stacks".

You will have to catch the onDamage event for basic attacks (for which a damage detection system will do for now) and then apply the buff on the target with a 5 seconds duration... if the target didnt have the buff already.
If it does have the buff already, then you can increase the "sins"/"stacks" by 1.

In any case, whatever you are using "custom value of <unit>" for... remove it.
Download a unit indexer (which uses the custom values) and create an integer array.
The array will now contain the values of your data for your unit.
So:
"set MyIntegerArray[Custom value of Unit1] = 1"
"set MyIntegerArray[Custom value of Unit2] = 2"
"set MyIntegerArray[Custom value of Unit3] = 3"
You can not only have integers but any variables for each unit.
 
Level 4
Joined
Jul 14, 2012
Messages
100
Ok I'll try your system to see if it works. It might take me some time to figure out but it seems really cool. Thanks!
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
You create 1 "instance" per unit struck. Each instance has a counter or timer which is set to expire in 5 seconds. Each instance also has a stack count starting at 1. Instances are mapped to units either with hashtable or custom value. If a unit is hit and has no instance then one is created for it. Each time a unit is hit and it already has an instance you then reset its timer to 5 seconds and increment stack count by 1. The buff graphics can be synchronized using the timer since it can be set to last forever and remove it after 5 seconds or if you refresh it constantly you can set it to last 7 odd seconds so that it flashes like all buffs that will expire shortly.
 
Level 4
Joined
Jul 14, 2012
Messages
100
Ah I knew this was going to be complicated for me... I made the variables and I tried basing it off the example of Magic Shield from your system since it seemed to resemble what I'm aiming for best... But this is what I got and I can't even enable the trigger without getting error messages and I just have no idea what I am doing. If I try to just copy paste something without understanding it I don't know how to fix error messages or make tweaks so that it fits the spell I'm trying to make so I need to understand your system first and I tried reading about it for a while now and I'm just having too hard of a time, sorry.

  • Magic Shield
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Unit-type of (Attacking unit)) Equal to Phantomlord Yurie (pvp)) or ((Unit-type of (Attacking unit)) Equal to Phantomlord Yurie (Reaper's Wrath))
    • Actions
      • -------- The event should be made by a DDS. --------
      • -------- make sure that there are no unwanted variables --------
      • Custom script: call EOT_Set_Default_Variables()
      • -------- set target and type --------
      • Set EOT_Param_Target = (Attacked unit)
      • Custom script: set udg_TempInteger = udg_TempAbility
      • Set EOT_Param_Type = TempInteger
      • -------- check if the target has an eot of the same type --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Evaluate EOT_Trigger_Get_Data conditions) Equal to True
        • Then - Actions
          • -------- if it has, increase the level of the ability and reset the duration --------
          • Set EOT_Param_Remaining_Duration = 5.00
          • Set EOT_Param_Sin_Level = (EOT_Param_Sin_Level + 1)
          • Trigger - Run EOT_Trigger_Save_Data (ignoring conditions)
        • Else - Actions
          • -------- if not, then create the EOT --------
          • Set EOT_Param_Target = (Attacked unit)
          • Set EOT_Param_Duration = 5.00
          • Set EOT_Param_Sin_Level = 1
          • Set EOT_Param_Special_Effect_Model = Abilities\Spells\Undead\FrostArmor\FrostArmorTarget.mdl
          • Set EOT_Param_Special_Effect_Point = chest
          • Custom script: set udg_TempInteger = udg_TempAbility
          • Set EOT_Param_Type = TempInteger
          • Set EOT_Param_Positive = True
          • Trigger - Run EOT_Trigger_Create_EOT (ignoring conditions)

What am I supposed to do here? I don't know what variables I'm missing or what variables I don't need or what I'm totally lost trying your system. I copy pasted your triggers from your file and the variables and everything I had to make one by one it took forever but I did it.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Well... as stated in the first comment in that trigger, the event should be made with a damage detection system.
To find out how that works, you should just try one.

But for the actual buff.
There is a part in the documentation about how to use it which might help you out.
I guess you will understand most of it when you read through that.

The more complex parts will then come up and I can tell you how they work, but for now try to figure most stuff out by the documentation.
(A big ass piece of green text in the trigger.)
 
Status
Not open for further replies.
Top