• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Set Ability Field onto Buffs

Status
Not open for further replies.
Buffs are kind of Abilities, one can get them using BlzGetUnitAbility & BlzGetUnitAbilityByIndex so I though maybe one also can use the Set/Get Field natives onto a Buff. As that would simple down some things, like recasting the same buff to make it stronger or damage absorb shields which block x amount of damage or less/no variables for such stuff.
Turns out it works, But only for a small part of the abilityField constants for Get & Set.
These are the ones my testings found:
ABILITY_BF_CHECK_DEPENDENCIES
ABILITY_BF_ITEM_ABILITY
ABILITY_IF_BUTTON_POSITION_ACTIVATED_X
ABILITY_IF_BUTTON_POSITION_ACTIVATED_Y
ABILITY_IF_BUTTON_POSITION_NORMAL_X
ABILITY_IF_BUTTON_POSITION_NORMAL_Y
ABILITY_IF_BUTTON_POSITION_RESEARCH_X
ABILITY_IF_BUTTON_POSITION_RESEARCH_Y
ABILITY_IF_MISSILE_SPEED
ABILITY_RF_ARF_MISSILE_ARC
ABILITY_SF_EFFECT_SOUND
ABILITY_SF_EFFECT_SOUND_LOOPING
ABILITY_SF_ICON_ACTIVATED
ABILITY_SF_ICON_RESEARCH


When the Buff is Lost & Regain the AbilityField data is gone, (Tested with Mana Reg Aura).
Rebuffing the same buff keeps the AbilityFields (tested with Inner Fire, ABILITY_IF_BUTTON_POSITION_NORMAL_X ++)
Spellsteal does not keep the changed AbilityField Data. (tested with Inner Fire, ABILITY_IF_BUTTON_POSITION_NORMAL_X ++)
One has to remember that the unit does not have the Buff in the EVENT_PLAYER_UNIT_SPELL_EFFECT Event yet, even for "instant" buffs like inner fire it still has to pass a 0s timer.

I am not sure about sideeffects when setting Buff AbilityFields.

Example:
Would have to be put into a spell Effect Event Trigger and casting Inner Fire.
Edit: it counts the amount of rebuffs (the first cast will not increase the value because the buff is no applied yet)
JASS:
local ability abi = BlzGetUnitAbility(GetSpellTargetUnit(), 'Binf')
call BlzSetAbilityIntegerField(abi, ABILITY_IF_BUTTON_POSITION_NORMAL_X, 1 + BlzGetAbilityIntegerField(abi, ABILITY_IF_BUTTON_POSITION_NORMAL_X))
call BJDebugMsg(I2S(BlzGetAbilityIntegerField(abi, ABILITY_IF_BUTTON_POSITION_NORMAL_X)))
 
Last edited:
Status
Not open for further replies.
Back
Top