How to setup a diablo like weapon/armor stats system with random loot system

Hey i was wondering how would someone go about making weapons with stats such as ( lightning damage %,critical hit chance ,% life drain,etc.) and randomly generate loot depending on their rarity and those stats. i have enums and structs but idk if i did it right and i feel like im missing ALOT of info.so any help would be appreciated .