예제 #1
0
void CDoppelganger::ClearMonsters()
{
	int Map = this->EventMap - 65;

	for(int X=0; X < DOPPELGANGER_MAX_MONSTERS;X++){
		if(this->CurrentMonster[X] > 0){
			if(gObj[this->CurrentMonster[X]].MapNumber == this->EventMap){
				gObjDel(this->CurrentMonster[X]);
				this->CurrentMonster[X] = -1;
			}
		}
	}
	
	///Clear Larvas
	for(int X=0; X < 5;X++){
		if(this->Larvas[X] > 0){
			if(gObj[this->Larvas[X]].MapNumber == this->EventMap){
				gObjDel(this->Larvas[X]);
				this->Larvas[X] = -1;
			}
		}
	}
		
	//Clear Chest's
	for(int X=0; X < 2;++X){
		if(this->SiverChestIndex[X] != NULL){
			if(gObj[this->SiverChestIndex[X]].MapNumber == this->EventMap){
				gObjDel(this->SiverChestIndex[X]);
				this->SiverChestIndex[X] = -1;
			}
		}
	}

	for(int X=0; X < 3;++X){
		if(this->MonsterBoss[X] != NULL){
			if(gObj[this->MonsterBoss[X]].MapNumber == this->EventMap){
				gObjDel(this->MonsterBoss[X]);
				this->MonsterBoss[X] = -1;
			}
		}
	}
	
	this->GoldenChestIndex = -1;
	this->MonstersCount = 0;

	LogAddTD("[Doppelganger] Monster Cleared");
}
예제 #2
0
BOOL NpcAdniel(LPOBJ lpNpc,LPOBJ lpObj )
{
	if ( bCanChaosBox == TRUE )
	{
		PMSG_TALKRESULT pMsg;

		pMsg.h.c = 0xC3;
		pMsg.h.headcode = 0x30;
		pMsg.h.size = sizeof(pMsg);
		
		if ( lpObj->m_bPShopOpen == true )
		{
			LogAdd("[%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;
		

		// 39 - entering acheron
		// 40 - arca war npc
		// 41 - mix npc

		pMsg.result = 41;
		lpObj->bIsChaosMixCompleted = false;
		pMsg.level1 = gDQChaosSuccessRateLevel1;
		pMsg.level2 = gDQChaosSuccessRateLevel2;
		pMsg.level3 = gDQChaosSuccessRateLevel3;
		pMsg.level4 = gDQChaosSuccessRateLevel4;
		pMsg.level5 = gDQChaosSuccessRateLevel5;
		pMsg.level6 = gDQChaosSuccessRateLevel6;

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

		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);
	}
	return true;
}
예제 #3
0
void CGReqProgressQuestInfo(PMSG_REQ_QUESTEXP_PROGRESS_INFO *pMsg, int aIndex)
{
    if( !OBJMAX_RANGE(aIndex) )
        return;

    if( !gObjIsConnected(aIndex) )
        return;

    if( !g_QuestExpProgMng.ChkQuestIndexIDToEpLimit(pMsg->quest_info_index_id, aIndex) )
    {
        LogAddTD("[QuestExp] - Error - [%s] [%d]", __FILE__, __LINE__);
        return;

    }    

    g_QuestExpProgMng.SendQuestProgressInfo(pMsg->quest_info_index_id, aIndex);
}
예제 #4
0
int CLifeStone::DeleteLifeStone(int iIndex)
{
	if(iIndex < 0 || iIndex > OBJMAX)
	{
		return false;
	}

	LPOBJ lpLifeStone = &gObj[iIndex];

	if(lpLifeStone->lpGuild != NULL)
	{
		LogAddTD("[CastleSiege] LifeStone is broken - [%s]",
			lpLifeStone->lpGuild->Name);
		lpLifeStone->lpGuild->lpLifeStone = NULL;
	}
	return true;
}
void CKanturuBattleOfNightmare::ProcState_START()
{
	KANTURU_UTIL.NotifyKanturuUserMonsterCount(g_KanturuMonsterMng.GetAliveMonsterCount(),
		g_KanturuBattleUserMng.GetUserCount());

	int iIndex = this->m_iNightmareObjIndex;

	if ( gObj[iIndex].Live == FALSE )
	{
		this->SetSuccessValue(TRUE);

		LogAddTD("[ KANTURU ][ BattleOfNightmare ] Success!! Nightmare Die");
		g_KanturuBattleUserMng.LogBattleWinnerUserInfo(3, this->m_StateInfo[this->m_iBattleOfNightmareState].GetElapsedTime());

		this->SetNextState(this->m_iBattleOfNightmareState);
	}
}
예제 #6
0
int CLifeStone::DeleteLifeStone(int iIndex) //Identical
{

	if(iIndex < 0 || iIndex > OBJMAX - 1)
	{
		return FALSE;
	}

	LPOBJ lpLifeStone = &gObj[iIndex];

	if(lpLifeStone->lpGuild)
	{
		LogAddTD("[CastleSiege] LifeStone is broken - [%s]",lpLifeStone->lpGuild->Name);
		lpLifeStone->lpGuild->lpLifeStone = 0;
	}
	return TRUE;
}
예제 #7
0
int CCrywolf::CalcGettingScore(int iUserIndex, int iMonIndex, int iScoreType)
{
	if ( !gObjIsConnected(iUserIndex))
		return -1;

	int iAddMVPScore = 0;

	if ( CHECK_LIMIT(iMonIndex, OBJ_MAXMONSTER) != FALSE )
	{
		switch ( gObj[iMonIndex].Class )
		{
			case 349:
				iAddMVPScore = this->m_iMVPScoreTable[0];
				break;
			case 340:
				iAddMVPScore = this->m_iMVPScoreTable[1];
				break;
			case 344:
				iAddMVPScore = this->m_iMVPScoreTable[2];
				break;
			case 341:
				iAddMVPScore = this->m_iMVPScoreTable[3];
				break;
			case 345:
				iAddMVPScore = this->m_iMVPScoreTable[4];
				break;
			case 348:
				iAddMVPScore = this->m_iMVPScoreTable[5];
				break;
		}
	}

	if ( iScoreType == 6 )
	{
		iAddMVPScore = this->m_iMVPScoreTable[6];
	}

	gObj[iUserIndex].m_iCrywolfMVPScore += iAddMVPScore;

	LogAddTD("[ Crywolf ][MVP] Plus MVP Score : %d, Accumulated : %d [%s][%s]",
		iAddMVPScore, gObj[iUserIndex].m_iCrywolfMVPScore,
		gObj[iUserIndex].AccountID, gObj[iUserIndex].Name);

	return gObj[iUserIndex].m_iCrywolfMVPScore;
}
예제 #8
0
int CCrywolf::CheckStateTimeSync()
{
	if (this->m_iCrywolfState != CRYWOLF_STATE_NONE )
	{
		if ( this->m_StateTimeInfo[this->m_iCrywolfState].m_bUsed == FALSE )
		{
			return -1;
		}

		DWORD dwTime = GetTickCount();

		if ( this->m_StateTimeInfo[this->m_iCrywolfState].CheckContinuanceTime() == FALSE )
		{
			this->m_StateTimeInfo[this->m_iCrywolfState].ResetAppliedTime();

			if ( this->m_iCrywolfState == CRYWOLF_STATE_ENDCYCLE )
			{
				if ( this->m_iScheduleMode == 1 )
				{
					this->SetState(CRYWOLF_STATE_NOTIFY_1);
				}
				else
				{
					this->SetState(CRYWOLF_STATE_NONE);
				}
			}
			else
			{
				this->SetNextState(this->m_iCrywolfState);
			}
		}
		return 1;
	}

	for ( int i=0;i<m_StartTimeInfoCount;i++)
	{
		if ( this->m_StartTimeInfo[i].CheckScheduleTime() != FALSE )
		{
			LogAddTD("[ Crywolf ] Start Crywolf");
			this->SetState(this->m_StartTimeInfo[i].m_iStateNumber);
		}
	}

	return 0;
}
예제 #9
0
//5C9A60
void CCashItemPeriodSystem::GDReqPeriodItemInsert(LPOBJ lpObj, int iItemCode, int iItemEffectDate)//Identical
{
	PMSG_REQ_PERIODITEM_INSERT pMsg;
	int iEffectType1 =0;
	int iEffectType2 =0;
	CTime tExpireDate;
	int iEffectTime = 0;

	if( g_ItemAddOption.SearchItemEffectType(iItemCode, &iEffectType1, &iEffectType2, &iEffectTime) == false )
	{
		return;
	}

	if( iItemEffectDate == -1 )
	{
		iItemEffectDate = iEffectTime / 60;
	}

	int iOptionType = g_ItemAddOption.SearchItemOptionType(iItemCode);

	if( iOptionType == -1 )
	{
		return;
	}

	pMsg.btOptionType = iOptionType;
	pMsg.iUserIndex = lpObj->m_Index;
	pMsg.iUserGuid = lpObj->DBNumber;
	pMsg.iItemCode = iItemCode;
	pMsg.btItemEffectType1 = iEffectType1;
	pMsg.btItemEffectType2 = iEffectType2;
	pMsg.iItemPeriodDate = iItemEffectDate;
	memcpy(pMsg.chUserID, lpObj->Name, sizeof(pMsg.chUserID));

	tExpireDate = this->CalcItemUseEndTime(iItemEffectDate);

	wsprintf(pMsg.chExpireDate, "%d-%d-%d %d:%d", tExpireDate.GetYear(), tExpireDate.GetMonth(), tExpireDate.GetDay(), tExpireDate.GetHour(), tExpireDate.GetMinute());

	PHeadSubSetB((LPBYTE)&pMsg, 0xD0, 0x03, sizeof(PMSG_REQ_PERIODITEM_INSERT));

	cDBSMng.Send((char *)&pMsg, sizeof(PMSG_REQ_PERIODITEM_INSERT));

	LogAddTD("[CashShop][PeriodItemInsert Req] - ID : %s, Name : %s, ItemCode : %d, Effect1 : %d, Effect2 : %d, UseTime : %d, ExpireDate : %s",
		lpObj->AccountID, lpObj->Name, pMsg.iItemCode, pMsg.btItemEffectType1, pMsg.btItemEffectType2, pMsg.iItemPeriodDate, pMsg.chExpireDate);
}
예제 #10
0
//006bd260
void CPeriodItemEx::DGPeriodItemExSelect(PMSG_ANS_PERIODITEMEX_SELECT* lpMsg)	//OK
{
	int iIndex = lpMsg->wUserIndex;

	if( iIndex < 0 || iIndex >= OBJMAX )
		return;

	LPOBJ lpObj = &gObj[iIndex];

	if( lpObj == NULL )
		return;

	if( lpObj->Type != OBJ_USER ||
		lpObj->Connected < PLAYER_LOGGED )
		return;

	if( lpMsg->btResultCode > 0 )
	{
		PERIOD_ITEMLIST ItemList;
		memcpy(&ItemList,&lpMsg->ItemList,sizeof(ItemList));

		int iItemCount = ItemList.btItemCount;
		DWORD dwDuration;

		for(int i = 0; i < iItemCount; i++)
		{
			dwDuration = this->GetLeftDate(ItemList.ItemData[i].lItemExpireDate);

			if( ItemList.ItemData[i].btItemType == 1 )
			{
				gObjAddBuffEffectForInGameShop(lpObj,ItemList.ItemData[i].wItemCode,dwDuration);
			}
			else if( ItemList.ItemData[i].btItemType == 2 )
			{
				AddPeriodItemData(lpObj,ItemList.ItemData[i].wItemCode,ItemList.ItemData[i].dwSerial,dwDuration,ItemList.ItemData[i].lItemExpireDate);
			}
	
			LogAddTD("[PeriodItemEx][SelectItemList] User Id : %s(%d), Name : %s, Item Code : %d(%s), PeriodType : %d, Serial : %u, Duration : %d, ExpireDate : %d",
				lpObj->AccountID,lpObj->DBNumber,lpObj->Name,ItemList.ItemData[i].wItemCode,ItemAttribute[ItemList.ItemData[i].wItemCode].Name,ItemList.ItemData[i].btItemType,
				ItemList.ItemData[i].dwSerial,dwDuration,ItemList.ItemData[i].lItemExpireDate);
		}
		//GCItemListSend(lpObj->m_Index);//test
		OnRequestPeriodItemList(lpObj);
	}
}
예제 #11
0
//00553c90	-> 100%
void CMasterLevelSystem::GDReqMasterLevelInfo(LPOBJ lpObj)	//OK
{
	if( lpObj->m_bMasterLevelDBLoad )
	{
		return;
	}
	// ----
	MLP_REQ_MASTERLEVEL_INFO pMsg;
	pMsg.h.set((LPBYTE)&pMsg, 0x30, sizeof(MLP_REQ_MASTERLEVEL_INFO));
	// ----
	pMsg.iUserIndex = lpObj->m_Index;
    memcpy(pMsg.szCharName, lpObj->Name, MAX_IDSTRING);
    pMsg.szCharName[MAX_IDSTRING] = 0;
	// ----
    cDBSMng.Send((char*)&pMsg, pMsg.h.size);
	// ----
    LogAddTD("[%s][%s] Request master level info to DB", lpObj->AccountID, lpObj->Name);
}
void CRaklionSelupan::SelupanAct_Teleport()
{
	return;

	int aIndex = this->GetSelupanObjIndex();
	int tIndex = this->GetSelupanTargetIndex();

	LPOBJ lpObj = &gObj[aIndex];
	LPOBJ lpTargetObj = &gObj[tIndex];
	
	if ( tIndex < 0 )
	{
		tIndex = aIndex;
	}

	TMonsterSkillManager::UseMonsterSkill(aIndex, tIndex, 1, 7, NULL);
	LogAddTD("[ RAKLION ][ Teleport ] Skill Using : Index(%d) %s", aIndex,lpObj->Name);
}
void CRaklionSelupan::SelupanAct_Freeze()
{
	int aIndex = this->GetSelupanObjIndex();
	int tIndex = this->GetSelupanTargetIndex();

	LPOBJ lpObj = &gObj[aIndex];

	if ( tIndex == -1 )
	{
		tIndex = aIndex;
		TMonsterSkillManager::UseMonsterSkill(aIndex, tIndex, 1, 7, NULL);
	}
	else
	{
		TMonsterSkillManager::UseMonsterSkill(aIndex, tIndex, 1, 6, NULL);
	}
	LogAddTD("[ RAKLION ][ Freeze ] Skill Using : Index(%d) %s", aIndex,lpObj->Name);
}
예제 #14
0
void CHacktoolBlockEx::RemoveHacktoolData(WORD wHacktoolIndex, char * pchFilename)
{
	for( int i = 0; i < HACKTOOL_DATA_SIZE; i++ )
	{
		if(		this->m_HacktoolData[i].bIsUsed == 1 
			&&	this->m_HacktoolData[i].wIndex	== wHacktoolIndex )
		{
			if( !strcmp(this->m_HacktoolData[i].chFilename, pchFilename) )
			{
				LogAddTD("[HacktoolBlockEx][Remove Hacktool Data] Remove Data Name : %s, Index : %d, CheckType : %d, BlockType : %d",
					this->m_HacktoolData[i].chFilename, this->m_HacktoolData[i].wIndex,
					this->m_HacktoolData[i].btHackCheckType, this->m_HacktoolData[i].btHackBlockType);
				// ----
				this->m_HacktoolData[i].Clear();
			}
		}
	}
}
예제 #15
0
//----- (00563D30) --------------------------------------------------------
BOOL CMercenary::DeleteMercenary(int iIndex)
{
	if ( OBJMAX_RANGE(iIndex) == FALSE )
	{
		return FALSE;
	}

	this->m_iMercenaryCount--;

	LogAddTD("[CastleSiege] Mercenary is broken [%d] - [%d]", iIndex, this->m_iMercenaryCount);

	if ( this->m_iMercenaryCount < 0 )
	{
		this->m_iMercenaryCount = 0;
	}

	return TRUE;
}
예제 #16
0
//006bce80
void CPeriodItemEx::RequestPeriodItemDelete(LPOBJ lpObj,ITEMDATA* lpItemData)	//OK
{
	PMSG_REQ_PERIODITEMEX_DELETE pMsg;
	pMsg.wUserIndex = lpObj->m_Index;
	pMsg.dwUserGuid = lpObj->DBNumber;
	memcpy(pMsg.chCharacterName,lpObj->Name,11);

	pMsg.wItemCode = lpItemData->wItemCode;
	pMsg.btItemType = lpItemData->btType;
	pMsg.dwSerial = lpItemData->dwSerial;

	PHeadSubSetB((LPBYTE)&pMsg,0xD1,0x02,sizeof(pMsg));

	LogAddTD("[PeriodItemEx][Delete PeriodItem] Request Delete PeriodItem Data. User Id : %s(%d), Name : %s, Item : %s(%d), Type : %d, Serial : %u",
		lpObj->AccountID,lpObj->DBNumber,lpObj->Name,ItemAttribute[lpItemData->wItemCode].Name,lpItemData->wItemCode,lpItemData->btType,lpItemData->dwSerial);

	cDBSMng.Send((char*)&pMsg,sizeof(pMsg));
}
예제 #17
0
int TMonsterAIGroup::FindGroupLeader(int iGroupNumber)
{
    if ( iGroupNumber < 0 || iGroupNumber >= MAX_MONSTER_AI_GROUP )
    {
        LogAddTD("[Monster AI Group] FindGroupLeader() Error - (GroupNumber=%d)", iGroupNumber);
        return -1;
    }

    for ( int i=0; i<MAX_MONSTER_AI_GROUP_MEMBER; i++)
    {
        if ( TMonsterAIGroup::s_MonsterAIGroupMemberArray[iGroupNumber][i].m_iRank == 0 )
        {
            return TMonsterAIGroup::s_MonsterAIGroupMemberArray[iGroupNumber][i].m_iObjIndex;
        }
    }

    return -1;
}
예제 #18
0
void CKanturuBattleUserMng::LogBattleWinnerUserInfo(BYTE btFlag, int iElapsedTime)
{
	int iIndex = -1;
	float fTime = iElapsedTime / 1000.0f;

	for ( int iCount=0;iCount<MAX_KANTURU_BATTLE_USER;iCount++)
	{
		if ( this->m_BattleUser[iCount].IsUseData() == TRUE )
		{
			iIndex = this->m_BattleUser[iCount].GetIndex();
			
			LogAddTD("[ KANTURU ][ BATTLE WINNER ] [%d/ElapsedTime:%0.3f] [%s][%s] MapNumber[%d]-(%d/%d)",
				btFlag, fTime, gObj[iIndex].AccountID, gObj[iIndex].Name,
				gObj[iIndex].MapNumber, gObj[iIndex].X, gObj[iIndex].Y);

		}
	}
}
예제 #19
0
int TMonsterAIGroup::FindGroupMemberObjectIndex(int iGroupNumber, int iGuid)
{
    if ( iGroupNumber < 0 || iGroupNumber >= MAX_MONSTER_AI_GROUP )
    {
        LogAddTD("[Monster AI Group] FindGroupMemberObjectIndex() Error - (GroupNumber=%d Guid=%d)", iGroupNumber, iGuid);
        return -1;
    }

    for ( int i=0; i<MAX_MONSTER_AI_GROUP_MEMBER; i++)
    {
        if ( TMonsterAIGroup::s_MonsterAIGroupMemberArray[iGroupNumber][i].m_iGuid == iGuid )
        {
            return TMonsterAIGroup::s_MonsterAIGroupMemberArray[iGroupNumber][i].m_iObjIndex;
        }
    }

    return -1;
}
예제 #20
0
void CGReqEventItemQuestList(PMSG_REQ_EVENT_ITEM_EP_LIST *pMsg, int aIndex)
{
    if( !OBJMAX_RANGE(aIndex) )
        return;

    if( !gObjIsConnected(aIndex) )
        return;

    lua_State* L = g_MuLuaQuestExp.GetLua();

    if( !L )
    {
        LogAddTD("[QuestExp] - Error - [%s] [%d]", __FILE__, __LINE__);
        return;
    }

    g_Generic_Call(L, "ItemAndEvent", "i>", aIndex);
}
예제 #21
0
BOOL CRingMonsterHerd::MonsterHerdItemDrop(LPOBJ lpObj)
{

    if ( lpObj->Class == 135 )
    {
        int iIndex = gObjMonsterTopHitDamageUser(lpObj);
        int itemnumber = ItemGetNumberMake(14, 13);
        ItemSerialCreateSend(lpObj->m_Index, lpObj->MapNumber, lpObj->X, lpObj->Y,
                             itemnumber, 0, 0, 0, 0, 0, iIndex, 0, 0);
        char szTemp[256];
        wsprintf(szTemp, lMsg.Get(MSGGET(4, 181)), gObj[iIndex].Name, gMapName[lpObj->MapNumber]);	// #error Apply Deathway fix here
        AllSendServerMsg( szTemp );
        LogAddTD("[Ring Event] White Wizard Killed by [%s][%s], MapNumber:%d",
                 gObj[iIndex].AccountID, gObj[iIndex].Name, gObj[iIndex].MapNumber);

        return TRUE;

    }

    if ( lpObj->Class == 136 || lpObj->Class == 137)
    {
        if ( (rand()%100) < 30 )
        {
            int iIndex = gObjMonsterTopHitDamageUser(lpObj);
            int itemnumber = ItemGetNumberMake(13, 20);	// Wizards Ring
            ItemSerialCreateSend(lpObj->m_Index, lpObj->MapNumber, lpObj->X, lpObj->Y,
                                 itemnumber, 0, 30, 0, 0, 0, iIndex, 0, 0);
            return TRUE;
        }

        if ( (rand() % g_iRingOrcKillGiftRate) == 0 )
        {
            int iIndex = gObjMonsterTopHitDamageUser(lpObj);
            this->SendEventGiftWinner(iIndex, 1);
            return TRUE;
        }

        MapC[lpObj->MapNumber].MoneyItemDrop(10000, (BYTE)lpObj->X, (BYTE)lpObj->Y);
        return TRUE;
    }

    return FALSE;

}
예제 #22
0
//00554960	-> 100%
void CMasterLevelSystem::GCMasterLevelUpInfo(LPOBJ lpObj)	//OK
{
	PMSG_MASTERLEVEL_UP pMsg;
	PHeadSubSetB(&pMsg.h.c, 0xF3, 0x51, 0x20);
	// ----
	pMsg.nMLevel		= lpObj->m_nMasterLevel;
	pMsg.nAddMLPoint	= 1;
	pMsg.nMLPoint		= lpObj->m_iMasterLevelPoint;
	pMsg.nMaxMLPoint	= MASTER_MAX_POINT;
	pMsg.wMaxLife		= (double)lpObj->AddLife + lpObj->MaxLife;
	pMsg.wMaxMana		= (double)lpObj->AddMana + lpObj->MaxMana;
	pMsg.wMaxShield		= LOWORD(lpObj->iAddShield) + LOWORD(lpObj->iMaxShield);
	pMsg.wMaxBP			= LOWORD(lpObj->AddBP) + LOWORD(lpObj->MaxBP);
	// ----
	DataSend(lpObj->m_Index, (LPBYTE)&pMsg, pMsg.h.size);
	GCSendEffectInfo(lpObj->m_Index, 16);
	// ----
	LogAddTD("[%s][%s] Master Level Up :%d, MLPoint:%d/%d", lpObj->AccountID, lpObj->Name, lpObj->m_nMasterLevel, lpObj->m_iMasterLevelPoint, MASTER_MAX_POINT);
}
예제 #23
0
void CDevilSquareGround::RegenBossMonster(int currtime)
{
	for ( int i=0;i<MAX_ST_DEVILSQUARE_MONSTER;i++)
	{
		if ( this->m_DevilSquareBossMonsterInfo[i].m_Type != (WORD)-1 )
		{
			if ( currtime == this->m_DevilSquareBossMonsterInfo[i].m_RegenStartTime )
			{
				int iMapNumber = (this->m_DevilSquareBossMonsterInfo[i].m_iDevilSquareNumber >= DEVIL_SQUARE_GROUND_1&& this->m_DevilSquareBossMonsterInfo[i].m_iDevilSquareNumber <= DEVIL_SQUARE_GROUND_4)?MAP_INDEX_DEVILSQUARE:(this->m_DevilSquareBossMonsterInfo[i].m_iDevilSquareNumber>=DEVIL_SQUARE_GROUND_5  && this->m_DevilSquareBossMonsterInfo[i].m_iDevilSquareNumber < 7 )?MAP_INDEX_DEVILSQUARE2:-1;

				int iMonIndex = gObjAddMonster(iMapNumber);

				if ( iMonIndex >= 0 )
				{
					gObjSetMonster(iMonIndex, this->m_DevilSquareBossMonsterInfo[i].m_Type);
					gObj[iMonIndex].MapNumber = iMapNumber;
					gMSetBase.GetBoxPosition(gObj[iMonIndex].MapNumber,
						this->m_DevilSquareBossMonsterInfo[i].X, this->m_DevilSquareBossMonsterInfo[i].Y,
						this->m_DevilSquareBossMonsterInfo[i].TX, this->m_DevilSquareBossMonsterInfo[i].TY,
						gObj[iMonIndex].X, gObj[iMonIndex].Y);
					int map = gObj[iMonIndex].MapNumber;
					int x = gObj[iMonIndex].X;
					int y = gObj[iMonIndex].Y;

					LogAddTD("[DevilSquare] Boss %d %d %d create ", map, x, y);

					gObj[iMonIndex].TX = gObj[iMonIndex].X;
					gObj[iMonIndex].TY = gObj[iMonIndex].Y;
					gObj[iMonIndex].MTX = gObj[iMonIndex].X;
					gObj[iMonIndex].MTY = gObj[iMonIndex].Y;
					gObj[iMonIndex].StartX = gObj[iMonIndex].X;
					gObj[iMonIndex].StartY = gObj[iMonIndex].Y;
					gObj[iMonIndex].m_bDevilSquareIndex = this->m_iIndex;
					gObj[iMonIndex].DieRegen = FALSE;
					gObj[iMonIndex].m_PosNum = -1;
					gObj[iMonIndex].Live = TRUE;
					gObj[iMonIndex].m_State = 1;
				}
			}
		}
	}
}
예제 #24
0
BOOL NpcChaosCardMaster(LPOBJ lpNpc, LPOBJ lpObj)
{
	if ( g_bUseLotterySystem == FALSE )
		return FALSE;

	if ( bCanChaosBox == TRUE )
	{
		if ( lpObj->m_IfState.use > 0 )
			return FALSE;

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

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

		PMSG_TALKRESULT pMsg;

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

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

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

		gObjInventoryTrans(lpObj->m_Index);

		LogAddTD("[JewelMix] [%s][%s] Jewel Mix Dealer Start",
			lpObj->AccountID, lpObj->Name);

		gObjItemTextSave(lpObj);
		gObjWarehouseTextSave(lpObj);
	}

	return TRUE;
}
예제 #25
0
void CCrywolf::NotifyCrywolfBossMonsterInfo()
{
	static DWORD dwTickCount = 0;

	if ( (GetTickCount() - dwTickCount) < 5000 )
		return;

	dwTickCount = GetTickCount();

	PMSG_ANS_CRYWOLF_BOSSMONSTER_INFO pMsg;

	PHeadSubSetB((LPBYTE)&pMsg, 0xBD, 0x05, sizeof(pMsg));
	pMsg.iMonster1HP = -1;
	pMsg.btMonster2 = 0;

	for ( int i=0;i<OBJ_MAXMONSTER;i++)
	{
		if (!gObjIsConnected(i))
			continue;

		if ( gObj[i].MapNumber != MAP_INDEX_CRYWOLF_FIRSTZONE )
			continue;

		if ( !gObj[i].Live )
			continue;

		switch ( gObj[i].Class )
		{
			case 340:
				pMsg.btMonster2++;
				break;
			case 349:
				pMsg.iMonster1HP = (gObj[i].Life * 100.0f) / (gObj[i].MaxLife + 1.0f);
				break;
		}
	}

	UTIL.SendCrywolfUserAnyData((LPBYTE)&pMsg,sizeof(pMsg));

	LogAddTD("[ Crywolf ][Boss Monster Info] Balgars HP:%d, DarkElf:%d",
		pMsg.iMonster1HP, pMsg.btMonster2);
}
예제 #26
0
void DestroyGIocp()
{
    LogAddTD("Error-L10");

    closesocket(g_Listen);

    for (DWORD dwCPU=0; dwCPU < g_dwThreadCount; dwCPU++ )
    {
        TerminateThread( g_ThreadHandles[dwCPU] , 0);
    }

    TerminateThread(g_IocpThreadHandle, 0);

    if ( g_CompletionPort != NULL )
    {
        CloseHandle(g_CompletionPort);
        g_CompletionPort=NULL;
    }

}
void CRaklionSelupan::SelupanAct_Berserk4()
{
	int aIndex = this->GetSelupanObjIndex();
	int tIndex = aIndex;

	LPOBJ lpObj = &gObj[aIndex];

	TMonsterSkillManager::UseMonsterSkill(aIndex, tIndex, 1, 9, NULL);
	
	this->m_iBerserkIndex = 4;

	int loc5 = 0;
	loc5 = this->m_iBerserkIndex * lpObj->m_MonsterSkillElementInfo.m_iSkillElementAttack;

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


	LogAddTD("[ RAKLION ][ Berserk4 ] Skill Using : Index(%d) Damage(%d~%d)",aIndex,lpObj->m_AttackDamageMin,lpObj->m_AttackDamageMax);
}
예제 #28
0
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();
	}
}
예제 #29
0
void CDoppelganger::CheckPartyMembers(){
	
	for(int X=0; X < 5; X++){ //Here send all Information to Party Members

		if(this->Player[X] >= OBJ_STARTUSERINDEX){ 

			//Check if Principal Player was Online in Party if was Required and in Event Map
			if(gObjIsConnected(this->Player[X]) == FALSE || gObj[this->Player[X]].MapNumber != this->EventMap){

				if(X == 0){ //Player 0, the Party Creator
					this->Status = FAILED; //Failed
					this->State = FINISHED;
					LogAddTD("[Doppelganger] Main Party Member was Out of Event - EVENT FINISH FAILED");
				} else {
					this->Player[X] = -1;
				}
			}
		}
	}
}
예제 #30
0
void CDoppelganger::CheckMonsterPassed(){

	
	if(this->State != RUNNING) return;

	for(int i=0; i < (OBJ_STARTUSERINDEX-1);i++){

		if(DOPPELGANGER_MAP_RANGE(gObj[i].MapNumber)){

			if((gObj[i].Class >= 533 || gObj[i].Class <= 539) && gObj[i].Live){
				if(gObj[i].X <= this->PosX[this->EventMap-65] && gObj[i].Y <= this->PosY[this->EventMap-65]){
					gObj[i].Life = FALSE;
					gObjDel(i);
					this->MonsterPassed++;
					LogAddTD("[Doppelganger][%d] Monster Passed to Protected Zone",gObj[i].m_Index);
				}
			}
		}
	}
}