Browse Source

Updated calculation for Max HP/SP, Max level cap, and parameters!
* Renamed job_maxhpsp_db to job_basehpsp_db.txt and add new values according to the base HP/SP calculation. Ref: http://irowiki.org/wiki/Max_HP, http://irowiki.org/wiki/Max_SP
* Updated the Max HP/SP calculation. Ref: http://irowiki.org/wiki/Max_HP, http://irowiki.org/wiki/Max_SP
* Changed Max Level for 3rd classes become 175/60. Ref: http://forums.irowiki.org/showpost.php?p=1344057&postcount=217
* Changed Max Parameters for 3rd classes from 125 to 130. Ref: http://forums.irowiki.org/showpost.php?p=1344057&postcount=217
* Changed Max Parameters for Baby 3rd Classes from 107 to 118: Ref: http://forums.irowiki.org/showpost.php?p=1344057&postcount=217
* Oboro/Kagerou and Rebellion, are 160/50 and max param is still 125
* Added and separated configs on conf/player.conf, becomes:
-- max_parameter,
-- max_trans_parameter,
-- max_third_parameter,
-- max_third_trans_parameter,
-- max_baby_parameter,
-- max_baby_third_parameter,
-- max_extended_parameter,
* Added new db file job_param_db.txt for RE and PRE-RE, which allow you to modify the max param for each job
* HP_SP_TABLES on core.h is disable by default

NOTE:
* Still need official value to add bonus status for 3rd classes from Job Level 50 to 60
* Still need official value for total status point from Base Level up to 175 also the EXP values
* I hope the calculations results are closer with Max HP/SP values with official servers

Signed-off-by: Cydh Ramdh <house.bad@gmail.com>

Cydh Ramdh 11 years ago
parent
commit
96443cd710

+ 14 - 9
conf/battle/player.conf

@@ -78,17 +78,22 @@ max_hp: 1000000
 // Maximum SP. (Default is 1000000)
 max_sp: 1000000
 
-// Max limit of char stats. (agi, str, etc.)
+// Maximum params/stats for each class. (str, agi, vit, int, dex, and luk)
+// 'max_parameter' for novice, non-trans, non-baby, and non-3rd classes
+// 'max_trans_parameter' for trans classes (non-3rd trans classes)
+// 'max_third_parameter' for 3rd classes (regular/non-trans) except baby 3rd clasess
+// 'max_third_trans_parameter' for 3rd trans classes
+// 'max_baby_parameter' for baby classes except baby 3rd classes
+// 'max_baby_third_parameter' for baby 3rd classes only
+// 'max_extended_parameter' for extended 2nd class (Kagerou/Oboro and Rebellion)
+// For mor specific/advanced option, see 'db/[pre-]re/job_params_db.txt'
 max_parameter: 99
-
-// Same as max_parameter, but for 3rd classes.
-max_third_parameter: 125
-
-// Same as max_parameter, but for baby classes.
+max_trans_parameter: 99
+max_third_parameter: 130
+max_third_trans_parameter: 130
 max_baby_parameter: 80
-
-// Same as max_parameter, but for baby 3rd's.
-max_baby_third_parameter: 108
+max_baby_third_parameter: 117
+max_extended_parameter: 125
 
 // Max armor def/mdef
 // NOTE: This setting have no effect if server is run on Renewal Mode (RENEWAL) 

+ 6 - 6
db/pre-re/item_db.txt

@@ -4968,12 +4968,12 @@
 12419,Mana_Plus,Mana Plus,2,100,,50,,,,,0xFFFFFFFF,7,2,,,,,,{},{},{}
 12420,Stamina_Up_M,Stamina Up M,2,100,,50,,,,,0xFFFFFFFF,7,2,,,,,,{},{},{}
 12421,Falmons_F,Falmons F,3,10,,10,,,,,,,,,,,,,{},{},{}
-12422,HP_Increase_Potion_(Small),HP Increase Potion (Small),0,10,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCMHPRATE,500000,1; sc_start SC_INCMHP,500000,(500+(10/3)*BaseLevel); percentheal 2,0; },{},{}
-12423,HP_Increase_Potion_(Medium),HP Increase Potion (Medium),0,10,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCMHPRATE,500000,2; sc_start SC_INCMHP,500000,(1500+(10/3)*BaseLevel); percentheal 3,0; },{},{}
-12424,HP_Increase_Potion_(Large),HP Increase Potion (Large),0,10,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCMHPRATE,500000,5; sc_start SC_INCMHP,500000,(2500+(10/3)*BaseLevel); percentheal 5,0; },{},{}
-12425,SP_Increase_Potion_(Small),SP Increase Potion (Small),0,10,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCMSPRATE,500000,2; percentheal 0,2; },{},{}
-12426,SP_Increase_Potion_(Medium),SP Increase Potion (Medium),0,10,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCMSPRATE,500000,4; percentheal 0,4; },{},{}
-12427,SP_Increase_Potion_(Large),SP Increase Potion (Large),0,10,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCMSPRATE,500000,8; percentheal 0,8; },{},{}
+12422,HP_Increase_Potion_(Small),HP Increase Potion (Small),0,10,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCMHP,500000,(500+(10/3)*BaseLevel); percentheal 1,0; },{},{}
+12423,HP_Increase_Potion_(Medium),HP Increase Potion (Medium),0,10,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCMHP,500000,(1500+(10/3)*BaseLevel); percentheal 2,0; },{},{}
+12424,HP_Increase_Potion_(Large),HP Increase Potion (Large),0,10,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCMHP,500000,(2500+(10/3)*BaseLevel); percentheal 5,0; },{},{}
+12425,SP_Increase_Potion_(Small),SP Increase Potion (Small),0,10,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCMSPRATE,500000,((BaseLevel/10)-5); percentheal 0,2; },{},{}
+12426,SP_Increase_Potion_(Medium),SP Increase Potion (Medium),0,10,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCMSPRATE,500000,(BaseLevel/10); percentheal 0,4; },{},{}
+12427,SP_Increase_Potion_(Large),SP Increase Potion (Large),0,10,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_INCMSPRATE,500000,((BaseLevel/10)+5); percentheal 0,8; },{},{}
 12428,Concentrated_White_Potion_Z,Concentrated White Potion Z,0,10,,10,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_EXTRACT_WHITE_POTION_Z,500000,0; heal 1000,0; },{},{}
 12429,Savage_Full_Roast,Savage Full Roast,2,,,50,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_SAVAGE_STEAK,300000,20; },{},{}
 12430,Cocktail_Warg_Blood,Cocktail Warg Blood,2,,,50,,,,,0xFFFFFFFF,7,2,,,,,,{ sc_start SC_COCKTAIL_WARG_BLOOD,300000,20; },{},{}

File diff suppressed because it is too large
+ 13 - 0
db/pre-re/job_basehpsp_db.txt


+ 0 - 166
db/pre-re/job_maxhpsp_db.txt

