killkeys( pHouse->serial );
void deedhouse(UOXSOCKET s, P_ITEM pHouse) // Ripper & AB{	int x1, y1, x2, y2;	if( pHouse == NULL ) return;	P_CHAR pc = currchar[s];	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 %s", pHouse->name.c_str());		sysmessage( s, (char*)temp );		sprintf((char*)temp, "Converted into a %s.", pDeed->name.c_str());		sysmessage(s, (char*)temp); 		// door/sign delete		StartGrid=mapRegions->StartGrid(pHouse->pos);		getcell=mapRegions->GetCell(pHouse->pos);		increment=0;		ab=0;		for (checkgrid=StartGrid+(increment*mapRegions->GetColSize());increment<3;increment++, checkgrid=StartGrid+(increment*mapRegions->GetColSize()))		{       			for (a=0;a<3;a++)			{                                       				cRegion::raw vecEntries = mapRegions->GetCellEntries(checkgrid+a);				cRegion::rawIterator it = vecEntries.begin();				for (; it != vecEntries.end(); ++it )				{					P_CHAR mapchar = FindCharBySerial(*it);					P_ITEM mapitem = FindItemBySerial(*it);					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.c_str() );								P_ITEM pPvDeed = Items->SpawnItem(pc, 1, (char*)temp, 0, 0x14F0, 0, 1);								pPvDeed->type = 217;								pPvDeed->value = 2000;								RefreshItem( pPvDeed );								sysmessage(s, "Packed up vendor %s.", mapchar->name.c_str());								Npcs->DeleteChar( 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);						}					}				} 			}		}		Items->DeleItem(pHouse);//		killkeys( pHouse->serial );		sysmessage(s, "All house items and keys removed.");				pc->pos.z = pc->dispz = Map->MapElevation(pc->pos);		teleport(pc);		return;	}}