Warcraft III resources & community, 2003–2006 · archived

Mixing type spell?

4 posts
#1

Mixing type spell?

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!!
#2
You will have to check the items slot by slot. You can however store all the six items into an array variable and then based on the variable try to get the right combo. Got it?

~Daelin
#3
I think that another way I could do it would be a loop.

I have never used an array variable. The only thing I know about it is that it stores multiple data. Can you please give me a quick rundown of how they work? :?
#4
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