-These are the functions I added. I called the funcion newbieitems from -the function creatchar. Alot may seem redundant but this is the only -way i could get it to work without it locking up(loops didn't work) -There were some things i didn't notice while i was cutting and pasting from .004 to .005 -I made those changes here like MORE, MORE2, etc... ---- in uox3.h extern char script4[512]; // added to use for newbie items -added newbie_script to extern Script int secndbstskll(int m, int bstskll); // gives second best skill int thrdbstskll(int n, int scnbst); // gives third void addfromitemlist(int itemlist); // this is what I use to grab items from itemlists, couldnt get other // to work void newbieitems(); // main function void read3 (); // like read1 but use script3 & script4 void read4 (); // same a above ----in globals.cpp char script4[512]; //added for newbie items newbie_script ("newbie.scp") was added toe the script caching part. ----in uox3.cpp void read3 () // used for newbie items { readscript(); sprintf(script3, "%s", temp); } void read4 () // used for newbie items { int i; readscript(); i=0; script3[0]=0; script4[0]=0; while(temp[i]!=0 && temp[i]!=' ') { i++; } strncpy(script3, temp, i); script3[i]=0; if (script1[0]!='}' && temp[i]!=0) strcpy(script4, temp+i+1); return; } int secndbstskll(int m, int bstskll) // Which skill is the second highest { int i, a=0, b=0; for (i=0;ib)&&(chars[m].baseskill[i]b)&&(chars[n].baseskill[i]0) { i=rand()%i; openscript("items.scp"); sprintf(sect, "ITEMLIST %i", itemlist); if(!items_script.find(sect)) { closescript(); return; } do { read1(); if (script1[0]!='}') { j++; if(j==i) { itemnum=str2num(script1); } } } while (script1[0]!='}'); closescript(); } openscript("items.scp"); sprintf(sect, "ITEM %i", itemnum); if (!items_script.find(sect)) { closescript(); return; } items[itemcount].ser1=itemcount2/16777216; items[itemcount].ser2=itemcount2/65536; items[itemcount].ser3=itemcount2/256; items[itemcount].ser4=itemcount2; items[itemcount].cont1=items[packitem(charcount)].ser1; items[itemcount].cont2=items[packitem(charcount)].ser2; items[itemcount].cont3=items[packitem(charcount)].ser3; items[itemcount].cont4=items[packitem(charcount)].ser4; items[itemcount].layer=0x01; items[itemcount].x=50+(rand()%80); items[itemcount].y=50+(rand()%80); items[itemcount].z=9; items[itemcount].priv=items[itemcount].priv|0x02; do { read2(); if (script1[0]!='}') { if (!(strcmp("NAME",script1))) { sprintf(items[itemcount].name, "%s", script2); } if (!(strcmp("ITEMLIST", script1))) { storeval=str2num(script2); pos=ftell(scpfile); closescript(); addfromitemlist(storeval); openscript("items.scp"); fseek(scpfile, pos, SEEK_SET); sprintf(script1, "DUMMY"); } if (!(strcmp("ID",script1))) { tmp=hstr2num(script2); items[itemcount].id1=tmp/256; items[itemcount].id2=tmp%256; } if (!(strcmp("AMOUNT",script1))) { items[itemcount].amount=str2num(script2); } if (!(strcmp("COLOR",script1))) { tmp=hstr2num(script2); items[itemcount].color1=tmp/256; items[itemcount].color2=tmp%256; } if (!(strcmp("TYPE",script1))) { items[itemcount].type=str2num(script2); } if ((!(strcmp("DAMAGE",script1)))||(!(strcmp("ATT",script1)))) { items[itemcount].att = getstatskillvalue(script2); } if (!(strcmp("DEF",script1))) { items[itemcount].def=str2num(script2); } if (!(strcmp("HP", script1))) { items[itemcount].hp=str2num(script2); } if (!(strcmp("STR", script1))) { items[itemcount].st=str2num(script2); } if (!(strcmp("LODAMAGE", script1))) { items[itemcount].lodamage=str2num(script2); } if (!(strcmp("HIDAMAGE", script1))) { items[itemcount].hidamage=str2num(script2); } if (!(strcmp("MOVABLE",script1))) { items[itemcount].magic=str2num(script2); } if (!(strcmp("VISIBLE",script1))) { items[itemcount].visible=str2num(script2); } if (!(strcmp("DYE",script1))) { items[itemcount].dye=str2num(script2); } if (!(strcmp("MORE", script1))) { tmp=str2num(script2); items[itemcount].more1=tmp/16777216; items[itemcount].more2=tmp/65536; items[itemcount].more3=tmp/256; items[itemcount].more4=tmp%256; } if (!(strcmp("MORE2", script1))) { tmp=str2num(script2); items[itemcount].moreb1=tmp/16777216; items[itemcount].moreb2=tmp/65536; items[itemcount].moreb3=tmp/256; items[itemcount].moreb4=tmp%256; } if (!(strcmp("MOREX",script1))) { tmp=str2num(script2); items[itemcount].morex=tmp; } if (!(strcmp("MOREY",script1))) { tmp=str2num(script2); items[itemcount].morey=tmp; } if (!(strcmp("MOREZ",script1))) { tmp=str2num(script2); items[itemcount].morez=tmp; } if (!(strcmp("DIR",script1))) { items[itemcount].dir=str2num(script2); } if (!(strcmp("DECAY",script1))) { items[itemcount].priv=items[itemcount].priv|0x01; } if (!(strcmp("DISPELLABLE",script1))) { items[itemcount].priv=items[itemcount].priv|0x04; } if (!(strcmp("VALUE",script1))) { items[itemcount].value=str2num(script2); } if (!(strcmp("RESTOCK",script1))) { items[itemcount].restock=str2num(script2); } if (!(strcmp("SPD", script1))) { items[itemcount].spd=str2num(script2); } } } while (script1[0]!='}'); closescript(); script1[0]=0; }