Пример #1
0
VOID WINAPI	TimerProcQueue2(LPVOID lpParametar, BOOL TimerOrWaitFired)
{
	if (g_MuTimer.GetTimerEnd() == TRUE)
	{
		return;
	}
	
	g_MuTimer.m_QueueTimer2.SyncLock();
		
	int nEventID = *(DWORD*)lpParametar;
	
	switch (nEventID)
	{
		case WM_FIRST_MSG_PROCESS:
		{
			int n;

			if (gDoPShopOpen != FALSE)
			{
				for (n=OBJ_STARTUSERINDEX; n<OBJMAX; n++)
				{
					PShop_ViewportListRegenarate(n);
				}
				
				for (n=OBJ_STARTUSERINDEX; n<OBJMAX; n++)
				{
					if (gObjIsConnected(n) != PLAYER_EMPTY)
					{
						gObj[n].m_bPShopItemChange = false;
					}
				}
			}
			
			for (n=OBJ_STARTUSERINDEX; n<OBJMAX; n++)
			{
				gObjUnionUpdateProc(n);
			}
			
			gObjSetState();

			GameServerInfoSend();

		} break;
		
		case WM_VIEWPORT_UPDATE:
		{
			for (int n = 0; n < OBJMAX; n++)
			{
				gObjStateSetCreate(n);
				gObjViewportListDestroy(n);
				gObjViewportListCreate(n);
				gObjViewportListProtocol(n);
			}
		} 
		break;
	}
		
	g_MuTimer.m_QueueTimer2.SyncUnlock();
}
Пример #2
0
BOOL CRaklionSelupan::CreateSelupan()
{
	int m_Type = -1;

	for ( int n=0;n<gMSetBase.m_Count;n++)
	{
		if( gMSetBase.m_Mp[n].m_Type == 459 )
		{
			m_Type = n;
		}
	}

	LPOBJ lpObj = NULL;
	int result = 0;


	result = gObjAddMonster(MAP_INDEX_RAKLION_BOSS);

	if ( result < 0 )
	{
		LogAddTD("[RAKLION] CreateSelupan error");
		return FALSE;
	}
	
	lpObj = &gObj[result];
	
	gObjSetPosMonster(result, m_Type);
	
	gObjSetMonster(result, 459); 
	
	LogAddTD("[RAKLION] Create Selupan : X (%d) / Y(%d)",lpObj->X,lpObj->Y);

	LPOBJ lpTargetObj = NULL;

	for(int n=0;n<OBJMAX;n++){

		lpTargetObj = &gObj[n];

		if(lpTargetObj->MapNumber == MAP_INDEX_RAKLION_BOSS){
			gObjStateSetCreate(n);
			gObjViewportListDestroy(n);
			gObjViewportListCreate(n);
			gObjViewportListProtocol(n);
		}
	}
	
	gObjSetState();

	this->m_iBossAttackMin = lpObj->m_AttackDamageMin;
	this->m_iBossAttackMax = lpObj->m_AttackDamageMax;

	return TRUE;
}
BOOL TMonsterSkillElement::ApplyElementSummon(int iIndex, int iTargetIndex)
{
	LPOBJ lpObj = &gObj[iIndex];
	LPOBJ lpTargetObj = &gObj[iTargetIndex];

	if ( lpTargetObj->Connected < PLAYER_PLAYING ||
		 lpTargetObj->Type != OBJ_MONSTER )
		 return FALSE;

	lpTargetObj->Life = lpTargetObj->MaxLife + lpTargetObj->AddLife;
	lpTargetObj->Mana = lpTargetObj->MaxMana + lpTargetObj->AddMana;
	lpTargetObj->Live = TRUE;
	lpTargetObj->m_PoisonBeattackCount = 0;
	lpTargetObj->m_ColdBeattackCount = 0;
	lpTargetObj->m_ViewState = 0;
	lpTargetObj->Teleport = 0;

	memset(lpTargetObj->m_ViewSkillState,0,sizeof(lpTargetObj->m_ViewSkillState));

	for ( int i=0;i<MAX_SELF_DEFENSE;i++)
		lpTargetObj->SelfDefenseTime[i] = 0;

	gObjTimeCheckSelfDefense(lpTargetObj);
	gObjViewportListProtocolDestroy(lpTargetObj);
	gObjViewportClose(lpTargetObj);
	lpTargetObj->m_ActState.Attack = 0;
	lpTargetObj->m_ActState.EmotionCount = 0;
	lpTargetObj->m_ActState.Escape = 0;
	lpTargetObj->m_ActState.Move = 0;
	lpTargetObj->m_ActState.Rest = 0;
	lpTargetObj->m_ActState.Emotion = 0;
	lpTargetObj->TargetNumber = -1;
	lpTargetObj->NextActionTime = 5000;

	if ( this->m_iIncAndDecValue < 0 )
		this->m_iIncAndDecValue = 10;

	BYTE cX;
	BYTE cY;
	BOOL bGetPosition = FALSE;
	int iCount = 100;


	while ( iCount-- != 0 )
	{
		cX = ( rand() % (this->m_iIncAndDecValue+1) ) * (((rand()%2==0)?-1:1)) + lpObj->X;
		cY = ( rand() % (this->m_iIncAndDecValue+1) ) * (((rand()%2==0)?-1:1)) + lpObj->Y;

		BYTE btMapAttr = MapC[lpObj->MapNumber].GetAttr(cX, cY);

		if ( btMapAttr == 0 )
		{
			bGetPosition = TRUE;
			break;
		}
	}

	if ( bGetPosition == FALSE )
	{
		lpObj->Live = FALSE;
		lpObj->m_State = 4;
		lpObj->RegenTime = GetTickCount();
		lpObj->DieRegen = 1;

		return FALSE;
	}

	lpTargetObj->X = cX;
	lpTargetObj->Y = cY;
	lpTargetObj->MTX = lpTargetObj->X;
	lpTargetObj->MTY = lpTargetObj->Y;
	lpTargetObj->TX = lpTargetObj->X;
	lpTargetObj->TY = lpTargetObj->Y;
	lpTargetObj->StartX = (BYTE)lpTargetObj->X;
	lpTargetObj->StartY = (BYTE)lpTargetObj->Y;

	gObjMonsterHitDamageInit(lpTargetObj);
	CreateFrustrum(lpTargetObj->X, lpTargetObj->Y, lpTargetObj->m_Index);
	lpTargetObj->DieRegen = 0;
	lpTargetObj->m_State = 1;
	lpTargetObj->m_Agro.ResetAll();
	gObjViewportListCreate(lpTargetObj->m_Index);

	return FALSE;
}
Пример #4
0
BOOL TMonsterSkillElement::ApplyElementSummon(int iIndex, int iTargetIndex)
{
	LPOBJ lpObj = &gObj[iIndex];
	LPOBJ lpTargetObj = &gObj[iTargetIndex];

	if( lpObj->Class == 459 &&
		lpObj->Connected == PLAYER_PLAYING &&
		lpObj->MapNumber == MAP_INDEX_RAKLIONBOSS &&
		iIndex == iTargetIndex)
	{
		LogAddTD("[TMonsterSkillElement][ApplyElementSummon] Selupan use summon.");
		return FALSE;
	}

	if ( lpTargetObj->Connected < PLAYER_PLAYING ||
		 lpTargetObj->Type != OBJ_MONSTER )
		 return FALSE;

	lpTargetObj->Life = lpTargetObj->MaxLife + lpTargetObj->AddLife;
	lpTargetObj->Mana = lpTargetObj->MaxMana + lpTargetObj->AddMana;
	lpTargetObj->Live = TRUE;

	gObjRemoveBuffEffect(lpTargetObj,BUFF_POISON);
	gObjRemoveBuffEffect(lpTargetObj,BUFF_ICE);
	gObjRemoveBuffEffect(lpTargetObj,BUFF_ICEARROW);

	lpTargetObj->m_ViewState = 0;
	lpTargetObj->Teleport = 0;

	gObjClearBuffEffect(lpTargetObj,CLEAR_TYPE_LOGOUT);

	for ( int i=0;i<MAX_SELF_DEFENSE;i++)
		lpTargetObj->SelfDefenseTime[i] = 0;

	gObjTimeCheckSelfDefense(lpTargetObj);
	gObjViewportListProtocolDestroy(lpTargetObj);
	gObjViewportClose(lpTargetObj);
	lpTargetObj->m_ActState.Attack = 0;
	lpTargetObj->m_ActState.EmotionCount = 0;
	lpTargetObj->m_ActState.Escape = 0;
	lpTargetObj->m_ActState.Move = 0;
	lpTargetObj->m_ActState.Rest = 0;
	lpTargetObj->m_ActState.Emotion = 0;
	lpTargetObj->TargetNumber = -1;
	lpTargetObj->NextActionTime = 5000;

	if ( this->m_iIncAndDecValue < 0 )
		this->m_iIncAndDecValue = 10;

	BYTE cX;
	BYTE cY;
	BOOL bGetPosition = FALSE;
	int iCount = 100;


	while ( iCount-- != 0 )
	{
		cX = ( rand() % (this->m_iIncAndDecValue+1) ) * (((rand()%2==0)?-1:1)) + lpObj->X;
		cY = ( rand() % (this->m_iIncAndDecValue+1) ) * (((rand()%2==0)?-1:1)) + lpObj->Y;

		BYTE btMapAttr = MapC[lpObj->MapNumber].GetAttr(cX, cY);

		if ( btMapAttr == 0 )
		{
			bGetPosition = TRUE;
			break;
		}
	}

	if ( bGetPosition == FALSE )
	{
		lpObj->Live = FALSE;
		lpObj->m_State = 4;
		lpObj->RegenTime = GetTickCount();
		lpObj->DieRegen = 1;

		return FALSE;
	}

	lpTargetObj->X = cX;
	lpTargetObj->Y = cY;
	lpTargetObj->MTX = lpTargetObj->X;
	lpTargetObj->MTY = lpTargetObj->Y;
	lpTargetObj->TX = lpTargetObj->X;
	lpTargetObj->TY = lpTargetObj->Y;
	lpTargetObj->StartX = lpTargetObj->X;
	lpTargetObj->StartY = lpTargetObj->Y;

	gObjMonsterHitDamageInit(lpTargetObj);
	CreateFrustrum(lpTargetObj->X, lpTargetObj->Y, lpTargetObj->m_Index);
	lpTargetObj->DieRegen = 0;
	lpTargetObj->m_State = 1;
	lpTargetObj->m_Agro.ResetAll();
	gObjViewportListCreate(lpTargetObj->m_Index);

	return FALSE;
}