Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 01-20-2009, 03:53 AM
Kilralpine
Sarnak
 
Join Date: Jul 2004
Posts: 98
Default

NP Now My Issue Is Find How To Calculate Aug Type Slots For Instance:

128 = Type 8

64 = Type 7

Anyone Know How This Is calculated??
Reply With Quote
  #2  
Old 01-20-2009, 08:57 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

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(128) and type 7(64)
10000000 (128) 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
Reply With Quote
  #3  
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
  #4  
Old 01-21-2009, 01:48 AM
Kilralpine
Sarnak
 
Join Date: Jul 2004
Posts: 98
Default

I C, Thanks For Posting :P
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 11:07 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3