Thread: Zone instancing
View Single Post
  #7  
Old 09-30-2008, 08:26 PM
Rocker8956
Hill Giant
 
Join Date: Sep 2007
Posts: 117
Default

Yep more changes.

This is a fix for setinstflagmanually to allow manual flagging of raids, groups, and individuals. This also offers a way to delete instance flags by sending a orgZoneID of -1 and a instFlag of -1 to the function.

Please note if you have already setup quests to use the setinstflagmanually you will need to add a fourth parameter to it.

Format for quests - setinstflagmanually(charID, orginalZoneID, instFlag, type)

types
0 = individual
1 = group
2 = raid
3 = individual, group, and raid

Zone\perlparser.cpp
Find XS(XS__setinstflagmanually) replace with below code
(line is 1774 on mine but..)
Code:
XS(XS__setinstflagmanually);
XS(XS__setinstflagmanually)
{
	dXSARGS;
	if (items != 4)
		Perl_croak(aTHX_ "Usage: setinstflagmanually(charID, orginalZoneID, instFlag, type)");

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

	quest_manager.setinstflagmanually(charID, orgZoneID, instFlag, type);

	XSRETURN_EMPTY;
}
zone\questmgr.cpp
Find void QuestManager::setinstflagmanually and replace with below code
(line 1420 on mine)
Code:
void QuestManager::setinstflagmanually(int charID, int orgZoneID, int instFlag, int type)
{
	if (type == 0)
	{
		database.setCharInstFlag(charID, orgZoneID, instFlag);
	}
	else if(type == 1)
	{
		database.setGroupInstFlagNum(charID, orgZoneID, instFlag);
	}
	else if(type == 2)
	{
		database.setRaidInstFlagNum(charID, orgZoneID, instFlag);
	}
	else if(type == 3)
	{
		database.setCharInstFlag(charID, orgZoneID, instFlag);
		database.setGroupInstFlagNum(charID, orgZoneID, instFlag);
		database.setRaidInstFlagNum(charID, orgZoneID, instFlag);
	}
}
zone\questmgr.h
Find void setinstflagmanually and replace with below code
(line 151 on mine)
Code:
void setinstflagmanually(int charID, int orgZoneID, int instFlag, int type);