setserial(c,i,1);
pi5->SetContSerial(items[i].serial);
static void newCarveTarget(UOXSOCKET s, ITEM i){	int cc = currchar[s];	bool deletecorpse=false;	int c, storeval, n;	char sect[512];	long int pos;	P_ITEM pi1=Items->SpawnItem(cc,1,"#",0,0x122A,0,0);	//add the blood puddle	P_ITEM pi2=MAKE_ITEMREF_LR(npcshape[0]);	P_ITEM pi3=MAKE_ITEMREF_LR(i);	if(!pi1) return;	pi1->MoveTo(pi2->pos.x,pi2->pos.y,pi2->pos.z);	pi1->magic=2;//AntiChrist - makes the item unmovable	pi1->startDecay();	RefreshItem(pi1);	if(pi3->morey)	//if it's a human corpse	{		chars[cc].fame-=100; // Ripper..lose fame and karma and criminal.		chars[cc].karma-=100;		sysmessage(s,"You lost some fame and karma!");		criminal(cc);		//create the Head		sprintf((char*)temp,"the head of %s",pi3->name2);		c=Items->SpawnItem(s,cc,1,(char*)temp,0,0x1D,0xA0,0,0,0,0);		P_ITEM pi=MAKE_ITEMREF_LR(c);		if(c==-1) return;		setserial(c,i,1);		pi->layer=0x01;		pi->att=5;		//AntiChrist & Magius(CHE) - store item's owner, so that lately		//if we want to know the owner we can do it		pi->setOwnSerialOnly(pi3->ownserial);		//create the Body		sprintf((char*)temp,"the heart of %s",pi3->name2);		c=Items->SpawnItem(s,cc,1,(char*)temp,0,0x1C,0xED,0,0,0,0);		P_ITEM pi4=MAKE_ITEMREF_LR(c);		if(c==-1) return;		setserial(c,i,1);		pi4->layer=0x01;		pi4->att=5;		pi4->setOwnSerialOnly(pi3->ownserial);	// see above		//create the Heart		sprintf((char*)temp,"the body of %s",pi3->name2);		c=Items->SpawnItem(s,cc,1,(char*)temp,0,0x1D,0xAD,0,0,0,0);		P_ITEM pi5=MAKE_ITEMREF_LR(c);		if(c==-1) return;		setserial(c,i,1);		pi5->layer=0x01;		pi5->att=5;		pi5->setOwnSerialOnly(pi3->ownserial);	// see above		//create the Left Arm		sprintf((char*)temp,"the left arm of %s",pi3->name2);		c=Items->SpawnItem(s,cc,1,(char*)temp,0,0x1D,0xA1,0,0,0,0);		P_ITEM pi6=MAKE_ITEMREF_LR(c);		if(c==-1) return;		setserial(c,i,1);		pi6->layer=0x01;		pi6->att=5;		pi6->setOwnSerialOnly(pi3->ownserial);	// see above		//create the Right Arm		sprintf((char*)temp,"the right arm of %s",pi3->name2);		c=Items->SpawnItem(s,cc,1,(char*)temp,0,0x1D,0xA2,0,0,0,0);		P_ITEM pi7=MAKE_ITEMREF_LR(c);		if(c==-1) return;//AntiChrist to preview crashes		setserial(c,i,1);		pi7->layer=0x01;		pi7->att=5;		pi7->setOwnSerialOnly(pi3->ownserial);	// see above		//create the Left Leg		sprintf((char*)temp,"the left leg of %s",pi3->name2);		c=Items->SpawnItem(s,cc,1,(char*)temp,0,0x1D,0xA3,0,0,0,0);		P_ITEM pi8=MAKE_ITEMREF_LR(c);		if(c==-1) return;//AntiChrist to preview crashes		setserial(c,i,1);		pi8->layer=0x01;		pi8->att=5;		pi8->setOwnSerialOnly(pi3->ownserial);	// see above		//create the Rigth Leg		sprintf((char*)temp,"the right leg of %s",pi3->name2);		c=Items->SpawnItem(s,cc,1,(char*)temp,0,0x1D,0xA4,0,0,0,0);		P_ITEM pi9=MAKE_ITEMREF_LR(c);		if(c==-1) return;				setserial(c,i,1);		pi9->layer=0x01;		pi9->att=5;		pi9->setOwnSerialOnly(pi3->ownserial);	// see above		//human: always delete corpse!		deletecorpse=true;	} else	{		openscript("carve.scp");		sprintf(sect,"CARVE %i",pi3->carve);		if (!i_scripts[carve_script]->find(sect))		{			closescript();			return;		}		int loopexit=0;		do		{			read2();			if (script1[0]!='}')			{				if (!(strcmp("ADDITEM",(char*)script1)))				{					storeval=str2num(script2);					pos=ftell(scpfile);					closescript();					n=Items->CreateScriptItem(s,storeval,0);					P_ITEM pi10=MAKE_ITEMREF_LR(n);					pi10->layer=0;					setserial(n, i, 1);					pi10->pos.x=20+(rand()%50);					pi10->pos.y=85+(rand()%75);					pi10->pos.z=9;					RefreshItem(n);//let's finally refresh the item					strcpy((char*)script1, "DUMMY");					openscript("carve.scp");					fseek(scpfile, pos, SEEK_SET);				}			}		}		while ( (script1[0]!='}') && (++loopexit < MAXLOOPS) );		closescript();	}	if(deletecorpse)//if corpse has to be deleted	{		//let's empty it		int ci=0, loopexit=0;		P_ITEM pj;		while ( (( pj=ContainerSearch(pi3->serial,&ci)) != NULL) && (++loopexit < MAXLOOPS) )		{			pj->SetContSerial(-1);			pj->MoveTo(pi3->pos.x,pi3->pos.y,pi3->pos.z);			pj->startDecay();			RefreshItem(pj);		}		Items->DeleItem(i);	//and then delete the corpse	}}