Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 10-13-2008, 04:40 PM
Rocker8956
Hill Giant
 
Join Date: Sep 2007
Posts: 117
Default Changes for setinstflag and setinstflagmanually

Sorry for all the changes to the quest code but I want to standardize the ones I wrote with the ones that are already in the code. Also, the below changes will allow me to rewrite some code later (when I have time) to reduce database access without changing the Perl syntax (again).

Below are the changes to the two quest commands
setinstflag and setinstflagmanually

The new quest syntax is
setinstflagmanually(orginalZoneID, instFlag, type)
or
setinstflag(orginalZoneID, type)

Zone\questmgr.h
Change
Code:
 	
void setinstflag(int charID, int orgZoneID, int type);
void setinstflagmanually(int charID, int orgZoneID, int instFlag, int type);
To
Code:
   	 
void setinstflag(int orgZoneID, int type);
void setinstflagmanually(int orgZoneID, int instFlag, int type);
zone\questmgr.cpp
Replace QuestManager::setinstflag with
Code:
void QuestManager::setinstflag(int orgZoneID, int type)
{
	int instFlag = database.getCurInstFlagNum();

	if (type == 0)
	{
		database.setCharInstFlag(initiator->CharacterID(), orgZoneID, instFlag);
		database.incrCurInstFlagNum(instFlag); // Increment the curInstFlagNum
	}
	else if(type == 1)
	{
		database.setGroupInstFlagNum(initiator->CharacterID(), orgZoneID, instFlag);
		database.incrCurInstFlagNum(instFlag); // Increment the curInstFlagNum
	}
	else if(type == 2)
	{
		database.setRaidInstFlagNum(initiator->CharacterID(), orgZoneID, instFlag);
		database.incrCurInstFlagNum(instFlag); // Increment the curInstFlagNum
	}
	else if(type == 3)
	{
		database.setCharInstFlag(initiator->CharacterID(), orgZoneID, instFlag);
		database.setGroupInstFlagNum(initiator->CharacterID(), orgZoneID, instFlag);
		database.setRaidInstFlagNum(initiator->CharacterID(), orgZoneID, instFlag);
		database.incrCurInstFlagNum(instFlag); // Increment the curInstFlagNum
	}
}
zone\questmgr.cpp
Replace setinstflagmanually function with

Code:
void QuestManager::setinstflagmanually(int orgZoneID, int instFlag, int type)
{
	if (type == 0)
	{
		database.setCharInstFlag(initiator->CharacterID(), orgZoneID, instFlag);
	}
	else if(type == 1)
	{
		database.setGroupInstFlagNum(initiator->CharacterID(), orgZoneID, instFlag);
	}
	else if(type == 2)
	{
		database.setRaidInstFlagNum(initiator->CharacterID(), orgZoneID, instFlag);
	}
	else if(type == 3)
	{
		database.setCharInstFlag(initiator->CharacterID(), orgZoneID, instFlag);
		database.setGroupInstFlagNum(initiator->CharacterID(), orgZoneID, instFlag);
		database.setRaidInstFlagNum(initiator->CharacterID(), orgZoneID, instFlag);
	}
}
Zone\perlparser.cpp
Replace XS(XS__setinstflag) function with

Code:
XS(XS__setinstflag);
XS(XS__setinstflag)
{
	dXSARGS;
	if (items != 3)
		Perl_croak(aTHX_ "Usage: setinstflag(orginalZoneID, type)");

	int		orgZoneID = (int)SvIV(ST(0));
	int		type = (int)SvIV(ST(1));

	quest_manager.setinstflag(orgZoneID, type);

	XSRETURN_EMPTY;
}
Zone\perlparser.cpp
Replace XS(XS__setinstflagmanually) function with

Code:
XS(XS__setinstflagmanually);
XS(XS__setinstflagmanually)
{
	dXSARGS;
	if (items != 3)
		Perl_croak(aTHX_ "Usage: setinstflagmanually(orginalZoneID, instFlag, type)");

	int		orgZoneID = (int)SvIV(ST(0));
	int		instFlag = (int)SvIV(ST(1));
	int		type = (int)SvIV(ST(2));

	quest_manager.setinstflagmanually(orgZoneID, instFlag, type);

	XSRETURN_EMPTY;
}
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 11:42 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3