View Single Post
  #1  
Old 10-13-2008, 03:00 PM
Rocker8956
Hill Giant
 
Join Date: Sep 2007
Posts: 117
Default Quest command: Get Instance Flag

Below is a quest function for getting the instance flag of a character.

Zone\perlparser.cpp
Above XSRETURN_YES;
Insert
Code:
newXS(strcpy(buf, "getinstflag"), XS__getinstflag, file);
zone\perlparser.cpp
Above /*This is the callback perl will look for to setup the
Insert
Code:
XS(XS__getinstflag);
XS(XS__getinstflag)
{
    dXSARGS;
    if (items != 0)
        Perl_croak(aTHX_ "Usage: getinstflag()");

    int		RETVAL;
    dXSTARG;

	RETVAL = quest_manager.getinstflag();
	XSprePUSH; PUSHu((IV)RETVAL);

	XSRETURN(1);
}
Zone\questmgr.h
Near line 179 Insert
Code:
int getinstflag();
zone\questmgr.cpp
At end Insert
Code:
int QuestManager::getinstflag()
{
	return (database.GetCharInstFlagNum(initiator->CharacterID()));
}