示例#1
0
void CKanturu::UserMonsterCountCheck()
{
	return;

	int iUserCount_Live = 0;
	int iUserCount_Die = 0;
	for ( int iAllUserCount=OBJ_STARTUSERINDEX;iAllUserCount<OBJMAX;iAllUserCount++)
	{
		if ( gObj[iAllUserCount].MapNumber == MAP_INDEX_KANTURU_BOSS &&
			 gObj[iAllUserCount].Type == OBJ_USER &&
			 (gObj[iAllUserCount].Authority&2) != 2 )
		{
			if ( gObj[iAllUserCount].Live == TRUE )
			{
				iUserCount_Live++;
			}
			else
			{
				iUserCount_Die++;
			}
		}
	}

	KANTURU_TEST_LOG.Output("[ KANTURU ][ Debug ] 2. All User Check:%d/(Die:%d)", iUserCount_Live, iUserCount_Die);
	KANTURU_TEST_LOG.Output("[ KANTURU ][ Debug ] 3. MonsterMng Count:%d", g_KanturuMonsterMng.GetAliveMonsterCount());

	int iMonsterCount=0;

	for ( int iAllMonsterCount=0;iAllMonsterCount<OBJ_STARTUSERINDEX;iAllMonsterCount++)
	{
		if ( gObj[iAllMonsterCount].MapNumber == MAP_INDEX_KANTURU_BOSS &&
			 gObj[iAllMonsterCount].Connected == PLAYER_PLAYING &&
			 gObj[iAllMonsterCount].Type == OBJ_MONSTER )
		{
			if ( gObj[iAllMonsterCount].Class != 105 &&
				 gObj[iAllMonsterCount].Class != 106 &&
				 gObj[iAllMonsterCount].Class != 364 )
			{
				iMonsterCount++;

				KANTURU_TEST_LOG.Output("[ KANTURU ][ Debug ] 4. Monster Info %s(%d/ObjIndex:%d) [%d]%d-%d HP:%0.1f IsAlive:%d Connected:%d State:%d ActState:Attack(%d)/Move(%d) DieRegen:%d",
					gObj[iAllMonsterCount].Name, gObj[iAllMonsterCount].Class,
					gObj[iAllMonsterCount].m_Index, gObj[iAllMonsterCount].MapNumber,
					gObj[iAllMonsterCount].X, gObj[iAllMonsterCount].Y,
					gObj[iAllMonsterCount].Life, gObj[iAllMonsterCount].Live,
					gObj[iAllMonsterCount].Connected, gObj[iAllMonsterCount].m_State,
					gObj[iAllMonsterCount].m_ActState.Attack, gObj[iAllMonsterCount].m_ActState.Move,
					gObj[iAllMonsterCount].DieRegen);
			}
		}
	}
}
示例#2
0
void Achievements::GD_UpdateEventDataCC(LPOBJ lpUser, int CC_UKill, int CC_MKill, int CC_TExp, int CC_RExp)
{
	if( !gObjIsConnected(lpUser->m_Index) )
	{
		return;
	}

	AchievGDUpdateEvent lpData = { 0 };
	lpData.Head.set((LPBYTE)&lpData, 0xA6, 0x01, sizeof(AchievGDUpdateEvent));
	strcpy(lpData.Name, lpUser->Name);

	lpData.EventType	= AchievEventType::ChaosCastle;
	lpData.CC_UKill		= CC_UKill;
	lpData.CC_MKill		= CC_MKill;
	lpData.CC_TExp		= CC_TExp;
	lpData.CC_RExp		= CC_RExp;
#if( __4GAMERS__ == 1 )
	g_AchievLog.Output("[%s] [%s] Updated data for ChaosCastle (UKill: %d, MKill: %d, TExp: %d, RExp: %d)",
		lpUser->AccountID, lpUser->Name, CC_UKill, CC_MKill, CC_TExp, CC_RExp);
#endif
	LogAddTD("[%s] [%s] [Achievements] Updated data for ChaosCastle (UKill: %d, MKill: %d, TExp: %d, RExp: %d)",
		lpUser->AccountID, lpUser->Name, CC_UKill, CC_MKill, CC_TExp, CC_RExp);

	cDBSMng.Send((PCHAR)&lpData, sizeof(lpData));
}
示例#3
0
void OfflineTrade::Start(int UserIndex)
#endif
{
	LPOBJ lpUser = &gObj[UserIndex];
	// ----
	g_OfflineTradeLog.Output("[%s] [%s] Send request to start offline trade", 
		lpUser->AccountID, lpUser->Name);
	// ----
	if( !this->CheckReq(UserIndex) )
	{
		return;
	}
#ifdef __ALIEN__
	switch(Type)
	{
		case 0: strcpy(lpUser->m_szPShopText, ZEN_SHOP);		break;
		case 1: strcpy(lpUser->m_szPShopText, WCOIN_SHOP);	break;
		case 2: strcpy(lpUser->m_szPShopText, SOUL_SHOP);	break;
		default:return;
	}
#endif
	// ----
	lpUser->Money					-= this->m_Cost[0];
	lpUser->GameShop.WCoinC			-= this->m_Cost[1];
	lpUser->GameShop.WCoinP			-= this->m_Cost[2];
	lpUser->GameShop.GoblinPoint	-= this->m_Cost[3];
	// ----
#if defined __BEREZNUK__ || __MIX__ || __REEDLAN__ || __MUANGEL__ || __WHITE__ || __MEGAMU__ || __VIRNET__
	g_ConnectEx.SendClose(UserIndex);
#endif
	// ----
	gGameShop.GDSavePoint(UserIndex);
	GCMoneySend(UserIndex, lpUser->Money);
	lpUser->IsOffTrade = true;
    CloseClientEx(UserIndex);
	// ----
#ifdef __ALIEN__
	g_OfflineTradeLog.Output("[%s] [%s] Has been disconnected, offline shop created (Type: %d)", 
		lpUser->AccountID, lpUser->Name, Type);
#else
	g_OfflineTradeLog.Output("[%s] [%s] Has been disconnected, offline shop created", 
		lpUser->AccountID, lpUser->Name);
#endif
}
示例#4
0
void cLuckyPenny::Exchange(int aIndex,BYTE Count)
{
	if(OBJMAX_RANGE(aIndex) == 0)
	{
		return;
	}

	if(this->Enabled == TRUE)
	{
		if ( gObj[aIndex].m_IfState.type != 97 )
		{
			ANTI_HACK_LOG.Output("[ANTI-HACK][Coins][Exchange] User in map(%d) [%s][%s] State(u:%d,t:%d,s:%d)",
				gObj[aIndex].MapNumber, gObj[aIndex].AccountID, gObj[aIndex].Name,
				gObj[aIndex].m_IfState.use,gObj[aIndex].m_IfState.type,gObj[aIndex].m_IfState.state);
			return;
		}

		if(Count != 10 && Count != 20 && Count != 30)
			return;

		int pos = gObjCheckItemPosByDur(aIndex,ITEMGET(14,100),Count);

		if(pos >= 0)
		{
			if ( ReadConfig.MAIN_INVENTORY_RANGE(aIndex,pos,false) != FALSE )
			{
				if(this->GetReward(aIndex,Count) == true)
				{
					gObj[aIndex].pInventory[pos].m_Durability -= Count;
				
					if(gObj[aIndex].pInventory[pos].m_Durability <= 0)
					{
						gObjInventoryItemSet(aIndex, pos, -1);
						gObj[aIndex].pInventory[pos].Clear();
						GCInventoryItemDeleteSend(aIndex, pos, 1);
					}else
					{
						GCItemDurSend(aIndex, pos, gObj[aIndex].pInventory[pos].m_Durability, 0);
					}

					LogAddTD("[LuckyPenny] [%s][%s][%d] LuckyPenny Item Buy Exchange Success",
						gObj[aIndex].AccountID, gObj[aIndex].Name,Count);
				}else
				{
					LogAddTD("[LuckyPenny] [%s][%s] LuckyPenny Item Buy Exchange Failed : No Room to Get Item",
						gObj[aIndex].AccountID, gObj[aIndex].Name);
					GCServerMsgStringSend("No Room in Inventory to Get Item!!",aIndex, 1);
				}
			}
		}else
		{
			char LackPacket[5] = {0xC1,0x05,0xBF,0x0C,0x00};
			DataSend(aIndex ,(UCHAR*)LackPacket, sizeof(LackPacket));
		}
	}
}
void RepackVendor::ReadConfig()
{
	CDirPath path;
	path.SetFirstPath(FOLDER_ROOT);
	LPSTR pStr	=	path.GetNewPath(FILE_REPACK_CONF);

	//Load repack version strings
	GetPrivateProfileString("Version", "Template", "1.0.0", this->config.temp_ver, sizeof(this->config.temp_ver), pStr);
	GetPrivateProfileString("Version", "Binaries", "1.0.0", this->config.bin_ver, sizeof(this->config.bin_ver), pStr);
	GetPrivateProfileString("Version", "Source", "1.0.0", this->config.src_ver, sizeof(this->config.src_ver), pStr);

	//Load repack vendor info
	GetPrivateProfileString("Repository", "URL", "github.com/denkers", this->config.repo_url, sizeof(this->config.repo_url), pStr);
	GetPrivateProfileString("Repository", "Author", "denker", this->config.author, sizeof(this->config.author), pStr);

	CLogToFile logger = CLogToFile(LOG_NAME_DEBUG, LOG_PATH_DEBUG, true);
	//logger.Output("version: %s, url: %s, author: %s", config.src_ver, config.author);
	logger.Output("File: %s", pStr);
}
示例#6
0
void cLuckyPenny::RegisterSend(int aIndex)
{
	if(OBJMAX_RANGE(aIndex) == 0)
	{
		return;
	}

	if(this->Enabled == TRUE)
	{
		if ( gObj[aIndex].m_IfState.type != 97 )
		{
			ANTI_HACK_LOG.Output("[ANTI-HACK][Coins][Register] User in map(%d) [%s][%s] State(u:%d,t:%d,s:%d)",
				gObj[aIndex].MapNumber, gObj[aIndex].AccountID, gObj[aIndex].Name,
				gObj[aIndex].m_IfState.use,gObj[aIndex].m_IfState.type,gObj[aIndex].m_IfState.state);
			return;
		}

		int pos = gObjCheckItemPos(aIndex,ITEMGET(14,100));
		if(pos >= 0)
		{
			if ( ReadConfig.MAIN_INVENTORY_RANGE(aIndex,pos,false) != FALSE )
			{
				gObj[aIndex].pInventory[pos].m_Durability -= 1;
				gObj[aIndex].LuckyCoins++;
				
				PMSG_LUCKYCOINSCOUNT result;
				PHeadSubSetB((LPBYTE)&result, 0xBF, 0x0B, sizeof(result));
				result.Count = gObj[aIndex].LuckyCoins;
				DataSend(gObj[aIndex].m_Index,(BYTE*)&result,sizeof(result));
				
				if(gObj[aIndex].pInventory[pos].m_Durability <= 0)
				{
					gObjInventoryItemSet(aIndex, pos, -1);
					gObj[aIndex].pInventory[pos].Clear();
					GCInventoryItemDeleteSend(aIndex, pos, 1);
				}else
				{
					GCItemDurSend(aIndex, pos, gObj[aIndex].pInventory[pos].m_Durability, 0);
				}
				
				char RegisterButton[4] = {0xC1,0x04,0xBF,0x0C};
				DataSend(aIndex ,(UCHAR*)RegisterButton, sizeof(RegisterButton));

				gObj[aIndex].AccountExtraInfoModified = 1;
			}
		}else
		{
			char LackPacket[5] = {0xC1,0x05,0xBF,0x0C,0x00};
			DataSend(aIndex ,(UCHAR*)LackPacket, sizeof(LackPacket));
		}
	}
}
示例#7
0
void OfflineTrade::Close(char * AccountID)
{
	for( int i = OBJ_STARTUSERINDEX; i < OBJMAX; i++ )
	{
		LPOBJ lpUser = &gObj[i];
		// ----
		if( lpUser->Connected != PLAYER_PLAYING || !lpUser->IsOffTrade || strcmp(AccountID, lpUser->AccountID) )
		{
			continue;
		}
		// ----
		GJPUserClose(lpUser->AccountID);
		gObjDel(i);
		lpUser->IsOffTrade = false;
		// ----
		g_OfflineTradeLog.Output("[%s] [%s] Offline shop has been closed, account free", 
			lpUser->AccountID, lpUser->Name);
	}
}
示例#8
0
void Achievements::MonsterProc(LPOBJ lpUser, LPOBJ lpMonster)
{
#if( __4GAMERS__ == 1 )
	AchievMonsterInfo* lpMonsterInfo = this->MonsterGet(lpMonster);
	// ----
	if( !lpMonsterInfo )
	{
		return;
	}
	// ----
	g_AchievLog.Output("[%s] [%s] Updated data for monster (id: %d)",
		lpUser->AccountID, lpUser->Name, 
		lpMonster->Class);
	LogAddTD("[%s] [%s] [Achievements] Updated data for monster (id: %d)",
		lpUser->AccountID, lpUser->Name,
		lpMonster->Class);
	// ----
	this->GD_UpdateMonsterData(lpUser, lpMonster);
#endif
}
示例#9
0
void Achievements::GD_UpdateEventDataDS(LPOBJ lpUser, int DS_Exp, int DS_Point)
{
	if( !gObjIsConnected(lpUser->m_Index) )
	{
		return;
	}

	AchievGDUpdateEvent lpData = { 0 };
	lpData.Head.set((LPBYTE)&lpData, 0xA6, 0x01, sizeof(AchievGDUpdateEvent));
	strcpy(lpData.Name, lpUser->Name);

	lpData.EventType	= AchievEventType::DevilSquare;
	lpData.DS_Exp		= DS_Exp;
	lpData.DS_Point		= DS_Point;
#if( __4GAMERS__ == 1 )
	g_AchievLog.Output("[%s] [%s] Updated data for DevilSquare (Exp: %d, Point: %d)",
		lpUser->AccountID, lpUser->Name, DS_Exp, DS_Point);
#endif
	LogAddTD("[%s] [%s] [Achievements] Updated data for DevilSquare (Exp: %d, Point: %d)",
		lpUser->AccountID, lpUser->Name, DS_Exp, DS_Point);

	cDBSMng.Send((PCHAR)&lpData, sizeof(lpData));
}
示例#10
0
void Achievements::GD_UpdateEventDataBC(LPOBJ lpUser, int BC_Exp, int BC_ExtExp, int BC_Score)
{
	if( !gObjIsConnected(lpUser->m_Index) )
	{
		return;
	}

	AchievGDUpdateEvent lpData = { 0 };
	lpData.Head.set((LPBYTE)&lpData, 0xA6, 0x01, sizeof(AchievGDUpdateEvent));
	strcpy(lpData.Name, lpUser->Name);

	lpData.EventType	= AchievEventType::BloodCastle;
	lpData.BC_Exp		= BC_Exp;
	lpData.BC_ExtExp	= BC_ExtExp;
	lpData.BC_Score		= BC_Score;
#if( __4GAMERS__ == 1 )
	g_AchievLog.Output("[%s] [%s] Updated data for BloodCastle (Exp: %d, ExtExp: %d, Score: %d)",
		lpUser->AccountID, lpData.Name, BC_Exp, BC_ExtExp, BC_Score);
#endif
	LogAddTD("[%s] [%s] [Achievements] Updated data for BloodCastle (Exp: %d, ExtExp: %d, Score: %d)",
		lpUser->AccountID, lpUser->Name, BC_Exp, BC_ExtExp, BC_Score);

	cDBSMng.Send((PCHAR)&lpData, sizeof(lpData));
}
示例#11
0
void DSGN_Item_Mover::LoadItem(char* script_file)
{
	SMDFile = fopen(script_file, "r");

	if ( SMDFile == NULL )
	{
		LogAdd(lMsg.Get(MSGGET(1, 197)), script_file);
		return ;
	}

	int Token;
	int n = 0;

	while ( true )
	{
		Token = GetToken();

		if ( Token == 2 )
		{
			break;
		}

		if ( Token == 1 )
		{
			int st = TokenNumber;	// script_type
			if ( st == 0 )
			{
				while ( true )
				{
					Token = GetToken();

					if ( Token == 0 )
					{
						if ( strcmp("end", TokenString) == 0 )
						{
							break;
						}
					}

					int TypeFrom = 0;
					int IndexFrom = 0;
					int TypeTo = 0;
					int IndexTo = 0;

					//Load Old Item Index + DbVersion
					TypeFrom = TokenNumber;

					Token = GetToken();
					IndexFrom = TokenNumber;

					this->recArray[n].oldIndex = ITEMGET(TypeFrom,IndexFrom);

					Token = GetToken();
					this->recArray[n].oldDBNumber = TokenNumber;

					//Load New Item Index + DbVersion
					Token = GetToken();
					TypeTo = TokenNumber;

					Token = GetToken();
					IndexTo = TokenNumber;

					this->recArray[n].newIndex = ITEMGET(TypeTo,IndexTo);

					Token = GetToken();
					this->recArray[n].newDBNumber = TokenNumber;

					//Get the New DbVersion
					if (this->highestDBNumber < this->recArray[n].newDBNumber)
					{
						this->highestDBNumber = this->recArray[n].newDBNumber;
					}

					//Mark Item as Loaded
					this->recArray[n].loaded = 1;
					this->ItemObjectCount++;

					DSGN_ITEMMOVE_LOG.Output("[ItemMove][Load] %d Item: oldId:%d, oldDb:%d, newId:%d, newDb:%d ",
						this->ItemObjectCount,
						this->recArray[n].oldIndex, this->recArray[n].oldDBNumber,
						this->recArray[n].newIndex, this->recArray[n].newDBNumber
					);

					n++;

					if ( this->ItemObjectCount > MAX_REC_ITEM_MACRO-1 )
					{
						break;
					}
				}
			}
		}
	}

	DSGN_ITEMMOVE_LOG.Output("[ItemMove] Successfuly Loaded %d Items [New DB: %d]!",
		this->ItemObjectCount,
		this->highestDBNumber
	);
}
示例#12
0
void GetTitanReward(SDHP_GETREWARD_INFOSAVE * lpMsg)
{	
	char szId[11]={0};
	int aIndex = 0;

	szId[MAX_ACCOUNT_LEN]=0;
	memcpy(szId, lpMsg->AccountID, sizeof(lpMsg->AccountID));
	aIndex = lpMsg->aIndex;

	if ( !gObjIsAccontConnect(aIndex, szId))
	{
		LogAddC(2, lMsg.Get(MSGGET(1, 175)), szId, aIndex);
		return;
	}
	
	LPOBJ lpObj = &gObj[aIndex];

	if (( lpObj->m_Index == aIndex) && (!strcmp(lpMsg->Name,lpObj->Name)))
	{
		char exVipMoney[512]={0};
		char exZen[512]={0};
		wsprintf(exVipMoney,"VipMoney increased in %d",lpMsg->rew.VipMoney);
		wsprintf(exZen,"Zen increased in %d",lpMsg->rew.Zen);

		if(lpMsg->ID_Num >= 0)
		{
			if(lpMsg->rew.num != (WORD) -1)
			{
				if(lpMsg->rew.Days == 0)
				{
					PMSG_BUYSHOPRESULT pResult;	
					PHeadSetB((LPBYTE)&pResult, 0x32, sizeof(pResult));
					CItem item;
					item.m_Level = lpMsg->rew.Level;
					item.m_SkillOption = lpMsg->rew.Skill;
					item.m_LuckOption = lpMsg->rew.Luck;
					item.m_Z28Option = lpMsg->rew.Opt;
					item.m_Durability = lpMsg->rew.Dur;
					item.m_ItemOptionEx = lpMsg->rew.Exc;
					item.m_JewelOfHarmonyOption = 0;
					if(lpMsg->rew.JOH > 0)
					{
						int btOptionLevel = item.m_Level;
						if(btOptionLevel > ReadConfig.JOHLevelMax)
							btOptionLevel = ReadConfig.JOHLevelMax;
						item.m_JewelOfHarmonyOption |= lpMsg->rew.JOH << 4;
						item.m_JewelOfHarmonyOption |= btOptionLevel & 0x0F;
					}
						
					item.Convert(lpMsg->rew.num, lpMsg->rew.Skill, lpMsg->rew.Luck, lpMsg->rew.Opt, lpMsg->rew.Exc, 0, 0, CURRENT_DB_VERSION);
					item.m_Durability = item.m_BaseDurability;
					item.m_ItemSlot1 = lpMsg->rew.Sock1;
					item.m_ItemSlot2 = lpMsg->rew.Sock2;
					item.m_ItemSlot3 = lpMsg->rew.Sock3;
					item.m_ItemSlot4 = lpMsg->rew.Sock4;
					item.m_ItemSlot5 = lpMsg->rew.Sock5;

					item.Value();
					pResult.Result = gObjShopBuyInventoryInsertItem(lpObj->m_Index,item);
						
					if ( pResult.Result != 0xFF )
					{
						DelTitanReward(aIndex,lpMsg->ID_Num);

						if(lpMsg->rew.IsForeverFFFE == 1)
							lpObj->pInventory[pResult.Result].m_Number = 0xFFFFFFFE;

						ItemByteConvert((LPBYTE)&pResult.ItemInfo, item);
						DataSend(aIndex, (LPBYTE)&pResult, pResult.h.size);

						if(lpMsg->rew.VipMoney > 0)
						{						
							lpObj->AccountExtraInfoModified = 1;
							lpObj->VipMoney += lpMsg->rew.VipMoney;
							GCServerMsgStringSend(exVipMoney, lpObj->m_Index, 0x01);
						}
						if(lpMsg->rew.Zen > 0)
						{
							if((__int64)(lpMsg->rew.Zen + gObj[aIndex].Money) > (__int64)MAX_ZEN)
								gObj[aIndex].Money = MAX_ZEN;
							else
								gObj[aIndex].Money += lpMsg->rew.Zen;

							::GCMoneySend(aIndex, gObj[aIndex].Money);
							GCServerMsgStringSend(exZen, lpObj->m_Index, 0x01);
						}
							
						GCServerMsgStringSend("Get Reward Success!", aIndex, 0x01);
						
						char sbuf[512]={0};
						wsprintf(sbuf,"[BotReward](%s)(%s) Buy Item:%d(%d %d) ID_DB:%d [LVL:%d O:%d L:%d S:%d E:%d]",
							gObj[aIndex].AccountID,gObj[aIndex].Name,
							lpMsg->rew.num, lpMsg->rew.num/512, lpMsg->rew.num-((int)(lpMsg->rew.num/512)*512), lpMsg->ID_Num,
							lpMsg->rew.Level,lpMsg->rew.Opt,lpMsg->rew.Luck,lpMsg->rew.Skill,lpMsg->rew.Exc);
						LogAddTD(sbuf);

						BOTREWARD_LOG.Output(sbuf);
					}
				}else
				{
					time_t t = time(NULL);
					localtime(&t);
					DWORD iTime = (DWORD)t + lpMsg->rew.Days * 86400;
					BYTE iItemPos = gObjInventoryInsertItem(&gObj[aIndex], ITEM_GET_TYPE(lpMsg->rew.num), ITEM_GET_INDEX(lpMsg->rew.num), lpMsg->rew.Level, iTime, 0xff,0,0,0,0,0);
					
					if ( iItemPos != (BYTE)-1 )
					{
						DelTitanReward(aIndex,lpMsg->ID_Num);
						gObj[aIndex].pInventory[iItemPos].m_JewelOfHarmonyOption = 0;
						if(lpMsg->rew.JOH > 0)
						{
							int btOptionLevel = gObj[aIndex].pInventory[iItemPos].m_Level;
							if(btOptionLevel > ReadConfig.JOHLevelMax)
								btOptionLevel = ReadConfig.JOHLevelMax;
							gObj[aIndex].pInventory[iItemPos].m_JewelOfHarmonyOption |= lpMsg->rew.JOH << 4;
							gObj[aIndex].pInventory[iItemPos].m_JewelOfHarmonyOption |= btOptionLevel & 0x0F;
						}
						gObj[aIndex].pInventory[iItemPos].Convert(lpMsg->rew.num, lpMsg->rew.Skill, lpMsg->rew.Luck, lpMsg->rew.Opt, lpMsg->rew.Exc, 0, 0, CURRENT_DB_VERSION);
						BYTE btItemType=0;
						btItemType |= (lpMsg->rew.num & 0x1E00 ) >> 5;
						gObj[aIndex].pInventory[iItemPos].m_ItemOptionEx = btItemType+2;
						gObj[aIndex].pInventory[iItemPos].m_ItemSlot1 = lpMsg->rew.Sock1;
						gObj[aIndex].pInventory[iItemPos].m_ItemSlot2 = lpMsg->rew.Sock2;
						gObj[aIndex].pInventory[iItemPos].m_ItemSlot3 = lpMsg->rew.Sock3;
						gObj[aIndex].pInventory[iItemPos].m_ItemSlot4 = lpMsg->rew.Sock4;
						gObj[aIndex].pInventory[iItemPos].m_ItemSlot5 = lpMsg->rew.Sock5;
						::GCInventoryItemOneSend(aIndex, iItemPos);
						MuItemShop.ItemSendTime(aIndex,iItemPos);					

						if(lpMsg->rew.VipMoney > 0)
						{						
							lpObj->AccountExtraInfoModified = 1;
							lpObj->VipMoney += lpMsg->rew.VipMoney;
							GCServerMsgStringSend(exVipMoney, lpObj->m_Index, 0x01);
						}
						if(lpMsg->rew.Zen > 0)
						{
							if((__int64)(lpMsg->rew.Zen + gObj[aIndex].Money) > (__int64)MAX_ZEN)
								gObj[aIndex].Money = MAX_ZEN;
							else
								gObj[aIndex].Money += lpMsg->rew.Zen;

							::GCMoneySend(aIndex, gObj[aIndex].Money);
							GCServerMsgStringSend(exZen, lpObj->m_Index, 0x01);
						}

						char sbuf[512]={0};
						GCServerMsgStringSend("Get Reward Success!", lpObj->m_Index, 0x01);
						wsprintf(sbuf,"[BotReward](%s)(%s) Buy Item:%d(%d %d) ID_DB:%d [LVL:%d O:%d L:%d S:%d E:%d]",
							gObj[aIndex].AccountID,gObj[aIndex].Name,
							lpMsg->rew.num, lpMsg->rew.num/512, lpMsg->rew.num-((int)(lpMsg->rew.num/512)*512), lpMsg->ID_Num,
							lpMsg->rew.Level,lpMsg->rew.Opt,lpMsg->rew.Luck,lpMsg->rew.Skill,lpMsg->rew.Exc);
						LogAddTD(sbuf);
						BOTREWARD_LOG.Output(sbuf);
					}
				}
			}else
			{
				if(lpMsg->rew.VipMoney > 0)
示例#13
0
int CGMMng::ManagementProc(LPOBJ lpObj, char* szCmd, int aIndex)
{
	char * szCmdToken;
	char string[256];
	char szId[20];
	char * pId = szId;
	int len = strlen(szCmd);
	int command_number;

	if ( len < 1 || len > 250 )
	{
		return 0;
	}

	memset(szId, 0, sizeof(szId));
	strcpy(string, szCmd);
	szCmdToken = strtok(string, " ");
	command_number = this->GetCmd(szCmdToken);

	strcpy(Message, szCmd);

	if ( stricmp(szCmdToken, "/add0") == 0 )
	{
		int nAddStrength = 100;
		LevelUpPointAdd(0,nAddStrength,aIndex);
		GCSendEffectInfo(aIndex, 17);
	}
	if ( stricmp(szCmdToken, "/add1") == 0 )
	{
		int nAddStrength = 100;
		LevelUpPointAdd(1,nAddStrength,aIndex);
		GCSendEffectInfo(aIndex, 3);
	}
	if ( stricmp(szCmdToken, "/add2") == 0 )
	{
		int nAddStrength = 100;
		LevelUpPointAdd(2,nAddStrength,aIndex);
		GCSendEffectInfo(aIndex, 17);
	}
	if ( stricmp(szCmdToken, "/add3") == 0 )
	{
		int nAddStrength = 100;
		LevelUpPointAdd(3,nAddStrength,aIndex);
		GCSendEffectInfo(aIndex, 17);
	}
	switch ( command_number )
	{
		#if(GS_CASTLE == 1)
		case 331:
		{
			pId = this->GetTokenString();
			g_CastleSiege.OperateGmCommand(lpObj->m_Index, 0, pId);
		}
		break;
		case 332:
		{
			pId = this->GetTokenString();
			g_CastleSiege.OperateGmCommand(lpObj->m_Index, 1, pId);
		}
		break;
		case 333:
		{
			pId = this->GetTokenString();
			g_CastleSiege.OperateGmCommand(lpObj->m_Index, 2, pId);
		}
		break;
		case 334:
		{
			pId = this->GetTokenString();
			g_CastleSiege.OperateGmCommand(lpObj->m_Index, 3, pId);
		}
		break;
		case 335:
		{
			pId = this->GetTokenString();
			g_CastleSiege.OperateGmCommand(lpObj->m_Index, 4, pId);
		}
		break;
		case 336:
		{
			pId = this->GetTokenString();
			g_CastleSiege.OperateGmCommand(lpObj->m_Index, 5, pId);
		}
		break;
		case 337:
		{
			pId = this->GetTokenString();
			g_CastleSiege.OperateGmCommand(lpObj->m_Index, 6, pId);
		}
		break;
		case 338:
		{
			pId = this->GetTokenString();
			g_CastleSiege.OperateGmCommand(lpObj->m_Index, 7, pId);
		}
		break;
		case 340:
		{
			pId = this->GetTokenString();
			g_CastleSiege.OperateGmCommand(lpObj->m_Index, 8, pId);
		}
		break;
#endif
		case 502:
			{
				MMSG->Msg(lpObj->m_Index,"@@God of MuGlobal is Wolf");
				break;
			}
		case 501:
			{
				int OnlineCount = 0;
				for (int n=OBJ_STARTUSERINDEX;n<OBJMAX;n++)
				{
					if(gObjIsConnected(n))
						OnlineCount++;
				}
				MMSG->Msg(lpObj->m_Index,"[%d] Online Players",OnlineCount);
				break;
			}
		case 500:
			{
				char* szuText = this->GetTokenString();
				if(szuText != NULL)
				{
					int uTick = GetTickCount();
					//if(lpObj->Money < 299999);
					//{
					//	MMSG->Msg(lpObj->m_Index,"@[POST] Eww ti co - bisplatnij sir toka v mi6elovki");
					//	return 0;
					//}
					//{
					//	MMSG->Msg(lpObj->m_Index,"@[POST] Eww ti co - level netu :(");
					//	return 0;
					//}
					if(lpObj->Money < 500000)
					{
						MMSG->Msg(lpObj->m_Index,"@[POST] You need 500k Zen to POST");
						return 0;
					}
					if(lpObj->Level < 50)
					{
						MMSG->Msg(lpObj->m_Index,"@[POST] You need 50 Level to POST");
						return 0;
					}
					else
					{
						char *Content = (char*) Message;
						GetLongParam(Message, Content);
						lpObj->Money -= 500000;
						GCMoneySend(lpObj->m_Index , lpObj->Money);
						wsprintf(szuTemp,"[POST] %s: %s",lpObj->Name,Message);
						MMSG->PMAll(szuTemp);
						return 0;
					}
				}
				else
				{
					MMSG->Msg(lpObj->m_Index,"@[POST] The Correct Syntax is: /post message");
					return 0;
				}
				break;
			}
			case 503:	// MakeSet CMD
			{
								if ( (lpObj->Authority & 2) != 2 && (lpObj->Authority & 0x20) != 0x20 )
				{
					return 0;
				}
				if (!strcmpi(Message, "/MakeSet"))
				{
					MMSG->Msg(aIndex, "Useage: /Make <Name> <Index> <Level> <Option> <Skill> <Luck> <Exc> <Ancient> <Amount> <Dur>");
					return 0;
				}
				//Name Index Level Option Skill Luck Exc Ancient Amount Dur
				char Name[100];
				memset(Name, 0, 100);
				int Index, Level, Option, Luck, Skill, Exc, Ancient, Amount, Dur; 
				char ParamBuff[100];
				memset(ParamBuff, 0, 100);
				GetParam(1, Message, ParamBuff);
				strcpy(Name, ParamBuff);
				memset(ParamBuff, 0, 100);
				if (!GetParam(2, Message, ParamBuff)) strcpy(ParamBuff, "0");
				Index = atoi(ParamBuff);
				memset(ParamBuff, 0, 100);
				if (!GetParam(3, Message, ParamBuff)) strcpy(ParamBuff, "13");
				Level = atoi(ParamBuff);
				memset(ParamBuff, 0, 100);
				if (!GetParam(4, Message, ParamBuff)) strcpy(ParamBuff, "4");
				Option = atoi(ParamBuff);
				memset(ParamBuff, 0, 100);
				if (!GetParam(5, Message, ParamBuff)) strcpy(ParamBuff, "1");
				Luck = atoi(ParamBuff);
				memset(ParamBuff, 0, 100);
				if (!GetParam(6, Message, ParamBuff)) strcpy(ParamBuff, "1");
				Skill = atoi(ParamBuff);
				memset(ParamBuff, 0, 100);
				if (!GetParam(7, Message, ParamBuff)) strcpy(ParamBuff, "127");
				Exc = atoi(ParamBuff);
				memset(ParamBuff, 0, 100);
				if (!GetParam(8, Message, ParamBuff)) strcpy(ParamBuff, "0");
				Ancient = atoi(ParamBuff);
				memset(ParamBuff, 0, 100);
				if (!GetParam(9, Message, ParamBuff)) strcpy(ParamBuff, "1");
				Amount = atoi(ParamBuff);
				memset(ParamBuff, 0, 100);
				if (!GetParam(10, Message, ParamBuff)) strcpy(ParamBuff, "255");
				Dur = atoi(ParamBuff);
				int tIndex = gObjGetIndexByName(Name);
				if (!tIndex) return 0;
				for (int i=0; i<Amount; i++)
				{
					for (int type=7; type<12; type++)
						ItemSerialCreateSend(tIndex, lpObj->MapNumber, lpObj->X, lpObj->Y, type*512 + Index, Level, Dur, Skill, Luck, Option, tIndex, Exc, Ancient);
				}
				break;
			}
		case 218:
			{
				AllSendServerMsg("[MU GLOBAL ADMINISTRATORS]");
				AllSendServerMsg("Sacred & Wolf");
				AllSendServerMsg("www.muglobal.ru");
				break;
			}
		case 217:	//116:
			{
				if ( (lpObj->Authority & 2) != 2 && (lpObj->Authority & 0x20) != 0x20 )
				{
					return 0;
				}

				LogAddTD("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s",
					lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "FIRECRACK.");
				int x = lpObj->X;
				int y = lpObj->Y;
				PMSG_SERVERCMD pMsg;

				PHeadSubSetB((LPBYTE)&pMsg,0xF3,0x40, sizeof(pMsg));
				pMsg.CmdType = 0;

				for ( int i=0;i<15;i++)
				{
					pMsg.X = x+(rand() % 5)*2 - 4;
					pMsg.Y = y+(rand() % 5)*2 - 4;
					MsgSendV2(lpObj,(UCHAR*)&pMsg, sizeof(pMsg));
					::DataSend(lpObj->m_Index ,(UCHAR*)&pMsg, sizeof(pMsg));
				}
			}
			break;

		case 216:	//115:
			{
				if ( (lpObj->Authority & 2) != 2 && (lpObj->Authority & 0x20) != 0x20 )
				{
					return 0;
				}

				pId = this->GetTokenString();

				if ( pId == NULL )
				{
					return 0;
				}

				LPOBJ lpTargetObj = gObjFind(pId);

				if ( lpTargetObj == NULL )
				{
					return 0;
				}

				LogAddTD("Use GM Command -> [ %s ]	[ %s ]	[ %s ] / Target : [%s][%s] : %s ",
					lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, lpTargetObj->AccountID,
					lpTargetObj->Name, "User Watching");

				char szTemp[256];

				if ( this->WatchTargetIndex == lpTargetObj->m_Index )
				{
					this->WatchTargetIndex = -1;
					
					wsprintf(szTemp, "%s : °¨½ÃÇØÁ¦", lpTargetObj->Name);	// #translation
					GCServerMsgStringSend(szTemp, lpObj->m_Index, 1);
				}
				else
				{
					wsprintf(szTemp, "%s : °¨½Ã½ÃÀÛ", lpTargetObj->Name);	// #translation
					GCServerMsgStringSend(szTemp, lpObj->m_Index, 1);
					this->WatchTargetIndex = lpTargetObj->m_Index;
				}
			}
			break;

		case 215:	//114:
			{
				if ( (lpObj->Authority & 2) != 2 && (lpObj->Authority & 0x20) != 0x20 )
				{
					return 0;
				}

				pId = this->GetTokenString();

				if ( pId == NULL )
				{
					return 0;
				}

				int map;
				int iX;
				int iY;
				LPOBJ lpTargetObj = gObjFind(pId);
				int iIndex;

				if ( lpTargetObj == NULL )
				{
					return 0;
				}

				LogAddTD("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] / Target : [%s][%s] : %s",
					lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, lpTargetObj->AccountID,
					lpTargetObj->Name, "User Tracking");
				map = lpTargetObj->MapNumber;
				iX = lpTargetObj->X;
				iY = lpTargetObj->Y;
				iIndex = lpObj->m_Index;

				if ( iIndex >= 0 )
				{
					gObjTeleport(iIndex, map, iX, iY);
				}
			}
			break;

		case 214:	//113:
			{
				if ( (lpObj->Authority & 2) != 2 )
				{
					return 0;
				}

				LogAddTD("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s",
					lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, 
					"User Stat (connection)");

				int lc151 = 0;
				int lc152 = 400;
				int iTokenNumber = this->GetTokenNumber();

				if ( iTokenNumber > 0 )
				{
					lc151 = iTokenNumber;
				}

				int iTokenNumber2 = this->GetTokenNumber();

				if ( iTokenNumber2 > 0 )
				{
					lc152 = iTokenNumber2;
				}

				gObjSendUserStatistic(lpObj->m_Index, lc151, lc152);
			}
			break;

		case 100:	//100:
			{
				if ( (lpObj->AuthorityCode &4) != 4 )
				{
					return 0;
				}

				pId = this->GetTokenString();

				if ( pId == NULL )
				{
					return 0;
				}

				int iTargetIndex = gObjGetIndex(pId);
				

				if ( iTargetIndex >= 0 )
				{
					LPOBJ lpTargetObj = gObjFind(pId);

					if ( lpTargetObj == NULL )
					{
						return 0;
					}

					LogAddTD("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] / Target : [%s][%s] : %s",
						lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, lpTargetObj->AccountID,
						lpTargetObj->Name, "User Disconnect");
					LogAdd(lMsg.Get(MSGGET(1, 191)), pId);
					CloseClient(iTargetIndex);
				}
			}
			break;

		case 112:	//108:
			{
				if ( (lpObj->AuthorityCode &4) != 4 )
				{
					return 0;
				}

				LogAddTD("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s",
					lpObj->Ip_addr, lpObj->AccountID, lpObj->Name,
					"Guild Disconnect");

				pId = this->GetTokenString();

				if ( pId == NULL )
				{
					return 0;
				}

				_GUILD_INFO_STRUCT * lpGuild = Guild.SearchGuild(pId);
				int iIndex;

				if ( lpGuild != NULL )
				{
					for ( int i=0;i<MAX_USER_GUILD ; i++ )
					{
						if ( lpGuild->Index[i] >= 0 )
						{
							iIndex = lpGuild->Index[i];

							if ( iIndex >= 0 )
							{
								LogAdd(lMsg.Get(MSGGET(1, 191)), pId);
								CloseClient(iIndex);
							}
						}
					}
				}
			}
			break;

		case 101:	//101:
			{
				if ( (lpObj->AuthorityCode &8) == 8 )
				{
					pId = this->GetTokenString();

					if ( pId == NULL )
					{
						return 0;
					}

					int iTokenNumber1 = this->GetTokenNumber();
					int iTokenNumber2 = this->GetTokenNumber();
					int iTokenNumber3 = this->GetTokenNumber();
					int iIndex = gObjGetIndex(pId);
					LPOBJ lpTargetObj;

					if ( iIndex >= 0 )
					{
						lpTargetObj = gObjFind(pId);

						if ( lpTargetObj == NULL )
						{
							return 0;
						}

						LogAddTD("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] / Target : [%s][%s] : %s",
							lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, lpTargetObj->AccountID,
							lpTargetObj->Name, "User SetPosition");

						gObjTeleport(iIndex, iTokenNumber1, iTokenNumber2, iTokenNumber3);
					}
				}
				else
				{
					pId = this->GetTokenString();

					if ( pId != NULL )
					{
						int lc165 = -1;
						int lc166 = 0;
						int lc167 = 0;

						if ( lpObj->Teleport != 0 )
						{
							GCServerMsgStringSend(lMsg.Get(MSGGET(6, 68)), lpObj->m_Index, 1);
							return 0;
						}

						if ( (lpObj->m_IfState.use) != 0 )
						{
							if ( lpObj->m_IfState.type  == 3 )
							{
								lpObj->TargetShopNumber = -1;
								lpObj->m_IfState.type = 0;
								lpObj->m_IfState.use = 0;
							}
						}

						if ( lpObj->m_IfState.use > 0 )
						{
							GCServerMsgStringSend(lMsg.Get(MSGGET(6, 68)), lpObj->m_Index, 1);
							return 0;
						}

						if ( gObj[aIndex].IsInBattleGround != false )
						{
							GCServerMsgStringSend(lMsg.Get(MSGGET(6, 68)), lpObj->m_Index, 1);
							return 0;
						}

						if ( lpObj->m_PK_Level >= 6 )
						{
							GCServerMsgStringSend(lMsg.Get(MSGGET(4, 101)), lpObj->m_Index, 1);
							return 0;
						}

						gMoveCommand.Move(lpObj, pId);
					}
				}
			}
			break;

		case 108:	//104:
			{
				if ( (lpObj->AuthorityCode &8)!= 8 )
				{
					return 0;
				}

				LogAddTD("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s",
					lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, 
					"Guild SetPosition");

				pId = this->GetTokenString();

				if ( pId == NULL )
				{
					return 0;
				}

				int iTokenNumber1 = this->GetTokenNumber();
				int iTokenNumber2 = this->GetTokenNumber();
				int iTokenNumber3 = this->GetTokenNumber();
				_GUILD_INFO_STRUCT* lpGuild = Guild.SearchGuild(pId);
				int iIndex;

				if ( lpGuild != NULL )
				{
					for ( int i=0;i<MAX_USER_GUILD;i++)
					{
						if (lpGuild->Index[i] >= 0 )
						{
							iIndex = lpGuild->Index[i];
							gObjTeleport(iIndex, iTokenNumber1, iTokenNumber2++, iTokenNumber3);
						}
					}
				}
			}
			break;

		case 109:	//105:
			{
				if ( (lpObj->Authority &2)== 2 )
				{
					LogAddTD("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s",
						lpObj->Ip_addr, lpObj->AccountID, lpObj->Name,
						"Start BattleSoccer");

					BattleSoccerGoalStart(0);
				}
			}
			break;

		case 110:	//106:
			{
				if ( (lpObj->Authority &2) == 2 )
				{
					LogAddTD("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s",
						lpObj->Ip_addr, lpObj->AccountID, lpObj->Name,
						"Stop BattleSoccer");

					BattleSoccerGoalEnd(0);
				}
				else
				{
					if ( gObj[aIndex].lpGuild != NULL )
					{
						if (gObj[aIndex].lpGuild->WarType == 1 )
						{
							strcmp(gObj[aIndex].Name, gObj[aIndex].lpGuild->Names[0] );
						}
					}
				}
			}

			break;

		case 111:	//107:
			{
				if ( (lpObj->Authority & 2) == 2 )
				{
					LogAddTD("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s",
						lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "End GuildWar");

					char * szGuild = this->GetTokenString();

					if ( szGuild != NULL )
					{
						GCManagerGuildWarEnd(szGuild);
					}
				}
				else
				{
					if ( gObj[aIndex].lpGuild != NULL && gObj[aIndex].lpGuild->lpTargetGuildNode != NULL)
					{
						if ( strcmp( gObj[aIndex].Name, gObj[aIndex].lpGuild->Names[0] ) ==  0)
						{
							if ( gObj[aIndex].lpGuild->BattleGroundIndex >= 0 && gObj[aIndex].lpGuild->WarType == 1 )
							{
								::gObjAddMsgSendDelay(&gObj[aIndex], 7, aIndex, 10000, 0);

								char szTemp[100];

								wsprintf(szTemp, lMsg.Get(MSGGET(4, 129)), gObj[aIndex].lpGuild->Names[0] );
								::GCServerMsgStringSendGuild(gObj[aIndex].lpGuild, szTemp, 1);
								::GCServerMsgStringSendGuild(gObj[aIndex].lpGuild->lpTargetGuildNode, szTemp, 1);
							}
						}
					}
				}
			}
			break;

		case 104:	//102:
			{
				if ( (lpObj->AuthorityCode&0x20 ) != 0x20 )
				{
					return FALSE;
				}

				LogAddTD("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID,
					lpObj->Name, "Ban Chatting");

				pId = this->GetTokenString();

				if ( pId == NULL )
				{
					return FALSE;
				}

				int Index = ::gObjGetIndex(pId);

				if ( Index >= 0 )
				{
					gObj[Index].Penalty |= 2;
				}

			}
			break;

		case 106:	//103:
			{
				if ( (lpObj->AuthorityCode & 32 ) != 32 )
				{
					return FALSE;
				}

				LogAddTD("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID,
					lpObj->Name, "Free Ban-Chatting");

				pId = this->GetTokenString();

				if ( pId == NULL )
				{
					return FALSE;
				}

				int Index = ::gObjGetIndex(pId);

				if ( Index >= 0 )
				{
					gObj[Index].Penalty &= ~2;
				}
			}
			break;

		case 200:	//109:
			{
				pId = this->GetTokenString();

				if ( pId != NULL )
				{
					if ( strlen(pId) >= 1 )
					{
						::GCGuildWarRequestResult(pId, aIndex, 0);
					}
				}
			}

			break;

		case 202:	//111:
			{
				if ( (lpObj->Authority & 2 ) == 2 )
				{
					LogAddTD("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID,
						lpObj->Name, "Set GuildWar");
		
					pId = this->GetTokenString();

					if ( pId != NULL )
					{
						char * Rival = this->GetTokenString();

						if ( Rival != NULL )
						{
							if ( strlen(pId) >= 1 )
							{
								if ( strlen(Rival) >= 1 )
								{
									::GCManagerGuildWarSet(pId, Rival, 1);
								}
							}
						}
					}
				}
				else
				{
					if ( gEnableBattleSoccer != FALSE )
					{
						pId = this->GetTokenString();

						if ( pId != NULL )
						{
							if ( strlen(pId) >= 1 )
							{
								::GCGuildWarRequestResult(pId, aIndex, 1);
							}
						}
					}
				}
			}

			break;

		case 201:	//110:
			{
				gObjBillRequest(&gObj[aIndex]);
			}
			break;

		case 203:	//112:
			{
				pId = this->GetTokenString();

				if ( pId != NULL )
				{
					BOOL bState;

					if ( strcmp(pId, "on" ) == 0 )
					{
						bState = TRUE;
					}
					else if ( strcmp(pId, "off") == 0 )
					{
						bState = FALSE;
					}

					if ( bState >= FALSE && bState <= TRUE )
					{
						::gObjSetTradeOption(aIndex, bState);
						::gObjSetDuelOption(aIndex, bState);
					}
				}
			}
			break;

		case 320:	//117:
			{
				if ( (lpObj->Authority &2) != 2 )
				{
					return FALSE;
				}

				LogAddTD("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID,
					lpObj->Name, "ÄïµÐ»óź¸±â");	// #translation Require Translation
				KUNDUN_GM_LOG.Output("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID,
					lpObj->Name, "ÄïµÐ»óź¸±â");	// #translation  Require Translation

				for ( int n=0;n<MAX_VIEWPORT;n++)
				{
					if ( lpObj->VpPlayer[n].state != 0 )
					{
						if ( lpObj->VpPlayer[n].type == OBJ_MONSTER )
						{
							if ( lpObj->VpPlayer[n].number >= 0 )
							{
								LPOBJ lpTarget = &gObj[lpObj->VpPlayer[n].number];

								if ( lpTarget->Class == 275 )
								{
									TNotice pNotice(1);

									pNotice.SendToUser(lpObj->m_Index, "ÄïµÐ HP = %7.0f / %7.0f", lpTarget->Life, lpTarget->MaxLife); //Require Translation
									pNotice.SendToUser(lpObj->m_Index, "ÄïµÐ HP ÃÊ´çȸº¹·® = %d ȸº¹·® = %d ȸº¹½Ã°£ = %d", giKundunRefillHPSec, giKundunRefillHP, giKundunRefillHPTime);	// Require Translation
								}
							}
						}
					}
				}

			}
			break;

		case 321:	//118:
			{
				if ( (lpObj->Authority &2 ) != 2 )
				{
					return FALSE;
				}

				LogAddTD("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID,
					lpObj->Name, "ÄïµÐHP¼³Á¤");	// Require Translation
				KUNDUN_GM_LOG.Output("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID,
					lpObj->Name, "ÄïµÐHP¼³Á¤");	// Require Translation

				int iLife = this->GetTokenNumber();

				for ( int n=0;n<MAX_VIEWPORT;n++)
				{
					if ( lpObj->VpPlayer[n].state != FALSE )
					{
						if ( lpObj->VpPlayer[n].type == OBJ_MONSTER )
						{
							if ( lpObj->VpPlayer[n].number >= 0 )
							{
								LPOBJ lpTarget = &gObj[lpObj->VpPlayer[n].number];

								if ( lpTarget->Class == 275 )
								{
									if  ( iLife <= 5000 )
									{
										iLife = 5000 ;
									}

									if ( iLife > lpTarget->MaxLife )
									{
										iLife = lpTarget->MaxLife;
									}

									lpTarget->Life = iLife;
								
									TNotice pNotice(1);

									pNotice.SendToUser(lpObj->m_Index, "ÄïµÐ HP = %7.0f / %7.0f", lpTarget->Life, lpTarget->MaxLife); //Require Translation
								}
							}
						}
					}
				}
			}
			break;

		case 322:	//119:
			{
				if ( (lpObj->Authority &2 ) != 2 )
				{
					return FALSE;
				}

				LogAddTD("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID,
					lpObj->Name, "ÄïµÐHPȸº¹·®¼³Á¤");	// Require Translation
				KUNDUN_GM_LOG.Output("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID,
					lpObj->Name, "ÄïµÐHPȸº¹·®¼³Á¤");	// Require Translation

				int RefillHP = this->GetTokenNumber();

				if ( RefillHP <= 0 || RefillHP > 5000000 )
				{
					return 0;
				}

				giKundunRefillHP = RefillHP;

				TNotice pNotice(0);

				pNotice.SendToUser(lpObj->m_Index, "ÄïµÐ HP ÃÊ´çȸº¹·® = %d ȸº¹·® = %d ȸº¹½Ã°£ = %d", giKundunRefillHPSec, giKundunRefillHP, giKundunRefillHPTime);	// Require Translation

			}

			break;

		case 323:	//120:
			{
				if ( (lpObj->Authority &2 ) != 2 )
				{
					return FALSE;
				}

				LogAddTD("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID,
					lpObj->Name, "ÄïµÐHPÃÊ´çȸº¹·®¼³Á¤");	// Require Translation
				KUNDUN_GM_LOG.Output("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID,
					lpObj->Name, "ÄïµÐHPÃÊ´çȸº¹·®¼³Á¤");	// Require Translation

				int RefillHPSec = this->GetTokenNumber();

				if ( RefillHPSec <= 0 || RefillHPSec > 10000 )
				{
					return 0;
				}

				giKundunRefillHPSec = RefillHPSec;

				TNotice pNotice(0);

				pNotice.SendToUser(lpObj->m_Index, "ÄïµÐ HP ÃÊ´çȸº¹·® = %d ȸº¹·® = %d ȸº¹½Ã°£ = %d",
					giKundunRefillHPSec, giKundunRefillHP, giKundunRefillHPTime);	// Require Translation

			}

			break;

		case 324:	//121:
			{
				if ( (lpObj->Authority &2 ) != 2 )
				{
					return FALSE;
				}

				LogAddTD("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID,
					lpObj->Name, "ÄïµÐHPȸº¹½Ã°£¼³Á¤");	// Require Translation
				KUNDUN_GM_LOG.Output("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID,
					lpObj->Name, "ÄïµÐHPȸº¹½Ã°£¼³Á¤");	// Require Translation

				int RefillHPTime = this->GetTokenNumber();

				if ( RefillHPTime < 0 || RefillHPTime > 60000 )
				{
					return 0;
				}

				giKundunRefillHPTime = RefillHPTime;

				TNotice pNotice(0);

				pNotice.SendToUser(lpObj->m_Index, "ÄïµÐ HP ÃÊ´çȸº¹·® = %d ȸº¹·® = %d ȸº¹½Ã°£ = %d", giKundunRefillHPSec, giKundunRefillHP, giKundunRefillHPTime);	// Require Translation

			}
			break;
		case 369:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 0);
			break;
		case 370:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 1);
			break;
		case 371:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 2);
			break;
		case 372:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 3);
			break;
		case 373:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 4);
			break;
		case 374:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 5);
			break;
		case 375:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 6);
			break;
		case 376:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 7);
			break;
		case 377:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 8);
			break;
		case 378:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 9);
			break;
		case 379:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 10);
			break;
		case 380:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 11);
			break;
		case 381:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 12);
			break;
		case 382:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 13);
			break;
		case 383:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 14);
			break;
		case 384:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 15);
			break;
		case 385:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 16);
			break;
		case 386:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 17);
			break;
		case 387:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 18);
			break;
		case 388:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 19);
			break;
		case 389:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 20);
			break;
	}
	return 0;
}
示例#14
0
bool OfflineTrade::CheckReq(int UserIndex)
{
	LPOBJ lpUser = &gObj[UserIndex];
	// ----
	if( !lpUser->m_bPShopOpen )
    {
		GCServerMsgStringSend("You need open p. shop to create offline store", UserIndex, 1);
		g_OfflineTradeLog.Output("[%s] [%s] Request aborted - not opened shop", 
			lpUser->AccountID, lpUser->Name);
		return false;
	}
	// ----
	if( lpUser->Level < this->m_ReqLevel )
	{
		GCServerMsgStringSend("Your Level is small to create offline store", UserIndex, 1);
		g_OfflineTradeLog.Output("[%s] [%s] Request aborted - small level (%d / %d)", 
			lpUser->AccountID, lpUser->Name, lpUser->Level, this->m_ReqLevel);
		return false;
	}
	// ----
	if( lpUser->Reset < this->m_ReqReset )
	{
		GCServerMsgStringSend("Your Reset is small to create offline store", UserIndex, 1);
		g_OfflineTradeLog.Output("[%s] [%s] Request aborted - small reset (%d / %d)", 
			lpUser->AccountID, lpUser->Name, lpUser->Reset, this->m_ReqReset);
		return false;
	}
	// ----
	if( lpUser->Money < this->m_Cost[0] )
	{
		GCServerMsgStringSend("You need more Zen to create offline store", UserIndex, 1);
		g_OfflineTradeLog.Output("[%s] [%s] Request aborted - short money (%d / %d)", 
			lpUser->AccountID, lpUser->Name, lpUser->Money, this->m_Cost[0]);
		return false;
	}
	// ----
	if( lpUser->GameShop.WCoinC < this->m_Cost[1] )
	{
		GCServerMsgStringSend("You need more WCoinC to create offline store", UserIndex, 1);
		g_OfflineTradeLog.Output("[%s] [%s] Request aborted - short wcoinc (%d / %d)", 
			lpUser->AccountID, lpUser->Name, lpUser->GameShop.WCoinC, this->m_Cost[1]);
		return false;
	}
	// ----
	if( lpUser->GameShop.WCoinP < this->m_Cost[2] )
	{
		GCServerMsgStringSend("You need more WCoinP to create offline store", UserIndex, 1);
		g_OfflineTradeLog.Output("[%s] [%s] Request aborted - short wcoinp (%d / %d)", 
			lpUser->AccountID, lpUser->Name, lpUser->GameShop.WCoinP, this->m_Cost[2]);
		return false;
	}
	// ----
	if( lpUser->GameShop.GoblinPoint < this->m_Cost[3] )
	{
		GCServerMsgStringSend("You need more GoblinPoint to create offline store", UserIndex, 1);
		g_OfflineTradeLog.Output("[%s] [%s] Request aborted - short wcoing (%d / %d)", 
			lpUser->AccountID, lpUser->Name, lpUser->GameShop.GoblinPoint, this->m_Cost[3]);
		return false;
	}
	// ----
	if( this->m_UseMapList )
	{
		bool RightMap = false;
		// ----
		for( int i = 0; i < MAX_NUMBER_MAP; i++ )
		{
			if( this->m_MapList[i] == lpUser->MapNumber )
			{
				RightMap = true;
				break;
			}
		}
		// ----
		if( !RightMap )
		{
			GCServerMsgStringSend("You can't open offline store on this map", UserIndex, 1);
			g_OfflineTradeLog.Output("[%s] [%s] Request aborted - invalid map (%d)", 
				lpUser->AccountID, lpUser->Name, lpUser->MapNumber);
			return false;
		}
	}
	// ----
	return true;
}
示例#15
0
BOOL NpcTalk(LPOBJ lpNpc, LPOBJ lpObj)
{
	int npcnum = lpNpc->Class;

	if ( npcnum < 0 )
	{
		return FALSE;
	}

	if ( lpObj->m_IfState.use > 0 )
	{
		return TRUE;
	}

	if ( lpObj->CloseCount >= 0 )
	{
		if(ReadConfig.AHLog == TRUE)
		{
			ANTI_HACK_LOG.Output("[ANTI-HACK][NPC] - Try to open NPC during server quit [%s][%s]",
				lpObj->AccountID, lpObj->Name);
		}
		return FALSE;
	}

	if ( lpObj->m_bMapSvrMoveQuit == true || lpObj->m_bMapAntiHackMove == true )
	{
		if(ReadConfig.AHLog == TRUE)
		{
			ANTI_HACK_LOG.Output("[ANTI-HACK][NPC] - Try to open NPC during MapServer Move [%s][%s]",
				lpObj->AccountID, lpObj->Name);
		}
		return FALSE;
	}

	if ( npcnum == 229 ) // Marlon
	{
		gQuestNpcTeleport.TalkRefAdd();
		lpObj->TargetShopNumber = npcnum;
	}

	if ( NpcQuestCheck(lpNpc, lpObj) != FALSE )
	{
		return TRUE;
	}

	switch ( npcnum )
	{
		case 367:
			if ( NpcMainatenceMachine ( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 259:
			if ( NpcReira ( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 254:
			if ( NpcFasi ( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 241:
			if ( NpcGuildMasterTalk( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;
		
		case 239:
			if ( NpcBattleAnnouncer( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 249:
			if ( NpcLorenciaGuard( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 238:
			if ( NpcChaosGoblin( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 237:
			if ( NpcRusipher( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 253:
			if ( NpcPotionsGirl( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 245:
			if ( NpcDeviasWizard( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 247:
			if ( NpcDeviasGuard( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 240:
			if ( NpcWarehouse( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 226:
			if ( NpcDarkSpiritTrainer( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 242:
			if ( NpcNoriaRara( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 244:
			if ( NpcDeviasMadam( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 236:
			if ( NpcEventChipNPC( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 234:
			if ( NpcServerDivision( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 232:
			if ( NpcAngelKing( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 233:
			if ( NpcAngelMessanger( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 255:
			if ( NpcLorenciaMadam( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 250:
			if ( NpcRoadMerchant( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 246:
			if ( NpcDeviasWeapon( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 251:
			if ( NpcLorenciaSmith( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 243:
			if ( NpcNoriJangIn( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 256:
			if ( NpcJewelMixDealer( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 221:
			if ( NpcSiegeMachine_Attack( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 222:
			if ( NpcSiegeMachine_Defense( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 223:
			if ( NpcElderCircle( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 224:
			if ( NpcCastleGuard( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 219:
			if ( NpcCastleGateLever( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 216:
			if ( NpcCastleCrown( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 217:
		case 218:
			if ( NpcCastleSwitch( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 220:
			if ( NpcCastleTrialsGuard( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 566:
		{
			if(ReadConfig.S5E2 == TRUE)
			{
				lpObj->m_IfState.use = 1;
				lpObj->m_IfState.type = 105;
				lpObj->m_IfState.state = 1;
				char sa[12] = {0xC1,0x0C,0xF9,0x01,0x36,0x02,0x00,0x00,0x00,0x00,0x00,0x00};
				::DataSend(lpObj->m_Index ,(UCHAR*)sa, sizeof(sa));
			}
		}break;

		case 567:
		{
			if(ReadConfig.S5E2 == TRUE)
			{
				lpObj->m_IfState.use = 1;
				lpObj->m_IfState.type = 103;
				lpObj->m_IfState.state = 1;
				char sa[12] = {0xC1,0x0C,0xF9,0x01,0x37,0x02,0x00,0x00,0x00,0x00,0x00,0x00};
				::DataSend(lpObj->m_Index ,(UCHAR*)sa, sizeof(sa));
			}
		}break;

		case 568:
		{
			if(ReadConfig.S5E2 == TRUE)
			{
				lpObj->m_IfState.use = 1;
				lpObj->m_IfState.type = 104;
				lpObj->m_IfState.state = 1;
				char sa[12] = {0xC1,0x0C,0xF9,0x01,0x38,0x02,0x00,0x00,0x00,0x00,0x00,0x00};
				::DataSend(lpObj->m_Index ,(UCHAR*)sa, sizeof(sa));
			}
		}break;

		case 257:
			{
				if(ReadConfig.S5E2 == FALSE)
				{
					if ( NpcShadowPhantom(lpObj ) == TRUE )
					{
						return TRUE;
					}
				}else
				{
					lpObj->m_IfState.use = 1;
					lpObj->m_IfState.type = 102;
					lpObj->m_IfState.state = 1;
					char sa[12] = {0xC1,0x0C,0xF9,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00};
					::DataSend(lpObj->m_Index ,(UCHAR*)sa, sizeof(sa));
				}
			}
		break;

		case 368:
		case 369:
		case 370:
			if ( g_kJewelOfHarmonySystem.NpcJewelOfHarmony( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;

		case 375:
			if ( NpcChaosCardMaster( lpNpc, lpObj ) == TRUE )
			{
				return TRUE;
			}
		break;
				
		case 380: //[ILLUSION TEMPLE] STONE STATUE
		{
			IllusionTemple.SelectHero(lpObj,lpObj->MapNumber);
		}break;
		
		case 383: //[ILLUSION TEMPLE] BLUE STORAGE
		{
			IllusionTemple.ReturnGift(lpObj,lpObj->MapNumber-45,npcnum);
		}break;
		
		case 384: //[ILLUSION TEMPLE] ORANGE STORAGE
		{
			IllusionTemple.ReturnGift(lpObj,lpObj->MapNumber-45,npcnum);
		}break;

		case 385:
		{
			if ( NpcAlchemist(lpNpc, lpObj ) == TRUE)
			{
				return TRUE;
			}
		}break;
		
		case 406:
		{
			if ( NpcPriestDevin(lpNpc, lpObj ) == TRUE)
			{
				return TRUE;
			}
		}break;

		case 407:
		{
			if ( NpcWerewolfQuarrel(lpNpc, lpObj ) == TRUE)
			{
				return TRUE;
			}
		}break;
		
		case 408:
		{
			if ( NpcKeepergate(lpNpc, lpObj ) == TRUE)
			{
				return TRUE;
			}
		}break;
#if (PACK_EDITION>=2)
		//case 450:
		//{
		//	if ( SkyEvent.NpcTalk(lpNpc, lpObj ) == TRUE)
		//	{
		//		return TRUE;
		//	}
		//}break;
#endif
		case 468:
		case 469:
		case 470:
		case 471:
		case 474:
#if (PACK_EDITION>=2)
		case 475:
		{
			if ( NpcLittleSanta(lpNpc, lpObj ) == TRUE)
			{
				return TRUE;
			}
		}break;
#endif
		case 479:
		{
			if ( g_DuelManager.NPCTalk_GateKeeper(lpNpc, lpObj)==TRUE )
			{
				return TRUE;
			}
		}break;

		case 478:
		{
			if ( NpcLuckyCoins(lpNpc, lpObj)==TRUE )
			{
				return TRUE;
			}
		}break;

		//case 579:
		//{
		//	if ( NpcLuckyItems(lpNpc, lpObj)==TRUE )
		//	{
		//		return TRUE;
		//	}
		//}break;
#if (PACK_EDITION>=2)
		case 522:
		{
			if ( NpcImperialGuardian(lpNpc, lpObj)==TRUE )
			{
				return TRUE;
			}
		}break;
#endif
#if (PACK_EDITION>=3)
		case 540:
		{
			if ( NpcDoubleGoer(lpNpc, lpObj)==TRUE )
			{
				return TRUE;
			}
		}break;

		case 541:
		{
			g_DoppelGanger.InterimChestOpen(lpObj,lpNpc);
			return TRUE;
		}break;
		case 542:
		{
			g_DoppelGanger.FinalChestOpen(lpObj,lpNpc);
			return TRUE;
		}break;
#endif		
		
#if (PACK_EDITION>=2)
		case 465:
		{
			if (XMasEvent.AllowGifts == 1)
			{
				if(XMasEventItemBoxOpen(lpObj, lpObj->MapNumber, lpObj->X, lpObj->Y) == 0)
				{
					ChatTargetSend(lpNpc, lMsg.Get(MSGGET(14, 114)), lpObj->m_Index);
				} else {
					ChatTargetSend(lpNpc, lMsg.Get(MSGGET(4, 124)), lpObj->m_Index);
					ChatTargetSend(lpNpc, "Ho-Ho-Ho!", lpObj->m_Index);
				}
			} else {
				ChatTargetSend(lpNpc, "XMas Season is Over!", lpObj->m_Index);
			}

			if (XMasEvent.BlessingBuffOnTalk == 1)
			{
				if ( NpcLittleSanta(lpNpc, lpObj ) == TRUE)
				{
					//Do Nothing Either Way
				}
			}
			return TRUE;
		}break;
#endif

		case 543:
		{
			lpObj->m_IfState.use = 1;
			lpObj->m_IfState.type = 100;
			lpObj->m_IfState.state = 1;
			char sa[12] = {0xC1,0x0C,0xF9,0x01,0x1F,0x02,0x00,0x00,0x00,0x00,0x00,0x00};
			DataSend(lpObj->m_Index ,(UCHAR*)sa, sizeof(sa));
		}break;
		case 544:
		{
			lpObj->m_IfState.use = 1;
			lpObj->m_IfState.type = 101;
			lpObj->m_IfState.state = 1;
			char sa[12] = {0xC1,0x0C,0xF9,0x01,0x20,0x02,0x00,0x00,0x00,0x00,0x00,0x00};
			DataSend(lpObj->m_Index ,(UCHAR*)sa, sizeof(sa));
		}break;
	}

	return FALSE;
}
示例#16
0
bool CustomJewels::Apply(LPOBJ lpObj, int source, int target)
{
	char sbuf[1024]={0};
	int TIndex = lpObj->pInventory[target].m_Type;
	int SIndex = lpObj->pInventory[source].m_Type;

	if(source < 0 || source > ReadConfig.MAIN_INVENTORY_SIZE(lpObj->m_Index,false)-1 )
	{
		return false;
	}

	if(target < 0 || target > ReadConfig.MAIN_INVENTORY_SIZE(lpObj->m_Index,false)-1 )
	{
		return false;
	}

	if(lpObj->pInventory[source].IsItem() == 0)
	{
		return false;
	}

	if(lpObj->pInventory[target].IsItem() == 0)
	{
		return false;
	}

	if (lpObj->pInventory[target].m_Type >= ITEMGET(12,0))
	{
		GCServerMsgStringSend("Can not aply this jewel to this item!",lpObj->m_Index, 0x01);
		return false;
	}

	if (!gObjJewelUpHackCheck(lpObj,target))
	{
		GCServerMsgStringSend("[Anti-Hack] Shadow Bug Attempt!",lpObj->m_Index, 0x01);
		if(ReadConfig.AHLog == TRUE)
		{
			ANTI_HACK_LOG.Output("[Anti-Hack][Custom Jewel][%s][%s] Shadow Bug Attempt, Item: %d",
				lpObj->AccountID,lpObj->Name,lpObj->pInventory[target].m_Type);
		}
		return false;
	}

	BYTE jPos = IsJewel(SIndex);
	BYTE jSuccess = GetSuccessPosition(SIndex);
	BYTE jFail = GetFailPosition(SIndex);

	if(jPos == -1)
	{
		LogAddTD("[CJewel] Could not find jewel property with id: %d", SIndex);
		GCServerMsgStringSend("JEWEL ERROR, contact GM!",lpObj->m_Index, 0x01);
		return false;
	}
	if(jSuccess == -1)
	{
		LogAddTD("[CJewel] Could not find jewel success with id: %d", SIndex);
		GCServerMsgStringSend("JEWEL ERROR, contact GM!",lpObj->m_Index, 0x01);
		return false;
	}
	if(jFail == -1)
	{
		LogAddTD("[CJewel] Could not find jewel fail with id: %d", SIndex);
		GCServerMsgStringSend("JEWEL ERROR, contact GM!",lpObj->m_Index, 0x01);
		return false;
	}

	if(lpObj->pInventory[target].m_Level < this->Property[jPos].MinLevel)
	{
		wsprintf(sbuf,"Item level must be higher than %d!",this->Property[jPos].MinLevel);
		GCServerMsgStringSend(sbuf,lpObj->m_Index, 0x01);
		return false;
	}

	if(lpObj->pInventory[target].m_Level > this->Property[jPos].MaxLevel)
	{
		wsprintf(sbuf,"Item level must be lower than %d!",this->Property[jPos].MaxLevel);
		GCServerMsgStringSend(sbuf,lpObj->m_Index, 0x01);
		return false;
	}

	if(lpObj->pInventory[target].m_Z28Option < this->Property[jPos].MinZ28Option)
	{
		wsprintf(sbuf,"Item JOL option minimum is +%d",(this->Property[jPos].MinZ28Option*4));
		GCServerMsgStringSend(sbuf,lpObj->m_Index, 0x01);
		return false;
	}

	if(this->Property[jPos].hasToHaveLuck == -1)
	{
		if (lpObj->pInventory[target].m_LuckOption != 0)
		{
			GCServerMsgStringSend("Item can not have Luck!",lpObj->m_Index, 0x01);
			return false;
		}
	}
	if(this->Property[jPos].hasToHaveLuck > 0)
	{
		if (lpObj->pInventory[target].m_LuckOption == 0)
		{
			GCServerMsgStringSend("Item has to have Luck!",lpObj->m_Index, 0x01);
			return false;
		}
	}

	if(this->Property[jPos].hasToHaveSkill == -1)
	{
		if (lpObj->pInventory[target].m_SkillOption != 0)
		{
			GCServerMsgStringSend("Item can not have Skill!",lpObj->m_Index, 0x01);
			return false;
		}
	}
	if(this->Property[jPos].hasToHaveSkill > 0)
	{
		if (lpObj->pInventory[target].m_SkillOption == 0)
		{
			GCServerMsgStringSend("Item has to have Skill!",lpObj->m_Index, 0x01);
			return false;
		}
	}

	if(this->Property[jPos].hasToBeAncient == -1)
	{
		if (lpObj->pInventory[target].m_SetOption != 0)
		{
			GCServerMsgStringSend("Item can not be Ancient!",lpObj->m_Index, 0x01);
			return false;
		}
	}
	if(this->Property[jPos].hasToBeAncient > 0)
	{
		if (lpObj->pInventory[target].m_SetOption == 0)
		{
			GCServerMsgStringSend("Item must be Ancient!",lpObj->m_Index, 0x01);
			return false;
		}
	}

	if(this->Property[jPos].hasToBeExcellent == -1)
	{
		if (lpObj->pInventory[target].m_NewOption != 0)
		{
			GCServerMsgStringSend("Item can not be Excellent!",lpObj->m_Index, 0x01);
			return false;
		}
	}
	if(this->Property[jPos].hasToBeExcellent > 0)
	{
		if (lpObj->pInventory[target].m_NewOption == 0)
		{
			GCServerMsgStringSend("Item must be Excellent!",lpObj->m_Index, 0x01);
			return false;
		}
	}

	if(this->Property[jPos].MaxExc != 0)
	{
		if(NumOfExcOptions(lpObj->pInventory[target].m_NewOption) >= this->Property[jPos].MaxExc)
		{
			wsprintf(sbuf,"Cant add jewel, you have a lot of excellent options, max opt are %d!",this->Property[jPos].MaxExc);
			GCServerMsgStringSend(sbuf,lpObj->m_Index, 0x01);
			return false;
		}
	}

	if(this->Property[jPos].hasToBeSoketItem == -1)
	{
		if(IsSlotItem(lpObj->pInventory[target].m_Type)==1)
		{
			GCServerMsgStringSend("Item can not be socket item!",lpObj->m_Index, 0x01);
			return false;
		}
	}
	if(this->Property[jPos].hasToBeSoketItem == 1)
	{
		if(IsSlotItem(lpObj->pInventory[target].m_Type)==0)
		{
			GCServerMsgStringSend("This item has to be socket item!",lpObj->m_Index, 0x01);
			return false;
		} else {
			if(this->Property[jPos].MinNumberSokets > 0)
			{
				BYTE counter = 0;

				if (lpObj->pInventory[target].m_ItemSlot1 > 0)
					counter += 1;
				if (lpObj->pInventory[target].m_ItemSlot2 > 0)
					counter += 1;
				if (lpObj->pInventory[target].m_ItemSlot3 > 0)
					counter += 1;
				if (lpObj->pInventory[target].m_ItemSlot4 > 0)
					counter += 1;
				if (lpObj->pInventory[target].m_ItemSlot5 > 0)
					counter += 1;

				if (this->Property[jPos].MinNumberSokets > counter)
				{
					wsprintf(sbuf,"Item minimum socket count is %d",this->Property[jPos].MinNumberSokets);
					GCServerMsgStringSend(sbuf,lpObj->m_Index, 0x01);
					return false;
				}
			}
		}
	}

	if(this->Property[jPos].MaxNumberSokets != 0)
	{
		BYTE counter = 0;

		if (lpObj->pInventory[target].m_ItemSlot1 > 0)
			counter += 1;
		if (lpObj->pInventory[target].m_ItemSlot2 > 0)
			counter += 1;
		if (lpObj->pInventory[target].m_ItemSlot3 > 0)
			counter += 1;
		if (lpObj->pInventory[target].m_ItemSlot4 > 0)
			counter += 1;
		if (lpObj->pInventory[target].m_ItemSlot5 > 0)
			counter += 1;

		if(counter >= this->Property[jPos].MaxNumberSokets)
		{
			wsprintf(sbuf,"Cant add jewel, you have a lot of socket slots, max slot are %d!",this->Property[jPos].MaxNumberSokets);
			GCServerMsgStringSend(sbuf,lpObj->m_Index, 0x01);
			return false;
		}
	}

	//if(MuItemShop.IsCShopItem(aIndex,target) == true)
	//{
	//	GCServerMsgStringSend("You can not use the jewel in this item!",lpObj->m_Index, 0x01);
	//	return true;
	//}

	LogAddTD("[CJewel][%s][%s] Use %s on item %s (%d)",
		lpObj->AccountID,lpObj->Name,lpObj->pInventory[source].GetName(),lpObj->pInventory[target].GetName(),
		lpObj->pInventory[target].m_Number);

	int _r = rand()%100;
	if(_r < this->Property[jPos].Rate )
	{
		//Success
		GCServerMsgStringSend("Jewel Succeded!",lpObj->m_Index, 0x01);
				
		LogAddTD("[CJewel][%s][%s] Success %s on item %s (%d) [%d][%d,%d]",
			lpObj->AccountID,lpObj->Name,lpObj->pInventory[source].GetName(),lpObj->pInventory[target].GetName(),
			lpObj->pInventory[target].m_Number,
			TIndex,_r,this->Property[jPos].Rate);

		if(this->Success[jSuccess].Luck == 1)
		{
			lpObj->pInventory[target].m_LuckOption = 1;
		}
		if(this->Success[jSuccess].Skill == 1)
		{
			lpObj->pInventory[target].m_SkillOption = 1;
		}
		if(this->Success[jSuccess].SetItem == 1)
		{
			lpObj->pInventory[target].m_SetOption = gSetItemOption.GenSetOption(lpObj->pInventory[target].m_Type);
		}
		if(this->Success[jSuccess].Excellent != 63)
		{
			if(this->Success[jSuccess].Excellent > 0) 
			{
				lpObj->pInventory[target].m_NewOption |= this->Success[jSuccess].Excellent;
			}
		}else
		{
			lpObj->pInventory[target].m_NewOption = 63;
		}
		if(this->Success[jSuccess].Level > 0)
		{
			if((lpObj->pInventory[target].m_Level + this->Success[jSuccess].Level) > MAX_ITEM_LEVEL)
			{
				lpObj->pInventory[target].m_Level = MAX_ITEM_LEVEL;
			}else
			{
				lpObj->pInventory[target].m_Level += this->Success[jSuccess].Level;
			}
		}

		if(this->Success[jSuccess].Sokets > 0)
		{
			if ( IsSlotItem(lpObj->pInventory[target].m_Type) )
			{
				for(int k=0;k<this->Success[jSuccess].Sokets;k++)
				{
					if (lpObj->pInventory[target].m_ItemSlot1 == 0)
						lpObj->pInventory[target].m_ItemSlot1 = 0xFF;
					else if (lpObj->pInventory[target].m_ItemSlot2 == 0)
						lpObj->pInventory[target].m_ItemSlot2 = 0xFF;
					else if (lpObj->pInventory[target].m_ItemSlot3 == 0)
						lpObj->pInventory[target].m_ItemSlot3 = 0xFF;
					else if (lpObj->pInventory[target].m_ItemSlot4 == 0)
						lpObj->pInventory[target].m_ItemSlot4 = 0xFF;
					else if (lpObj->pInventory[target].m_ItemSlot5 == 0)
						lpObj->pInventory[target].m_ItemSlot5 = 0xFF;
				}
			}
		}

		if(this->Success[jSuccess].Option > 0)
		{
			if((lpObj->pInventory[target].m_Z28Option + this->Success[jSuccess].Option) > 7)
			{
				lpObj->pInventory[target].m_Z28Option = 7;
			}else
			{
				lpObj->pInventory[target].m_Z28Option += this->Success[jSuccess].Option;
			}
		}
	}
	else
	{
		//Fail
		GCServerMsgStringSend("Jewel Failed!",lpObj->m_Index, 0x01);
		
		LogAddTD("[CJewel][%s][%s] Fail %s on item %s (%d) [%d][%d,%d]",
			lpObj->AccountID,lpObj->Name,lpObj->pInventory[source].GetName(),lpObj->pInventory[target].GetName(),
			lpObj->pInventory[target].m_Number,
			TIndex,_r,this->Property[jPos].Rate);

		if(this->Fail[jFail].Destroy == 1)
		{			
			gObjInventoryItemSet(lpObj->m_Index, target, -1);
			lpObj->pInventory[target].Clear();
			GCInventoryItemDeleteSend(lpObj->m_Index, target, 1);
			return true;
		}
		
		if(this->Fail[jFail].Luck == -1)
		{
			lpObj->pInventory[target].m_LuckOption = 0;
		}
		if(this->Fail[jFail].Skill == -1)
		{
			lpObj->pInventory[target].m_SkillOption = 0;
		}
		if(this->Fail[jFail].SetItem == -1)
		{
			lpObj->pInventory[target].m_SetOption = 0;
		}
		if(this->Fail[jFail].Excellent < 0)
		{
			if(this->Fail[jFail].Excellent == -63)
				lpObj->pInventory[target].m_NewOption = 0;
			else if( (lpObj->pInventory[target].m_NewOption&(this->Fail[jFail].Excellent)) )
				lpObj->pInventory[target].m_NewOption += (this->Fail[jFail].Excellent);

			if(lpObj->pInventory[target].m_NewOption < 0)
				lpObj->pInventory[target].m_NewOption = 0;
		}
		if(this->Fail[jFail].Level < 0)
		{
			if((lpObj->pInventory[target].m_Level + (this->Fail[jFail].Level)) < 0)
			{
				lpObj->pInventory[target].m_Level = 0;
			}else
			{
				lpObj->pInventory[target].m_Level += (this->Fail[jFail].Level);
			}
		}
		if(this->Fail[jFail].Sokets < 0)
		{
			if ( IsSlotItem(lpObj->pInventory[target].m_Type) )
			{
				for(int k=0;k<(this->Fail[jFail].Sokets);k++)
				{
					if (lpObj->pInventory[target].m_ItemSlot5 > 0)
						lpObj->pInventory[target].m_ItemSlot5 = 0x00;
					else if (lpObj->pInventory[target].m_ItemSlot4 > 0)
						lpObj->pInventory[target].m_ItemSlot4 = 0x00;
					else if (lpObj->pInventory[target].m_ItemSlot3 > 0)
						lpObj->pInventory[target].m_ItemSlot3 = 0x00;
					else if (lpObj->pInventory[target].m_ItemSlot2 > 0)
						lpObj->pInventory[target].m_ItemSlot2 = 0x00;
					else if (lpObj->pInventory[target].m_ItemSlot1 > 0)
						lpObj->pInventory[target].m_ItemSlot1 = 0x00;
				}
			}
		}
		if(this->Fail[jFail].Option < 0)
		{
			if((lpObj->pInventory[target].m_Z28Option + (this->Fail[jFail].Option)) < 0)
			{
				lpObj->pInventory[target].m_Z28Option = 0;
			}else
			{
				lpObj->pInventory[target].m_Z28Option += (this->Fail[jFail].Option);
			}
		}
	}

	float levelitemdur = ItemGetDurability(lpObj->pInventory[target].m_Type,lpObj->pInventory[target].m_Level,lpObj->pInventory[target].IsExtItem(),lpObj->pInventory[target].IsSetItem());

	lpObj->pInventory[target].m_Durability = levelitemdur * lpObj->pInventory[target].m_Durability / lpObj->pInventory[target].m_BaseDurability;

	lpObj->pInventory[target].Convert(
			lpObj->pInventory[target].m_Type,
			lpObj->pInventory[target].m_SkillOption,
			lpObj->pInventory[target].m_LuckOption,
			lpObj->pInventory[target].m_Z28Option,
			lpObj->pInventory[target].m_NewOption,
			lpObj->pInventory[target].m_SetOption,
			lpObj->pInventory[target].m_ItemOptionEx,
			CURRENT_DB_VERSION);

	if(g_kJewelOfHarmonySystem.IsStrengthenByJewelOfHarmony(&lpObj->pInventory[target])== 1)
	{
		if(g_kJewelOfHarmonySystem.IsActive(&lpObj->pInventory[target]) == 0)
		{
			GCServerMsgStringSend(lMsg.Get(3370),lpObj->m_Index,1);
		}
	}

	return true;
}
示例#17
0
int CGMMng::ManagementProc(LPOBJ lpObj, char* szCmd, int aIndex)
{
	char * szCmdToken;
	char string[256]={0};
	char szId[20]={0};
	char * pId = szId;
	int len = strlen(szCmd);
	int command_number;

	if ( len < 1 || len > 250 )
	{
		return 0;
	}

	strcpy_s(string, sizeof(string), szCmd);
	szCmdToken = InitTokenString(string);
	command_number = this->GetCmd(szCmdToken);

	switch ( command_number )
	{

        case 331:
        {
                pId = this->GetTokenString();

				if (pId == NULL)
					return 0;

                g_CastleSiege.OperateGmCommand(lpObj->m_Index, 0, pId);
        }
        break;
        case 332:
        {
                pId = this->GetTokenString();

				if (pId == NULL)
					return 0;

                g_CastleSiege.OperateGmCommand(lpObj->m_Index, 1, pId);
        }
        break;
        case 333:
        {
                pId = this->GetTokenString();

				if (pId == NULL)
					return 0;

                g_CastleSiege.OperateGmCommand(lpObj->m_Index, 2, pId);
        }
        break;
        case 334:
        {
                pId = this->GetTokenString();

				if (pId == NULL)
					return 0;

                g_CastleSiege.OperateGmCommand(lpObj->m_Index, 3, pId);
        }
        break;
        case 335:
        {
                pId = this->GetTokenString();

				if (pId == NULL)
					return 0;

                g_CastleSiege.OperateGmCommand(lpObj->m_Index, 4, pId);
        }
        break;
        case 336:
        {
                pId = this->GetTokenString();

				if (pId == NULL)
					return 0;

                g_CastleSiege.OperateGmCommand(lpObj->m_Index, 5, pId);
        }
        break;
        case 337:
        {
                pId = this->GetTokenString();

				if (pId == NULL)
					return 0;

                g_CastleSiege.OperateGmCommand(lpObj->m_Index, 6, pId);
        }
        break;
        case 338:
        {
                pId = this->GetTokenString();

				if (pId == NULL)
					return 0;

                g_CastleSiege.OperateGmCommand(lpObj->m_Index, 7, pId);
        }
        break;
        case 340:
        {
                pId = this->GetTokenString();

				if (pId == NULL)
					return 0;

                g_CastleSiege.OperateGmCommand(lpObj->m_Index, 8, pId);
        }
        break;

		case 217:	//116:
			{
				if ( (lpObj->Authority & 2) != 2 && (lpObj->Authority & 0x20) != 0x20 )
				{
					return 0;
				}

				LogAdd("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s",
					lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "FIRECRACK.");
				int x = lpObj->X;
				int y = lpObj->Y;
				PMSG_SERVERCMD pMsg;

				PHeadSubSetB((LPBYTE)&pMsg,0xF3,0x40, sizeof(pMsg));
				pMsg.CmdType = 0;

				for ( int i=0;i<15;i++)
				{
					pMsg.X = x+Random(0,4)*2 - 4;
					pMsg.Y = y+Random(0,4)*2 - 4;
					MsgSendV2(lpObj,(UCHAR*)&pMsg, sizeof(pMsg));
					::DataSend(lpObj->m_Index ,(UCHAR*)&pMsg, sizeof(pMsg));
				}
			}
			break;

		case 216:	//115:
			{
				if ( (lpObj->Authority & 2) != 2 && (lpObj->Authority & 0x20) != 0x20 )
				{
					return 0;
				}

				pId = this->GetTokenString();

				if ( pId == NULL )
				{
					return 0;
				}

				LPOBJ lpTargetObj = gObjFind(pId);

				if ( lpTargetObj == NULL )
				{
					return 0;
				}

				LogAdd("Use GM Command -> [ %s ]	[ %s ]	[ %s ] / Target : [%s][%s] : %s ",
					lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, lpTargetObj->AccountID,
					lpTargetObj->Name, "User Watching");

				char szTemp[256];

				if ( this->WatchTargetIndex == lpTargetObj->m_Index )
				{
					this->WatchTargetIndex = -1;
					
					wsprintf(szTemp, "%s : Off guard", lpTargetObj->Name);	
					GCServerMsgStringSend(szTemp, lpObj->m_Index, 1);
				}
				else
				{
					wsprintf(szTemp, "%s : Start monitoring", lpTargetObj->Name);	
					GCServerMsgStringSend(szTemp, lpObj->m_Index, 1);
					this->WatchTargetIndex = lpTargetObj->m_Index;
				}
			}
			break;

		case 215:	//114:
			{
				if ( (lpObj->Authority & 2) != 2 && (lpObj->Authority & 0x20) != 0x20 )
				{
					return 0;
				}

				pId = this->GetTokenString();

				if ( pId == NULL )
				{
					return 0;
				}

				int map;
				int iX;
				int iY;
				LPOBJ lpTargetObj = gObjFind(pId);
				int iIndex;

				if ( lpTargetObj == NULL )
				{
					return 0;
				}

				LogAdd("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] / Target : [%s][%s] : %s",
					lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, lpTargetObj->AccountID,
					lpTargetObj->Name, "User Tracking");
				map = lpTargetObj->MapNumber;
				iX = lpTargetObj->X;
				iY = lpTargetObj->Y;
				iIndex = lpObj->m_Index;

				if ( iIndex >= 0 )
				{
					gObjTeleport(iIndex, map, iX, iY);
				}
			}
			break;

		case 214:	//113:
			{
				if ( (lpObj->Authority & 2) != 2 )
				{
					return 0;
				}

				LogAdd("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s",
					lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, 
					"User Stat (connection)");

				int lc151 = 0;
				int lc152 = 400;
				int iTokenNumber = this->GetTokenNumber();

				if ( iTokenNumber > 0 )
				{
					lc151 = iTokenNumber;
				}

				int iTokenNumber2 = this->GetTokenNumber();

				if ( iTokenNumber2 > 0 )
				{
					lc152 = iTokenNumber2;
				}

				gObjSendUserStatistic(lpObj->m_Index, lc151, lc152);
			}
			break;

		case 100:	//100:
			{
				if ( (lpObj->AuthorityCode &4) != 4 )
				{
					return 0;
				}

				pId = this->GetTokenString();

				if ( pId == NULL )
				{
					return 0;
				}

				int iTargetIndex = gObjGetIndex(pId);
				
				if ( iTargetIndex == -1)
					iTargetIndex=0;

				if ( iTargetIndex >= 0 )
				{
					LPOBJ lpTargetObj = gObjFind(pId);

					if ( lpTargetObj == NULL )
					{
						return 0;
					}

					LogAdd("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] / Target : [%s][%s] : %s",
						lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, lpTargetObj->AccountID,
						lpTargetObj->Name, "User Disconnect");
					LogAdd("%s is forced to disconnect.", pId);
					CloseClient(iTargetIndex);
				}
			}
			break;

		case 112:	//108:
			{
				if ( (lpObj->AuthorityCode &4) != 4 )
				{
					return 0;
				}

				LogAdd("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s",
					lpObj->Ip_addr, lpObj->AccountID, lpObj->Name,
					"Guild Disconnect");

				pId = this->GetTokenString();

				if ( pId == NULL )
				{
					return 0;
				}

				_GUILD_INFO_STRUCT * lpGuild = Guild.SearchGuild(pId);
				int iIndex;

				if ( lpGuild != NULL )
				{
					for ( int i=0;i<MAX_USER_GUILD ; i++ )
					{
						if ( lpGuild->Index[i] >= 0 )
						{
							iIndex = lpGuild->Index[i];

							if ( iIndex >= 0 )
							{
								LogAdd("%s is forced to disconnect.", pId);
								CloseClient(iIndex);
							}
						}
					}
				}
			}
			break;

		case 101:	//101: /move
			{
				char* map_name=this->GetTokenString();

				if (map_name == NULL)
					return 0;

				int iTokenNumber1 = this->GetTokenNumber();

				if ( (lpObj->AuthorityCode &8) == 8 && iTokenNumber1 != -1)
				{

					int iTokenNumber2 = this->GetTokenNumber();
					int iTokenNumber3 = this->GetTokenNumber();

					if (iTokenNumber2 == -1)
						iTokenNumber2 = 0;

					if (iTokenNumber3 == -1)
						iTokenNumber3 = 0;

					int iIndex = gObjGetIndex(map_name);

					if ( iIndex >= 0 )
					{
						LPOBJ lpTargetObj = gObjFind(map_name);

						if ( lpTargetObj == NULL )
						{
							return 0;
						}

						LogAdd("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] / Target : [%s][%s] : %s",
							lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, lpTargetObj->AccountID,
							lpTargetObj->Name, "User SetPosition");

						gObjTeleport(iIndex, iTokenNumber1, iTokenNumber2, iTokenNumber3);
					}
				}
				else
				{

					int lc165 = -1;
					int lc166 = 0;
					int lc167 = 0;

					if ( lpObj->Teleport != 0 )
					{
						GCServerMsgStringSend("You are currently not able to warp.", lpObj->m_Index, 1);
						return 0;
					}

					if ( (lpObj->m_IfState.use) != 0 )
					{
						if ( lpObj->m_IfState.type  == 3 )
						{
							lpObj->TargetShopNumber = -1;
							lpObj->m_IfState.type = 0;
							lpObj->m_IfState.use = 0;
						}
					}

					if ( lpObj->m_IfState.use > 0 )
					{
						GCServerMsgStringSend("You are currently not able to warp.", lpObj->m_Index, 1);
						return 0;
					}

					if ( gObj[aIndex].IsInBattleGround != false )
					{
						GCServerMsgStringSend("You are currently not able to warp.", lpObj->m_Index, 1);
						return 0;
					}

					if ( lpObj->m_PK_Level >= gPKLvlToCantWarp )
					{
						GCServerMsgStringSend("An outlaw cannot use the /warp command. ", lpObj->m_Index, 1);
						return 0;
					}

					gMoveCommand.Move(lpObj, map_name);
				}
			}
			break;

		case 108:	//104:
			{
				if ( (lpObj->AuthorityCode &8)!= 8 )
				{
					return 0;
				}

				LogAdd("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s",
					lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, 
					"Guild SetPosition");

				pId = this->GetTokenString();

				if ( pId == NULL )
				{
					return 0;
				}

				int iTokenNumber1 = this->GetTokenNumber();
				int iTokenNumber2 = this->GetTokenNumber();
				int iTokenNumber3 = this->GetTokenNumber();

				if (iTokenNumber1 == -1)
					iTokenNumber1 = 0;

				if (iTokenNumber2 == -1)
					iTokenNumber2 = 0;

				if (iTokenNumber3 == -1)
					iTokenNumber3 = 0;

				_GUILD_INFO_STRUCT* lpGuild = Guild.SearchGuild(pId);
				int iIndex;

				if ( lpGuild != NULL )
				{
					for ( int i=0;i<MAX_USER_GUILD;i++)
					{
						if (lpGuild->Index[i] >= 0 )
						{
							iIndex = lpGuild->Index[i];
							gObjTeleport(iIndex, iTokenNumber1, iTokenNumber2++, iTokenNumber3);
						}
					}
				}
			}
			break;

		case 109:	//105:
			{
				if ( (lpObj->Authority &2)== 2 )
				{
					LogAdd("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s",
						lpObj->Ip_addr, lpObj->AccountID, lpObj->Name,
						"Start BattleSoccer");

					BattleSoccerGoalStart(0);
				}
			}
			break;

		case 110:	//106:
			{
				if ( (lpObj->Authority &2) == 2 )
				{
					LogAdd("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s",
						lpObj->Ip_addr, lpObj->AccountID, lpObj->Name,
						"Stop BattleSoccer");

					BattleSoccerGoalEnd(0);
				}
				else
				{
					if ( gObj[aIndex].lpGuild != NULL )
					{
						if (gObj[aIndex].lpGuild->WarType == 1 )
						{
							strcmp(gObj[aIndex].Name, gObj[aIndex].lpGuild->Names[0] );
						}
					}
				}
			}

			break;

		case 111:	//107:
			{
				if ( (lpObj->Authority & 2) == 2 )
				{
					LogAdd("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s",
						lpObj->Ip_addr, lpObj->AccountID, lpObj->Name, "End GuildWar");

					char * szGuild = this->GetTokenString();

					if ( szGuild != NULL )
					{
						GCManagerGuildWarEnd(szGuild);
					}
				}
				else
				{
					if ( gObj[aIndex].lpGuild != NULL && gObj[aIndex].lpGuild->lpTargetGuildNode != NULL)
					{
						if ( strcmp( gObj[aIndex].Name, gObj[aIndex].lpGuild->Names[0] ) ==  0)
						{
							if ( gObj[aIndex].lpGuild->BattleGroundIndex >= 0 && gObj[aIndex].lpGuild->WarType == 1 )
							{
								::gObjAddMsgSendDelay(&gObj[aIndex], 7, aIndex, 10000, 0);

								char szTemp[100];

								wsprintf(szTemp, "Because of %s's request, the match will end automatically in 10 seconds", gObj[aIndex].lpGuild->Names[0] );
								::GCServerMsgStringSendGuild(gObj[aIndex].lpGuild, szTemp, 1);
								::GCServerMsgStringSendGuild(gObj[aIndex].lpGuild->lpTargetGuildNode, szTemp, 1);
							}
						}
					}
				}
			}
			break;

		case 104:	//102:
			{
				if ( (lpObj->AuthorityCode&0x20 ) != 0x20 )
				{
					return FALSE;
				}

				LogAdd("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID,
					lpObj->Name, "Ban Chatting");

				pId = this->GetTokenString();

				if ( pId == NULL )
				{
					return FALSE;
				}

				int Index = ::gObjGetIndex(pId);

				if ( Index >= 0 )
				{
					gObj[Index].Penalty |= 2;
				}

			}
			break;

		case 106:	//103:
			{
				if ( (lpObj->AuthorityCode & 32 ) != 32 )
				{
					return FALSE;
				}

				LogAdd("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID,
					lpObj->Name, "Free Ban-Chatting");

				pId = this->GetTokenString();

				if ( pId == NULL )
				{
					return FALSE;
				}

				int Index = ::gObjGetIndex(pId);

				if ( Index >= 0 )
				{
					gObj[Index].Penalty &= ~2;
				}
			}
			break;

		case 200:	//109:
			{
				pId = this->GetTokenString();

				if ( pId != NULL )
				{
					if ( strlen(pId) >= 1 )
					{
						::GCGuildWarRequestResult(pId, aIndex, 0);
					}
				}
			}

			break;

		case 202:	//111:
			{
				if ( (lpObj->Authority & 2 ) == 2 )
				{
					LogAdd("Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID,
						lpObj->Name, "Set GuildWar");
		
					pId = this->GetTokenString();

					if ( pId != NULL )
					{
						char * Rival = this->GetTokenString();

						if ( Rival != NULL )
						{
							if ( strlen(pId) >= 1 )
							{
								if ( strlen(Rival) >= 1 )
								{
									::GCManagerGuildWarSet(pId, Rival, 1);
								}
							}
						}
					}
				}
				else
				{
					if ( gEnableBattleSoccer != FALSE )
					{
						pId = this->GetTokenString();

						if ( pId != NULL )
						{
							if ( strlen(pId) >= 1 )
							{
								::GCGuildWarRequestResult(pId, aIndex, 1);
							}
						}
					}
				}
			}

			break;

		case 201:	//110:
			{
				gObjBillRequest(&gObj[aIndex]);
			}
			break;

		case 203:	//112:
			{
				pId = this->GetTokenString();

				if ( pId != NULL )
				{
					BOOL bState;

					if ( strcmp(pId, "on" ) == 0 )
					{
						bState = TRUE;
					}
					else if ( strcmp(pId, "off") == 0 )
					{
						bState = FALSE;
					}

					if ( bState >= FALSE && bState <= TRUE )
					{
						::gObjSetTradeOption(aIndex, bState);
						::gObjSetDuelOption(aIndex, bState);
					}
				}
			}
			break;

		case 320:	//117:
			{
				if ( (lpObj->Authority &2) != 2 )
				{
					return FALSE;
				}

				LogAdd("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID,
					lpObj->Name, "View the status of kundun");	
				KUNDUN_GM_LOG.Output("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID,
					lpObj->Name, "View the status of kundun");	

				for ( int n=0;n<MAX_VIEWPORT;n++)
				{
					if ( lpObj->VpPlayer[n].state != 0 )
					{
						if ( lpObj->VpPlayer[n].type == OBJ_MONSTER )
						{
							if ( lpObj->VpPlayer[n].number >= 0 )
							{
								LPOBJ lpTarget = &gObj[lpObj->VpPlayer[n].number];

								if ( lpTarget->Class == 275 )
								{
									TNotice pNotice(1);

									pNotice.SendToUser(lpObj->m_Index, "Kundun HP = %7.0f / %7.0f", lpTarget->Life, lpTarget->MaxLife); 
									pNotice.SendToUser(lpObj->m_Index, "Kundun RefillHP/Sec = %d RefillHP = %d RefillHPTime = %d", giKundunRefillHPSec, giKundunRefillHP, giKundunRefillHPTime);	// Require Translation
								}
							}
						}
					}
				}

			}
			break;

		case 321:	//118:
			{
				if ( (lpObj->Authority &2 ) != 2 )
				{
					return FALSE;
				}

				LogAdd("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID,
					lpObj->Name, "쿤둔HP설정");	// Require Translation
				KUNDUN_GM_LOG.Output("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID,
					lpObj->Name, "쿤둔HP설정");	// Require Translation

				int iLife = this->GetTokenNumber();

				if (iLife == -1)
					iLife = 0;

				for ( int n=0;n<MAX_VIEWPORT;n++)
				{
					if ( lpObj->VpPlayer[n].state != FALSE )
					{
						if ( lpObj->VpPlayer[n].type == OBJ_MONSTER )
						{
							if ( lpObj->VpPlayer[n].number >= 0 )
							{
								LPOBJ lpTarget = &gObj[lpObj->VpPlayer[n].number];

								if ( lpTarget->Class == 275 )
								{
									if  ( iLife <= 5000 )
									{
										iLife = 5000 ;
									}

									if ( iLife > lpTarget->MaxLife )
									{
										iLife = (int)lpTarget->MaxLife;
									}

									lpTarget->Life = iLife;
								
									TNotice pNotice(1);

									pNotice.SendToUser(lpObj->m_Index, "쿤둔 HP = %7.0f / %7.0f", lpTarget->Life, lpTarget->MaxLife); //Require Translation
								}
							}
						}
					}
				}
			}
			break;

		case 322:	//119:
			{
				if ( (lpObj->Authority &2 ) != 2 )
				{
					return FALSE;
				}

				LogAdd("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID,
					lpObj->Name, "쿤둔HP회복량설정");	// Require Translation
				KUNDUN_GM_LOG.Output("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID,
					lpObj->Name, "쿤둔HP회복량설정");	// Require Translation

				int RefillHP = this->GetTokenNumber();

				if ( RefillHP <= 0 || RefillHP > 5000000 )
				{
					return 0;
				}

				giKundunRefillHP = RefillHP;

				TNotice pNotice(0);

				pNotice.SendToUser(lpObj->m_Index, "쿤둔 HP 초당회복량 = %d 회복량 = %d 회복시간 = %d", giKundunRefillHPSec, giKundunRefillHP, giKundunRefillHPTime);	// Require Translation

			}

			break;

		case 323:	//120:
			{
				if ( (lpObj->Authority &2 ) != 2 )
				{
					return FALSE;
				}

				LogAdd("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID,
					lpObj->Name, "쿤둔HP초당회복량설정");	// Require Translation
				KUNDUN_GM_LOG.Output("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID,
					lpObj->Name, "쿤둔HP초당회복량설정");	// Require Translation

				int RefillHPSec = this->GetTokenNumber();

				if ( RefillHPSec <= 0 || RefillHPSec > 10000 )
				{
					return 0;
				}

				giKundunRefillHPSec = RefillHPSec;

				TNotice pNotice(0);

				pNotice.SendToUser(lpObj->m_Index, "쿤둔 HP 초당회복량 = %d 회복량 = %d 회복시간 = %d",
					giKundunRefillHPSec, giKundunRefillHP, giKundunRefillHPTime);	// Require Translation

			}

			break;

		case 324:	//121:
			{
				if ( (lpObj->Authority &2 ) != 2 )
				{
					return FALSE;
				}

				LogAdd("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID,
					lpObj->Name, "쿤둔HP회복시간설정");	// Require Translation
				KUNDUN_GM_LOG.Output("[KUNDUN] Use GM Command -> [ %s ]\t[ %s ]\t[ %s ] : %s", lpObj->Ip_addr, lpObj->AccountID,
					lpObj->Name, "쿤둔HP회복시간설정");	// Require Translation

				int RefillHPTime = this->GetTokenNumber();

				if ( RefillHPTime < 0 || RefillHPTime > 60000 )
				{
					return 0;
				}

				giKundunRefillHPTime = RefillHPTime;

				TNotice pNotice(0);

				pNotice.SendToUser(lpObj->m_Index, "쿤둔 HP 초당회복량 = %d 회복량 = %d 회복시간 = %d", giKundunRefillHPSec, giKundunRefillHP, giKundunRefillHPTime);	// Require Translation

			}
			break;
 
		case 345:
			g_Crywolf.OperateGmCommand(lpObj->m_Index, 1);
			break;
		case 346:
			g_Crywolf.OperateGmCommand(lpObj->m_Index, 2);
			break;
		case 347:
			g_Crywolf.OperateGmCommand(lpObj->m_Index, 3);
			break;
		case 348:
			g_Crywolf.OperateGmCommand(lpObj->m_Index, 0);
			break;

		case 369:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 0);
			break;
		case 370:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 1);
			break;
		case 371:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 2);
			break;
		case 372:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 3);
			break;
		case 373:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 4);
			break;
		case 374:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 5);
			break;
		case 375:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 6);
			break;
		case 376:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 7);
			break;
		case 377:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 8);
			break;
		case 378:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 9);
			break;
		case 379:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 10);
			break;
		case 380:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 11);
			break;
		case 381:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 12);
			break;
		case 382:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 13);
			break;
		case 383:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 14);
			break;
		case 384:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 15);
			break;
		case 385:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 16);
			break;
		case 386:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 17);
			break;
		case 387:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 18);
			break;
		case 388:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 19);
			break;
		case 389:
			g_Kanturu.OperateGmCommand(lpObj->m_Index, 20);
			break;
	    case 390:
        {
                if ( (lpObj->Authority &2 ) != 2 )
                {
                        return FALSE;
                }

                int type, index,ItemLevel,ItemSkill,ItemLuck,ItemOpt,ItemExc,ItemAncient;
                type = GetTokenNumber();
                index = GetTokenNumber();
                ItemLevel = GetTokenNumber();
                ItemSkill = GetTokenNumber();
                ItemLuck = GetTokenNumber();
                ItemOpt = GetTokenNumber();
                ItemExc = GetTokenNumber();
                ItemAncient = GetTokenNumber();

				if (type == -1)
					type = 0;
                
				if (index == -1)
					index = 0;

				if (ItemLevel == -1)
					ItemLevel = 0;

				if (ItemSkill == -1)
					ItemSkill = 0;

				if (ItemLuck == -1)
					ItemLuck = 0;

				if (ItemOpt == -1)
					ItemOpt = 0;

				if (ItemExc == -1)
					ItemExc = 0;

				if (ItemAncient == -1)
					ItemAncient = 0;

                if( (type >= 0 && type <= 15) )
                {
					int Item = ItemGetNumberMake( type, index);
					ItemSerialCreateSend(aIndex, gObj[aIndex].MapNumber, (BYTE)gObj[aIndex].X, (BYTE)gObj[aIndex].Y, Item,ItemLevel,0,ItemSkill,ItemLuck,ItemOpt,-1,ItemExc,ItemAncient);
                }
                break;
        }
        case 391:
        {
                int value = GetTokenNumber();

				if (value == -1)
					value = 0;

                g_Crywolf.OperateGmCommand(lpObj->m_Index,value);
        }
        break;

	}
	return 0;
}