• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How to limit items carred by hero to only 1 per type

Status
Not open for further replies.
Level 7
Joined
Feb 4, 2005
Messages
289
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.
 
Level 5
Joined
Jun 17, 2006
Messages
114
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).
 
Level 7
Joined
Feb 4, 2005
Messages
289
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 ?
 
Status
Not open for further replies.
Top