Warcraft III resources & community, 2003–2006 · archived
How to limit items carred by hero to only 1 per type
4 posts
Impac7
#1
How to limit items carred by hero to only 1 per type
It's simple or looks so, but i cant think of how to make if a hero has 1 item, then if he acquires another item like this one to drop the acquired item if he has 1 already.
there are 2 main ways that i have found to do this; either you can have, for example, artifacts represent weapons, so that if a player picks up an artifact and he already has an artifact then he drops the one he just picked up and a message is displayed. or you can have the item's life represent the item type (and disable attacks against items of course) like 1 = weapon, 2 = armor, etc.
a third way would be to just make a list of items that are of a certain type and check to see if a player already has one of those items, but that becomes tedious. i would only recommend this if for some reason the other 2 methods are not an option (like you have already used them to represent something else).
Impac7
#3
The item gives intelligence so i will add an amount of mana and if the hero manipulating item has more than lets say 1000 mana or 700 mana, the item will be dropped. This will avoid abuse of 6 items fpr example giving total of 120 intelligence.
just 1 question ? Can i use instead of mana - intelligence like if intelligence of hero manipulation item bla bla ... then do else do...
I didnt see a condition where it checks intelligence/strength . = (value) is there such condition ?