void CParty::ReplaceLodestar( const CRect &rect ) { // locked CUser* pUser; for( int i = 0; i < m_nSizeofMember; i ++ ) // 극단원 모두에게 듀얼 해제를 세팅하고 클라에도 알림. { pUser = g_UserMng.GetUserByPlayerID( m_aMember[i].m_uPlayerId ); if( IsValidObj( pUser ) ) { CWorld* pWorld = pUser->GetWorld(); if( pWorld ) { POINT point = { (int)pUser->GetPos().x, (int)pUser->GetPos().z }; if( rect.PtInRect( point ) ) { PRegionElem pRgnElem = NULL; if( pWorld->GetID() != pWorld->m_dwIdWorldRevival && pWorld->m_dwIdWorldRevival != 0 ) pRgnElem = g_WorldMng.GetRevivalPos( pWorld->m_dwIdWorldRevival, pWorld->m_szKeyRevival ); if( !pRgnElem ) // Find near revival pos pRgnElem = g_WorldMng.GetNearRevivalPos( pWorld->GetID(), pUser->GetPos() ); if( pRgnElem ) pUser->REPLACE( g_uIdofMulti, pRgnElem->m_dwWorldId, pRgnElem->m_vPos, REPLACE_NORMAL, nRevivalLayer ); } } } } }
// 클라용 대전 가능한 유저인가? BOOL CGuildCombat1to1Mng::IsPossibleMover( CMover* pMover ) { if( !pMover ) return FALSE; CWorld* pWorld = pMover->GetWorld(); if( pWorld ) { if( pWorld->GetID() >= WI_WORLD_GUILDWAR1TO1_0 && pWorld->GetID() <= WI_WORLD_GUILDWAR1TO1_L ) { if( pMover->m_nGuildCombatState != 0 ) return TRUE; } } return FALSE; }
// 대전 가능한 대상인가? BOOL CGuildCombat1to1::IsPossibleUser( CUser* pUser ) { if( !pUser ) return FALSE; int nIndex = g_GuildCombat1to1Mng.GetTenderGuildIndexByUser( pUser ); if( nIndex != NULL_ID ) { CWorld* pWorld = pUser->GetWorld(); if( pWorld && pWorld->GetID() == m_vecTenderGuild[nIndex].dwWorldId ) return TRUE; } return FALSE; }
void CCreateMonster::CreateMonster( CUser* pUser, DWORD dwObjId, D3DXVECTOR3 vPos ) { if( (int)( m_mapCreateMonsterInfo.size() ) >= m_nMaxCreateNum ) { pUser->AddDefinedText( TID_GAME_CREATEMON_LIMIT ); return; } CItemElem* pItemElem = pUser->m_Inventory.GetAtId( dwObjId ); if( !IsUsableItem( pItemElem ) ) return; CREATE_MONSTER_PROP* pCreateMonsterProp = GetCreateMonsterProp( pItemElem ); if( !pCreateMonsterProp ) return; DWORD dwMonsterId = pCreateMonsterProp->GetRandomMonsterId(); if( dwMonsterId == NULL_ID ) return; CWorld* pWorld = pUser->GetWorld(); MoverProp* pMoverProp = prj.GetMoverProp( dwMonsterId ); if( pWorld && pMoverProp && pMoverProp->dwID != 0 ) { D3DXVECTOR3 vDist2 = pUser->GetPos() - vPos; float fDist = D3DXVec3Length( &vDist2 ); // 두좌표간의 거리 if( 15.f < fDist ) { pUser->AddDefinedText( TID_GAME_CREATEMON_F_15 ); return; } int nAttr = pWorld->GetHeightAttribute( vPos.x, vPos.z ); // 이동할 위치의 속성 읽음. if( nAttr == HATTR_NOWALK || nAttr == HATTR_NOMOVE ) // 못 움직이는 곳이면 Pass { pUser->AddDefinedText( TID_GAME_CREATEMON_F_AREA ); return; } if( pUser->IsRegionAttr( RA_SAFETY )) // 안전지역이면 Pass { pUser->AddDefinedText( TID_GAME_CREATEMON_F_AREA ); return; } if( pWorld->GetID() != WI_WORLD_MADRIGAL ) { pUser->AddDefinedText( TID_GAME_CREATEMON_F_AREA ); return; } CObj* pObj = CreateObj( D3DDEVICE, OT_MOVER, pMoverProp->dwID ); if( NULL == pObj ) return; // ASSERT( pObj ); pObj->SetPos( vPos ); pObj->InitMotion( MTI_STAND ); pObj->UpdateLocalMatrix(); ((CMover*)pObj)->m_bActiveAttack = FALSE; ((CMover*)pObj)->AddItToGlobalId(); pWorld->ADDOBJ( pObj, FALSE, pUser->GetLayer() ); LogItemInfo aLogItem; aLogItem.Action = "i"; aLogItem.SendName = pUser->GetName(); char szTemp[128] = {0,}; sprintf( szTemp, "M_C_%s", pMoverProp->szName ); memset( szTemp+31, 0, sizeof(szTemp)-31 ); aLogItem.RecvName = szTemp; aLogItem.Gold = aLogItem.Gold2 = pUser->GetGold(); aLogItem.Gold_1 = ((CMover*)pObj)->GetId(); aLogItem.WorldId = pUser->GetWorld()->GetID(); g_DPSrvr.OnLogItem( aLogItem, pItemElem, 1 ); pUser->AddDefinedText( TID_GAME_CREATEMON_S, "\"%s\"", pMoverProp->szName ); pUser->RemoveItem( (BYTE)( dwObjId ), (short)( 1 ) ); CREATE_MONSTER_INFO createMonsterInfo; createMonsterInfo.chState = 'N'; createMonsterInfo.dwOwnerId = pUser->m_idPlayer; createMonsterInfo.dwEndTick = pCreateMonsterProp->dwKeepTime + GetTickCount(); m_mapCreateMonsterInfo.insert( make_pair( ((CMover*)pObj)->GetId(), createMonsterInfo ) ); } }