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

pathfinderElf.js (7613B)


      1 var nm1 = ["", "", "", "", "", "c", "d", "f", "g", "h", "k", "kr", "l", "m", "n", "s", "t", "th", "v", "z"];
      2 var nm2 = ["a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "a", "o", "o", "e", "e", "ae", "ia", "ie", "ea", "ei", "io"];
      3 var nm3 = ["ch", "cl", "cv", "dr", "dv", "g", "g", "g", "gl", "gr", "ghr", "ght", "h", "h", "h", "j", "j", "l", "l", "l", "l", "l", "l", "lm", "ln", "ldr", "lvr", "ld", "ldl", "ll", "ls", "lth", "lv", "m", "m", "m", "m", "mr", "mv", "n", "n", "n", "n", "nr", "nv", "nvr", "nth", "nd", "ndl", "ndr", "nl", "r", "r", "r", "r", "r", "rl", "rgr", "rg", "rd", "rdl", "rdr", "s", "s", "s", "s", "sh", "shn", "st", "sv", "sr", "sth", "t", "t", "t", "th", "th", "v", "v", "v", "vr", "y", "y", "y"];
      4 var nm4 = ["", "l", "m", "n", "r", "s", "ss", "l", "m", "n", "r", "s", "ss"];
      5 var nm5 = ["", "", "", "", "", "d", "f", "h", "j", "k", "l", "m", "n", "ph", "s", "sh", "t", "th", "v", "y"];
      6 var nm6 = ["a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "a", "o", "o", "e", "e", "ie", "ia", "ea", "au", "aa", "ao", "eae", "ou", "ae"];
      7 var nm7 = ["c", "c", "c", "cl", "cn", "cm", "d", "d", "d", "dr", "dn", "dm", "g", "g", "g", "gn", "gh", "gy", "h", "h", "h", "h", "hh", "hh", "hn", "hl", "hr", "l", "l", "l", "l", "l", "ll", "ll", "lm", "ln", "lhr", "lhn", "lv", "ls", "lsh", "ly", "ll", "m", "m", "m", "m", "mm", "mm", "mh", "mn", "mr", "n", "n", "n", "nn", "nn", "nd", "ndl", "ndr", "nn", "nr", "nth", "ns", "nl", "nh", "ny", "r", "r", "r", "rr", "rr", "rdl", "rl", "rn", "rv", "rs", "s", "s", "s", "ss", "ss", "sh", "shr", "sl", "th", "v", "v", "v", "y", "y", "y"];
      8 var nm8 = ["", "", "", "", "", "", "", "", "", "", "", "h", "l", "n", "s", "ss"];
      9 var nm9 = ["", "", "", "", "c", "d", "f", "g", "gr", "h", "j", "k", "l", "m", "n", "s", "sh", "t", "th", "v", "w", "y", "z", "zh"];
     10 var nm10 = ["a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "a", "e", "e", "o", "o", "ai", "ee", "ei", "ia", "ie", "ae", "io"];
     11 var nm11 = ["cl", "d", "d", "d", "dn", "dr", "g", "g", "g", "gh", "gl", "gr", "h", "h", "h", "hh", "j", "k", "k", "k", "l", "l", "l", "l", "l", "ll", "ll", "ll", "ld", "ldl", "ldr", "lf", "lhn", "lhr", "ll", "llm", "llv", "lm", "ln", "ls", "lv", "lvr", "m", "m", "m", "mm", "mm", "mn", "mr", "mv", "n", "n", "n", "nn", "n", "nd", "ndl", "ndr", "nl", "nn", "nr", "ns", "nth", "nv", "ph", "r", "r", "r", "rr", "rd", "rdl", "rg", "rl", "rm", "rr", "s", "s", "s", "ss", "ss", "sh", "sl", "ss", "st", "th", "tl", "v", "v", "v", "y", "y", "y"];
     12 var nm12 = ["", "", "h", "l", "m", "n", "r", "s"];
     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         rnd10 = Math.floor(Math.random() * nm9.length);
     22         rnd11 = Math.floor(Math.random() * nm10.length);
     23         rnd12 = Math.floor(Math.random() * nm12.length);
     24         if (i % 3 === 0 && i % 2 != 0) {
     25             rnd13 = Math.floor(Math.random() * nm11.length);
     26             rnd14 = Math.floor(Math.random() * nm10.length);
     27             nameLast = nm9[rnd10] + nm10[rnd11] + nm11[rnd13] + nm10[rnd14] + nm12[rnd12];
     28         } else if (i % 2 === 0) {
     29             rnd13 = Math.floor(Math.random() * nm11.length);
     30             rnd14 = Math.floor(Math.random() * nm10.length);
     31             rnd15 = Math.floor(Math.random() * nm11.length);
     32             rnd16 = Math.floor(Math.random() * nm10.length);
     33             nameLast = nm9[rnd10] + nm10[rnd11] + nm11[rnd13] + nm10[rnd14] + nm11[rnd15] + nm10[rnd16] + nm12[rnd12];
     34         } else {
     35             while (rnd10 < 4) {
     36                 rnd10 = Math.floor(Math.random() * nm9.length);
     37             }
     38             while (rnd12 < 2) {
     39                 rnd12 = Math.floor(Math.random() * nm12.length);
     40             }
     41             nameLast = nm9[rnd10] + nm10[rnd11] + nm12[rnd12];
     42         }
     43         if (tp === 1) {
     44             rnd = Math.floor(Math.random() * nm5.length);
     45             rnd2 = Math.floor(Math.random() * nm6.length);
     46             rnd3 = Math.floor(Math.random() * nm7.length);
     47             rnd4 = Math.floor(Math.random() * nm6.length);
     48             rnd5 = Math.floor(Math.random() * nm8.length);
     49             if (i < 4) {
     50                 names = nm5[rnd] + nm6[rnd2] + nm7[rnd3] + nm6[rnd4] + nm8[rnd5] + " " + nameLast;
     51             } else if (i < 8) {
     52                 rnd6 = Math.floor(Math.random() * nm7.length);
     53                 rnd7 = Math.floor(Math.random() * nm6.length);
     54                 names = nm5[rnd] + nm6[rnd2] + nm7[rnd3] + nm6[rnd4] + nm7[rnd6] + nm6[rnd7] + nm8[rnd5] + " " + nameLast;
     55             } else {
     56                 rnd6 = Math.floor(Math.random() * nm7.length);
     57                 rnd7 = Math.floor(Math.random() * nm6.length);
     58                 rnd8 = Math.floor(Math.random() * nm7.length);
     59                 rnd9 = Math.floor(Math.random() * nm6.length);
     60                 names = nm5[rnd] + nm6[rnd2] + nm7[rnd3] + nm6[rnd4] + nm7[rnd6] + nm6[rnd7] + nm7[rnd8] + nm6[rnd9] + nm8[rnd5] + " " + nameLast;
     61             }
     62         } else {
     63             rnd = Math.floor(Math.random() * nm1.length);
     64             rnd2 = Math.floor(Math.random() * nm2.length);
     65             rnd5 = Math.floor(Math.random() * nm4.length);
     66             if (i < 3) {
     67                 while (rnd < 5) {
     68                     rnd = Math.floor(Math.random() * nm1.length);
     69                 }
     70                 while (rnd5 === 0) {
     71                     rnd5 = Math.floor(Math.random() * nm4.length);
     72                 }
     73                 names = nm1[rnd] + nm2[rnd2] + nm4[rnd5] + "  " + nameLast;
     74             } else if (i < 7) {
     75                 rnd3 = Math.floor(Math.random() * nm3.length);
     76                 rnd4 = Math.floor(Math.random() * nm2.length);
     77                 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm4[rnd5] + " " + nameLast;
     78             } else if (i < 9) {
     79                 rnd3 = Math.floor(Math.random() * nm3.length);
     80                 rnd4 = Math.floor(Math.random() * nm2.length);
     81                 rnd6 = Math.floor(Math.random() * nm3.length);
     82                 rnd7 = Math.floor(Math.random() * nm2.length);
     83                 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm3[rnd6] + nm2[rnd7] + nm4[rnd5] + " " + nameLast;
     84             } else {
     85                 rnd3 = Math.floor(Math.random() * nm3.length);
     86                 rnd4 = Math.floor(Math.random() * nm2.length);
     87                 rnd6 = Math.floor(Math.random() * nm3.length);
     88                 rnd7 = Math.floor(Math.random() * nm2.length);
     89                 rnd8 = Math.floor(Math.random() * nm3.length);
     90                 rnd9 = Math.floor(Math.random() * nm2.length);
     91                 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm3[rnd6] + nm2[rnd7] + nm3[rnd8] + nm2[rnd9] + nm4[rnd5] + " " + nameLast;
     92             }
     93         }
     94         br = document.createElement('br');
     95         element.appendChild(document.createTextNode(names));
     96         element.appendChild(br);
     97     }
     98     if (document.getElementById("result")) {
     99         document.getElementById("placeholder").removeChild(document.getElementById("result"));
    100     }
    101     document.getElementById("placeholder").appendChild(element);
    102 }