コード例 #1
0
void CSocketItems::ApplyWaterOption(LPOBJ lpObj,BYTE btOption,BYTE IncType,WORD IncValue)
{
	int _IncValue = 0;

	switch( btOption )
	{
	case 10:
		_IncValue = GetResultValue(lpObj->m_SuccessfulBlocking,IncValue,IncType);
		lpObj->m_SuccessfulBlocking += _IncValue;
		break;
	case 11:
		_IncValue = GetResultValue(lpObj->m_Defense,IncValue,IncType);
		lpObj->m_Defense += _IncValue;

		_IncValue = GetResultValue(lpObj->m_MagicDefense,IncValue,IncType);
		lpObj->m_MagicDefense += _IncValue;
		break;
	case 12:
		lpObj->SetOpImproveSheldDefence += IncValue;
		break;
	case 13:
		lpObj->DamageMinus += IncValue;
		break;
	case 14:
		lpObj->DamageReflect += IncValue;
		break;
	}
}
コード例 #2
0
ファイル: SelfTest.cpp プロジェクト: JetBrains/runAs
Result<ExitCode> SelfTest::Run(const Settings& settings) const
{	
	auto statisticResult = GetStatistic(settings);
	if (statisticResult.HasError())
	{
		return statisticResult.GetError();
	}

	auto statistic = statisticResult.GetResultValue();
	if (statistic.IsService())
	{	
		if (!statistic.HasAdministrativePrivileges())
		{
			return EXIT_CODE_NO_ADMIN;
		}

		if (!statistic.HasSeAssignPrimaryTokenPrivilege())
		{
			return EXIT_CODE_NO_ASSIGN_PRIMARY_TOKEN_PRIV;
		}

		if (!statistic.HasSeTcbPrivilegePrivilege())
		{
			return EXIT_CODE_NO_TCB_PRIV;
		}
	}
	
	return Is64OS() ? EXIT_CODE_READY_FOR_64 : EXIT_CODE_READY_FOR_32;
}
コード例 #3
0
void CSocketItems::SetSocketOption(CItem* lpItem)
{
	if( lpItem == NULL )
		return;

	if( lpItem->IsItem() == FALSE || IsSocketItem(lpItem) == FALSE )
		return;

	BYTE btOption = 0;
	BYTE btLevel = 0;
	BYTE btSocketOpt = 0;

	_SOCKET_SPHERE_OPTION tmpSphere;

	int _IncValue = 0;

	for(int i = 0; i < MAX_SOCKET_COUNT; i++)
	{
		if( lpItem->m_SocketOption[i] == 0xFF || lpItem->m_SocketOption[i] == 0xFE )
			continue;

		btSocketOpt = lpItem->m_SocketOption[i];

		btOption = btSocketOpt % 50;
		btLevel = ((btSocketOpt - btOption)/50)+1;

		if( IsOptionSet(&tmpSphere,btOption,btLevel) == FALSE )
			continue;

		if( btOption == 38 )
		{
			_IncValue = GetResultValue(lpItem->m_HJOpStrength,tmpSphere.wSphereValue,tmpSphere.btIncType);
			lpItem->m_HJOpStrength += _IncValue;
		}
		else if(btOption == 39 )
		{
			_IncValue = GetResultValue(lpItem->m_HJOpDexterity,tmpSphere.wSphereValue,tmpSphere.btIncType);
			lpItem->m_HJOpDexterity += _IncValue;
		}
		else if(btOption == 20 )
		{
			lpItem->m_BonusDurability += tmpSphere.wSphereValue;
		}
	}
}
コード例 #4
0
ファイル: CheatsManager.cpp プロジェクト: dolphin-emu/dolphin
void CheatsManager::OnWatchItemChanged(QTableWidgetItem* item)
{
  if (m_updating)
    return;

  int index = item->data(INDEX_ROLE).toInt();
  int column = item->data(COLUMN_ROLE).toInt();

  switch (column)
  {
  case 0:
    m_watch[index].name = item->text();
    break;
  case 2:
    m_watch[index].locked = item->checkState() == Qt::Checked;

    if (m_watch[index].locked)
      m_watch[index].locked_value = GetResultValue(m_results[index]);

    UpdatePatch(m_watch[index]);
    break;
  case 3:
  {
    const auto text = item->text();
    u32 value = 0;

    switch (m_watch[index].type)
    {
    case DataType::Byte:
      value = text.toUShort(nullptr, 16) & 0xFF;
      break;
    case DataType::Short:
      value = text.toUShort(nullptr, 16);
      break;
    case DataType::Int:
      value = text.toUInt(nullptr, 16);
      break;
    case DataType::Float:
    {
      float f = text.toFloat();
      std::memcpy(&value, &f, sizeof(float));
      break;
    }
    default:
      break;
    }

    m_watch[index].locked_value = value;

    UpdatePatch(m_watch[index]);

    break;
  }
  }

  Update();
}
コード例 #5
0
ファイル: SelfTest.cpp プロジェクト: JetBrains/runAs
Result<bool> SelfTest::IsService(Trace& trace, const Handle& token) const
{		
	auto integrityLevelResult = _securityManager.GetIntegrityLevel(trace, token);
	if(integrityLevelResult.GetResultValue() == INTEGRITY_LEVEL_SYSTEM)
	{
		return true;
	}

	return _securityManager.HasGroupSid(trace, token, L"S-1-5-6");
}
コード例 #6
0
ファイル: ProcessAsUser.cpp プロジェクト: JetBrains/runAs
Result<Environment> ProcessAsUser::GetEnvironment(const Settings& settings, Handle& userToken, const InheritanceMode inheritanceMode, Trace& trace)
{
	auto callingProcessEnvironmentResult = Environment::CreateForCurrentProcess(trace);
	if(callingProcessEnvironmentResult.HasError())
	{
		return callingProcessEnvironmentResult;
	}

	if (inheritanceMode == INHERITANCE_MODE_ON)
	{
		return GetEnvironmentWithSpecifiedByCaller(
			settings, 
			callingProcessEnvironmentResult.GetResultValue(), 
			trace);
	}

	// Get target user's environment
	auto targetUserEnvironmentResult = Environment::CreateForUser(userToken, false, trace);
	if (targetUserEnvironmentResult.HasError())
	{
		return targetUserEnvironmentResult;
	}

	if (inheritanceMode == INHERITANCE_MODE_OFF)
	{
		return GetEnvironmentWithSpecifiedByCaller(
			settings, 
			targetUserEnvironmentResult.GetResultValue(), 
			trace);
	}
	
	return GetEnvironmentWithSpecifiedByCaller(
		settings, 
		Environment::Override(
			callingProcessEnvironmentResult.GetResultValue(), 
			targetUserEnvironmentResult.GetResultValue(), 
			trace),
		trace);
}
コード例 #7
0
void CSocketItems::ApplyLightningOption(LPOBJ lpObj,BYTE btOption,BYTE IncType,WORD IncValue)
{
	int _IncValue = 0;

	switch( btOption )
	{
	case 29:
		_IncValue = GetResultValue(lpObj->SetOpAddExDamage,IncValue,IncType);
		lpObj->SetOpAddExDamage += _IncValue;
		break;
	case 30:
		lpObj->m_ExcelentDamage += IncValue;
		break;
	case 31:
		_IncValue = GetResultValue(lpObj->SetOpAddCriticalDamage,IncValue,IncType);
		lpObj->SetOpAddCriticalDamage += _IncValue;
		break;
	case 32:
		lpObj->m_CriticalDamage += IncValue;
		break;
	}
}
コード例 #8
0
void CSocketItems::ApplyIceOption(LPOBJ lpObj,BYTE btOption,BYTE IncType,WORD IncValue)
{
	int _IncValue = 0;

	switch( btOption )
	{
	case 16:
		_IncValue += GetResultValue((int)(lpObj->MaxLife+lpObj->AddLife),IncValue,IncType);
		lpObj->m_wSocketMonsterDieLife += _IncValue;
		break;
	case 17:
		_IncValue += GetResultValue((int)(lpObj->MaxMana+lpObj->AddMana),IncValue,IncType);
		lpObj->m_wSocketMonsterDieMana += _IncValue;
		break;
	case 18:
		_IncValue = GetResultValue(lpObj->SetOpAddSkillAttack,IncValue,IncType);
		lpObj->SetOpAddSkillAttack += _IncValue;
		break;
	case 19:
		lpObj->m_AttackRating += IncValue;
		break;
	}
}
コード例 #9
0
void CSocketItems::ApplyEarthOption(LPOBJ lpObj,BYTE btOption,BYTE IncType,WORD IncValue)
{
	int _IncValue = 0;

	switch( btOption )
	{
	case 34:
		_IncValue = GetResultValue(lpObj->Strength+lpObj->AddStrength,IncValue,IncType);
		lpObj->AddStrength += _IncValue;
		break;
	case 35:
		_IncValue = GetResultValue(lpObj->Dexterity+lpObj->AddDexterity,IncValue,IncType);
		lpObj->AddDexterity += _IncValue;
		break;
	case 36:
		_IncValue = GetResultValue(lpObj->Vitality+lpObj->AddVitality,IncValue,IncType);
		lpObj->AddVitality += _IncValue;
		break;
	case 37:
		_IncValue = GetResultValue(lpObj->Energy+lpObj->AddEnergy,IncValue,IncType);
		lpObj->AddEnergy += _IncValue;
		break;
	}
}
コード例 #10
0
ファイル: CheatsManager.cpp プロジェクト: dolphin-emu/dolphin
void CheatsManager::OnMatchContextMenu()
{
  if (m_match_table->selectedItems().isEmpty())
    return;

  QMenu* menu = new QMenu(this);

  menu->addAction(tr("Add to Watch"), this, [this] {
    auto* item = m_match_table->selectedItems()[0];

    int index = item->data(INDEX_ROLE).toInt();

    m_results[index].locked_value = GetResultValue(m_results[index]);

    m_watch.push_back(m_results[index]);

    Update();
  });

  menu->exec(QCursor::pos());
}
コード例 #11
0
void CSocketItems::ApplyWindOption(LPOBJ lpObj,BYTE btOption,BYTE IncType,WORD IncValue)
{
	int _IncValue = 0;

	switch( btOption )
	{
	case 21:
		_IncValue = GetResultValue(lpObj->MaxLife+lpObj->AddLife,IncValue,IncType);
		lpObj->m_wSocketAddLife += _IncValue;
		break;
	case 22:
		_IncValue = GetResultValue(lpObj->MaxLife+lpObj->AddLife,IncValue,IncType);
		lpObj->AddLife += _IncValue;

		GCReFillSend(lpObj->m_Index,lpObj->MaxLife+lpObj->AddLife,0xFE,0,lpObj->iMaxShield+lpObj->iAddShield);
		GCReFillSend(lpObj->m_Index,lpObj->Life,0xFF,0,lpObj->iShield);
		break;
	case 23:
		_IncValue = GetResultValue(lpObj->MaxMana+lpObj->AddMana,IncValue,IncType);
		lpObj->AddMana += _IncValue;

		GCManaSend(lpObj->m_Index,lpObj->MaxMana+lpObj->AddMana,0xFE,0,lpObj->MaxBP+lpObj->AddBP);
		GCManaSend(lpObj->m_Index,lpObj->Mana,0xFF,0,lpObj->BP);
		break;
	case 24:
		_IncValue = GetResultValue(lpObj->MaxMana+lpObj->AddMana,IncValue,IncType);
		lpObj->m_wSocketAddMana += _IncValue;
		break;
	case 25:
		_IncValue = GetResultValue(lpObj->MaxBP+lpObj->AddBP,IncValue,IncType);
		lpObj->AddBP += _IncValue;

		GCManaSend(lpObj->m_Index,lpObj->MaxMana+lpObj->AddMana,0xFE,0,lpObj->MaxBP+lpObj->AddBP);
		GCManaSend(lpObj->m_Index,lpObj->Mana,0xFF,0,lpObj->BP);
		break;
	case 26:
		_IncValue = GetResultValue(lpObj->SetOpIncAGValue,IncValue,IncType);
		lpObj->SetOpIncAGValue += _IncValue;
		break;
	case 27:
		lpObj->MonsterDieGetMoney += IncValue;
		break;
	}
}
コード例 #12
0
ファイル: SelfTest.cpp プロジェクト: JetBrains/runAs
Result<SelfTestStatistic> SelfTest::GetStatistic(const Settings& settings) const
{
	Trace trace(settings.GetLogLevel());
	trace < L"SelfTest::GetStatistic";

	Handle processToken(L"Process token");
	if (!::OpenProcessToken(GetCurrentProcess(), TOKEN_ALL_ACCESS, &processToken))
	{
		return Error(L"OpenProcessToken");
	}

	trace < L"Token groups:";
	auto tokenGroupsResult = _securityManager.GetTokenGroups(trace, processToken);
	if (!tokenGroupsResult.HasError())
	{
		auto tokenGroups = tokenGroupsResult.GetResultValue();
		for (auto groupsIterator = tokenGroups.begin(); groupsIterator != tokenGroups.end(); ++groupsIterator)
		{
			trace < groupsIterator->ToString();
		}
	}	
	
	auto isServiceResult = IsService(trace, processToken);
	if (isServiceResult.HasError())
	{
		return isServiceResult.GetError();
	}

	trace < L"SelfTest::IsService: ";
	trace << isServiceResult.GetResultValue();

	auto hasAdministrativePrivilegesResult = HasAdministrativePrivileges(trace);
	if (hasAdministrativePrivilegesResult.HasError())
	{
		return hasAdministrativePrivilegesResult.GetError();
	}

	trace < L"SelfTest::HasAdministrativePrivileges: ";
	trace << hasAdministrativePrivilegesResult.GetResultValue();

	auto hasSeAssignPrimaryTokenPrivilegeResult = HasPrivilege(trace, processToken, SE_ASSIGNPRIMARYTOKEN_NAME);
	if (hasSeAssignPrimaryTokenPrivilegeResult.HasError())
	{
		return hasSeAssignPrimaryTokenPrivilegeResult.GetError();
	}

	trace < L"SelfTest::HasPrivilege(SE_ASSIGNPRIMARYTOKEN_NAME): ";
	trace << hasSeAssignPrimaryTokenPrivilegeResult.GetResultValue();

	auto hasSeTcbPrivilegeResult = HasPrivilege(trace, processToken, SE_TCB_NAME);
	if (hasSeTcbPrivilegeResult.HasError())
	{
		return hasSeTcbPrivilegeResult.GetError();
	}

	trace < L"SelfTest::HasPrivilege(SE_TCB_NAME): ";
	trace << hasSeTcbPrivilegeResult.GetResultValue();

	auto integrityLevelResult = GetIntegrityLevel(trace, processToken);
	if (integrityLevelResult.HasError())
	{
		return integrityLevelResult.GetError();
	}
	
	
	trace < L"SelfTest::GetIntegrityLevel: ";
	trace << integrityLevelResult.GetResultValue();

	return SelfTestStatistic(
		isServiceResult.GetResultValue(),
		hasAdministrativePrivilegesResult.GetResultValue(),
		hasSeAssignPrimaryTokenPrivilegeResult.GetResultValue(),
		hasSeTcbPrivilegeResult.GetResultValue(),
		integrityLevelResult.GetResultValue());
}
コード例 #13
0
ファイル: ProcessAsUser.cpp プロジェクト: JetBrains/runAs
Result<ExitCode> ProcessAsUser::Run(const Settings& settings, ProcessTracker& processTracker) const
{
	Trace trace(settings.GetLogLevel());
	trace < L"ProcessAsUser::Attempt to log a user on to the local computer";
	StringBuffer userName(settings.GetUserName());
	StringBuffer domain(settings.GetDomain());
	StringBuffer password(settings.GetPassword());
	StringBuffer workingDirectory(settings.GetWorkingDirectory());
	StringBuffer commandLine(settings.GetCommandLine());

	SecurityManager securityManager;
	auto setPrivilegesResult = securityManager.SetPrivileges(trace, { SE_TCB_NAME, SE_ASSIGNPRIMARYTOKEN_NAME }, true);
	if(setPrivilegesResult.HasError())
	{
		return setPrivilegesResult.GetError();
	}

	auto newUserSecurityTokenHandle = Handle(L"New user security token");
	unsigned long logonTypeCount = sizeof(allLogonTypes) / sizeof(allLogonTypes[0]);
	for (unsigned long logonTypeIndex = 0; logonTypeIndex < logonTypeCount; logonTypeIndex++)
	{
		auto logonType = allLogonTypes[logonTypeIndex];
		trace < L"::LogonUser using logon type ";
		switch (logonType)
		{
			case LOGON32_LOGON_INTERACTIVE:
				trace << L"LOGON32_LOGON_INTERACTIVE";
				break;

			case LOGON32_LOGON_NETWORK:
				trace << L"LOGON32_LOGON_NETWORK";
				break;

			case LOGON32_LOGON_BATCH:
				trace << L"LOGON32_LOGON_BATCH";
				break;

			case LOGON32_LOGON_SERVICE:
				trace << L"LOGON32_LOGON_SERVICE";
				break;
		}

		if (LogonUser(
			userName.GetPointer(),
			domain.GetPointer(),
			password.GetPointer(),
			logonType,
			LOGON32_PROVIDER_DEFAULT,
			&newUserSecurityTokenHandle))
		{
			break;
		}
		
		auto error = Error(L"LogonUser");
		trace << L" - ";
		trace << error.GetDescription();

		if(logonTypeIndex == logonTypeCount -1)
		{
			return error;
		}
	}

	trace < L"ProcessAsUser::InitializeConsoleRedirection a new security descriptor";
	trace < L"::InitializeSecurityDescriptor";
	SECURITY_DESCRIPTOR securityDescriptor = {};
	if (!InitializeSecurityDescriptor(
		&securityDescriptor,
		SECURITY_DESCRIPTOR_REVISION))
	{
		return Error(L"InitializeSecurityDescriptor");
	}

	trace < L"::SetSecurityDescriptorDacl";
	if (!SetSecurityDescriptorDacl(
		&securityDescriptor,
		true,
		nullptr,
		false))
	{
		return Error(L"SetSecurityDescriptorDacl");
	}

	trace < L"ProcessAsUser::Creates a new access primary token that duplicates new process's token";
	auto primaryNewUserSecurityTokenHandle = Handle(L"Primary new user security token");
	SECURITY_ATTRIBUTES processSecAttributes = {};
	processSecAttributes.lpSecurityDescriptor = &securityDescriptor;
	processSecAttributes.nLength = sizeof(SECURITY_DESCRIPTOR);
	processSecAttributes.bInheritHandle = true;
	trace < L"::DuplicateTokenEx";
	if (!DuplicateTokenEx(
		newUserSecurityTokenHandle,
		0, // MAXIMUM_ALLOWED
		&processSecAttributes,
		SecurityImpersonation,
		TokenPrimary,
		&primaryNewUserSecurityTokenHandle))
	{
		return Error(L"DuplicateTokenEx");
	}	

	SECURITY_ATTRIBUTES threadSecAttributes = {};
	threadSecAttributes.lpSecurityDescriptor = nullptr;
	threadSecAttributes.nLength = 0;
	threadSecAttributes.bInheritHandle = false;	
	STARTUPINFO startupInfo = {};	

	trace < L"ProcessTracker::InitializeConsoleRedirection";
	auto error = processTracker.InitializeConsoleRedirection(processSecAttributes, startupInfo);
	if(error.HasError())
	{
		return Result<ExitCode>(error.GetError());
	}

	trace < L"::LoadUserProfile";
	PROFILEINFO profileInfo = {};
	profileInfo.dwSize = sizeof(PROFILEINFO);
	profileInfo.lpUserName = userName.GetPointer();
	if (!LoadUserProfile(primaryNewUserSecurityTokenHandle, &profileInfo))
	{
		return Error(L"LoadUserProfile");
	}

	auto newProcessEnvironmentResult = GetEnvironment(settings, primaryNewUserSecurityTokenHandle, settings.GetInheritanceMode(), trace);
	if (newProcessEnvironmentResult.HasError())
	{
		UnloadUserProfile(primaryNewUserSecurityTokenHandle, profileInfo.hProfile);
		return Result<ExitCode>(newProcessEnvironmentResult.GetError());
	}

	auto setIntegrityLevelResult = securityManager.SetIntegrityLevel(settings.GetIntegrityLevel(), primaryNewUserSecurityTokenHandle, trace);
	if (setIntegrityLevelResult.HasError())
	{
		return Result<ExitCode>(setIntegrityLevelResult.GetError());
	}

	trace < L"ProcessAsUser::Create a new process and its primary thread. The new process runs in the security context of the user represented by the specified token.";
	PROCESS_INFORMATION processInformation = {};
	startupInfo.dwFlags = STARTF_USESHOWWINDOW;
	startupInfo.wShowWindow = ShowModeConverter::ToShowWindowFlag(settings.GetShowMode());
	auto cmdLine = settings.GetCommandLine();
	trace < L"::CreateProcessAsUser";	
	if (!CreateProcessAsUser(
		primaryNewUserSecurityTokenHandle,
		nullptr,
		commandLine.GetPointer(),
		&processSecAttributes,
		&threadSecAttributes,
		true,
		CREATE_UNICODE_ENVIRONMENT,
		newProcessEnvironmentResult.GetResultValue().CreateEnvironment(),
		workingDirectory.GetPointer(),
		&startupInfo,
		&processInformation))
	{		
		auto result = Error(L"CreateProcessAsUser");
		UnloadUserProfile(primaryNewUserSecurityTokenHandle, profileInfo.hProfile);
		return result;
	}

	// ReSharper disable CppInitializedValueIsAlwaysRewritten
	// ReSharper disable CppEntityAssignedButNoRead
	
	auto processHandle = Handle(L"Service Process");
	processHandle = processInformation.hProcess;
	
	auto threadHandle = Handle(L"Thread");
	threadHandle = processInformation.hThread;

	auto exitCode = processTracker.WaiteForExit(processInformation.hProcess, trace);
	UnloadUserProfile(primaryNewUserSecurityTokenHandle, profileInfo.hProfile);	

	return exitCode;
}
コード例 #14
0
ファイル: ProcessWithLogon.cpp プロジェクト: JetBrains/runAs
Result<ExitCode> ProcessWithLogon::Run(const Settings& settings, ProcessTracker& processTracker) const
{
	Trace trace(settings.GetLogLevel());
	trace < L"ProcessWithLogon::Run";
	if (_changeIntegrityLevel)
	{
		trace << L" elevated";
	}
	
	Environment callingProcessEnvironment;
	Environment targetUserEnvironment;
	Environment environment;
	if (settings.GetInheritanceMode() != INHERITANCE_MODE_OFF)
	{
		trace < L"ProcessWithLogon::Get calling process Environment";
		auto callingProcessEnvironmentResult = Environment::CreateForCurrentProcess(trace);
		if (callingProcessEnvironmentResult.HasError())
		{
			return Result<ExitCode>(callingProcessEnvironmentResult.GetError());
		}

		callingProcessEnvironment = callingProcessEnvironmentResult.GetResultValue();
		environment = callingProcessEnvironment;
	}

	if (settings.GetInheritanceMode() != INHERITANCE_MODE_ON)
	{		
		trace < L"ProcessWithLogon::Get target user environment";
		Settings getEnvVarsProcessSettings(
			settings.GetUserName(),
			settings.GetDomain(),
			settings.GetPassword(),
			L"cmd.exe",
			settings.GetWorkingDirectory(),
			EXIT_CODE_BASE,
			{ L"/U", L"/C", L"SET" },
			{ },
			INHERITANCE_MODE_OFF,
			INTEGRITY_LEVEL_AUTO,			
			SHOW_MODE_HIDE,
			false);

		if(settings.GetLogLevel() == LOG_LEVEL_DEBUG)
		{
			getEnvVarsProcessSettings.SetLogLevel(LOG_LEVEL_DEBUG);
		}
		else
		{
			getEnvVarsProcessSettings.SetLogLevel(LOG_LEVEL_OFF);
		}

		wstringstream getEnvVarsStream;
		StringWriter getEnvVarsWriter(getEnvVarsStream);
		StubWriter nullWriter;
		ProcessTracker getEnvVarsProcessTracker(getEnvVarsWriter, nullWriter);
		auto getEnvVarsResult = RunInternal(trace, getEnvVarsProcessSettings, getEnvVarsProcessTracker, targetUserEnvironment, false);
		if (getEnvVarsResult.HasError() || getEnvVarsResult.GetResultValue() != 0)
		{
			return getEnvVarsResult;
		}

		targetUserEnvironment = Environment::CreateFormString(getEnvVarsStream.str(), trace);
		environment = targetUserEnvironment;
	}

	if (settings.GetInheritanceMode() == INHERITANCE_MODE_AUTO)
	{
		environment = Environment::Override(callingProcessEnvironment, targetUserEnvironment, trace);
	}

	environment = Environment::Apply(environment, Environment::CreateFormList(settings.GetEnvironmentVariables(), L"from command line", trace), trace);
	return RunInternal(trace, settings, processTracker, environment, _changeIntegrityLevel);
}
コード例 #15
0
void CSocketItems::ApplyFireOption(LPOBJ lpObj,BYTE btOption,BYTE IncType,WORD IncValue)
{
	int _IncValue = 0;

	switch( btOption )
	{
	case 0:
		_IncValue = GetResultValue(lpObj->m_AttackDamageMaxLeft,IncValue,IncType);
		lpObj->m_AttackDamageMaxLeft += _IncValue;

		_IncValue = GetResultValue(lpObj->m_AttackDamageMinLeft,IncValue,IncType);
		lpObj->m_AttackDamageMinLeft += _IncValue;

		_IncValue = GetResultValue(lpObj->m_AttackDamageMaxRight,IncValue,IncType);
		lpObj->m_AttackDamageMaxRight += _IncValue;

		_IncValue = GetResultValue(lpObj->m_AttackDamageMinRight,IncValue,IncType);
		lpObj->m_AttackDamageMinRight += _IncValue;

		_IncValue = GetResultValue(lpObj->m_MagicDamageMin,IncValue,IncType);
		lpObj->m_MagicDamageMin += _IncValue;

		_IncValue = GetResultValue(lpObj->m_MagicDamageMax,IncValue,IncType);
		lpObj->m_MagicDamageMax += _IncValue;
		break;
	case 1:
		_IncValue = GetResultValue(lpObj->m_AttackSpeed,IncValue,IncType);
		lpObj->m_AttackSpeed += _IncValue;

		_IncValue = GetResultValue(lpObj->m_MagicSpeed,IncValue,IncType);
		lpObj->m_MagicSpeed += _IncValue;
		break;
	case 2:
		_IncValue = GetResultValue(lpObj->m_AttackDamageMaxLeft,IncValue,IncType);
		lpObj->m_AttackDamageMaxLeft += _IncValue;

		_IncValue = GetResultValue(lpObj->m_AttackDamageMaxRight,IncValue,IncType);
		lpObj->m_AttackDamageMaxRight += _IncValue;

		_IncValue = GetResultValue(lpObj->m_MagicDamageMax,IncValue,IncType);
		lpObj->m_MagicDamageMax += _IncValue;
		break;
	case 3:
		_IncValue = GetResultValue(lpObj->m_AttackDamageMinLeft,IncValue,IncType);
		lpObj->m_AttackDamageMinLeft += _IncValue;

		_IncValue = GetResultValue(lpObj->m_AttackDamageMinRight,IncValue,IncType);
		lpObj->m_AttackDamageMinRight += _IncValue;

		_IncValue = GetResultValue(lpObj->m_MagicDamageMin,IncValue,IncType);
		lpObj->m_MagicDamageMin += _IncValue;
		break;
	case 4:
		_IncValue = GetResultValue(lpObj->m_AttackDamageMaxLeft,IncValue,IncType);
		lpObj->m_AttackDamageMaxLeft += _IncValue;

		_IncValue = GetResultValue(lpObj->m_AttackDamageMinLeft,IncValue,IncType);
		lpObj->m_AttackDamageMinLeft += _IncValue;

		_IncValue = GetResultValue(lpObj->m_AttackDamageMaxRight,IncValue,IncType);
		lpObj->m_AttackDamageMaxRight += _IncValue;

		_IncValue = GetResultValue(lpObj->m_AttackDamageMinRight,IncValue,IncType);
		lpObj->m_AttackDamageMinRight += _IncValue;

		_IncValue = GetResultValue(lpObj->m_MagicDamageMin,IncValue,IncType);
		lpObj->m_MagicDamageMin += _IncValue;

		_IncValue = GetResultValue(lpObj->m_MagicDamageMax,IncValue,IncType);
		lpObj->m_MagicDamageMax += _IncValue;
		break;
	case 5:

		lpObj->m_btSocketBPUseDec += IncValue;

		if( lpObj->m_btSocketBPUseDec > 100 )
			lpObj->m_btSocketBPUseDec = 100;

		break;
	}
}