Hashtable / Arrays and a somewhat simple system can allow you to create as many custom item classes as you'd like.
Here's a system I just made, hopefully you're on the latest patch if you're interested in using it
-
CIC Setup
-

Events
-


Time - Elapsed game time is 0.00 seconds
-

Conditions
-

Actions
-


-------- We need to create the Hashtable before doing anything else. Don't change this: --------
-


Hashtable - Create a hashtable
-


Set VariableSet CIC_Item_Hash = (Last created hashtable)
-


-------- --------
-


-------- Give each custom class a unique Integer value to set it apart from other classes (start at 1 and work your way up): --------
-


Set VariableSet CIC_ARMOR = 1
-


Set VariableSet CIC_WEAPON = 2
-


Set VariableSet CIC_TRINKET = 3
-


-------- --------
-


-------- Now we can setup all of our items to use these custom item classes! --------
-


-------- Use the CIC_Setup variables to define the Item-Type, it's new custom Item Class, and the Item Limit for max carried at once: --------
-


-------- --------
-


Set VariableSet CIC_Setup_Item_Type = Crown of Kings +5
-


Set VariableSet CIC_Setup_Item_Class = CIC_ARMOR
-


Set VariableSet CIC_Setup_Item_Limit = 1
-


Trigger - Run CIC Add To System <gen> (ignoring conditions)
-


-------- --------
-


Set VariableSet CIC_Setup_Item_Type = Claws of Attack +15
-


Set VariableSet CIC_Setup_Item_Class = CIC_WEAPON
-


Set VariableSet CIC_Setup_Item_Limit = 1
-


Trigger - Run CIC Add To System <gen> (ignoring conditions)
-


-------- --------
-


Set VariableSet CIC_Setup_Item_Type = Ring of Protection +5
-


Set VariableSet CIC_Setup_Item_Class = CIC_TRINKET
-


Set VariableSet CIC_Setup_Item_Limit = 3
-


Trigger - Run CIC Add To System <gen> (ignoring conditions)
-
CIC Add To System
-

Events
-

Conditions
-

Actions
-


-------- This trigger saves the data about our custom item class in the hashtable. --------
-


-------- This is done by taking advantage of the item's item-type id (an integer that's hidden in GUI). --------
-


-------- --------
-


Custom script: set udg_CIC_Item_Id = udg_CIC_Setup_Item_Type
-


Hashtable - Save CIC_Setup_Item_Class as 0 of CIC_Item_Id in CIC_Item_Hash.
-


Hashtable - Save CIC_Setup_Item_Limit as 1 of CIC_Item_Id in CIC_Item_Hash.
-


-------- --------
-


-------- We can now get the class of this item-type whenever we want! --------
-
CIC Acquire Item
-

Events
-


Unit - A unit Acquires an item
-

Conditions
-

Actions
-


-------- Get the item's Item-Type id so we can use it to load the data from our hashtable: --------
-


Set VariableSet CIC_Item = (Item being manipulated)
-


Custom script: set udg_CIC_Item_Id = GetItemTypeId(udg_CIC_Item)
-


-------- --------
-


-------- Using the id we can load the class and the carry limit of our item: --------
-


Set VariableSet CIC_Class = (Load 0 of CIC_Item_Id from CIC_Item_Hash.)
-


Set VariableSet CIC_Limit = (Load 1 of CIC_Item_Id from CIC_Item_Hash.)
-


-------- --------
-


-------- If the loaded data is 0 that means that this item doesn't have a custom item class and we can skip it: --------
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-



Then - Actions
-



Else - Actions
-


-------- --------
-


-------- Use the Unit Indexer system to track how many items of each custom class the unit has: --------
-


Set VariableSet CV = (Custom value of (Triggering unit))
-


-------- --------
-


-------- Check if it was a ARMOR and how many ARMORS we already have (limit of 1): --------
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




CIC_Class Equal to CIC_ARMOR
-



Then - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






CIC_ARMOR_Count[CV] Less than CIC_Limit
-





Then - Actions
-






Set VariableSet CIC_ARMOR_Count[CV] = (CIC_ARMOR_Count[CV] + 1)
-





Else - Actions
-






-------- Limit reached! --------
-






Trigger - Turn off CIC Lose Item <gen>
-






Hero - Drop CIC_Item from (Triggering unit).
-






Trigger - Turn on CIC Lose Item <gen>
-




Skip remaining actions
-



Else - Actions
-


-------- --------
-


-------- Check if it was a WEAPON and how many WEAPONS we already have (limit of 1): --------
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




CIC_Class Equal to CIC_WEAPON
-



Then - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






CIC_WEAPON_Count[CV] Less than CIC_Limit
-





