if( pi_k->id1 == 0x1B && ( pi_k->id2 == 0xC3 || pi_k->id2 == 0xC4 ) )
if( pi_k->id() == 0x1BC3 || pi_k->id() == 0x1BC4 )
void deathstuff(P_CHAR pc_player){	int z, l, q, ele;	char murderername[50]; //AntiChrist	unsigned char clearmsg[8];	int nType=0;	if ( pc_player == NULL )		return;	if (pc_player->dead || pc_player->npcaitype == 17 || pc_player->isInvul())		return;	if(pc_player->polymorph)	{		pc_player->setId(pc_player->xid);		pc_player->polymorph = false;		teleport(pc_player);	}	pc_player->xid = pc_player->id(); // lb bugfix	pc_player->xskin = pc_player->skin;	pc_player->murdererSer = 0;	// Reset previous murderer serial # to zero	if (pc_player->attacker != INVALID_SERIAL)	{		P_CHAR pc_attacker = FindCharBySerial(pc_player->serial);		strcpy(murderername, pc_attacker->name.c_str());	}	else		murderername[0]=0;	AllCharsIterator iter_char;	for (iter_char.Begin(); !iter_char.atEnd(); iter_char++)	{		P_CHAR pc_t = iter_char.GetData();		if (pc_t->targ == pc_player->serial && !pc_t->free)		{			if (pc_t->npcaitype==4) //LB change from 0x40 to 4			{				pc_t->summontimer=(uiCurrentTime+(MY_CLOCKS_PER_SEC*20));				pc_t->npcWander=2;				pc_t->setNextMoveTime();				npctalkall(pc_t,"Thou have suffered thy punishment, scoundrel.",0);			}			pc_t->targ=INVALID_SERIAL;			pc_t->timeout=0;			if (pc_t->attacker != INVALID_SERIAL)			{				P_CHAR pc_attacker = FindCharBySerial(pc_t->attacker);				pc_attacker->resetAttackFirst();				pc_attacker->attacker = INVALID_SERIAL; // lb crashfix			}			pc_t->attacker = INVALID_SERIAL;			pc_t->resetAttackFirst();			if (pc_t->npcaitype==4 || pc_t->npcaitype==9) // Ripper...so non human npcs disapear if killed by guards.			{				if (pc_player->isNpc() && !pc_player->isHuman())					Npcs->DeleteChar(pc_player);			}			if(pc_t->isPlayer() && !pc_t->inGuardedArea())			{//AntiChrist				Karma(pc_t, pc_player, (0-(pc_player->karma)));				Fame(pc_t,pc_player->fame);				//murder count \/				if ((pc_player->isPlayer())&&(pc_t->isPlayer()))//Player vs Player				{					if(pc_player->isInnocent() && GuildCompare( pc_t, pc_player ) == 0 && pc_t->attackfirst == 1)					{						// Ask the victim if they want to place a bounty on the murderer (need gump to be added to						// BountyAskViction() routine to make this a little nicer ) - no time right now						// BountyAskVictim( pc_player->serial, pc_t->serial );						pc_player->murdererSer = pc_t->serial;						pc_t->kills++;						sprintf((char*)temp, "You have killed %i innocent people.", pc_t->kills);						UOXSOCKET sock = calcSocketFromChar(pc_t);						sysmessage(sock, (char*)temp);						if (pc_t->kills==(unsigned)SrvParams->maxkills())							sysmessage(sock, "You are now a murderer!");						setcharflag(pc_t);//AntiChrist					}					if (SrvParams->pvpLog())					{						sprintf((char*)temp,"%s was killed by %s!\n",pc_player->name.c_str(),pc_t->name.c_str());						savelog((char*)temp,"PvP.log");					}				}			}//if !npc			if (pc_t->isNpc() && pc_t->war)				npcToggleCombat(pc_t); // ripper		}	}	P_ITEM pi_backpack = Packitem(pc_player);	z=calcSocketFromChar(pc_player);	if (z != -1)		unmounthorse(z);	unsigned int ci=0;	P_ITEM pi_j;	vector<SERIAL> vecContainer(contsp.getData(pc_player->serial));	for ( ci = 0; ci < vecContainer.size(); ci++)	{		pi_j = FindItemBySerial(vecContainer[ci]);		if (pi_j->type==1 && pi_j->pos.x==26 && pi_j->pos.y==0 &&			pi_j->pos.z==0 && pi_j->id()==0x1E5E )		{			endtrade(pi_j->serial);		}	}	ele=0;	if(pc_player->isPlayer()) pc_player->id1=0x01; // Character is a ghost	if (pc_player->xid==0x0191)	{		pc_player->setId(0x0193);	// Male or Female	}	else	{		pc_player->setId(0x0192);	}	PlayDeathSound(pc_player);	pc_player->skin = 0x0000; // Undyed	pc_player->dead = true;	// Dead	pc_player->hp = 0;		// With no hp left	pc_player->poisoned = 0;	pc_player->poison = 0;	//AntiChrist	// Make the corpse	sprintf((char*)temp,"corpse of %s",pc_player->name.c_str());	const P_ITEM pi_c = Items->SpawnItem(pc_player, 1, (char*)temp, 0, 0x2006, pc_player->xskin, 0);	if(pi_c==NULL) return;//AntiChrist to preview crashes	// Corpse highlighting.. Ripper	if(pc_player->isPlayer())	{	    if (pc_player->isInnocent()) pi_c->more2=1;	    else if (pc_player->isCriminal()) pi_c->more2=2;	    else if (pc_player->isMurderer()) pi_c->more2=3;        pi_c->ownserial=pc_player->serial;	}// end corpse highlighting.//    if(pc_player->isNpc() || pc_player->isPlayer())	ele=pi_c->amount=pc_player->xid; // Amount == corpse type	pi_c->morey = ishuman(pc_player);//is human?? - AntiChrist	pi_c->carve=pc_player->carve;//store carve section - AntiChrist	pi_c->name2 = pc_player->name;	pi_c->type=1;	pi_c->moveTo(pc_player->pos);	pi_c->more1=nType;	pi_c->dir=pc_player->dir;	pi_c->corpse=1;	pi_c->startDecay();		//JustMichael -- If it was a player set the ownerserial to the player's	if( pc_player->isPlayer() )	{		pi_c->SetOwnSerial(pc_player->serial);		pi_c->more4 = char( SrvParams->playercorpsedecaymultiplier()&0xff ); // how many times longer for the player's corpse to decay	}	//AntiChrist -- stores the time and the murderer's name	pi_c->murderer = murderername;	pi_c->murdertime = uiCurrentTime;	// Put objects on corpse	vecContainer.clear();	vecContainer = contsp.getData(pc_player->serial);	for ( ci = 0; ci < vecContainer.size(); ci++)	{		pi_j = FindItemBySerial(vecContainer[ci]);		// for BONUS ITEMS - remove bonus		pc_player->removeItemBonus(pi_j);		if ((pi_j->trigon==1) && (pi_j->layer >0) && (pi_j->layer!=15) && (pi_j->layer<19))// -Frazurbluu- Trigger Type 2 is my new trigger type *-		{			Trig->triggerwitem(z, pi_j, 1); // trigger is fired when item destroyed		}		if ((pi_j->contserial== pc_player->serial) && (pi_j->layer!=0x0B) && (pi_j->layer!=0x10))		{//Let's check all items, except HAIRS and BEARD			// Ripper...so order/chaos shields disappear when on corpse backpack.			if( pi_j->id1 == 0x1B && ( pi_j->id2 == 0xC3 || pi_j->id2 == 0xC4 ) )			{				soundeffect2(pc_player, 0x01FE);				staticeffect(pc_player, 0x37, 0x2A, 0x09, 0x06);				Items->DeleItem( pi_j );			}			if (pi_j->type==1 && pi_j->layer!=0x1A && pi_j->layer!=0x1B &&				pi_j->layer!=0x1C && pi_j->layer!=0x1D)			{//if this is a pack but it's not a VendorContainer(like the buy container) or a bankbox				unsigned int ci1;				vector<SERIAL> vecContainer = contsp.getData(pi_j->serial);				for ( ci1 = 0; ci1 < vecContainer.size(); ++ci1)				{					P_ITEM pi_k = FindItemBySerial(vecContainer[ci1]);					if ( (!(pi_k->priv&0x02)) && (pi_k->type!=9))//Morrolan spellbook disappearance fix					{//put the item in the corpse only of we're sure it's not a newbie item or a spellbook						pi_k->layer=0;						pi_k->SetContSerial(pi_c->serial);						pi_k->SetRandPosInCont(pi_c);						// Ripper...so order/chaos shields disappear when on corpse backpack.						if( pi_k->id1 == 0x1B && ( pi_k->id2 == 0xC3 || pi_k->id2 == 0xC4 ) )						{							soundeffect2(pc_player, 0x01FE);							staticeffect(pc_player, 0x37, 0x2A, 0x09, 0x06);							Items->DeleItem( pi_k );						}						RefreshItem(pi_k);//AntiChrist					}				}			}			else if (pi_j->layer==0x1A)			{//else if it's a NPC vendor special container				clearmsg[0]=0x3B;				clearmsg[1]=0x00;				clearmsg[2]=0x08;				LongToCharPtr(pc_player->serial, &clearmsg[3]);				clearmsg[7]=0x00;				for (l=0;l<now;l++)					if (perm[l] && inrange1p(pc_player, currchar[l]))						Xsend(l, clearmsg, 8);			}//else if it's a normal item but ( not newbie and not bank items )			else if ((!(pi_j->priv&0x02)) && pi_j->layer!=0x1D)			{				if (pi_j != pi_backpack)				{					pi_j->SetContSerial(pi_c->serial);				}			}			else if(pi_backpack != NULL && pi_j->layer!=0x1D)			{//else if the item is newbie put it into char's backpack				if(pi_j != pi_backpack)				{					pi_j->layer = 0;					pi_j->SetContSerial(pi_backpack->serial);				}			}			if ((pi_j->layer==0x15)&&(pc_player->shop==0)) pi_j->layer=0x1A;			pi_j->pos.x = RandomNum(20, 70);			pi_j->pos.y = RandomNum(85, 160);			pi_j->pos.z=9;			SndRemoveitem(pi_j->serial);			RefreshItem(pi_j);//AntiChrist		}		if ((pi_j->contserial == pc_player->serial)&& ((pi_j->layer==0x0B)||(pi_j->layer==0x10)))		{			pi_j->name = "Hair/Beard";			pi_j->pos.x=0x47;			pi_j->pos.y=0x93;			pi_j->pos.z=0;		}	}	if (pc_player->isPlayer())	{		strcpy((char*)temp,"a Death Shroud");		const P_ITEM pi_c = Items->SpawnItem(z, pc_player, 1, (char*)temp, 0, 0x20, 0x4E, 0, 0, 0);		if(pi_c == NULL) return;		pc_player->robe = pi_c->serial;		pi_c->SetContSerial(pc_player->serial);		pi_c->layer=0x16;		pi_c->def=1;	}	if (SrvParams->showDeathAnim())		deathaction(pc_player, pi_c);	if (pc_player->account() != -1) // LB	{				teleport(pc_player);			q = calcSocketFromChar(pc_player);		if (q>-1) deathmenu(q);	}//	if ((ele==13)||(ele==15)||(ele==16)||(ele==574))//-Frazurbluu, we're gonna remove this strange little function :)// it becomes OSI exact with it removed! -Fraz- I DO NEED TO CHECK ENERGY VORTEXS!!!!!!!!!!!!!!!!!!!!!!//	{		// *** This looks very strange to me! Turning the shroud into a backpack ??? Duke 9.8.2k ***//		strcpy(pi_c->name,"a backpack");//		pi_c->color1=0;//		pi_c->color2=0;//		pi_c->amount = 1;//		pi_c->setId(0x09B2);//		pi_c->corpse=0;//	}	RefreshItem(pi_c);//AntiChrist	if (pc_player->isNpc())		Npcs->DeleteChar(pc_player);	if(ele==65535) Items->DeleItem(pi_c);}