void CKanturuBattleOfMaya::SetState_START2()
{
	LogAdd( "[ KANTURU ][ BattleOfMaya ] State(%d) -> START2",
		this->m_iBattleOfMayaState);

	this->SetBattleOfMayaState(KANTURU_MAYA_START2);
	this->SetEntrancePermit(FALSE);
	this->SetBattleSceneState(1);
	this->SetSuccessValue(FALSE);
	this->SetSceneSuccessValue(FALSE);
	this->m_BattleTimeInfo[this->m_iSceneState].SetAppliedTime();

	if ( this->m_BattleTimeInfo[this->m_iSceneState].GetCondition() == 1 )
	{
		KANTURU_UTIL.NotifyKanturuBattleTime(this->m_BattleTimeInfo[this->m_iSceneState].GetValue());
	}

	g_KanturuMonsterMng.SetKanturuMonster(0);
	this->m_KanturuMaya.SetMayaObjIndex(g_KanturuMonsterMng.GetMayaObjIndex());
}
void CKanturuBattleOfNightmare::SetState_ENDCYCLE()
{
	LogAdd( "[ KANTURU ][ BattleOfNightmare ] State(%d) -> ENDCYCLE",
		this->m_iBattleOfNightmareState);

	LogAdd("[ KANTURU ][ BattleOfNightmare ] State(%d) -> ENDCYCLE",
		this->m_iBattleOfNightmareState);

	this->SetBattleOfNightmareState(KANTURU_NIGHTMARE_ENDCYCLE);

	if ( this->GetSuccessValue() == TRUE )
	{
		KANTURU_UTIL.SendMsgKanturuBattleUser("Has defeated the Nightmare Boss. You may now proceed to the Refinery Tower.");
	}
	else
	{
		g_KanturuBattleUserMng.MoveAllUser(137);
		g_KanturuBattleUserMng.ResetAllData();
	}
}
void CKanturuBattleOfNightmare::SetState_ENDCYCLE()
{
	LogAddC(5, "[ KANTURU ][ BattleOfNightmare ] State(%d) -> ENDCYCLE",
		this->m_iBattleOfNightmareState);

	LogAddTD("[ KANTURU ][ BattleOfNightmare ] State(%d) -> ENDCYCLE",
		this->m_iBattleOfNightmareState);

	this->SetBattleOfNightmareState(KANTURU_NIGHTMARE_ENDCYCLE);

	if ( this->GetSuccessValue() == TRUE )
	{
		KANTURU_UTIL.SendMsgKanturuBattleUser(lMsg.Get(MSGGET(13, 35)));
	}
	else
	{
		g_KanturuBattleUserMng.MoveAllUser(137);
		g_KanturuBattleUserMng.ResetAllData();
	}
}
Esempio n. 4
0
BOOL TMonsterAIElement::ApplyElementMove(int iIndex, int iTargetIndex, TMonsterAIState * pAIState)
{
	LPOBJ lpObj = &gObj[iIndex];
	UTIL.SendCrywolfChattingMsg(iIndex, "Element-이동");
	KANTURU_UTIL.SendKanturuChattingMsg(iIndex, "Element-이동");

	if ( lpObj->PathStartEnd )
		return FALSE;

	BOOL bFindXY = FALSE;

	if ( pAIState->m_iTransitionType == 2 )
		bFindXY = MONSTER_UTIL.GetXYToChase(lpObj);
	else
		bFindXY = MONSTER_UTIL.GetXYToPatrol(lpObj);

	if ( bFindXY )
		MONSTER_UTIL.FindPathToMoveMonster(lpObj, lpObj->MTX, lpObj->MTY, 5, 1);

	return FALSE;
}
void CKanturuBattleOfNightmare::SetState_START()
{
	CLog.LogAddC(5, "[ KANTURU ][ BattleOfNightmare ] State(%d) -> START",
		this->m_iBattleOfNightmareState);

	this->SetBattleOfNightmareState(KANTURU_NIGHTMARE_START);

	if ( this->m_StateInfo[this->m_iBattleOfNightmareState].GetCondition() == 1 )
	{
		KANTURU_UTIL.NotifyKanturuBattleTime(this->m_StateInfo[this->m_iBattleOfNightmareState].GetValue());
	}

	g_KanturuMonsterMng.SetKanturuMonster(2);

	TMonsterAIGroup::Init(this->m_iNightmareAIGroupNumber);
	TMonsterAIGroup::ChangeAIOrder(this->m_iNightmareAIGroupNumber, 0);

	int iIndex = TMonsterAIGroup::FindGroupLeader(this->m_iNightmareAIGroupNumber);
	this->m_iNightmareObjIndex = iIndex;

	CLog.LogAdd("[ KANTURU ][ BattleOfNightmare ] CKanturuNightmare Set m_iNightmareObjIndex %d",
		this->m_iNightmareObjIndex);
}
Esempio n. 6
0
void CKanturuMaya::KanturuMayaAct_IceStorm(int iSkillUsingRate)
{
	if ( (rand()%10000) > iSkillUsingRate )
		return;

	if ( this->m_iMayaObjIndex < 0 || this->m_iMayaObjIndex >= OBJMAX )	// #errot change to OBJMAX-1
		return;

	for ( int iCount=OBJ_STARTUSERINDEX;iCount < OBJMAX;iCount++)
	{
		if ( gObj[iCount].Type == OBJ_USER &&
			 gObjIsConnected(iCount) &&
			 gObj[iCount].MapNumber == MAP_INDEX_KANTURU_BOSS )
		{
			KANTURU_UTIL.NotifyKanturuWideAreaAttack(this->m_iMayaObjIndex, iCount, 0);
			TMonsterSkillManager::UseMonsterSkill(this->m_iMayaObjIndex, iCount, 31,-1,0);
			this->m_iIceStormCount++;
		}
	}

	LogAddTD("[ KANTURU ][ IceStorm ] Skill Using(%d) : Index(%d) %s",
		this->m_iIceStormCount, this->m_iMayaObjIndex, gObj[this->m_iMayaObjIndex].Name);
}
void CKanturuBattleOfNightmare::SetState(int iBattleOfNightmareState)
{
	if ( this->m_StateInfo[iBattleOfNightmareState].GetCondition() > 0 )
	{
		this->m_StateInfo[iBattleOfNightmareState].SetAppliedTime();
	}

	g_KanturuMonsterMng.ResetRegenMonsterObjData();
	this->m_iNightmareObjIndex = -1;

	CLog.LogAdd("[ KANTURU ][ BattleOfNightmare ] CKanturuBattleOfNightmare::SetState(...)  m_iNightmareObjIndex %d",
		this->m_iNightmareObjIndex);

	switch ( iBattleOfNightmareState )
	{
		case KANTURU_NIGHTMARE_NONE:
			this->SetState_NONE();
			break;
		case KANTURU_NIGHTMARE_IDLE:
			this->SetState_IDLE();
			break;
		case KANTURU_NIGHTMARE_NOTIFY:
			this->SetState_NOTIFY();
			break;
		case KANTURU_NIGHTMARE_START:
			this->SetState_START();
			break;
		case KANTURU_NIGHTMARE_END:
			this->SetState_END();
			break;
		case KANTURU_NIGHTMARE_ENDCYCLE:
			this->SetState_ENDCYCLE();
			break;
	}

	KANTURU_UTIL.NotifyKanturuChangeState(KANTURU_STATE_BATTLE_OF_NIGHTMARE, this->m_iBattleOfNightmareState);
}
Esempio n. 8
0
void CKanturuBattleStanby::SetState(int iBattleStanbyState)
{
	if ( this->m_StateInfo[iBattleStanbyState].GetCondition() > 0 )
	{
		this->m_StateInfo[iBattleStanbyState].SetAppliedTime();
	}

	g_KanturuMonsterMng.ResetRegenMonsterObjData();

#if (GS_CASTLE == 0 || GS_SPEC == 1)
	for ( int iCount=OBJ_STARTUSERINDEX;iCount<OBJMAX;iCount++)
	{
		gObj[iCount].m_bKanturuEntranceByNPC = FALSE;
	}
#endif

	g_KanturuBattleUserMng.ResetAllData();

	switch ( iBattleStanbyState )
	{
		case KANTURU_STANBY_NONE:
			this->SetState_NONE();
			break;
		case KANTURU_STANBY_START:
			this->SetState_START();
			break;
		case KANTURU_STANBY_NOTIFY:
			this->SetState_NOTIFY();
			break;
		case KANTURU_STANBY_END:
			this->SetState_END();
			break;
	}

	KANTURU_UTIL.NotifyKanturuChangeState(KANTURU_STATE_BATTLE_STANTBY, this->m_iBattleStanbyState);
	g_KanturuBattleUserMng.ResetAllData();
}
Esempio n. 9
0
void CKanturuEntranceNPC::NotifyResultEnterKanturuBossMap(int iIndex)
{
	if ( !gObjIsConnected(iIndex))
	{
		return;
	}

	LPOBJ lpObj = &gObj[iIndex];
	BOOL bMoveGateSuccess = FALSE;
	int iResult = g_Kanturu.CheckEnterKanturu(iIndex);

	if ( iResult == 0 )
	{
		int iCurrentState = g_Kanturu.GetKanturuState();

		if ( iCurrentState == KANTURU_STATE_BATTLE_OF_MAYA )
		{
			bMoveGateSuccess = gObjMoveGate(iIndex, 133);

			if ( bMoveGateSuccess ==TRUE )
			{
				g_KanturuBattleUserMng.AddUserData(iIndex);

				LogAddTD("[Kanturu][BattleUser] Add User [%s][%s] Current Battle User:%d State:[%d-%d] (CharInfoSave : Class=%d, Level=%d, LvPoint=%d, Exp=%u, Str=%d, Dex=%d, Vit=%d, Energy=%d, LeaderShip=%d, Map=%d, Pk=%d",
					gObj[iIndex].AccountID, gObj[iIndex].Name,
					g_KanturuBattleUserMng.GetUserCount(), g_Kanturu.GetKanturuState(),
					g_Kanturu.GetKanturuDetailState(),
					gObj[iIndex].Class, gObj[iIndex].Level, gObj[iIndex].LevelUpPoint,
					gObj[iIndex].Experience, gObj[iIndex].Strength, gObj[iIndex].Dexterity,
					gObj[iIndex].Vitality, gObj[iIndex].Energy, gObj[iIndex].Leadership, 
					gObj[iIndex].MapNumber, gObj[iIndex].m_PK_Level);

				KANTURU_UTIL.NotifyKanturuCurrentState(iIndex, 
					g_Kanturu.GetKanturuState(),g_Kanturu.GetKanturuDetailState());

				gObj[iIndex].m_bKanturuEntranceByNPC = 1;
			}
		}
		else if ( iCurrentState == KANTURU_STATE_TOWER_OF_REFINEMENT )
		{
			bMoveGateSuccess = gObjMoveGate(iIndex, 135);

			KANTURU_UTIL.NotifyKanturuCurrentState(iIndex, 
				g_Kanturu.GetKanturuState(),g_Kanturu.GetKanturuDetailState());

			gObj[iIndex].m_bKanturuEntranceByNPC = 1;
		}
		else
		{
			LogAddTD("[Kanturu][BossMapMove] Error - State(%d) Character[%s][%s]",
				iCurrentState, lpObj->AccountID, lpObj->Name);
		}
	}
	else
	{
		KANTURU_UTIL.NotifyKanturuEntranceReqResult(iIndex, iResult);

		LogAddTD("[Kanturu][BossMapMove] Fail - Result(%d) Character[%s][%s]",
			iResult, lpObj->AccountID, lpObj->Name);

		gObj[iIndex].m_bKanturuEntranceByNPC = 0;
	}
}
Esempio n. 10
0
BOOL TMonsterAIElement::ApplyElementMoveTarget(int iIndex, int iTargetIndex, TMonsterAIState * pAIState)
{
	LPOBJ lpObj = &gObj[iIndex];

	UTIL.SendCrywolfChattingMsg(iIndex, "Element-MoveTarget");
#if (__CUSTOM__ == 0)
	KANTURU_UTIL.SendKanturuChattingMsg(iIndex, "Element-타겟이동");
#endif

	if ( lpObj->PathStartEnd )
		return FALSE;

	if ( lpObj->X == this->m_iX &&
		 lpObj->Y == this->m_iY )
	{
		this->ApplyElementMove(iIndex, iTargetIndex, pAIState);
		return FALSE;
	}

	BOOL bFindXY = TRUE;
	int iTargetX = this->m_iX;
	int iTargetY = this->m_iY;
	int iTargetDistance = (int)sqrt(double(((lpObj->X - iTargetX)*(lpObj->X - iTargetX))+ ((lpObj->Y - iTargetY)*(lpObj->Y - iTargetY))));
	
	if ( TMonsterAIElement::s_MonsterAIMovePath[lpObj->MapNumber].m_bDataLoad )
	{
		if ( iTargetDistance > 10 )
		{
			int iMinCost = 1000000;
			int iMidX = -1;
			int iMidY = -1;
			int iSpotNum = -1;

			for ( int i=0;i<MAX_MONSTER_AI_MOVE_PATH;i++)
			{
				TMonsterAIMovePathInfo & PathInfo = TMonsterAIElement::s_MonsterAIMovePath[lpObj->MapNumber].m_MovePathInfo[i];
				float fDistX = (float)(lpObj->X - PathInfo.m_iPathX);
				float fDistY = (float)(lpObj->Y - PathInfo.m_iPathY);
				int iPathSpotDist =  (int)sqrt( (fDistX*fDistX) + (fDistY*fDistY) );

				if ( iPathSpotDist < 20 )
				{
					fDistX = (float)(iTargetX - PathInfo.m_iPathX);
					fDistY = (float)(iTargetY - PathInfo.m_iPathY);
					int iMidDist = (int)sqrt( (fDistX*fDistX) + (fDistY*fDistY) );

					if ( iMinCost > iMidDist )
					{
						if ( iMidDist )
						{
							iMinCost = iMidDist;
							iMidX = PathInfo.m_iPathX;
							iMidY = PathInfo.m_iPathY;
							iSpotNum = i;
						}
					}
				}
			}

			if ( iMinCost != 1000000 )
			{
				iTargetX = iMidX;
				iTargetY = iMidY;
			}
		}
	}

	if ( bFindXY )
	{
		if ( MONSTER_UTIL.FindPathToMoveMonster(lpObj, iTargetX, iTargetY, 7, FALSE) )
			lpObj->PathStartEnd = 1;
		else
			lpObj->PathStartEnd = 0;
	}

	return FALSE;
}
void CKanturuBattleOfMaya::SetState(int iBattleOfMayaState)
{
	if ( this->m_StateInfo[iBattleOfMayaState].GetCondition() > 0 )
	{
		this->m_StateInfo[iBattleOfMayaState].SetAppliedTime();
	}

	g_KanturuMonsterMng.ResetRegenMonsterObjData();
	this->m_KanturuMaya.Init();
	this->ResetAIMonster();

	switch ( iBattleOfMayaState )
	{
		case KANTURU_MAYA_NONE:
			this->SetState_NONE();
			break;
		case KANTURU_MAYA_STANBY1:
			this->SetState_STANBY1();
			break;
		case KANTURU_MAYA_NOTIFY1:
			this->SetState_NOTIFY1();
			break;
		case KANTURU_MAYA_START1:
			this->SetState_START1();
			break;
		case KANTURU_MAYA1:
			this->SetState_MAYA1();
			break;
		case KANTURU_MAYA_END1:
			this->SetState_END_MAYA1();
			break;
		case KANTURU_MAYA_ENDCYCLE1:
			this->SetState_ENDCYCLE_MAYA1();
			break;
		case KANTURU_MAYA_STANBY2:
			this->SetState_STANBY2();
			break;
		case KANTURU_MAYA_START2:
			this->SetState_START2();
			break;
		case KANTURU_MAYA2:
			this->SetState_MAYA2();
			break;
		case KANTURU_MAYA_END2:
			this->SetState_END_MAYA2();
			break;
		case KANTURU_MAYA_ENDCYCLE2:
			this->SetState_ENDCYCLE_MAYA2();
			break;
		case KANTURU_MAYA_STANBY3:
			this->SetState_STANBY3();
			break;
		case KANTURU_MAYA_START3:
			this->SetState_START3();
			break;
		case KANTURU_MAYA3:
			this->SetState_MAYA3();
			break;
		case KANTURU_MAYA_END3:
			this->SetState_END_MAYA3();
			break;
		case KANTURU_MAYA_ENDCYCLE3:
			this->SetState_ENDCYCLE_MAYA3();
			break;
		case KANTURU_MAYA_END:
			this->SetState_END();
			break;
		case KANTURU_MAYA_ENDCYCLE:
			this->SetState_ENDCYCLE();
			break;
	}

	KANTURU_UTIL.NotifyKanturuChangeState(KANTURU_STATE_BATTLE_OF_MAYA, this->m_iBattleOfMayaState);
}