-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtreasure.py
2027 lines (1933 loc) · 69.1 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
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import random
import sys
'''verbosity v
'''
v = 0
def testtreasure():
return "Basic treasure goes in shape_dict for room! Not done random gems, jewellery, magic."
def roll_dice(number, sides):
roll = random.randint(number,sides)
return roll
def select_gemstone():
dice_roll = roll_dice(1, 100)
if v:
print(dice_roll)
if dice_roll <= 25:
return 10, "Ornamental Stones"
elif dice_roll <= 50:
return 50, "Semi-precious Stones"
elif dice_roll <= 70:
return 100, "Fancy Stones"
elif dice_roll <= 90:
return 500, "Fancy Stones (Precious)"
elif dice_roll <= 99:
return 1000, "Gem Stones"
else:
return 5000, "Gem Stones (Jewels)"
def update_gemstone(base_value):
dice_roll = roll_dice(1, 10)
if v:
print(dice_roll)
if dice_roll == 1:
next_base_value = base_value * 2
if next_base_value > 1000000:
return 1000000
return next_base_value
elif dice_roll == 2:
return base_value * 2
elif dice_roll == 3:
percent_increase = roll_dice(1, 6) * 10
return base_value + (base_value * percent_increase) / 100
elif dice_roll == 4 or dice_roll == 5 or dice_roll == 6 or dice_roll == 7 or dice_roll == 8:
return base_value
elif dice_roll == 9:
percent_decrease = roll_dice(1, 4) * 10
return base_value - (base_value * percent_decrease) / 100
else:
next_base_value = base_value / 2
if next_base_value < 5:
return 5
return next_base_value
def select_jewellery():
dice_roll = roll_dice(1, 100)
if dice_roll <= 10:
base_value = roll_dice(1, 10) * 100
description = "Ivory or wrought silver"
elif dice_roll <= 20:
base_value = roll_dice(1, 6) + roll_dice(1, 6)
base_value = base_value * 100
description = "Wrought silver and gold"
elif dice_roll <= 40:
base_value = roll_dice(1, 6) + roll_dice(1, 6)+ roll_dice(1, 6)
base_value = base_value * 100
description = "Wrought gold"
elif dice_roll <= 50:
base_value = roll_dice(1, 6) + roll_dice(1, 6)+ roll_dice(1, 6)+ roll_dice(1, 6)+ roll_dice(1, 6)
base_value = base_value * 100
description = "Jade, coral or wrought platinum"
elif dice_roll <= 70:
base_value = roll_dice(1, 10) * 1000
description = "Silver with gems"
elif dice_roll <= 90:
base_value = roll_dice(1, 4) * 1000 + roll_dice(1, 4) * 1000
description = "Gold with gems"
else:
base_value = roll_dice(1, 6) + roll_dice(1, 6)
base_value = base_value * 1000
description = "Platinum with gems"
# Check for exceptional value
w = roll_dice(1,10)
v = roll_dice(1,10)
if w == 1:
base_value = min(base_value * 2, 120000)
description = "Exceptional Workmanship " + description
if v == 1:
base_value = min(base_value * 2, 120000)
description = "Exceptional Design " + description
# Check for exceptional gems
if "gems" in description:
e = roll_dice(1,8)
if e == 1:
gem_bonus = 5000
ec = roll_dice(1,6)
while ec == 1:
if ec == 1:
gem_bonus *= 2
gem_bonus = min(gem_bonus, 640000)
base_value += gem_bonus
ec = roll_dice(1,6)
return base_value, description
def jewellery_type():
i = roll_dice(1,100)
items = {
2: "anklet",
6: "arm band",
9: "belt",
12: "box small",
16: "bracelet",
19: "brooch",
21: "buckle",
25: "chain",
26: "chalice",
27: "choker",
30: "clasp",
32: "coffer",
33: "collar",
35: "comb",
36: "coronet",
37: "crown",
39: "decanter",
40: "diadem",
45: "earring",
47: "fob",
52: "goblet",
54: "headband fillet",
57: "idol",
59: "locket",
62: "medal",
68: "medallion",
75: "necklace",
78: "pendant",
83: "pin",
84: "orb",
93: "ring",
94: "sceptre",
96: "seal",
99: "statuette",
100: "tiara"
}
for key in items:
if i <= key:
return items[key]
def potion_choice():
potion_table = [
('Animal Control', 250, 400),
('Clairaudience', 250, 400),
('Clairvoyance', 300, 500),
('Climbing', 300, 500),
('Delusion', 0, 150),
('Diminution', 300, 500),
('Dragon Control', 500, 9000), ('ESP', 500, 850),
('Extra-Healing', 400, 800),
('Fire Resistance', 250, 400),
('Flying', 500, 750),
('Gaseous Form', 300, 400),
('Giant Control', 400, 9000),
('Giant Strength', 500, 1400),
('Growth', 250, 300),
('Healing', 200, 400),
('Heroism', 300, 500),
('Human Control', 500, 900),
('Invisibility', 250, 500),
('Invulnerability', 350, 500),
('Levitation', 250, 400),
('Longevity', 500, 1000),
('Oil of Etherealness', 600, 1500),
('Oil of Slipperiness', 400, 750),
('Philter of Love', 200, 300),
('Philter of Persuasiveness', 400, 850),
('Plant Control', 250, 300),
('Polymorph (self)', 200, 350),
('Poison', 0, 0),
('Speed', 200, 450),
('Super-Heroism', 450, 750),
('Sweet Water', 200, 250),
('Treasure Finding', 600, 2000),
('Undead Control', 700, 2500),
('Water Breathing', 400, 900)
]
potion = random.choice(potion_table)
return potion
def potion_choice():
roll = roll_dice(1,100)
if roll <= 3:
return ("Animal Control*", 250, 400)
elif roll <= 6:
return ("Clairaudience", 250, 400)
elif roll <= 9:
return ("Clairvoyance", 300, 500)
elif roll <= 12:
return ("Climbing", 300, 500)
elif roll <= 15:
return ("Delusion**", 0, 150)
elif roll <= 18:
return ("Diminution", 300, 500)
elif roll <= 20:
return ("Dragon Control*", 5000, 9000) #random this
elif roll <= 23:
return ("ESP", 500, 850)
elif roll <= 26:
return ("Extra-Healing", 400, 800)
elif roll <= 29:
return ("Fire Resistance", 250, 400)
elif roll <= 32:
return ('Flying', 500, 750)
elif roll <= 34:
return ('Gaseous Form', 300, 400)
elif roll <= 36:
g = roll_dice(1,6)
return ('Giant Control', 300 +g*100, g*1000)
elif roll <= 39:
g = roll_dice(1,6)
return ('Giant Strength', 450 +g*50, 800+g*100)
elif roll <= 41:
return ('Growth', 250, 300)
elif roll <= 47:
return ('Healing', 200, 400)
elif roll <= 49:
return ('Heroism', 300, 500)
elif roll <= 51:
return ('Human Control', 500, 900)
elif roll <= 54:
return ('Invisibility', 250, 500)
elif roll <= 57:
return ('Invulnerability', 350, 500)
elif roll <= 60:
return ('Levitation', 250, 400)
elif roll <= 63:
return ('Longevity', 500, 1000)
elif roll <= 66:
return ('Oil of Etherealness', 600, 1500)
elif roll <= 69:
return ('Oil of Slipperiness', 400, 750)
elif roll <= 72:
return ('Philter of Love', 200, 300)
elif roll <= 75:
return ('Philter of Persuasiveness', 400, 850)
elif roll <= 78:
return ('Plant Control', 250, 300)
elif roll <= 81:
return ('Polymorph (self)', 200, 350)
elif roll <= 84:
return ('Poison', 0, 0)
elif roll <= 87:
return ('Speed', 200, 450)
elif roll <= 90:
return ('Super-Heroism', 450, 750)
elif roll <= 93:
return ('Sweet Water', 200, 250)
elif roll <= 96:
return ('Treasure Finding', 600, 2000)
elif roll <= 97:
return ('Undead Control*', 700, 2500)
else: #Water Breathing
return ('Water Breathing', 400, 900)
def scroll_choice():
s = roll_dice(1,100)
st = 1
if s <=70:
sc = "MAGIC-USER"
mu = roll_dice(1,100)
if mu >= 91:
sc = "ILLUSIONIST"
else:
st = 2
sc = "CLERIC"
cl = roll_dice(1,100)
if cl >= 76:
sc = "DRUID"
roll = roll_dice(1,100)
if roll <= 10:
return 1, random.randint(1,4), -1, sc
elif roll <= 16:
return 1, random.randint(1,6), -1, sc
elif roll <= 19:
return 1, random.randint(2,9) if st==1 else random.randint(2,7), -1, sc
elif roll <= 24:
return 2, random.randint(1,4), -1, sc
elif roll <= 27:
return 2, random.randint(1,8) if st==1 else random.randint(1,6), -1, sc
elif roll <= 32:
return 3, random.randint(1,4), -1, sc
elif roll <= 35:
return 3, random.randint(2,9) if st==1 else random.randint(2,7), -1, sc
elif roll <= 39:
return 4, random.randint(1,6), -1, sc
elif roll <= 42:
return 4, random.randint(1,8) if st==1 else random.randint(1,6), -1, sc
elif roll <= 46:
return 5, random.randint(1,6), -1, sc
elif roll <= 49:
return 5, random.randint(1,8) if st==1 else random.randint(1,6), -1, sc
elif roll <= 52:
return 6, random.randint(1,6), -1, sc
elif roll <= 54:
return 6, random.randint(3,8) if st==1 else random.randint(3,6), -1, sc
elif roll <= 57:
return 7, random.randint(1,8), -1, sc
elif roll <= 59:
return 7, random.randint(2,9) if st==1 else random.randint(2,7), -1, sc
elif roll <= 60:
return 7, random.randint(4,9) if st==1 else random.randint(4,7), -1, sc
elif roll <= 62:
return 1, 'Protection - Demons', 2500, sc
elif roll <= 64:
return 1, 'Protection - Devils', 2500, sc
elif roll <= 70:
return 1, 'Protection - Elementals', 1500, sc
elif roll <= 76:
return 1, 'Protection - Lycanthropes', 1000, sc
elif roll <= 82:
return 1, 'Protection - Magic', 2500, sc
elif roll <= 87:
return 1, 'Protection - Petrification', 2000, sc
elif roll <= 92:
return 1, 'Protection - Possession', 2000, sc
elif roll <= 97:
return 1, 'Protection - Undead', 1500, sc
elif roll <= 100:
return 1, 'Curse', 0, sc
def cleric_choice(level):
first_level = ["Bless", "Command", "Create Water", "Cure Light Wounds", "Detect Evil", "Detect Magic", "Light", "Protection From Evil", "Purify Food & Drink", "Remove Fear", "Resist Cold", "Sanctuary"]
second_level = ["Augury", "Chant", "Detect Charm", "Find Traps", "Hold Person", "Know Alignment", "Resist Fire", "Silence 15 Radius", "Slow Poison","Snake Charm","Speak With Animals","Spiritual Hammer"]
third_level = ["Animate Dead", "Continual Light","Create Food & Water", "Cure Blindness", "Cure Disease", "Dispel Magic", "Feign Death","Glyph Of Warding", "Locate Object", "Prayer", "Remove Curse", "Speak With Dead"]
fourth_level = ["Cure Serious Wounds", "Detect Lie", "Cure Critical Wounds","Divination","Exorcise","Lower Water","Neutralize Poison","Protection from Evil 10 Radius","Speak With Plants","Sticks To Snakes","Tongues"]
fifth_level = ["Atonement", "Commune", "Cure Critical Wounds","Dispel Evil", "Earthquake", "Flame Strike", "Insect Plague", "Plane Shift", "Quest", "Raise Dead","True Seeing"]
sixth_level = ["Aerial Servant", "Animate Object", "Blade Barrier","Conjure Animals", "Find The Path","Heal","Part Water","Speak With Monsters","Stone Tell", "Word Of Recall"]
seventh_level = [ "Astral Spell","Control Weather", "Earthquake","Gate", "Holy (Unholy) Word","Regenerate", "Restoration", "Resurrection", "Symbol", "Wind Walk"]
if level == 1:
return random.choice(first_level)
elif level == 2:
return random.choice(second_level)
elif level == 3:
return random.choice(third_level)
elif level == 4:
return random.choice(fourth_level)
elif level == 5:
return random.choice(fifth_level)
elif level == 6:
return random.choice(sixth_level)
elif level == 7:
return random.choice(seventh_level)
else:
return "Invalid Level"
def druid_choice(level):
druid = {1: ['Animals Friendship',
'Detect Magic',
'Detect Snares & Pits',
'Entangle',
'Faerie Fire',
'Invisibility To Animals',
'Locate Animals',
'Pass Without Trace',
'Predict Weather',
'Purify Water',
'Shillelagh',
'Speak With Animals'],
2: ['Barkskin',
'Charm Person/Mammal',
'Create Water',
'Cure Light Wounds',
'Feign Death',
'Fire Trap',
'Heat Metal',
'Locate Plants',
'Obscurement',
'Produce Flame',
'Trip',
'Warp Wood'],
3: ['Call Lightning',
'Cure Disease',
'Hold Animal',
'Neutralize Poison',
'Plant Growth',
'Protection From Fire',
'Pyrotechnics',
'Snare',
'Stone Shape',
'Summon Insects',
'Tree',
'Water Breathing'],
4: ['Animals Summoning I',
'Call Woodland Beings',
'Control Temperature',
'Cure Serious Wounds',
'Dispel Magic',
'Hallucinatory Forest',
'Hold Plant',
'Plant Door',
'Produce Fire',
'Prot. From Lightning',
'Repel Insects',
'Speak With Plants'],
5: ['Animals Growth',
'Animals Summoning II',
'Anti-Plant Shell',
'Commune With Nature',
'Control Winds',
'Insect Plague',
'Pass Plant',
'Sticks To Snakes',
'Trans Rock To Mud',
'Wall Of Fire'],
6: ['Animals Summoning III',
'Anti-Animals Shell',
'Conjure Fire Elemental',
'Cure Critical Wounds',
'Feeblemind',
'Fire Seeds',
'Transport Via Plants',
'Turn Wood',
'Wall Of Thorns',
'Weather Summoning'],
7: ['Animate Rock',
'Chariot Of Sustarre',
'Confusion',
'Conjure Earth Elemental',
'Control Weather',
'Creeping Doom',
'Finger Of Death',
'Fire Storm',
'Reincarnate',
'Trans Metal To Wood']
}
return random.choice(druid[level])
def magicuser_choice(level):
magicuser = {1: ['Affect Normal Fires',
'Burning Hands',
'Charm Person',
'Comprehend Languages',
'Dancing Lights',
'Detect Magic',
'Enlarge',
'Erase',
'Feather Fall',
'Find Familiar',
'Friends',
'Hold Portal',
'Identify',
'Jump',
'Light',
'Magic Missile',
'Mending',
'Message',
"Nystul's Magic Aura",
'Protection From Evil',
'Push',
'Read Magic',
'Shield',
'Shocking Grasp',
'Sleep',
'Spider Climb',
"Tenser's Floating Disc",
'Unseen Servant',
'Ventriloquism',
'Write'],
2: ['Audible Glamour',
'Continual Light',
"Darkness 15' Radius",
'Detect Evil',
'Detect Invisibility',
'ESP',
'Fools Gold',
'Forget',
'Invisibility',
'Knock',
"Leomund's Trap",
'Levitate',
'Locate Object',
'Magic Mouth',
'Mirror Image',
'Pyrotechnics',
'Ray Of Enfeeblement',
'Rope Trick',
'Scare',
'Shatter',
'Stinking Cloud',
'Strength',
'Web',
'Wizard Lock'],
3: ['Blink',
'Clairaudience',
'Clairvoyance',
'Dispel Magic',
'Explosive Runes',
'Feign Death',
'Fireball',
'Flame Arrow',
'Fly',
'Gust Of Wind',
'Haste',
'Hold Person',
'Infravision',
"Invisibility 10' Radius",
"Leomund's Tiny Hut",
'Lightning Bolt',
'Monster Summoning I',
'Phantasmal Force',
"Protection From Evil 10' Radius",
'Protection From Normal Missiles',
'Slow',
'Suggestion',
'Tongues',
'Water Breathing'],
4: ['Charm Monster',
'Confusion',
'Dig',
'Dimension Door',
'Enchanted Weapon',
'Extension I',
'Fear',
'Fire Charm',
'Fire Shield',
'Fire Trap',
'Fumble',
'Hallucinatory Terrain',
'Ice Storm',
'Massmorph',
'Minor Globe Of Invulnerability',
'Monster Summoning II',
'Plant Growth',
'Polymorph Other',
'Polymorph Self',
"Rary's Mnemonic Enhancer",
'Remove Curse',
'Wall Of Fire',
'Wall Of Ice',
'Wizard Eye'],
5: ['Airy Water',
'Animals Growth',
'Animate Dead',
"Bigby's Interposing Hand",
'Cloudkill',
'Conjure Elemental',
'Cone Of Cold',
'Contact Other Plane',
'Distance Distortion',
'Extension II',
'Feeblemind',
'Hold Monster',
"Leomund's Secret Chest",
'Magic Jar',
'Monster Summoning III',
"Mordenkainen's Faithful Hound",
'Passwall',
'Stone Shape',
'Telekinesis',
'Teleport',
'Transmute Rock To Mud',
'Wall Of Force',
'Wall Of Iron',
'Wall Of Stone'],
6: ['Anti-Magic Shell',
'Bigbys Forceful Hand',
'Control Weather',
'Death Spell',
'Disintegrate',
'Enchant An Item',
'Extension III',
'Geas',
'Glassee',
'Globe Of Invulnerability',
'Guards And Wards',
'Invisible Stalker',
'Legend Lore',
'Lower Water',
'Monster Summoning IV',
'Move Earth',
'Otilukes Freezing Sphere',
'Part Water',
'Project Image',
'Reincarnation',
'Repulsion',
'Spiritwrack',
'Stone To Flesh',
'Tensers Transformation'],
7: ['Bigbys Grasping Hand',
'Cacodemon',
'Charm Plants',
'Delayed Blast Fireball',
'Drawmijs Instant Summons',
'Duo-Dimension',
'Limited Wish',
'Mass Invisibility',
'Monster Summoning V',
'Mordenkainens Sword',
'Phase Door',
'Power Word, Stun',
'Reverse Gravity',
'Simulacrum',
'Statue',
'Vanish'],
8: ['Antipathy/Sympathy',
'Bigbys Clenched Fist',
'Clone',
'Glassteel',
'Incendiary Cloud',
'Mass Charm',
'Maze',
'Mind Blank',
'Monster Summoning VI',
'Ottos Irresistible Dance',
'Permanency',
'Polymorph Any Object',
'Power Word, Blind',
'Sertens Spell Immunity',
'Symbol',
'Trap The Soul'],
9: ['Astral Spell',
'Bigbys Crushing Hand',
'Gate',
'Imprisonment',
'Meteor Swarm',
'Monster Summoning VII',
'Power Word, Kill',
'Prismatic Sphere',
'Shape Change',
'Temporal Stasis',
'Time Stop',
'Wish']}
return random.choice(magicuser[level])
def illusionist_choice(level):
illusionist = {
1: ["Audible Glamour", "Change Self", "Colour Spray", "Dancing Lights", "Darkness", "Detect Illusion", "Detect Invisibility", "Gaze Reflection"],
2: ["Blindness", "Blur", "Deafness", "Detect Magic", "Fog Cloud", "Hypnotic Pattern", "Improved Phantasmal Force", "Invisibility"],
3: ["Continual Darkness", "Continual Light", "Dispel Illusion", "Emotion", "Hallucinatory Terrain", "Illusionary Script", "Invisibility 10' Radius", "Non-detection"],
4: ["Confusion", "Dispel Exhaustion", "Fear", "Improved Invisibility", "Massmorph", "Minor Creation", "Phantasmal Killer", "Shadow Monsters"],
5: ["Chaos", "Demi-Shadow Monsters", "Major Creation", "Maze", "Projected Image", "Shadow Door", "Shades", "Summon Shadow"],
6: ["Conjure Animals", "Demi-Shadow Magic", "Mass Suggestion", "Permanent Illusion", "Programmed Illusion", "True Sight", "Veil"],
7: ["Alter Reality", "Astral Spell", "Prismatic Spray", "Prismatic Wall", "Vision"]
}
return random.choice(illusionist[level])
def ring_choice():
dice_roll = roll_dice(1, 100)
if dice_roll <= 6:
return ("Contrariness", 0, 1000)
elif dice_roll <= 12:
return ("Delusion", 0, 2000)
elif dice_roll <= 14:
return ("Djinni Summoning", 3000, 20000)
elif dice_roll <= 15:
return ("Elemental Command", 5000, 25000)
elif dice_roll <= 21:
return ("Feather Falling", 1000, 5000)
elif dice_roll <= 27:
return ("Fire Resistance", 1000, 5000)
elif dice_roll <= 30:
return ("Free Action", 1000, 5000)
elif dice_roll <= 33:
return ("Human Influence", 2000, 10000)
elif dice_roll <= 40:
return ("Invisibility", 1500, 7500)
elif dice_roll <= 43:
return ("Mammal Control", 1000, 5000)
elif dice_roll <= 44:
return ("Multiple Wishes", 5000, 25000)
elif dice_roll <= 60:
dice_roll_2 = random.randint(1, 20)
if dice_roll_2 <= 10:
return ("Protection", 2000, 10000)
elif dice_roll_2 <= 20:
return ("Protection", 2500, 12500)
elif dice_roll_2 <= 30:
return ("Protection", 3000, 15000)
else:
return ("Protection", 4000, 20000)
elif dice_roll <= 63:
return ("Regeneration", 5000, 40000)
elif dice_roll <= 65:
return ("Shooting Stars", 3000, 15000)
elif dice_roll <= 69:
return ("Spell Storing", 2500, 22500)
elif dice_roll <= 75:
return ("Spell Turning", 2000, 17500)
elif dice_roll <= 77:
return ("Swimming", 1000, 5000)
elif dice_roll <= 79:
return ("Telekinesis", 2000, 10000)
elif dice_roll <= 85:
return ("Three Wishes", 3000, 15000)
elif dice_roll <= 90:
return ("Warmth", 1000, 5000)
elif dice_roll <= 98:
return ("Water Walking", 1000, 5000)
elif dice_roll <= 99:
return ("Weakness", 0, 1000)
else:
return ("Wizardry", 4000, 50000)
def wand_choice():
roll = roll_dice(1, 100)
if roll <= 3:
return ('Rod of Absorption', 7500, 40000)
elif roll <= 4:
return ('Rod of Beguiling', 5000, 30000)
elif roll <= 14:
return ('Rod of Cancellation', 10000, 15000)
elif roll <= 16:
return ('Rod of Lordly Might', 6000, 20000)
elif roll <= 17:
return ('Rod of Resurrection', 10000, 35000)
elif roll <= 18:
return ('Rod of Rulership', 8000, 35000)
elif roll <= 19:
return ('Rod of Smiting', 4000, 15000)
elif roll <= 20:
return ('Staff of Command', 5000, 25000)
elif roll <= 22:
return ('Staff of Curing', 6000, 25000)
elif roll <= 23:
return ('Staff of the Magi', 15000, 75000)
elif roll <= 24:
return ('Staff of Power', 12000, 60000)
elif roll <= 27:
return ('Staff of the Serpent', 7000, 35000)
elif roll <= 31:
return ('Staff of Striking', 6000, 15000)
elif roll <= 33:
return ('Staff of Withering', 8000, 35000)
elif roll <= 34:
return ('Wand of Conjuration', 7000, 35000)
elif roll <= 38:
return ('Wand of Enemy Detection', 2000, 10000)
elif roll <= 41:
return ('Wand of Fear', 3000, 15000)
elif roll <= 44:
return ('Wand of Fire', 4500, 25000)
elif roll <= 47:
return ('Wand of Frost', 6000, 50000)
elif roll <= 52:
return ('Wand of Illumination', 2000, 10000)
elif roll <= 56:
return ("Wand of Illusion", 3000, 20000)
elif roll <= 59:
return ("Wand of Lightning", 4000, 30000)
elif roll <= 68:
return ("Wand of Magic Detection", 2500, 25000)
elif roll <= 73:
return ("Wand of Metal & Mineral Detection", 1500, 7500)
elif roll <= 78:
return ("Wand of Magic Missiles", 4000, 35000)
elif roll <= 86:
return ("Wand of Negation", 3500, 15000)
elif roll <= 89:
return ("Wand of Paralyzation", 3500, 25000)
elif roll <= 92:
return ("Wand of Polymorphing", 3500, 25000)
elif roll <= 94:
return ("Wand of Secret Door & Trap Location", 5000, 40000)
else:
return ("Wand of Wonder", 6000, 10000)
def armour_choice():
dice_roll = roll_dice(1, 100)
if dice_roll <= 5:
return ('Chain Mail +1', 600, 3500)
elif dice_roll <= 9:
return ('Chain Mail +2', 1200, 7500)
elif dice_roll <= 11:
return ('Chain Mail +3', 2000, 12500)
elif dice_roll <= 19:
return ('Leather Armor +1', 300, 2000)
elif dice_roll <= 26:
return ('Plate Mail +1', 800, 5000)
elif dice_roll <= 32:
return ('Plate Mail +2', 1750, 10500)
elif dice_roll <= 35:
return ('Plate Mail +3', 2750, 15500)
elif dice_roll <= 37:
return ('Plate Mail +4', 3500, 20500)
elif dice_roll == 38:
return ('Plate Mail +5', 4500, 27500)
elif dice_roll == 39:
return ('Plate Mail of Etherealness', 5000, 30000)
elif dice_roll <= 44:
return ('Plate Mail of Vulnerability', 0, 1500)
elif dice_roll <= 50:
return ('Ring Mail +1', 400, 2500)
elif dice_roll <= 55:
return ('Scale Mail +1', 500, 3000)
elif dice_roll <= 59:
return ('Scale Mail +2', 1100, 6750)
elif dice_roll <= 63:
return ('Splint Mail +1', 700, 4000)
elif dice_roll <= 66:
return ('Splint Mail +2', 1500, 8500)
elif dice_roll <= 68:
return ('Splint Mail +3', 2250, 14500)
elif dice_roll == 69:
return ('Splint Mail +4', 3000, 19000)
elif dice_roll <= 75:
return ('Studded Leather +1', 400, 2500)
elif dice_roll <= 84:
return ('Shield +1', 250, 2500)
elif dice_roll <= 89:
return ('Shield +2', 500, 5000)
elif dice_roll <= 93:
return ('Shield +3', 800, 8000)
elif dice_roll <= 95:
return ('Shield +4', 1200, 12000)
elif dice_roll <= 96:
return ('Shield +5', 1200, 17500)
elif dice_roll <= 97:
return ('Shield large +1 +4 vs missiles', 400, 4000)
else:
return ('Shield -1 Missile attractor', 0, 750)
def sword_choice():
dice_roll = roll_dice(1,100)
if dice_roll <= 25:
return ("Sword +1", 400, 2000)
elif dice_roll <= 30:
return ("Sword +1 +2 vs magic-using & enchanted creatures", 600, 3000)
elif dice_roll <= 35:
return ("Sword +1 +3 vs lycanthropes & shape changers", 700, 3500)
elif dice_roll <= 40:
return ("Sword +1 +3 vs regenerating creatures", 800, 4000)
elif dice_roll <= 45:
return ("Sword +1 +4 vs reptiles", 800, 4000)
elif dice_roll <= 49:
return ("Sword +1 Flame Tongue: +2 vs. regenerating creatures +3 vs cold-using inflammable or avian creatures +4 vs. undead", 900, 4500)
elif dice_roll <= 50:
return ("Sword +1 Luck Blade", 1000, 5000)
elif dice_roll <= 58:
return ("Sword +2", 800, 4000)
elif dice_roll <= 62:
return ("Sword +2 Giant Slayer", 900, 4500)
elif dice_roll <= 66:
return ("Sword +2 Dragon Slayer", 900, 4500)
elif dice_roll <= 67:
return ("Sword +2 Nine Lives Stealer", 1600, 8000)
if dice_roll <= 71:
return ('Sword +3', 1400, 7000)
elif dice_roll <= 74:
return ('Sword +3 Frost Brand: +6 vs fire using or dwelling creatures', 1600, 8000)
elif dice_roll <= 76:
return ('Sword +4', 2000, 10000)
elif dice_roll <= 77:
return ('Sword +4 Defender', 3000, 15000)
elif dice_roll <= 78:
return ('Sword +5', 3000, 15000)
elif dice_roll <= 79:
return ('Sword +5 Defender', 3600, 18000)
elif dice_roll <= 80:
return ('Sword +5 Holy Avenger', 4000, 20000)
elif dice_roll <= 81:
return ('Sword of Dancing', 4400, 22000)
elif dice_roll <= 82:
return ('Sword of Wounding', 4400, 22000)
elif dice_roll <= 83:
return ('Sword of Life Stealing', 5000, 25000)
elif dice_roll <= 84:
return ('Sword of Sharpness', 7000, 35000)
elif dice_roll <= 85:
return ('Sword Vorpal Weapon', 10000, 50000)
elif dice_roll <= 90:
return ('Sword +1 Cursed', 400, 0)
elif dice_roll <= 95:
return ('Sword -2 Cursed', 600, 0)
else:
return ('Sword Cursed Berserking', 900, 0)
def weapon_choice():
roll = roll_dice(1,100)
if roll <= 8:
return ("Arrow +1", 20, 120) #random number of these if want fancier
#, random.randint(2,24)
elif roll <= 12:
return ("Arrow +2", 50, 300) #random number of these if want fancier
#, random.randint(2,16)
elif roll == 13:
return ("Arrow +3", 75, 450)
#, random.randint(2,12)
elif roll == 14:
return ("Arrow of Slaying", 250, 2500)
elif roll <= 20:
return ("Axe +1", 300, 1750)
elif roll <= 22:
return ("Axe +2", 600, 3750)
elif roll == 23:
return ("Axe +2 Throwing", 750, 4500)
elif roll == 24:
return ("Axe +3", 1000, 7000)
elif roll <= 27:
return ("Battle Axe +1", 400, 2500)
elif roll <= 32:
return ("Bolt +2", 50, 300) #random number of these if want fancier
elif roll == 33:
return ("Bow +1", 500, 3500)
elif roll == 34:
return ("Crossbow of Accuracy +3", 2000, 12000)
elif roll == 35:
return ("Crossbow of Distance", 1500, 7500)
elif roll == 36:
return ("Crossbow of Speed", 1500, 7500)
elif roll <= 46:
return ("Dagger +1", 100, 750)
elif roll <= 50:
return ("Dagger +2", 250, 2000)
elif roll == 51:
return ("Dagger of Venom", 350, 3000)
elif roll <= 56:
return ("Flail +1", 450, 4000)
elif roll <= 60:
return ("Hammer +2", 300, 2500)
elif roll <= 62:
return ("Hammer +2", 650, 6000)
elif roll == 63:
return ("Hammer +3 Dwarven Thrower", 1500, 15000)
elif roll == 64:
return ("Hammer of Thunderbolts", 2500, 25000)
elif roll <= 67:
return ("Javelin +2", 750, 5000)
elif roll <= 72:
return ("Mace +1", 350, 3000)
elif roll <= 75:
return ("Mace +2", 700, 4500)
elif roll == 76:
return ("Mace of Disruption", 1750, 17500)
elif roll == 77:
return ("Mace +4", 1500, 15000)
elif roll <= 80:
return ("Military Pick +1", 350, 2500)
elif roll <= 83:
return ("Morning Star +1", 400, 3000)
elif roll <= 88:
return ("Scimitar +2", 750, 6000)
elif roll == 89:
return ("Sling of Seeking +2", 700, 7000)
elif roll <= 94:
return ("Spear +1", 500, 3000)
elif roll <= 96:
return ("Spear +2", 1000, 6500)
elif roll == 97:
return ("Spear +3", 1750, 15000)
elif roll <= 99:
return ("Spear Cursed Backbiter", 0, 1000)
else:
return ("Trident-Military Fork +3", 1500, 12500)
def misc_1_choice():
roll = roll_dice(1, 100)
if roll <= 2:
return ("Alchemy Jug", 3000, 12000)
elif roll <= 4:
return ("Amulet of Inescapable Location", 0, 1000)
elif roll == 5:
return ("Amulet of Life Protection", 5000, 20000)
elif roll <= 7:
return ("Amulet of the Planes", 6000, 30000)
elif roll <= 11:
return ("Amulet of Proof Against Detection and Location", 4000, 15000)
elif roll <= 13:
return ("Apparatus of Kwalish", 8000, 35000)
elif roll <= 16:
return ("Arrow of Direction", 2500, 17500)
elif roll == 17:
return ("Artifact or Relic (see Special table)", 0, 0)
elif roll <= 20:
return ("Bag of Beans", 1000, 5000)
elif roll == 21:
return ("Bag of Devouring", 0, 1500)
elif roll <= 26:
return ("Bag of Holding", 5000, 25000)
elif roll == 27:
return ("Bag of Transmuting", 0, 500)
elif roll <= 29:
return ("Bag of Tricks", 2500, 15000)
elif roll <= 31:
return ("Beaker of Plentiful Potions", 1500, 12500)
elif roll == 32:
return ("Boat-Folding", 10000, 25000)
elif roll == 33:
return ("Book of Exalted Deeds (C)", 8000, 40000)
elif roll == 34:
return ("Book of Infinite Spells", 9000, 50000)
elif roll == 35:
return ("Book of Vile Darkness (C)", 8000, 40000)