package HeroInventoryRestrictions import ItemTypeData import EquipmentClassification import HeroType public function validateClass(unit u, item i) returns boolean boolean allowed = false let ht = u.getHeroType() EqCla cls = GetItemTypeId(i).xGetItemTypeData().equipmentClass switch ht case WARRIOR allowed = ( cls == EqCla.SWO or cls == EqCla.AXE or cls == EqCla.SHI or cls == EqCla.CHA or cls == EqCla.ACC) case PRIEST allowed = ( cls == EqCla.STA or cls == EqCla.ORB or cls == EqCla.CLO or cls == EqCla.ACC) case RANGER allowed = ( cls == EqCla.BOW or cls == EqCla.QUI or cls == EqCla.LEA or cls == EqCla.ACC) case DRUID allowed = ( cls == EqCla.STA or cls == EqCla.ORB or cls == EqCla.CLO or cls == EqCla.ACC) return allowed