int n, first, second, third, storeval, itemaddperskill, loopexit = 0;
int first, second, third, storeval, itemaddperskill, loopexit = 0;
void newbieitems(CHARACTER c){	int n, first, second, third, storeval, itemaddperskill, loopexit = 0;	char sect[512];	char whichsect[15];	long int pos;	int s;	for (s = 0; s < now; s++)	{		if (c == currchar[s])			break;	}	P_CHAR pc = MAKE_CHARREF_LR(c);	first = bestskill(c);	second = nextbestskill(c, first);	third = nextbestskill(c, second);	if (pc->baseskill[third] < 190)		third = 46;	for (itemaddperskill = 1; itemaddperskill <= 4; itemaddperskill++)	{		switch (itemaddperskill)		{			case 1: sprintf(whichsect, "BESTSKILL %i", first);	break;			case 2: sprintf(whichsect, "BESTSKILL %i", second);	break;			case 3: sprintf(whichsect, "BESTSKILL %i", third);	break;			case 4: strcpy(whichsect, "DEFAULT");				break;			default:				clConsole.send("ERROR: Fallout of switch statement without default. newbie.cpp, newbieitems()/n"); // Morrolan		}		openscript("newbie.scp");		sprintf(sect, whichsect);		if (!i_scripts[newbie_script]->find(sect)) 		{			closescript();			return;		}		do		{			read2();			if (script1[0] != '}')			{ 				if (!(strcmp("PACKITEM", (char*)script1)))				{					storeval = str2num(script2);					pos = ftell(scpfile);					closescript();										P_ITEM pi_n = Items->SpawnItemBackpack2(s, storeval, 0); // Tauriel 11-24-98					if (pi_n != NULL)						pi_n->priv |= 0x02; // Mark as a newbie item					strcpy((char*)script1, "DUMMY");					openscript("newbie.scp");					fseek(scpfile, pos, SEEK_SET);				}				else if (!strcmp("BANKITEM", (char*)script1))				{					storeval = str2num(script2);					pos = ftell(scpfile);					closescript();									P_ITEM pi = Items->SpawnItemBank(c, storeval); // Tauriel 11-24-98					if (pi != NULL)						pi->priv |= 0x02; // Mark as a newbie item					strcpy((char*)script1, "DUMMY");					openscript("newbie.scp");					fseek(scpfile, pos, SEEK_SET);				}				else if (!strcmp("GOLD", (char*)script1))				{					goldamount = str2num(script2);					pos = ftell(scpfile);					closescript();				    P_ITEM pi_n =Items->SpawnItem(s,DEREF_P_CHAR(pc),goldamount,"#",1,0x0E,0xED,0,0,1,0);	                if(pi_n==NULL) return;					pi_n->priv |= 0x02; // Mark as a newbie item					strcpy((char*)script1, "DUMMY");					openscript("newbie.scp");					fseek(scpfile, pos, SEEK_SET);				}			}  		}			while ((script1[0] != '}') &&(++loopexit < MAXLOOPS));	    closescript();	}}