if(!Magic->CheckReagents(pc_currchar, spells[num].reagents)
if(!Magic->CheckReagents(pc_currchar, num)
void TellScroll( char *menu_name, int s, long snum ){	P_CHAR pc_currchar = currchar[s];	unsigned cir,spl;	int part;	if(snum<=0) return;				// bad spell selction	P_ITEM pi = FindItemBySerial(pc_currchar->lastTarget);	cir=(int)((snum-800)/10);		// snum holds the circle/spell as used in inscribe.gmp	spl=(((snum-800)-(cir*10))+1);	// i.e. 800 + 1-based circle*10 + zero-based spell									// snum is also equals the item # in items.scp of the scrool to be created !	P_ITEM pBackpack = Packitem(pc_currchar);	if (pBackpack == NULL) return;		AllItemsIterator iterItems;	for (iterItems.Begin(); !iterItems.atEnd(); iterItems++)		// find the spellbook	{		P_ITEM pb = iterItems.GetData();		if (pb->type==9 && (pb->contserial==pBackpack->serial ||			(pb->layer==1 && pc_currchar->Wears(pb))))		{			if (!Magic->CheckBook( cir, spl-1, pb))			{				sysmessage(s,"You don't have this spell in your spell book!");				return;			}		}	}		int num = (8*(cir-1)) + spl;	// circle & spell combined to a zero-based index		if (spells[num].action)		impaction(s, spells[num].action);	npctalkall(pc_currchar, spells[num].mantra,0);		if(!Magic->CheckReagents(pc_currchar, spells[num].reagents)		|| !Magic->CheckMana(pc_currchar, num))	{		Magic->SpellFail(s);		return;	}	Magic->SubtractMana(pc_currchar, spells[num].mana);		if (pi->id()==0x0E34)  //is it a scroll?	{		itemmake[s].Mat1id=0x0E34; 		itemmake[s].needs=1; 		itemmake[s].has = getamount(pc_currchar, 0x0E34); 		itemmake[s].minskill=(cir-1)*100;	//set range values based on scroll level		itemmake[s].maxskill=(cir+2)*100;		Magic->DelReagents(pc_currchar, spells[num].reagents);				Skills->MakeMenuTarget(s,snum,INSCRIPTION); //put it in your pack	}	else if ((pi->att>0)||(pi->def>0)||(pi->hidamage)) //or is it an item?	{		part=0;		switch(cir)		{		case 1:	part = CheckThreeSkills(s,  11, 401);break;		case 2:	part = CheckThreeSkills(s,  61, 501);break;		case 3:	part = CheckThreeSkills(s, 161, 601);break;		case 4:	part = CheckThreeSkills(s, 261, 701);break;		case 5:	part = CheckThreeSkills(s, 361, 801);break;		case 6:	part = CheckThreeSkills(s, 461, 901);break;		case 7:	part = CheckThreeSkills(s, 661,1101);break;		case 8:	part = CheckThreeSkills(s, 761,1201);break;		default:			LogError("switch reached default");			return;		}				if (part < 3)		// failure !		{			switch(part)			{			case 0:				sysmessage(s,"Your hand jerks and you punch a hole in the item");				pi->hp -= 3;				break;			case 1:				sysmessage(s,"Your hand slips and you dent the item");				pi->hp -= 2;				break;			case 2:				sysmessage(s,"Your hand cramps and you scratch the item");				pi->hp--;				break;			}			if(pi->hp<1)				pi->hp=1;		}		else				// success !		{			if (!( pi->morez == 0 ||(pi->morex == cir && pi->morey == spl))  )				sysmessage(s,"This item already has a spell!");			else if ( pi->morez >= (9 - pi->morex)*2)				sysmessage(s,"Item at max charges!");			else			{				Skills->EngraveAction(s, pi, cir, spl);	// check mana & set name				if (!(pi->morex == cir && pi->morey == spl))	// not THIS spell				{					pi->type2=pi->type; //kept type of item for returning to this type when item remain no charge 					pi->type=15;  //make it magical					pi->morex=cir;//spell circle					pi->morey=spl;//spell number					sysmessage(s,"Item successfully Engraved");				}				else					sysmessage(s,"You added one more charge to the Item");				pi->morez++;  // charges				sysmessage(s,"Item successfully Engraved");			}		}	}//else if}