@@ -1,166 +0,0 @@
-//MaxHP & MaxSP tables format:
-//Start Level,Max Level,Class list,Type,Max value for Lv 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99
-//Type (0 - MaxHP; 1 - MaxSP) 
-
-//===================================
-// Pre-Renewal MaxHP & MaxSP Database
-//===================================
-
-//MaxHP - Novice/Super Novice/Novice High/Baby Novice/Baby Super Novice/Super Novice (Expanded)
-1,99,0:23:4001:4023:4045:4190:4191,0,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110,115,120,125,130,135,140,145,150,155,160,165,170,175,180,185,190,195,200,205,210,215,220,225,230,235,240,245,250,255,260,265,270,275,280,285,290,295,300,305,310,315,320,325,330,335,340,345,350,355,360,365,370,375,380,385,390,395,400,405,410,415,420,425,430,435,440,445,450,455,460,465,470,475,480,485,490,495,500,505,510,515,520,525,530
-
-//MaxHP - Swordman/Swordman High/Baby Swordman
-1,99,1:4002:4024,0,40,46,53,61,70,79,89,100,111,123,136,149,163,178,194,210,227,245,263,282,302,322,343,365,388,411,435,460,485,511,538,565,593,622,652,682,713,745,777,810,844,878,913,949,986,1023,1061,1100,1139,1179,1220,1261,1303,1346,1390,1434,1479,1525,1571,1618,1666,1714,1763,1813,1864,1915,1967,2020,2073,2127,2182,2237,2293,2350,2408,2466,2525,2585,2645,2706,2768,2830,2893,2957,3022,3087,3153,3220,3287,3355,3424,3493,3563,3634,3706,3778,3851,3925,3999
-
-//MaxHP - Magician/Magician High/Baby Magician
-1,99,2:4003:4025,0,40,46,52,58,65,72,79,86,94,102,110,119,128,137,147,157,167,177,188,199,210,222,234,246,259,272,285,298,312,326,340,355,370,385,401,417,433,449,466,483,500,518,536,554,573,592,611,630,650,670,690,711,732,753,775,797,819,841,864,887,910,934,958,982,1007,1032,1057,1082,1108,1134,1160,1187,1214,1241,1269,1297,1325,1353,1382,1411,1440,1470,1500,1530,1561,1592,1623,1654,1686,1718,1750,1783,1816,1849,1883,1917,1951,1985,2020
-
-//MaxHP - Archer/Thief/Archer High/Thief High/Baby Archer/Baby Thief
-1,99,3:6:4004:4007:4026:4029,0,40,46,53,60,68,76,85,94,104,114,125,136,148,160,173,186,200,214,229,244,260,276,293,310,328,346,365,384,404,424,445,466,488,510,533,556,580,604,629,654,680,706,733,760,788,816,845,874,904,934,965,996,1028,1060,1093,1126,1160,1194,1229,1264,1300,1336,1373,1410,1448,1486,1525,1564,1604,1644,1685,1726,1768,1810,1853,1896,1940,1984,2029,2074,2120,2166,2213,2260,2308,2356,2405,2454,2504,2554,2605,2656,2708,2760,2813,2866,2920,2974,3029
-
-//MaxHP - Acolyte/Merchant/Acolyte High/Merchant High/Baby Acolyte/Baby Merchant
-1,99,4:5:4005:4006:4027:4028,0,40,46,52,59,66,73,81,89,98,107,116,126,136,147,158,169,181,193,206,219,232,246,260,275,290,305,321,337,354,371,388,406,424,443,462,481,501,521,542,563,584,606,628,651,674,697,721,745,770,795,820,846,872,899,926,953,981,1009,1038,1067,1096,1126,1156,1187,1218,1249,1281,1313,1346,1379,1412,1446,1480,1515,1550,1585,1621,1657,1694,1731,1768,1806,1844,1883,1922,1961,2001,2041,2082,2123,2164,2206,2248,2291,2334,2377,2421,2465,2510
-
-//MaxHP - Knight/Knight (Peco)/Lord Knight/Lord Knight (Peco)/Baby Knight/Baby Knight (Peco)
-1,99,7:13:4008:4014:4030:4036,0,40,48,58,69,82,96,112,129,148,168,190,213,238,264,292,321,352,384,418,453,490,528,568,609,652,696,742,789,838,888,940,993,1048,1104,1162,1221,1282,1344,1408,1473,1540,1608,1678,1749,1822,1896,1972,2049,2128,2208,2290,2373,2458,2544,2632,2721,2812,2904,2998,3093,3190,3288,3388,3489,3592,3696,3802,3909,4018,4128,4240,4353,4468,4584,4702,4821,4942,5064,5188,5313,5440,5568,5698,5829,5962,6096,6232,6369,6508,6648,6790,6933,7078,7224,7372,7521,7672,7824,7978
-
-//MaxHP - Priest/Sage/High Priest/Professor/Baby Priest/Baby Sage
-1,99,8:16:4009:4017:4031:4039,0,40,47,54,62,71,81,91,102,114,127,140,154,169,185,201,218,236,255,274,294,315,337,359,382,406,431,456,482,509,537,565,594,624,655,686,718,751,785,819,854,890,927,964,1002,1041,1081,1121,1162,1204,1247,1290,1334,1379,1425,1471,1518,1566,1615,1664,1714,1765,1817,1869,1922,1976,2031,2086,2142,2199,2257,2315,2374,2434,2495,2556,2618,2681,2745,2809,2874,2940,3007,3074,3142,3211,3281,3351,3422,3494,3567,3640,3714,3789,3865,3941,4018,4096,4175,4254
-
-//MaxHP - Wizard/High Wizard/Baby Wizard
-1,99,9:4010:4032,0,40,46,53,60,68,76,85,94,104,115,126,138,150,163,176,190,204,219,234,250,267,284,302,320,339,358,378,398,419,441,463,486,509,533,557,582,607,633,659,686,714,742,771,800,830,860,891,922,954,987,1020,1054,1088,1123,1158,1194,1230,1267,1304,1342,1381,1420,1460,1500,1541,1582,1624,1666,1709,1753,1797,1842,1887,1933,1979,2026,2073,2121,2169,2218,2268,2318,2369,2420,2472,2524,2577,2630,2684,2739,2794,2850,2906,2963,3020,3078,3136,3195,3254
-
-//MaxHP - Blacksmith/Alchemist/Whitesmith/Creator/Baby Blacksmith/Baby Alchemist
-1,99,10:18:4011:4019:4033:4041,0,40,47,55,64,74,84,95,107,120,134,149,165,182,200,219,238,258,279,301,324,348,373,399,426,454,482,511,541,572,604,637,671,706,742,779,816,854,893,933,974,1016,1059,1103,1148,1194,1240,1287,1335,1384,1434,1485,1537,1590,1644,1699,1754,1810,1867,1925,1984,2044,2105,2167,2230,2294,2358,2423,2489,2556,2624,2693,2763,2834,2906,2979,3052,3126,3201,3277,3354,3432,3511,3591,3672,3754,3836,3919,4003,4088,4174,4261,4349,4438,4528,4619,4710,4802,4895,4989
-
-//MaxHP - Hunter/Rogue/Sniper/Stalker/Baby Hunter/Baby Rogue
-1,99,11:17:4012:4018:4034:4040,0,40,47,55,63,72,82,93,105,118,132,146,161,177,194,212,231,250,270,291,313,336,360,385,410,436,463,491,520,550,581,612,644,677,711,746,782,818,855,893,932,972,1013,1055,1097,1140,1184,1229,1275,1322,1370,1418,1467,1517,1568,1620,1673,1726,1780,1835,1891,1948,2006,2065,2124,2184,2245,2307,2370,2434,2499,2564,2630,2697,2765,2834,2904,2974,3045,3117,3190,3264,3339,3415,3491,3568,3646,3725,3805,3886,3968,4050,4133,4217,4302,4388,4475,4562,4650,4739
-
-//MaxHP - Assassin/Assassin Cross/Baby Assassin
-1,99,12:4013:4035,0,40,47,55,64,75,87,100,114,129,145,162,180,199,219,241,264,288,313,339,366,394,423,453,484,517,551,586,622,659,697,736,776,817,859,903,948,994,1041,1089,1138,1188,1239,1291,1344,1399,1455,1512,1570,1629,1689,1750,1812,1875,1939,2005,2072,2140,2209,2279,2350,2422,2495,2569,2644,2721,2799,2878,2958,3039,3121,3204,3288,3373,3459,3547,3636,3726,3817,3909,4002,4096,4191,4287,4384,4483,4583,4684,4786,4889,4993,5098,5204,5311,5419,5529,5640,5752,5865,5979
-
-//MaxHP - Crusader/Crusader (Peco)/Paladin/Paladin (Peco)/Baby Crusader/Baby Crusader (Peco)
-1,99,14:21:4015:4022:4037:4044,0,40,47,56,62,81,94,108,128,147,165,184,204,225,247,271,296,322,349,377,406,436,467,499,532,567,603,640,678,717,757,798,840,883,927,973,1020,1068,1117,1167,1218,1270,1323,1377,1432,1489,1547,1606,1666,1727,1789,1852,1916,1981,2047,2115,2184,2254,2325,2397,2470,2544,2619,2695,2772,2851,2931,3012,3094,3177,3261,3346,3432,3519,3607,3697,3788,3880,3973,4067,4162,4258,4355,4453,4552,4653,4755,4858,4962,5067,5173,5280,5388,5497,5607,5719,5832,5946,6061,6177
-
-//MaxHP - Monk/Champion/Baby Monk
-1,99,15:4016:4038,0,40,47,55,64,74,84,95,107,120,134,149,165,182,200,219,238,258,306,329,354,379,406,433,462,491,521,551,583,615,649,683,719,755,793,831,870,909,950,991,1034,1077,1122,1167,1214,1261,1309,1357,1407,1457,1509,1561,1615,1669,1725,1781,1838,1895,1954,2013,2074,2135,2198,2261,2326,2391,2457,2523,2591,2659,2729,2799,2871,2943,3017,3091,3166,3241,3318,3395,3474,3553,3634,3715,3798,3881,3965,4049,4135,4221,4309,4397,4487,4577,4669,4761,4854,4947,5042,5137
-
-//MaxHP - Bard/Dancer/Clown/Gypsy/Baby Bard/Baby Dancer
-1,99,19:20:4020:4021:4042:4043,0,40,47,54,62,71,81,91,102,114,127,140,154,169,180,196,212,224,242,260,278,296,316,330,350,371,393,415,438,451,477,503,530,558,587,616,646,677,709,741,774,808,843,878,914,951,989,1027,1066,1106,1147,1188,1230,1273,1317,1361,1406,1452,1499,1546,1594,1643,1693,1743,1794,1846,1899,1952,2006,2061,2117,2173,2230,2288,2347,2406,2466,2527,2589,2651,2714,2778,2843,2908,2974,3041,3109,3177,3246,3316,3387,3458,3530,3603,3677,3751,3826,3902,3979,4056
-
-//MaxHP - Gunslinger/Rebellion
-1,99,24:4215,0,40,47,54,61,69,77,85,94,103,202,212,222,232,243,254,265,277,289,301,316,331,346,364,382,400,420,440,460,490,520,550,580,610,650,680,710,740,770,800,830,865,890,925,955,990,1025,1050,1080,1110,1145,1180,1215,1275,1335,1395,1455,1515,1575,1635,1695,1760,1820,1885,1950,2015,2080,2145,2210,2275,2340,2410,2480,2550,2620,2690,2760,2830,2900,2970,3040,3115,3190,3265,3340,3415,3490,3565,3640,3715,3790,3870,3950,4030,4110,4190,4270,4350,4430,4510
-
-//MaxHP - Ninja/Oboro/Kagerou
-1,99,25:4211:4212,0,40,47,54,61,69,77,85,94,103,202,212,222,232,243,254,265,277,289,301,316,331,346,364,382,400,420,440,460,482,504,526,548,572,596,620,646,672,698,726,754,784,814,844,876,908,940,975,1010,1100,1140,1180,1220,1260,1300,1340,1385,1430,1475,1520,1565,1615,1665,1715,1765,1815,1880,1935,1990,2045,2100,2160,2220,2280,2340,2400,2460,2520,2580,2640,2705,2770,2835,2900,2965,3030,3100,3170,3240,3310,3380,3455,3530,3605,3680,3760,3840,3920,4000,4080
-
-//MaxHP - Taekwon
-1,99,4046,0,40,46,53,61,70,79,89,100,111,123,136,149,163,178,194,210,227,245,263,282,302,322,343,365,388,411,435,460,485,511,538,565,593,622,652,682,713,745,777,810,844,878,913,949,986,1023,1061,1100,1139,1179,1220,1261,1303,1346,1390,1434,1479,1525,1571,1618,1666,1714,1763,1813,1864,1915,1967,2020,2073,2127,2137,2147,2157,2167,2177,2187,2197,2200,2210,2230,2250,2300,2350,2400,2450,2500,2550,2600,2650,2700,2750,2800,2850,2900,2950,3000,3050,3100,3200
-
-//MaxHP - Star Knight/Star Knight (flying)
-1,99,4047:4048,0,40,47,55,64,74,84,95,107,120,134,149,165,182,200,219,238,258,306,329,354,379,406,433,462,491,521,551,583,615,649,683,719,755,793,831,870,909,950,991,1034,1077,1122,1167,1214,1261,1309,1357,1407,1457,1509,1561,1615,1669,1725,1781,1838,1895,1954,2013,2074,2135,2198,2261,2326,2391,2457,2523,2591,2659,2670,2680,2690,2700,2710,2720,2730,2740,2750,2760,3000,3020,3040,3060,3080,3100,3120,3140,3160,3180,3455,3524,3593,3663,3734,3806,3878,3951,4025,4500
-
-//MaxHP - Soul Linker
-1,99,4049,0,40,47,54,62,71,81,91,102,114,127,140,154,169,185,201,218,236,255,274,294,315,337,359,382,406,431,456,482,509,537,565,594,624,655,686,718,751,785,819,854,890,927,964,1002,1041,1081,1121,1162,1204,1247,1290,1334,1379,1425,1471,1518,1566,1615,1664,1714,1765,1817,1869,1922,1976,2031,2086,2142,2199,2257,2275,2294,2314,2335,2356,2378,2401,2425,2449,2874,2890,2907,2924,2942,2971,2991,3011,3032,3054,3567,3590,3614,3649,3675,3701,3728,3756,3800,4250
-
-//MaxHP - Munak/Bongun
-1,99,4050,0,40,46,52,59,66,73,81,89,98,107,116,126,136,147,158,169,181,193,206,219,232,246,260,275,290,305,321,337,354,371,388,406,424,443,462,481,501,521,542,563,584,606,628,651,674,697,721,745,770,795,820,846,872,899,926,953,981,1009,1038,1067,1096,1126,1156,1187,1218,1249,1281,1313,1346,1379,1412,1446,1480,1515,1550,1585,1621,1657,1694,1731,1768,1806,1844,1883,1922,1961,2001,2041,2082,2123,2164,2206,2248,2291,2334,2377,2421,2465,2510
-
-//MaxHP - Death Knight
-1,99,4051,0,40,48,58,69,82,96,112,129,148,168,190,213,238,264,292,321,352,384,418,453,490,528,568,609,652,696,742,789,838,888,940,993,1048,1104,1162,1221,1282,1344,1408,1473,1540,1608,1678,1749,1822,1896,1972,2049,2128,2208,2290,2373,2458,2544,2632,2721,2812,2904,2998,3093,3190,3288,3388,3489,3592,3696,3802,3909,4018,4128,4240,4353,4468,4584,4702,4821,4942,5064,5188,5313,5440,5568,5698,5829,5962,6096,6232,6369,6508,6648,6790,6933,7078,7224,7372,7521,7672,7824,7978
-
-//MaxHP - Dark Collector
-1,99,4052,0,40,47,54,62,71,81,91,102,114,127,140,154,169,185,201,218,236,255,274,294,315,337,359,382,406,431,456,482,509,537,565,594,624,655,686,718,751,785,819,854,890,927,964,1002,1041,1081,1121,1162,1204,1247,1290,1334,1379,1425,1471,1518,1566,1615,1664,1714,1765,1817,1869,1922,1976,2031,2086,2142,2199,2257,2315,2374,2434,2495,2556,2618,2681,2745,2809,2874,2940,3007,3074,3142,3211,3281,3351,3422,3494,3567,3640,3714,3789,3865,3941,4018,4096,4175,4254
-
-//MaxHP - Rune Knight/Rune Knight_T/Rune Knight (Dragon)/Rune Knight (Dragon)_T
-99,150,4054:4060:4080:4081:4096:4109,0,8100,8133,8242,8352,8464,8576,8690,8804,8920,9036,9154,9273,9393,9514,9636,9759,9883,10008,10134,10261,10389,10518,10648,10779,10912,11045,11180,11315,11452,11589,11728,11868,12009,12151,12294,12438,12583,12729,12876,13024,13173,13323,13474,13626,13780,13934,14090,14246,14404,14562,14722,14883
-
-//MaxHP - Warlock/Warlock_T
-99,150,4055:4061:4097,0,3200,3313,3383,3455,3528,3601,3675,3749,3824,3899,3975,4051,4129,4208,4287,4367,4447,4528,4609,4691,4773,4857,4941,5026,5112,5198,5285,5372,5460,5548,5638,5728,5819,5911,6003,6096,6189,6283,6377,6473,6569,6666,6763,6861,6960,7059,7159,7259,7361,7463,7566,7669
-
-//MaxHP - Ranger/Ranger_T/Minstrel/Wanderer/Minstrel_T/Wanderer_T/Ranger (Warg)/Ranger (Warg)_T
-99,150,4056:4062:4068:4069:4075:4076:4084:4085:4098:4104:4105:4111,0,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
-
-//MaxHP - Arch Bishop/Arch Bishop_T
-99,150,4057:4063:4099,0,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
-
-//MaxHP - Mechanic/Mechanic_T/Sura/Sura_T/Mechanic (Mado Gear)/Mechanic (Mado Gear)_T
-99,150,4058:4064:4086:4087:4100:4112,0,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
-
-//MaxHP - Guillotine Cross/Guillotine Cross_T/Royal Guard/Shadow Chaser/Royal Guard_T/Shadow Chaser_T/Royal Guard (Gryphon)/Royal Guard (Gryphon)_T
-99,150,4059:4065:4066:4072:4073:4079:4082:4083:4101:4102:4108:4110,0,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
-
-//MaxHP - Sorcerer/Sorcerer_T
-99,150,4067:4074:4103,0,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
-
-//MaxHP - Sura/Sura_T
-99,150,4070:4077:4106,0,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
-
-//MaxHP - Genetic/Genetic_T
-99,150,4071:4078:4107,0,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
-
-//MaxSP - Novice/Super Novice/Novice High/Baby Novice/Baby Super Novice/Baby Super Novice/Super Novice (Expanded)
-1,99,0:23:4001:4023:4045:4190:4191,1,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109
-
-//MaxSP - Swordman/Archer/Thief/Swordman High/Archer High/Thief High/Baby Swordman/Baby Archer/Baby Thief
-1,99,1:3:6:4002:4004:4007:4024:4026:4029,1,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,172,174,176,178,180,182,184,186,188,190,192,194,196,198,200,202,204,206,208
-
-//MaxSP - Magician/Bard/Dancer/Magician High/Clown/Gypsy/Baby Magician/Baby Bard/Baby Dancer
-1,99,2:19:20:4003:4020:4021:4025:4042:4043,1,16,22,28,34,40,46,52,58,64,70,76,82,88,94,100,106,112,118,124,130,136,142,148,154,160,166,172,178,184,190,196,202,208,214,220,226,232,238,244,250,256,262,268,274,280,286,292,298,304,310,316,322,328,334,340,346,352,358,364,370,376,382,388,394,400,406,412,418,424,430,436,442,448,454,460,466,472,478,484,490,496,502,508,514,520,526,532,538,544,550,556,562,568,574,580,586,592,598,604
-
-//MaxSP - Acolyte/Rogue/Acolyte High/Stalker/Baby Acolyte/Baby Rogue
-1,99,4:17:4005:4018:4027:4040,1,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110,115,120,125,130,135,140,145,150,155,160,165,170,175,180,185,190,195,200,205,210,215,220,225,230,235,240,245,250,255,260,265,270,275,280,285,290,295,300,305,310,315,320,325,330,335,340,345,350,355,360,365,370,375,380,385,390,395,400,405,410,415,420,425,430,435,440,445,450,455,460,465,470,475,480,485,490,495,500,505
-
-//MaxSP - Merchant/Knight/Knight (Peco)/Merchant High/Lord Knight/Lord Knight (Peco)/Baby Merchant/Baby Knight/Baby Knight (Peco)
-1,99,5:7:13:4006:4008:4014:4028:4030:4036,1,13,16,19,22,25,28,31,34,37,40,43,46,49,52,55,58,61,64,67,70,73,76,79,82,85,88,91,94,97,100,103,106,109,112,115,118,121,124,127,130,133,136,139,142,145,148,151,154,157,160,163,166,169,172,175,178,181,184,187,190,193,196,199,202,205,208,211,214,217,220,223,226,229,232,235,238,241,244,247,250,253,256,259,262,265,268,271,274,277,280,283,286,289,292,295,298,301,304,307
-
-//MaxSP - Priest/High Priest/Baby Priest
-1,99,8:4009:4031,1,18,26,34,42,50,58,66,74,82,90,98,106,114,122,130,138,146,154,162,170,178,186,194,202,210,218,226,234,242,250,258,266,274,282,290,298,306,314,322,330,338,346,354,362,370,378,386,394,402,410,418,426,434,442,450,458,466,474,482,490,498,506,514,522,530,538,546,554,562,570,578,586,594,602,610,618,626,634,642,650,658,666,674,682,690,698,706,714,722,730,738,746,754,762,770,778,786,794,802
-
-//MaxSP - Wizard/High Wizard/Baby Wizard
-1,99,9:4010:4032,1,19,28,37,46,55,64,73,82,91,100,109,118,127,136,145,154,163,172,181,190,199,208,217,226,235,244,253,262,271,280,289,298,307,316,325,334,343,352,361,370,379,388,397,406,415,424,433,442,451,460,469,478,487,496,505,514,523,532,541,550,559,568,577,586,595,604,613,622,631,640,649,658,667,676,685,694,703,712,721,730,739,748,757,766,775,784,793,802,811,820,829,838,847,856,865,874,883,892,901
-
-//MaxSP - Blacksmith/Hunter/Assassin/Alchemist/Whitesmith/Sniper/Assassin Cross/Creator/Baby Blacksmith/Baby Hunter/Baby Assassin/Baby Alchemist
-1,99,10:11:12:18:4011:4012:4013:4019:4033:4034:4035:4041,1,14,18,22,26,30,34,38,42,46,50,54,58,62,66,70,74,78,82,86,90,94,98,102,106,110,114,118,122,126,130,134,138,142,146,150,154,158,162,166,170,174,178,182,186,190,194,198,202,206,210,214,218,222,226,230,234,238,242,246,250,254,258,262,266,270,274,278,282,286,290,294,298,302,306,310,314,318,322,326,330,334,338,342,346,350,354,358,362,366,370,374,378,382,386,390,394,398,402,406
-
-//MaxSP - Crusader/Monk/Crusader (Peco)/Paladin/Champion/Paladin (Peco)/Baby Crusader/Baby Monk/Baby Crusader (Peco)
-1,99,14:15:21:4015:4016:4022:4037:4038:4044,1,14,19,24,28,33,38,42,47,52,57,61,66,71,75,80,85,89,94,99,104,108,113,118,122,127,132,136,141,146,151,155,160,165,169,174,179,183,188,193,198,202,207,212,216,221,226,230,235,240,245,249,254,259,263,268,273,277,282,287,292,296,301,306,310,315,320,324,329,334,339,343,348,353,357,362,367,371,376,381,386,390,395,400,404,409,414,418,423,428,433,437,442,447,451,456,461,465,470,475
-
-//MaxSP - Sage/Professor/Baby Sage
-1,99,16:4017:4039,1,17,24,31,38,45,52,59,66,73,80,87,94,101,108,115,122,129,136,143,150,157,164,171,178,185,192,199,206,213,220,227,234,241,248,255,262,269,276,283,290,297,304,311,318,325,332,339,346,353,360,367,374,381,388,395,402,409,416,423,430,437,444,451,458,465,472,479,486,493,500,507,514,521,528,535,542,549,556,563,570,577,584,591,598,605,612,619,626,633,640,647,654,661,668,675,682,689,696,703
-
-//MaxSP - Gunslinger/Rebellion
-1,99,24:4215,1,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,61,64,67,70,73,76,79,82,85,89,93,97,101,105,109,113,117,121,125,129,131,135,139,141,145,149,153,157,161,165,169,173,177,181,186,191,196,201,206,211,216,221,226,231,236,241,246,251,256,261,266,271,276,281,286,291,296,301,306,312,318,324,336,342,348,354,360,366,372,378,384,390,396,402,408,414,420,426,432,438,444,450,456
-
-//MaxSP - Ninja/Oboro/Kagerou
-1,99,25:4211:4212,1,14,17,20,23,26,29,32,35,38,41,44,47,50,53,56,59,62,65,68,71,75,79,83,87,91,95,99,103,107,111,115,119,123,127,131,135,139,143,147,151,156,161,166,171,176,181,186,191,196,201,206,211,216,221,226,231,236,241,246,251,257,263,269,275,281,287,293,299,305,311,317,323,329,335,341,347,353,359,365,371,378,386,394,402,410,418,426,434,442,450,458,466,474,482,490,498,506,514,522
-
-//MaxSP - Taekwon
-1,99,4046,1,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,151,152,153,154,155,156,157,158,159,170,171,172,173,174,175,176,177,178,188,190,190,190,190,190,190,190,190,190,200
-
-//MaxSP - Star Knight/Star Knight (flying)
-1,99,4047:4048,1,14,19,24,28,33,38,42,47,52,57,61,66,71,75,80,85,89,94,99,104,108,113,118,122,127,132,136,141,146,151,155,160,165,169,174,179,183,188,193,198,202,207,212,216,221,226,230,235,240,245,249,254,259,263,268,273,277,282,287,292,296,301,306,310,315,320,324,329,334,339,341,343,345,347,349,351,353,355,357,386,388,390,392,394,396,398,400,402,404,430,433,436,439,442,445,448,451,454,500
-
-//MaxSP - Soul Linker
-1,99,4049,1,19,28,37,46,55,64,73,82,91,100,109,118,127,136,145,154,163,172,181,190,199,208,217,226,235,244,253,262,271,280,289,298,307,316,325,334,343,352,361,370,379,388,397,406,415,424,433,442,451,460,469,478,487,496,505,514,523,532,541,550,559,568,577,586,595,604,613,622,631,635,640,645,650,655,660,665,670,675,680,730,735,740,745,750,755,760,765,770,775,820,825,830,845,850,855,860,865,870,900
-
-//MaxSP - Munak/Bongun
-1,99,4050,1,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110,115,120,125,130,135,140,145,150,155,160,165,170,175,180,185,190,195,200,205,210,215,220,225,230,235,240,245,250,255,260,265,270,275,280,285,290,295,300,305,310,315,320,325,330,335,340,345,350,355,360,365,370,375,380,385,390,395,400,405,410,415,420,425,430,435,440,445,450,455,460,465,470,475,480,485,490,495,500,505
-
-//MaxSP - Death Knight
-1,99,4051,1,13,16,19,22,25,28,31,34,37,40,43,46,49,52,55,58,61,64,67,70,73,76,79,82,85,88,91,94,97,100,103,106,109,112,115,118,121,124,127,130,133,136,139,142,145,148,151,154,157,160,163,166,169,172,175,178,181,184,187,190,193,196,199,202,205,208,211,214,217,220,223,226,229,232,235,238,241,244,247,250,253,256,259,262,265,268,271,274,277,280,283,286,289,292,295,298,301,304,307
-
-//MaxSP - Dark Collector
-1,99,4052,1,17,24,31,38,45,52,59,66,73,80,87,94,101,108,115,122,129,136,143,150,157,164,171,178,185,192,199,206,213,220,227,234,241,248,255,262,269,276,283,290,297,304,311,318,325,332,339,346,353,360,367,374,381,388,395,402,409,416,423,430,437,444,451,458,465,472,479,486,493,500,507,514,521,528,535,542,549,556,563,570,577,584,591,598,605,612,619,626,633,640,647,654,661,668,675,682,689,696,703
-
-//MaxSP - Rune Knight/Rune Knight_T/Rune Knight (Dragon)/Rune Knight (Dragon)_T
-99,150,4054:4060:4080:4081:4096:4109,1,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
-
-//MaxSP - Warlock/Sorcerer/Genetic/Warlock_T/Sorcerer_T/Genetic_T
-99,150,4055:4061:4067:4071:4074:4078:4097:4103:4107,1,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
-
-//MaxSP - Arch Bishop/Arch Bishop_T
-99,150,4057:4063:4099,1,800,810,818,826,834,842,850,858,866,874,882,890,898,906,914,922,930,938,946,954,962,970,978,986,994,1002,1010,1018,1026,1034,1042,1050,1058,1066,1074,1082,1090,1098,1106,1114,1122,1130,1138,1146,1154,1162,1170,1178,1186,1194,1202,1210
-
-//MaxSP - Ranger/Mechanic/Guillotine Cross/Ranger_T/Mechanic_T/Guillotine Cross_T/Royal Guard/Minstrel/Wanderer/Sura/Shadow Chaser/Royal Guard_T/Minstrel_T/Wanderer_T/Sura_T/Shadow Chaser_T/Royal Guard (Gryphon)/Royal Guard (Gryphon)_T/Ranger (Warg)/Ranger (Warg)_T/Mechanic (Mado Gear)/Mechanic (Mado Gear)_T
-1,150,4056:4058:4059:4062:4064:4065:4066:4068:4069:4070:4072:4073:4075:4076:4077:4079:4082:4083:4084:4085:4086:4087:4098:4100:4101:4102:4104:4105:4106:4108:4110:4111:4112,1,14,18,22,26,30,34,38,42,46,50,54,58,62,66,70,74,78,82,86,90,94,98,102,106,110,114,118,122,126,130,134,138,142,146,150,154,158,162,166,170,174,178,182,186,190,194,198,202,206,210,214,218,222,226,230,234,238,242,246,250,254,258,262,266,270,274,278,282,286,290,294,298,302,306,310,314,318,322,326,330,334,338,342,346,350,354,358,362,366,370,374,378,382,386,390,394,398,402,406,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

+ 18 - 0
db/pre-re/job_param_db.txt

@@ -0,0 +1,18 @@
+// Maximum parameters for specific job!
+// ====================================================
+// Structure of Database:
+//	JobID,MaxParam
+//		or
+//	JobID,MaxStr,MaxAgi,MaxVit,MaxInt,MaxDex,MaxLuk
+// ====================================================
+// JobID: Using Job constanta on 'db/const.txt'
+// MaxParams: Value between 10 ~ 32767 (SHRT_MAX)
+// ====================================================
+// Examples:
+//Job_Novice,60
+//	Normally, Novice's max. param is using 'max_parameter' on conf/battle/player.conf.
+//	By with this config, Novice's max. param will be 60, for all params.
+//Job_Swordman,90
+//	Normally, Swordman's max. param is using 'max_parameter' on conf/battle/player.conf.
+//	By with this config, Swordman's max. param will be 90, for all params.
+// ====================================================

+ 6 - 6
db/re/item_db.txt

@@ -5898,12 +5898,12 @@
 12419,Mana_Plus,Mana Plus,2,100,,50,,,,,0xFFFFFFFF,63,2,,,,,,{},{},{}
 12420,Stamina_Up_M,Stamina Up M,2,100,,50,,,,,0xFFFFFFFF,63,2,,,,,,{},{},{}
 12421,Falmons_F,Falmons F,3,10,,10,,,,,,,,,,,,,{},{},{}
-12422,HP_Increase_Potion_(Small),HP Increase Potion (Small),0,10,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ sc_start SC_INCMHPRATE,500000,1; sc_start SC_INCMHP,500000,(500+(10/3)*BaseLevel); percentheal 2,0; },{},{}
-12423,HP_Increase_Potion_(Medium),HP Increase Potion (Medium),0,10,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ sc_start SC_INCMHPRATE,500000,2; sc_start SC_INCMHP,500000,(1500+(10/3)*BaseLevel); percentheal 3,0; },{},{}
-12424,HP_Increase_Potion_(Large),HP Increase Potion (Large),0,10,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ sc_start SC_INCMHPRATE,500000,5; sc_start SC_INCMHP,500000,(2500+(10/3)*BaseLevel); percentheal 5,0; },{},{}
-12425,SP_Increase_Potion_(Small),SP Increase Potion (Small),0,10,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ sc_start SC_INCMSPRATE,500000,2; percentheal 0,2; },{},{}
-12426,SP_Increase_Potion_(Medium),SP Increase Potion (Medium),0,10,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ sc_start SC_INCMSPRATE,500000,4; percentheal 0,4; },{},{}
-12427,SP_Increase_Potion_(Large),SP Increase Potion (Large),0,10,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ sc_start SC_INCMSPRATE,500000,8; percentheal 0,8; },{},{}
+12422,HP_Increase_Potion_(Small),HP Increase Potion (Small),0,10,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ sc_start SC_INCMHP,500000,(500+(10/3)*BaseLevel); percentheal 1,0; },{},{}
+12423,HP_Increase_Potion_(Medium),HP Increase Potion (Medium),0,10,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ sc_start SC_INCMHP,500000,(1500+(10/3)*BaseLevel); percentheal 2,0; },{},{}
+12424,HP_Increase_Potion_(Large),HP Increase Potion (Large),0,10,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ sc_start SC_INCMHP,500000,(2500+(10/3)*BaseLevel); percentheal 5,0; },{},{}
+12425,SP_Increase_Potion_(Small),SP Increase Potion (Small),0,10,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ sc_start SC_INCMSPRATE,500000,((BaseLevel/10)-5); percentheal 0,2; },{},{}
+12426,SP_Increase_Potion_(Medium),SP Increase Potion (Medium),0,10,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ sc_start SC_INCMSPRATE,500000,(BaseLevel/10); percentheal 0,4; },{},{}
+12427,SP_Increase_Potion_(Large),SP Increase Potion (Large),0,10,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ sc_start SC_INCMSPRATE,500000,((BaseLevel/10)+5); percentheal 0,8; },{},{}
 12428,Concentrated_White_Potion_Z,Concentrated White Potion Z,0,10,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ sc_start SC_EXTRACT_WHITE_POTION_Z,500000,0; heal 1000,0; },{},{}
 12429,Savage_Full_Roast,Savage Full Roast,2,,,50,,,,,0xFFFFFFFF,63,2,,,,,,{ sc_start SC_SAVAGE_STEAK,300000,20; },{},{}
 12430,Cocktail_Warg_Blood,Cocktail Warg Blood,2,,,50,,,,,0xFFFFFFFF,63,2,,,,,,{ sc_start SC_COCKTAIL_WARG_BLOOD,300000,20; },{},{}

