• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Mixing type spell?

Status
Not open for further replies.
Level 8
Joined
Jul 3, 2004
Messages
334
I am making a spell that when cast, there is a trigger that takes the items in the unit's inventory and based on what items it has, it makes different items. I.E. Steel + Steel = Steel Sword. It's almost like a weaponsmith. I can't figure out how do detect the correct items though. I have the event and conditions. In the actions, I am planning to use if then else code. The if will see if the hero has the items or not. After that, I can do the rest. A little help here? :roll:

EDIT: I don't want the items to have to be in specific slots of the hero!!
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
It's simple... You can store more than one thing under a variable. In your case, you can store more than 1 item into a variable.

The trick about arrays is that they have a parameter. Each array variable looks like this: Variable_name[parameter]. To store stuff into variables and to get them:

unit[1]=footman
unit[2]=archer
unit[3]=ghoul

That's just an example. Now, if you want to remove the footman after a couple of seconds you will have something like:

Wait 1.00 seconds
Remove Unit unit[1].

~Daelin
 
Status
Not open for further replies.
Top