-
Notifications
You must be signed in to change notification settings - Fork 0
/
treasure.py
281 lines (274 loc) · 14.8 KB
/
treasure.py
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
from random import randrange, random, triangular
import math
from util import roll
# cash object = [cp: int, sp: int, ep: int, gp: int, pp: int]
def combineCash (o1, o2, func = lambda x, y: x+y):
"""combineCash(o1, o2, func = lambda x, y: x+y), combine two lists using func"""
return [func(o1[x], o2[x]) for x in range(len(o1))]
def cashToString(cash):
return '{} cp, {} sp, {} ep, {} gp, {} pp'.format(cash[0], cash[1], cash[2], cash[3], cash[4])
#roll functions for gems and art here
def getTreasure(lvl):
"""get basic treasure"""
r = {}
cr = randrange(1, 101) + (lvl-2)*18
if(cr < 31):
r['cash'] = [roll(5, 6), 0, 0, 0, 0]
elif(cr < 61):
r['cash'] = [0, roll(4,6), 0, 0, 0]
elif(cr < 71):
r['cash'] = [0, 0, roll(3, 6), 0, 0]
elif(cr < 96):
r['cash'] = [0,0,0,roll(3, 6),0]
elif(cr < 101):
r['cash'] = [0, 0, 0, 0, roll(1, 6)]
elif(cr < 131):
r['cash'] = [roll(4, 6)*100, 0, roll(1, 6)*10, 0, 0]
elif(cr < 161):
r['cash'] = [0, roll(6, 6)*10, 0, roll(2, 6)*10, 0]
elif(cr < 171):
r['cash'] = [0,0, roll(3, 6)*10, roll(2, 6)*10, 0]
elif(cr < 196):
r['cash'] = [0, 0, 0, roll(4, 6) * 10, 0]
elif(cr < 201):
r['cash'] = [0,0,0,roll(2, 6)*10, roll(3, 6)]
elif(cr < 221):
r['cash'] = [0, roll(4, 6)*100, 0, roll(1, 6)*100, 0]
elif(cr < 236):
r['cash'] = [0,0,roll(1, 6)*100, roll(1, 6)*100, 0]
elif(cr < 276):
r['cash'] = [0,0, 0, roll(2, 6)*100, roll(1, 6)*10]
elif(cr < 301):
r['cash'] = [0, 0, 0, roll(2, 6)*100, roll(2, 6)*10]
elif(cr < 316):
r['cash'] = [0, 0, roll(2, 6)*1000, roll(8, 6)*100, 0]
elif(cr < 356):
r['cash'] = [0, 0, 0, roll(1, 6)*1000, roll(1, 6)*100]
else:
r['cash'] = [0,0,0, roll(1, 6)*1000, roll(2, 6) * 100]
return r
def getHoard(lvl):
"""get major reward"""
r = {'cash': [],
'loot': ''}
cr = randrange(1, 101) + (lvl-2)*18
if(cr < 101):
r['cash'] = [roll(6, 6)*100, roll(3, 6)*100, 0, roll(2, 6)*10, 0]
if(cr < 7):
"nothin"
elif(cr < 17):
r['loot'] = str(roll(2, 6)) + ' 10 gp gems'
elif(cr < 27):
r['loot'] = str(roll(2, 4)) + ' 25 gp art objects'
elif(cr < 37):
r['loot'] = str(roll(2, 6)) + ' 50 gp gems'
elif(cr < 45):
r['loot'] = str(roll(2, 6)) + ' 10 gp gems and ' + str(roll(1, 6)) + ' Magic Items(table A)'
elif(cr < 53):
r['loot'] = str(roll(2, 4)) + ' 25 gp art objects and ' + str(roll(1, 6)) + ' Magic Items(table A)'
elif(cr < 61):
r['loot'] = str(roll(2, 6)) + ' 50 gp gems and ' + str(roll(1, 6)) + ' Magic Items(table A)'
elif(cr < 66):
r['loot'] = str(roll(2, 6)) + ' 10 gp gems and ' + str(roll(1, 4)) + ' Magic Items(table B)'
elif(cr < 71):
r['loot'] = str(roll(2, 4)) + ' 25 gp art objects and ' + str(roll(1, 4)) + ' Magic Items(table B)'
elif(cr < 76):
r['loot'] = str(roll(2, 6)) + ' 50 gp gems and ' + str(roll(1, 4)) + ' Magic Items(table B)'
elif(cr < 79):
r['loot'] = str(roll(2, 6)) + ' 10 gp gems and ' + str(roll(1, 4)) + ' Magic Items(table C)'
elif(cr < 81):
r['loot'] = str(roll(2, 4)) + ' 25 gp art objects and ' + str(roll(1, 4)) + ' Magic Items(table C)'
elif(cr < 86):
r['loot'] = str(roll(2, 6)) + ' 50 gp gems and ' + str(roll(1, 4)) + ' Magic Items(table C)'
elif(cr < 93):
r['loot'] = str(roll(2, 4)) + ' 25 gp art objects and ' + str(roll(1, 4)) + ' Magic Items(table F)'
elif(cr < 98):
r['loot'] = str(roll(2, 6)) + ' 50 gp gems and ' + str(roll(1, 4)) + ' Magic Items(table F)'
elif(cr < 100):
r['loot'] = str(roll(2, 4)) + ' 25 gp art objects and one Magic Item(table G)'
else:
r['loot'] = str(roll(2, 6)) + ' 50 gp gems and one Magic Item(table G)'
elif(cr < 201):
r['cash'] = [roll(2, 6)*100, roll(2, 6)*1000, 0, roll(6, 6)*100, roll(3, 6)*10]
cr = cr - 100
if(cr < 5):
"nothin"
elif(cr < 11):
r['loot'] = str(roll(2, 4)) + ' 25 gp art objects'
elif(cr < 17):
r['loot'] = str(roll(3, 6)) + ' 50 gp gems'
elif(cr < 23):
r['loot'] = str(roll(3, 6)) + ' 100 gp gems'
elif(cr < 29):
r['loot'] = str(roll(2, 4)) + ' 250 gp art objects'
elif(cr < 33):
r['loot'] = str(roll(2, 4)) + ' 25 gp art objects and ' + str(roll(1, 6)) + ' Magic Items(table A)'
elif(cr < 37):
r['loot'] = str(roll(3, 6)) + ' 50 gp gems and ' + str(roll(1, 6)) + ' Magic Items(table A)'
elif(cr < 41):
r['loot'] = str(roll(3, 6)) + ' 100 gp gems and ' + str(roll(1, 6)) + ' Magic Items(table A)'
elif(cr < 45):
r['loot'] = str(roll(2, 4)) + ' 250 gp art objects and ' + str(roll(1, 6)) + ' Magic Items(table A)'
elif(cr < 50):
r['loot'] = str(roll(2, 4)) + ' 25 gp art objects and ' + str(roll(1, 4)) + ' Magic Items(table B)'
elif(cr < 55):
r['loot'] = str(roll(3, 6)) + ' 50 gp gems and ' + str(roll(1, 4)) + ' Magic Items(table B)'
elif(cr < 60):
r['loot'] = str(roll(3, 6)) + ' 100 gp gems and ' + str(roll(1, 4)) + ' Magic Items(table B)'
elif(cr < 64):
r['loot'] = str(roll(2, 4)) + ' 250 gp art objects and ' + str(roll(1, 4)) + ' Magic Items(table B)'
elif(cr < 67):
r['loot'] = str(roll(2, 4)) + ' 25 gp art objects and ' + str(roll(1, 4)) + ' Magic Items(table C)'
elif(cr < 70):
r['loot'] = str(roll(3, 6)) + ' 50 gp gems and ' + str(roll(1, 4)) + ' Magic Items(table C)'
elif(cr < 73):
r['loot'] = str(roll(3, 6)) + ' 100 gp gems and ' + str(roll(1, 4)) + ' Magic Items(table C)'
elif(cr < 75):
r['loot'] = str(roll(2, 4)) + ' 250 gp art objects and ' + str(roll(1, 4)) + ' Magic Items(table C)'
elif(cr < 77):
r['loot'] = str(roll(2, 4)) + ' 25 gp art objects and 1 Magic Item(table D)'
elif(cr < 79):
r['loot'] = str(roll(3, 6)) + ' 50 gp gems and 1 Magic Item(table D)'
elif(cr < 80):
r['loot'] = str(roll(3, 6)) + ' 100 gp gems and 1 Magic Item(table D)'
elif(cr < 81):
r['loot'] = str(roll(2, 4)) + ' 250 gp art objects and 1 Magic Item(table D)'
elif(cr < 85):
r['loot'] = str(roll(2, 4)) + ' 25 gp art objects and ' + str(roll(1, 4)) + ' Magic Items(table F)'
elif(cr < 89):
r['loot'] = str(roll(3, 6)) + ' 50 gp gems and ' + str(roll(1, 4)) + ' Magic Items(table F)'
elif(cr < 92):
r['loot'] = str(roll(3, 6)) + ' 100 gp gems and ' + str(roll(1, 4)) + ' Magic Items(table F)'
elif(cr < 95):
r['loot'] = str(roll(2, 4)) + ' 250 gp art objects and ' + str(roll(1, 4)) + ' Magic Items(table F)'
elif(cr < 97):
r['loot'] = str(roll(3, 6)) + ' 100 gp gems and ' + str(roll(1, 4)) + ' Magic Items(table G)'
elif(cr < 99):
r['loot'] = str(roll(2, 4)) + ' 250 gp art objects and ' + str(roll(1, 4)) + ' Magic Items(table G)'
elif(cr < 100):
r['loot'] = str(roll(3, 6)) + ' 100 gp gems and 1 Magic Item(table H)'
else:
r['loot'] = str(roll(2, 4)) + ' 250 gp art objects and 1 Magic Item(table H)'
elif(cr < 301):
r['cash'] = [0,0,0, roll(4, 6)*1000, roll(5, 6)*100]
cr = cr - 200
if(cr < 4):
"nothin"
elif(cr < 7):
r['loot'] = str(roll(2, 4)) + ' 250 gp art objects'
elif(cr < 11):
r['loot'] = str(roll(2, 4)) + ' 750 gp art objects'
elif(cr < 13):
r['loot'] = str(roll(3, 6)) + ' 500 gp gems'
elif(cr < 16):
r['loot'] = str(roll(3, 6)) + ' 1000 gp gems'
elif(cr < 20):
r['loot'] = str(roll(2, 4)) + ' 250 gp art objects, ' + str(roll(1, 4)) + ' Magic Items(table A) and ' + str(roll(1, 6)) + ' Magic Items(table B)'
elif(cr < 24):
r['loot'] = str(roll(2, 4)) + ' 750 gp art objects, ' + str(roll(1, 4)) + ' Magic Items(table A) and ' + str(roll(1, 6)) + ' Magic Items(table B)'
elif(cr < 27):
r['loot'] = str(roll(3, 6)) + ' 500 gp gems, ' + str(roll(1, 4)) + ' Magic Items(table A) and ' + str(roll(1, 6)) + ' Magic Items(table B)'
elif(cr < 30):
r['loot'] = str(roll(3, 6)) + ' 1000 gp gems, ' + str(roll(1, 4)) + ' Magic Items(table A) and ' + str(roll(1, 6)) + ' Magic Items(table B)'
elif(cr < 36):
r['loot'] = str(roll(2, 4)) + ' 250 gp art objects and ' + str(roll(1, 6)) + ' Magic Ttems(table C)'
elif(cr < 41):
r['loot'] = str(roll(2, 4)) + ' 750 gp art objects and ' + str(roll(1, 6)) + ' Magic Ttems(table C)'
elif(cr < 46):
r['loot'] = str(roll(3, 6)) + ' 500 gp gems and ' + str(roll(1, 6)) + ' Magic Ttems(table C)'
elif(cr < 51):
r['loot'] = str(roll(3, 6)) + ' 1000 gp gems and ' + str(roll(1, 6)) + ' Magic Ttems(table C)'
elif(cr < 55):
r['loot'] = str(roll(2, 4)) + ' 250 gp art objects and ' + str(roll(1, 4)) + ' Magic Items(table D)'
elif(cr < 59):
r['loot'] = str(roll(2, 4)) + ' 750 gp art objects and ' + str(roll(1, 4)) + ' Magic Ttems(table D)'
elif(cr < 63):
r['loot'] = str(roll(3, 6)) + ' 500 gp gems and ' + str(roll(1, 4)) + ' Magic Ttems(table D)'
elif(cr < 67):
r['loot'] = str(roll(3, 6)) + ' 1000 gp gems and ' + str(roll(1, 4)) + ' Magic Ttems(table D)'
elif(cr < 69):
r['loot'] = str(roll(2, 4)) + ' 250 gp art objects and 1 Magic Item(table E)'
elif(cr < 71):
r['loot'] = str(roll(2, 4)) + ' 750 gp art objects and 1 Magic Item(table E)'
elif(cr < 73):
r['loot'] = str(roll(3, 6)) + ' 500 gp gems and 1 Magic Item(table E)'
elif(cr < 75):
r['loot'] = str(roll(3, 6)) + ' 1000 gp gems and 1 Magic Item(table E)'
elif(cr < 77):
r['loot'] = str(roll(2, 4)) + ' 250 gp art objects, 1 Magic Item(table F) and ' + str(roll(1, 4)) + ' Magic Item(table G)'
elif(cr < 79):
r['loot'] = str(roll(2, 4)) + ' 750 gp art objects, 1 Magic Item(table F) and ' + str(roll(1, 4)) + ' Magic Item(table G)'
elif(cr < 81):
r['loot'] = str(roll(3, 6)) + ' 500 gp gems, 1 Magic Item(table F) and ' + str(roll(1, 4)) + ' Magic Item(table G)'
elif(cr < 83):
r['loot'] = str(roll(3, 6)) + ' 1000 gp gems, 1 Magic Item(table F) and ' + str(roll(1, 4)) + ' Magic Item(table G)'
elif(cr < 86):
r['loot'] = str(roll(2, 4)) + ' 250 gp art objects and ' + str(roll(1, 4)) + ' Magic Items(table H)'
elif(cr < 89):
r['loot'] = str(roll(2, 4)) + ' 750 gp art objects and ' + str(roll(1, 4)) + ' Magic Ttems(table H)'
elif(cr < 91):
r['loot'] = str(roll(3, 6)) + ' 500 gp gems and ' + str(roll(1, 4)) + ' Magic Ttems(table H)'
elif(cr < 93):
r['loot'] = str(roll(3, 6)) + ' 1000 gp gems and ' + str(roll(1, 4)) + ' Magic Ttems(table H)'
elif(cr < 95):
r['loot'] = str(roll(2, 4)) + ' 250 gp art objects and 1 Magic Item(table I)'
elif(cr < 97):
r['loot'] = str(roll(2, 4)) + ' 750 gp art objects and 1 Magic Item(table I)'
elif(cr < 99):
r['loot'] = str(roll(3, 6)) + ' 500 gp gems and 1 Magic Item(table I)'
else:
r['loot'] = str(roll(3, 6)) + ' 1000 gp gems and 1 Magic Item(table I)'
else:
r['cash'] = [0, 0, 0, roll(12, 6)*1000, roll(8, 6)*1000]
cr = cr - 300
if(cr < 3):
"nothin"
elif(cr < 6):
r['loot'] = str(roll(3, 6)) + ' 1000 gp gems and ' + str(roll(1, 8)) + ' Magic Items(table C)'
elif(cr < 9):
r['loot'] = str(roll(1, 10)) + ' 2500 gp art objects and ' + str(roll(1, 8)) + ' Magic Items(table C)'
elif(cr < 12):
r['loot'] = str(roll(1, 4)) + ' 7500 gp art objects and ' + str(roll(1, 8)) + ' Magic Items(table C)'
elif(cr < 15):
r['loot'] = str(roll(1, 8)) + ' 5000 gp gems and ' + str(roll(1, 8)) + ' Magic Items(table C)'
elif(cr < 23):
r['loot'] = str(roll(3, 6)) + ' 1000 gp gems and ' + str(roll(1, 6)) + ' Magic Items(table D)'
elif(cr < 31):
r['loot'] = str(roll(1, 10)) + ' 2500 gp art objects and ' + str(roll(1, 6)) + ' Magic Items(table D)'
elif(cr < 39):
r['loot'] = str(roll(1, 4)) + ' 7500 gp art objects and ' + str(roll(1, 6)) + ' Magic Items(table D)'
elif(cr < 47):
r['loot'] = str(roll(1, 8)) + ' 5000 gp gems and ' + str(roll(1, 6)) + ' Magic Items(table D)'
elif(cr < 53):
r['loot'] = str(roll(3, 6)) + ' 1000 gp gems and ' + str(roll(1, 6)) + ' Magic Items(table E)'
elif(cr < 59):
r['loot'] = str(roll(1, 10)) + ' 2500 gp art objects and ' + str(roll(1, 6)) + ' Magic Items(table E)'
elif(cr < 64):
r['loot'] = str(roll(1, 4)) + ' 7500 gp art objects and ' + str(roll(1, 6)) + ' Magic Items(table E)'
elif(cr < 69):
r['loot'] = str(roll(1, 8)) + ' 5000 gp gems and ' + str(roll(1, 6)) + ' Magic Items(table E)'
elif(cr < 70):
r['loot'] = str(roll(3, 6)) + ' 1000 gp gems and ' + str(roll(1, 4)) + ' Magic Items(table G)'
elif(cr < 71):
r['loot'] = str(roll(1, 10)) + ' 2500 gp art objects and ' + str(roll(1, 4)) + ' Magic Items(table G)'
elif(cr < 72):
r['loot'] = str(roll(1, 4)) + ' 7500 gp art objects and ' + str(roll(1, 4)) + ' Magic Items(table G)'
elif(cr < 73):
r['loot'] = str(roll(1, 8)) + ' 5000 gp gems and ' + str(roll(1, 4)) + ' Magic Items(table G)'
elif(cr < 75):
r['loot'] = str(roll(3, 6)) + ' 1000 gp gems and ' + str(roll(1, 4)) + ' Magic Items(table H)'
elif(cr < 77):
r['loot'] = str(roll(1, 10)) + ' 2500 gp art objects and ' + str(roll(1, 4)) + ' Magic Items(table H)'
elif(cr < 79):
r['loot'] = str(roll(1, 4)) + ' 7500 gp art objects and ' + str(roll(1, 4)) + ' Magic Items(table H)'
elif(cr < 81):
r['loot'] = str(roll(1, 8)) + ' 5000 gp gems and ' + str(roll(1, 4)) + ' Magic Items(table H)'
elif(cr < 86):
r['loot'] = str(roll(3, 6)) + ' 1000 gp gems and ' + str(roll(1, 4)) + ' Magic Items(table I)'
elif(cr < 91):
r['loot'] = str(roll(1, 10)) + ' 2500 gp art objects and ' + str(roll(1, 4)) + ' Magic Items(table I)'
elif(cr < 96):
r['loot'] = str(roll(1, 4)) + ' 7500 gp art objects and ' + str(roll(1, 4)) + ' Magic Items(table I)'
else:
r['loot'] = str(roll(1, 8)) + ' 5000 gp gems and ' + str(roll(1, 4)) + ' Magic Items(table I)'
return r