File diff suppressed because it is too large
+ 13 - 0
db/re/job_basehpsp_db.txt


+ 16 - 16
db/re/job_db1.txt

@@ -32,9 +32,9 @@
 // Knight (Peco)
 13,	28000,150  ,500  ,300  ,440  ,530  ,490  ,560  ,590  ,690  ,540  ,590  ,490  ,490  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490
 // Crusader
-14,	28000,110  ,700  ,470  ,440  ,520  ,470  ,590  ,570  ,560  ,540  ,590  ,490  ,490  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490
+14,	28000,110  ,700  ,400  ,440  ,520  ,470  ,590  ,570  ,560  ,540  ,590  ,490  ,490  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490
 // Monk
-15,	26000,90   ,650  ,470  ,440  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,470  ,470  ,640  ,2000 ,440  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,620  ,490
+15,	26000,90   ,650  ,400  ,440  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,470  ,470  ,640  ,2000 ,440  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,620  ,490
 // Sage
 16,	24000,75   ,500  ,700  ,490  ,570  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,590  ,2000 ,2000 ,2000 ,2000 ,470  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,590  ,590
 // Rogue
@@ -46,7 +46,7 @@
 // Dancer
 20,	27000,75   ,300  ,600  ,400  ,530  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,480  ,2000 ,2000 ,450  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,470
 // Crusader (Peco)
-21,	28000,110  ,700  ,470  ,440  ,520  ,470  ,590  ,570  ,560  ,540  ,590  ,490  ,490  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490
+21,	28000,110  ,700  ,400  ,440  ,520  ,470  ,590  ,570  ,560  ,540  ,590  ,490  ,490  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490
 // Wedding
 22,	20000,0    ,500  ,100  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000
 // Super Novice
@@ -84,9 +84,9 @@
 // Lord Knight (Peco)
 4014,	28000,150  ,500  ,300  ,440  ,530  ,490  ,560  ,590  ,690  ,540  ,590  ,490  ,490  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490
 // Paladin
-4015,	28000,110  ,700  ,470  ,440  ,520  ,470  ,590  ,570  ,560  ,540  ,590  ,490  ,490  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490
+4015,	28000,110  ,700  ,400  ,440  ,520  ,470  ,590  ,570  ,560  ,540  ,590  ,490  ,490  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490
 // Champion
-4016,	26000,90   ,650  ,470  ,440  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,470  ,470  ,640  ,2000 ,440  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,620  ,490
+4016,	26000,90   ,650  ,400  ,440  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,470  ,470  ,640  ,2000 ,440  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,620  ,490
 // Professor
 4017,	24000,75   ,500  ,700  ,490  ,570  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,590  ,2000 ,2000 ,2000 ,2000 ,470  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,590  ,590
 // Stalker
@@ -98,7 +98,7 @@
 // Gypsy
 4021,	27000,75   ,300  ,600  ,440  ,570  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,520  ,2000 ,2000 ,490  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,510
 // Paladin (Peco)
-4022,	28000,110  ,700  ,470  ,440  ,520  ,470  ,590  ,570  ,560  ,540  ,590  ,490  ,490  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490
+4022,	28000,110  ,700  ,400  ,440  ,520  ,470  ,590  ,570  ,560  ,540  ,590  ,490  ,490  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490
 // Baby Novice
 4023,	20000,0    ,500  ,100  ,440  ,590  ,610  ,2000 ,2000 ,2000 ,540  ,2000 ,540  ,540  ,690  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,690  ,540
 // Baby Swordman
@@ -142,7 +142,7 @@
 // Baby Dancer
 4043,	27000,75   ,300  ,600  ,400  ,530  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,480  ,2000 ,2000 ,450  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,470
 // Baby Crusader (Peco)
-4044,	28000,110  ,700  ,470  ,440  ,520  ,470  ,590  ,570  ,560  ,540  ,590  ,490  ,490  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490
+4044,	28000,110  ,700  ,400  ,440  ,520  ,470  ,590  ,570  ,560  ,540  ,590  ,490  ,490  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490
 // Baby Super Novice
 4045,	20000,0    ,500  ,100  ,440  ,590  ,610  ,2000 ,2000 ,2000 ,540  ,2000 ,540  ,540  ,690  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,690  ,540
 // Taekwon
@@ -184,7 +184,7 @@
 // Guillotine Cross (Trans)
 4065,	32000,110  ,500  ,400  ,440  ,460  ,690  ,2000 ,2000 ,2000 ,840  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,460  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,530
 // Royal Guard (Regular)
-4066,	35000,110  ,700  ,470  ,440  ,510  ,490  ,530  ,540  ,540  ,520  ,560  ,480  ,480  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490
+4066,	35000,110  ,700  ,400  ,440  ,510  ,490  ,530  ,540  ,540  ,520  ,560  ,480  ,480  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490
 // Sorcerer (Regular)
 4067,	30000,75   ,500  ,700  ,440  ,540  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490  ,2000 ,2000 ,2000 ,2000 ,490  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490  ,490
 // Minstrel (Regular)
@@ -192,13 +192,13 @@
 // Wanderer (Regular)
 4069,	32000,75   ,300  ,600  ,440  ,560  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,540  ,2000 ,2000 ,490  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,510
 // Sura (Regular)
-4070,	30000,90   ,650  ,470  ,420  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,470  ,470  ,520  ,2000 ,430  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,540  ,470
+4070,	30000,90   ,650  ,400  ,420  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,470  ,470  ,520  ,2000 ,430  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,540  ,470
 // Genetic (Regular)
 4071,	32000,90   ,500  ,400  ,440  ,540  ,480  ,2000 ,2000 ,2000 ,550  ,550  ,490  ,490  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,480
 // Shadow Chaser (Regular)
 4072,	28000,85   ,500  ,500  ,440  ,470  ,510  ,2000 ,2000 ,2000 ,2030 ,2000 ,2000 ,2000 ,2000 ,510  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490
 // Royal Guard (Trans)
-4073,	35000,110  ,700  ,470  ,440  ,510  ,490  ,530  ,540  ,540  ,520  ,560  ,480  ,480  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490
+4073,	35000,110  ,700  ,400  ,440  ,510  ,490  ,530  ,540  ,540  ,520  ,560  ,480  ,480  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490
 // Sorcerer (Trans)
 4074,	30000,75   ,500  ,700  ,440  ,540  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490  ,2000 ,2000 ,2000 ,2000 ,490  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490  ,490
 // Minstrel (Trans)
@@ -206,7 +206,7 @@
 // Wanderer (Trans)
 4076,	32000,75   ,300  ,600  ,440  ,560  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,540  ,2000 ,2000 ,490  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,510
 // Sura (Trans)
-4077,	30000,90   ,650  ,470  ,420  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,470  ,470  ,520  ,2000 ,430  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,540  ,470
+4077,	30000,90   ,650  ,400  ,420  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,470  ,470  ,520  ,2000 ,430  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,540  ,470
 // Genetic (Trans)
 4078,	32000,90   ,500  ,400  ,440  ,540  ,480  ,2000 ,2000 ,2000 ,550  ,550  ,490  ,490  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,480
 // Shadow Chaser (Trans)
@@ -216,9 +216,9 @@
 // Rune Knight (Dragon) (Trans)
 4081,	35000,150  ,500  ,300  ,440  ,540  ,560  ,590  ,620  ,560  ,620  ,640  ,490  ,490  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490
 // Royal Guard (Gryphon) (Regular)
-4082,	35000,110  ,700  ,470  ,440  ,510  ,490  ,530  ,540  ,540  ,520  ,560  ,480  ,480  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490
+4082,	35000,110  ,700  ,400  ,440  ,510  ,490  ,530  ,540  ,540  ,520  ,560  ,480  ,480  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490
 // Royal Guard (Gryphon) (Trans)
-4083,	35000,110  ,700  ,470  ,440  ,510  ,490  ,530  ,540  ,540  ,520  ,560  ,480  ,480  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490
+4083,	35000,110  ,700  ,400  ,440  ,510  ,490  ,530  ,540  ,540  ,520  ,560  ,480  ,480  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490
 // Ranger (Warg) (Regular)
 4084,	32000,85   ,500  ,400  ,440  ,540  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,530  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,520
 // Ranger (Warg) (Trans)
@@ -240,7 +240,7 @@
 // Baby Guillotine Cross
 4101,	24000,110  ,500  ,400  ,440  ,460  ,690  ,2000 ,2000 ,2000 ,840  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,460  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,530
 // Baby Royal Guard
-4102,	28000,110  ,700  ,470  ,440  ,510  ,490  ,530  ,540  ,540  ,520  ,560  ,480  ,480  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490
+4102,	28000,110  ,700  ,400  ,440  ,510  ,490  ,530  ,540  ,540  ,520  ,560  ,480  ,480  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490
 // Baby Sorcerer
 4103,	24000,75   ,500  ,700  ,440  ,540  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490  ,2000 ,2000 ,2000 ,2000 ,490  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490  ,490
 // Baby Minstrel
@@ -248,7 +248,7 @@
 // Baby Wanderer
 4105,	27000,75   ,300  ,600  ,440  ,560  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,540  ,2000 ,2000 ,490  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,510
 // Baby Sura
-4106,	26000,90   ,650  ,470  ,420  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,470  ,470  ,520  ,2000 ,430  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,540  ,470
+4106,	26000,90   ,650  ,400  ,420  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,470  ,470  ,520  ,2000 ,430  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,540  ,470
 // Baby Genetic
 4107,	30000,90   ,500  ,400  ,440  ,540  ,480  ,2000 ,2000 ,2000 ,550  ,550  ,490  ,490  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,480
 // Baby Shadow Chaser
@@ -256,7 +256,7 @@
 // Baby Rune Knight (Dragon)
 4109,	28000,150  ,500  ,300  ,440  ,540  ,560  ,590  ,620  ,560  ,620  ,640  ,490  ,490  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490
 // Baby Royal Guard (Gryphon)
-4110,	28000,110  ,700  ,470  ,440  ,510  ,490  ,530  ,540  ,540  ,520  ,560  ,480  ,480  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490
+4110,	28000,110  ,700  ,400  ,440  ,510  ,490  ,530  ,540  ,540  ,520  ,560  ,480  ,480  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,490
 // Baby Ranger (Warg)
 4111,	27000,85   ,500  ,400  ,440  ,540  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,530  ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,2000 ,520
 // Baby Mechanic (Mado)

File diff suppressed because it is too large
+ 0 - 0
db/re/job_exp.txt


+ 0 - 178
db/re/job_maxhpsp_db.txt

