Removing Abilities Based on Ability Location (2,2), (1,2), (1,1), etc.

Status
Not open for further replies.
Level 23
Joined
Jul 18, 2004
Messages
1,862
Hey there. Wresting with this problem at the moment.
I've got a hero in my map who will use "Spell Theft". Basically, it's her ultimate ability to copy a single spell of a target enemy unit to use as her own.

What I've done is make copies of each stealable spell, slightly changed their descriptions so it refers to the hero's name when she uses it (instead of the original units'), and made them so they'll appear in the X=1, Y=1 location.

My question:

Is there a way to remove the ability which is currently occupying the X=1, Y=1 location, from a hero?

If not I have to remove about 50 possible spells from her whenever she casts Spellsteal, and then give her her new spell. This'll make for quite a big-ass trigger and a lot of boring copy/paste work... which I'd rather avoid.
 
Level 23
Joined
Jul 18, 2004
Messages
1,862
Is it possible to store the ability as a variable and remove it afterwards?
Otherwise, store all possible abilities as a variable with array (Ability[1] = critical strike, Ability[2] = Bash, etc...).
Then use a loop from 1 to 50 (apparantly) and if the hero has that ability, remove it.


Agh, of course. I can set a variable as the stolen spell whenever she steals it, then remove her stolen ability by the variable before giving her a new one. Silly me.

Thanks. This'll work.

Still curious though if it's possible, removing an ability from a specific slot.
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Agh, of course. I can set a variable as the stolen spell whenever she steals it, then remove her stolen ability by the variable before giving her a new one. Silly me.

Thanks. This'll work.

Still curious though if it's possible, removing an ability from a specific slot.

The most difficult problems can be found with the easiest solutions.
Don't think too far (I've done that a lot of times, but it really doesn't work :p).
 
Status
Not open for further replies.
Top