Exemple #1
0
BOOL NpcGuildMasterTalk(LPOBJ lpNpc, LPOBJ lpObj)
{
	if ( gGuildCreate == FALSE )
	{
		ChatTargetSend(lpNpc, "Creation of the guild is DISABLED!", lpObj->m_Index);
		return TRUE;
	}

	if ( lpObj->GuildNumber > 0 )
	{
		ChatTargetSend(lpNpc, lMsg.Get(MSGGET(4, 116)), lpObj->m_Index);
		return TRUE;
	}

	int capacity = gObjGuildMasterCapacityTest(lpObj);

	if ( capacity == 0 )
	{
		ChatTargetSend(lpNpc, lMsg.Get(MSGGET(4, 117)), lpObj->m_Index);
	}
	else if ( capacity == 2 )
	{
		char buf[100]={0};
		wsprintf(buf,"You need at least %d resets",ReadConfig.ResetReq_NpcGuildMasterTalk);
		ChatTargetSend(lpNpc, buf, lpObj->m_Index);
		GCServerMsgStringSend(buf,lpObj->m_Index, 0x01);
	}
	else
	{
		GCGuildMasterQuestionSend(lpObj->m_Index);
	}

	return TRUE;
}
Exemple #2
0
BOOL NpcGuildMasterTalk(LPOBJ lpNpc, LPOBJ lpObj)
{
	if ( gGuildCreate == FALSE )
	{
		ChatTargetSend(lpNpc, "서버분할 기간에는 길드를 생성할수가 없습니다", lpObj->m_Index);
		return TRUE;
	}

	if ( lpObj->GuildNumber > 0 )
	{
		ChatTargetSend(lpNpc, lMsg.Get(MSGGET(4, 116)), lpObj->m_Index);
		return TRUE;
	}

	int capacity = gObjGuildMasterCapacityTest(lpObj);

	if ( capacity == 0 )
	{
		ChatTargetSend(lpNpc, lMsg.Get(MSGGET(4, 117)), lpObj->m_Index);
	}
	else if ( capacity == 2 )
	{
		ChatTargetSend(lpNpc, lMsg.Get(MSGGET(4, 118)), lpObj->m_Index);
	}
	else
	{
		GCGuildMasterQuestionSend(lpObj->m_Index);
	}

	return TRUE;
}
Exemple #3
0
BOOL NpcFasi(LPOBJ lpNpc, LPOBJ lpObj)
{
	if ( gDevilSquareEvent != FALSE )
	{
		GCServerCmd(lpObj->m_Index, 1, 6, 0);
	}

	if ( lpObj->m_PK_Level > 4 )
	{
		if ( PvP.gPkLimitFree == FALSE )
		{
			int numbertext = rand() % 3;

			switch ( numbertext )
			{
				case 0:
					ChatTargetSend(lpNpc, lMsg.Get(MSGGET(4, 98)), lpObj->m_Index);
					break;

				case 1:
					ChatTargetSend(lpNpc, lMsg.Get(MSGGET(4, 99)), lpObj->m_Index);
					break;

				case 2:
					ChatTargetSend(lpNpc, lMsg.Get(MSGGET(4, 100)), lpObj->m_Index);
					break;
			}

			lpNpc->TargetNumber = -1;	// Apply Deathway Fix, change 0 to -1;
			return TRUE;
		}
	}

	return FALSE;
}
Exemple #4
0
BOOL NpcFasi(LPOBJ lpNpc, LPOBJ lpObj)
{
	if ( gLanguage != 0 )
	{
		if ( gDevilSquareEvent != FALSE )
		{
			GCServerCmd(lpObj->m_Index, 1, 6, 0);
		}
	}

	if ( lpObj->m_PK_Level > 4 )
	{
		int hour = 0;
		int min = 0;

		if ( lpNpc->TargetNumber != lpObj->m_Index )
		{
			if ( gObjGetPkTime(lpObj, hour, min) == TRUE )
			{
				char szTemp[100];

				wsprintf(szTemp, lMsg.Get(MSGGET(4, 79)), hour, min);

				ChatTargetSend(lpNpc, szTemp, lpObj->m_Index);

				lpNpc->TargetNumber = lpObj->m_Index;

				/*if ( gPkLimitFree == FALSE )
				{
					return TRUE;
				}*/
			}
		}
		else if ( gPkLimitFree == FALSE )
		{
			int numbertext = rand() % 3;

			switch ( numbertext )
			{
				case 0:
					ChatTargetSend(lpNpc, lMsg.Get(MSGGET(4, 98)), lpObj->m_Index);
					break;

				case 1:
					ChatTargetSend(lpNpc, lMsg.Get(MSGGET(4, 99)), lpObj->m_Index);
					break;

				case 2:
					ChatTargetSend(lpNpc, lMsg.Get(MSGGET(4, 100)), lpObj->m_Index);
					break;
			}

			lpNpc->TargetNumber = 0;	// Apply Deathway Fix, change 0 to -1;
			return TRUE;
		}
	}

	return FALSE;
}
void CHatcheryEvent::Npc(int aIndex,int Monster)
{
	if(!(this->m_HatcheryEvent.m_EventState == STATE_OPEN))
	{			
		if(this->m_HatcheryEvent.m_EventState == STATE_CLOSED) 
		{
			ChatTargetSend(&gObj[Monster], "Hatchery is closed now, try again later.", aIndex);
		} 
		else 
		{	
			ChatTargetSend(&gObj[Monster], "Hatchery is running now, try again later.", aIndex);
		}
	}
	else
	{	
		for (int i = 0; i < this->m_HatcheryEvent.m_UserCount; i++)
		{
			if(this->m_HatcheryEvent.m_UserIndex[i] == aIndex)
			{
				gObjTeleport(aIndex,5,160,25);
				return;
			}
		}

		if(this->m_HatcheryEvent.m_UserCount >= MAX_PLAYERCOUNT)
		{
			ChatTargetSend(&gObj[Monster], "Hatchery is already full!", aIndex);
			return;
		}

		if(AddTab[aIndex].m_Resets < MIN_RESET)
		{
			ChatTargetSend(&gObj[Monster], "You need minimum 1 reset to join!", aIndex);
			return;
		}

		if(this->CheckTicket(aIndex) == 0)
		{
			ChatTargetSend(&gObj[Monster],"You don't have Hatchery Key.",aIndex);
			return;
		}

		this->m_HatcheryEvent.m_UserIndex[this->m_HatcheryEvent.m_UserCount] = aIndex;
		this->m_HatcheryEvent.m_UserLevel[this->m_HatcheryEvent.m_UserCount] = gObj[aIndex].Level;
		this->m_HatcheryEvent.m_UserDefense[this->m_HatcheryEvent.m_UserCount] = gObj[aIndex].m_Defense;
		this->m_HatcheryEvent.m_UserDamageMin[this->m_HatcheryEvent.m_UserCount] = (gObj[aIndex].Dexterity + gObj[aIndex].Strength + gObj[aIndex].Vitality + gObj[aIndex].Energy) / 25; // NEW
		this->m_HatcheryEvent.m_UserDamageMax[this->m_HatcheryEvent.m_UserCount] = (gObj[aIndex].Dexterity + gObj[aIndex].Strength + gObj[aIndex].Vitality + gObj[aIndex].Energy) / 20; // NEW
		this->m_HatcheryEvent.m_UserCount++;

		gObjTeleport(aIndex,5,160,25);
		gObj[aIndex].MapNumber = 3;
		Log.Info("[HatcheryEvent] (%s)(%s) Registred User", gObj[aIndex].AccountID, gObj[aIndex].Name);
	}
}
Exemple #6
0
void CCrywolfUtil::SendCrywolfChattingMsg(int iObjIndex, LPSTR lpszMsg, ...)
{
	return;

	if( !OBJMAX_RANGE(iObjIndex) )
		return;

	LPOBJ lpObj = &gObj[iObjIndex];
	char szBuffer[512];
	va_list pArguments;

	va_start(pArguments, lpszMsg);
	vsprintf(szBuffer, lpszMsg, pArguments);
	va_end(pArguments);

	char szChat[60];

	strncpy(szChat,szBuffer,59);

	for (int i;i<MAX_VIEWPORT_MONSTER;i++)
	{
		if ( lpObj->VpPlayer2[i].state != FALSE )
		{
			int iTargetNumber = lpObj->VpPlayer2[i].number;

			if ( OBJMAX_RANGE(iTargetNumber) != FALSE )
			{
				ChatTargetSend(lpObj, szChat, iTargetNumber);
			}
		}
	}
}
Exemple #7
0
BOOL NpcCastleGuard(LPOBJ lpNpc, LPOBJ lpObj) //GS-CS Decompiled 100%
{
	if ( (lpObj->m_IfState.use ) > 0 )
	{
		return TRUE;
	}

#if(GS_CASTLE==1)
	if(g_CastleSiege.GetCastleState() == 7)
	{
		ChatTargetSend(lpNpc,(lMsg.Get(MSGGET(6, 87))), lpObj->m_Index);
		return TRUE;
	}
#endif

	PMSG_TALKRESULT pMsg;

	pMsg.h.c = 0xC3;
	pMsg.h.headcode = 0x30;
	pMsg.h.size = sizeof(pMsg);
	pMsg.result = 0x0D;

	DataSend(lpObj->m_Index, (LPBYTE)&pMsg, pMsg.h.size);

	lpObj->m_IfState.use = 1;
	lpObj->m_IfState.type = 12;


	return TRUE;
}
void TMonsterAIUtil::SendChattingMsg(int iObjIndex, char* lpszMsg, ...)
{
	if ( !lpszMsg )
		return;

	if ( !OBJMAX_RANGE(iObjIndex))
		return;

	LPOBJ lpObj = &gObj[iObjIndex];
	char szBuffer[512] = "";
	va_list pArguments;

	va_start(pArguments, lpszMsg);
	vsprintf(szBuffer, lpszMsg, pArguments);
	va_end(pArguments);

	char szChat[MAX_CHAT_LEN] = {0};
	memcpy(szChat, szBuffer, sizeof(szChat)-1);

	for(int i=0;i<MAX_VIEWPORT_MONSTER;i++)
	{
		if ( lpObj->VpPlayer2[i].state )
		{
			int tObjNum = lpObj->VpPlayer2[i].number;

			if ( OBJMAX_RANGE(tObjNum) )
			{
				ChatTargetSend(lpObj, szChat, tObjNum);
			}
		}
	}
}
void NPCMessage(int IndexPlayer, LPOBJ mObj, char* Msg,...)
{						 
	Messages1[0] = 0;
	va_list pArguments1;
	va_start(pArguments1, Msg);
	vsprintf_s(Messages1, Msg, pArguments1);
	va_end(pArguments1);

	ChatTargetSend(mObj, Messages1, IndexPlayer);
}
void NPCMessageLog(sColor LogColor, sLogType LogType, LPOBJ gObj, LPOBJ mObj, char* Msg,...)
{						  
	Messages1[0] = 0;
	va_list pArguments1;
	va_start(pArguments1, Msg);
	vsprintf_s(Messages1, Msg, pArguments1);
	va_end(pArguments1);

	ChatTargetSend(mObj, Messages1, gObj->m_Index); 
	Log.ConsoleOutPut(1, LogColor, LogType, "[%s]: %s", gObj->Name, Messages1);
}
BOOL NpcGuildMasterTalk(LPOBJ lpNpc, LPOBJ lpObj)
{
#if (__GENS_SYSTEM__ == 1)

	if( lpObj->m_GensInfo.btFamily == GENS_NONE )
	{
		MsgOutput(lpObj->m_Index,"You are not a member of any gens clan!");
		return TRUE;
	}

#endif

	if ( gGuildCreate == FALSE )
	{
		ChatTargetSend(lpNpc, "Guild creation is disabled!", lpObj->m_Index);
		return TRUE;
	}

	if ( lpObj->GuildNumber > 0 )
	{
		ChatTargetSend(lpNpc, lMsg.Get(MSGGET(4, 116)), lpObj->m_Index);
		return TRUE;
	}

	int capacity = gObjGuildMasterCapacityTest(lpObj);

	if ( capacity == 0 )
	{
		ChatTargetSend(lpNpc, lMsg.Get(MSGGET(4, 117)), lpObj->m_Index);
	}
	else if ( capacity == 2 )
	{
		ChatTargetSend(lpNpc, lMsg.Get(MSGGET(4, 118)), lpObj->m_Index);
	}
	else
	{
		GCGuildMasterQuestionSend(lpObj->m_Index);
	}

	return TRUE;
}
void NPCMessageNear(LPOBJ mObj, char* Msg,...)
{						   
	Messages1[0] = 0;
	va_list pArguments1;
	va_start(pArguments1, Msg);
	vsprintf_s(Messages1, Msg, pArguments1);
	va_end(pArguments1);

	for(int i = OBJECT_MIN; i <= OBJECT_MAX; i++)
	{						   
		OBJECTSTRUCT *gObj = (OBJECTSTRUCT*)OBJECT_POINTER(i);	   
		if(gObj->Connected < 3) continue; 	   
		if(mObj->MapNumber != gObj->MapNumber) continue;	 		 
		if(mObj->X <= gObj->X-10 || mObj->X >= gObj->X+10) continue;
		if(mObj->Y <= gObj->Y-10 || mObj->Y >= gObj->Y+10) continue;
		ChatTargetSend(mObj, Messages1, i);
	}
}
void CKanturuUtil::SendKanturuChattingMsg(int iIndex, LPSTR lpMsg, ...)
{
	return;
	LPOBJ lpObj;
	char szChat[512];

	for ( int iCount=0;iCount<MAX_VIEWPORT_MONSTER;iCount++)
	{
		if ( lpObj->VpPlayer2[iCount].state )
		{
			int number = lpObj->VpPlayer2[iCount].number;

			if ( number >= 0 || number < OBJMAX )
			{
				ChatTargetSend(lpObj, szChat, number);
			}
		}
	}
}
Exemple #14
0
BOOL ObjBotReward::TradeOpen(int index, int nindex)
{
	if ( gObjIsConnectedGP(index) == FALSE )
	{
		LogAddC(2, "error-L3 [%s][%d]", __FILE__, __LINE__);
		return 0;
	}
	if(gObjIsConnected(nindex) == 0)
	{
		return 0;
	}

	int number = this->GetBotIndex(nindex);
	if(number == -1)
		return 0;

	GetPlayerExtraInfo(index,SCFExDB_GSSend_GetBotReward);
	ChatTargetSend(&gObj[this->bot.index],"Wait, i will check i have some reward for you!",index);
	return 1;
}
void CCrywolfUtil::SendCrywolfChattingMsg(int iObjIndex, LPSTR lpszMsg, ...)
{
	return;

	LPOBJ lpObj;
	char szBuffer[512];
	va_list pArguments;
	char szChat[60];

	for (int i;i<MAX_VIEWPORT_MONSTER;i++)
	{
		if ( lpObj->VpPlayer2[i].state != FALSE )
		{
			int iTargetNumber = lpObj->VpPlayer2[i].number;

			if ( OBJMAX_RANGE(iTargetNumber) != FALSE )
			{
				ChatTargetSend(lpObj, szChat, iTargetNumber);
			}
		}
	}
}
Exemple #16
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;
}
BOOL NpcElderCircle(LPOBJ lpNpc, LPOBJ lpObj)
{
#if (GS_CASTLE == 1)
	if ( (lpObj->m_IfState.use ) > 0 )
	{
		return TRUE;
	}

	if( g_CastleSiege.GetCastleState() == CASTLESIEGE_STATE_STARTSIEGE)
	{
		ChatTargetSend(lpNpc,lMsg.Get(MSGGET(6,85)),lpObj->m_Index);
		return TRUE;
	}

	if( strcmp(lpObj->GuildName,"") == NULL)
	{
		ChatTargetSend(lpNpc,lMsg.Get(MSGGET(6,86)),lpObj->m_Index);
		return TRUE;
	}

	if( g_CastleSiege.CheckGuildOwnCastle(lpObj->GuildName) == FALSE
		|| (lpObj->GuildStatus != G_MASTER && lpObj->GuildStatus != G_SUB_MASTER))
	{
		ChatTargetSend(lpNpc,lMsg.Get(MSGGET(6,86)),lpObj->m_Index);
		return TRUE;
	}

	PMSG_TALKRESULT pMsg;

	pMsg.h.c = 0xC3;
	pMsg.h.headcode = 0x30;
	pMsg.h.size = sizeof(pMsg);
	pMsg.result = 0x0C;

	lpObj->m_IfState.use = 1;
	lpObj->m_IfState.type = 12;

	pMsg.level1 = 0;
	pMsg.level2 = 0;
	pMsg.level3 = 0;
	pMsg.level4 = 0;
	pMsg.level5 = 0;
	pMsg.level6 = 0;

	if( bCanChaosBox == TRUE )
	{
		lpObj->m_IfState.type = 7;
		lpObj->bIsChaosMixCompleted = FALSE;
		pMsg.level1 = 1;

		GCAnsCsMapSvrTaxInfo(lpObj->m_Index,1,g_CastleSiegeSync.GetTaxRateChaos(lpObj->m_Index));
		gObjInventoryTrans(lpObj->m_Index);
		LogAddTD("[%s][%s] Open Chaos Box",
			lpObj->AccountID,lpObj->Name);

		gObjItemTextSave(lpObj);
		gObjWarehouseTextSave(lpObj);
	}

	DataSend(lpObj->m_Index, (LPBYTE)&pMsg, pMsg.h.size);
#endif



	return TRUE;
}
BOOL NpcFasi(LPOBJ lpNpc, LPOBJ lpObj)
{
	int bPk = FALSE;

#if( ENABLE_FIX_NPCTALKPK == 1 )
	if( lpObj->m_PK_Level >= 4 )
	{
		bPk = TRUE;
	}
#else
	if ( lpObj->PartyNumber >= 0 )
	{
		if( gParty.GetPartyPkLevel(lpObj->PartyNumber) >= 4 )
		{
			bPk = TRUE;
		}
	}
	else if( lpObj->m_PK_Level >= 4 )
	{
		bPk = TRUE;
	}

#endif

	if ( bPk == TRUE )
	{
		int hour = 0;
		int min = 0;

		if ( lpNpc->TargetNumber != lpObj->m_Index )
		{
			if ( gObjGetPkTime(lpObj, hour, min) == TRUE )
			{
				char szTemp[100];

				wsprintf(szTemp, lMsg.Get(MSGGET(4, 79)), hour, min);

				ChatTargetSend(lpNpc, szTemp, lpObj->m_Index);

				lpNpc->TargetNumber = lpObj->m_Index;

				if ( gPkLimitFree == FALSE )
				{
					return TRUE;
				}
			}
		}
		else if ( gPkLimitFree == FALSE )
		{
			int numbertext = rand() % 3;

			switch ( numbertext )
			{
				case 0:
					ChatTargetSend(lpNpc, lMsg.Get(MSGGET(4, 98)), lpObj->m_Index);
					break;

				case 1:
					ChatTargetSend(lpNpc, lMsg.Get(MSGGET(4, 99)), lpObj->m_Index);
					break;

				case 2:
					ChatTargetSend(lpNpc, lMsg.Get(MSGGET(4, 100)), lpObj->m_Index);
					break;
			}

			lpNpc->TargetNumber = 0;	// Apply Deathway Fix, change 0 to -1;
			return TRUE;
		}
	}

	return FALSE;
}
// -----------------------------------------------------------------------------------------------------------------------
bool CIllusionTemple::NpcTalk(OBJECTSTRUCT* lpNpc, OBJECTSTRUCT* lpObj)
{
	if ( (lpObj->m_IfState.use) > 0 )
	{
		return true;
	}

	switch(lpNpc->Class)
	{
		case 385:
		{
			int templeIndex = this->GetObjTempleIndex(lpObj);
				
			if(templeIndex != -1)
			{
				if(templeIndex >= 0 && templeIndex < MAX_ILLUSION_TEMPLES)
				{
					if(!(this->m_IllusionTemple[templeIndex].m_TempleState == IT_STATE_OPEN))
					{
						char szBuff[100] = {0};
						
						if(this->m_IllusionTemple[templeIndex].m_TempleState == IT_STATE_CLOSED) 
						{
							sprintf(&szBuff[0], "IT Event will be Opened in %d Minute(s).", (this->m_IllusionTemple[0].m_RemainTime / 60000) - 4);
						} 
						else 
						{	
							sprintf(&szBuff[0], "IT Event is Running Now, Try again Later!", (this->m_IllusionTemple[0].m_RemainTime / 60000) - 4);
						}
						
						ChatTargetSend(lpNpc, &szBuff[0], lpObj->m_Index);
					}
					else
					{
						PMSG_ILLUSION_NPC pMsg;
						pMsg.MemberCount = this->GetUserCount(templeIndex);
						pMsg.State = 0;
						gSendProto.DataSend(lpObj->m_Index, (unsigned char*)&pMsg, pMsg.h.size);
						ChatTargetSend(lpNpc, "Illusion Temple Event Awaits You!", lpObj->m_Index);
					}
				}
				else
				{
					ChatTargetSend(lpNpc, "Sorry, You are not allowed to enter the IT Event.", lpObj->m_Index);
					CLog.LogAddC(2, "[IllusionTemple] Gate Index Error (%d)(%s).", templeIndex, &lpObj->Name[0]);
				}
			}
			else
			{
				ChatTargetSend(lpNpc, "You don't have sufficient Level to Enter IT Event.", lpObj->m_Index);
			}
		}
		return TRUE;

		case 380:
		{
			if(IT_FLOOR_RANGE(lpObj->m_IllusionIndex) && IT_MAP_RANGE(lpObj->MapNumber))
			{
				if(this->m_IllusionTemple[lpObj->m_IllusionIndex].m_BallOwner == lpNpc->m_Index)
				{
					BYTE ItemPosition = gObjInventoryInsertItem(lpObj, 14, 64, 0);
					
					if(ItemPosition != -1)
					{
						GCInventoryItemOneSend(lpObj->m_Index, ItemPosition);
						this->m_IllusionTemple[lpObj->m_IllusionIndex].m_BallOwner = lpObj->m_Index;
					}
					else
					{
						GCServerMsgStringSend("You do not have space to capture the artifact!", lpObj->m_Index, 1);
					} // Need To be Translated By Testers "Você não tem espaço para capturar o artefato!"
				}
				else
				{
					GCServerMsgStringSend("The artifact is not in the statue!", lpObj->m_Index, 1);
				} // Need To be Translated By Testers "O artefato não se encontra nesta estátua!"
			}
		}
		return TRUE;

		case 383: // Blue
		
		case 384:
		{
			int iTeam = lpNpc->Class == 383 ? IT_TEAM_BLUE : IT_TEAM_RED;
				
			if(IT_FLOOR_RANGE(lpObj->m_IllusionIndex) && IT_MAP_RANGE(lpObj->MapNumber))
			{
				bool bFound = false;
					
				for(int i = 0; i < INVENTORY_SIZE; i++)
				{
					if(lpObj->pInventory[i].IsItem())
					{
						if(lpObj->pInventory[i].m_Type == ITEMGET(14, 64))
						{
							gObjInventoryDeleteItem(lpObj->m_Index, i);
							GCInventoryItemDeleteSend(lpObj->m_Index, i, 1);
							bFound = true;
						}
					}
				}
				if(bFound)
				{
					this->m_IllusionTemple[lpObj->m_IllusionIndex].m_BallOwner = this->m_IllusionTemple[lpObj->m_IllusionIndex].m_Statues[rand()%MAX_IT_STATUES];
					this->m_IllusionTemple[lpObj->m_IllusionIndex].m_Teams[iTeam].m_Score++;
				}
			}
		}
		return TRUE;

		default:
			
		return TRUE;
	}
}
bool CQuest::NpcTalk(LPOBJ lpNpc, LPOBJ lpObj)
{
	int iIndex = lpObj->m_Index;
	if( lpObj->q_QuestIndex == 0xFF)
	{
		this->SetQuestState(lpObj, 0 , QUEST_STATE_START);
	}
	int i = lpObj->q_QuestIndex;

	if(this->quests[i].npcID == lpNpc->Class)
	{

		if(lpObj->Level < this->quests[i].level)
		{
			wsprintf(szQuestTemp, " You're need be level %d for quest!",this->quests[i].level);
			ChatTargetSend(lpNpc,szQuestTemp, iIndex);
			return true;
		}
		if(lpObj->Money < this->quests[i].zen)
		{
			wsprintf(szQuestTemp, " you need zen %d for quest!",this->quests[i].zen);
			ChatTargetSend(lpNpc,szQuestTemp, iIndex);
			return true;
		}
		if(this->IsClass(i, lpObj->DbClass ))
		{
			for(int x = 0 ; x != this->quests->QuestsObjectCount ; x++)
			{
				switch(this->GetQuestType(i,x))
				{
					case QUEST_OBJECT_TYPE_ITEM:
					{
						switch(lpObj->q_QuestState)
						{
							case QUEST_STATE_START:
							{
								int ItemType = this->quests[i].ItemsObject[x].itemType;
								int ItemSubType = this->quests[i].ItemsObject[x].itemSubType;
								LPITEM_ATTRIBUTE Item = &ItemAttribute[ITEMGET(ItemType, ItemSubType) ];
								qMsg->Notice(iIndex , "[Quest] Quest Start. " );
								qMsg->Notice(iIndex , "[Quest] %s go find %s !!!",this->quests[i].name,Item->Name);
								this->SetQuestState(lpObj, i , QUEST_STATE_ONGOING );
								if(this->quests[i].zen > 0)
								{
									lpObj->Money -= this->quests[i].zen;
									GCMoneySend( iIndex , lpObj->Money );
								}
								qMsg->PM( iIndex , "[Quest] Remmber you can do quest only without party");
								qMsg->PM( iIndex , "[Quest] you need free slot in your invenotry for quest item");
								return true;
							}
							case QUEST_STATE_ONGOING:
							{
								int ItemType = this->quests[i].ItemsObject[x].itemType;
								int ItemSubType = this->quests[i].ItemsObject[x].itemSubType;
								int GetCount = this->quests[i].ItemsObject[x].itemCount;

								LPITEM_ATTRIBUTE Item = &ItemAttribute[ITEMGET(ItemType, ItemSubType) ];
								qMsg->PM(iIndex , "[Quest] You do not have enough required items");
								qMsg->PM(iIndex , "[Quest] Search %d %s",GetCount,Item->Name);
								wsprintf(szQuestTemp, "Search %d %s",GetCount,Item->Name);
								ChatTargetSend(lpNpc , szQuestTemp , iIndex );
								return true;

							}
							case QUEST_STATE_FINISH:
							{

								int ItemType = this->quests[i].ItemsObject[x].itemType;

								int ItemSubType = this->quests[i].ItemsObject[x].itemSubType;

								int Count = gObjGetItemCountInIventory(iIndex, ITEMGET(ItemType,ItemSubType));

								int GetCount = this->quests[i].ItemsObject[x].itemCount;

								if(Count >= GetCount)
								{
									LPITEM_ATTRIBUTE Item = &ItemAttribute[ITEMGET(ItemType, ItemSubType) ];
									qMsg->Notice(iIndex, "[Quest] You have been finished %s ",this->quests[i].name);
									gObjDelteItemCountInInventory(iIndex ,ItemType , ItemSubType , Count );
									int PrizeCount = this->quests[i].ItemsObject[x].QuestPrizeCount;
									int uPoint = 0;
									int uClassUp = 0;
									for(int p = 0 ; p != PrizeCount ; p++)
									{
										int Points = this->quests[i].ItemsObject[x].QuestPrize[p].points;
										int ClassUp = this->quests[i].ItemsObject[x].QuestPrize[p].ClassUp;
										if(Points > 0)
											uPoint += Points;
										if(ClassUp > 0 )
											uClassUp += ClassUp;
													
									}
									if(uPoint > 0)
									{
										qMsg->Msg(iIndex , "[Quest] you have received %d points",uPoint);
										lpObj->LevelUpPoint += uPoint;
										GCLevelUpMsgSend(iIndex, 201);
										this->SetQuestState(lpObj, lpObj->q_QuestIndex+1 , QUEST_STATE_START);
									}
									if(uClassUp > 0)
									{
										qMsg->PM(iIndex , "[Quest] congratulation you win Class up :)");
										lpObj->ChangeUP += 1;
										lpObj->DbClass |= 1;
										gObjMakePreviewCharSet(lpObj->m_Index);
										BYTE btClass = (lpObj->Class * 32) & 224 ;
										btClass |= (lpObj->ChangeUP * 16) & 16;
										if(lpObj->ChangeUP == 1)
											GCSendQuestPrize(lpObj->m_Index, 201 , btClass);
										if(lpObj->ChangeUP == 2)
											GCSendQuestPrize(lpObj->m_Index, 204 , btClass);
										GCMagicAttackNumberSend(lpObj, 76 , lpObj->m_Index , 0 );
									}
									
								}
							}
						}
						break;
					}
				}
			}	
		}
	}
	
			

	return false;
}
Exemple #21
0
BOOL NpcElderCircle(LPOBJ lpNpc, LPOBJ lpObj)
{
if ( (lpObj->m_IfState.use ) > 0 )
	{
		return TRUE;
	}

#if(GS_CASTLE==1)
	if(g_CastleSiege.GetCastleState() == 7) //Good
	{
		ChatTargetSend(lpNpc,(lMsg.Get(MSGGET(6, 85))), lpObj->m_Index);
		return TRUE;
	}

	 //0001:001d2150       _strcmp                    005d3150 f   libcmt:strcmp.obj

	if(strcmp(lpObj->GuildName, "") == 0 ) //Good
	{
		ChatTargetSend(lpNpc,(lMsg.Get(MSGGET(6, 86))), lpObj->m_Index);
		return TRUE;
	}

	if(g_CastleSiege.CheckGuildOwnCastle(lpObj->GuildName)) //Good
	{
		if( lpObj->GuildStatus != 128 )
		{
			if ( lpObj->GuildStatus != 64 )
			{
				ChatTargetSend(lpNpc,(lMsg.Get(MSGGET(6, 86))), lpObj->m_Index);
				return TRUE;
			}
		}
	}
#endif

	PMSG_TALKRESULT pMsg;

	pMsg.h.c = 0xC3;
	pMsg.h.headcode = 0x30;
	pMsg.h.size = sizeof(pMsg);
	pMsg.result = 0x0C;

	lpObj->m_IfState.use = 1;
	lpObj->m_IfState.type = 12;

#if(GS_CASTLE==1)
	pMsg.level1 = 0;
	pMsg.level2 = 0;
	pMsg.level3 = 0;
	pMsg.level4 = 0;
	pMsg.level5 = 0;
	pMsg.level6 = 0;

	if( bCanChaosBox == TRUE) //Good
	{
		lpObj->m_IfState.type = 7;

		lpObj->bIsChaosMixCompleted = false;
		lpObj->m_bCsGuildInvolved = false; //Good

		pMsg.level1 = 1; //Good

		GCAnsCsMapSvrTaxInfo(lpObj->m_Index, 1, g_CastleSiegeSync.GetTaxRateChaos(lpObj->m_Index));
		gObjInventoryTrans(lpObj->m_Index);

		LogAddTD("[%s][%s] Open Chaos Box", lpObj->AccountID, lpObj->Name);
		gObjItemTextSave(lpObj);
		gObjWarehouseTextSave(lpObj);
	}
#endif

	DataSend(lpObj->m_Index, (LPBYTE)&pMsg, pMsg.h.size);
	return TRUE;
}
BOOL CJewelOfHarmonySystem::NpcJewelOfHarmony(LPOBJ lpNpc, LPOBJ lpObj)
{
	if ( lpObj->m_IfState.use > 0 )
		return TRUE;

	PMSG_TALKRESULT pResult;

	pResult.h.c = 0xC3;
	pResult.h.headcode = 0x30;
	pResult.h.size = sizeof(pResult);
	
	if ( lpNpc->Class == 368 )
	{
		pResult.result = 17;
		pResult.level1 = this->m_iRatePuritySuccess;

		if ( this->m_bSystemPrutiyJewel != TRUE )
		{
			GCServerMsgStringSend(lMsg.Get(MSGGET(13,50)), lpObj->m_Index, 1);
			return TRUE;
		}

		if ( !this->IsEnableToUsePuritySystem() )
		{
			GCServerMsgStringSend(lMsg.Get(MSGGET(13,50)), lpObj->m_Index, 1);
			CLog.LogAdd("[JewelOfHarmony][%s][%s] Not Purtiy Time ",
				lpObj->AccountID, lpObj->Name);

			return TRUE;
		}
	}
	else  if ( lpNpc->Class == 369 )
	{
		pResult.result = 18;
		pResult.level1 = this->m_iRateMixSmeltingStoneNor;
		pResult.level2 = this->m_iRateMixSmeltingStoneExt;

		if ( this->m_bSystemMixSmeltingStone != TRUE )
		{
			ChatTargetSend(lpNpc, lMsg.Get(MSGGET(13,53)), lpObj->m_Index);
			return TRUE;
		}
	}
	else if ( lpNpc->Class == 370 )
	{
		pResult.result = 19;

		if ( this->m_bSystemRestoreStrengthen != TRUE )
		{
			ChatTargetSend(lpNpc, lMsg.Get(MSGGET(13,54)), lpObj->m_Index);
			return TRUE;
		}
	}
	else
	{
		CLog.LogAdd("[JewelOfHarmony][%s][%s] Open Chaos Box Failed NpcType [%d]",
			lpObj->AccountID, lpObj->Name, lpNpc->Class);

		return TRUE;
	}

	if ( bCanChaosBox == TRUE )
	{
		if ( lpObj->m_bPShopOpen == true )
		{
			CLog.LogAdd("[JewelOfHarmony][%s][%s] is Already Opening PShop, ChaosBox Failed",
				lpObj->AccountID, lpObj->Name);

			GCServerMsgStringSend(lMsg.Get(MSGGET(4,194)), lpObj->m_Index, 1);
			return TRUE;
		}

		lpObj->m_IfState.type = 7;
		lpObj->m_IfState.state = 0;
		lpObj->m_IfState.use = 1;
		lpObj->bIsChaosMixCompleted = false;

		gSendProto.DataSend(lpObj->m_Index, (LPBYTE)&pResult, pResult.h.size);
		gObjInventoryTrans(lpObj->m_Index);

		CLog.LogAdd("[JewelOfHarmony][%s][%s] Open Chaos Box",
			lpObj->AccountID, lpObj->Name);

		gObjItemTextSave(lpObj);
		gObjWarehouseTextSave(lpObj);
		GCAnsCsMapSvrTaxInfo(lpObj->m_Index, 1, g_CastleSiegeSync.GetTaxRateChaos(lpObj->m_Index));
	}

	return TRUE;
}
Exemple #23
0
BOOL ObjBotWarper::TradeOpen(int index, int nindex)
{
	if ( gObjIsConnectedGP(index) == FALSE )
	{
		LogAddC(2, "error-L3 [%s][%d]", __FILE__, __LINE__);
		return 0;
	}
	if(gObjIsConnected(nindex) == 0)
	{
		return 0;
	}

	int number = this->GetBotIndex(nindex);
	if(number == -1)
		return 0;

	char sbuf[512]={0};
	LPOBJ lpObj = &gObj[index];
	LPOBJ lpBot = &gObj[nindex];

	if(this->bot[number].OnlyVip == 1 && gObj[index].Vip == 0)
	{
		ChatTargetSend(&gObj[this->bot[number].index],"I only warp VIP Players!",index);
		return 1;
	}
	if(this->bot[number].Zen > gObj[index].Money)
	{
		wsprintf(sbuf,lMsg.Get(MSGGET(14, 160)),this->bot[number].Zen);
		GCServerMsgStringSend(sbuf ,lpObj->m_Index, 0x01);
		return 1;		
	}
	if(this->bot[number].VipMoney > gObj[index].VipMoney)
	{
		wsprintf(sbuf,"You Need %d VipMoney",this->bot[number].VipMoney);
		GCServerMsgStringSend(sbuf ,lpObj->m_Index, 0x01);
		return 1;
	}
	
	if(gObj[index].Level < this->bot[number].MinLevel)
	{
		wsprintf(sbuf,"You Need to be level %d at least",this->bot[number].MinLevel);
		ChatTargetSend(&gObj[this->bot[number].index],sbuf,index);
		return 1;
	}
	
	if(gObj[index].Resets < this->bot[number].MinReset)
	{
		wsprintf(sbuf,"You Need to have %d resets at least",this->bot[number].MinReset);
		ChatTargetSend(&gObj[this->bot[number].index],sbuf,index);
		return 1;
	}


	int m_check1 = gMoveCommand.CheckMainToMove(lpObj);
	int m_check2 = gMoveCommand.CheckEquipmentToMove(lpObj,lpObj->MapNumber);
	int m_check3 = gMoveCommand.CheckInterfaceToMove(lpObj);

	if(m_check1 == false
		|| m_check2 == false
		|| m_check3 == false)
	{
		char szMsg[256];
		wsprintf(szMsg,lMsg.Get(1254));

		GCServerMsgStringSend(szMsg,lpObj->m_Index,1);
		ChatTargetSend(&gObj[this->bot[number].index],"I cant warp you there!",index);
	}
	int addx;
	int addy;
	int count = 50;
	int Find = 0;

	while(count--)
	{
		addx = this->bot[number].Warp_X + rand()%9 - 4;
		addy = this->bot[number].Warp_Y + rand()%9 - 4;

		if(gObjCheckTeleportAreaByMap(this->bot[number].Warp_Map,addx,addy))
		{
			Find = 1;
			break;
		}
	}
	if(Find == 0)
	{
		addx = this->bot[number].Warp_X;
		addy = this->bot[number].Warp_Y;
	}

	ChatTargetSend(&gObj[this->bot[number].index],"I will warp you!",index);

	if(this->bot[number].Zen > 0)
	{
		gObj[index].Money -= this->bot[number].Zen;
		::GCMoneySend(index, gObj[index].Money);
	}
	if(this->bot[number].VipMoney > 0)
	{
		char tmp[256];
		gObj[index].VipMoney -= this->bot[number].VipMoney;
		gObj[index].AccountExtraInfoModified = 1;
		wsprintf(tmp,"VipMoney = %d",gObj[index].VipMoney);
		GCServerMsgStringSend(tmp,index, 1);
	}

	if(lpObj->MapNumber != this->bot[number].Warp_Map)
	{
		short sSvrCode = g_MapServerManager.CheckMoveMapSvr(lpObj->m_Index,this->bot[number].Warp_Map,lpObj->m_sPrevMapSvrCode);

		if(sSvrCode != gGameServerCode)
		{
			if(sSvrCode == -1)
			{
				LogAddC(2,"[MapServerMng] Map Server Move Fail : CheckMoveMapSvr() == -1 [%s][%s] (%d)",lpObj->AccountID,lpObj->Name,lpObj->m_Index);
				return 1;
			}

			if(lpObj->m_bPShopOpen == 1)
			{
				LogAddC(2,"[MapServerMng] Map Server Move Fail : m_bPShopOpen == 1 [%s][%s] (%d)",lpObj->AccountID,lpObj->Name,lpObj->m_Index);
				return 1;
			}

			GJReqMapSvrMove(lpObj->m_Index,sSvrCode,this->bot[number].Warp_Map,addx,addy);
			LogAddTD("[MapServerMng] Request to Move Map Server : (%d) - [%s][%s] (%d)",sSvrCode,lpObj->AccountID,lpObj->Name,lpObj->m_Index);
			return 1;
		}
	}
	
	lpObj->SkillRecallParty_Time = 3;
	lpObj->SkillRecallParty_MapNumber = this->bot[number].Warp_Map;
	lpObj->SkillRecallParty_X = addx;
	lpObj->SkillRecallParty_Y = addy;

	return 1;
}