@@ -1,178 +0,0 @@
-//MaxHP & MaxSP tables format:
-//Start Level,Max Level,Class list,Type,Max value for Lv 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99
-//Type (0 - MaxHP; 1 - MaxSP)
-
-//===============================
-// Renewal MaxHP & MaxSP Database
-//===============================
-
-//MaxHP - Novice/Super Novice/Novice High/Baby Novice/Baby Super Novice/Super Novice (Expanded)/Super Baby (Expanded)
-1,99,0:23:4001:4023:4045:4190:4191,0,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110,115,120,125,130,135,140,145,150,155,160,165,170,175,180,185,190,195,200,205,210,215,220,225,230,235,240,245,250,255,260,265,270,275,280,285,290,295,300,305,310,315,320,325,330,335,340,345,350,355,360,365,370,375,380,385,390,395,400,405,410,415,420,425,430,435,440,445,450,455,460,465,470,475,480,485,490,495,500,505,510,515,520,525,530
-
-//MaxHP - Swordman/Swordman High/Baby Swordman
-1,99,1:4002:4024,0,40,46,53,61,70,79,89,100,111,123,136,149,163,178,194,210,227,245,263,282,302,322,343,365,388,411,435,460,485,511,538,565,593,622,652,682,713,745,777,810,844,878,913,949,986,1023,1061,1100,1139,1179,1220,1261,1303,1346,1390,1434,1479,1525,1571,1618,1666,1714,1763,1813,1864,1915,1967,2020,2073,2127,2182,2237,2293,2350,2408,2466,2525,2585,2645,2706,2768,2830,2893,2957,3022,3087,3153,3220,3287,3355,3424,3493,3563,3634,3706,3778,3851,3925,3999
-
-//MaxHP - Magician/Magician High/Baby Magician
-1,99,2:4003:4025,0,40,46,52,58,65,72,79,86,94,102,110,119,128,137,147,157,167,177,188,199,210,222,234,246,259,272,285,298,312,326,340,355,370,385,401,417,433,449,466,483,500,518,536,554,573,592,611,630,650,670,690,711,732,753,775,797,819,841,864,887,910,934,958,982,1007,1032,1057,1082,1108,1134,1160,1187,1214,1241,1269,1297,1325,1353,1382,1411,1440,1470,1500,1530,1561,1592,1623,1654,1686,1718,1750,1783,1816,1849,1883,1917,1951,1985,2020
-
-//MaxHP - Archer/Thief/Archer High/Thief High/Baby Archer/Baby Thief
-1,99,3:6:4004:4007:4026:4029,0,40,46,53,60,68,76,85,94,104,114,125,136,148,160,173,186,200,214,229,244,260,276,293,310,328,346,365,384,404,424,445,466,488,510,533,556,580,604,629,654,680,706,733,760,788,816,845,874,904,934,965,996,1028,1060,1093,1126,1160,1194,1229,1264,1300,1336,1373,1410,1448,1486,1525,1564,1604,1644,1685,1726,1768,1810,1853,1896,1940,1984,2029,2074,2120,2166,2213,2260,2308,2356,2405,2454,2504,2554,2605,2656,2708,2760,2813,2866,2920,2974,3029
-
-//MaxHP - Acolyte/Merchant/Acolyte High/Merchant High/Baby Acolyte/Baby Merchant
-1,99,4:5:4005:4006:4027:4028,0,40,46,52,59,66,73,81,89,98,107,116,126,136,147,158,169,181,193,206,219,232,246,260,275,290,305,321,337,354,371,388,406,424,443,462,481,501,521,542,563,584,606,628,651,674,697,721,745,770,795,820,846,872,899,926,953,981,1009,1038,1067,1096,1126,1156,1187,1218,1249,1281,1313,1346,1379,1412,1446,1480,1515,1550,1585,1621,1657,1694,1731,1768,1806,1844,1883,1922,1961,2001,2041,2082,2123,2164,2206,2248,2291,2334,2377,2421,2465,2510
-
-//MaxHP - Knight/Knight (Peco)/Lord Knight/Lord Knight (Peco)/Baby Knight/Baby Knight (Peco)
-1,99,7:13:4008:4014:4030:4036,0,40,48,58,69,82,96,112,129,148,168,190,213,238,264,292,321,352,384,418,453,490,528,568,609,652,696,742,789,838,888,940,993,1048,1104,1162,1221,1282,1344,1408,1473,1540,1608,1678,1749,1822,1896,1972,2049,2128,2208,2290,2373,2458,2544,2632,2721,2812,2904,2998,3093,3190,3288,3388,3489,3592,3696,3802,3909,4018,4128,4240,4353,4468,4584,4702,4821,4942,5064,5188,5313,5440,5568,5698,5829,5962,6096,6232,6369,6508,6648,6790,6933,7078,7224,7372,7521,7672,7824,7978
-
-//MaxHP - Priest/Sage/High Priest/Professor/Baby Priest/Baby Sage
-1,99,8:16:4009:4017:4031:4039,0,40,47,54,62,71,81,91,102,114,127,140,154,169,185,201,218,236,255,274,294,315,337,359,382,406,431,456,482,509,537,565,594,624,655,686,718,751,785,819,854,890,927,964,1002,1041,1081,1121,1162,1204,1247,1290,1334,1379,1425,1471,1518,1566,1615,1664,1714,1765,1817,1869,1922,1976,2031,2086,2142,2199,2257,2315,2374,2434,2495,2556,2618,2681,2745,2809,2874,2940,3007,3074,3142,3211,3281,3351,3422,3494,3567,3640,3714,3789,3865,3941,4018,4096,4175,4254
-
-//MaxHP - Wizard/High Wizard/Baby Wizard
-1,99,9:4010:4032,0,40,46,53,60,68,76,85,94,104,115,126,138,150,163,176,190,204,219,234,250,267,284,302,320,339,358,378,398,419,441,463,486,509,533,557,582,607,633,659,686,714,742,771,800,830,860,891,922,954,987,1020,1054,1088,1123,1158,1194,1230,1267,1304,1342,1381,1420,1460,1500,1541,1582,1624,1666,1709,1753,1797,1842,1887,1933,1979,2026,2073,2121,2169,2218,2268,2318,2369,2420,2472,2524,2577,2630,2684,2739,2794,2850,2906,2963,3020,3078,3136,3195,3254
-
-//MaxHP - Blacksmith/Alchemist/Whitesmith/Creator/Baby Blacksmith/Baby Alchemist
-1,99,10:18:4011:4019:4033:4041,0,40,47,55,64,74,84,95,107,120,134,149,165,182,200,219,238,258,279,301,324,348,373,399,426,454,482,511,541,572,604,637,671,706,742,779,816,854,893,933,974,1016,1059,1103,1148,1194,1240,1287,1335,1384,1434,1485,1537,1590,1644,1699,1754,1810,1867,1925,1984,2044,2105,2167,2230,2294,2358,2423,2489,2556,2624,2693,2763,2834,2906,2979,3052,3126,3201,3277,3354,3432,3511,3591,3672,3754,3836,3919,4003,4088,4174,4261,4349,4438,4528,4619,4710,4802,4895,4989
-
-//MaxHP - Hunter/Rogue/Sniper/Stalker/Baby Hunter/Baby Rogue
-1,99,11:17:4012:4018:4034:4040,0,40,47,55,63,72,82,93,105,118,132,146,161,177,194,212,231,250,270,291,313,336,360,385,410,436,463,491,520,550,581,612,644,677,711,746,782,818,855,893,932,972,1013,1055,1097,1140,1184,1229,1275,1322,1370,1418,1467,1517,1568,1620,1673,1726,1780,1835,1891,1948,2006,2065,2124,2184,2245,2307,2370,2434,2499,2564,2630,2697,2765,2834,2904,2974,3045,3117,3190,3264,3339,3415,3491,3568,3646,3725,3805,3886,3968,4050,4133,4217,4302,4388,4475,4562,4650,4739
-
-//MaxHP - Assassin/Assassin Cross/Baby Assassin
-1,99,12:4013:4035,0,40,47,55,64,75,87,100,114,129,145,162,180,199,219,241,264,288,313,339,366,394,423,453,484,517,551,586,622,659,697,736,776,817,859,903,948,994,1041,1089,1138,1188,1239,1291,1344,1399,1455,1512,1570,1629,1689,1750,1812,1875,1939,2005,2072,2140,2209,2279,2350,2422,2495,2569,2644,2721,2799,2878,2958,3039,3121,3204,3288,3373,3459,3547,3636,3726,3817,3909,4002,4096,4191,4287,4384,4483,4583,4684,4786,4889,4993,5098,5204,5311,5419,5529,5640,5752,5865,5979
-
-//MaxHP - Crusader/Crusader (Peco)/Paladin/Paladin (Peco)/Baby Crusader/Baby Crusader (Peco)
-1,99,14:21:4015:4022:4037:4044,0,40,47,56,62,81,94,108,128,147,165,184,204,225,247,271,296,322,349,377,406,436,467,499,532,567,603,640,678,717,757,798,840,883,927,973,1020,1068,1117,1167,1218,1270,1323,1377,1432,1489,1547,1606,1666,1727,1789,1852,1916,1981,2047,2115,2184,2254,2325,2397,2470,2544,2619,2695,2772,2851,2931,3012,3094,3177,3261,3346,3432,3519,3607,3697,3788,3880,3973,4067,4162,4258,4355,4453,4552,4653,4755,4858,4962,5067,5173,5280,5388,5497,5607,5719,5832,5946,6061,6177
-
-//MaxHP - Monk/Champion/Baby Monk
-1,99,15:4016:4038,0,40,47,55,64,74,84,95,107,120,134,149,165,182,200,219,238,258,306,329,354,379,406,433,462,491,521,551,583,615,649,683,719,755,793,831,870,909,950,991,1034,1077,1122,1167,1214,1261,1309,1357,1407,1457,1509,1561,1615,1669,1725,1781,1838,1895,1954,2013,2074,2135,2198,2261,2326,2391,2457,2523,2591,2659,2729,2799,2871,2943,3017,3091,3166,3241,3318,3395,3474,3553,3634,3715,3798,3881,3965,4049,4135,4221,4309,4397,4487,4577,4669,4761,4854,4947,5042,5137
-
-//MaxHP - Bard/Dancer/Clown/Gypsy/Baby Bard/Baby Dancer
-1,99,19:20:4020:4021:4042:4043,0,40,47,54,62,71,81,91,102,114,127,140,154,169,180,196,212,224,242,260,278,296,316,330,350,371,393,415,438,451,477,503,530,558,587,616,646,677,709,741,774,808,843,878,914,951,989,1027,1066,1106,1147,1188,1230,1273,1317,1361,1406,1452,1499,1546,1594,1643,1693,1743,1794,1846,1899,1952,2006,2061,2117,2173,2230,2288,2347,2406,2466,2527,2589,2651,2714,2778,2843,2908,2974,3041,3109,3177,3246,3316,3387,3458,3530,3603,3677,3751,3826,3902,3979,4056
-
-//MaxHP - Gunslinger
-1,99,24,0,40,47,55,64,74,84,95,107,120,134,149,165,182,200,219,238,258,306,329,354,379,406,433,462,491,521,551,583,615,649,683,719,755,793,831,870,909,950,991,1034,1077,1122,1167,1214,1261,1309,1357,1407,1457,1509,1561,1615,1669,1725,1781,1838,1895,1954,2013,2074,2135,2198,2261,2326,2391,2457,2523,2591,2659,2670,2680,2690,2700,2710,2720,2730,2740,2750,2760,3000,3020,3040,3060,3080,3100,3120,3140,3160,3180,3455,3524,3593,3663,3734,3806,3878,3951,4025,4500
-
-//MaxHP - Rebellion
-1,160,4215,0,40,47,54,62,71,81,91,103,115,128,141,155,170,186,203,220,238,257,276,296,318,340,362,385,410,435,460,486,514,542,570,599,630,661,692,725,758,792,827,862,898,936,973,1012,1051,1091,1132,1173,1216,1259,1302,1347,1392,1439,1485,1533,1581,1631,1680,1731,1782,1835,1887,1941,1995,2051,2106,2163,2220,2279,2338,2397,2458,2519,2581,2644,2707,2772,2837,2902,2969,3037,3104,3173,3243,3313,3384,3456,3528,3602,3676,3751,3826,3903,3980,4058,4136,4216,4296,4377,4459,4541,4624,4708,4793,4879,4965,5052,5139,5228,5317,5407,5498,5590,5682,5775,5869,5964,6058,6154,6251,6349,6447,6546,6646,6747,6848,6950,7053,7157,7261,7366,7472,7580,7687,7795,7904,8014,8124,8235,8347,8460,8573,8688,8803,8919,9035,9152,9270,9389,9509,9629,9750,9872,9994,10118,10242,10367,10492,10619
-
-//MaxHP - Ninja
-1,99,25,0,40,47,54,62,71,81,91,102,114,127,140,154,169,185,201,218,236,255,274,294,315,337,359,382,406,431,456,482,509,537,565,594,624,655,686,718,751,785,819,854,890,927,964,1002,1041,1081,1121,1162,1204,1247,1290,1334,1379,1425,1471,1518,1566,1615,1664,1714,1765,1817,1869,1922,1976,2031,2086,2142,2199,2257,2275,2294,2314,2335,2356,2378,2401,2425,2449,2874,2890,2907,2924,2942,2971,2991,3011,3032,3054,3567,3590,3614,3649,3675,3701,3728,3756,3800,4250
-
-//MaxHP - Oboro/Kagerou
-1,160,4211:4212,0,40,47,54,62,71,81,92,104,116,129,143,158,173,189,207,225,244,263,283,305,327,350,373,397,423,449,476,503,532,561,591,623,654,686,720,754,789,825,861,898,937,976,1016,1056,1097,1140,1183,1227,1271,1317,1363,1410,1458,1506,1556,1606,1658,1709,1762,1815,1870,1926,1981,2038,2095,2154,2213,2273,2334,2395,2458,2521,2585,2650,2715,2782,2850,2917,2986,3056,3126,3198,3270,3343,3416,3491,3567,3643,3719,3797,3876,3956,4035,4116,4198,4281,4365,4449,4533,4619,4706,4794,4882,4971,5061,5152,5243,5335,5428,5522,5617,5713,5809,5906,6004,6103,6203,6303,6404,6506,6609,6713,6817,6922,7028,7135,7243,7351,7460,7570,7682,7794,7906,8019,8133,8248,8364,8480,8598,8716,8835,8955,9075,9197,9319,9442,9566,9690,9816,9942,10069,10197,10326,10455,10585,10717,10849,10981,11115,11249
-
-//MaxHP - Taekwon
-1,99,4046,0,40,46,53,61,70,79,89,100,111,123,136,149,163,178,194,210,227,245,263,282,302,322,343,365,388,411,435,460,485,511,538,565,593,622,652,682,713,745,777,810,844,878,913,949,986,1023,1061,1100,1139,1179,1220,1261,1303,1346,1390,1434,1479,1525,1571,1618,1666,1714,1763,1813,1864,1915,1967,2020,2073,2127,2137,2147,2157,2167,2177,2187,2197,2200,2210,2230,2250,2300,2350,2400,2450,2500,2550,2600,2650,2700,2750,2800,2850,2900,2950,3000,3050,3100,3200
-
-//MaxHP - Star Knight/Star Knight (flying)
-1,99,4047:4048,0,40,47,55,64,74,84,95,107,120,134,149,165,182,200,219,238,258,306,329,354,379,406,433,462,491,521,551,583,615,649,683,719,755,793,831,870,909,950,991,1034,1077,1122,1167,1214,1261,1309,1357,1407,1457,1509,1561,1615,1669,1725,1781,1838,1895,1954,2013,2074,2135,2198,2261,2326,2391,2457,2523,2591,2659,2670,2680,2690,2700,2710,2720,2730,2740,2750,2760,3000,3020,3040,3060,3080,3100,3120,3140,3160,3180,3455,3524,3593,3663,3734,3806,3878,3951,4025,4500
-
-//MaxHP - Soul Linker
-1,99,4049,0,40,47,54,62,71,81,91,102,114,127,140,154,169,185,201,218,236,255,274,294,315,337,359,382,406,431,456,482,509,537,565,594,624,655,686,718,751,785,819,854,890,927,964,1002,1041,1081,1121,1162,1204,1247,1290,1334,1379,1425,1471,1518,1566,1615,1664,1714,1765,1817,1869,1922,1976,2031,2086,2142,2199,2257,2275,2294,2314,2335,2356,2378,2401,2425,2449,2874,2890,2907,2924,2942,2971,2991,3011,3032,3054,3567,3590,3614,3649,3675,3701,3728,3756,3800,4250
-
-//MaxHP - Munak/Bongun
-1,99,4050,0,40,46,53,60,68,76,85,94,104,114,125,136,148,160,173,186,200,214,229,244,260,276,293,310,328,346,365,384,404,424,445,466,488,510,533,556,580,604,629,654,680,706,733,760,788,816,845,874,904,934,965,996,1028,1060,1093,1126,1160,1194,1229,1264,1300,1336,1373,1410,1448,1486,1525,1564,1604,1644,1685,1726,1768,1810,1853,1896,1940,1984,2029,2074,2120,2166,2213,2260,2308,2356,2405,2454,2504,2554,2605,2656,2708,2760,2813,2866,2920,2974,3029
-
-//MaxHP - Death Knight
-1,99,4051,0,2040,2046,2053,2060,2068,2076,2085,2094,2104,2114,2125,2136,2148,2160,2173,2186,2200,2214,2229,2244,2260,2276,2293,2310,2328,2346,2365,2384,2404,2424,2445,2466,2488,2510,2533,2556,2580,2604,2629,2654,2680,2706,2733,2760,2788,2816,2845,2874,2904,2934,2965,2996,3028,3060,3093,3126,3160,3194,3229,3264,3300,3336,3373,3410,3448,3486,3525,3564,3604,3644,3685,3726,3768,3810,3853,3896,3940,3984,4029,4074,4120,4166,4213,4260,4308,4356,4405,4454,4504,4554,4605,4656,4708,4760,4813,4866,4920,4974,5029
-
-//MaxHP - Dark Collector
-1,99,4052,0,40,47,54,62,71,81,91,102,114,127,140,154,169,185,201,218,236,255,274,294,315,337,359,382,406,431,456,482,509,537,565,594,624,655,686,718,751,785,819,854,890,927,964,1002,1041,1081,1121,1162,1204,1247,1290,1334,1379,1425,1471,1518,1566,1615,1664,1714,1765,1817,1869,1922,1976,2031,2086,2142,2199,2257,2315,2374,2434,2495,2556,2618,2681,2745,2809,2874,2940,3007,3074,3142,3211,3281,3351,3422,3494,3567,3640,3714,3789,3865,3941,4018,4096,4175,4254
-
-//MaxHP - Rune Knight/Rune Knight_T/Rune Knight (Dragon)/Rune Knight (Dragon)_T
-99,150,4054:4060:4080:4081:4096:4109,0,8100,8133,8242,8352,8464,8576,8690,8804,8920,9036,9154,9273,9393,9514,9636,9759,9883,10008,10134,10261,10389,10518,10648,10779,10912,11045,11180,11315,11452,11589,11728,11868,12009,12151,12294,12438,12583,12729,12876,13024,13173,13323,13474,13626,13780,13934,14090,14246,14404,14562,14722,14883
-
-//MaxHP - Warlock/Warlock_T
-99,150,4055:4061:4097,0,3200,3313,3383,3455,3528,3601,3675,3749,3824,3899,3975,4051,4129,4208,4287,4367,4447,4528,4609,4691,4773,4857,4941,5026,5112,5198,5285,5372,5460,5548,5638,5728,5819,5911,6003,6096,6189,6283,6377,6473,6569,6666,6763,6861,6960,7059,7159,7259,7361,7463,7566,7669
-
-//MaxHP - Ranger/Ranger_T/Minstrel/Wanderer/Minstrel_T/Wanderer_T/Ranger (Warg)/Ranger (Warg)_T
-99,150,4056:4062:4068:4069:4075:4076:4084:4085:4098:4104:4105:4111,0,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
-
-//MaxHP - Arch Bishop/Arch Bishop_T
-99,150,4057:4063:4099,0,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
-
-//MaxHP - Mechanic/Mechanic_T/Sura/Sura_T/Mechanic (Mado Gear)/Mechanic (Mado Gear)_T
-99,150,4058:4064:4086:4087:4100:4112,0,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
-
-//MaxHP - Guillotine Cross/Guillotine Cross_T/Royal Guard/Shadow Chaser/Royal Guard_T/Shadow Chaser_T/Royal Guard (Gryphon)/Royal Guard (Gryphon)_T
-99,150,4059:4065:4066:4072:4073:4079:4082:4083:4101:4102:4108:4110,0,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
-
-//MaxHP - Sorcerer/Sorcerer_T
-99,150,4067:4074:4103,0,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
-
-//MaxHP - Sura/Sura_T
-99,150,4070:4077:4106,0,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
-
-//MaxHP - Genetic/Genetic_T
-99,150,4071:4078:4107,0,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
-
-//MaxSP - Novice/Super Novice/Novice High/Baby Novice/Baby Super Novice/Super Novice (Expanded)/Super Baby (Expanded)
-1,99,0:23:4001:4023:4045:4190:4191,1,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109
-
-//MaxSP - Swordman/Archer/Thief/Swordman High/Archer High/Thief High/Baby Swordman/Baby Archer/Baby Thief
-1,99,1:3:6:4002:4004:4007:4024:4026:4029,1,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,172,174,176,178,180,182,184,186,188,190,192,194,196,198,200,202,204,206,208
-
-//MaxSP - Magician/Bard/Dancer/Magician High/Clown/Gypsy/Baby Magician/Baby Bard/Baby Dancer
-1,99,2:19:20:4003:4020:4021:4025:4042:4043,1,16,22,28,34,40,46,52,58,64,70,76,82,88,94,100,106,112,118,124,130,136,142,148,154,160,166,172,178,184,190,196,202,208,214,220,226,232,238,244,250,256,262,268,274,280,286,292,298,304,310,316,322,328,334,340,346,352,358,364,370,376,382,388,394,400,406,412,418,424,430,436,442,448,454,460,466,472,478,484,490,496,502,508,514,520,526,532,538,544,550,556,562,568,574,580,586,592,598,604
-
-//MaxSP - Acolyte/Rogue/Acolyte High/Stalker/Baby Acolyte/Baby Rogue
-1,99,4:17:4005:4018:4027:4040,1,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110,115,120,125,130,135,140,145,150,155,160,165,170,175,180,185,190,195,200,205,210,215,220,225,230,235,240,245,250,255,260,265,270,275,280,285,290,295,300,305,310,315,320,325,330,335,340,345,350,355,360,365,370,375,380,385,390,395,400,405,410,415,420,425,430,435,440,445,450,455,460,465,470,475,480,485,490,495,500,505
-
-//MaxSP - Merchant/Knight/Knight (Peco)/Merchant High/Lord Knight/Lord Knight (Peco)/Baby Merchant/Baby Knight/Baby Knight (Peco)
-1,99,5:7:13:4006:4008:4014:4028:4030:4036,1,13,16,19,22,25,28,31,34,37,40,43,46,49,52,55,58,61,64,67,70,73,76,79,82,85,88,91,94,97,100,103,106,109,112,115,118,121,124,127,130,133,136,139,142,145,148,151,154,157,160,163,166,169,172,175,178,181,184,187,190,193,196,199,202,205,208,211,214,217,220,223,226,229,232,235,238,241,244,247,250,253,256,259,262,265,268,271,274,277,280,283,286,289,292,295,298,301,304,307
-
-//MaxSP - Priest/High Priest/Baby Priest
-1,99,8:4009:4031,1,18,26,34,42,50,58,66,74,82,90,98,106,114,122,130,138,146,154,162,170,178,186,194,202,210,218,226,234,242,250,258,266,274,282,290,298,306,314,322,330,338,346,354,362,370,378,386,394,402,410,418,426,434,442,450,458,466,474,482,490,498,506,514,522,530,538,546,554,562,570,578,586,594,602,610,618,626,634,642,650,658,666,674,682,690,698,706,714,722,730,738,746,754,762,770,778,786,794,802
-
-//MaxSP - Wizard/High Wizard/Baby Wizard
-1,99,9:4010:4032,1,19,28,37,46,55,64,73,82,91,100,109,118,127,136,145,154,163,172,181,190,199,208,217,226,235,244,253,262,271,280,289,298,307,316,325,334,343,352,361,370,379,388,397,406,415,424,433,442,451,460,469,478,487,496,505,514,523,532,541,550,559,568,577,586,595,604,613,622,631,640,649,658,667,676,685,694,703,712,721,730,739,748,757,766,775,784,793,802,811,820,829,838,847,856,865,874,883,892,901
-
-//MaxSP - Blacksmith/Hunter/Assassin/Alchemist/Whitesmith/Sniper/Assassin Cross/Creator/Baby Blacksmith/Baby Hunter/Baby Assassin/Baby Alchemist
-1,99,10:11:12:18:4011:4012:4013:4019:4033:4034:4035:4041,1,14,18,22,26,30,34,38,42,46,50,54,58,62,66,70,74,78,82,86,90,94,98,102,106,110,114,118,122,126,130,134,138,142,146,150,154,158,162,166,170,174,178,182,186,190,194,198,202,206,210,214,218,222,226,230,234,238,242,246,250,254,258,262,266,270,274,278,282,286,290,294,298,302,306,310,314,318,322,326,330,334,338,342,346,350,354,358,362,366,370,374,378,382,386,390,394,398,402,406
-
-//MaxSP - Crusader/Monk/Crusader (Peco)/Paladin/Champion/Paladin (Peco)/Baby Crusader/Baby Monk/Baby Crusader (Peco)
-1,99,14:15:21:4015:4016:4022:4037:4038:4044,1,14,19,24,28,33,38,42,47,52,57,61,66,71,75,80,85,89,94,99,104,108,113,118,122,127,132,136,141,146,151,155,160,165,169,174,179,183,188,193,198,202,207,212,216,221,226,230,235,240,245,249,254,259,263,268,273,277,282,287,292,296,301,306,310,315,320,324,329,334,339,343,348,353,357,362,367,371,376,381,386,390,395,400,404,409,414,418,423,428,433,437,442,447,451,456,461,465,470,475
-
-//MaxSP - Sage/Professor/Baby Sage
-1,99,16:4017:4039,1,17,24,31,38,45,52,59,66,73,80,87,94,101,108,115,122,129,136,143,150,157,164,171,178,185,192,199,206,213,220,227,234,241,248,255,262,269,276,283,290,297,304,311,318,325,332,339,346,353,360,367,374,381,388,395,402,409,416,423,430,437,444,451,458,465,472,479,486,493,500,507,514,521,528,535,542,549,556,563,570,577,584,591,598,605,612,619,626,633,640,647,654,661,668,675,682,689,696,703
-
-//MaxSP - Gunslinger
-1,99,24,1,12,15,18,21,24,27,30,33,36,39,42,45,48,51,54,57,61,64,67,70,73,76,79,82,85,89,93,97,101,105,109,113,117,121,125,129,131,135,139,141,145,149,153,157,161,165,169,173,177,181,186,191,196,201,206,211,216,221,226,231,236,241,246,251,256,261,266,271,276,281,286,291,296,301,306,312,318,324,336,342,348,354,360,366,372,378,384,390,396,402,408,414,420,426,432,438,444,450,456
-
-//MaxSP - Rebellion
-1,160,4215,1,14,18,22,26,30,34,38,42,46,50,54,58,62,66,70,74,78,82,86,90,94,98,103,107,111,115,119,123,127,131,135,139,143,147,151,155,159,163,167,171,175,179,183,187,191,195,199,204,208,212,216,220,224,228,232,236,240,244,248,252,256,260,264,268,272,276,280,284,288,292,296,300,305,309,313,317,321,325,329,333,337,341,345,349,353,357,361,365,369,373,377,381,385,389,393,397,401,406,410,414,418,422,426,430,434,438,442,446,450,454,458,462,466,470,474,478,482,486,490,494,498,502,507,511,515,519,523,527,531,535,539,543,547,551,555,559,563,567,571,575,579,583,587,591,595,599,603,608,612,616,620,624,628,632,636,640,644,648,652,656
-
-//MaxSP - Ninja
-1,99,25:4211:4212,1,14,17,20,23,26,29,32,35,38,41,44,47,50,53,56,59,62,65,68,71,75,79,83,87,91,95,99,103,107,111,115,119,123,127,131,135,139,143,147,151,156,161,166,171,176,181,186,191,196,201,206,211,216,221,226,231,236,241,246,251,257,263,269,275,281,287,293,299,305,311,317,323,329,335,341,347,353,359,365,371,378,386,394,402,410,418,426,434,442,450,458,466,474,482,490,498,506,514,522
-
-//MaxSP - Oboro/Kagerou
-1,160,4211:4212,1,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,101,106,111,116,121,126,131,136,141,146,151,156,161,166,171,176,181,186,191,196,202,207,212,217,222,227,232,237,242,247,252,257,262,267,272,277,282,287,292,297,303,308,313,318,323,328,333,338,343,348,353,358,363,368,373,378,383,388,393,398,404,409,414,419,424,429,434,439,444,449,454,459,464,469,474,479,484,489,494,499,505,510,515,520,525,530,535,540,545,550,555,560,565,570,575,580,585,590,595,600,606,611,616,621,626,631,636,641,646,651,656,661,666,671,676,681,686,691,696,701,707,712,717,722,727,732,737,742,747,752,757,762,767,772,777,782,787,792,797,802,808,813,818
-
-//MaxSP - Taekwon
-1,99,4046,1,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,151,152,153,154,155,156,157,158,159,170,171,172,173,174,175,176,177,178,188,190,190,190,190,190,190,190,190,190,200
-
-//MaxSP - Star Knight/Star Knight (flying)
-1,99,4047:4048,1,14,19,24,28,33,38,42,47,52,57,61,66,71,75,80,85,89,94,99,104,108,113,118,122,127,132,136,141,146,151,155,160,165,169,174,179,183,188,193,198,202,207,212,216,221,226,230,235,240,245,249,254,259,263,268,273,277,282,287,292,296,301,306,310,315,320,324,329,334,339,341,343,345,347,349,351,353,355,357,386,388,390,392,394,396,398,400,402,404,430,433,436,439,442,445,448,451,454,500
-
-//MaxSP - Soul Linker
-1,99,4049,1,19,28,37,46,55,64,73,82,91,100,109,118,127,136,145,154,163,172,181,190,199,208,217,226,235,244,253,262,271,280,289,298,307,316,325,334,343,352,361,370,379,388,397,406,415,424,433,442,451,460,469,478,487,496,505,514,523,532,541,550,559,568,577,586,595,604,613,622,631,635,640,645,650,655,660,665,670,675,680,730,735,740,745,750,755,760,765,770,775,820,825,830,845,850,855,860,865,870,900
-
-//MaxSP - Munak/Bongun
-1,99,4050,1,13,16,19,22,25,28,31,34,37,40,43,46,49,52,55,58,61,64,67,70,73,76,79,82,85,88,91,94,97,100,103,106,109,112,115,118,121,124,127,130,133,136,139,142,145,148,151,154,157,160,163,166,169,172,175,178,181,184,187,190,193,196,199,202,205,208,211,214,217,220,223,226,229,232,235,238,241,244,247,250,253,256,259,262,265,268,271,274,277,280,283,286,289,292,295,298,301,304,307
-
-//MaxSP - Death Knight
-1,99,4051,1,13,16,19,22,25,28,31,34,37,40,43,46,49,52,55,58,61,64,67,70,73,76,79,82,85,88,91,94,97,100,103,106,109,112,115,118,121,124,127,130,133,136,139,142,145,148,151,154,157,160,163,166,169,172,175,178,181,184,187,190,193,196,199,202,205,208,211,214,217,220,223,226,229,232,235,238,241,244,247,250,253,256,259,262,265,268,271,274,277,280,283,286,289,292,295,298,301,304,307
-
-//MaxSP - Dark Collector
-1,99,4052,1,17,24,31,38,45,52,59,66,73,80,87,94,101,108,115,122,129,136,143,150,157,164,171,178,185,192,199,206,213,220,227,234,241,248,255,262,269,276,283,290,297,304,311,318,325,332,339,346,353,360,367,374,381,388,395,402,409,416,423,430,437,444,451,458,465,472,479,486,493,500,507,514,521,528,535,542,549,556,563,570,577,584,591,598,605,612,619,626,633,640,647,654,661,668,675,682,689,696,703
-
-//MaxSP - Rune Knight/Rune Knight_T/Rune Knight (Dragon)/Rune Knight (Dragon)_T
-99,150,4054:4060:4080:4081:4096:4109,1,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
-
-//MaxSP - Warlock/Sorcerer/Genetic/Warlock_T/Sorcerer_T/Genetic_T
-99,150,4055:4061:4067:4071:4074:4078:4097:4103:4107,1,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
-
-//MaxSP - Arch Bishop/Arch Bishop_T
-99,150,4057:4063:4099,1,800,810,818,826,834,842,850,858,866,874,882,890,898,906,914,922,930,938,946,954,962,970,978,986,994,1002,1010,1018,1026,1034,1042,1050,1058,1066,1074,1082,1090,1098,1106,1114,1122,1130,1138,1146,1154,1162,1170,1178,1186,1194,1202,1210
-
-//MaxSP - Ranger/Mechanic/Guillotine Cross/Ranger_T/Mechanic_T/Guillotine Cross_T/Royal Guard/Minstrel/Wanderer/Sura/Shadow Chaser/Royal Guard_T/Minstrel_T/Wanderer_T/Sura_T/Shadow Chaser_T/Royal Guard (Gryphon)/Royal Guard (Gryphon)_T/Ranger (Warg)/Ranger (Warg)_T/Mechanic (Mado Gear)/Mechanic (Mado Gear)_T
-1,150,4056:4058:4059:4062:4064:4065:4066:4068:4069:4070:4072:4073:4075:4076:4077:4079:4082:4083:4084:4085:4086:4087:4098:4100:4101:4102:4104:4105:4106:4108:4110:4111:4112,1,14,18,22,26,30,34,38,42,46,50,54,58,62,66,70,74,78,82,86,90,94,98,102,106,110,114,118,122,126,130,134,138,142,146,150,154,158,162,166,170,174,178,182,186,190,194,198,202,206,210,214,218,222,226,230,234,238,242,246,250,254,258,262,266,270,274,278,282,286,290,294,298,302,306,310,314,318,322,326,330,334,338,342,346,350,354,358,362,366,370,374,378,382,386,390,394,398,402,406,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

