Skip to content

Commit

Permalink
Fix hp/sp table of third classed
Browse files Browse the repository at this point in the history
  • Loading branch information
jigsawye committed Mar 15, 2018
1 parent 4902466 commit ba3db22
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 22 deletions.
89 changes: 70 additions & 19 deletions src/constants/hpspTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,19 @@ export const thirdHpTable = [
],
},
{
job: [classes.GUILLOTINE_CROSS, classes.SHADOW_CHASER, classes.ROYAL_GUARD],
job: [classes.GUILLOTINE_CROSS],
hpTable: [
6050,6093,6208,6324,6441,6559,6678,6798,6920,7043,7167,7292,7418,7545,7673,7802,7932,8063,8196,8330,8465,8601,8738,8876,9015,9155,9296,9438,9582,9727,9873,10020,10168,10317,10467,10618,10770,10923,11078,11234,11391,11549,11708,11868,12029,12191,12354,12518,12684,12851,13019,13188,13351,13518,13684,13850,14016,14182,14349,14515,14681,14830,14966,15103,15241,15380,15520,15661,15803,15946,16090,16235,16381,16528,16676,16825,16975,
],
},
{
job: [classes.ARCH_BISHOP, classes.GENETIC],
job: [classes.ARCH_BISHOP],
hpTable: [
4300,4333,4412,4491,4570,4649,4728,4807,4886,4965,5044,5123,5202,5281,5360,5439,5518,5597,5676,5755,5834,5913,5992,6071,6150,6229,6308,6387,6466,6545,6624,6703,6782,6861,6940,7019,7098,7177,7256,7335,7414,7493,7572,7651,7730,7809,7888,7967,8046,8125,8204,8283,8362,8441,8520,8599,8678,8757,8836,8915,8994,9115,9276,9438,9601,9765,9930,10096,10263,10431,10600,10770,10941,11113,11286,11460,11635,
],
},
{
job: [classes.RANGER, classes.WANDERER, classes.MAESTRO, classes.SORCERER],
job: [classes.RANGER],
hpTable: [
4800,4828,4918,5009,5101,5194,5288,5382,5477,5573,5670,5768,5867,5967,6068,6170,6273,6377,6482,6588,6694,6801,6909,7018,7128,7239,7351,7464,7578,7693,7809,7926,8044,8162,8281,8401,8522,8644,8767,8891,9016,9142,9269,9397,9526,9656,9786,9917,10049,10182,10316,10451,10585,10719,10853,10987,11121,11255,11389,11523,11657,11790,11926,12063,12201,12340,12480,12621,12763,12906,13050,13195,13341,13488,13636,13785,13935,
],
Expand All @@ -163,18 +163,60 @@ export const thirdHpTable = [
],
},
{
job: [classes.SURA, classes.MECHANIC],
job: [classes.ROYAL_GUARD],
hpTable: [
6050,6093,6208,6324,6441,6559,6678,6798,6920,7043,7167,7292,7418,7545,7673,7802,7932,8063,8196,8330,8465,8601,8738,8876,9015,9155,9296,9438,9582,9727,9873,10020,10168,10317,10467,10618,10770,10923,11078,11234,11391,11549,11708,11868,12029,12191,12354,12518,12684,12851,13019,13188,13355,13522,13690,13857,14025,14192,14360,14527,14695,14860,15021,15183,15346,15510,15675,15841,16008,16176,16345,16515,16686,16858,17031,17205,17380,
],
},
{
job: [classes.MECHANIC],
hpTable: [
5807,5844,5952,6061,6172,6283,6396,6510,6625,6741,6857,6974,7093,7212,7333,7455,7578,7702,7828,7954,8081,8208,8337,8467,8598,8730,8864,8998,9134,9271,9408,9546,9685,9825,9967,10109,10253,10398,10544,10691,10838,10987,11136,11287,11439,11592,11746,11901,12057,12215,12372,12531,12688,12845,13003,13160,13318,13475,13633,13790,13948,14105,14266,14428,14591,14755,14920,15086,15253,15421,15590,15760,15931,16103,16276,16450,16625,
],
},
{
job: [classes.SHADOW_CHASER],
hpTable: [
6050,6093,6208,6324,6441,6559,6678,6798,6920,7043,7167,7292,7418,7545,7673,7802,7932,8063,8196,8330,8465,8601,8738,8876,9015,9155,9296,9438,9582,9727,9873,10020,10168,10317,10467,10618,10770,10923,11078,11234,11391,11549,11708,11868,12029,12191,12354,12518,12684,12851,13019,13188,13300,13420,13500,13600,13700,13800,13900,14000,14100,14200,14301,14403,14506,14610,14715,14821,14928,15036,15145,15255,15366,15478,15591,15705,15820,
],
},
{
job: [classes.SURA],
hpTable: [
5050,5082,5176,5271,5367,5464,5562,5661,5761,5862,5963,6065,6168,6272,6377,6483,6590,6698,6807,6917,7027,7138,7250,7363,7477,7592,7708,7825,7943,8062,8181,8301,8422,8544,8667,8791,8916,9042,9169,9297,9425,9554,9684,9815,9947,10080,10214,10349,10485,10622,10759,10897,11033,11170,11307,11444,11581,11718,11855,11992,12129,12265,12406,12548,12691,12835,12980,13126,13273,13421,13570,13720,13871,14023,14176,14330,14485,
]
},
{
job: [classes.WANDERER, classes.MAESTRO],
hpTable: [
4800,4828,4918,5009,5101,5194,5288,5382,5477,5573,5670,5768,5867,5967,6068,6170,6273,6377,6482,6588,6694,6801,6909,7018,7128,7239,7351,7464,7578,7693,7809,7926,8044,8162,8281,8401,8522,8644,8767,8891,9016,9142,9269,9397,9526,9656,9786,9917,10049,10182,10316,10451,10584,10717,10851,10984,11118,11251,11385,11518,11652,11785,11921,12058,12196,12335,12475,12616,12758,12901,13045,13190,13336,13483,13631,13780,13930,
],
},
{
job: [classes.SORCERER],
hpTable: [
4080,4103,4180,4257,4335,4414,4494,4574,4655,4737,4819,4902,4986,5071,5157,5244,5332,5420,5509,5599,5689,5780,5872,5965,6058,6153,6248,6344,6441,6539,6637,6737,6837,6937,7038,7140,7243,7347,7451,7557,7663,7770,7878,7987,8097,8207,8318,8429,8541,8654,8768,8883,8994,9107,9220,9280,9340,9450,9570,9680,9798,9915,10036,10158,10281,10405,10530,10656,10783,10911,11040,11170,11301,11433,11566,11700,11835,
],
},
{
job: [classes.GENETIC],
hpTable: [
5807,5844,5952,6061,6172,6283,6396,6510,6625,6741,6857,6974,7093,7212,7333,7455,7578,7702,7828,7954,8081,8208,8337,8467,8598,8730,8864,8998,9134,9271,9408,9546,9685,9825,9967,10109,10253,10398,10544,10691,10838,10987,11136,11287,11439,11592,11746,11901,12057,12215,12372,12531,12688,12845,13003,13160,13318,13475,13633,13790,13948,14105,14266,14428,14591,14755,14920,15086,15253,15421,15590,15760,15931,16103,16276,16450,1662,
4730,4766,4853,4940,5027,5113,5200,5287,5374,5461,5548,5635,5722,5809,5896,5982,6069,6156,6243,6330,6417,6504,6591,6678,6765,6851,6938,7025,7112,7199,7286,7373,7460,7547,7634,7720,7807,7894,7981,8068,8155,8242,8329,8416,8503,8589,8676,8763,8850,8937,9024,9111,9198,9285,9372,9459,9546,9633,9720,9807,9894,9980,10141,10303,10466,10630,10795,10961,11128,11296,11465,11635,11806,11978,12151,12325,12500,
],
},
];

