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

Need Help fixing ability trigger

Status
Not open for further replies.
Level 4
Joined
Dec 3, 2012
Messages
51
Hi, I am trying to make an ability that adds a hero stat bonus for a short duration.

Here is what I have so far:

  • FOS 1 Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Feat of Strength
    • Actions
      • Custom script: local unit u = GetSpellAbilityUnit()
      • Unit - Add Feat of Strength (+5 Stats) to (Casting unit)
      • Unit - Set level of Feat of Strength (+5 Stats) for (Casting unit) to (Level of Feat of Strength for (Casting unit))
      • Wait 20.00 seconds
      • Custom script: set udg_unitVariable = u
      • Unit - Remove Feat of Strength (+5 Stats from unitVariable
      • Custom script: set u = null

There are two abilities" Feat of Strength +5 (unit ability), and Feat of Strength ("dummy" hero ability). The Hero ability is based on Berzerk (all data set to zero), when the hero activates the ability the FoS +5 ability, which is based off of the hero stat bonus, is added. The problem is that there are 6 levels for the hero ability and unit ability, so the max stat bonus is supposed to be +30. However, it stays at +5.

I currently have a more tedious trigger (that works as intended) that checks for the level of the Hero ability, and then adds a unique unit ability (ie +5, +10, +15 ...), but that requires 6 unit abilities and a more clumsy trigger. Is there a way to optimize this trigger? Any help would be appreciated.

Thanks
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
You can do the trigger like this, this is MUI:
  • FOS 1 Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Feat of Strength
    • Actions
      • Unit - Add Feat of Strength (+5 Stats) to (Triggering unit)
      • Unit - Set level of Feat of Strength (+5 Stats) for (Triggering unit) to (Level of Feat of Strength for (Triggering unit))
      • Wait 20.00 seconds
      • Unit - Remove Feat of Strength (+5 Stats from (Triggering unit))

It should work if you are leveling Feat of Strength somewhere.
 
Level 4
Joined
Jan 27, 2010
Messages
133
Perhaps it's the ability type that's messing with you. If I recall correctly Warcraft is picky about adding hero abilities. Try making it into a unit or item ability instead.

Also, if you want the game to be fair, use Wait(Game-Time). (A normal wait will be shortened by X seconds if you have an X second lag-spike. Best solution is timer, but that requires JASS to be MUI)
 
Level 4
Joined
Dec 3, 2012
Messages
51
Tried it, but the added ability will not be set higher than level 1


+5 stats ability is based off of the item stat ability, i made it into a unit ability and gave it 6 levels

feat of strength is the hero ability, based off of bezerk, it also has 6 levels. The unit ability should set to thr level of the hero ability, but it is not


  • FOS 1 Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Feat of Strength
    • Actions
      • Unit - Add Feat of Strength (+5 Stats) to (Triggering unit)
      • Unit - Set level of Feat of Strength (+5 Stats) for (Triggering unit) to (Level of Feat of Strength for (Triggering unit))
      • Wait 20.00 game-time seconds
      • Unit - Remove Feat of Strength (+5 Stats) from (Triggering unit)
 
Status
Not open for further replies.
Top