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!
Custom script: set udg_NO_ITEM_TYPE = 0 //This line doesn't need to be done, just here for completeness; you need to create an item type variable called NO_ITEM_TYPE and simply don't assign it a default value (it's used in comparisons below)
Set MAX_ITEM_COMBINES = 4 //greater than or equal to the maximum number of times any item in the map can be upgraded
Set MAX_ITEM_COMBINES = MAX_ITEM_COMBINES + 1 //so it works properly it needs to be one greater
-------- --------
Set ItemNum = ItemNum + MAX_ITEM_COMBINES
Set CombineItem[ItemNum + 0] = Rocket Cannon (Dummy Buy)
Set CombineItem[ItemNum + 1] = Rocket Cannon
Set CombineItem[ItemNum + 2] = Double Rocket Cannon
Set CombineItem[ItemNum + 3] = Triple Rocket Cannon
Set CombineItem[ItemNum + 4] = Quad Rocket Cannon
-------- --------
Set ItemNum = ItemNum + MAX_ITEM_COMBINES
Set CombineItem[ItemNum + 0] = Arrow Launcher (Dummy Buy)
Set CombineItem[ItemNum + 1] = Arrow Launcher
Set CombineItem[ItemNum + 2] = Double Arrow Launcher
Set CombineItem[ItemNum + 3] = Triple Arrow Launcher
Set CombineItem[ItemNum + 4] = Quad Arrow Launcher
-------- --------
Set ItemNum = ItemNum + MAX_ITEM_COMBINES
Set CombineItem[ItemNum + 0] = Regular Gun (Dummy Buy)
Set CombineItem[ItemNum + 1] = Regular Gun
Set CombineItem[ItemNum + 2] = Really Fucking Big Gun That Doesn't Upgrade
-------- --------
etc.
-------- --------
Set NUM_BASE_COMBINES = ItemNum / MAX_ITEM_COMBINES
Events
Unit - A unit acquires an item
Conditions
Actions
Set B_Item = (Item being manipulated)
Set B_IType = (Item-type of B_Item)
Set B_Unit = (Triggering Unit)
For each Integer BaseInt from 1 to NUM_BASE_COMBINES) do (Actions)
Loop - Actions
Set ItemNum = BaseInt x MAX_ITEM_COMBINES
If (All conditions are true) then do (Then actions) else do (Else actions)
If - Conditions
B_IType equal to CombineItem[ItemNum]
Then - Actions
Set GiveItem = CombineItem[ItemNum]
Set FoundItem = False
For each Integer SlotInt from 1 to 6 do (Actions)
Loop - Actions
Set S_Item = (Item carried by B_Unit in slot SlotInt)
Set S_IType = (Item-type of S_Item)
For each Integer CombInt from ItemNum to (ItemNum + (MAX_ITEM_COMBINES - 1)) do (Actions) //the -1 is because the max rank can't be upgraded
Loop - Actions
If (All conditions are true) then do (Then actions) else do (Else actions)
If - Conditions
S_IType equal to CombineItem[CombInt]
CombineItem[(CombInt + 1)] not equal to NO_ITEM_TYPE
Then - Actions
Set FoundItem = True
Item - Remove S_Item
Set GiveItem = CombineItem[(CombInt + 1)]
Custom script: exitwhen true
Else - Actions
If (All conditions are true) then do (Then actions) else do (Else actions)
I did not make a map. I just wrote that in the forum reply box; you will have to recreate it yourself. Honestly it will be a good exercise and perhaps you will better understand how the trigger works in the process.
Just look at how it's used... If it doesn't have a [] after it it's not an array. What kind of variable they are should be obvious from how they are used.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.