Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::General Support

Support::General Support Post all topics here having to do with errors while trying to connect to an EQEMu server but not about the setup/running of the Server itself.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 06-07-2009, 11:32 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Ok, I think I got the conversion functions written properly, but it might not hurt to have them double-checked:

Code:
// Converts Titanium Slot IDs to SoF Slot IDs for use in Encodes
static inline int32 TitaniumToSoFSlot(int32 TitaniumSlot) {
	int32 SoFSlot = 0;

	if(TitaniumSlot >= 21 && TitaniumSlot <= 50)	// Cursor/Ammo/Power Source and Normal Inventory Slots
	{
		SoFSlot = TitaniumSlot + 1;
	}
	else if(TitaniumSlot >= 251 && TitaniumSlot <= 340)		// Bag Slots for Normal Inventory and Cursor 
	{
		SoFSlot = TitaniumSlot + 11;
	}
	else if(TitaniumSlot >= 2031 && TitaniumSlot <= 2270)	// Bank Bag Slots
	{
		SoFSlot = TitaniumSlot + 1;
	}
	else if(TitaniumSlot >= 2531 && TitaniumSlot <= 2550)	// Shared Bank Bag Slots
	{
		SoFSlot = TitaniumSlot + 1;
	}
	else if(TitaniumSlot == 9999)	//Unused slot ID to give a place to save Power Slot
	{
		SoFSlot = 21;
	}
	else
	{
		SoFSlot = TitaniumSlot;
	}	
	
	return SoFSlot;
}

// Converts Sof Slot IDs to Titanium Slot IDs for use in Decodes
static inline int32 SoFToTitaniumSlot(int32 SoFSlot) {
	int32 TitaniumSlot = 0;
	
	if(SoFSlot >= 22 && SoFSlot <= 51)	// Cursor/Ammo/Power Source and Normal Inventory Slots
	{
		TitaniumSlot = SoFSlot - 1;
	}
	else if(SoFSlot >= 262 && SoFSlot <= 351)	// Bag Slots for Normal Inventory and Cursor 
	{
		TitaniumSlot = SoFSlot - 11;
	}
	else if(SoFSlot >= 2032 && SoFSlot <= 2271)	// Bank Bag Slots
	{
		TitaniumSlot = SoFSlot - 1;
	}
	else if(SoFSlot >= 2532 && SoFSlot <= 2551)	// Shared Bank Bag Slots
	{
		TitaniumSlot = SoFSlot - 1;
	}
	else if(SoFSlot == 21)
	{
		TitaniumSlot = 9999;	//Unused slot ID to give a place to save Power Slot
	}
	else
	{
		TitaniumSlot = SoFSlot;
	}

	return TitaniumSlot;
}
When working on that, I noticed that there were a couple of issues with the current slot move related stuff in the encodes and decodes that could cause items to be lost if stored in certain slots. Right now, I think those would include:

1. The last slot in a 10 slot bag that is on your cursor.
2. The last slot in the last bag of your bank in SoF.
3. The last slot in the last bag in you shared bank.

This conversion should fix all of that once it is working. Hopefully it will also make it easy to for us to add in any more conversions for slots without having to go through each encode/decode and adjusting them 1 by 1. I will try this out later and see how well it works. Seems like it should be ok.

I am not completely sure what uses slot 31 to 50 in Titanium, but maybe that is how stacked items are stored on the cursor when being moved. If so, we might need to increase that from 50 to at least 130, so it could account for stacks up to 100.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 06-08-2009 at 07:37 AM..
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 04:52 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