• 🏆 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] Custom script local integer initialize value

Status
Not open for further replies.
Level 12
Joined
Feb 5, 2018
Messages
521
  • Might2
    • Events
      • Game - PDD_damageEventTrigger becomes Equal to 0.00
    • Conditions
      • (Level of Might (Completed) for PDD_target) Greater than 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
      • -------- >>>Locals<<< --------
      • Custom script: local integer udg_XMightStacks = 0
      • Custom script: local unit udg_XMightTarget = GetTriggerUnit()
      • Custom script: local real udg_XMightTime
      • Custom script: local integer udg_XMightStacksMax
      • -------- Increse stacks --------
      • Custom script: set udg_XMightStacks = udg_XMightStacks + 1
      • -------- Get Max Stacks --------
      • Custom script: set udg_XMightStacksMax = ( GetUnitAbilityLevelSwapped('A007', udg_XMightTarget) * 5 )
      • -------- Checking stacks --------
      • Custom script: if (udg_XMightStacks) < (udg_XMightStacksMax) then
      • Custom script: call ModifyHeroStat( bj_HEROSTAT_STR, udg_XMightTarget, bj_MODIFYMETHOD_ADD, 4 )
      • Custom script: endif
      • -------- Setting Timer --------
      • Custom script: set udg_XMightTime = 15
      • Custom script: call TriggerSleepAction( udg_XMightTime )
      • -------- End of Timer --------
      • Custom script: call ModifyHeroStat( bj_HEROSTAT_STR, udg_XMightTarget, bj_MODIFYMETHOD_SUB, 4 )
      • -------- Reduce Stacks --------
      • Custom script: set udg_XMightStacks = udg_XMightStacks - 1
Is there a way around initializing the local integer. It needs to be set to value, but then the stacks always return to the value set.

At the moment the XMightstacks return to 0, then get increased to 1
Then it loops back to 0 then back to 1
---And so on---
While I want XMightStacks to reach 5

This trigger runs correctly otherwise. I tested it with 24 units taking damage and they all increased strength and then reduced it after 15 seconds.
 
Status
Not open for further replies.
Top