View Single Post
  #4  
Old 05-09-2004, 09:47 AM
Jezebell
Discordant
 
Join Date: Feb 2004
Location: Florida
Posts: 441
Default

What file(s) are these in?

Code:
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; 
}
__________________
Eru, the Creator of Arda
ServerOwner for The First Age
An EQEMulator Roleplaying [Custom-Legit] Server
The First Age Website

Running on: Asus A7N8X-Deluxe, AMD Athlon XP 2100+, Geil 1024MB PC3200 Ultra DDR RAM,
WD 40GB 7200rpm ATA-100 HDD, Visiontek 128MB Geforce4 TI 4400, Windows XP Pro SP2
Reply With Quote