Esempio n. 1
0
BOOL TMonsterAIElement::ApplyElementGroupMove(int iIndex, int iTargetIndex, TMonsterAIState * pAIState)
{
	LPOBJ lpObj = &gObj[iIndex];
	UTIL.SendCrywolfChattingMsg(iIndex, "Element-그룹이동");

	if ( lpObj->PathStartEnd )
		return FALSE;

	BOOL bFindXY = FALSE;
	BOOL bFoundLeader = TRUE;
	int iLeaderIndex = -1;
	iLeaderIndex = TMonsterAIGroup::FindGroupLeader(lpObj->m_iGroupNumber);

	if ( iLeaderIndex == -1 || gObj[iLeaderIndex].Live == FALSE )
		bFoundLeader = FALSE;

	if ( bFoundLeader && gObjCalDistance(lpObj, &gObj[iLeaderIndex]) > 6 )
	{
		lpObj->TargetNumber = iLeaderIndex;
		bFindXY = MONSTER_UTIL.GetXYToChase(lpObj);
	}
	else if ( pAIState->m_iTransitionType == 2 )
	{
		bFindXY = MONSTER_UTIL.GetXYToChase(lpObj);
	}
	else
	{
		bFindXY = MONSTER_UTIL.GetXYToPatrol(lpObj);
	}

	if ( bFindXY )
	{
		if ( MONSTER_UTIL.FindPathToMoveMonster(lpObj, lpObj->MTX, lpObj->MTY, 5, TRUE) )
		{

		}
		else
		{
			MONSTER_UTIL.GetXYToPatrol(lpObj);
			MONSTER_UTIL.FindPathToMoveMonster(lpObj, lpObj->MTX, lpObj->MTY, 5, TRUE);
		}
	}

	return FALSE;
}
Esempio n. 2
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;
}