feat: add enchant value to pdef/mdef, patk/matk

This commit is contained in:
k0t9i
2023-01-24 23:50:59 +04:00
parent ca0183603f
commit 4cfb986ce0
8 changed files with 38 additions and 23 deletions

View File

@@ -1,5 +1,7 @@
#include "pch.h"
#include "Common.h"
#include <cmath>
#include <Rpc.h>
#pragma comment(lib, "Rpcrt4.lib")
@@ -31,4 +33,14 @@ std::string GenerateUUID()
wszUuid = NULL;
return std::string(ws.begin(), ws.end());
}
std::uint32_t GetEnchantValue(const std::uint16_t baseValue, const std::uint16_t enchantLevel, const uint8_t lowEnchantDelta, const uint8_t highEnchantDelta)
{
if (baseValue == 0)
{
return 0;
}
return baseValue + enchantLevel * lowEnchantDelta + max(enchantLevel - 3, 0) * (highEnchantDelta - lowEnchantDelta);
}

View File

@@ -1,6 +1,8 @@
#pragma once
#include <string>
#include <cstdint>
std::string ConvertFromWideChar(const wchar_t* str);
std::string GenerateUUID();
std::string GenerateUUID();
std::uint32_t GetEnchantValue(const std::uint16_t baseValue, const std::uint16_t enchantLevel, const uint8_t lowEnchantDelta, const uint8_t highEnchantDelta);