Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Database/World Building

Archive::Database/World Building Archive area for General Discussion's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 10-15-2003, 10:49 AM
Merth
Dragon
 
Join Date: May 2003
Location: Seattle, WA
Posts: 609
Default

Hmm, I don't believe that algorithm will work. Go with the post above by LethalEncounter. The field is a bitfield, and you can use bitmask operators to determine the classes that can use it.

I don't feel like writing a novel to explain bitfield operators, so hopefully sample code will do. Bitfield operators differ from language to language, but here they are in c++:

Code:
// Class number from classes.h
#define ROGUE        9

// Create a number with only the rogue bit turned on
uint32 rogue_mask = (1 << (ROGUE-1));

// Apply mask to 'classes' field to see if rogue bit is turned on
uint32 val = (rogue_mask & MyClassesValue);

if (val == rogue_mask)
   // .. item can be used by rogues
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 09:03 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