sysmessage(s, "Hey, putting houses in your pack crashes your back and client!"); }
sysmessage(s, "You cannot put houses in your backpack" ); }
void pack_item(P_CLIENT ps, PKGx08 *pp) // Item is put into container{	SERIAL serial;	bool abort = false;	UOXSOCKET s = ps->GetSocket();	P_CHAR pc_currchar = ps->getPlayer();		serial=pp->Tserial;	if(serial == INVALID_SERIAL) abort = true;	const P_ITEM pCont= FindItemBySerial( serial );		serial = pp->Iserial;	if(serial == INVALID_SERIAL) abort = true;	const P_ITEM pItem = FindItemBySerial( serial );		if (pCont == NULL)	{		RefreshItem(pCont);//AntiChrist		return;	}		if (pItem == NULL || pCont == NULL) return; //LB	pItem->flags.isBeeingDragged = false;	if (pItem->id1>=0x40)	{	   abort = true; // LB crashfix that prevents moving multi objcts in BP's       sysmessage(s, "Hey, putting houses in your pack crashes your back and client!");	}	P_CHAR pc_j = GetPackOwner(pCont);	if (pc_j != NULL)	{		if (pc_j->npcaitype==17 && pc_j->isNpc() && !pc_currchar->Owns(pc_j))		{			abort = true;			sysmessage(s, "This aint your vendor!");						}	}	if(abort)	{//AntiChrist to preview item disappearing		item_bounce6(ps,pItem);		return;	}	if (pCont->layer==0 && pCont->id() == 0x1E5E &&	pc_currchar->Wears(pCont))	{		// Trade window???		serial=calcserial(pCont->moreb1, pCont->moreb2, pCont->moreb3, pCont->moreb4);		if(serial == INVALID_SERIAL) return;		P_ITEM pi_z = FindItemBySerial( serial );				if (pi_z != NULL)			if ((pi_z->morez || pCont->morez))			{				pi_z->morez=0;				pCont->morez=0;				sendtradestatus(pi_z, pCont);			}	}		//	//AntiChrist - Special Bank Stuff	//	//if morey==123  - gold only bank		//	if(SrvParams->useSpecialBank())//only if special bank is activated	{		if(pCont->morey==123 && pCont->morex==1 && pCont->type==1)		{			if ( pItem->id() == 0x0EED )			{//if they're gold ok				goldsfx(s, 2);			} else			{//if they're not gold..bounce on ground				sysmessage(s,"You can only put golds in this bank box!");				pItem->SetContSerial(-1);				pItem->moveTo(pc_currchar->pos);				RefreshItem(pItem);//AntiChrist				itemsfx(s,pItem->id());				return;			}		}	}		//testing UOP Blocking Tauriel 1-12-99	if (!pItem->isInWorld())	{		item_bounce6(ps,pItem);		return;	}		if (!pc_currchar->canPickUp(pItem))	{		Sndbounce5(s);		if (ps->IsDragging())		{			ps->ResetDragging();			item_bounce3(pItem);			if (pCont->id1>=0x40)				senditem(s, pCont);		}		return;	}	// - Trash container	if (pCont->type==87)	{		Items->DeleItem(pItem);		sysmessage(s, "As you let go of the item it disappears.");		return;	}	// - Spell Book	if (pCont->type==9)	{		if (!IsSpellScroll72(pItem->id()))		{			sysmessage(s, "You can only place spell scrolls in a spellbook!");			Sndbounce5(s);			if (ps->IsDragging())			{				ps->ResetDragging();				item_bounce3(pItem);			}			if (pCont->id1>=0x40)				senditem(s, pCont);			return;		}		P_ITEM pBackpack = Packitem(pc_currchar);		if (pBackpack != NULL) // lb		{			if (!pc_currchar->Wears(pCont) &&				(!(pCont->contserial==pBackpack->serial)) && (!(pc_currchar->canSnoop())))			{				sysmessage(s, "You cannot place spells in other peoples spellbooks.");				item_bounce6(ps,pItem);				return;			}						if(pItem->name == "#")				pItem->getName(temp2);			else				strcpy((char*)temp2, pItem->name.c_str());			vector<SERIAL> vecContainer = contsp.getData(pCont->serial);			for (unsigned int i = 0; i < vecContainer.size(); i++) // antichrist , bugfix for inscribing scrolls			{				P_ITEM pi = FindItemBySerial(vecContainer[i]);				if (pi != NULL)				{					if(pi->name == "#")						pi->getName(temp);					else						strcpy((char*)temp, pi->name.c_str());					if(!(strcmp((char*)temp,(char*)temp2)) || !(strcmp((char*)temp,"All-Spell Scroll")))					{						sysmessage(s,"You already have that spell!");						item_bounce6(ps,pItem);						return;					}				}			}		}	}		// player run vendors	if (!(pCont->pileable && pItem->pileable && pCont->id()==pItem->id()		|| (pCont->type!=1 && pCont->type!=9)))	{		P_CHAR pc_j = GetPackOwner(pCont);		if (pc_j != NULL)		{			if (pc_j->npcaitype==17 && pc_j->isNpc() && pc_currchar->Owns(pc_j))			{				pc_currchar->inputitem = pItem->serial;				pc_currchar->inputmode = cChar::enPricing;				sysmessage(s, "Set a price for this item.");			}		}		short xx=pp->TxLoc;		short yy=pp->TyLoc;		pCont->AddItem(pItem,xx,yy);				//itemsfx(s, pItem->id());// see itemsfx() for details - Dupois Added Oct 09, 1998		soundeffect2( pc_currchar, 0x57 );		statwindow(s, pc_currchar);	}	// end of player run vendors		else		// - Unlocked item spawner or unlockable item spawner		if (pCont->type==63 || pCont->type==65 || pCont->type==66)		{			pItem->SetContSerial(pp->Tserial);			// lb bugfix			pItem->pos.x=pp->TxLoc;			pItem->pos.y=pp->TyLoc;			pItem->pos.z=pp->TzLoc;						SndRemoveitem(pItem->serial);			RefreshItem(pItem);//AntiChrist			//itemsfx(s, pItem->id());			soundeffect2( pc_currchar, 0x57 );					}		else  // - Pileable			if (pCont->pileable && pItem->pileable && pCont->id()==pItem->id())			{						if ((pCont->amount+pItem->amount) > 65535)				{					pItem->amount -= (65535-pCont->amount);					Commands->DupeItem(s, pCont, pItem->amount);					pCont->amount = 65535;					Items->DeleItem(pItem);				}				else				{					pCont->amount=pCont->amount+pItem->amount;					itemsfx(s, pItem->id());					Items->DeleItem(pItem);				}				SndRemoveitem(pItem->serial);				RefreshItem(pCont);//AntiChrist			}			else			{				pItem->pos.x=pp->TxLoc;				pItem->pos.y=pp->TyLoc;				pItem->pos.z=pp->TzLoc;//				pItem->SetContSerial(-1);				pItem->SetContSerial(pp->Tserial);				// Tauriel add item to world mapcells				mapRegions->Add(pItem); //add this item to a map cell								SndRemoveitem(pItem->serial);				RefreshItem(pCont);//AntiChrist			}						// - Spell Book				if (pCont->type==9)				Magic->SpellBook(s, pCont); // LB, bugfix for showing(!) the wrong spell (clumsy) when a new spell is put into opened spellbook			if (pItem->glow != INVALID_SERIAL) // LB's glowing items stuff			{				P_CHAR pc = GetPackOwner(pCont);				pc_currchar->removeHalo(pItem); // if gm put glowing object in another pack, handle glowsp correctly !				if (pc != NULL)				{					pc->addHalo(pItem);					pc->glowHalo(pItem);				}									}	}