• 🏆 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!

Item group

Status
Not open for further replies.
Level 4
Joined
Nov 21, 2004
Messages
47
IS there such a thing as item groups? What im trying to do is when you pick up 2 small bundles of lumber it removes them and makes a normal bundle and when you get 2 normal bundles it gives you a large and 5 large is gigantic. Is there any way to do this other then make like 50 item variables cause i need to be able to do this for every single player individually and i have like 10.
 
Level 6
Joined
Feb 18, 2005
Messages
263
it is possible.

here is a way that should work, even though i just wrote it out of my mind...

you require the variables

"tmp_boolean" as boolean
"tmp_integer" as integer

But you may use other names if you want to - this is just a suggestions...

event: hero gets item
condition:
or(
itemtype = lumber(small)
itemtype = lumber(normal)
itemtype = lumber(big)
itemtype = lumber(giant)
)
tmp_boolean = false
actions:
drop item beeing manipulated
set tmp_integer = 0
for 1 to 6 as Integer A
(
if ( itemtype caried by hero(manipulating hero) in slot (Integer A) == itemtype of (item beeing manipulated)) then
(
set tmp_integer = tmp_integer + 1
)
)

//do this for each type of lumber you want, but place them into the "else" of the previous one
if ( (itemtype = lumber(small)) and (tmp_integer >= 1) ) then
(
//this line one time for each lumber(small) you want to use, but remember that there still is the item that the hero got
remove random item of type (type of(item beeing manipulated))
remove item beeing manipulated
) else
(
//in here the if from above for each type of lumber - edited acording to your wishes and the following code into the last else
set tmp_boolean = true
give (Uitem beeing manipulated) to (hero manipulating item)
set tmp_boolean = false
)
 
Status
Not open for further replies.
Top