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

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.
Top