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

Development::Tools 3rd Party Tools for EQEMu (DB management tools, front ends, etc...)

View Poll Results: Is this a good idea?
Yes 11 91.67%
No 0 0%
You are completely insane, why ould anyone want that. 1 8.33%
Voters: 12. You may not vote on this poll

Reply
 
Thread Tools Display Modes
  #31  
Old 04-14-2008, 01:31 PM
John Adams
Demi-God
 
Join Date: Jul 2006
Posts: 1,552
Default

Not sure this will help any, but I built some arrays in php for these bitwise comparisons. It was so long ago, I am not really sure why I did it this way, but here it is nonetheless.

Code:
// Gear slots
$a = 1;
$gear_slots=array(
	"Charm" 				=> $a << 0,
	"Left Ear" 			=> $a << 1,
	"Head" 					=> $a << 2,
	"Face" 					=> $a << 3,
	"Right Ear" 		=> $a << 4,
	"Neck" 					=> $a << 5,
	"Shoulder" 			=> $a << 6,
	"Arms" 					=> $a << 7,
	"Back" 					=> $a << 8,
	"Left Bracer" 	=> $a << 9,
	"Right Bracer" 	=> $a << 10,
	"Range" 				=> $a << 11,
	"Hands" 				=> $a << 12,
	"Primary" 			=> $a << 13,
	"Secondary" 		=> $a << 14,
	"Left Ring" 		=> $a << 15,
	"Right Ring" 		=> $a << 16,
	"Chest" 				=> $a << 17,
	"Legs" 					=> $a << 18,
	"Feet" 					=> $a << 19,
	"Waist" 				=> $a << 20,
	"Ammo" 					=> $a << 21
);

//foreach($gear_slots as $row=>$val) {
//	echo $row.$val."<BR>";
//}

// Char Inventory slots (8)
$s=1;
for($i=22;$i<=29;$i++) {
	$inv="Inventory$s";
	$inv_slots[$inv]=$i;
	$s++;
}

// Char Inventory bag slots (8bags * 10slots)
$b=1; // bag 1
$s=1; // slot 1
for($i=251;$i<=330;$i++) {
	if($s>10) {
		$s=1;
		$b++;
	}
	$bag="Bag$b";
	$bagslot="Slot$s";
//	echo "$bag-$bagslot<br>";
	$inv_slots["$bag-$bagslot"]=$i;
	$s++;
}

// Char Bank Slots (16)
$s=1; // slot 1
for($i=2000;$i<=2015;$i++) {
	$inv="BankSlot$s";
	$inv_slots[$inv]=$i;
	$s++;
}

// Char Bank Bag slots (16bags * 10slots)
$b=1; // bag 1
$s=1; // slot 1
for($i=2031;$i<=2190;$i++) {
	if($s>10) {
		$s=1;
		$b++;
	}
	$bag="BankBag$b";
	$bagslot="Slot$s";
//	echo "$bag-$bagslot<br>";
	$inv_slots["$bag-$bagslot"]=$i;
	$s++;
}


// Create Classes Array
$a = 1;
$classes=array(
	"Unknown" 			=> 0,
	"Warrior" 			=> $a << 0,
	"Cleric" 				=> $a << 1,
	"Paladin" 			=> $a << 2,
	"Ranger" 				=> $a << 3,
	"Shadowknight"	=> $a << 4,
	"Druid" 				=> $a << 5,
	"Monk" 					=> $a << 6,
	"Bard" 					=> $a << 7,
	"Rogue" 				=> $a << 8,
	"Shaman" 				=> $a << 9,
	"Necromancer" 	=> $a << 10,
	"Wizard" 				=> $a << 11,
	"Magician" 			=> $a << 12,
	"Enchanter" 		=> $a << 13,
	"Beastlord" 		=> $a << 14,
	"Berserker" 		=> $a << 15
);

// Create Races Array
$a = 1;
$races=array(
	"Unknown" 	=> 0,
	"Human" 		=> $a << 0,
	"Barbarian" => $a << 1,
	"Erudite" 	=> $a << 2,
	"Wood Elf" 	=> $a << 3,
	"High Elf"	=> $a << 4,
	"Dark Elf" 	=> $a << 5,
	"Half Elf" 	=> $a << 6,
	"Dwarf" 		=> $a << 7,
	"Troll" 		=> $a << 8,
	"Ogre" 			=> $a << 9,
	"Halfling" 	=> $a << 10,
	"Gnome" 		=> $a << 11,
	"Iksar" 		=> $a << 12,
	"Vah Shir" 	=> $a << 13,
	"NPC" 			=> $a << 14,
	"PET" 			=> $a << 15,
	"Froglok" 	=> $a << 16
);
I used these arrays to build the combo boxes on my lookup page. Something like this:
Code:
<select name="searchClass" class="advSearch">
	<option value="-1">Pick a Class</option>
	<?php
	foreach($classes as $key=>$val) {
		if(isset($_POST['searchClass']) && $val==$_POST['searchClass']) {
			$selected=" selected";
		} else {
			$selected="";
		}
		echo '<option value="'.$val.'"'.$selected.'>'.$key.'</option>';
	}
	?>
</select>
Again, kinda barbaric, but it works. Good luck with the app. I like the idea.
Reply With Quote
Reply


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 03:02 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3