summaryrefslogtreecommitdiff
path: root/misc/mobexpgen.py
blob: 964ec59166ae3e891a86b59787e855070fca6d07 (plain) (blame)
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
#!/usr/bin/python
# (C) Jesusalva, 2018
# All rights reserved

# Permission is hereby granted, free of charge, to TMW2 Team, its subsidiaries
# and controllers, to use, modify and share this script, without fee of any kind.
# (C) COPYRIGHT, ALL RIGHTS RESERVED
#
# Experience Assignment core logic and formula
# This script generates EXP for mob level ranges

import sys

exp=[			9,16,25,36,77,112,153,200,253,320,
				385,490,585,700,830,970,1120,1260,1420,1620,
				1860,1990,2240,2504,2950,3426,3934,4474,6889,7995,
				9174,10425,11748,13967,15775,17678,19677,21773,28543,34212,
				38065,42102,46323,53026,58419,64041,69892,75973,92468,115254,
				128692,142784,157528,178184,196300,215198,234879,255341,310188,365914,
				402508,442769,487051,535756,589342,648281,713112,784421,862867,949158,
				1044076,1148484,1263331,1389671,1528642,1681509,1849671,2034639,2238111,
				2461928,
				2708132,2978946,3276840,3604530,3964987,4361495,4797656,5277432,5805184,6095442,
				6400217,6720231,7056251,7409070,7779531,8168509,8576941,9005793,9456080,9928893,
				10425342,10946613,11493946,12068655,12672087,13305690,13970980,14669530,15403013,16173172,
				16981833,17830934,18722479,19658611,20641552,21673632,22757319,23895184,25089950,25591758,
				26103599,26625670,27158181,27701356,28255388,28820507,29396920,29984867,30584571,31196260,
				31820184,32456596,33105727,33767845,34443202,35132065,35834705,36551410,37282446,38028099,
				38788671,39564454,40355745,41162860,41986116,42825838,43682362,44556009,45447138,45901616,
				46360641,46824255,47292503,47765432,48243093,48725528,49212784,49704921,50201982,50704003,
				51211047,51723162,52240405,52762810,53290446,53823354,54361598,54905214,55454271,56008820,
				56568910,57134610,57705965,58283032,58865873,59454536,60049086,60649586,61256083,61868649,
				62487336,63112216,63743344,64380779,65024597,65674843,66331602,66994930,67664885,68341538,
				69024959,69715207,70412360,71116485,71827658,72545940,73271398,74004114,74744153,75491595,
				76246518,77008984,77779077,78556879,79342456,80135878,80937236,81746616,82564087,83389730,
				84223638,85065880,85916545,86775711,87643468,88519912,89405121,90299171,91202163,92114182,
				93035322,93965687,94905347,95854406,96812948,97781076,98758892,99746478,100743951,101751398,
				102768911,103796609,104834582,105882930,106941769,108011193,109091315,110182230,111284052,112396904,
				113520874,114656091,115802657,116960692,118130296,119311601,120504716,121709770,122926875,124156150,
				125397711,126651686,127918206,129197392,130489375,131794267,133112212,134443338,135787774,137145652,
				138517109,139902284,141301316,142714335,144141489,145582902,147038738,148509126,149994219,150894194,
				151799571,152710366,153626627,154548387,155475676,156408540,157346998,158291079,159240837,160196288,
				161157464,162124419,163097165,164075757,165060214,166050576,167046878,168049166,169057470,170071823,
				171092262,172118826,173151541,174190460,175235604,176287026,177344758,178408837,179479294,180556179,
				181639518,182729367,183825754,184928711,186038293,187154528,188277464,189407130,190543577,191686849,
				192836981,193994007,195157974,196328927,197506910,198691949,199884102,201083405,202289908,203503646,
				204724676,205953024,207188754,208431886,209682484,210940582,212206225,213479467,214760350,216048919,
				217345224,218649298,219961193,221280960,222608645,223944302,225287974,226639708,227999552,229367554,
				230743762,232128226,233520999,234922133,236331675,237749668,239176170,240611236,242054915,243507252,
				244968307,246438117,247916753,249404252,250900687,252406101,253920540,255444067,256976742,258518609,
				260069729,261630158,263199938,264779135,266367816,267966025,269573820,271191260,272818408,274455326,
				276102061,277758679,279425234,281101787,282788399,284485141,286192050,287909214,289636677,291374496,
				293122752,294881486,296650782,298430689,300221275,302022609,303834742,305657759,307491713,309336672,
				311192696,313059863,314938223,316827859,318728836,320641216,322565061,324500459,326447460,328406143,
				330376584,332358847,334353004,336359128,338377288,340407551,342449994,344504696,346571722,348651151,
				350743062,352847532,354964629,357094423,359236990,361392422,363560778,365742141,367936599,370144221,
				372365091,374599279,376846874,379107955,381382611,383670915,385972949,388288794,390618537,392962257,
				395320037,397691969,400078129,402478601,404893475,407322841,409766782,412225383,414698739,417186939,
				419690069,422208209,424741456,427289911,429853651,432432776,435027370,437637543,440263366,442024421,
				443792521,445567690,447349963,449139360,450935926,452739673,454550638,456368839,458194326,460027115,
				461867221,463714693,465569558,467431848,469301579,471178794,473063508,474955766,476855601,478763022,
				480678083,482600803,484531205,486469328,488415217,490368880,492330355,494299675,496276878,498261990,
				500255043,502256068,504265102,506282171,508307305,510340540,512381907,514431439,516489176,518555144,
				520629376,522711891,524802748,526901963,529009581,531125618,533250127,535383137,537524678,539674777,
				541833486,544000830,546176836,548361554,550555012,552757234,554968274,557188159,559416915,561654583,
				563901210,566156820,568421455,570695142,572977924,575269847,577570928,579881219,582200741,584529542,
				586867672,589215145,591572009,593938303,596314063,598699319,601094122,603498497,605912494,608336152,
				610769496,613212575,615665434,618128102,620600617,623083026,625575357,628077658,630589971,633112332,
				635644789,638187373,640740134,643303101,645876314,648459827,651053675,653657891,656272528,658897623,
				661533224,664179368,666836088,669503437,672181451,674870184,677569669,680279959,683001081,685733085,
				688476023,691229930,693994859,696770843,699557927,702356165,705165600,707986270,710818214,713661496,
				716516145,719382218,722259755,725148792,728049398,730961596,733885443,736820993,739768279,742727359,
				745698276,748681079,751675801,754682510,757701238,760732051,763774987,766830096,769897426,772977027,
				776068941,779173220,782289911,785419075,788560754,791714999,794881861,798061393,801253640,804458666,
				807676501,810907214,814150847,817407448,820677081,823959788,827255638,830564665,833886935,837222492,
				840571380,843933675,847309412,850698655,854101449,857517860,860947939,864391740,867849310,871320709,
				874805998,878305227,881818445,885345716,888887109,892442668,896012438,899596490,903194873,906807655,
				910434887,914076637,917732953,921403888,925089515,928789881,932505045,936235070,939980010,943739930,
				947514893,951304957,955110178,958930630,962766360,966617436,970483913,974365859,978263328,980219865,
				982180304,984144663,986112953,988085181,990061353,992041475,994025558,996013620,998005651,1000001664,
				1002001670,1004005681,1006013699,1008025735,1010041798,1012061881,1014086014,1016114195,1018146435,1020182726,
				1022223100,1024267547,1026316088,1028368724,1030425473,1032486333,1034551306,1036620414,1038693652,1040771050,
				1042852592,1044938300,1047028186,1049122253,1051220509,1053322948,1055429600,1057540462,1059655548,1061774865,
				1063898414,1066026219,1068158269,1070294589,1072435186,1074580062,1076729225,1078882693,1081040458,1083202540,
				1085368950,1087539688,1089714773,1091894206,1094078002,1096266159,1098458700,1100655626,1102856943,1105062660,
				1107272796,1109487341,1111706320,1113929730,1116157597,1118389911,1120626695,1122867946,1125113683,1127363921,
				1129618652,1131877895,1134141656,1136409947,1138682764,1140960132,1143242053,1145528545,1147819610,1150115261,
				1152415501,1154720335,1157029785,1159343854,1161662550,1163985886,1166313869,1168646501,1170983802,1173325780,
				1175672438,1178023791,1180379849,1182740610,1185106101,1187476311,1189851269,1192230970,1194615441,1197004680,
				1199398692,1201797491,1204201086,1206609487,1209022706,1211440756,1213863640,1216291377,1218723958,1221161411,
				1223603745,1226050962,1228503065,1230960072,1233421991,1235888844,1238360630,1240837350,1243319031,1245805676,
				1248297286,1250793883,1253295481,1255802074,1258313676,1260830309,1263351977,1265878686,1268410449,1270947278,
				1273489175,1276036154,1278588238,1281145420,1283707708,1286275130,1288847692,1291425394,1294008252,1296596274,
				1299189476,1301787855,1304391432,1307000221,1309614230,1312233465,1314857937,1317487654,1320122630,1322762880,
				1325408412,1328059235,1330715364,1333376805,1336043560,1338715652,1341393091,1344075885,1346764039,1349457570,
				1352156491,1354860804,1357570532,1360285684,1363006259,1365732281,1368463753,1371200692,1373943098,1376690985,
				1379444366,1382203263,1384967675,1387737610,1390513086,1393294117,1396080703,1398872867,1401670621,1404473974,
				1407282926,1410097490,1412917693,1415743531,1418575025,1421412178,1424255014,1427103527,1429957732,1432817658,
				1435683298,1438554668,1441431788,1444314663,1447203298,1450097702,1452997898,1455903892,1458815709,1461733351,
				1464656827,1467586139,1470521322,1473462375,1476409309,1479362131,1482320860,1485285512,1488256082,1491232605,
				1494215078,1497203516,1500197931,1503198331,1506204738,1509217145,1512235587,1515260063,1518290591,1521327177,
				1524369835,1527418577,1530473423,1533534369,1536601435,1539674638,1542753994,1545839499,1548931187,1552029061,
				1555133122,1558243389,1561359877,1564482606,1567611577,1570746809,1573888301,1577036087,1580190168,1583350559,
				1586517258,1589690299,1592869679,1596055429,1599247538,1602446032,1605650924,1608862226,1612079956,1615304119,
				1618534730,1621771801,1625015350,1628265386,1631521928,1634784983,1638054564,1641330673,1644613335,1647902564,
				1651198378,1654500782,1657809784,1661125412,1664447667,1667776560,1671112119,1674454344,1677803256,1681158862,
				1684521177,1687890226,1691266004,1694648540,1698037842,1701433925,1704836795,1708246469,1711662970,1715086305,
				1718516475,1721953518,1725397429,1728848221,1732305917,1735770534,1739242078,1742720572,1746206018,1749698432,
				1753197834,1756704230,1760217648,1763738095,1767265571,1770800114,1774341724,1777890417,1781446204,1785009103,
				1788579129,1792156296,1795740613,1799332095,1802930767,1806536637,1810149712,1813770023,1817397563,1821032370,
				1824674439,1828323791,1831980439,1835644402,1839315694,1842994331,1846680321,1850373680,1854074439,1857782597,
				1861498160,1865221158,1868951609,1872689521,1876434907,1880187783,1883948157,1887716051,1891491487,1895274474,
				1899065034,1902863163,1906668898,1910482243,1914303210,1918131823,1921968091,1925812028,1929663661,1933522991,
				1937390042,1941264831,1945147368,1949037671,1952935746,1956841623,1960755316,1964676830,1968606184
				]


