P_ITEM playerCont = Packitem( pc );
void deedhouse(UOXSOCKET s, int i) // Ripper & AB{	P_ITEM pHouse = MAKE_ITEM_REF(i);	int loopexit=0;	int x1, y1, x2, y2;	unsigned char ser1, ser2, ser3, ser4;	if( pHouse == NULL ) return;	P_CHAR pc = MAKE_CHARREF_LR(currchar[s]);	P_ITEM playerCont = Packitem( pc );	int a,checkgrid,increment,StartGrid,getcell,ab;			if(pc->Owns(pHouse) || pc->isGM())	{		Map->MultiArea(pHouse, &x1,&y1,&x2,&y2);				P_ITEM pDeed = Items->SpawnItemBackpack2(s, pHouse->morex, 0);        // need to make before delete		if( pDeed == NULL ) return;		sprintf((char*)temp, "Demolishing House %s", pHouse->name);		sysmessage( s, (char*)temp );		ser1 = pHouse->ser1;		ser2 = pHouse->ser2;		ser3 = pHouse->ser3;		ser4 = pHouse->ser4;		Items->DeleItem(pHouse);		sprintf((char*)temp, "Converted into a %s.", pDeed->name);		sysmessage(s, (char*)temp); 		// door/sign delete		StartGrid=mapRegions->StartGrid(pc->pos.x, pc->pos.y);		getcell=mapRegions->GetCell(pc->pos.x, pc->pos.y);		increment=0;		ab=0;		for (checkgrid=StartGrid+(increment*mapRegions->GetColSize());increment<3;increment++, checkgrid=StartGrid+(increment*mapRegions->GetColSize()))		{       			for (a=0;a<3;a++)			{                                       				loopexit=0;				vector<SERIAL> vecEntries = mapRegions->GetCellEntries(checkgrid+a);				for (unsigned int k = 0; k < vecEntries[k]; k++)				{					P_CHAR mapchar = FindCharBySerial(vecEntries[k]);					P_ITEM mapitem = FindItemBySerial(vecEntries[k]);					if (mapchar != NULL)					{						if( mapchar->pos.x >= x1 && mapchar->pos.y >= y1 && mapchar->pos.x <= x2 && mapchar->pos.y <= y2 )						{							if( mapchar->npcaitype == 17 ) // player vendor in right place							{								sprintf( (char*)temp, "A vendor deed for %s", mapchar->name );								P_ITEM pPvDeed = Items->SpawnItem(DEREF_P_CHAR(pc), 1, (char*)temp, 0, 0x14F0, 0, 1);								pPvDeed->type = 217;								pPvDeed->value = 2000;								RefreshItem( pPvDeed );								sysmessage(s, "Packed up vendor %s.", mapchar->name);								Npcs->DeleteChar( DEREF_P_CHAR(mapchar) );							}						}					}					else if( mapitem != NULL )					{						if( mapitem->pos.x >= x1 && mapitem->pos.y >= y1 && mapitem->pos.x <= x2 && mapitem->pos.y <= y2 )						{							Items->DeleItem(mapitem);						}					}				} 			}		}		int h=HouseManager->GetHouseNum(pc);		if(h>=0)			HouseManager->RemoveHouse(h);		sysmessage(s,"All house items and keys removed.");				pc->pos.z = pc->dispz = Map->MapElevation(pc->pos.x, pc->pos.y);		teleport(DEREF_P_CHAR(pc));		return;	}}