• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Change value of item abilities

Level 11
Joined
Aug 11, 2009
Messages
609
Hello!
Was wondering if anyone has tinkered with the "Set Ability Real Level Field" on item abilities? I cant get it to work but maybe I am doing something wrong or perhaps it doesnt work with items?

I just tried something simple to test it but it doesnt give the damage bonus. The ability i used to test is based on Command Aura, i checked so "Cac1" is the correct one aswell. 0.5 should be a 50% damage bonus.

  • Weapon Bonus
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Ability - Set Ability: (Item: Claws of Attack [+0] 0033 <gen>'s Ability with Ability Code: Enhance Weapon Bonus )'s Real Level Field: Attack Damage Increase ('Cac1') of Level: 0 to 0.50
Thanks in advance for any help on this!
 
Those functions don't always work on all fields (but when they do work, they're great!). Usually I'll make sure I show a "Game - Text message" with the value before and after the change just as a sanity check. But I can confirm it works with "Cac1", but you do need to do a lil trick.

It seems like when you update that value, it "succeeds" (i.e. if you print that field back, it'll now display "0.500")--but it doesn't update the unit's attack. So a lot of times you just need to find the correct way to "force" wc3 to reflect those latest changes.

In this case, you can force a refresh by changing the level of the ability (similar to when a hero learns a skill, e.g. Trueshot Aura, and the attack+ needs to be reflected). You can simply add a line to increment the level and then one to decrement the level:
  • Acquire Claws
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Claws
    • Actions
      • Ability - Set Ability: (Item: (Item being manipulated)'s Ability with Ability Code: Attack Bonus (Item))'s Real Level Field: Attack Damage Increase ('Cac1') of Level: 0 to 0.50
      • Unit - Increase level of Attack Bonus (Item) for (Triggering unit)
      • Unit - Decrease level of Attack Bonus (Item) for (Triggering unit)
With that, it should work. However, you might notice a slight delay in the changes taking effect (it might start initially as +6, and then jump up to +22 after a few seconds). That's most likely due to the internal refresh rate for auras in wc3, which isn't really in your control. So I recommend setting the "Data - Attack Damage Increase" to 0.00 in the object editor so it at least doesn't weirdly jump between two values.

If you want the changes to be applied instantly, and you only care about it being applied to the main unit, then you might want to use a different ability/item ability (instead of one based on an aura). You can search our systems section for "Bonus" mods, and that might point you in the right direction!

EDIT: Updated slightly since it apparently isn't necessary to add levels in the object editor.
 
Last edited:
Level 11
Joined
Aug 11, 2009
Messages
609
Oh I will give it a try when I get home!

I didnt know changing a units ability level worked on item abilities aswell. I tried to look for one specific to items instead of units as I have had the same problem with unit abilities not getting their values updated until leveled up then down again :D

I guess the items ability counts as the units ability when carried by it?

Thanks alot for the help!

Edit: It worked perfectly, thanks alot again! :D
 
Last edited:
Top