Thread: (augrestrict)
View Single Post
  #9  
Old 01-20-2009, 09:13 PM
unknownhost
Sarnak
 
Join Date: Dec 2006
Posts: 89
Default

Quote:
Originally Posted by KLS View Post
Looks like a bit mask, they're fairly common in EQ structures, you use bitwise or to combine the bit flags and bitwise and for comparison.

Each flag has a value that has a specific orientation in binary
1 00000001
2 00000010
4 00000100
8 00001000
16 00010000
32 00100000
64 01000000
128 10000000

In this situation say you wanted to combine type 8(12 and type 7(64)
10000000 (12 OR
01000000 (64)
---------
11000000 (192)

You'll notice that 64+128 is 192 so you can create your masks easily by just adding the values you want together if you don't have the patience to deal with the binary =p. Course the masks have to be correct or bad things will happen

reading through this, learning, and it triggered a memory.

couldnt remember where the heck i had used a system exactly like this then it poped in there. UOx used to setup their npc spell lists like this. like 1= magic arrow, 2=harm, 4=fireballetc. place a 3 there and the npc would cast both magic arrow & harm.

sorry not relavent to the thread i guess but hey it got my brain churning on the EQEmu at least.
Reply With Quote