closescript(); return;
P_ITEM nItem = Items->createScriptItem( (*it) ); if( nItem ) { nItem->setContSerial( pi3->serial ); nItem->pos.x=20+(rand()%50); nItem->pos.y=85+(rand()%75); nItem->pos.z=9; RefreshItem( nItem ); } it++;
static void newCarveTarget(UOXSOCKET s, P_ITEM pi3){	P_CHAR pc_currchar = currchar[s];	bool deletecorpse=false;	int storeval;	char sect[512];	long int pos;	P_ITEM pi1 = Items->SpawnItem(pc_currchar, 1, "#", 0, 0x122A, 0, 0);	//add the blood puddle	P_ITEM pi2 = FindItemBySerial(npcshape[0]);	if (pi3 == NULL)		return;	if(!pi1) return;	pi1->moveTo(pi2->pos);	pi1->setGMMovable();//AntiChrist - makes the item unmovable	pi1->startDecay();	RefreshItem(pi1);	if(pi3->morey)	//if it's a human corpse	{		pc_currchar->karma-=100; // Ripper..lose karma and criminal.		sysmessage(s,"You have lost some karma!");		criminal( pc_currchar );		//create the Head		sprintf((char*)temp,"the head of %s",pi3->name2().ascii());		P_ITEM pi = Items->SpawnItem(s, pc_currchar,1,(char*)temp,0,0x1D,0xA0,0,0,0);		if(pi == NULL) return;		pi->setContSerial(pi3->serial);		pi->setLayer( 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().ascii());		P_ITEM pi4 = Items->SpawnItem(s, pc_currchar,1,(char*)temp,0,0x1C,0xED,0,0,0);		if(pi4 == NULL) return;		pi4->setContSerial(pi3->serial);		pi4->setLayer( 0x01 );		pi4->att=5;		pi4->setOwnSerialOnly(pi3->ownserial);	// see above		//create the Heart		sprintf((char*)temp,"the body of %s",pi3->name2().ascii());		P_ITEM pi5 = Items->SpawnItem(s, pc_currchar,1,(char*)temp,0,0x1D,0xAD,0,0,0);		if(pi5 == NULL) return;		pi5->setContSerial(pi3->serial);		pi5->setLayer( 0x01 );		pi5->att=5;		pi5->setOwnSerialOnly(pi3->ownserial);	// see above		//create the Left Arm		sprintf((char*)temp,"the left arm of %s",pi3->name2().ascii());		P_ITEM pi6 = Items->SpawnItem(s, pc_currchar,1,(char*)temp,0,0x1D,0xA1,0,0,0);		if(pi6==NULL) return;		pi6->setContSerial(pi3->serial);		pi6->setLayer( 0x01 );		pi6->att=5;		pi6->setOwnSerialOnly(pi3->ownserial);	// see above		//create the Right Arm		sprintf((char*)temp,"the right arm of %s",pi3->name2().ascii());		P_ITEM pi7 = Items->SpawnItem(s, pc_currchar,1,(char*)temp,0,0x1D,0xA2,0,0,0);		if(pi7==NULL) return;//AntiChrist to preview crashes		pi7->setContSerial(pi3->serial);		pi7->setLayer( 0x01 );		pi7->att=5;		pi7->setOwnSerialOnly(pi3->ownserial);	// see above		//create the Left Leg		sprintf((char*)temp,"the left leg of %s",pi3->name2().ascii());		P_ITEM pi8 = Items->SpawnItem(s, pc_currchar,1,(char*)temp,0,0x1D,0xA3,0,0,0);		if(pi8 == NULL) return;//AntiChrist to preview crashes		pi8->setContSerial(pi3->serial);		pi8->setLayer( 0x01 );		pi8->att=5;		pi8->setOwnSerialOnly(pi3->ownserial);	// see above		//create the Rigth Leg		sprintf((char*)temp,"the right leg of %s",pi3->name2().ascii());		P_ITEM pi9=Items->SpawnItem(s, pc_currchar,1,(char*)temp,0,0x1D,0xA4,0,0,0);		if(pi9==NULL) return;				pi9->setContSerial(pi3->serial);		pi9->setLayer( 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;		}		unsigned long loopexit=0;		do		{			read2();			if (script1[0]!='}')			{				if (!(strcmp("ADDITEM",(char*)script1)))				{					storeval=str2num(script2);					pos=ftell(scpfile);					closescript();					P_ITEM pi10 = Items->createScriptItem(s,script2,0);					if (pi10 == NULL)						return;					pi10->setLayer( 0x00 );					pi10->setContSerial(pi3->serial);					pi10->pos.x=20+(rand()%50);					pi10->pos.y=85+(rand()%75);					pi10->pos.z=9;					RefreshItem(pi10);//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		unsigned int ci;		P_ITEM pj;		vector<SERIAL> vecContainer = contsp.getData(pi3->serial);		for ( ci = 0; ci < vecContainer.size(); ci++)		{			pj = FindItemBySerial(vecContainer[ci]);			pj->setContSerial(-1);			pj->moveTo(pi3->pos);			pj->startDecay();			RefreshItem(pj);		}		Items->DeleItem(pi3);	//and then delete the corpse	}}