HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Drop Ability

07-28-2005, 02:00 AM#1
HandOfRa
I want that when the player type '-drop <ability name>', it will automatically remove the ability from the player's hero instantly. How do I do that?
07-28-2005, 03:08 AM#2
Switch33
do you mean actually remove the abillity, or just disable it, because if you remove the abillity, you can't readd the abillity without having a more trigger work.
Well anyways for removing the abillity:
Events: Player 1 types in the chat message saying -drop abillity
Conditions: None
Actions:
Pick every unit on the map
if
picked unit is equal to (The hero who has the abillity)
then
Remove (abillity) from
else
Do nothing

But for disabling the abillity, u simply need disable abillity for triggering player for the only action.
07-28-2005, 05:14 PM#3
AFZ
Uhm, I don't think you can remove an ability jsut by refering to it's name. You have to refer to the hex code, for example 'a000' or whatever, so what you have to do is make a trigger like this:

(you will have to make all the abilities name the same lenght or make the player refer to the ability code)

* Events *
- Player event: player types a chat message containing the string "remove" as a substring
* Actions *
- set variable <your string variable> = substring((7,11),entered chat message)
- remove ability (your string variable) from <your unit>
07-28-2005, 10:59 PM#4
Vexorian
Easiest way for the players that play the game would be having multiple arrays one with the string that represents an ability and one with the ability itself so you just loop for the ability value when reading the string

Gamecache is obviously better for this though but since you can't use Abilities on integer variables or arguments you would need jass