+ 18 - 0
db/re/job_param_db.txt

@@ -0,0 +1,18 @@
+// Maximum parameters for specific job!
+// ====================================================
+// Structure of Database:
+//	JobID,MaxParam
+//		or
+//	JobID,MaxStr,MaxAgi,MaxVit,MaxInt,MaxDex,MaxLuk
+// ====================================================
+// JobID: Using Job constanta on 'db/const.txt'
+// MaxParams: Value between 10 ~ 32767 (SHRT_MAX)
+// ====================================================
+// Examples:
+//Job_Novice,60
+//	Normally, Novice's max. param is using 'max_parameter' on conf/battle/player.conf.
+//	By with this config, Novice's max. param will be 60, for all params.
+//Job_Swordman,90
+//	Normally, Swordman's max. param is using 'max_parameter' on conf/battle/player.conf.
+//	By with this config, Swordman's max. param will be 90, for all params.
+// ====================================================

+ 2 - 2
src/config/core.h

@@ -69,8 +69,8 @@
 #define MAX_SKILL_DAMAGE_RATE 100000
 #endif
 
-/// Comment to disable the job HP/SP tables and use formulas instead
-#define HP_SP_TABLES
+/// Uncomment to enable the job base HP/SP table (job_basehpsp_db.txt)
+//#define HP_SP_TABLES
 
 /// Uncomment to enable VIP system.
 //#define VIP_ENABLE

+ 46 - 21
src/map/atcommand.c

