SHARE
TWEET

Untitled

a guest May 22nd, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import random
  2. import sys
  3.  
  4. print("One Click NPC Common Generator\n")
  5.  
  6. race = ["Dwarf", "Elf", "Halfling", "Human", "Human", "Gnome", "Half-Elf", "Half-Orc"]
  7. gender = ["Male", "Female", "Male", "Female"]
  8. adjective = ["Tattooed/Pierced/Unusual", "Long/Large/Loud/Extravagant", "Short/Small/Quiet/Simple",
  9.              "Missing/Injured/Damaged", "Beautiful/Ugly", "Colourful/Dyed/Painted"]
  10. feature = ["Nose/Voice", "Eyes/Eyebrows/Stare", "Beard/Hair/Sideburns", "Ears/Hearing", "Mouth/Lips/Laugh",
  11.        "Head/Forehead/Face", "Clothing", "Skin/Scar", "Shoes/Hat", "Teeth/Nails/Hands"]
  12.  
  13. first_parts = [
  14.     ["Dal", "Taer", "Mar", "Dyl", "Eth", "Clad", "Gal", "Bok"],
  15.     ["Hour", "Keth", "Dan", "Eth", "La", "Ged", "Ari", "Gun"],
  16.     ["Kal", "ELin", "San", "Jord", "Gab", "Dap", "Fae", "Ton"],
  17.     ["Gat", "Ay", "Tar", "Gab", "Zach", "Jip", "Avil", "Tar"],
  18.     ["Brot", "Lae", "Wil", "Zach", "Hay", "Cos", "Tyr", "Kez"],
  19.     ["Har", "Sil", "Fin", "Al", "Dyl", "Glon", "Yen", "Vug"],
  20.     ["Strom", "Arth", "Elk", "La", "Iv", "Smid", "Rad", "No"],
  21.     ["Glor", "Sca", "Jop", "Iv", "Jord", "Jen", "Ven", "Kir"],
  22.     ["Thog", "Evin", "Ric", "Kar", "Al", "Tin", "Lan", "Bro"],
  23.     ["Demm", "Kyr", "Bel", "Hay", "Kar", "Deb", "Dan", "Gor"]
  24. ]
  25. second_parts = [
  26.     ["omma", "ryl", "", "", "", "li", "tu", "og"],
  27.     ["ogg", "tha", "", "", "", "mer", "ana", "oto"],
  28.     ["osgra", "ina", "ow", "", "", "wun", "dra", "ust"],
  29.     ["ed", "ala", "em", "", "", "men", "ado", ""],
  30.     ["tirl", "yni", "", "", "", "alv", "la", "g"],
  31.     ["wod", "arun", "", "", "", "ip", "reg", "ak"]
  32. ]
  33. third_parts = [
  34.     ["rut", "en", "os", "an", "in", "ak", "il", "ik"],
  35.     ["lynn", "lia", "ra", "ley", "ina", "eth", "lia", "nor"],
  36.     ["li", "al", "er", "as", "riel", "urt", "on", "org"],
  37.     ["na", "aya", "yn", "na", "ila", "na", "tha", "gri"]
  38. ]
  39.  
  40.  
  41. def d4():
  42.     return random.randint(0, 3)
  43.  
  44. def d6():
  45.     return random.randint(0, 5)
  46.  
  47. def d8():
  48.     return random.randint(0, 7)
  49.  
  50. def d10():
  51.     return random.randint(0, 9)
  52.  
  53. def generate_npc():
  54.     name1 = first_parts[d10()][d8()]
  55.     name2 = second_parts[d6()][d8()]
  56.     name3 = third_parts[d4()][d8()]
  57.  
  58.     print("Name: {}{}{}".format(name1, name2, name3))
  59.     print("Gender: {}".format(gender[d4()]))
  60.     print("Race: {}".format(race[d8()]))
  61.     print("Feature: {} {}".format(adjective[d6()], feature[d10()]))
  62.  
  63. if __name__ == '__main__':
  64.     # If user provides number of npcs they want, make that many, otherwise just make one
  65.     if len(sys.argv) > 1:
  66.         num_of_npcs = int(sys.argv[1])
  67.         for i in range(num_of_npcs):
  68.             generate_npc()
  69.     else:
  70.         generate_npc()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top