Makes me wonder why you're not doing something like this...
JASS:
private function in takes nothing returns nothing
local integer abil = Ability_Register()
local trigger t = CreateTrigger()
call TriggerAddCondition(t,function act)
call Ability_SetHandler(abil,t)
call Ability_SetName(abil,"Unholy Vigor")
call Ability_AddObject(abil,'AUV1')
call Ability_AddObject(abil,'AUV2')
call Ability_AddObject(abil,'AUV3')
call Ability_AddObject(abil,'AUV4')
call Ability_AddObject(abil,'AUV5')
call Ability_AddObject(abil,'AUV6')
call Ability_AddObject(abil,'AUV7')
set Unholy_Vigor = abil
endfunction
Because that would pointlessly spam hundreds of abilities. It's been discussed before with customizable hotkeys; it's just not feasable in Gaias:
7*6 base class abilities + 7*12 advanced abilites * 9 possible hotkeys (if we limit it to QWER+ASDF+V choices) = 1134 abilities, not including all the NPC-only spells you could capture with the Psi-Blade.
And even if I create only a single duplicate each with a static unused orderstring and hotkey, there are several abilities that are not based on channel for technical reasons (all abilities that don't interrupt orders, like Feline Reflexes) that I could not duplicate.
The approach I'm currently doing avoids all this, albeit a bit cumbersome to implement:
I basicly have a dummy ability for triggering the captured spell with a static orderstring and hotkey with multiple ability levels to dynamically adjust mana cost and cooldown at runtime.
When using the dummy ability, it
- temporarily adds the captured ability
- hides all other abilities so they don't interfere if they have the same orderstring
- triggers the added ability
- unhides all normal abilities again
- hides the triggered ability
- waits until the EndCast event
- removes the triggered hidden ability
- adjusts the level of the dummy ability with a matching cooldown
- triggers the dummy ability to start the cooldown
- adjusts the level of the dummy ability to the correct mana cost and target type when the cooldown ends
...
Wow, now that I read that again, this sounds like an unneccesary complicated workaround just for avoiding some spell registry and ability duplicates...
Maybe you're right and I'll just have a duplicate of each ability. My approach sounds completely overkill.