export const thirdSpTable = [
{
job: [classes.GENETIC, classes.WARLOCK, classes.SORCERER],
job: [classes.RUNE_KNIGHT],
spTable: [
900,910,919,928,937,946,955,964,973,982,991,1000,1009,1018,1027,1036,1045,1054,1063,1072,1081,1090,1099,1108,1117,1126,1135,1144,1153,1162,1171,1180,1189,1198,1207,1216,1225,1234,1243,1252,1261,1270,1279,1288,1297,1306,1315,1324,1333,1342,1351,1360,1369,1378,1387,1396,1405,1414,1423,1432,1441,1450,1460,1470,1480,1490,1500,1511,1522,1533,1544,1555,1567,1579,1591,1603,1615,
300,310,313,316,319,322,325,328,331,334,337,340,343,346,349,352,355,358,361,364,367,370,373,376,379,382,385,388,391,394,397,400,403,406,409,412,415,418,421,424,427,430,433,436,439,442,445,448,451,454,457,460,500,566,629,672,710,748,781,824,847,890,894,898,902,906,910,915,920,925,930,935,941,947,953,959,965,
],
},
{
job: [classes.GUILLOTINE_CROSS],
spTable: [
400,410,414,418,422,426,430,434,438,442,446,450,454,458,462,466,470,474,478,482,486,490,494,498,502,506,510,514,518,522,526,530,534,538,542,546,550,554,558,562,566,570,574,578,582,586,590,594,598,602,606,610,670,695,700,715,730,745,760,785,790,805,810,815,820,825,830,836,842,848,854,860,867,874,881,888,895,
],
},
{
Expand All @@ -184,24 +226,33 @@ export const thirdSpTable = [
],
},
{
job: [
classes.GUILLOTINE_CROSS,
classes.RANGER,
classes.MECHANIC,
classes.SHADOW_CHASER,
classes.WANDERER,
classes.MAESTRO,
classes.SURA,
classes.ROYAL_GUARD,
job: [classes.RANGER],
spTable: [
400,410,414,418,422,426,430,434,438,442,446,450,454,458,462,466,470,474,478,482,486,490,494,498,502,506,510,514,518,522,526,530,534,538,542,546,550,554,558,562,566,570,574,578,582,586,590,594,598,602,606,610,650,675,680,695,710,725,740,765,770,785,790,795,800,805,810,816,822,828,834,840,847,854,861,868,875,
],
},
{
job: [classes.WARLOCK, classes.SORCERER, classes.GENETIC],
spTable: [
900,910,919,928,937,946,955,964,973,982,991,1000,1009,1018,1027,1036,1045,1054,1063,1072,1081,1090,1099,1108,1117,1126,1135,1144,1153,1162,1171,1180,1189,1198,1207,1216,1225,1234,1243,1252,1261,1270,1279,1288,1297,1306,1315,1324,1333,1342,1351,1360,1369,1378,1387,1396,1405,1414,1423,1432,1441,1450,1460,1470,1480,1490,1500,1511,1522,1533,1544,1555,1567,1579,1591,1603,1615,
],
},
{
job: [classes.MECHANIC, classes.ROYAL_GUARD],
spTable: [
400,410,414,418,422,426,430,434,438,442,446,450,454,458,462,466,470,474,478,482,486,490,494,498,502,506,510,514,518,522,526,530,534,538,542,546,550,554,558,562,566,570,574,578,582,586,590,594,598,602,606,610,670,695,700,715,730,745,760,785,790,805,810,815,820,825,830,836,842,848,854,860,867,874,881,888,895,
400,410,414,418,422,426,430,434,438,442,446,450,454,458,462,466,470,474,478,482,486,490,494,498,502,506,510,514,518,522,526,530,534,538,542,546,550,554,558,562,566,570,574,578,582,586,590,594,598,602,606,610,700,760,820,880,930,965,1020,1132,1160,1230,1235,1240,1245,1250,1255,1261,1267,1273,1279,1285,1292,1299,1306,1313,1320,
],
},
{
job: [classes.RUNE_KNIGHT],
job: [classes.SHADOW_CHASER, classes.SURA],
spTable: [
300,310,313,316,319,322,325,328,331,334,337,340,343,346,349,352,355,358,361,364,367,370,373,376,379,382,385,388,391,394,397,400,403,406,409,412,415,418,421,424,427,430,433,436,439,442,445,448,451,454,457,460,500,566,629,672,710,748,781,824,847,890,894,898,902,906,910,915,920,925,930,935,941,947,953,959,965,
400,410,414,418,422,426,430,434,438,442,446,450,454,458,462,466,470,474,478,482,486,490,494,498,502,506,510,514,518,522,526,530,534,538,542,546,550,554,558,562,566,570,574,578,582,586,590,594,598,602,606,610,614,618,622,626,630,634,638,642,646,650,655,660,665,670,675,681,687,693,699,705,712,719,726,733,740,
],
},
{
job: [classes.WANDERER, classes.MAESTRO],
spTable: [
400,410,414,418,422,426,430,434,438,442,446,450,454,458,462,466,470,474,478,482,486,490,494,498,502,506,510,514,518,522,526,530,534,538,542,546,550,554,558,562,566,570,574,578,582,586,590,594,598,602,606,610,614,648,702,726,750,774,808,822,846,850,855,860,865,870,875,881,887,893,899,905,912,919,926,933,940
],
},
];
8 changes: 5 additions & 3 deletions src/utils/hpsp.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { secondHpTable, secondSpTable, thirdHpTable, thirdSpTable } from '../con

const findTable = (table, job) => find(table, compose(includes(job[1]), prop('job')));

const getTransMod = type => type === SECOND ? 1 : 1.25;

const getSecondBaseHp = (baseLevel, job) => {
const { hpJobA, hpJobB } = findTable(secondHpTable, job);
const baseHp = 35 + baseLevel * hpJobB;
Expand All @@ -32,16 +34,16 @@ const getThirdBaseSp = (baseLevel, job) => {

export const getMaxHp = (baseLevel, job, vit, { hpAddMod, hpMultiMod }) => {
const type = getJobType(job)
const transMod = type === SECOND ? 1 : 1.25;
const transMod = getTransMod(type);
const getBaseHp = type === THIRD ? getThirdBaseHp : getSecondBaseHp;
const baseHp = getBaseHp(baseLevel, job);
const maxHp = floor(baseHp * (1 + vit * 0.01) * transMod) + hpAddMod;
const maxHp = floor(floor(baseHp * (1 + vit * 0.01)) * transMod) + hpAddMod;
return floor(maxHp * (1 + hpMultiMod * 0.01));
};

export const getMaxSp = (baseLevel, job, int, { spAddMod, spMultiMod }) => {
const type = getJobType(job)
const transMod = type === SECOND ? 1 : 1.25;
const transMod = getTransMod(type);
const getBaseSp = type === THIRD ? getThirdBaseSp : getSecondBaseSp;
const baseSp = getBaseSp(baseLevel, job);
const maxSp =floor(floor(baseSp * (1 + int * 0.01)) * transMod) + spAddMod;
Expand Down

0 comments on commit ba3db22

Please sign in to comment.