mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-02 00:47:45 +00:00
remove old max mp code, remove level modifiers for pie/mp, cap to 10k mp
This commit is contained in:
parent
9039ceba1f
commit
36481a44b0
4 changed files with 85 additions and 114 deletions
|
@ -971,8 +971,6 @@ namespace Sapphire::Common
|
||||||
|
|
||||||
enum LevelTableEntry : uint8_t
|
enum LevelTableEntry : uint8_t
|
||||||
{
|
{
|
||||||
PIE,
|
|
||||||
MP,
|
|
||||||
MAIN,
|
MAIN,
|
||||||
SUB,
|
SUB,
|
||||||
DIV,
|
DIV,
|
||||||
|
|
|
@ -285,7 +285,7 @@ void Sapphire::Entity::Player::calculateStats()
|
||||||
m_baseStats.attackPotMagic = m_baseStats.inte;
|
m_baseStats.attackPotMagic = m_baseStats.inte;
|
||||||
m_baseStats.healingPotMagic = m_baseStats.mnd;
|
m_baseStats.healingPotMagic = m_baseStats.mnd;
|
||||||
|
|
||||||
m_baseStats.max_mp = Math::CalcStats::calculateMaxMp( getAsPlayer(), m_pFw );
|
m_baseStats.max_mp = 10000;
|
||||||
|
|
||||||
m_baseStats.max_hp = Math::CalcStats::calculateMaxHp( getAsPlayer(), m_pFw );
|
m_baseStats.max_hp = Math::CalcStats::calculateMaxHp( getAsPlayer(), m_pFw );
|
||||||
|
|
||||||
|
|
|
@ -15,92 +15,93 @@
|
||||||
using namespace Sapphire::Math;
|
using namespace Sapphire::Math;
|
||||||
using namespace Sapphire::Entity;
|
using namespace Sapphire::Entity;
|
||||||
|
|
||||||
const int levelTable[81][7] =
|
const int levelTable[81][5] =
|
||||||
{
|
{
|
||||||
// PIE, MP, MAIN,SUB,DIV,HP,ELMT,THREAT
|
// MAIN,SUB,DIV,HP,ELMT,THREAT
|
||||||
{ 1, 1, 1, 1, 1, 1, 1 },
|
{ 1, 1, 1, 1, 1 },
|
||||||
{ 50, 104, 20, 56, 56, 0, 52 },
|
{ 20, 56, 56, 0, 52 },
|
||||||
{ 55, 114, 21, 57, 57, 0, 54 },
|
{ 21, 57, 57, 0, 54 },
|
||||||
{ 60, 123, 22, 60, 60, 0, 56 },
|
{ 22, 60, 60, 0, 56 },
|
||||||
{ 65, 133, 24, 62, 62, 0, 58 },
|
{ 24, 62, 62, 0, 58 },
|
||||||
{ 70, 142, 26, 65, 65, 0, 60 },
|
{ 26, 65, 65, 0, 60 },
|
||||||
{ 75, 152, 27, 68, 68, 0, 62 },
|
{ 27, 68, 68, 0, 62 },
|
||||||
{ 80, 161, 29, 70, 70, 0, 64 },
|
{ 29, 70, 70, 0, 64 },
|
||||||
{ 85, 171, 31, 73, 73, 0, 66 },
|
{ 31, 73, 73, 0, 66 },
|
||||||
{ 90, 180, 33, 76, 76, 0, 68 },
|
{ 33, 76, 76, 0, 68 },
|
||||||
{ 95, 190, 35, 78, 78, 0, 70 },
|
{ 35, 78, 78, 0, 70 },
|
||||||
{ 100, 209, 36, 82, 82, 0, 73 },
|
{ 36, 82, 82, 0, 73 },
|
||||||
{ 105, 228, 38, 85, 85, 0, 75 },
|
{ 38, 85, 85, 0, 75 },
|
||||||
{ 110, 247, 41, 89, 89, 0, 78 },
|
{ 41, 89, 89, 0, 78 },
|
||||||
{ 115, 266, 44, 93, 93, 0, 81 },
|
{ 44, 93, 93, 0, 81 },
|
||||||
{ 120, 285, 46, 96, 96, 0, 84 },
|
{ 46, 96, 96, 0, 84 },
|
||||||
{ 125, 304, 49, 100, 100, 0, 86 },
|
{ 49, 100, 100, 0, 86 },
|
||||||
{ 130, 323, 52, 104, 104, 0, 89 },
|
{ 52, 104, 104, 0, 89 },
|
||||||
{ 135, 342, 54, 109, 109, 0, 93 },
|
{ 54, 109, 109, 0, 93 },
|
||||||
{ 140, 361, 57, 113, 113, 0, 95 },
|
{ 57, 113, 113, 0, 95 },
|
||||||
{ 145, 380, 60, 116, 116, 0, 98 },
|
{ 60, 116, 116, 0, 98 },
|
||||||
{ 150, 418, 63, 122, 122, 0, 102 },
|
{ 63, 122, 122, 0, 102 },
|
||||||
{ 155, 456, 67, 127, 127, 0, 105 },
|
{ 67, 127, 127, 0, 105 },
|
||||||
{ 160, 494, 71, 133, 133, 0, 109 },
|
{ 71, 133, 133, 0, 109 },
|
||||||
{ 165, 532, 74, 138, 138, 0, 113 },
|
{ 74, 138, 138, 0, 113 },
|
||||||
{ 170, 570, 78, 144, 144, 0, 117 },
|
{ 78, 144, 144, 0, 117 },
|
||||||
{ 175, 608, 81, 150, 150, 0, 121 },
|
{ 81, 150, 150, 0, 121 },
|
||||||
{ 180, 646, 85, 155, 155, 0, 125 },
|
{ 85, 155, 155, 0, 125 },
|
||||||
{ 185, 684, 89, 162, 162, 0, 129 },
|
{ 89, 162, 162, 0, 129 },
|
||||||
{ 190, 722, 92, 168, 168, 0, 133 },
|
{ 92, 168, 168, 0, 133 },
|
||||||
{ 195, 760, 97, 173, 173, 0, 137 },
|
{ 97, 173, 173, 0, 137 },
|
||||||
{ 200, 826, 101, 181, 181, 0, 143 },
|
{ 101, 181, 181, 0, 143 },
|
||||||
{ 205, 893, 106, 188, 188, 0, 148 },
|
{ 106, 188, 188, 0, 148 },
|
||||||
{ 210, 959, 110, 194, 194, 0, 153 },
|
{ 110, 194, 194, 0, 153 },
|
||||||
{ 215, 1026, 115, 202, 202, 0, 159 },
|
{ 115, 202, 202, 0, 159 },
|
||||||
{ 220, 1092, 119, 209, 209, 0, 165 },
|
{ 119, 209, 209, 0, 165 },
|
||||||
{ 225, 1159, 124, 215, 215, 0, 170 },
|
{ 124, 215, 215, 0, 170 },
|
||||||
{ 230, 1225, 128, 223, 223, 0, 176 },
|
{ 128, 223, 223, 0, 176 },
|
||||||
{ 235, 1292, 134, 229, 229, 0, 181 },
|
{ 134, 229, 229, 0, 181 },
|
||||||
{ 240, 1358, 139, 236, 236, 0, 186 },
|
{ 139, 236, 236, 0, 186 },
|
||||||
{ 245, 1425, 144, 244, 244, 0, 192 },
|
{ 144, 244, 244, 0, 192 },
|
||||||
{ 250, 1548, 150, 253, 253, 0, 200 },
|
{ 150, 253, 253, 0, 200 },
|
||||||
{ 255, 1672, 155, 263, 263, 0, 207 },
|
{ 155, 263, 263, 0, 207 },
|
||||||
{ 260, 1795, 161, 272, 272, 0, 215 },
|
{ 161, 272, 272, 0, 215 },
|
||||||
{ 265, 1919, 166, 283, 283, 0, 223 },
|
{ 166, 283, 283, 0, 223 },
|
||||||
{ 270, 2042, 171, 292, 292, 0, 231 },
|
{ 171, 292, 292, 0, 231 },
|
||||||
{ 275, 2166, 177, 302, 302, 0, 238 },
|
{ 177, 302, 302, 0, 238 },
|
||||||
{ 280, 2289, 183, 311, 311, 0, 246 },
|
{ 183, 311, 311, 0, 246 },
|
||||||
{ 285, 2413, 189, 322, 322, 0, 254 },
|
{ 189, 322, 322, 0, 254 },
|
||||||
{ 290, 2536, 196, 331, 331, 0, 261 },
|
{ 196, 331, 331, 0, 261 },
|
||||||
{ 300, 2660, 202, 341, 341, 1700, 269 },
|
{ 202, 341, 341, 1700, 269 },
|
||||||
{ 315, 3000, 204, 342, 393, 1774, 270 },
|
{ 204, 342, 393, 1774, 270 },
|
||||||
{ 330, 3380, 205, 344, 444, 1851, 271 },
|
{ 205, 344, 444, 1851, 271 },
|
||||||
{ 360, 3810, 207, 345, 496, 1931, 273 },
|
{ 207, 345, 496, 1931, 273 },
|
||||||
{ 390, 4300, 209, 346, 548, 2015, 274 },
|
{ 209, 346, 548, 2015, 274 },
|
||||||
{ 420, 4850, 210, 347, 600, 2102, 275 },
|
{ 210, 347, 600, 2102, 275 },
|
||||||
{ 450, 5470, 212, 349, 651, 2194, 276 },
|
{ 212, 349, 651, 2194, 276 },
|
||||||
{ 480, 6170, 214, 350, 703, 2289, 278 },
|
{ 214, 350, 703, 2289, 278 },
|
||||||
{ 510, 6950, 215, 351, 755, 2388, 279 },
|
{ 215, 351, 755, 2388, 279 },
|
||||||
{ 540, 7840, 217, 352, 806, 2492, 280 },
|
{ 217, 352, 806, 2492, 280 },
|
||||||
{ 620, 8840, 218, 354, 858, 2600, 282 },
|
{ 218, 354, 858, 2600, 282 },
|
||||||
{ 650, 8980, 224, 355, 941, 2700, 283 },
|
{ 224, 355, 941, 2700, 283 },
|
||||||
{ 680, 9150, 228, 356, 1032, 2800, 284 },
|
{ 228, 356, 1032, 2800, 284 },
|
||||||
{ 710, 9350, 236, 357, 1133, 2900, 286 },
|
{ 236, 357, 1133, 2900, 286 },
|
||||||
{ 740, 9590, 244, 358, 1243, 3000, 287 },
|
{ 244, 358, 1243, 3000, 287 },
|
||||||
{ 770, 9870, 252, 359, 1364, 3100, 288 },
|
{ 252, 359, 1364, 3100, 288 },
|
||||||
{ 800, 10190, 260, 360, 1497, 3200, 290 },
|
{ 260, 360, 1497, 3200, 290 },
|
||||||
{ 830, 10560, 268, 361, 1643, 3300, 292 },
|
{ 268, 361, 1643, 3300, 292 },
|
||||||
{ 860, 10980, 276, 362, 1802, 3400, 293 },
|
{ 276, 362, 1802, 3400, 293 },
|
||||||
{ 890, 11450, 284, 363, 1978, 3500, 294 },
|
{ 284, 363, 1978, 3500, 294 },
|
||||||
{ 890, 12000, 292, 364, 2170, 3600, 295 },
|
{ 292, 364, 2170, 3600, 295 },
|
||||||
|
|
||||||
// todo: add proper shbr values
|
// todo: add proper shbr values
|
||||||
{ 890, 12000, 292, 364, 2170, 3600, 295 },
|
// sub/div added from http://theoryjerks.akhmorning.com/resources/levelmods/
|
||||||
{ 890, 12000, 292, 364, 2170, 3600, 295 },
|
{ 292, 365, 2263, 3600, 295 },
|
||||||
{ 890, 12000, 292, 364, 2170, 3600, 295 },
|
{ 292, 366, 2360, 3600, 295 },
|
||||||
{ 890, 12000, 292, 364, 2170, 3600, 295 },
|
{ 292, 367, 2461, 3600, 295 },
|
||||||
{ 890, 12000, 292, 364, 2170, 3600, 295 },
|
{ 292, 368, 2566, 3600, 295 },
|
||||||
{ 890, 12000, 292, 364, 2170, 3600, 295 },
|
{ 292, 370, 2676, 3600, 295 },
|
||||||
{ 890, 12000, 292, 364, 2170, 3600, 295 },
|
{ 292, 372, 2790, 3600, 295 },
|
||||||
{ 890, 12000, 292, 364, 2170, 3600, 295 },
|
{ 292, 374, 2910, 3600, 295 },
|
||||||
{ 890, 12000, 292, 364, 2170, 3600, 295 },
|
{ 292, 376, 3034, 3600, 295 },
|
||||||
{ 890, 12000, 292, 364, 2170, 3600, 295 },
|
{ 292, 378, 3164, 3600, 295 },
|
||||||
|
{ 292, 380, 3300, 3600, 295 },
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -173,32 +174,6 @@ uint32_t CalcStats::calculateMaxHp( PlayerPtr pPlayer, Sapphire::FrameworkPtr pF
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Leggerless' MP Formula
|
|
||||||
// ROUNDDOWN(((ROUNDDOWN(((PIE - BaseDET) * PieMPMod/100),0) + BaseMP) * JobModMP / 100),0)
|
|
||||||
|
|
||||||
uint32_t CalcStats::calculateMaxMp( PlayerPtr pPlayer, Sapphire::FrameworkPtr pFw )
|
|
||||||
{
|
|
||||||
auto pExdData = pFw->get< Data::ExdDataGenerated >();
|
|
||||||
auto classInfo = pExdData->get< Sapphire::Data::ClassJob >( static_cast< uint8_t >( pPlayer->getClass() ) );
|
|
||||||
auto paramGrowthInfo = pExdData->get< Sapphire::Data::ParamGrow >( pPlayer->getLevel() );
|
|
||||||
|
|
||||||
if( !classInfo || !paramGrowthInfo )
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
auto pieMod = pPlayer->getBonusStat( Common::BaseParam::Piety );
|
|
||||||
|
|
||||||
float baseStat = calculateBaseStat( *pPlayer );
|
|
||||||
uint16_t piety = pPlayer->getStats().pie + pieMod;
|
|
||||||
uint16_t pietyScalar = paramGrowthInfo->mpModifier;
|
|
||||||
uint16_t jobModMp = classInfo->modifierManaPoints;
|
|
||||||
uint16_t baseMp = paramGrowthInfo->mpModifier;
|
|
||||||
|
|
||||||
uint16_t result = static_cast< uint16_t >( floor( floor( piety - baseStat ) * ( pietyScalar / 100 ) + baseMp ) *
|
|
||||||
jobModMp / 100 );
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
float CalcStats::blockProbability( const Chara& chara )
|
float CalcStats::blockProbability( const Chara& chara )
|
||||||
{
|
{
|
||||||
auto level = chara.getLevel();
|
auto level = chara.getLevel();
|
||||||
|
|
|
@ -15,8 +15,6 @@ namespace Sapphire::Math
|
||||||
|
|
||||||
static float calculateBaseStat( const Entity::Chara& chara );
|
static float calculateBaseStat( const Entity::Chara& chara );
|
||||||
|
|
||||||
static uint32_t calculateMaxMp( Sapphire::Entity::PlayerPtr pPlayer, FrameworkPtr pFw );
|
|
||||||
|
|
||||||
static uint32_t calculateMaxHp( Sapphire::Entity::PlayerPtr pPlayer, FrameworkPtr pFw );
|
static uint32_t calculateMaxHp( Sapphire::Entity::PlayerPtr pPlayer, FrameworkPtr pFw );
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
Loading…
Add table
Reference in a new issue