FOR_LINKMAP( GetWorld(), vPos, pObj, nRange, CObj::linkPlayer, GetLayer() ) { if( pObj->GetType() == OT_MOVER ) // 대상이 무버일때만. { CMover *pTarget = (CMover *)pObj; if( pTarget->IsLive() && pAttacker != pTarget ) { if( pObj->IsRangeObj( vPos, 1.0f ) ) { #if __VER >= 9 // __SKILL_0706 int n = 0; if( bPVP && pAttacker->IsPVPTarget( pTarget ) ) n = pTarget->m_pActMover->SendDamage( AF_FORCE, pAttacker->GetId(), nDamagePVP, FALSE ); else if( bPVP && (m_bControl || pAttacker->IsGuildCombatTarget( pTarget ) /*아레나 추가*/ || pAttacker->IsArenaTarget( pTarget ) ) ) n = pTarget->m_pActMover->SendDamage( AF_FORCE, pAttacker->GetId(), nDamage, FALSE ); #else // __SKILL_0706 int n = pTarget->m_pActMover->SendDamage( AF_FORCE, pAttacker->GetId(), nDamage, FALSE ); #endif // __SKILL_0706 if( n > 0 ) { m_nLife ++; // 부딪힐때마다 카운트 올라감 if( m_nLife >= (int)( m_pAddSkillProp->dwSkillLvl / 2 ) ) DestroyWall(); // 뒤로 밀리기 처리. FLOAT fPushAngle = pTarget->GetAngle() + 180.0f; FLOAT fPower = 0.825f; AngleToVectorXZ( &pTarget->m_pActMover->m_vDeltaE, fPushAngle, fPower ); g_UserMng.AddPushPower( pTarget, pTarget->GetPos(), pTarget->GetAngle(), fPushAngle, fPower ); } } } } }
void CCreateMonster::ProcessRemoveMonster() { if( m_mapCreateMonsterInfo.empty() ) return; DWORD dwTick = GetTickCount(); for( MAPINFO::iterator it=m_mapCreateMonsterInfo.begin(); it!=m_mapCreateMonsterInfo.end(); it++ ) { CREATE_MONSTER_INFO* pCreateMonsterInfo = &it->second; if( dwTick >= pCreateMonsterInfo->dwEndTick ) { CMover* pMover = prj.GetMover( it->first ); if( IsValidObj( pMover ) ) { if( pMover->IsLive() && !pMover->IsDelete() ) { pCreateMonsterInfo->chState = 'R'; pMover->Delete(); } } } } }
// 싸이킥 월 void CCommonCtrl::_ProcessWall( void ) { if( m_nCount == 0 ) { #ifdef __CLIENT m_pSfxModel = new CSfxModel; m_pSfxModel2 = new CSfxModel; m_pSfxModel->SetSfx( "sfx_sklpsypsychicwall02" ); m_pSfxModel2->SetSfx( "sfx_sklpsypsychicwall04" ); #endif } D3DXVECTOR3 vPos = GetPos(); #ifndef __CLIENT CObj* pObj; BOOL bApply; #endif //__CLIENT int nRange = 4; // 일반적으로 fDepth가 가장 길기때문에 검사 영역은 fDepth로 했다. float fDepth = 3; if( fDepth <= 4.0f ) nRange = 4; else if( fDepth <= 8.0f ) nRange = 8; else if( fDepth <= 16.0f ) nRange = 16; else nRange = 32; #ifdef __WORLDSERVER CMover *pAttacker = prj.GetMover( m_idAttacker ); if( IsInvalidObj( pAttacker ) ) // 일단 어태커가 사라지면 컨트롤도 사라지게 하자. { DestroyWall(); return; } int nMin = m_pAddSkillProp->dwAbilityMin + (pAttacker->GetLevel() + (pAttacker->GetInt() / 10) * (int)m_pAddSkillProp->dwSkillLvl); int nMax = m_pAddSkillProp->dwAbilityMax + (pAttacker->GetLevel() + (pAttacker->GetInt() / 10) * (int)m_pAddSkillProp->dwSkillLvl); int nDamage = xRandom( nMin, nMax ); #if __VER >= 9 // __SKILL_0706 int nMinPVP = m_pAddSkillProp->dwAbilityMinPVP + ( pAttacker->GetLevel() + ( pAttacker->GetInt() / 10 ) * (int)m_pAddSkillProp->dwSkillLvl ); int nMaxPVP = m_pAddSkillProp->dwAbilityMaxPVP + ( pAttacker->GetLevel() + ( pAttacker->GetInt() / 10 ) * (int)m_pAddSkillProp->dwSkillLvl ); int nDamagePVP = xRandom( nMinPVP, nMaxPVP ); #endif // __SKILL_0706 int nHitPoint = 0; int nTargetHP = 0; FOR_LINKMAP( GetWorld(), vPos, pObj, nRange, CObj::linkDynamic, GetLayer() ) { bApply = FALSE; if( pObj->GetType() == OT_MOVER ) // 대상이 무버일때만. { CMover *pTarget = (CMover *)pObj; if( pTarget->IsPeaceful() == FALSE ) // NPC가 아닌경우만 적용 bApply = TRUE; #if __VER >= 8 // #ifdef __JHMA_VER_8_5_1 // 8.5차 경비병 범위스킬 공격효과 불가로 수정 World if( pAttacker->IsPlayer() && pAttacker->IsChaotic() == FALSE && pTarget->GetProp()->dwClass == RANK_GUARD ) bApply = FALSE; #endif // #endif // __JHMA_VER_8_5_1 // 8.5차 경비병 범위스킬 공격효과 불가로 수정 World if( bApply ) { if( IsValidObj( pTarget ) && pTarget->IsLive() ) { if( pObj->IsRangeObj( vPos, 1.0f ) ) { if( IsValidObj(pAttacker) ) { nTargetHP = pTarget->GetHitPoint(); nHitPoint = nTargetHP - nDamage; if( nHitPoint > 0 ) { pTarget->m_nHitPoint = nHitPoint; g_UserMng.AddDamage( pTarget, pAttacker->GetId(), nDamage, AF_GENERIC ); } else { pAttacker->SubExperience( pTarget ); // pTarget를 죽이고 난후의 m_pAttacker 경험치 처리. pTarget->DropItemByDied( pAttacker ); // 몬스터였다면 아이템 드랍. pAttacker->m_nAtkCnt = 0; // 타겟을 죽였으면 공격자의 어택카운트 클리어 pTarget->DoDie( pAttacker ); // pTarget 죽어라. pTarget->m_nHitPoint = 0; } } m_nLife ++; // 부딪힐때마다 카운트 올라감 if( m_nLife >= (int)(m_pAddSkillProp->dwSkillLvl / 2) ) DestroyWall(); // 뒤로 밀리기 처리. #if __VER >= 10 // __AI_0711 if( pTarget->IsRank( RANK_MIDBOSS ) == FALSE ) #endif // __AI_0711 { FLOAT fPushAngle = pTarget->GetAngle() + 180.0f; FLOAT fPower = 0.825f; AngleToVectorXZ( &pTarget->m_pActMover->m_vDeltaE, fPushAngle, fPower ); g_UserMng.AddPushPower( pTarget, pTarget->GetPos(), pTarget->GetAngle(), fPushAngle, fPower ); } } } } } }