Method for returning raw ability name?

Hadezown

TH.net Regular
Reaction score
5
What's the method for calling the raw data name of an ability for example: Acid Bomb is 'ANab'

thanks
 

Builder Bob

Live free or don't
Reaction score
249
you can use this function within spell triggers to get the spell being cast
JASS:
local integer spellId = GetSpellAbilityId()


Another function is this:
JASS:
constant native AbilityId                   takes string  abilityIdString   returns integer

I've never used this function though, so I am not sure what string you need to enter. You can probably figure that out yourself by using this function though:
JASS:
constant native AbilityId2String            takes integer abilityId         returns string
 

Hadezown

TH.net Regular
Reaction score
5
Oh should have been more clear. Im giving a unit an ability which is previously stored in some variable in its raw data form.

Code:
call UnitAddAbilityBJ('ANab', GetSpellAbilityUnit())

Im trying to replace the 'ANab' with an ability variable. The code you gave me looks right but not sure how to implement it.

Would i do:

Code:
local integer spellId = GetSpellAbilityId()
call UnitAddAbilityBJ(spellId, GetSpellAbilityUnit())

Can that first parameter take an integer? I would try myself but can't get to my editer till later tonight.
 

Builder Bob

Live free or don't
Reaction score
249
I am really not sure what you're asking for.

The code you posted won't cause any syntax error. If it does what you want however, I have no idea, since I don't know what you want.

'ANab' is an integer value if that is what you're wondering about.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top