• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Spell] Item into Spell

Status
Not open for further replies.
You're going to need knowledge of hashtables for this.

First, on Map initialization, you have to save abilities into the hashtable using the keys of the items that get turned into them.

  • Trigger
    • Events
      • Map Initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set HASHTABLE = (Last created hashtable)
      • ------ Start adding abilities here ------
      • Save Ability ABILITY with key(ITEM) by 0 in HASHTABLE
      • ------ Set booleans to determine whether an item can be changed to an ability or not
      • Save boolean True with key(ITEM) by 1 in HASHTABLE
When a unit goes into a region, check all of his items and see if (Load boolean with key (ITEM_ID_OF_YOUR_ITEM) by 1 from HASHTABLE) equals to true.

If it does, it means that this item should be converted to an ability.
Now, the second thing we do is store the ability into a variable:

  • Set TempAbility = (Load Ability with key (ITEM_ID_OF_YOUR_ITEM) by 0 from HASHTABLE)
Now, we remove the item from the game, and give the unit the Ability TempAbility:

  • Unit - Give TempAbility to UNIT
 
You don't need to :p
In GUI, abilities are actually just IDs directly, and so are unit-types, item-types, and other '-types' ^.^ (buff-type, destructable-type, etc..)

edit
But in case you really want to, in the object editor, typing Ctrl+D should bring up all the ability ids in the form of Raw Codes.
Raw Codes are four-digit numbers in Base-256 (which is much greater than Base-10 (decimal))
They use characters like "!@#$%^&*()-=_+><.,/?';":][{}`~QWERTYUIOPKLJHGFDSAZXCVBNMpoiuytrewqasdfghjklmnbvcxz1234567890" and other symbols you aren't going to care about :p
Ability Ids typically start at 'A000', then they increase by 1 everytime you create a new ability:
'A000'
'A001'
'A002'
...
'A009'
'A00A'
'A00B'
...
'A00Z'
'A010'
etc...
 
Status
Not open for further replies.
Top