• 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.

Item Restriction System Request

Status
Not open for further replies.
Level 9
Joined
Jul 10, 2011
Messages
562
hey all...

ive got an request i now have to post here after i asked Mr_Bean987 (too complex to make it beside the spell requests in his thread) and Magtheridon96 (he has too much to do) refused doing it because of the said reasons.

basically i need a system restricting certain heroes from carrying certain items and restricting certain items to certain slots.
IMPORTANT: the restriction should just work on heroes NOT on normal units or buildings.

here's a detailed description of the system :
there are 20 different item classes in total all defined through item levels (1-20).
the item levels 1-8 are restricted to the slot 1 (the top left one).
the item levels 9-13 can be in slot 1 or slot 2 (the top left and the top right one). More explanation follows later.
the item level 14 is restricted to the slot 2 (the top right one) only.
the item level 15 is restricted to the slot 3 (mid left one) only.
the item level 16 is restricted to the slot 4 (mid right one) only.
the item level 17 is restricted to the slot 4 only.
the item level 18 is restricted to the slot 5 (bottom left one) only.
item levels 19 and 20 are restricted to the slot 6 only.

the item levels 1-8 define 2-handed weapons.
that they are 2-handed means that when a 2-handed weapon is picked up you have to check whether slot 1 AND slot 2 are free and then if the unit is able to wear a 2-handed weapon add a dummy item (rawcode : I000) to slot 2 to make the hero unable to wear another item there. (if the unit sells/drops the 2-handed weapon it has to be removed again for sure)
the item levels 9-13 are 1-handed weapons (ill give you the unit type rawcodes later too) and the item level 14 define shields. here's a special thing happening : some unit types can wear 2 1-handed weapons, some can wear 1 1-handed weapon and a shield and some can just wear a 1-handed weapon but no second 1-handed weapon and no shield.
item level 15 defines armors and all units are able to wear it.
item level 16 defines helmets and all unit are able to wear it.
item level 17 defines boots and all units are able to wear it.
item level 18 defines jewelry and all units are able to wear it.
item level 19 defines misc items and all units are able to wear it.
item level 20 defines pots and other charged items and all units are able to wear it.

now the error messages (i would recommend using SimError even though i don't know whether it's outdated or not^^):
if a unit trys to pick up a weapon type it can't carry error message is 'You can't carry X.' where X is for example 'a 2-handed weapon' , 'a 1-handed weapon' , 'a 1-handed axe' , 'a 2-handed hammer' and so on.

Itemlevels//Itemclasses
1//2-handed swords
2//Halberds
3//2-handed hammers
4//Gloves (yeah gloves are weapons in my ORPG^^)
5//Warglaives
6//Staffs
7//Bows
8//Rifles
9//1-handed swords
10//1-handed axes
11//maces
12//1-handed hammers
13//glaives
14//shields
15//armors
16//helmets
17//boots
18//jewelry
19//misc items
20//potions and other charged items

if a unit tries to pick up a weapon it could carry but the required slot/s is/are not free the error message is 'You can't pick up this weapon as long as you already carry something in your hands.' , for armor it is 'You can't wear 2 armors.' , for helmet and boots it is 'You can't pick up boots or a helmet as long as you already wear one of them.' , for jewelry it is 'You can't pick up another piece of jewelry as long as you already wear one.' and for misc items and charged items it is 'You can't pick up this item as long as your belt pouch is filled.'

The Hashtable in which the unit-types are stored is called 'ItemRestrictionTable' and the unit types are stored (as integer) the following way:
'0 of (itemlevel) from ItemRestrictionTable' stores the max number of unit types able to wear this item 'class'.
'1 up to (0 of (itemlevel) from ItemRestrictionTable) of (itemlevel) from ItemRestrictionTable' store the unit type rawcode.
Itemlevels 4,15,16,17,18,19&20 are usable for all unit types means there's no restriction beside the slot restriction.

if an item is dropped because the hero can't wear it or the required slots aren't free set the custom value of it to 0 please.


i hope someone will take care of this request because im just not able to make it and i really need it. +rep and credits in my map for sure for the maker.

thanks in advance

greetz clapto
 
Status
Not open for further replies.
Top