Ejemplo n.º 1
0
void CRingAttackEvent::ProcState_Closed()
{
	int iTICK_MSEC = GetTickCount() - this->m_iTIME_TICK_COUNT;

	if ( iTICK_MSEC >= 1000 )
	{
		this->m_iTIME_MSEC_REMAIN -= iTICK_MSEC;
		this->m_iTIME_TICK_COUNT = GetTickCount();

		if ( this->m_bDoEvent )
		{
			if ( this->m_iTIME_MSEC_REMAIN <= (this->m_iTIME_MIN_OPEN * 60 * 1000 ) &&
				 this->m_iTIME_MSEC_REMAIN > 0 &&
				 (this->m_iTIME_MSEC_REMAIN / 60000 ) != this->m_iTIME_NOTIFY_COUNT )
			{
				this->m_iTIME_NOTIFY_COUNT = this->m_iTIME_MSEC_REMAIN / 60000;

				if ( (this->m_iTIME_NOTIFY_COUNT+1) == 3 )
				{
					AllSendServerMsg("The White Wizard and his minions are starting to assemble!");

					PMSG_ANS_CL_EFFECT pMsg;

					PHeadSetB((LPBYTE)&pMsg, 0x9E, sizeof(pMsg));
					pMsg.wEffectNum = 0;

					DataSendAll((LPBYTE)&pMsg, pMsg.h.size);

					LogAdd("[Ring Event] - Before 3 minutes - Advertise");
				}
			}
		}
	}

	if ( this->m_iTIME_MSEC_REMAIN <= 0 )
	{

		AllSendServerMsg("The White Wizard and his Orcs have invaded us!");

		PMSG_ANS_CL_EFFECT pMsg;

		PHeadSetB((LPBYTE)&pMsg, 0x9E, sizeof(pMsg));
		pMsg.wEffectNum = 1;

		DataSendAll((LPBYTE)&pMsg, pMsg.h.size);

		if ( this->m_bDoEvent )
		{
			this->SetState(2);
		}
		else
		{
			this->SetState(0);
		}

		LogAdd("[Ring Event] - Event Started");
	}
}
Ejemplo n.º 2
0
void BroadCastMessage(BroadCastMessageInfo* lpResult)
{
	if( strlen(lpResult->Text) < 2 )
	{
		return;
	}
	
	switch(lpResult->Type)
	{
	case 0:
		{
			AllSendServerMsg(&lpResult->Text[1]);
		}
		break;
	case 1:
		{
			USER_REQ_POST lpInfo = { 0 };
			PHeadSetB((LPBYTE)&lpInfo, 0, sizeof(lpInfo));
			lpInfo.h.headcode = 2;
			lpInfo.chatmsg[0] = '!';
			memcpy(lpInfo.id, lpResult->Sender, 10);
			strcat(lpInfo.chatmsg, lpResult->Text);
			DataSendAll((LPBYTE)&lpInfo, sizeof(lpInfo));
		}
		break;
	}
	
}
Ejemplo n.º 3
0
void CHacktoolBlockEx::OnRequestHacktoolStatistics(PMSG_HACKTOOL_CHECK_USE_STATISTICS_REQ * lpMsg)
{
	PMSG_REQ_HACKTOOL_STATISTICS pMsg				= { 0 };
	PMSG_HACKTOOL_CHECK_USE_STATISTISC_ANS pResult	= { 0 };
	HACKTOOL_DATA * lpHacktoolData					= 0;
	// ----
	lpHacktoolData = this->SearchHacktoolData(lpMsg->wHacktoolIndex);
	// ----
	if( lpHacktoolData )
	{
		lpHacktoolData->btHackCheckType = 2;
	}
	else if( this->AddHacktoolData(lpMsg->wHacktoolIndex, lpMsg->chFilename, lpMsg->lExpireDate, lpMsg->btBlockType) )
	{
		lpHacktoolData = this->SearchHacktoolData(lpMsg->wHacktoolIndex);
		lpHacktoolData->btHackCheckType = 2;
	}
	else
	{
		PHeadSubSetB((LPBYTE)&pResult, 0x8D, 1, sizeof(PMSG_HACKTOOL_CHECK_USE_STATISTISC_ANS));
		// ----
		pResult.btResult			= 1;
		pResult.wHacktoolIndex		= lpMsg->wHacktoolIndex;
		pResult.wHacktoolUseCount	= 0;
		pResult.wTotalUserCount		= 0;
		// ----
		wsJServerCli.DataSend((char*)&pResult, pResult.head.size);
	}
	// ----
	pMsg.h.setE((LPBYTE)&pMsg, 0x8A, sizeof(PMSG_REQ_HACKTOOL_STATISTICS));
	pMsg.dwKey = lpMsg->wHacktoolIndex;
	memcpy(pMsg.Filename, lpMsg->chFilename, 64);
	// ----
	for( int i = OBJ_STARTUSERINDEX; i < OBJMAX; i++ )
	{
		if( gObj[i].Connected >= PLAYER_LOGGED && gObj[i].Type == OBJ_USER )
		{
			for( int iSlotIndex = 0; iSlotIndex < HACKTOOL_DATA_SIZE; iSlotIndex++ )
			{
				if( !gObj[i].m_HacktoolUseInfo[iSlotIndex].btUseType )
				{
					gObj[i].m_HacktoolUseInfo[iSlotIndex].Set(0, 1, lpMsg->wHacktoolIndex);
					break;
				}
			}
		}
	}
	// ----
	DataSendAll((LPBYTE)&pMsg, sizeof(PMSG_REQ_HACKTOOL_STATISTICS));
}
Ejemplo n.º 4
0
void CRingAttackEvent::Start_Menual()
{
	this->SetMenualStart(TRUE);
	this->StopEvent();

	LogAdd("[Event Management] [Start] RingAttack Event!");
	this->m_iTIME_MIN_PLAY = 30;

	AllSendServerMsg("The White Wizard and his Orcs have invaded us!");

	PMSG_ANS_CL_EFFECT pMsg;

	PHeadSetB((LPBYTE)&pMsg, 0x9E, sizeof(pMsg));
	pMsg.wEffectNum = 1;

	DataSendAll((LPBYTE)&pMsg, pMsg.h.size);
	this->SetState(2);
}
Ejemplo n.º 5
0
void CRingAttackEvent::Start_Menual()
{
    this->SetMenualStart(TRUE);
    this->StopEvent();

    LogAddTD("¡Û¡Ü[Event Management] [Start] RingAttack Event!");
    this->m_iTIME_MIN_PLAY = 30;

    char szTemp[256];

    wsprintf(szTemp, lMsg.Get(MSGGET(4, 184)));
    AllSendServerMsg(szTemp);

    PMSG_ANS_CL_EFFECT pMsg;

    PHeadSetB((LPBYTE)&pMsg, 0x9E, sizeof(pMsg));
    pMsg.wEffectNum = 1;

    DataSendAll((LPBYTE)&pMsg, pMsg.h.size);
    this->SetState(2);
}
Ejemplo n.º 6
0
void CRingAttackEvent::ProcState_Playing()
{
    int iTICK_MSEC = GetTickCount() - this->m_iTIME_TICK_COUNT;

    if ( iTICK_MSEC >= 1000 )
    {
        this->m_iTIME_MSEC_REMAIN -= iTICK_MSEC;
        this->m_iTIME_TICK_COUNT = GetTickCount();

        if ( (rand()%10) == 0 )
        {
            this->Move();
        }
    }

    static int s_iTIME_REMAIN = -1;

    if ( ((this->m_iTIME_MSEC_REMAIN / 1000 ) % 30 ) == 0 && ((this->m_iTIME_MSEC_REMAIN / 1000) / 30) != s_iTIME_REMAIN  )
    {
        s_iTIME_REMAIN = this->m_iTIME_MSEC_REMAIN / 1000 / 30;

        for ( int i=0; i<MAX_RINGMONSTER_MAP; i++)
        {
            BOOL bLive = FALSE;

            for ( int n=0; n<OBJ_STARTUSERINDEX; n++)
            {
                if ( gObj[n].Class == 135 )
                {
                    if ( gObj[n].m_bIsInMonsterHerd )
                    {
                        if ( gObj[n].Live && gObj[n].MapNumber == g_RingEventMapNum[i] )
                        {
                            bLive = TRUE;
                        }
                    }
                }
            }

            LogAddTD("[Ring Event] - per 30'S Inform MapNumber:%d, X:%d, Y:%d, Boss Live:%d",
                     g_RingEventMapNum[i], this->m_RingMonsterHerd[i].GetX(), this->m_RingMonsterHerd[i].GetY(), bLive);
        }
    }

    if ( this->m_iTIME_MSEC_REMAIN <= (this->m_iTIME_MONSTER_TO_DEST * 60 * 1000) && this->m_bMonsterToDest == FALSE )
    {

        for ( int i=0; i<MAX_RINGMONSTER_MAP; i++)
        {
            BYTE iRandX;
            BYTE iRandY;
            BYTE ucRAND;

            ucRAND = rand()%4;
            iRandX = g_RingMapDestPosition[i][ucRAND*2];
            iRandY = g_RingMapDestPosition[i][ucRAND*2+1];

            if ( this->m_RingMonsterHerd[i].MoveHerd(iRandX, iRandY) != FALSE )
            {
                LogAddTD("[Ring Event] - Monster Herd Move MapNumber:%d, X:%d, Y:%d",
                         g_RingEventMapNum[i], iRandX, iRandY);
            }
        }

        this->m_bMonsterToDest = TRUE;
    }

    if ( this->m_iTIME_MSEC_REMAIN <= 0 )
    {
        char szTemp[256];
        wsprintf(szTemp, lMsg.Get(MSGGET(4, 185)));
        AllSendServerMsg(szTemp);

        PMSG_ANS_CL_EFFECT pMsg;

        PHeadSetB((LPBYTE)&pMsg, 0x9E, sizeof(pMsg));
        pMsg.wEffectNum = 2;

        DataSendAll((LPBYTE)&pMsg, pMsg.h.size);

        if ( this->m_bDoEvent )
        {
            this->SetState(1);
        }
        else
        {
            this->SetState(0);
        }

        LogAddTD("[Ring Event] - Event Ended");
    }
}
Ejemplo n.º 7
0
void CRingAttackEvent::ProcState_Closed()
{
    int iTICK_MSEC = GetTickCount() - this->m_iTIME_TICK_COUNT;

    if ( iTICK_MSEC >= 1000 )
    {
        this->m_iTIME_MSEC_REMAIN -= iTICK_MSEC;
        this->m_iTIME_TICK_COUNT = GetTickCount();

        if ( this->m_bDoEvent )
        {
            if ( this->m_iTIME_MSEC_REMAIN <= (this->m_iTIME_MIN_OPEN * 60 * 1000 ) &&
                    this->m_iTIME_MSEC_REMAIN > 0 &&
                    (this->m_iTIME_MSEC_REMAIN / 60000 ) != this->m_iTIME_NOTIFY_COUNT )
            {
                this->m_iTIME_NOTIFY_COUNT = this->m_iTIME_MSEC_REMAIN / 60000;

                if ( (this->m_iTIME_NOTIFY_COUNT+1) == 3 )
                {
                    char szTemp[256];
                    wsprintf(szTemp, lMsg.Get(MSGGET(4, 183)));
                    AllSendServerMsg(szTemp);

                    PMSG_ANS_CL_EFFECT pMsg;

                    PHeadSetB((LPBYTE)&pMsg, 0x9E, sizeof(pMsg));
                    pMsg.wEffectNum = 0;

                    DataSendAll((LPBYTE)&pMsg, pMsg.h.size);

                    LogAddTD("[Ring Event] - Before 3 minutes - Advertise");
                }
            }
        }
    }

    if ( this->m_iTIME_MSEC_REMAIN <= 0 )
    {
        char szTemp[256];
        wsprintf(szTemp, lMsg.Get(MSGGET(4, 184)));
        AllSendServerMsg(szTemp);

        PMSG_ANS_CL_EFFECT pMsg;

        PHeadSetB((LPBYTE)&pMsg, 0x9E, sizeof(pMsg));
        pMsg.wEffectNum = 1;

        DataSendAll((LPBYTE)&pMsg, pMsg.h.size);

        if ( this->m_bDoEvent )
        {
            this->SetState(2);
        }
        else
        {
            this->SetState(0);
        }

        LogAddTD("[Ring Event] - Event Started");
    }
}