Warcraft III resources & community, 2003–2006 · archived

How can i count the item type in carried by hero?

6 posts
#1

How can i count the item type in carried by hero?

How can i count the item type in carried by hero?
Please example for me. :oops:
#2
Assume that the number of items will be int i.

For each integer A from 1 to 6
Loop - Actions
If Item Carried by (hero) in slot For Loop Integer A is equal to (item)
Then - Actions
Set i = i + 1
Else - Actions
#3
but i guess u need to remove the sold item or u'll have it twice (counted and single)
#4
but i guess u need to remove the sold item or u'll have it twice (counted and single)


??? i think he just wants to know this for some other purpose, meh

What did you mean, anyways? Lol, im a little tired right now :roll:
#5
example for countable potions
if u buy an item , then the trigger would activate, so it would check if the buying unit alredy got an potion. if so, it would increase the counts of it (=potion) and skip the rest. but because he bought another potion he would have a new one in his inventory (one with 2 counts, anothe single one). so he needs to remove the sold item when the trigger counted the old one.
but i guess, this is only when u actually use an event like "a unit bought an item". so ur post is all right. ^^
#6
Mine assumes you recalc it when you need it.