Esempio n. 1
0
BOOL CALLBACK Dlgproc3(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch(uMsg)
	{
		case WM_COMMAND:
			switch(LOWORD(wParam))
			{
				case IDC_BUTTON1:
					IsBotting = !IsBotting;				
					if (IsBotting)
						StartBot();
					else
						StopBot();		
					break;

				case IDC_CHECK1:
					PickItems = !PickItems;
					if (PickItems)
						EnableWindow(GetDlgItem(hWnd, IDC_CHECK2), true);
					else
						EnableWindow(GetDlgItem(hWnd, IDC_CHECK2), false);
					break;

				case IDC_CHECK2:
					DoSellItems = !DoSellItems;
					break;

				case IDC_CHECK3:
					DoRepairEquipment = !DoRepairEquipment;
					break;

				case IDC_CHECK4:
					UseOnlySkills = !UseOnlySkills;
					break;

				case IDC_BUTTON4:
					ClearListBox(GetDlgItem(hWnd, IDC_LIST2));
					char c[100];
					DWORD Count = SendMessage(GetDlgItem(hWnd, IDC_LIST1), LB_GETCOUNT, 0, 0);
					if ((Count != 0) && (Count != LB_ERR))
					{		
						for (BYTE i = 0; i < Count; i++)
						{
							if (SendMessage(GetDlgItem(hWnd, IDC_LIST1), LB_GETSEL, i, 0) > 0)
							{
								SendMessage(GetDlgItem(hWnd, IDC_LIST1), LB_GETTEXT, i, (LPARAM)c);
								SendMessage(GetDlgItem(hWnd, IDC_LIST2), LB_ADDSTRING, i, (LPARAM)c);
								IsUsingSkill(i, true);
							}
							else
								IsUsingSkill(i, false);
						}
					}
					break;

			}
	}
	return FALSE;
}
Esempio n. 2
0
void CInstanceBase::NEW_Attack(float fDirRot)
{
	if (IsDead())
		return;

	if (IsStun())
		return;

	if (IsKnockDown())
		return;

	if (IsUsingSkill())
		return;
	
	if (IsWalking())
		EndWalking();

	m_isGoing = FALSE;

	if (IsPoly())
	{
		InputNormalAttack(fDirRot);
	}
	else
	{
		if (m_kHorse.IsMounting())
		{
			InputComboAttack(fDirRot);
		}
		else
		{
			InputComboAttack(fDirRot);
		}
	}
}
bool CActorInstance::CanUseSkill()
{
	if (!CanAct())
		return false;

	DWORD dwCurMotionIndex=__GetCurrentMotionIndex();
	
	// Locked during attack
	switch (dwCurMotionIndex)
	{
		case CRaceMotionData::NAME_FISHING_THROW:
		case CRaceMotionData::NAME_FISHING_WAIT:
		case CRaceMotionData::NAME_FISHING_STOP:
		case CRaceMotionData::NAME_FISHING_REACT:
		case CRaceMotionData::NAME_FISHING_CATCH:
		case CRaceMotionData::NAME_FISHING_FAIL:
			return TRUE;
			break;
	}

	// Locked during using skill
	if (IsUsingSkill())
	{
		if (m_pkCurRaceMotionData->IsCancelEnableSkill())
			return TRUE;

		return FALSE;
	}	
	
	return true;
}
bool CActorInstance::CanAttack()
{
	if (!CanAct())
		return false;

	if (IsUsingSkill())
	{
		if (!CanCancelSkill())
			return false;
	}

	return true;
}
Esempio n. 5
0
void CActorInstance::__Push(int x, int y)
{
	if (IsResistFallen())
		return;

	//DWORD dwVID=GetVirtualID();
	//Tracenf("VID %d SyncPixelPosition %d %d", dwVID, x, y);		

	const D3DXVECTOR3& c_rv3Src=GetPosition();
	const D3DXVECTOR3 c_v3Dst=D3DXVECTOR3(x, -y, c_rv3Src.z);
	const D3DXVECTOR3 c_v3Delta=c_v3Dst-c_rv3Src;
	
	const int LoopValue = 100;
	const D3DXVECTOR3 inc=c_v3Delta / LoopValue;
	
	D3DXVECTOR3 v3Movement(0.0f, 0.0f, 0.0f);

	IPhysicsWorld* pWorld = IPhysicsWorld::GetPhysicsWorld();
			
	if (!pWorld)
	{
		return;
	}

	for(int i = 0; i < LoopValue; ++i)
	{
		if (pWorld->isPhysicalCollision(c_rv3Src + v3Movement))
		{
			ResetBlendingPosition();
			return;
		}
		v3Movement += inc;
	}

	SetBlendingPosition(c_v3Dst);

	if (!IsUsingSkill())
	{
		int len=sqrt(c_v3Delta.x*c_v3Delta.x+c_v3Delta.y*c_v3Delta.y);
		if (len>150.0f)
		{
			InterceptOnceMotion(CRaceMotionData::NAME_DAMAGE_FLYING);
			PushOnceMotion(CRaceMotionData::NAME_STAND_UP);
		}
	}
}
bool CActorInstance::CanFishing()
{
	if (!CanAct())
		return false;

	if (IsUsingSkill())
		return false;

	switch (__GetCurrentMotionIndex())
	{
		case CRaceMotionData::NAME_WAIT:
		case CRaceMotionData::NAME_WALK:
		case CRaceMotionData::NAME_RUN:
			break;
		default:
			return false;
			break;
	}

	return true;
}
void CActorInstance::ComboProcess()
{
	// If combo is on action
	if (0 != m_dwcurComboIndex)
	{
		if (!m_pkCurRaceMotionData)
		{
			Tracef("Attacking motion data is NULL! : %d\n", m_dwcurComboIndex);
			__ClearCombo();
			return;
		}

		float fElapsedTime = GetAttackingElapsedTime();

		// Process PreInput
		if (m_isPreInput)
		{
			//Tracenf("선입력 %f 다음콤보시간 %f", fElapsedTime, m_pkCurRaceMotionData->GetNextComboTime());
			if (fElapsedTime > m_pkCurRaceMotionData->GetNextComboTime())
			{
  				__RunNextCombo();
				m_isPreInput = FALSE;

				return;
			}
		}
	}
	else
	{
		m_isPreInput = FALSE;

		if (!IsUsingSkill())	// m_isNextPreInput는 활모드 일때만 사용하는 변수
		if (m_isNextPreInput)	// 활일때만 스킬이 캔슬 되는건 이곳 때문임
		{
			__RunNextCombo();
			m_isNextPreInput = FALSE;
		}
	}
}
Esempio n. 8
0
DWORD CActorInstance::__SetMotion(const SSetMotionData& c_rkSetMotData, DWORD dwRandMotKey)
{
	DWORD dwMotKey = dwRandMotKey;

	if (dwMotKey == 0)
		dwMotKey = GetRandomMotionKey(c_rkSetMotData.dwMotKey);

	UINT uNextMot = GET_MOTION_INDEX(c_rkSetMotData.dwMotKey);

	if (IsDead())
	{
		if (uNextMot!=CRaceMotionData::NAME_DAMAGE_FLYING && uNextMot!=CRaceMotionData::NAME_DAMAGE_FLYING_BACK && uNextMot!=CRaceMotionData::NAME_DEAD && uNextMot!=CRaceMotionData::NAME_DEAD_BACK)
			return 0;
	}
	if (IsUsingSkill())
	{
		__OnStop();
	}

	if (__IsStandUpMotion())
	{
		__OnStop();
	}


	if (__IsMoveMotion())
	{
		if (uNextMot==CRaceMotionData::NAME_DAMAGE || uNextMot==CRaceMotionData::NAME_DAMAGE_BACK || uNextMot==CRaceMotionData::NAME_DAMAGE_FLYING || uNextMot==CRaceMotionData::NAME_DAMAGE_FLYING_BACK)
		{
			if (!m_isMain)
			{
				Logn(0, "주인공이 아니라면 이동중이라 데미지 동작을 취하지 않음");
				return false;
			}
		}

		if (uNextMot!=CRaceMotionData::NAME_RUN &&
			uNextMot!=CRaceMotionData::NAME_WALK &&
			!__IsMovingSkill(c_rkSetMotData.uSkill))
		{
			__OnStop();
		}
	}
	else
	{
		if (uNextMot==CRaceMotionData::NAME_RUN || __IsMovingSkill(c_rkSetMotData.uSkill))
		{
			__OnMove();
		}
	}


	// NOTE : 스킬 사용중 사라지는 문제를 위한 안전 장치 - [levites]
	if (__IsHiding())
	{
		__ShowEvent();
	}


	if (-1 != m_iFishingEffectID)
	{
		CEffectManager& rkEftMgr=CEffectManager::Instance();
 		rkEftMgr.DeactiveEffectInstance(m_iFishingEffectID);

		m_iFishingEffectID = -1;
	}

	if (m_pkHorse)
	{
		WORD wMotionIndex = GET_MOTION_INDEX(dwMotKey);
		WORD wMotionSubIndex = GET_MOTION_SUB_INDEX(dwMotKey);
		DWORD dwChildMotKey = MAKE_RANDOM_MOTION_KEY(m_pkHorse->m_wcurMotionMode, wMotionIndex, wMotionSubIndex);

		if (CRaceMotionData::NAME_DEAD == wMotionIndex)
			CGraphicThingInstance::ChangeMotion(dwMotKey, c_rkSetMotData.iLoopCount, c_rkSetMotData.fSpeedRatio);
		else
			CGraphicThingInstance::SetMotion(dwMotKey, c_rkSetMotData.fBlendTime, c_rkSetMotData.iLoopCount, c_rkSetMotData.fSpeedRatio);

		m_pkHorse->SetMotion(dwChildMotKey, c_rkSetMotData.fBlendTime, c_rkSetMotData.iLoopCount, c_rkSetMotData.fSpeedRatio);
		m_pkHorse->__BindMotionData(dwChildMotKey);

		if (c_rkSetMotData.iLoopCount)
			m_pkHorse->m_kCurMotNode.iMotionType = MOTION_TYPE_ONCE; // 무조건 이전 모션 타입으로 설정되고 있었음
		else
			m_pkHorse->m_kCurMotNode.iMotionType = MOTION_TYPE_LOOP;

		m_pkHorse->m_kCurMotNode.dwFrameCount	= m_pkHorse->GetMotionDuration(dwChildMotKey) / (1.0f / g_fGameFPS);
		m_pkHorse->m_kCurMotNode.dwcurFrame		= 0;
		m_pkHorse->m_kCurMotNode.dwMotionKey	= dwChildMotKey;
	}
	else
	{
		CGraphicThingInstance::SetMotion(dwMotKey, c_rkSetMotData.fBlendTime, c_rkSetMotData.iLoopCount, c_rkSetMotData.fSpeedRatio);
	}
	
	__HideWeaponTrace();

	if (__BindMotionData(dwMotKey))
	{
		int iLoopCount = __GetLoopCount();
		SetMotionLoopCount(iLoopCount);

		if (__CanAttack())
		{
			// 여기서 공격 모션일 경우의 처리를 합니다 - [levites]
			__ShowWeaponTrace();

			m_HitDataMap.clear();
			//PreAttack();
		}

		if (__IsComboAttacking())
		{
			if (!__CanNextComboAttack())
			{
				// 2004.11.19.myevan.동물 변신시 이부분에서 바로 리셋되어 다음동작 안나온다
				m_dwcurComboIndex = 0; // 콤보 리셋 - [levites]

				// NOTE : ClearCombo() 를 수행해서는 안된다.
				//        콤보 다음에 스킬을 이어서 사용할 경우 m_pkCurRaceMotionData까지 초기화 되어 버린다.
				//Tracef("MotionData에 콤보 데이타가 들어 있지 않습니다.\n");
			}
		}
	}

	return dwMotKey;
}
Esempio n. 9
0
BOOL CActorInstance::isLock()
{
	DWORD dwCurMotionIndex=__GetCurrentMotionIndex();

	// Locked during attack
	switch (dwCurMotionIndex)
	{
		case CRaceMotionData::NAME_NORMAL_ATTACK:
		case CRaceMotionData::NAME_COMBO_ATTACK_1:
		case CRaceMotionData::NAME_COMBO_ATTACK_2:
		case CRaceMotionData::NAME_COMBO_ATTACK_3:
		case CRaceMotionData::NAME_COMBO_ATTACK_4:
		case CRaceMotionData::NAME_COMBO_ATTACK_5:
		case CRaceMotionData::NAME_COMBO_ATTACK_6:
		case CRaceMotionData::NAME_COMBO_ATTACK_7:
		case CRaceMotionData::NAME_COMBO_ATTACK_8:
		case CRaceMotionData::NAME_SPECIAL_1:
		case CRaceMotionData::NAME_SPECIAL_2:
		case CRaceMotionData::NAME_SPECIAL_3:
		case CRaceMotionData::NAME_SPECIAL_4:
		case CRaceMotionData::NAME_SPECIAL_5:
		case CRaceMotionData::NAME_SPECIAL_6:
		case CRaceMotionData::NAME_FISHING_THROW:
		case CRaceMotionData::NAME_FISHING_WAIT:
		case CRaceMotionData::NAME_FISHING_STOP:
		case CRaceMotionData::NAME_FISHING_REACT:
		case CRaceMotionData::NAME_FISHING_CATCH:
		case CRaceMotionData::NAME_FISHING_FAIL:
		case CRaceMotionData::NAME_CLAP:
		case CRaceMotionData::NAME_DANCE_1:
		case CRaceMotionData::NAME_DANCE_2:	
		case CRaceMotionData::NAME_DANCE_3:
		case CRaceMotionData::NAME_DANCE_4:
		case CRaceMotionData::NAME_DANCE_5:
		case CRaceMotionData::NAME_DANCE_6:
		case CRaceMotionData::NAME_CONGRATULATION:
		case CRaceMotionData::NAME_FORGIVE:
		case CRaceMotionData::NAME_ANGRY:
		case CRaceMotionData::NAME_ATTRACTIVE:
		case CRaceMotionData::NAME_SAD:
		case CRaceMotionData::NAME_SHY:
		case CRaceMotionData::NAME_CHEERUP:
		case CRaceMotionData::NAME_BANTER:
		case CRaceMotionData::NAME_JOY:
		case CRaceMotionData::NAME_CHEERS_1:
		case CRaceMotionData::NAME_CHEERS_2:
		case CRaceMotionData::NAME_KISS_WITH_WARRIOR:
		case CRaceMotionData::NAME_KISS_WITH_ASSASSIN:
		case CRaceMotionData::NAME_KISS_WITH_SURA:
		case CRaceMotionData::NAME_KISS_WITH_SHAMAN:
		case CRaceMotionData::NAME_FRENCH_KISS_WITH_WARRIOR:
		case CRaceMotionData::NAME_FRENCH_KISS_WITH_ASSASSIN:
		case CRaceMotionData::NAME_FRENCH_KISS_WITH_SURA:
		case CRaceMotionData::NAME_FRENCH_KISS_WITH_SHAMAN:
		case CRaceMotionData::NAME_SLAP_HIT_WITH_WARRIOR:
		case CRaceMotionData::NAME_SLAP_HIT_WITH_ASSASSIN:
		case CRaceMotionData::NAME_SLAP_HIT_WITH_SURA:
		case CRaceMotionData::NAME_SLAP_HIT_WITH_SHAMAN:
		case CRaceMotionData::NAME_SLAP_HURT_WITH_WARRIOR:
		case CRaceMotionData::NAME_SLAP_HURT_WITH_ASSASSIN:
		case CRaceMotionData::NAME_SLAP_HURT_WITH_SURA:
		case CRaceMotionData::NAME_SLAP_HURT_WITH_SHAMAN:
			return TRUE;
			break;
	}

	// Locked during using skill
	if (IsUsingSkill())
	{
		if (m_pkCurRaceMotionData->IsCancelEnableSkill())
			return FALSE;

		return TRUE;
	}

	return FALSE;
}
Esempio n. 10
0
BOOL CActorInstance::CanCancelSkill()
{
	assert(IsUsingSkill());
	return m_pkCurRaceMotionData->IsCancelEnableSkill();
}