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

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3  
Old 05-08-2004, 01:31 PM
bUsh
Sarnak
 
Join Date: Apr 2004
Location: Waukesha, WI
Posts: 93
Default

IMPORTANT

The following line in ItemCommonInst::IsEquipable must be altered:
Code:
if( level_ < level )
Change to:
Code:
if( level_ <= level )
WITHOUT THIS CHANGE, PLAYERS OF THE REQUIRED LEVEL TO EQUIP AN ITEM WILL HAVE THEIR REQ. LVL ITEMS DELETED

Next, ValidateInventory now looks like this:
Code:
bool Database::ValidateInventory( uint32 char_id, PlayerProfile_Struct* pp, Inventory* inv )
{
	if( !pp || !inv ) // null?
		return false;

	bool valid = true;

    ItemInst *item = 0;
	for( int i = 0; i < 22; ++i ) // Worn slots
	{
		item = inv->GetItem(i);
		if( item == 0 )
			continue;

		if( item->IsType( ItemTypeCommon ) )
		{
			// Make sure no-one has equipped items their Race, Class, or Level cannot use.
			if( !item->IsEquipable( pp->race, pp->class_, pp->level ) ) // if item shouldn't be equipped
			{
				inv->DeleteItem( i ); // Delete from inventory
				item = 0; // Null the item
				SaveInventory( char_id, item, i ); // Save change
				valid = false; // Inventory was invalid, flag it
			}
			// Make sure no-one has equipped 2 handed weapons & a secondary item
			else if( i == SLOT_PRIMARY && item->IsWeapon() )
			{
				if( (item->GetItem()->Common.Skill == 1) || (item->GetItem()->Common.Skill == 4) || (item->GetItem()->Common.Skill == 35) ) // 2 handed weapons
				{
					if( inv->GetItem(SLOT_SECONDARY) ) // and if secondary slot is not empty
					{
						inv->DeleteItem( i ); // Delete from inventory
						item = 0; // Null the item
						SaveInventory( char_id, item, i ); // Save change
						valid = false; // Inventory was invalid, flag it
					}
				}
			}
		}
	}

	return valid;
}
__________________
~ b [ u ] s h

* ServerOP * The Green Leaf Server
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 09:43 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