for (ci=0;ci<contsp[serhash].max;ci++) { i=contsp[serhash].pointer[ci];
vector<SERIAL> vecContainer = contsp.getData(serial); for (ci = 0; ci < vecContainer.size(); ci++) { i=calcItemFromSer(vecContainer[ci]);
void advancementobjects(int s, int x, int allways){	char sect[512];	int loopexit=0;	P_CHAR pc_s = MAKE_CHARREF_LR(s);	int packnum,hairobject=-1, beardobject=-1;	int pos,i,retitem=-1;	if ((pc_s->advobj==0)||(allways==1))	{		staticeffect(s, 0x37, 0x3A, 0, 15);		soundeffect2(s, 0x01, 0xE9);		pc_s->advobj=x;		openscript("advance.scp");		sprintf(sect, "ADVANCEMENT %i", x);		if (!i_scripts[advance_script]->find(sect))		{			closescript();			clConsole.send("ADVANCEMENT OBJECT: Script section not found. Aborting.\n");			pc_s->advobj=0;			return;		}		else						do			{				read2();				if (script1[0]!='}')				{					if ((!(strcmp("STR",(char*)script1)))||(!(strcmp("STRENGTH",(char*)script1))))					{						pc_s->st= getstatskillvalue((char*)script2);						pc_s->st2 = pc_s->st;					}					if ((!(strcmp("DEX",(char*)script1)))||(!(strcmp("DEXTERITY",(char*)script1))))					{						pc_s->setDex(getstatskillvalue((char*)script2));					}					if ((!(strcmp("INT",(char*)script1)))||(!(strcmp("INTELLIGENCE",(char*)script1))))					{						pc_s->in= getstatskillvalue((char*)script2);						pc_s->in2 = pc_s->in;					}					if ((!(strcmp("ALCHEMY",(char*)script1)))||(!(strcmp("SKILL0",(char*)script1)))) pc_s->baseskill[ALCHEMY] = getstatskillvalue((char*)script2);					if ((!(strcmp("ANATOMY",(char*)script1)))||(!(strcmp("SKILL1",(char*)script1)))) pc_s->baseskill[ANATOMY] = getstatskillvalue((char*)script2);					if ((!(strcmp("ANIMALLORE",(char*)script1)))||(!(strcmp("SKILL2",(char*)script1)))) pc_s->baseskill[ANIMALLORE] = getstatskillvalue((char*)script2);					if ((!(strcmp("ITEMID",(char*)script1)))||(!(strcmp("SKILL3",(char*)script1)))) pc_s->baseskill[ITEMID] = getstatskillvalue((char*)script2);					if ((!(strcmp("ARMSLORE",(char*)script1)))||(!(strcmp("SKILL4",(char*)script1)))) pc_s->baseskill[ARMSLORE] = getstatskillvalue((char*)script2);					if ((!(strcmp("PARRYING",(char*)script1)))||(!(strcmp("SKILL5",(char*)script1)))) pc_s->baseskill[PARRYING] = getstatskillvalue((char*)script2);					if ((!(strcmp("BEGGING",(char*)script1)))||(!(strcmp("SKILL6",(char*)script1)))) pc_s->baseskill[BEGGING] = getstatskillvalue((char*)script2);					if ((!(strcmp("BLACKSMITHING",(char*)script1)))||(!(strcmp("SKILL7",(char*)script1)))) pc_s->baseskill[BLACKSMITHING] = getstatskillvalue((char*)script2);					if ((!(strcmp("BOWCRAFT",(char*)script1)))||(!(strcmp("SKILL8",(char*)script1)))) pc_s->baseskill[BOWCRAFT] = getstatskillvalue((char*)script2);					if ((!(strcmp("PEACEMAKING",(char*)script1)))||(!(strcmp("SKILL9",(char*)script1)))) pc_s->baseskill[PEACEMAKING] = getstatskillvalue((char*)script2);					if ((!(strcmp("CAMPING",(char*)script1)))||(!(strcmp("SKILL10",(char*)script1)))) pc_s->baseskill[CAMPING] = getstatskillvalue((char*)script2);					if ((!(strcmp("CARPENTRY",(char*)script1)))||(!(strcmp("SKILL11",(char*)script1)))) pc_s->baseskill[CARPENTRY] = getstatskillvalue((char*)script2);					if ((!(strcmp("CARTOGRAPHY",(char*)script1)))||(!(strcmp("SKILL12",(char*)script1)))) pc_s->baseskill[CARTOGRAPHY] = getstatskillvalue((char*)script2);					if ((!(strcmp("COOKING",(char*)script1)))||(!(strcmp("SKILL13",(char*)script1)))) pc_s->baseskill[COOKING] = getstatskillvalue((char*)script2);					if ((!(strcmp("DETECTINGHIDDEN",(char*)script1)))||(!(strcmp("SKILL14",(char*)script1)))) pc_s->baseskill[DETECTINGHIDDEN] = getstatskillvalue((char*)script2);					if ((!(strcmp("ENTICEMENT",(char*)script1)))||(!(strcmp("SKILL15",(char*)script1)))) pc_s->baseskill[ENTICEMENT] = getstatskillvalue((char*)script2);					if ((!(strcmp("EVALUATINGINTEL",(char*)script1)))||(!(strcmp("SKILL16",(char*)script1)))) pc_s->baseskill[EVALUATINGINTEL] = getstatskillvalue((char*)script2);					if ((!(strcmp("HEALING",(char*)script1)))||(!(strcmp("SKILL17",(char*)script1)))) pc_s->baseskill[HEALING] = getstatskillvalue((char*)script2);					if ((!(strcmp("FISHING",(char*)script1)))||(!(strcmp("SKILL18",(char*)script1)))) pc_s->baseskill[FISHING] = getstatskillvalue((char*)script2);					if ((!(strcmp("FORENSICS",(char*)script1)))||(!(strcmp("SKILL19",(char*)script1)))) pc_s->baseskill[FORENSICS] = getstatskillvalue((char*)script2);					if ((!(strcmp("HERDING",(char*)script1)))||(!(strcmp("SKILL20",(char*)script1)))) pc_s->baseskill[HERDING] = getstatskillvalue((char*)script2);					if ((!(strcmp("HIDING",(char*)script1)))||(!(strcmp("SKILL21",(char*)script1)))) pc_s->baseskill[HIDING] = getstatskillvalue((char*)script2);					if ((!(strcmp("PROVOCATION",(char*)script1)))||(!(strcmp("SKILL22",(char*)script1)))) pc_s->baseskill[PROVOCATION] = getstatskillvalue((char*)script2);					if ((!(strcmp("INSCRIPTION",(char*)script1)))||(!(strcmp("SKILL23",(char*)script1)))) pc_s->baseskill[INSCRIPTION] = getstatskillvalue((char*)script2);					if ((!(strcmp("LOCKPICKING",(char*)script1)))||(!(strcmp("SKILL24",(char*)script1)))) pc_s->baseskill[LOCKPICKING] = getstatskillvalue((char*)script2);					if ((!(strcmp("MAGERY",(char*)script1)))||(!(strcmp("SKILL25",(char*)script1)))) pc_s->baseskill[MAGERY] = getstatskillvalue((char*)script2);					if ((!(strcmp("MAGICRESISTANCE",(char*)script1)))||(!(strcmp("RESIST",(char*)script1)))||(!(strcmp("SKILL26",(char*)script1)))) pc_s->baseskill[MAGICRESISTANCE] = getstatskillvalue((char*)script2);					if ((!(strcmp("TACTICS",(char*)script1)))||(!(strcmp("SKILL27",(char*)script1)))) pc_s->baseskill[TACTICS] = getstatskillvalue((char*)script2);					if ((!(strcmp("SNOOPING",(char*)script1)))||(!(strcmp("SKILL28",(char*)script1)))) pc_s->baseskill[SNOOPING] = getstatskillvalue((char*)script2);					if ((!(strcmp("MUSICIANSHIP",(char*)script1)))||(!(strcmp("SKILL29",(char*)script1)))) pc_s->baseskill[MUSICIANSHIP] = getstatskillvalue((char*)script2);					if ((!(strcmp("POISONING",(char*)script1)))||(!(strcmp("SKILL30",(char*)script1)))) pc_s->baseskill[POISONING] = getstatskillvalue((char*)script2);					if ((!(strcmp("ARCHERY",(char*)script1)))||(!(strcmp("SKILL31",(char*)script1)))) pc_s->baseskill[ARCHERY] = getstatskillvalue((char*)script2);					if ((!(strcmp("SPIRITSPEAK",(char*)script1)))||(!(strcmp("SKILL32",(char*)script1)))) pc_s->baseskill[SPIRITSPEAK] = getstatskillvalue((char*)script2);					if ((!(strcmp("STEALING",(char*)script1)))||(!(strcmp("SKILL33",(char*)script1)))) pc_s->baseskill[STEALING] = getstatskillvalue((char*)script2);					if ((!(strcmp("TAILORING",(char*)script1)))||(!(strcmp("SKILL34",(char*)script1)))) pc_s->baseskill[TAILORING] = getstatskillvalue((char*)script2);					if ((!(strcmp("TAMING",(char*)script1)))||(!(strcmp("SKILL35",(char*)script1)))) pc_s->baseskill[TAMING] = getstatskillvalue((char*)script2);					if ((!(strcmp("TASTEID",(char*)script1)))||(!(strcmp("SKILL36",(char*)script1)))) pc_s->baseskill[TASTEID] = getstatskillvalue((char*)script2);					if ((!(strcmp("TINKERING",(char*)script1)))||(!(strcmp("SKILL37",(char*)script1)))) pc_s->baseskill[TINKERING] = getstatskillvalue((char*)script2);					if ((!(strcmp("TRACKING",(char*)script1)))||(!(strcmp("SKILL38",(char*)script1)))) pc_s->baseskill[TRACKING] = getstatskillvalue((char*)script2);					if ((!(strcmp("VETERINARY",(char*)script1)))||(!(strcmp("SKILL39",(char*)script1)))) pc_s->baseskill[VETERINARY] = getstatskillvalue((char*)script2);					if ((!(strcmp("SWORDSMANSHIP",(char*)script1)))||(!(strcmp("SKILL40",(char*)script1)))) pc_s->baseskill[SWORDSMANSHIP] = getstatskillvalue((char*)script2);					if ((!(strcmp("MACEFIGHTING",(char*)script1)))||(!(strcmp("SKILL41",(char*)script1)))) pc_s->baseskill[MACEFIGHTING] = getstatskillvalue((char*)script2);					if ((!(strcmp("FENCING",(char*)script1)))||(!(strcmp("SKILL42",(char*)script1)))) pc_s->baseskill[FENCING] = getstatskillvalue((char*)script2);					if ((!(strcmp("WRESTLING",(char*)script1)))||(!(strcmp("SKILL43",(char*)script1)))) pc_s->baseskill[WRESTLING] = getstatskillvalue((char*)script2);					if ((!(strcmp("LUMBERJACKING",(char*)script1)))||(!(strcmp("SKILL44",(char*)script1)))) pc_s->baseskill[LUMBERJACKING] = getstatskillvalue((char*)script2);					if ((!(strcmp("MINING",(char*)script1)))||(!(strcmp("SKILL45",(char*)script1)))) pc_s->baseskill[MINING] = getstatskillvalue((char*)script2);					// lb, new skills					if ((!(strcmp("MEDITATION",(char*)script1)))||(!(strcmp("SKILL46",(char*)script1)))) pc_s->baseskill[MEDITATION] = getstatskillvalue((char*)script2);					if ((!(strcmp("STEALTH",(char*)script1)))||(!(strcmp("SKILL47",(char*)script1)))) pc_s->baseskill[STEALTH] = getstatskillvalue((char*)script2);					if ((!(strcmp("REMOVETRAPS",(char*)script1)))||(!(strcmp("SKILL48",(char*)script1)))) pc_s->baseskill[REMOVETRAPS] = getstatskillvalue((char*)script2);					if ((!(strcmp("DYEHAIR",(char*)script1))))					{						int serial,serhash,ci;						serial=pc_s->serial;						serhash=serial%HASHMAX;						for (ci=0;ci<contsp[serhash].max;ci++)						{							i=contsp[serhash].pointer[ci];							if (i!=-1)								if ((items[i].layer==0x0B) && (items[i].contserial==serial))								{									hairobject=i;									break;								}						}						if (hairobject>-1)						{							x=hstr2num(script2);							items[hairobject].color1=x>>8;							items[hairobject].color2=x%256;							RefreshItem(hairobject);//AntiChrist							teleport(s);						}					}					if ((!(strcmp("DYEBEARD",(char*)script1))))					{						int serial,serhash,ci;						serial=pc_s->serial;						serhash=serial%HASHMAX;						for (ci=0;ci<contsp[serhash].max;ci++)						{							i=contsp[serhash].pointer[ci];							if (i!=-1)								if ((items[i].layer==0x10) && (items[i].contserial==serial))								{									beardobject=i;									break;								}						}						if (beardobject>-1)						{							x=hstr2num(script2);							items[beardobject].color1=x>>8;							items[beardobject].color2=x%256;							RefreshItem(beardobject);//AntiChrist							teleport(s);						}					}					if (!(strcmp("KILLHAIR",(char*)script1)))					{						int serial,serhash,ci;						serial=pc_s->serial;						serhash=serial%HASHMAX;						for (ci=0;ci<contsp[serhash].max;ci++)						{							i=contsp[serhash].pointer[ci];							if (i!=-1)								if ((items[i].layer==0x0B) && (items[i].contserial==serial))								{									Items->DeleItem(i);									break;								}						}					}					if (!(strcmp("KILLBEARD",(char*)script1)))					{						int serial,serhash,ci;						serial=pc_s->serial;						serhash=serial%HASHMAX;						for (ci=0;ci<contsp[serhash].max;ci++)						{							i=contsp[serhash].pointer[ci];							if (i!=-1)								if ((items[i].layer==0x10) && (items[i].contserial==serial))								{									Items->DeleItem(i);									break;								}						}					}					if (!(strcmp("KILLPACK",(char*)script1)))					{						int serial,serhash,ci;						serial=pc_s->serial;						serhash=serial%HASHMAX;						for (ci=0;ci<contsp[serhash].max;ci++)						{							i=contsp[serhash].pointer[ci];							if (i!=-1)								if ((items[i].layer==0x15) && (items[i].contserial==serial))								{									Items->DeleItem(i);									break;								}						}					}					if (!(strcmp("ITEM",(char*)script1)))					{						x=str2num(script2);						pos=ftell(scpfile);						closescript();	/* lord binary */						retitem=Targ->AddMenuTarget(-1, 0, x);						openscript("advance.scp");						fseek(scpfile, pos, SEEK_SET);						strcpy((char*)script1, "DUMMY");						packnum=packitem(s);						if (retitem>-1)						{							items[retitem].pos.x=50+(rand()%80);							items[retitem].pos.y=50+(rand()%80);							items[retitem].pos.z=9;							if(items[retitem].layer==0x0b || items[retitem].layer==0x10)							{								setserial(retitem,s,4);							}							else							{								if(packnum>-1) setserial(retitem,packnum,1);							}							RefreshItem(retitem);//AntiChrist							teleport(s);						}					}					if (!(strcmp((char*)script1,"SKIN")))					{						pc_s->skin = pc_s->xskin = static_cast<UI16>(hstr2num(script2));						teleport(s);					}					if (!(strcmp("POLY",(char*)script1)))					{						x=hstr2num(script2);						pc_s->id1=x>>8;						pc_s->xid1=x>>8;						pc_s->id2=x%256;						pc_s->xid2=x%256;						teleport(s);					}					if (!(strcmp("ADVOBJ",(char*)script1)))					{						x=str2num(script2);						pc_s->advobj=x;					}				}			}			while ((script1[0]!='}') && (++loopexit < MAXLOOPS) );			closescript();	}	else sysmessage(calcSocketFromChar(s),"You have already used an advancement object with this character.");}