offline-fantasy-name-generators

Offline version of www.fantasynamegenerators.com
git clone https://git.neptards.moe/neptards/offline-fantasy-name-generators.git
Log | Files | Refs | README

mgtGods.js (4795B)


      1 var nm1 = ["c", "cr", "h", "k", "kr", "m", "n", "ph", "v", "x", "z"];
      2 var nm2 = ["a", "e", "i", "o", "u"];
      3 var nm3 = ["d", "fr", "g", "l", "ll", "lr", "n", "ph", "r", "rph", "rv", "rc", "rk", "rl", "th", "thr", "v", "z"];
      4 var nm4 = ["a", "i", "o", "a", "i", "o", "io", "ia", "oa", "eo"];
      5 var nm5 = ["b", "d", "g", "l", "n", "r", "t", "z"];
      6 var nm6 = ["d", "s", "t", "th", "x", "s", "s", "x", "x", "s", "s", "s"];
      7 var nm7 = ["c", "f", "h", "k", "l", "m", "n", "ph", "th"];
      8 var nm8 = ["a", "e", "i", "a", "e", "i", "y"];
      9 var nm9 = ["l", "ll", "m", "n", "ph", "r", "rr", "s", "sh", "ss", "th"];
     10 var nm10 = ["a", "e", "i", "a", "e", "i", "ea", "ae", "ia", "oe"];
     11 var nm11 = ["c", "h", "k", "l", "n", "r", "ss", "tr", "y"];
     12 var nm12 = ["Abundance", "Agriculture", "Animals", "Battle", "Beauty", "Beer", "Beginnings", "Blacksmiths", "Chaos", "Children", "Chivalry", "Commerce", "Conquest", "Dawn", "Day", "Death", "Destiny", "Destruction", "Dreams", "Dusk", "Duty", "Earth", "Education", "Endings", "Envy", "Fall", "Fame", "Fertility", "Finance", "Fire", "Forgiveness", "Fortune", "Freedom", "Funerals", "Good Luck", "Governance", "Harvest", "Hatred", "Health", "Home", "Honesty", "Honor", "Hope", "Hunting", "Infamy", "Jealousy", "Judgement", "Justice", "Law", "Life", "Life & Death", "Light", "Logic", "Love", "Loyalty", "Magic", "Marriage", "Medicine", "Mercy", "Messages", "Miracles", "Misfortune", "Music", "Nature", "Night", "Night & Day", "Oracles", "Order", "Peace", "Penance", "Pleasure", "Poetry", "Prosperity", "Revenge", "Science", "Secrecy", "Shadows", "Sleep", "Spring", "Strength", "Success", "Summer", "Thunder", "Time", "Torture", "Trade", "Tranquility", "Tricks", "Truth", "Vengeance", "Victory", "Virtues", "War", "Water", "Weddings", "Wind", "Wine", "Winter", "Wisdom", "Work", "Youth", "the Afterlife", "the Dark", "the Hearth", "the Hunt", "the Insane", "the Land", "the Military", "the Moon", "the Mountains", "the Ocean", "the Ostracized", "the Rivers", "the Sea", "the Sky", "the Stars", "the Sun", "the Underworld"];
     13 var br = "";
     14 
     15 function nameGen(type) {
     16     $('#placeholder').css('textTransform', 'capitalize');
     17     var tp = type;
     18     var element = document.createElement("div");
     19     element.setAttribute("id", "result");
     20     for (i = 0; i < 10; i++) {
     21         rnd12 = Math.floor(Math.random() * nm12.length);
     22         if (tp === 1) {
     23             rnd = Math.floor(Math.random() * nm7.length);
     24             rnd2 = Math.floor(Math.random() * nm8.length);
     25             rnd3 = Math.floor(Math.random() * nm9.length);
     26             rnd4 = Math.floor(Math.random() * nm10.length);
     27             if (i < 5) {
     28                 while (nm9[rnd3] === nm7[rnd]) {
     29                     rnd3 = Math.floor(Math.random() * nm9.length);
     30                 }
     31                 names = nm7[rnd] + nm8[rnd2] + nm9[rnd3] + nm10[rnd4] + ", God of " + nm12[rnd12];
     32             } else {
     33                 rnd5 = Math.floor(Math.random() * nm8.length);
     34                 rnd6 = Math.floor(Math.random() * nm11.length);
     35                 if (i < 7) {
     36                     names = nm7[rnd] + nm8[rnd2] + nm9[rnd3] + nm10[rnd4] + nm11[rnd6] + nm8[rnd5] + ", God of " + nm12[rnd12];
     37                 } else {
     38                     names = nm7[rnd] + nm8[rnd2] + nm9[rnd3] + nm8[rnd5] + nm11[rnd6] + nm10[rnd4] + ", God of " + nm12[rnd12];
     39                 }
     40             }
     41         } else {
     42             rnd = Math.floor(Math.random() * nm1.length);
     43             rnd2 = Math.floor(Math.random() * nm2.length);
     44             rnd3 = Math.floor(Math.random() * nm3.length);
     45             rnd4 = Math.floor(Math.random() * nm4.length);
     46             rnd5 = Math.floor(Math.random() * nm6.length);
     47             if (i < 5) {
     48                 while (nm3[rnd3] === nm1[rnd]) {
     49                     rnd3 = Math.floor(Math.random() * nm3.length);
     50                 }
     51                 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm6[rnd5] + ", God of " + nm12[rnd12];
     52             } else {
     53                 rnd6 = Math.floor(Math.random() * nm2.length);
     54                 rnd7 = Math.floor(Math.random() * nm5.length);
     55                 if (i < 7) {
     56                     names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm5[rnd7] + nm2[rnd6] + nm6[rnd5] + ", God of " + nm12[rnd12];
     57                 } else {
     58                     names = nm1[rnd] + nm2[rnd2] + nm5[rnd7] + nm2[rnd6] + nm3[rnd3] + nm4[rnd4] + nm6[rnd5] + ", God of " + nm12[rnd12];
     59                 }
     60             }
     61         }
     62         br = document.createElement('br');
     63         element.appendChild(document.createTextNode(names));
     64         element.appendChild(br);
     65     }
     66     if (document.getElementById("result")) {
     67         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     68     }
     69     document.getElementById("placeholder").appendChild(element);
     70 }