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.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 10-15-2003, 07:21 AM
Bori
Fire Beetle
 
Join Date: Sep 2003
Location: Denham Springs, LA
Posts: 18
Default

Use the following formula to determine class:

Assumptions: (not the same as database, making it up on the fly)

1 = Warrior
2 = Rogue
4 = Enchanter
8 = Wizard
16 = ...
32 = ....
(notice the binary increments?)


******************************************
Algorithm: (for the assumed classes, not all of them)

IF TEMP - 8 >= 0
UsableClass = "Wiz"
TEMP = TEMP - 8

ELSEIF TEMP - 4 >= 0
UsableClass = UsableClass & ", " & "Enc"
TEMP = TEMP - 4

ELSEIF TEMP - 2 >= 0
UsableClass = UsableClass & ", " & "Rog"
TEMP = TEMP - 2

ELSEIF TEMP - 1 >= 0
UsableClass = UsableClass & ", " & "War"
TEMP = TEMP - 1


************************************

Let's say the number in the database is 6 so we'll store it as TEMP. We also need a string to hold classes (for this example. You can store it anyway you choose)

So,
TEMP = 6
UsableClass = ""


In the first IF we'll have: 6 - 8 which is -2. This does not satisfy
the statement, so we know Wizard is NOT a usable class.
After Statement:
TEMP = 6
UsableClass = ""

In the second IF we'll have: 6 - 4 which is 2. This does satisfy
the statement, so we know Enchanter IS a usable class.
After Statement:
TEMP = 2
UsableClass = "Enc"

In the third IF we'll have: 2 - 2 which is 0. This does satisfy
the statement, so we know Rogue IS a usable class.
After Statement:
TEMP = 0
UsableClass = "Enc, Rog"

In the fourth IF we'll have: 0 - 1 which is -1. This does not satisfy
the statement, so we know Warrior is NOT a usable class.
After Statement:
TEMP = 0
UsableClass = "Enc, Rog"

(at this point, TEMP will be zero)



So, from this example, the number 6 represents the Enchanter and Rogue class. As you stated, the number 32767 is ALL classes because
1 + 2 + 4 + 8 + 16 + 32 +
64 + 128 + 256 + 512 +
1024 + 2048 + 4096 + 8192 + 16384
= 32767

SOooooo, each class's number is included in the TEMP (32767).


I hope this helps, it's really entertaining to work with such things.
Reply With Quote
 


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 07:05 AM.


 

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