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

Problems with setting ability integer level value

Level 11
Joined
Aug 11, 2009
Messages
594
I want to temporarily increase the intelligence of hero and I wanted to use Attribute Bonus and edit its intelligence bonus to be based off the heroes Strength stat. Everything in the spell happens, except for the change in Intelligence bonus on the Attribute Bonus ability.

  • Tsu Ult
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Strength of a Hundred Seal (Tsunade)
    • Actions
      • Set VariableSet StrengthSeal_Player = (Owner of (Triggering unit))
      • Set VariableSet StrengthSeal_PlayerNumber = (Player number of StrengthSeal_Player)
      • Set VariableSet StrengthSeal_Caster = (Triggering unit)
      • Floating Text - Create floating text that reads |cff8080ffStrength ... above StrengthSeal_Caster with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Set VariableSet FT_Ability = (Last created floating text)
      • Floating Text - Change FT_Ability: Disable permanence
      • Floating Text - Set the velocity of FT_Ability to 200.00 towards 90.00 degrees
      • Floating Text - Change the lifespan of FT_Ability to 1.50 seconds
      • Floating Text - Change the fading age of FT_Ability to 1.00 seconds
      • Animation - Add the Alternate animation tag to StrengthSeal_Caster
      • Set VariableSet StrengthSeal_Skill = ((Strength of StrengthSeal_Caster (Include bonuses)) / 2)
      • Unit - Add Stat Bonus (Dummy) to StrengthSeal_Caster
      • Ability - Set Ability: (Unit: StrengthSeal_Caster's Ability with Ability Code: Stat Bonus (Dummy))'s Integer Level Field: Intelligence Bonus ('Iint') of Level: 0 to StrengthSeal_Skill
      • Unit Group - Add StrengthSeal_Caster to StrengthSeal_UnitGroup
      • Set VariableSet StrengthSeal_Instances = (StrengthSeal_Instances + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • StrengthSeal_Instances Equal to 1
        • Then - Actions
          • Trigger - Turn on Tsu Ult Loop <gen>
        • Else - Actions
The loop trigger only checks if the Hero has a buff, and removes the Attribute Bonus ability if it doesnt. So its not part of the problem.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,543
The "Set Ability Field" functions are a little buggy. Some flat out don't work but most require an extra step to "refresh" and update their new stats.

Try adding these two Actions after changing the Intelligence Bonus:
  • Unit - Increase level of Stat Bonus (Dummy) for StrengthSeal_Caster
  • Unit - Decrease level of Stat Bonus (Dummy) for StrengthSeal_Caster
Upon changing it back to Level 1 the ability SHOULD detect the new changes that you've made.

Here's a system that automates most of this for you and is quite useful for modifying all kinds of stats via triggers:


Also, it appears as though you're using Dynamic Indexing for an ability that doesn't seem to need more than one Instance active at a time PER UNIT. For standard "buff" setups like these I recommend the more simple Unit Indexing. But I suppose there's the chance that you want these Intelligence bonuses to stack multiple times on the same hero, so disregard this if that's the case.
 
Last edited:
Top