P_ITEM pj = Trade->tradestart(s, pTC); pi->SetContSerial(pj->serial);
static bool ItemDroppedOnChar(P_CLIENT ps, PKGx08 *pp, P_ITEM pi){	UOXSOCKET s = ps->GetSocket();	P_CHAR pc_currchar = ps->getPlayer();	P_CHAR pTC = FindCharBySerial(pp->Tserial);	// the targeted character	if (!pTC) return true;	if (pTC != pc_currchar)	{		if (pTC->isNpc())		{			if(!pTC->isHuman())									{				ItemDroppedOnPet( ps, pp, pi);			}			else	// Item dropped on a Human character			{				// Item dropped on a Guard (possible bounty quest)				if( ( pTC->isNpc() ) && ( pTC->npcaitype == 4 ) )				{					if (!ItemDroppedOnGuard( ps, pp, pi) )					{						Sndbounce5(s);						if (ps->IsDragging())						{							ps->ResetDragging();							item_bounce5(s,pi);						}					}					return true;				}				if ( pTC->npcaitype == 5 )				{					if (!ItemDroppedOnBeggar( ps, pp, pi))					{						Sndbounce5(s);						if (ps->IsDragging())						{							ps->ResetDragging();							item_bounce5(s,pi);						}					}					return true;				}				if ( pTC->npcaitype == 19 )				{					if (!DeedDroppedOnBroker( ps, pp, pi))					{						Sndbounce5(s);						if (ps->IsDragging())						{							ps->ResetDragging();							item_bounce5(s,pi);						}					}					return true;				}				if ( pTC->npcaitype == 8 )				{					if (!ItemDroppedOnBanker( ps, pp, pi))					{						Sndbounce5(s);						if (ps->IsDragging())						{							ps->ResetDragging();							item_bounce5(s,pi);						}					}					return true;				}								//This crazy training stuff done by Anthracks (fred1117@tiac.net)				if(pc_currchar->trainer!=pTC->serial)				{					npctalk(s, pTC, "Thank thee kindly, but I have done nothing to warrant a gift.",0);					Sndbounce5(s);					if (ps->IsDragging())					{						ps->ResetDragging();						item_bounce5(s,pi);					}					return true;				}				else // The player is training from this NPC				{					ItemDroppedOnTrainer( ps, pp, pi);					return true;				}			}//if human or not		}		else // dropped on another player		{			// By Polygon: Avoid starting the trade if GM drops item on logged on char (crash fix)			if ((pc_currchar->isGM()) && !online(pTC))			{				// Drop the item in the players pack instead				// Get the pack				P_ITEM pack = Packitem(pTC);				if (pack != NULL)	// Valid pack?				{					pack->AddItem(pi);	// Add it					Weight->NewCalc(pTC);				}				else	// No pack, give it back to the GM				{					pack = Packitem(pc_currchar);					if (pack != NULL)	// Valid pack?					{						pack->AddItem(pi);	// Add it						Weight->NewCalc(pc_currchar);					}					else	// Even GM has no pack?					{						// Drop it to it's feet						pi->MoveTo(pc_currchar->pos.x, pc_currchar->pos.y, pc_currchar->pos.z);						RefreshItem(pi);					}				}			}			else			{				P_ITEM j=Trade->tradestart(s, pTC); //trade-stuff				if(j==NULL)					return true;				pi->SetContSerial(j->serial);				P_ITEM pj = Trade->tradestart(s, pTC); //trade-stuff				pi->SetContSerial(pj->serial);				pi->pos.x = 30;				pi->pos.y = 30;				pi->pos.z = 9;				SndRemoveitem(pi->serial);				RefreshItem(pi);			}		}	}	else // dumping stuff to his own backpack !	{		ItemDroppedOnSelf( ps, pp, pi);	}	return true;}