Thread: spell book help
View Single Post
  #5  
Old 11-14-2008, 06:09 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

This is untested, but I think this should work, or should be very close to working if it was added to the source:

questmgr.cpp
Code:
void QuestManager::unscribespell(int spell_id, bool update_client=true) {
	int i;

	for(i = 0; i < MAX_PP_SPELLBOOK; i++)
	{
		if(m_pp.spell_book[i] == spell_id)
			UnscribeSpell(i, update_client);
	}
}
questmgr.h
Code:
	void unscribespell(int spell_id, bool update_client=true);
perlparser.cpp
Code:
XS(XS__unscribespell);
XS(XS__unscribespell)
{
	dXSARGS;
	if (items != 0)
		Perl_croak(aTHX_ "Usage: unscribespell(spell_id)");

	int	spell_id;

	quest_manager.unscribespell(spell_id);

	XSRETURN_EMPTY;
}
Code:
		newXS(strcpy(buf, "unscribespell"), XS__unscribespells, file);
Then, you should be able to just do quest::unscribespell(spell_id); to do it. I think you could even do it without giving the message that they are being removed by using quest::unscribespell(spell_id, false); if I am reading the code correctly.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 11-15-2008 at 01:46 AM..
Reply With Quote