-
TEST
-

Events
-

Conditions
-

Actions
-


Set VariableSet TEMP = (TEMP + 1)
-


Set VariableSet StackCount[TEMP] = (StackCount[TEMP] + 1)
The code is broken, but calm down - Reforged isn't the source of all evil. It works as written, it's just written wrong.
Basically, it seems like you are using the indexer incorrectly.
In this example you change StackCount[TEMP] *after* you increase TEMP (and same for previous post). So you will read from whatever integer was stored there every time, until you restart the index or run out of array, and only add single stack per pass.TEMP increases, while StackCount[TEMP] reading from unchanged array element will return 0.
As for your Might code; it works wrong because it doesn't really use indexer - it just uncaringly reads whatever Stacks for next array element was stored and increases it, overwriting old Source, Target and Max. You got infinite stacks because every time the trigger runs it stores it into separate stacks;
-
Might
-

Events
-


Game - PDD_damageEventTrigger becomes Equal to 1.00
-

Conditions
-


(Level of Might for PDD_target) Not equal to 0
-


(PDD_target belongs to an enemy of (Owner of PDD_source).) Equal to True
-


(Random integer number between 1 and 100) Less than or equal to 33
-

Actions
-


Set VariableSet MighTemp = (MighTemp + 1)
-


Set VariableSet MightStacks[MighTemp] = (MightStacks[MighTemp] + 1)
-


Set VariableSet MightSource[MighTemp] = PDD_source
-


Set VariableSet MightTarget[MighTemp] = PDD_target
-


Set VariableSet MightMax[MighTemp] = ((Level of Might for MightTarget[MighTemp]) x 5)
-


Game - Display to (All players) the text: (String(MightStacks[MighTemp]))
-


Set VariableSet MightTime[MighTemp] = 15.00
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




MightStacks[MighTemp] Less than MightMax[MighTemp]
-



Then - Actions
-




Hero - Modify Strength of MightTarget[MighTemp]: Add 4.
-




Special Effect - Create a special effect attached to the origin of MightTarget[MighTemp] using Abilities\Spells\Items\AIsm\AIsmTarget.mdl
-





Set VariableSet MightFX = (Last created special effect)
-





Special Effect - Destroy MightFX
-



Else - Actions
-


Wait MightTime[MighTemp] seconds
-


Hero - Modify Strength of MightTarget[MighTemp]: Subtract 4.
-


Set VariableSet MightStacks[MighTemp] = (MightStacks[MighTemp] - 1)
-


Game - Display to (All players) the text: (String(MightStacks[MighTemp]))
-


Set VariableSet MighTemp = (MighTemp - 1)
To actually use indexer, you need to find if you already have PDD_target as a MightTarget stored somewhere in the index, and save data into new index only if it is not.
also, using wait and trying to do anything after wait is asking for a trigger collision. You expect the global variable to remain unchanged? That's not how it works. You need either a local or local shadowing to do anything post-wait, or better yet not use waits at all and run timers instead. Though I don't recall how one works with timer arrays.
Let me check if I get it right: the ability should add stack on enemy damage with 33%, adds 4 strength and fx per stack, has LVx5 maximal stack and each stack lasts 15 seconds? Also I don't know why would you want to save source since it doesn't seem to be use d anywhere beyond initial condition, is something intended to work for multiple damage sources separately?
Anyway, hope it helps make it work.
Edit: whoops, I was late