Pretty much what lightfoot said. They are very handy for masks, as well, and for turning one hex number into far more potential values. For example, take our 'tagging' system, which has different masks at higher numbers, each for a different part of the mod, with lower numbers meaning different things depending which mask is set higher up. Here are some sample values to illustrate my point:
const int PCACC_PRELL_CORPSE_LORD = 0x40000001;
const int PCACC_PRELL_HENDRON = 0x40000002;
const int PCACC_PRELL_RAT_KING = 0x40000004;
const int PCACC_PRELL_MINOTAUR_CHIEFTAIN = 0x40000008;
const int PCACC_PRELL_LAVA_KING = 0x40000010;
const int PCACC_PRELL_BLOOD_MOOR_HAGS = 0x40000020;
const int PCACC_PRELL_SHADOW_PONTIFF = 0x40000040;
const int PCACC_PRELL_ANCIENT_KINGS = 0x40000080;
const int PCACC_PRELL_HIVE_MOTHER = 0x40000100;
const int PCACC_PRELL_QUEEN_SPIDER = 0x40000200;
const int PCACC_PRELL_RAZHID = 0x40000400;
const int PCACC_PRELL_AXILAR = 0x40000800;
const int PCACC_PRELL_ZERYA = 0x40001000;
const int PCACC_PRELL_HEADMASTER = 0x40002000;
const int PCACC_PRELL_CAPTAIN_ANGUS = 0x40004000;
const int PCACC_PRELL_ELANNA_NIGHTSTAR = 0x40008000;
const int PCACC_PRELL_HEL = 0x40010000;
const int PCACC_PRELL_REANIMATOR = 0x40020000;
const int PCACC_PRELL_ICE_KOBOLD_KING = 0x40040000;
const int PCACC_PRELL_WATER_SHRIKE_NEST_MOTHER = 0x40080000;
const int PCACC_PRELL_ELDER_ORB = 0x40100000;
const int PCACC_PRELL_MOTHER_OF_THE_CORN = 0x40200000;
const int PCACC_PRELL_FORMIAN_MATRIARCH = 0x40400000;
const int PCACC_PRELL_DRIDER_CHIEF = 0x40800000;
const int PCACC_DRAGON_ASIMATHAS = 0x50000001;
const int PCACC_DRAGON_BLOODPOOL = 0x50000002;
const int PCACC_DRAGON_CESSPOOL = 0x50000004;
const int PCACC_DRAGON_DEADPOOL = 0x50000008;
const int PCACC_DRAGON_GLITHILDHOUL = 0x50000010;
const int PCACC_DRAGON_GREHNAXAS = 0x50000020;
const int PCACC_DRAGON_KARDKILDONTAR = 0x50000040;
const int PCACC_DRAGON_LITHIUCSHAS = 0x50000080;
const int PCACC_DRAGON_SPAWN_DEEPONE = 0x50000100;
const int PCACC_DRAGON_SPAWN_UROBOROS = 0x50000200;
const int PCACC_DRAGON_WASTALGRANIQ = 0x50000400;
const int PCACC_DRAGON_DRACOLICH = 0x50000800;
const int PCACC_QUEST_STAFF_OF_ANDUIN = 0x60000001;
const int PCACC_QUEST_ARCHEMLIS = 0x60000002;
const int PCACC_QUEST_BORIAN_MUSHROOM = 0x60000004;
const int PCACC_QUEST_BORIAN_MUSK_CREEPER = 0x60000008;
const int PCACC_QUEST_HERO_CRYSTAL = 0x60000010;
const int PCACC_QUEST_SOLIS_GAOBIN_GOOD = 0x60000020;
const int PCACC_QUEST_SOLIS_GAOBIN_EVIL = 0x60000040;
As you can see, there are separate masks for pre-legendary accomplishments, dragon accomplishments, and quest (storyline) accomplishments:
const int PCACC_TYPE_PRELL = 0x40000000;
const int PCACC_TYPE_DRAGON = 0x50000000;
const int PCACC_TYPE_QUEST = 0x60000000;
In binary, it would be FAR harder to see what was going on there. Likewise, even if you aren't masking in that way, hex is just much more readable, and doesn't take all that long to grow accustomed to. Here's another example, showing a non-masked variable, with each bit having a distinct meaning, our pc options variable (which stores toggleable client option settings like low graphics mode and other configurations):
const int PCOPTION_NOINVISHELMS = 0x00000001;
const int PCOPTION_NOAUTOREBUFF = 0x00000002;
const int PCOPTION_SHIFTERFIX = 0x00000004;
const int PCOPTION_NOTURNIMMOB = 0x00000008;
const int PCOPTION_TAUNTBLUFF = 0x00000010;
const int PCOPTION_TAUNTPERSUADE = 0x00000020;
const int PCOPTION_DEATHARROW = 0x00000040;
const int PCOPTION_DOMSPELLS = 0x00000080;
const int PCOPTION_NORESPAWN = 0x00000100;
const int PCOPTION_NOWWCONSUME = 0x00000200;
const int PCOPTION_NOTURNSMITE = 0x00000400;
const int PCOPTION_HEALCIRCLE = 0x00000800;
const int PCOPTION_WHISPER_GUILD = 0x00001000;
const int PCOPTION_WHISPER_META = 0x00002000;
const int PCOPTION_BARDSONG_SWAP = 0x00004000;
const int PCOPTION_CURSESONG_SWAP = 0x00008000;
Note that the powers of two form a distinct pattern. If I want the next available bit, I can immediately see that it is 0x00010000 - no need to sit there multiplying some large number by 2. This is really just another illustration of lightfoot's point about readability and ease of use.
Funky