Staff is a weapon for Fae Trickster, Dracolyte, Ice Sage, Tomb Raiser, and Chloromancer . It deals magic damage instead of a melee weapon's physical damage. Some staves are made by players (see Stave Creation Guide for a bit more info) and can be equipped in the game.
Guns - both guns and staves do magic damage and are ranged, but are considered different because they are used in different classes.
Melee - melee has very close attacks, so in some circumstances staves can be better, as being ranged.