@@ -2410,9 +2410,10 @@ ACMD_FUNC(zeny)
  *------------------------------------------*/
 ACMD_FUNC(param)
 {
-	int i, value = 0, new_value, max;
+	int i, value = 0, new_value;
 	const char* param[] = { "str", "agi", "vit", "int", "dex", "luk" };
 	short* status[6];
+	short max_status[6];
  	//we don't use direct initialization because it isn't part of the c standard.
 	nullpo_retr(-1, sd);
 
@@ -2437,15 +2438,27 @@ ACMD_FUNC(param)
 	status[4] = &sd->status.dex;
 	status[5] = &sd->status.luk;
 
-	if( battle_config.atcommand_max_stat_bypass )
-		max = SHRT_MAX;
-	else
-		max = pc_maxparameter(sd);
+	if( battle_config.atcommand_max_stat_bypass ){
+		max_status[0] = SHRT_MAX;
+		max_status[1] = SHRT_MAX;
+		max_status[2] = SHRT_MAX;
+		max_status[3] = SHRT_MAX;
+		max_status[4] = SHRT_MAX;
+		max_status[5] = SHRT_MAX;
+	}
+	else {
+		max_status[0] = pc_maxparameter(sd->class_,sd->status.sex,PARAM_STR);
+		max_status[1] = pc_maxparameter(sd->class_,sd->status.sex,PARAM_AGI);
+		max_status[2] = pc_maxparameter(sd->class_,sd->status.sex,PARAM_VIT);
+		max_status[3] = pc_maxparameter(sd->class_,sd->status.sex,PARAM_INT);
+		max_status[4] = pc_maxparameter(sd->class_,sd->status.sex,PARAM_DEX);
+		max_status[5] = pc_maxparameter(sd->class_,sd->status.sex,PARAM_LUK);
+	}
 
 	if(value < 0 && *status[i] <= -value) {
 		new_value = 1;
-	} else if(max - *status[i] < value) {
-		new_value = max;
+	} else if(max_status[i] - *status[i] < value) {
+		new_value = max_status[i];
 	} else {
 		new_value = *status[i] + value;
 	}
@@ -2472,8 +2485,10 @@ ACMD_FUNC(param)
  *------------------------------------------*/
 ACMD_FUNC(stat_all)
 {
-	int index, count, value, max, new_value;
-	short* status[6];
+	int index, count, value, new_value;
+	short* status[PARAM_MAX];
+	short max_status[PARAM_MAX];
+	short values[PARAM_MAX];
  	//we don't use direct initialization because it isn't part of the c standard.
 	nullpo_retr(-1, sd);
 
@@ -2485,24 +2500,34 @@ ACMD_FUNC(stat_all)
 	status[5] = &sd->status.luk;
 
 	if (!message || !*message || sscanf(message, "%d", &value) < 1 || value == 0) {
-		value = pc_maxparameter(sd);
-		max = pc_maxparameter(sd);
+		uint8 i;
+		for (i  = 0; i < PARAM_MAX; i++) {
+			values[i] = pc_maxparameter(sd->class_,sd->status.sex,(enum e_params)i);
+			max_status[i] = pc_maxparameter(sd->class_,sd->status.sex,(enum e_params)i);
+		}
 	} else {
-		if( battle_config.atcommand_max_stat_bypass )
-			max = SHRT_MAX;
-		else
-			max = pc_maxparameter(sd);
-	}
+		uint8 i;
+		for (i  = 0; i < PARAM_MAX; i++)
+			values[i] = value;
 
+		if( battle_config.atcommand_max_stat_bypass ) {
+			for (i  = 0; i < PARAM_MAX; i++)
+				max_status[i] = SHRT_MAX;
+		}
+		else {
+			for (i  = 0; i < PARAM_MAX; i++)
+				max_status[i] = pc_maxparameter(sd->class_,sd->status.sex,(enum e_params)i);
+		}
+	}
+	
 	count = 0;
 	for (index = 0; index < ARRAYLENGTH(status); index++) {
-
-		if (value > 0 && *status[index] > max - value)
-			new_value = max;
-		else if (value < 0 && *status[index] <= -value)
+		if (values[index] > 0 && *status[index] > max_status[index] - values[index])
+			new_value = max_status[index];
+		else if (values[index] < 0 && *status[index] <= -values[index])
 			new_value = 1;
 		else
-			new_value = *status[index] +value;
+			new_value = *status[index] +values[index];
 
 		if (new_value != (int)*status[index]) {
 			*status[index] = new_value;

+ 7 - 4
src/map/battle.c

@@ -7006,8 +7006,8 @@ static const struct _battle_data {
 	{ "max_hp",                             &battle_config.max_hp,                          32500,  100,    1000000000,     },
 	{ "max_sp",                             &battle_config.max_sp,                          32500,  100,    1000000000,     },
 	{ "max_cart_weight",                    &battle_config.max_cart_weight,                 8000,   100,    1000000,        },
-	{ "max_parameter",                      &battle_config.max_parameter,                   99,     10,     10000,          },
-	{ "max_baby_parameter",                 &battle_config.max_baby_parameter,              80,     10,     10000,          },
+	{ "max_parameter",                      &battle_config.max_parameter,                   99,     10,     SHRT_MAX,       },
+	{ "max_baby_parameter",                 &battle_config.max_baby_parameter,              80,     10,     SHRT_MAX,       },
 	{ "max_def",                            &battle_config.max_def,                         99,     0,      INT_MAX,        },
 	{ "over_def_bonus",                     &battle_config.over_def_bonus,                  0,      0,      1000,           },
 	{ "skill_log",                          &battle_config.skill_log,                       BL_NUL, BL_NUL, BL_ALL,         },
@@ -7242,8 +7242,11 @@ static const struct _battle_data {
 	/**
 	 * rAthena
 	 **/
-	{ "max_third_parameter",                &battle_config.max_third_parameter,             120,    10,     10000,          },
-	{ "max_baby_third_parameter",           &battle_config.max_baby_third_parameter,        108,    10,     10000,          },
+	{ "max_third_parameter",				&battle_config.max_third_parameter,				135,	10,		SHRT_MAX,		},
+	{ "max_baby_third_parameter",			&battle_config.max_baby_third_parameter,		108,	10,		SHRT_MAX,		},
+	{ "max_trans_parameter",				&battle_config.max_trans_parameter,				99,		10,		SHRT_MAX,		},
+	{ "max_third_trans_parameter",			&battle_config.max_third_trans_parameter,		135,	10,		SHRT_MAX,		},
+	{ "max_extended_parameter",				&battle_config.max_extended_parameter,			125,	10,		SHRT_MAX,		},
 	{ "atcommand_max_stat_bypass",          &battle_config.atcommand_max_stat_bypass,       0,      0,      100,            },
 	{ "skill_amotion_leniency",             &battle_config.skill_amotion_leniency,          90,     0,      300             },
 	{ "mvp_tomb_enabled",                   &battle_config.mvp_tomb_enabled,                1,      0,      1               },

+ 3 - 0
src/map/battle.h

@@ -479,6 +479,9 @@ extern struct Battle_Config
 	// rAthena
 	int max_third_parameter;
 	int max_baby_third_parameter;
+	int max_trans_parameter;
+	int max_third_trans_parameter;
+	int max_extended_parameter;
 	int atcommand_max_stat_bypass;
 	int max_third_aspd;
 	int vcast_stat_scale;

+ 1 - 1
src/map/map.h

@@ -44,7 +44,7 @@ void map_msg_reload(void);
 #define NATURAL_HEAL_INTERVAL 500
 #define MIN_FLOORITEM 2
 #define MAX_FLOORITEM START_ACCOUNT_NUM
-#define MAX_LEVEL 160
+#define MAX_LEVEL 175
 #define MAX_DROP_PER_MAP 48
 #define MAX_IGNORE_LIST 20 	// official is 14
 #define MAX_VENDING 12

+ 221 - 135
src/map/pc.c

@@ -48,6 +48,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
+#include <math.h>
 
 int pc_split_atoui(char* str, unsigned int* val, char sep, int max);
 
@@ -1467,9 +1468,9 @@ int pc_calc_skilltree(struct map_session_data *sd)
 					}
 				}
 				if( sd->status.job_level < skill_tree[c][i].joblv ) { //We need to get the actual class in this case
-					int class = pc_mapid2jobid(sd->class_, sd->status.sex);
-					class = pc_class2idx(class);
-					if (class == c || (class != c && sd->status.job_level < skill_tree[class][i].joblv))
+					int class_ = pc_mapid2jobid(sd->class_, sd->status.sex);
+					class_ = pc_class2idx(class_);
+					if (class_ == c || (class_ != c && sd->status.job_level < skill_tree[class_][i].joblv))
 						f = 0; // job level requirement wasn't satisfied
 				}
 			}
@@ -2255,16 +2256,12 @@ int pc_bonus(struct map_session_data *sd,int type,int val)
 		case SP_MAXHP:
 			if(sd->state.lr_flag == 2)
 				break;
-			val += (int)status->max_hp;
-			//Negative bonuses will underflow, this will be handled in status_calc_pc through casting
-			//If this is called outside of status_calc_pc, you'd better pray they do not underflow and end with UINT_MAX max_hp.
-			status->max_hp = (unsigned int)val;
+			sd->bonus.hp += val;
 			break;
 		case SP_MAXSP:
 			if(sd->state.lr_flag == 2)
 				break;
-			val += (int)status->max_sp;
-			status->max_sp = (unsigned int)val;
+			sd->bonus.sp += val;
 			break;
 	#ifndef RENEWAL_CAST
 		case SP_VARCASTRATE:
@@ -6096,14 +6093,23 @@ int pc_gets_status_point(int level)
 /// raise the specified stat from (current value - val) to current value.
 int pc_need_status_point(struct map_session_data* sd, int type, int val)
 {
-	int low, high, sp = 0;
+	int low, high, sp = 0, max = 0;
 
 	if ( val == 0 )
 		return 0;
 
 	low = pc_getstat(sd,type);
+	
+	switch(type) {
+		case SP_STR: max = pc_maxparameter(sd->class_,sd->status.sex,PARAM_STR); break;
+		case SP_AGI: max = pc_maxparameter(sd->class_,sd->status.sex,PARAM_AGI); break;
+		case SP_VIT: max = pc_maxparameter(sd->class_,sd->status.sex,PARAM_VIT); break;
+		case SP_INT: max = pc_maxparameter(sd->class_,sd->status.sex,PARAM_INT); break;
+		case SP_DEX: max = pc_maxparameter(sd->class_,sd->status.sex,PARAM_DEX); break;
+		case SP_LUK: max = pc_maxparameter(sd->class_,sd->status.sex,PARAM_LUK); break;
+	}
 
-	if ( low >= pc_maxparameter(sd) && val > 0 )
+	if ( low >= max && val > 0 )
 		return 0; // Official servers show '0' when max is reached
 
 	high = low + val;
@@ -6141,7 +6147,14 @@ int pc_statusup(struct map_session_data* sd, int type)
 	}
 
 	// check limits
-	max = pc_maxparameter(sd);
+	switch(type) {
+		case SP_STR: max = pc_maxparameter(sd->class_,sd->status.sex,PARAM_STR); break;
+		case SP_AGI: max = pc_maxparameter(sd->class_,sd->status.sex,PARAM_AGI); break;
+		case SP_VIT: max = pc_maxparameter(sd->class_,sd->status.sex,PARAM_VIT); break;
+		case SP_INT: max = pc_maxparameter(sd->class_,sd->status.sex,PARAM_INT); break;
+		case SP_DEX: max = pc_maxparameter(sd->class_,sd->status.sex,PARAM_DEX); break;
+		case SP_LUK: max = pc_maxparameter(sd->class_,sd->status.sex,PARAM_LUK); break;
+	}
 	if( pc_getstat(sd,type) >= max )
 	{
 		clif_statusupack(sd,type,0,0);
@@ -6189,7 +6202,14 @@ int pc_statusup2(struct map_session_data* sd, int type, int val)
 	need = pc_need_status_point(sd,type,1);
 
 	// set new value
-	max = pc_maxparameter(sd);
+	switch(type) {
+		case SP_STR: max = pc_maxparameter(sd->class_,sd->status.sex,PARAM_STR); break;
+		case SP_AGI: max = pc_maxparameter(sd->class_,sd->status.sex,PARAM_AGI); break;
+		case SP_VIT: max = pc_maxparameter(sd->class_,sd->status.sex,PARAM_VIT); break;
+		case SP_INT: max = pc_maxparameter(sd->class_,sd->status.sex,PARAM_INT); break;
+		case SP_DEX: max = pc_maxparameter(sd->class_,sd->status.sex,PARAM_DEX); break;
+		case SP_LUK: max = pc_maxparameter(sd->class_,sd->status.sex,PARAM_LUK); break;
+	}
 	val = pc_setstat(sd, type, cap_value(pc_getstat(sd,type) + val, 1, max));
 
 	status_calc_pc(sd,0);
@@ -7336,22 +7356,22 @@ int pc_setparam(struct map_session_data *sd,int type,int val)
 		}
 		break;
 	case SP_STR:
-		sd->status.str = cap_value(val, 1, pc_maxparameter(sd));
+		sd->status.str = cap_value(val, 1, pc_maxparameter(sd->class_,sd->status.sex,PARAM_STR));
 		break;
 	case SP_AGI:
-		sd->status.agi = cap_value(val, 1, pc_maxparameter(sd));
+		sd->status.agi = cap_value(val, 1, pc_maxparameter(sd->class_,sd->status.sex,PARAM_AGI));
 		break;
 	case SP_VIT:
-		sd->status.vit = cap_value(val, 1, pc_maxparameter(sd));
+		sd->status.vit = cap_value(val, 1, pc_maxparameter(sd->class_,sd->status.sex,PARAM_VIT));
 		break;
 	case SP_INT:
-		sd->status.int_ = cap_value(val, 1, pc_maxparameter(sd));
+		sd->status.int_ = cap_value(val, 1, pc_maxparameter(sd->class_,sd->status.sex,PARAM_INT));
 		break;
 	case SP_DEX:
-		sd->status.dex = cap_value(val, 1, pc_maxparameter(sd));
+		sd->status.dex = cap_value(val, 1, pc_maxparameter(sd->class_,sd->status.sex,PARAM_DEX));
 		break;
 	case SP_LUK:
-		sd->status.luk = cap_value(val, 1, pc_maxparameter(sd));
+		sd->status.luk = cap_value(val, 1, pc_maxparameter(sd->class_,sd->status.sex,PARAM_LUK));
 		break;
 	case SP_KARMA:
 		sd->status.karma = val;
@@ -9833,19 +9853,30 @@ static bool pc_readdb_levelpenalty(char* fields[], int columns, int current)
 }
 #endif
 
+/** [Cydh]
+* Calculates base hp of player. Reference: http://irowiki.org/wiki/Max_HP
+* @param level Base level of player
+* @param idx Index of class
+* @return base_hp
+*/
+unsigned int pc_calc_basehp(uint16 level, uint16 class_idx) {
+	double base_hp;
+	uint16 i;
+
+	base_hp = 35 + level * (job_info[class_idx].hp_multiplicator/100.);
+	for (i = 2; i <= level; i++)
+		base_hp += floor(((job_info[class_idx].hp_factor/100.) * i) + 0.5);
+	return (unsigned int)base_hp;
+}
 
 //Reading job_db1.txt line, (class,weight,HPFactor,HPMultiplicator,SPFactor,aspd/lvl...)
 static bool pc_readdb_job1(char* fields[], int columns, int current){
 	int idx, class_;
 	unsigned int i;
-#ifndef HP_SP_TABLES
-	unsigned int k = 0, val;
-#endif
 
 	class_ = atoi(fields[0]);
 
-	if(!pcdb_checkid(class_))
-	{
+	if (!pcdb_checkid(class_)) {
 		ShowWarning("status_readdb_job1: Invalid job class %d specified.\n", class_);
 		return false;
 	}
@@ -9855,6 +9886,7 @@ static bool pc_readdb_job1(char* fields[], int columns, int current){
 	job_info[idx].hp_factor  = atoi(fields[2]);
 	job_info[idx].hp_multiplicator = atoi(fields[3]);
 	job_info[idx].sp_factor  = atoi(fields[4]);
+
 #ifdef RENEWAL_ASPD
 	for(i = 0; i <= MAX_WEAPON_TYPE; i++)
 #else
@@ -9864,19 +9896,6 @@ static bool pc_readdb_job1(char* fields[], int columns, int current){
 		job_info[idx].aspd_base[i] = atoi(fields[i+5]);
 	}
 
-#ifndef HP_SP_TABLES
-	for(i = 0; i <= MAX_LEVEL; i++) {
-		k += (job_info[idx].hp_factor*(i+1) + 50) / 100;
-		val = 35 + ((i+1)*job_info[idx].hp_multiplicator)/100 + k;
-		val = min(INT_MAX,val);
-		job_info[idx].hp_table[i] = val;
-	}
-	for(i = 0; i <= MAX_LEVEL; i++) {
-		val = 10 + ((i+1)*job_info[idx].sp_factor)/100;
-		val = min(INT_MAX,val);
-		job_info[idx].sp_table[i] = val;
-	}
-#endif
 	return true;
 }
 
@@ -9901,95 +9920,6 @@ static bool pc_readdb_job2(char* fields[], int columns, int current)
 	return true;
 }
 
-//Reading job_maxhpsp.txt line
-//startlvl,maxlvl,class,type,values...
-#ifdef HP_SP_TABLES
-static bool pc_readdb_job_maxhpsp(char* fields[], int columns, int current)
-{
-	int idx, i,j, maxlvl, startlvl;
-	int job_id,job_count,jobs[CLASS_COUNT];
-	int type;
-
-	startlvl = atoi(fields[0]);
-	if(startlvl > MAX_LEVEL || startlvl<1){
-		ShowError("pc_readdb_job_maxhpsp: Invalid start level %d specified.\n", startlvl);
-		return false;
-	}
-	maxlvl = atoi(fields[1]);
-	if(maxlvl > MAX_LEVEL || maxlvl<1){
-		ShowError("pc_readdb_job_maxhpsp: Invalid max level %d specified.\n", maxlvl);
-		return false;
-	}
-	if((maxlvl-startlvl+1+4) != columns){ //nb values = (maxlvl-startlvl)+1-index1stvalue
-		ShowError("pc_readdb_job_maxhpsp: Number of columns %d defined is too low for start level %d, max level %d.\n",columns,startlvl,maxlvl);
-		return false;
-	}
-	type = atoi(fields[3]);
-	if(type < 0 || type > 1){
-		ShowError("pc_readdb_job_maxhpsp: Invalid type %d specified.\n", type);
-		return false;
-	}
-
-	job_count = pc_split_atoi(fields[2],jobs,':',CLASS_COUNT);
-	if (job_count < 1)
-		return false;
-	for (j = 0; j < job_count; j++) {
-		job_id = jobs[j];
-		if(!pcdb_checkid(job_id)){
-			ShowError("pc_readdb_job_maxhpsp: Invalid job class %d specified.\n", job_id);
-			return false;
-		}
-		idx = pc_class2idx(job_id);
-		if(type == 0) {	//hp type
-			unsigned int k = 0, val, oldval=0;
-			short level = 0;
-			for(i = 0; i <= MAX_LEVEL; i++) {
-				val = 0;
-				k += (job_info[idx].hp_factor*(i+1) + 50) / 100;
-				if(i>=startlvl && i <= maxlvl) val = atoi(fields[(i-level)+4]);
-				if(val==0) {
-					val = 35 + ((i+1)*job_info[idx].hp_multiplicator)/100 + k;
-					level++; // This tells us when we didn't use the database so we know what field to grab
-				}
-				if(oldval > val && i > startlvl && i <= maxlvl) // Let's not warn about the formula table giving us a higher value, only DB
-					ShowWarning("pc_readdb_job_maxhpsp: HP value is lower than previous level (job=%d,oldval=%d,val=%d,lvl=%d hp_factor=%d,hp_multiplicator=%d,k=%d).\n",
-						job_id,oldval,val,i+1,job_info[idx].hp_factor,job_info[idx].hp_multiplicator,k);
-				val = min(INT_MAX,val);
-				job_info[idx].hp_table[i] = val;
-				oldval = val;
-			}
-	//		ShowInfo("Finished reading HP table for job %d.\n{",job_id);
-	//		for(i=0; i<=MAX_LEVEL; i++ )
-	//			printf("%d,",job_info[idx].hp_table[i]);
-	//		printf("\n}\n");
-		}
-		else if(type == 1){ //sp type
-			unsigned int val, oldval=0;
-			short level = 0;
-			for(i = 0; i <= MAX_LEVEL; i++) {
-				val = 0;
-				if(i>=startlvl && i <=maxlvl) val = atoi(fields[(i-level)+4]);
-				if(val==0) {
-					val = 10 + ((i+1)*job_info[idx].sp_factor)/100;
-					level++; // This tells us when we didn't use the database so we know what field to grab
-				}
-				if(oldval > val && i > startlvl && i <= maxlvl) // Let's not warn about the formula table giving us a higher value, only DB
-					ShowWarning("pc_readdb_job_maxhpsp: SP value is lower than previous level (job=%d,oldval=%d,val=%d,lvl=%d,sp_factor=%d).\n",
-						job_id,oldval,val,i+1,job_info[idx].sp_factor);
-				val = min(INT_MAX,val);
-				job_info[idx].sp_table[i] = val;
-				oldval = val;
-			}
-	//		ShowInfo("Finished reading SP table for job %d.\n{",job_id);
-	//		for(i=0; i<MAX_LEVEL; i++ )
-	//			printf("%d,",job_info[idx].sp_table[i]);
-	//		printf("\n}\n");
-		}
-	}
-	return true;
-}
-#endif
-
 //Reading job_exp.txt line
 //Max Level,Class list,Type (0 - Base Exp; 1 - Job Exp),Exp/lvl...
 static bool pc_readdb_job_exp(char* fields[], int columns, int current)
@@ -10023,8 +9953,11 @@ static bool pc_readdb_job_exp(char* fields[], int columns, int current)
 	idx = pc_class2idx(job_id);
 
 	job_info[idx].max_level[type] = maxlvl;
-	for(i=0; i<maxlvl; i++){
+	for(i=0; i<maxlvl; i++) {
 		job_info[idx].exp_table[type][i] = ((uint32) atoi(fields[3+i]));
+		//Place the BaseHP/SP calculation here, so we can use the maxlevel from job_exp
+		job_info[idx].base_hp[i] = pc_calc_basehp(i+1,idx);
+		job_info[idx].base_sp[i] = 10 + ((i+1) * (job_info[idx].sp_factor/100));
 	}
 	//Reverse check in case the array has a bunch of trailing zeros... [Skotlex]
 	//The reasoning behind the -2 is this... if the max level is 5, then the array
@@ -10043,6 +9976,7 @@ static bool pc_readdb_job_exp(char* fields[], int columns, int current)
 	}
 //	ShowInfo("%s - Class %d: %d\n", type?"Job":"Base", job_id, job_info[idx].max_level[type]);
 	for (i = 1; i < job_count; i++) {
+		uint16 j;
 		job_id = jobs[i];
 		if (!pcdb_checkid(job_id)) {
 			ShowError("pc_readdb_job_exp: Invalid job ID %d.\n", job_id);
@@ -10050,12 +9984,132 @@ static bool pc_readdb_job_exp(char* fields[], int columns, int current)
 		}
 		idx = pc_class2idx(job_id);
 		memcpy(job_info[idx].exp_table[type], job_info[pc_class2idx(jobs[0])].exp_table[type], sizeof(job_info[pc_class2idx(jobs[0])].exp_table[type]));
+
+		//Place the BaseHP/SP calculation here, so we can use the maxlevel from job_exp
+		for (j = 0; j < maxlvl; j++) {
+			job_info[idx].base_hp[j] = pc_calc_basehp(j+1,idx);
+			job_info[idx].base_sp[j] = 10 + ((j+1) * (job_info[idx].sp_factor/100));
+		}
+
 		job_info[idx].max_level[type] = maxlvl;
 //		ShowInfo("%s - Class %d: %u\n", type?"Job":"Base", job_id, job_info[idx].max_level[type]);
 	}
 	return true;
 }
 
+/**
+* #ifdef HP_SP_TABLES, reads 'job_basehpsp_db.txt to replace hp/sp results from formula
+* startlvl,endlvl,class,type,values...
+*/
+#ifdef HP_SP_TABLES
+static bool pc_readdb_job_basehpsp(char* fields[], int columns, int current)
+{
+	int i, startlvl, endlvl;
+	int job_count,jobs[CLASS_COUNT];
+	short type;
+
+	startlvl = atoi(fields[0]);
+	if(startlvl<1){
+		ShowError("pc_readdb_job_basehpsp: Invalid start level %d specified.\n", startlvl);
+		return false;
+	}
+	endlvl = atoi(fields[1]);
+	if(endlvl<1 || endlvl<startlvl){
+		ShowError("pc_readdb_job_basehpsp: Invalid end level %d specified.\n", endlvl);
+		return false;
+	}
+	if((endlvl-startlvl+1+4) > columns){ //nb values = (maxlvl-startlvl)+1-index1stvalue
+		ShowError("pc_readdb_job_basehpsp: Number of columns %d (needs %d) defined is too low for start level %d, max level %d.\n",columns,(endlvl-startlvl+1+4),startlvl,endlvl);
+		return false;
+	}
+	type = atoi(fields[3]);
+	if(type < 0 || type > 1){
+		ShowError("pc_readdb_job_basehpsp: Invalid type %d specified.\n", type);
+		return false;
+	}
+
+	job_count = pc_split_atoi(fields[2],jobs,':',CLASS_COUNT);
+	if (job_count < 1)
+		return false;
+
+	for (i = 0; i < job_count; i++) {
+		int idx, job_id = jobs[i], use_endlvl;
+		if (!pcdb_checkid(job_id)) {
+			ShowError("pc_readdb_job_basehpsp: Invalid job class %d specified.\n", job_id);
+			return false;
+		}
+		idx = pc_class2idx(job_id);
+		if (startlvl > job_info[idx].max_level[0]) {
+			ShowError("pc_readdb_job_basehpsp: Invalid start level %d specified.\n", startlvl);
+			return false;
+		}
+		//Just read until available max level for this job, don't use MAX_LEVEL!
+		use_endlvl = endlvl;
+		if (use_endlvl > job_info[idx].max_level[0])
+			use_endlvl = job_info[idx].max_level[0];
+		
+		if(type == 0) {	//hp type
+			uint16 j;
+			for(j = 0; j < use_endlvl; j++) {
+				if (atoi(fields[j+4])) {
+					uint16 lvl_idx = startlvl-1+j;
+					job_info[idx].base_hp[lvl_idx] = atoi(fields[j+4]);
+					//Tells if this HP is lower than previous level
+					if (lvl_idx-1 >= 0 && job_info[idx].base_hp[lvl_idx] < job_info[idx].base_hp[lvl_idx-1])
+						ShowWarning("pc_readdb_job_basehpsp: HP value at line %d col %d is lower than previous level (job=%d,lvl=%d,oldval=%d,val=%d).\n",
+							current,j+4,job_id,lvl_idx+1,job_info[idx].base_hp[lvl_idx-1],job_info[idx].base_hp[lvl_idx]);
+				}
+			}
+		}
+		else { //sp type
+			uint16 j;
+			for(j = 0; j < use_endlvl; j++) {
+				if (atoi(fields[j+4])) {
+					uint16 lvl_idx = startlvl-1+j;
+					job_info[idx].base_sp[lvl_idx] = atoi(fields[j+4]);
+					//Tells if this SP is lower than previous level
+					if (lvl_idx-1 >= 0 && job_info[idx].base_sp[lvl_idx] < job_info[idx].base_sp[lvl_idx-1])
+						ShowWarning("pc_readdb_job_basehpsp: SP value at line %d col %d is lower than previous level (job=%d,lvl=%d,oldval=%d,val=%d).\n",
+							current,j+4,job_id,lvl_idx+1,job_info[idx].base_sp[lvl_idx-1],job_info[idx].base_sp[lvl_idx]);
+				}
+			}
+		}
+	}
+	return true;
+}
+#endif
+
+/** [Cydh]
+* Reads 'job_param_db.txt' to check max. param each job and store them to job_info[].max_param.*
+*/
+static bool pc_readdb_job_param(char* fields[], int columns, int current)
+{
+	int idx, class_;
+	uint16 str, agi, vit, int_, dex, luk;
+
+	script_get_constant(trim(fields[0]),&class_);
+
+	if ((idx = pc_class2idx(class_)) < 0) {
+		ShowError("pc_readdb_job_param: Invalid job '%s'. Skipping!",fields[0]);
+		return false;
+	}
+	str = cap_value(atoi(fields[1]),10,SHRT_MAX);
+	agi = atoi(fields[2]) ? cap_value(atoi(fields[2]),10,SHRT_MAX) : str;
+	vit = atoi(fields[3]) ? cap_value(atoi(fields[3]),10,SHRT_MAX) : str;
+	int_ = atoi(fields[4]) ? cap_value(atoi(fields[4]),10,SHRT_MAX) : str;
+	dex = atoi(fields[5]) ? cap_value(atoi(fields[5]),10,SHRT_MAX) : str;
+	luk = atoi(fields[6]) ? cap_value(atoi(fields[6]),10,SHRT_MAX) : str;
+
+	job_info[idx].max_param.str = str;
+	job_info[idx].max_param.agi = agi;
+	job_info[idx].max_param.vit = vit;
+	job_info[idx].max_param.int_ = int_;
+	job_info[idx].max_param.dex = dex;
+	job_info[idx].max_param.luk = luk;
+	
+	return true;
+}
+
 /*==========================================
  * pc DB reading.
  * job_exp.txt		- required experience values
@@ -10067,14 +10121,13 @@ static bool pc_readdb_job_exp(char* fields[], int columns, int current)
  *------------------------------------------*/
 int pc_readdb(void)
 {
-	int i,k, entries;
+	int i, k, entries;
 	FILE *fp;
 	char line[24000];
 
 	//reset
 	memset(job_info,0,sizeof(job_info)); // job_info table
 
-
 	// Reset and read skilltree
 	memset(skill_tree,0,sizeof(skill_tree));
 	sv_readdb(db_path, DBPATH"skill_tree.txt", ',', 3+MAX_PC_SKILL_REQUIRE*2, 4+MAX_PC_SKILL_REQUIRE*2, -1, &pc_readdb_skilltree);
@@ -10138,21 +10191,22 @@ int pc_readdb(void)
 	sv_readdb(db_path, "pre-re/job_db1.txt",',',5+MAX_WEAPON_TYPE,5+MAX_WEAPON_TYPE,CLASS_COUNT,&pc_readdb_job1);
 #endif
 	sv_readdb(db_path, "job_db2.txt",',',1,1+MAX_LEVEL,CLASS_COUNT,&pc_readdb_job2);
+	sv_readdb(db_path, DBPATH"job_exp.txt",',',4,1000+3,CLASS_COUNT*2,&pc_readdb_job_exp); //support till 1000lvl
 #ifdef HP_SP_TABLES
-	sv_readdb(db_path, DBPATH"job_maxhpsp_db.txt", ',', 4, 4+MAX_LEVEL, CLASS_COUNT*2, &pc_readdb_job_maxhpsp);
+	sv_readdb(db_path, DBPATH"job_basehpsp_db.txt", ',', 4, 4+500, CLASS_COUNT*2, &pc_readdb_job_basehpsp); //Make it support until lvl 500!
 #endif
-	sv_readdb(db_path, DBPATH"job_exp.txt",',',4,1000+3,CLASS_COUNT*2,&pc_readdb_job_exp); //support till 1000lvl
+	sv_readdb(db_path, DBPATH"job_param_db.txt", ',', 2, PARAM_MAX+1, CLASS_COUNT, &pc_readdb_job_param);
 	
 	//Checking if all class have their data
 	for (i = 0; i < JOB_MAX; i++) {
-		int j;
+		int idx;
 		if (!pcdb_checkid(i)) continue;
 		if (i == JOB_WEDDING || i == JOB_XMAS || i == JOB_SUMMER || i == JOB_HANBOK)
 			continue; //Classes that do not need exp tables.
-		j = pc_class2idx(i);
-		if (!job_info[j].max_level[0])
+		idx = pc_class2idx(i);
+		if (!job_info[idx].max_level[0])
 			ShowWarning("Class %s (%d) does not have a base exp table.\n", job_name(i), i);
-		if (!job_info[j].max_level[1])
+		if (!job_info[idx].max_level[1])
 			ShowWarning("Class %s (%d) does not have a job exp table.\n", job_name(i), i);
 	}
  	return 0;
@@ -10493,6 +10547,38 @@ void pc_cell_basilica(struct map_session_data *sd) {
 		sc_start(&sd->bl,&sd->bl,SC_BASILICA,100,0,-1);
 }
 
+/** [Cydh]
+ * Get maximum specified parameter for specified class
+ * @param class_: sd->class
+ * @param sex: sd->status.sex
+ * @param flag: parameter will be checked
+ * @return max_param
+ */
+short pc_maxparameter(int class_, int sex, enum e_params param) {
+	short max_param = 0;
+	int idx = -1;
+
+	max_param = ((class_&MAPID_UPPERMASK) == MAPID_KAGEROUOBORO || (class_&MAPID_UPPERMASK) == MAPID_REBELLION) ? battle_config.max_extended_parameter :
+		((class_&JOBL_THIRD) ? ((class_&JOBL_UPPER) ? battle_config.max_third_trans_parameter : ((class_&JOBL_BABY) ? battle_config.max_baby_third_parameter : battle_config.max_third_parameter)) : 
+		((class_&JOBL_BABY) ? battle_config.max_baby_parameter :
+		((class_&JOBL_UPPER) ? battle_config.max_trans_parameter : battle_config.max_parameter)));
+
+	if ((idx = pc_class2idx(pc_mapid2jobid(class_,sex))) >= 0) {
+		short max_param_ = 0;
+		switch (param) {
+			case PARAM_STR: max_param_ = job_info[idx].max_param.str; break;
+			case PARAM_AGI: max_param_ = job_info[idx].max_param.agi; break;
+			case PARAM_VIT: max_param_ = job_info[idx].max_param.vit; break;
+			case PARAM_INT: max_param_ = job_info[idx].max_param.int_; break;
+			case PARAM_DEX: max_param_ = job_info[idx].max_param.dex; break;
+			case PARAM_LUK: max_param_ = job_info[idx].max_param.luk; break;
+		}
+		if (max_param_ > 0)
+			return max_param_;
+	}
+	return max_param;
+}
+
 /*==========================================
  * pc Init/Terminate
  *------------------------------------------*/

+ 22 - 5
src/map/pc.h

@@ -347,6 +347,7 @@ struct map_session_data {
 	// manually zeroed structures end here.
 	// zeroed vars start here.
 	struct {
+		int hp, sp;
 		int atk_rate;
 		int arrow_atk,arrow_ele,arrow_cri,arrow_hit;
 		int nsshealhp,nsshealsp;
@@ -648,10 +649,8 @@ enum equip_pos {
 };
 
 struct {
-	int hp_table[MAX_LEVEL];
-	int sp_table[MAX_LEVEL];
-	int hp_factor, hp_multiplicator;
-	int sp_factor;
+	unsigned int base_hp[MAX_LEVEL], base_sp[MAX_LEVEL]; //Storage for the first calculation with hp/sp factor and multiplicator
+	int hp_factor, hp_multiplicator, sp_factor;
 	int max_weight_base;
 	char job_bonus[MAX_LEVEL];
 #ifdef RENEWAL_ASPD
@@ -661,6 +660,9 @@ struct {
 #endif
 	uint32 exp_table[2][MAX_LEVEL];
 	uint32 max_level[2];
+	struct s_params {
+		uint16 str, agi, vit, int_, dex, luk;
+	} max_param;
 } job_info[CLASS_COUNT];
 
 #define EQP_WEAPON EQP_HAND_R
@@ -711,7 +713,19 @@ struct {
 #define pc_isinvisible(sd)    ( (sd)->sc.option&OPTION_INVISIBLE )
 #define pc_is50overweight(sd) ( (sd)->weight*100 >= (sd)->max_weight*battle_config.natural_heal_weight_rate )
 #define pc_is90overweight(sd) ( (sd)->weight*10 >= (sd)->max_weight*9 )
-#define pc_maxparameter(sd)   ( ((((sd)->class_&MAPID_UPPERMASK) == MAPID_KAGEROUOBORO) || ((sd)->class_&MAPID_UPPERMASK) == MAPID_REBELLION || (sd)->class_&JOBL_THIRD ? ((sd)->class_&JOBL_BABY ? battle_config.max_baby_third_parameter : battle_config.max_third_parameter) : ((sd)->class_&JOBL_BABY ? battle_config.max_baby_parameter : battle_config.max_parameter)) )
+
+/// Enum of Player's Parameter
+enum e_params {
+	PARAM_STR = 0,
+	PARAM_AGI,
+	PARAM_VIT,
+	PARAM_INT,
+	PARAM_DEX,
+	PARAM_LUK,
+	PARAM_MAX
+};
+short pc_maxparameter(int class_, int sex, enum e_params param);
+
 /**
  * Ranger
  **/
@@ -1056,6 +1070,9 @@ void pc_bonus_script_clear(struct map_session_data *sd, uint16 flag);
 
 void pc_cell_basilica(struct map_session_data *sd);
 
+unsigned int pc_get_maxhp(uint16 level, uint16 class_, uint16 vit, int bonus, int bonus_rate);
+unsigned int pc_get_maxsp(uint16 level, uint16 class_, uint16 int_, int bonus, int bonus_rate);
+
 #if defined(RENEWAL_DROP) || defined(RENEWAL_EXP)
 int pc_level_penalty_mod(struct map_session_data *sd, int mob_level, uint32 mob_race, uint32 mob_mode, int type);
 #endif

+ 317 - 218
src/map/status.c

@@ -71,6 +71,41 @@ static int StatusSkillChangeTable[SC_MAX];         /// status -> skill
 static int StatusRelevantBLTypes[SI_MAX];          /// "icon" -> enum bl_type (for clif_status_change to identify for which bl types to send packets)
 static unsigned int StatusChangeStateTable[SC_MAX]; /// status -> flags
 
+static unsigned short status_calc_str(struct block_list *,struct status_change *,int);
+static unsigned short status_calc_agi(struct block_list *,struct status_change *,int);
+static unsigned short status_calc_vit(struct block_list *,struct status_change *,int);
+static unsigned short status_calc_int(struct block_list *,struct status_change *,int);
+static unsigned short status_calc_dex(struct block_list *,struct status_change *,int);
+static unsigned short status_calc_luk(struct block_list *,struct status_change *,int);
+static unsigned short status_calc_batk(struct block_list *,struct status_change *,int);
+static unsigned short status_calc_watk(struct block_list *,struct status_change *,int);
+static unsigned short status_calc_matk(struct block_list *,struct status_change *,int);
+static signed short status_calc_hit(struct block_list *,struct status_change *,int);
+static signed short status_calc_critical(struct block_list *,struct status_change *,int);
+static signed short status_calc_flee(struct block_list *,struct status_change *,int);
+static signed short status_calc_flee2(struct block_list *,struct status_change *,int);
+static defType status_calc_def(struct block_list *bl, struct status_change *sc, int);
+static signed short status_calc_def2(struct block_list *,struct status_change *,int);
+static defType status_calc_mdef(struct block_list *bl, struct status_change *sc, int);
+static signed short status_calc_mdef2(struct block_list *,struct status_change *,int);
+static unsigned short status_calc_speed(struct block_list *,struct status_change *,int);
+static short status_calc_aspd_rate(struct block_list *,struct status_change *,int);
+static unsigned short status_calc_dmotion(struct block_list *bl, struct status_change *sc, int dmotion);
+#ifdef RENEWAL_ASPD
+static short status_calc_aspd(struct block_list *bl, struct status_change *sc, short flag);
+#endif
+static short status_calc_fix_aspd(struct block_list *bl, struct status_change *sc, int);
+static unsigned int status_calc_maxhp(struct block_list *bl, uint64 maxhp);
+static unsigned int status_calc_maxsp(struct block_list *bl, uint64 maxsp);
+static unsigned char status_calc_element(struct block_list *bl, struct status_change *sc, int element);
+static unsigned char status_calc_element_lv(struct block_list *bl, struct status_change *sc, int lv);
+static unsigned short status_calc_mode(struct block_list *bl, struct status_change *sc, int mode);
+#ifdef RENEWAL
+static unsigned short status_calc_ematk(struct block_list *,struct status_change *,int);
+#endif
+static int status_get_hpbonus(struct block_list *bl, enum e_status_bonus type);
+static int status_get_spbonus(struct block_list *bl, enum e_status_bonus type);
+static unsigned int status_calc_maxhpsp_pc(struct map_session_data *sd, uint8 flag);
 
 /**
  * Returns the status change associated with a skill.
@@ -2326,7 +2361,7 @@ int status_calc_pet_(struct pet_data *pd, bool first)
 
 		if(battle_config.pet_attack_support || battle_config.pet_damage_support) {
 			// Attack support requires the pet to be able to attack
-			pd->status.mode|= MD_CANATTACK;
+			pd->status.mode |= MD_CANATTACK;
 		}
 	}
 
@@ -2379,52 +2414,221 @@ int status_calc_pet_(struct pet_data *pd, bool first)
 	return 1;
 }
 
-/**
-* Modifies max HP based on job bonuses (pc_init_maxhpsp) <- GET REAL NAME
-* @param sd: Player object
-* @param status: Player status
-* @return HP value after job bonuses
-**/
-static unsigned int status_base_pc_maxhp(struct map_session_data* sd, struct status_data* status)
-{
-	uint32 val = job_info[pc_class2idx(sd->status.class_)].hp_table[sd->status.base_level-1];
-
-	if((sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON && sd->status.base_level >= 90 && pc_famerank(sd->status.char_id, MAPID_TAEKWON))
-		val *= 3; // Triple max HP for top ranking Taekwons over level 90.
-	if((sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE && sd->status.base_level >= 99)
-		val += 2000; // Supernovice lvl99 hp bonus.
-	if((sd->class_&MAPID_UPPERMASK) == MAPID_REBELLION)
-		val += 100; // Since Rebellion's HP can't be approximated well enough without this.
-
-	val += val * status->vit/100; // +1% per each point of VIT
-
-	if (sd->class_&JOBL_UPPER)
-		val += val * 25/100; // Trans classes get a 25% hp bonus
-	else if (sd->class_&JOBL_BABY)
-		val -= val * 30/100; // Baby classes get a 30% hp penalty
-	return (unsigned int)val;
+/** [Cydh]
+* Get HP bonus modifiers
+* @param bl: block_list that will be checked
+* @param type: type of e_status_bonus (STATUS_BONUS_FIX or STATUS_BONUS_RATE)
+* @return bonus: total bonus for HP
+*/
+static int status_get_hpbonus(struct block_list *bl, enum e_status_bonus type) {
+	int bonus = 0;
+
+	if (type == STATUS_BONUS_FIX) {
+		struct status_change *sc = status_get_sc(bl);
+		
+		//Only for BL_PC
+		if (bl->type == BL_PC) {
+			struct map_session_data *sd = map_id2sd(bl->id);
+			int i;
+
+			bonus += sd->bonus.hp;
+			if ((i=pc_checkskill(sd,CR_TRUST)) > 0)
+				bonus += i * 200;
+			if ((sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON && sd->status.base_level >= 90 && pc_famerank(sd->status.char_id, MAPID_TAEKWON))
+				bonus *= 3; // Triple max HP for top ranking Taekwons over level 90.
+			if ((sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE && sd->status.base_level >= 99)
+				bonus += 2000; // Supernovice lvl99 hp bonus.
+		}
+		
+		//Bonus by SC
+		if (sc) {
+			if(sc->data[SC_INCMHP])
+				bonus += sc->data[SC_INCMHP]->val1;
+			if(sc->data[SC_EARTH_INSIGNIA] && sc->data[SC_EARTH_INSIGNIA]->val1 == 2)
+				bonus += 500;
+			if(sc->data[SC_LERADSDEW])
+				bonus += sc->data[SC_LERADSDEW]->val3;
+			if(sc->data[SC_INSPIRATION])
+				bonus += (600 * sc->data[SC_INSPIRATION]->val1);
+			if(sc->data[SC_FRIGG_SONG])
+				bonus += sc->data[SC_FRIGG_SONG]->val2;
+			if(sc->data[SC_SOLID_SKIN_OPTION])
+				bonus += 2000;
+			if(sc->data[SC_MARIONETTE])
+				bonus -= 1000;
+		}
+	}
+	else if (type == STATUS_BONUS_RATE) {
+		struct status_change *sc = status_get_sc(bl);
+		
+		//Only for BL_PC
+		if (bl->type == BL_PC) {
+			struct map_session_data *sd = map_id2sd(bl->id);
+			bonus += sd->hprate;
+			bonus -= 100; //Default hprate is 100, so it should be add 0%
+
+			//+200% for top ranking Taekwons over level 90.
+			if ((sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON && sd->status.base_level >= 90 && pc_famerank(sd->status.char_id,MAPID_TAEKWON))
+				bonus += 200;
+		}
+
+		//Bonus by SC
+		if (sc) {
+			//Increasing
+			if(sc->data[SC_INCMHPRATE])
+				bonus += sc->data[SC_INCMHPRATE]->val1;
+			if(sc->data[SC_APPLEIDUN])
+				bonus += sc->data[SC_APPLEIDUN]->val2;
+			if(sc->data[SC_DELUGE])
+				bonus += sc->data[SC_DELUGE]->val2;
+			if(sc->data[SC_BERSERK])
+				bonus += 200; //+200%
+			if(sc->data[SC_MERC_HPUP])
+				bonus += sc->data[SC_MERC_HPUP]->val2;
+			if(sc->data[SC_EPICLESIS])
+				bonus += sc->data[SC_EPICLESIS]->val2;
+			if(sc->data[SC_FORCEOFVANGUARD])
+				bonus += (3 * sc->data[SC_FORCEOFVANGUARD]->val1);
+			if(sc->data[SC_INSPIRATION])
+				bonus += (5 * sc->data[SC_INSPIRATION]->val1);
+			if(sc->data[SC_RAISINGDRAGON])
+				bonus += (2 + sc->data[SC_RAISINGDRAGON]->val1);
+			if(sc->data[SC_GT_REVITALIZE])
+				bonus += (2 * sc->data[SC_GT_REVITALIZE]->val1);
+			if(sc->data[SC_MUSTLE_M])
+				bonus += sc->data[SC_MUSTLE_M]->val1;
+			if(sc->data[SC_ANGRIFFS_MODUS])
+				bonus += (5 * sc->data[SC_ANGRIFFS_MODUS]->val1);
+			if(sc->data[SC_PETROLOGY_OPTION])
+				bonus += sc->data[SC_PETROLOGY_OPTION]->val2;
+			if(sc->data[SC_POWER_OF_GAIA])
+				bonus += sc->data[SC_POWER_OF_GAIA]->val2;
+			if(sc->data[SC_CURSED_SOIL_OPTION])
+				bonus += sc->data[SC_CURSED_SOIL_OPTION]->val2;
+	
+			//Decreasing
+			if(sc->data[SC_VENOMBLEED])
+				bonus -= 15;
+			if(sc->data[SC__WEAKNESS])
+				bonus -= sc->data[SC__WEAKNESS]->val2;
+			if(sc->data[SC_MYSTERIOUS_POWDER])
+				bonus -= sc->data[SC_MYSTERIOUS_POWDER]->val1;
+			if(sc->data[SC_GT_CHANGE]) // Max HP decrease: [Skill Level x 4] %
+				bonus -= (4 * sc->data[SC_GT_CHANGE]->val1);
+			if(sc->data[SC_EQC])
+				bonus -= sc->data[SC_EQC]->val4;
+		}
+	}
+
+	return min(bonus,INT_MAX);
+}
+
+/** [Cydh]
+* Get SP bonus modifiers
+* @param bl: block_list that will be checked
+* @param type: type of e_status_bonus (STATUS_BONUS_FIX or STATUS_BONUS_RATE)
+* @return bonus: total bonus for SP
+*/
+static int status_get_spbonus(struct block_list *bl, enum e_status_bonus type) {
+	int bonus = 0;
+
+	if (type == STATUS_BONUS_FIX) {
+		struct status_change *sc = status_get_sc(bl);
+		
+		//Only for BL_PC
+		if (bl->type == BL_PC) {
+			struct map_session_data *sd = map_id2sd(bl->id);
+			int i;
+
+			bonus += sd->bonus.sp;
+			if ((i=pc_checkskill(sd,SL_KAINA)) > 0)
+				bonus += 30 * i;
+			if ((i = pc_checkskill(sd,RA_RESEARCHTRAP)) > 0)
+				bonus += 200 + 20 * i;
+		}
+		
+		//Bonus by SC
+		if (sc) {
+			if(sc->data[SC_INCMSP])
+				bonus += (sc->data[SC_INCMSP]->val1);
+			if(sc->data[SC_EARTH_INSIGNIA] && sc->data[SC_EARTH_INSIGNIA]->val1 == 3)
+				bonus += 50;
+		}
+	}
+	else if (type == STATUS_BONUS_RATE) {
+		struct status_change *sc = status_get_sc(bl);
+		
+		//Only for BL_PC
+		if (bl->type == BL_PC) {
+			struct map_session_data *sd = map_id2sd(bl->id);
+			int i;
+
+			bonus += sd->hprate;
+			bonus -= 100; //Default hprate is 100, so it should be add 0%
+
+			if((i=pc_checkskill(sd,HP_MEDITATIO)) > 0)
+				bonus += i;
+			if((i = pc_checkskill(sd,WM_LESSON)) > 0)
+				bonus += 30 * i;
+			if((i=pc_checkskill(sd,HW_SOULDRAIN)) > 0)
+				bonus += 2 * i;
+	
+			//+200% for top ranking Taekwons over level 90.
+			if ((sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON && sd->status.base_level >= 90 && pc_famerank(sd->status.char_id, MAPID_TAEKWON))
+				bonus += 200;
+		}
+
+		//Bonus by SC
+		if (sc) {
+			if(sc->data[SC_INCMSPRATE])
+				bonus += sc->data[SC_INCMSPRATE]->val1;
+			if(sc->data[SC_RAISINGDRAGON])
+				bonus += (2 + sc->data[SC_RAISINGDRAGON]->val1);
+			if(sc->data[SC_SERVICE4U])
+				bonus += sc->data[SC_SERVICE4U]->val2;
+			if(sc->data[SC_MERC_SPUP])
+				bonus += sc->data[SC_MERC_SPUP]->val2;
+			if(sc->data[SC_RAISINGDRAGON])
+				bonus += (2 + sc->data[SC_RAISINGDRAGON]->val1);
+			if(sc->data[SC_LIFE_FORCE_F])
+				bonus += sc->data[SC_LIFE_FORCE_F]->val1;
+		}
+	}
+
+	return min(bonus,INT_MAX);
 }
 
 /**
-* Modifies max SP based on job bonuses (pc_init_maxhpsp) <- GET REAL NAME
-* @param sd: Player object
-* @param status: Player status
-* @return SP value after job bonuses
+* Get final MaxHP or MaxSP for player. References: http://irowiki.org/wiki/Max_HP and http://irowiki.org/wiki/Max_SP
+* The calculation needs base_level, battle_status (vit or int), additive modifier, and multiplicative modifier
+* @param sd: Player
+* @param flag: 0=Calculates MaxHP, 1=Calculates MaxSP
+* @return max_hp: value
 **/
-static unsigned int status_base_pc_maxsp(struct map_session_data* sd, struct status_data *status)
+static unsigned int status_calc_maxhpsp_pc(struct map_session_data* sd, uint8 flag)
 {
-	uint32 val = job_info[pc_class2idx(sd->status.class_)].sp_table[sd->status.base_level-1];
+	double max = 0;
+	uint16 idx, level, job_id;
 
-	val += val * status->int_/100;
+	nullpo_ret(sd);
+	
+	job_id = pc_mapid2jobid(sd->class_,sd->status.sex);
+	idx = pc_class2idx(job_id);
+	level = max(sd->status.base_level,1);
 
-	if (sd->class_&JOBL_UPPER)
-		val += val * 25/100;
-	else if (sd->class_&JOBL_BABY)
-		val -= val * 30/100;
-	if ((sd->class_&MAPID_UPPERMASK) == MAPID_TAEKWON && sd->status.base_level >= 90 && pc_famerank(sd->status.char_id, MAPID_TAEKWON))
-		val *= 3; // Triple max SP for top ranking Taekwons over level 90.
+	if (flag == 0) { //Calculates MaxHP
+		max = floor(job_info[idx].base_hp[level-1] * (1 + (max(sd->battle_status.vit,1) * 0.01)) * ((sd->class_&JOBL_UPPER)?1.25:1));
+		max += status_get_hpbonus(&sd->bl,STATUS_BONUS_FIX);
+		max = floor(max * (1 + status_get_hpbonus(&sd->bl,STATUS_BONUS_RATE) * 0.01));
+	}
+	else if (flag == 1) { //Calculates MaxSP
+		max = floor(job_info[idx].base_sp[level-1] * (1 + (max(sd->battle_status.int_,1) * 0.01)));
+		max += status_get_spbonus(&sd->bl,STATUS_BONUS_FIX);
+		max = floor(max * (1 + status_get_spbonus(&sd->bl,STATUS_BONUS_RATE) * 0.01));
+		max = floor(max * ((sd->class_&JOBL_UPPER) ?1.25:1));
+	}
 
-	return (unsigned int)val;
+	return cap_value((unsigned int)max,1,UINT_MAX);
 }
 
 /**
@@ -2442,7 +2646,6 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
 	struct s_skill b_skill[MAX_SKILL]; ///< Previous skill tree
 	int b_weight, b_max_weight, b_cart_weight_max, ///< Previous weight
 	i, index, skill,refinedef=0;
-	int64 i64;
 
 	if (++calculating > 10) // Too many recursive calls!
 		return -1;
@@ -2903,23 +3106,8 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
 #endif
 
 // ----- HP MAX CALCULATION -----
-
-	// Basic MaxHP value
-	// We hold the standard Max HP here to make it faster to recalculate on vit changes.
-	sd->status.max_hp = status_base_pc_maxhp(sd,status);
-	// This is done to handle underflows from negative Max HP bonuses
-	i64 = sd->status.max_hp + (int)status->max_hp;
-	status->max_hp = (unsigned int)cap_value(i64, 0, INT_MAX);
-
-	// Absolute modifiers from passive skills
-	if((skill=pc_checkskill(sd,CR_TRUST))>0)
-		status->max_hp += skill*200;
-
-	// Apply relative modifiers from equipment
-	if(sd->hprate < 0)
-		sd->hprate = 0;
-	if(sd->hprate!=100)
-		status->max_hp = (int64)status->max_hp * sd->hprate/100;
+	sd->status.max_hp = status_calc_maxhpsp_pc(sd,0);
+	
 	if(battle_config.hp_rate != 100)
 		status->max_hp = (int64)status->max_hp * battle_config.hp_rate/100;
 
@@ -2929,31 +3117,8 @@ int status_calc_pc_(struct map_session_data* sd, bool first)
 		status->max_hp = 1;
 
 // ----- SP MAX CALCULATION -----
+	sd->status.max_sp = status_calc_maxhpsp_pc(sd,1);
 
-	// Basic MaxSP value
-	sd->status.max_sp = status_base_pc_maxsp(sd,status);
-	// This is done to handle underflows from negative Max SP bonuses
-	i64 = sd->status.max_sp + (int)status->max_sp;
-	status->max_sp = (unsigned int)cap_value(i64, 0, INT_MAX);
-
-	// Absolute modifiers from passive skills
-	if((skill=pc_checkskill(sd,SL_KAINA))>0)
-		status->max_sp += 30*skill;
-	if((skill=pc_checkskill(sd,HP_MEDITATIO))>0)
-		status->max_sp += (int64)status->max_sp * skill/100;
-	if((skill=pc_checkskill(sd,HW_SOULDRAIN))>0)
-		status->max_sp += (int64)status->max_sp * 2*skill/100;
-	if( (skill = pc_checkskill(sd,RA_RESEARCHTRAP)) > 0 )
-		status->max_sp += 200 + 20 * skill;
-	if( (skill = pc_checkskill(sd,WM_LESSON)) > 0 )
-		status->max_sp += 30 * skill;
-
-
-	// Apply relative modifiers from equipment
-	if(sd->sprate < 0)
-		sd->sprate = 0;
-	if(sd->sprate!=100)
-		status->max_sp = (int64)status->max_sp * sd->sprate/100;
 	if(battle_config.sp_rate != 100)
 		status->max_sp = (int64)status->max_sp * battle_config.sp_rate/100;
 
@@ -3508,39 +3673,6 @@ int status_calc_npc_(struct npc_data *nd, bool first)
 	return 0;
 }
 
-static unsigned short status_calc_str(struct block_list *,struct status_change *,int);
-static unsigned short status_calc_agi(struct block_list *,struct status_change *,int);
-static unsigned short status_calc_vit(struct block_list *,struct status_change *,int);
-static unsigned short status_calc_int(struct block_list *,struct status_change *,int);
-static unsigned short status_calc_dex(struct block_list *,struct status_change *,int);
-static unsigned short status_calc_luk(struct block_list *,struct status_change *,int);
-static unsigned short status_calc_batk(struct block_list *,struct status_change *,int);
-static unsigned short status_calc_watk(struct block_list *,struct status_change *,int);
-static unsigned short status_calc_matk(struct block_list *,struct status_change *,int);
-static signed short status_calc_hit(struct block_list *,struct status_change *,int);
-static signed short status_calc_critical(struct block_list *,struct status_change *,int);
-static signed short status_calc_flee(struct block_list *,struct status_change *,int);
-static signed short status_calc_flee2(struct block_list *,struct status_change *,int);
-static defType status_calc_def(struct block_list *bl, struct status_change *sc, int);
-static signed short status_calc_def2(struct block_list *,struct status_change *,int);
-static defType status_calc_mdef(struct block_list *bl, struct status_change *sc, int);
-static signed short status_calc_mdef2(struct block_list *,struct status_change *,int);
-static unsigned short status_calc_speed(struct block_list *,struct status_change *,int);
-static short status_calc_aspd_rate(struct block_list *,struct status_change *,int);
-static unsigned short status_calc_dmotion(struct block_list *bl, struct status_change *sc, int dmotion);
-#ifdef RENEWAL_ASPD
-static short status_calc_aspd(struct block_list *bl, struct status_change *sc, short flag);
-#endif
-static short status_calc_fix_aspd(struct block_list *bl, struct status_change *sc, int);
-static unsigned int status_calc_maxhp(struct block_list *,struct status_change *, uint64);
-static unsigned int status_calc_maxsp(struct block_list *,struct status_change *,unsigned int);
-static unsigned char status_calc_element(struct block_list *bl, struct status_change *sc, int element);
-static unsigned char status_calc_element_lv(struct block_list *bl, struct status_change *sc, int lv);
-static unsigned short status_calc_mode(struct block_list *bl, struct status_change *sc, int mode);
-#ifdef RENEWAL
-static unsigned short status_calc_ematk(struct block_list *,struct status_change *,int);
-#endif
-
 /**
 * Calculates regeneration values
 * Applies passive skill regeneration additions
@@ -3719,6 +3851,13 @@ void status_calc_regen_rate(struct block_list *bl, struct regen_data *regen, str
 		} else
 			regen->flag&=~sce->val4; // Remove regen as specified by val4
 	}
+	if (sc->data[SC_APPLEIDUN])
+		regen->rate.hp += sc->data[SC_APPLEIDUN]->val3;
+	if (sc->data[SC_EPICLESIS]) {
+		regen->rate.hp += sc->data[SC_EPICLESIS]->val3;
+		regen->rate.sp += sc->data[SC_EPICLESIS]->val4;
+	}
+
 	if(sc->data[SC_GT_REVITALIZE]) {
 		regen->hp = cap_value(regen->hp*sc->data[SC_GT_REVITALIZE]->val3/100, 1, SHRT_MAX);
 		regen->state.walk= 1;
@@ -4070,15 +4209,12 @@ void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag)
 
 	if(flag&SCB_MAXHP) {
 		if( bl->type&BL_PC ) {
-			status->max_hp = status_base_pc_maxhp(sd,status);
-			status->max_hp += b_status->max_hp - sd->status.max_hp;
-
-			status->max_hp = status_calc_maxhp(bl, sc, status->max_hp);
-
+			status->max_hp = status_calc_maxhpsp_pc(sd,0);
+			
 			if( status->max_hp > (unsigned int)battle_config.max_hp )
 				status->max_hp = (unsigned int)battle_config.max_hp;
 		} else
-			status->max_hp = status_calc_maxhp(bl, sc, b_status->max_hp);
+			status->max_hp = status_calc_maxhp(bl, b_status->max_hp);
 
 		if( status->hp > status->max_hp ) { // !FIXME: Should perhaps a status_zap should be issued?
 			status->hp = status->max_hp;
@@ -4088,15 +4224,12 @@ void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag)
 
 	if(flag&SCB_MAXSP) {
 		if( bl->type&BL_PC ) {
-			status->max_sp = status_base_pc_maxsp(sd,status);
-			status->max_sp += b_status->max_sp - sd->status.max_sp;
-
-			status->max_sp = status_calc_maxsp(&sd->bl, &sd->sc, status->max_sp);
-
+			status->max_sp = status_calc_maxhpsp_pc(sd,1);
+			
 			if( status->max_sp > (unsigned int)battle_config.max_sp )
 				status->max_sp = (unsigned int)battle_config.max_sp;
 		} else
-			status->max_sp = status_calc_maxsp(bl, sc, b_status->max_sp);
+			status->max_sp = status_calc_maxsp(bl, b_status->max_sp);
 
 		if( status->sp > status->max_sp ) {
 			status->sp = status->max_sp;
@@ -4293,9 +4426,9 @@ void status_calc_bl_(struct block_list* bl, enum scb_flag flag, bool first)
 		
 	if( bl->type == BL_PET )
 		return; // Pets are not affected by statuses
-
+	
 	status_calc_bl_main(bl, flag);
-
+	
 	if( first && bl->type == BL_HOM )
 		return; // Client update handled by caller
 
@@ -5999,110 +6132,43 @@ static unsigned short status_calc_dmotion(struct block_list *bl, struct status_c
 }
 
 /**
-* Calculates a player's max HP based on status changes
+* Calculates a max HP based on status changes
 * Values can either be percentages or fixed, based on how equations are formulated
 * Examples: maxhp += maxhp * value; (percentage increase)
-*	    maxhp -= value (fixed decrease)
-* @param bl: Object to change aspd [PC|MOB|HOM|MER|ELEM]
-* @param sc: Object's status change information
+* @param bl: Object's block_list data
 * @param maxhp: Object's current max HP
 * @return modified maxhp
 **/
-static unsigned int status_calc_maxhp(struct block_list *bl, struct status_change *sc, uint64 maxhp)
+static unsigned int status_calc_maxhp(struct block_list *bl, uint64 maxhp)
 {
-	if(!sc || !sc->count)
-		return (unsigned int)cap_value(maxhp,1,UINT_MAX);
-
-	if(sc->data[SC_INCMHPRATE])
-		maxhp += maxhp * sc->data[SC_INCMHPRATE]->val1/100;
-	if(sc->data[SC_INCMHP])
-		maxhp += (sc->data[SC_INCMHP]->val1);
-	if(sc->data[SC_APPLEIDUN])
-		maxhp += maxhp * sc->data[SC_APPLEIDUN]->val2/100;
-	if(sc->data[SC_DELUGE])
-		maxhp += maxhp * sc->data[SC_DELUGE]->val2/100;
-	if(sc->data[SC_BERSERK])
-		maxhp += maxhp * 2;
-	if(sc->data[SC_MARIONETTE])
-		maxhp -= 1000;
-	if(sc->data[SC_SOLID_SKIN_OPTION])
-		maxhp += 2000;
-	if(sc->data[SC_POWER_OF_GAIA])
-		maxhp += 3000;
-	if(sc->data[SC_EARTH_INSIGNIA] && sc->data[SC_EARTH_INSIGNIA]->val1 == 2)
-		maxhp += 500;
-
-	if(sc->data[SC_MERC_HPUP])
-		maxhp += maxhp * sc->data[SC_MERC_HPUP]->val2/100;
-
-	if(sc->data[SC_EPICLESIS])
-		maxhp += maxhp * 5 * sc->data[SC_EPICLESIS]->val1 / 100;
-	if(sc->data[SC_VENOMBLEED])
-		maxhp -= maxhp * 15 / 100;
-	if(sc->data[SC__WEAKNESS])
-		maxhp -= maxhp * sc->data[SC__WEAKNESS]->val2 / 100;
-	if(sc->data[SC_LERADSDEW])
-		maxhp += maxhp * sc->data[SC_LERADSDEW]->val3 / 100;
-	if(sc->data[SC_FORCEOFVANGUARD])
-		maxhp += maxhp * 3 * sc->data[SC_FORCEOFVANGUARD]->val1 / 100;
-	if(sc->data[SC_INSPIRATION]) // Custom value.
-		maxhp += maxhp * 3 * sc->data[SC_INSPIRATION]->val1 / 100;
-	if(sc->data[SC_RAISINGDRAGON])
-		maxhp += maxhp * (2 + sc->data[SC_RAISINGDRAGON]->val1) / 100;
-	if(sc->data[SC_GT_CHANGE]) // Max HP decrease: [Skill Level x 4] %
-		maxhp -= maxhp * (4 * sc->data[SC_GT_CHANGE]->val1) / 100;
-	if(sc->data[SC_GT_REVITALIZE])// Max HP increase: [Skill Level x 2] %
-		maxhp += maxhp * (2 * sc->data[SC_GT_REVITALIZE]->val1) / 100;
-	if(sc->data[SC_MUSTLE_M])
-		maxhp += maxhp * sc->data[SC_MUSTLE_M]->val1/100;
-	if(sc->data[SC_MYSTERIOUS_POWDER])
-		maxhp -= sc->data[SC_MYSTERIOUS_POWDER]->val1 / 100;
-	if(sc->data[SC_PETROLOGY_OPTION])
-		maxhp += maxhp * sc->data[SC_PETROLOGY_OPTION]->val2 / 100;
-	if (sc->data[SC_ANGRIFFS_MODUS])
-		maxhp += maxhp * 5 * sc->data[SC_ANGRIFFS_MODUS]->val1 /100;
-	if(sc->data[SC_EQC])
-		maxhp -= maxhp * sc->data[SC_EQC]->val4 / 100;
+	int rate = 100;
 
-	if (sc->data[SC_GOLDENE_FERSE])
-		maxhp += maxhp * sc->data[SC_GOLDENE_FERSE]->val2 / 100;
-	if(sc->data[SC_FRIGG_SONG])
-		maxhp += maxhp * sc->data[SC_FRIGG_SONG]->val2 / 100;
+	maxhp += status_get_hpbonus(bl,STATUS_BONUS_FIX);
+
+	if ((rate += status_get_hpbonus(bl,STATUS_BONUS_RATE)) != 100)
+		maxhp = maxhp * rate / 100;
 
 	return (unsigned int)cap_value(maxhp,1,UINT_MAX);
 }
 
 /**
-* Calculates a player's max SP based on status changes
+* Calculates a max SP based on status changes
 * Values can either be percentages or fixed, bas ed on how equations are formulated
-* Examples: maxsp += maxhp * value; (percentage increase)
-*	    maxsp -= value (fixed decrease)
-* @param bl: Object to change aspd [PC|MOB|HOM|MER|ELEM]
-* @param sc: Object's status change information
+* Examples: maxsp += maxsp * value; (percentage increase)
+* @param bl: Object's block_list data
 * @param maxsp: Object's current max SP
 * @return modified maxsp
 **/
-static unsigned int status_calc_maxsp(struct block_list *bl, struct status_change *sc, unsigned int maxsp)
+static unsigned int status_calc_maxsp(struct block_list *bl, uint64 maxsp)
 {
-	if(!sc || !sc->count)
-		return cap_value(maxsp,1,UINT_MAX);
-
-	if(sc->data[SC_INCMSPRATE])
-		maxsp += maxsp * sc->data[SC_INCMSPRATE]->val1/100;
-	if(sc->data[SC_INCMSP])
-		maxsp += (sc->data[SC_INCMSP]->val1);
-	if(sc->data[SC_SERVICE4U])
-		maxsp += maxsp * sc->data[SC_SERVICE4U]->val2/100;
-	if(sc->data[SC_MERC_SPUP])
-		maxsp += maxsp * sc->data[SC_MERC_SPUP]->val2/100;
-	if(sc->data[SC_RAISINGDRAGON])
-		maxsp += maxsp * (2 + sc->data[SC_RAISINGDRAGON]->val1) / 100;
-	if(sc->data[SC_LIFE_FORCE_F])
-		maxsp += maxsp * sc->data[SC_LIFE_FORCE_F]->val1/100;
-	if(sc->data[SC_EARTH_INSIGNIA] && sc->data[SC_EARTH_INSIGNIA]->val1 == 3)
-		maxsp += 50;
+	int rate = 100;
 
-	return cap_value(maxsp,1,UINT_MAX);
+	maxsp += status_get_spbonus(bl,STATUS_BONUS_FIX);
+	
+	if ((rate += status_get_spbonus(bl,STATUS_BONUS_RATE)) != 100)
+		maxsp = maxsp * rate / 100;
+	
+	return (unsigned int)cap_value(maxsp,1,UINT_MAX);
 }
 
 /**
@@ -9114,11 +9180,11 @@ int status_change_start(struct block_list* src, struct block_list* bl,enum sc_ty
 			val2 = MG_LIGHTNINGBOLT;
 			break;
 		case SC_PETROLOGY_OPTION:
-			val2 = 5;
+			val2 = 5; //HP Rate bonus
 			val3 = 50;
 			break;
 		case SC_CURSED_SOIL_OPTION:
-			val2 = 10;
+			val2 = 10; //HP rate bonus
 			val3 = 33;
 			val4 = 2;
 			break;
@@ -9157,9 +9223,11 @@ int status_change_start(struct block_list* src, struct block_list* bl,enum sc_ty
 			break;
 		case SC_ROCK_CRUSHER:
 		case SC_ROCK_CRUSHER_ATK:
-		case SC_POWER_OF_GAIA:
 			val2 = 33;
 			break;
+		case SC_POWER_OF_GAIA:
+			val2 = 20; //HP rate bonus
+			break;
 		case SC_MELON_BOMB:
 		case SC_BANANA_BOMB:
 			val1 = 15;
@@ -9256,7 +9324,7 @@ int status_change_start(struct block_list* src, struct block_list* bl,enum sc_ty
 		case SC_EQC:
 			val2 = 5 * val1; // def % reduc
 			val3 = 5 * val1; // atk % reduc
-			val4 = 2 * val1; // maxhp % reduc
+			val4 = 2 * val1; // HP drain %
 			break;
 		case SC_ASH:
 			val2 = 50; // hit % reduc
@@ -9304,6 +9372,37 @@ int status_change_start(struct block_list* src, struct block_list* bl,enum sc_ty
 			if( !mobdb_checkid(val1) )
 				val1 = 1002; // Default poring
 			break;
+		case SC_APPLEIDUN:
+			{
+				uint8 i;
+				val2 = 5 + (2 * (val1-1)); //HP Rate
+				val3 = 30 + (5 * val1); //HP Recovery rate
+				if (sd && (i = pc_checkskill(sd,BA_MUSICALLESSON)) > 0) {
+					val2 += i;
+					val3 += (5 * i);
+				}
+			} break;
+		case SC_EPICLESIS:
+			val2 = 5 * val1; //HP rate bonus
+			switch (val1) { //! FIXME, looks so weird!
+				//val3: HP regen rate bonus
+				//val4: SP regen rate bonus
+				case 1:
+				case 2:
+					val3 = 3; //HP regen rate bonus
+					val4 = 2; //SP regen rate bonus
+					break;
+				case 3:
+				case 4:
+					val3 = 4; //HP regen rate bonus
+					val4 = 3; //SP regen rate bonus
+					break;
+				case 5:
+					val3 = 5; //HP regen rate bonus
+					val4 = 4; //SP regen rate bonus
+					break;
+			}
+			break;
 
 		/* Rebellion */
 		case SC_HEAT_BARREL_AFTER:

+ 6 - 0
src/map/status.h

@@ -1680,6 +1680,12 @@ enum e_bonus_script_flags {
 	BONUS_FLAG_REM_DEBUFF		= 0x20,	//Remove bonus when player logged out
 };
 
+///Enum for status_get_hpbonus and status_get_spbonus
+enum e_status_bonus {
+	STATUS_BONUS_FIX = 0,
+	STATUS_BONUS_RATE = 1,
+};
+
 //Define to determine who gets HP/SP consumed on doing skills/etc. [Skotlex]
 #define BL_CONSUME (BL_PC|BL_HOM|BL_MER|BL_ELEM)
 //Define to determine who has regen

Some files were not shown because too many files changed in this diff