"""
i=0; acc=0; target=100; ml=10; fx1=1.45; fx2=1.55; mk1=55;
while (i < target):
    i+=1
    if i > (mk1-10) and i < (mk1+10):
        fx=fx1+((i-mk1+10)/200.0)
    elif (i < mk1):
        fx=fx1
    else:
        fx=fx2
    acc+=i**fx
    if (i%ml == 0 or i < 10 or (i > (mk1-12) and i < (mk1+12) )):
        print("Level %d: total %d mobs individual %d xp (%.3f)" % (i, acc, exp[i-1]/(i**fx), fx));
"""

# Handle input
try:
    target=int(sys.argv[1])
except:
    try:
        ip=str(sys.argv[1])
    except:
        ip="help"

    if (ip != "all"):
        print("Syntax 1: ./mobexpgen.txt [target_lvl]")
        print("Syntax 2: ./mobexpgen.txt all")
        print("This will calculate the average experience gain expected for the monster level")
        exit(0)
    else:
        i=0; acc=0; target=100; ml=10; fx1=1.45; fx2=1.65; mk1=45;
        while (i < target):
            i+=1
            if i > (mk1-10):
                fx=fx1+((i-mk1+10)/200.0)
            else:
                fx=fx1
            if fx > fx2:
                fx=fx2
            acc+=i**fx
            if (i%ml == 0 or i < 10 or (i > (mk1-15) and i < (mk1+25) )):
                print("Level %d: total %d mobs individual %d xp (%.3f)" % (i, acc, exp[i-1]/(i**fx), fx));
        exit(0)

# Environment config
i=0; acc=0; fx1=1.45; fx2=1.65; mk1=45;
while (i < target):
    i+=1
    if i > (mk1-10):
        fx=fx1+((i-mk1+10)/200.0)
    else:
        fx=fx1
    if fx > fx2:
        fx=fx2
    acc+=i**fx
print("Level %d: total %d mobs specific %d kills individual \033[31;1m%d\033[0m xp (exp factor %.3f)" % (i, acc, i**fx, exp[i-1]/(i**fx), fx));