Then - Actions
-






Set VariableSet CIC_WEAPON_Count[CV] = (CIC_WEAPON_Count[CV] + 1)
-





Else - Actions
-






-------- Limit reached! --------
-






Trigger - Turn off CIC Lose Item <gen>
-






Hero - Drop CIC_Item from (Triggering unit).
-






Trigger - Turn on CIC Lose Item <gen>
-




Skip remaining actions
-



Else - Actions
-


-------- --------
-


-------- Check if it was a TRINKET and how many TRINKETS we already have (limit of 3): --------
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




CIC_Class Equal to CIC_TRINKET
-



Then - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






CIC_TRINKET_Count[CV] Less than CIC_Limit
-





Then - Actions
-






Set VariableSet CIC_TRINKET_Count[CV] = (CIC_TRINKET_Count[CV] + 1)
-





Else - Actions
-






-------- Limit reached! --------
-






Trigger - Turn off CIC Lose Item <gen>
-






Hero - Drop CIC_Item from (Triggering unit).
-






Trigger - Turn on CIC Lose Item <gen>
-




Skip remaining actions
-



Else - Actions
-


-------- --------
-
CIC Lose Item
-

Events
-


Unit - A unit Loses an item
-

Conditions
-

Actions
-


-------- Get the item's Item-Type id so we can use it to load the data from our hashtable: --------
-


Set VariableSet CIC_Item = (Item being manipulated)
-


Custom script: set udg_CIC_Item_Id = GetItemTypeId(udg_CIC_Item)
-


-------- --------
-


-------- Using the id we can load the class and the carry limit of our item: --------
-


Set VariableSet CIC_Class = (Load 0 of CIC_Item_Id from CIC_Item_Hash.)
-


Set VariableSet CIC_Limit = (Load 1 of CIC_Item_Id from CIC_Item_Hash.)
-


-------- --------
-


-------- If the loaded data is 0 that means that this item doesn't have a custom item class and we can skip it: --------
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-



Then - Actions
-



Else - Actions
-


-------- --------
-


-------- Use the Unit Indexer system to track how many items of each custom class the unit has: --------
-


Set VariableSet CV = (Custom value of (Triggering unit))
-


-------- --------
-


-------- Check if it was a ARMOR and reduce how many ARMORS we have (limit of 1): --------
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




CIC_Class Equal to CIC_ARMOR
-



Then - Actions
-




Set VariableSet CIC_ARMOR_Count[CV] = (CIC_ARMOR_Count[CV] - 1)
-




Skip remaining actions
-



Else - Actions
-


-------- --------
-


-------- Check if it was a WEAPON and reduce how many WEAPONS we have (limit of 1): --------
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




CIC_Class Equal to CIC_WEAPON
-



Then - Actions
-




Set VariableSet CIC_WEAPON_Count[CV] = (CIC_WEAPON_Count[CV] - 1)
-




Skip remaining actions
-



Else - Actions
-


-------- --------
-


-------- Check if it was a TRINKET and reduce how many TRINKETS we have (limit of 3): --------
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




CIC_Class Equal to CIC_TRINKET
-



Then - Actions
-




Set VariableSet CIC_TRINKET_Count[CV] = (CIC_TRINKET_Count[CV] - 1)
-




Skip remaining actions
-



Else - Actions
This has 3 custom classes by default: ARMOR, WEAPON, and TRINKET. You can hold 1 Weapon, 1 Armor, and up to 3 Trinkets at a time. You can add as many custom classes as you'd like and the system is optional so not every item needs a custom class. You can also customize the limits to adjust how many of each class you can carry. Note that I'm using a
Unit Indexer to track how many of each Item Class you have equipped. I find this system is a must have in GUI maps and here it helps keep things organized. You should be using it!
If you wanted to add a new custom item class then you would follow these steps:
1) Create a new Integer variable and name it
CIC_CLASS and create a new Integer
array variable and name it
CIC_CLASS_Count. Don't forget to replace
CLASS with the actual name of your new custom class.
2) Go to the
CIC Setup trigger. You can see
ARMOR,
WEAPON, and
TRINKET are being defined in here so just copy and paste one of those and change it to reference your new class and give it a unique value (follow the pattern/instructions).
3) Go to the bottom of the
CIC Acquire Item trigger, copy and paste an existing If Then Else for another Item Class, and adjust it's variables to use your new
CIC_CLASS and
CIC_CLASS_Count variables.
4) Go to the bottom of the
CIC Lose Item trigger, copy and paste an existing If Then Else for another Item Class, and adjust it's variables to use your new
CIC_CLASS and
CIC_CLASS_Count variables.
It's really just a matter of following the pattern that my 3 example classes use.