for (ci=0;ci<contsp[serhash].max;ci++)
vector<SERIAL> vecContainer = contsp.getData(serial); for (ci=0;ci<vecContainer.size();ci++)
void vialtarget(int nSocket) // bug & crashfixed by LB 25 september 1999{	if(buffer[nSocket][11]==0xFF && buffer[nSocket][12]==0xFF && buffer[nSocket][13]==0xFF && buffer[nSocket][14]==0xFF) 		return; // check if user canceled operation		P_ITEM pVial=MAKE_ITEMREF_LR(addx[nSocket]);	if (!pVial) return; // should never happen		int nTargetID=-1,nDagger=-1,nDist=0,item,serhash,i,dag,ci;		int serial=calcserial(buffer[nSocket][7],buffer[nSocket][8],buffer[nSocket][9],buffer[nSocket][10]);	int nItemID = calcCharFromSer( serial ); // targeted a living creature ?	if (nItemID!=-1)		nTargetID=nItemID;		nItemID = calcItemFromSer( serial ); // or a corpse/differnt item ?	if ((nItemID!=-1) && (nTargetID==-1)) nTargetID=nItemID;		int cc = currchar[nSocket];	serial=chars[cc].serial; // search for a dagger in the players hand	serhash=serial%HASHMAX;	item=-1;	for (ci=0;ci<contsp[serhash].max;ci++)	{		i=contsp[serhash].pointer[ci];		if (i!=-1)		{			if (items[i].id()==0x0F51 || items[i].id()==0x0F52) dag=1; else dag=0;			if (((items[i].layer==1)&&(items[i].contserial==serial) && dag))			{				item=i;				break;			}		}	}		nDagger=item;		if(pVial && nTargetID!=-1 && nDagger!=-1)	{		pVial->more1=0;		if((chars[nTargetID].isPlayer() || chars[nTargetID].isNpc()) && items[nTargetID].corpse!=1)		{			// checkskill hmmm what skill/s has/have to added here LB ...						if( nTargetID == cc)			{				if(chars[nTargetID].hp<=10)				{					sysmessage(nSocket,"You are too wounded to continue.");					return;				}				else				{					sysmessage(nSocket,"You prick your finger and fill the vial.");					chars[nTargetID].hp=(chars[nTargetID].hp-((rand()%6)+2));					MakeNecroReg(nSocket,pVial,0x0E24);					return;				}			}			else			{				nDist=chardist(cc,nTargetID);				if((inrange1p(cc,nTargetID))&&					(nDist<=2))				{					sprintf((char*)temp,"%s has pricked you with a dagger and sampled your blood.",chars[cc].name);					if(chars[nTargetID].isNpc())					{						Karma(cc,nTargetID,(0-(chars[nTargetID].karma)));						if((chars[nTargetID].id1==0x00)&&((chars[nTargetID].id2==0x0c)||(chars[nTargetID].id2>=0x3b)&&(chars[nTargetID].id2<=0x3d)))							pVial->more1=1;						chars[nTargetID].hp=(chars[nTargetID].hp-((rand()%6)+2));						MakeNecroReg(nSocket,pVial,0x0E24);						// Guard be summuned if in town and good npc						// if good flag criminal						// if evil npc attack necromancer but don't flag criminal					}					else					{						Karma(cc,nTargetID,(0-(chars[nTargetID].karma)));						chars[nTargetID].hp=(chars[nTargetID].hp-((rand()%6)+2));						sysmessage(calcSocketFromChar(nTargetID),(char*)temp);						MakeNecroReg(nSocket,pVial,0x0E24);						// flag criminal											}				}				else 				{					sysmessage(nSocket,"That individual is not anywhere near you.");					return;				}			}		}		else			if(items[nTargetID].corpse==1)			{				pVial->more1=items[nTargetID].more1;				Karma(cc,-1,-1000);				if(items[nTargetID].more2<4)				{					sysmessage(nSocket,"You take a sample of blood from the corpse.");					MakeNecroReg(nSocket,pVial,0x0E24);					items[nTargetID].more2++;				}				else sysmessage(nSocket,"You examine the corpse but, decide any further blood samples would be to contaminated.");			}			else sysmessage(nSocket,"That is not a person or a corpse!");	}			if(nDagger==-1) sysmessage(nSocket,"You do not have a dagger equipped.");	}