1. Loading/Saving ability never ever worked in editor. If you want to know, some hashtables functions weren't finished and blizzard abbadoned them - functions that at first they wanted to implement. One of those, were abilities handle. Why they did that? Meaby because for wc3 engine abilities are nothing but integers and from what I know Load/Save fucntion for integers works pretty nice.
So, here comes the question - how can we save/load ability without ability handle? As I've already mentioned we gonna use integers but we also gonna need Jass functions since with normal GUI it's impossible.
For adding and removing abilities this way, you will have to use Custom script (if we are talking about GUI):
-
Custom script: call UnitAddAbility (udg_yourunit, ID)
-
Custom script: call UnitRemoveAbility (udg_yourunit, ID)
Where yourunit is unit variable, and ID being an integer number - each ability has it's own Id and since we gonna use integer variables here - we can replace 'ID' with 'udg_YourintegerVariable' in our trigger.
'Abilities are basicaly integers for Wc3' - strange isn't it? If you don't believe, go to your ability editor section (from object editor) and click Ctrl + D. Rawcade (aka Id) will replace aach ability's name. For egzample thunderbolt will be now: 'AHtb' and that string for wc3 engine is integer (converted later).
If you want to make this from A to Z you can still at first base trigger on abilities (variables) and then switch to integer - or you can immidiately switch do integers
What I meant:
You can start with setting ability you what to manipulate to a variable, lets say you gonna manipulate Thunderbolt.
-
Set Ability = Thunderbolt
Where 'Ability' is the ability variable and thunderbolt is just spell from filter. Now, since we need to switch into integers we do a trick. Create additional variable in your variable editor of type integer (lets call it AbilityId) and use Custom script action from actions filter - write:
-
Custom script: set udg_AbilityId = udg_Ability
As I said, you can skip this step and use rawcode immidiately:
-
Custom script: set udg_AbilityId = 'AHtb'
It's all the same.
Then, since we know that integer functions are fine you can just use save/load integer in hashtable's action part and you do not need custom scripts for that. Do you remember triggers I have shown you at the begining (add/remove ability)? Now we'll use them!
Let's say, after setting integer AbilityId to Id of thunderbolt we save it as:
-
Hashtable - Save AbilityId as 0 of "spell" in Hash
Now you to add/remove thunderbolt spell from unit:
-
Actions
-

Set IntegerVariable = Load 0 of "spell" from Hash
-

Custom script: call UnitAddAbility(udg_yourunit, udg_IntegerVariable)
-

Custom script: call UnitAddAbility(udg_yourunit, udg_IntegerVariable)
That knowledge should help you with further ability triggering.
Elaborate second quesiton - I do not understood it.