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

warhammerWoodelves.js (3012B)


      1 var nm1 = ["", "", "", "c", "d", "dh", "g", "k", "kh", "sc", "str", "t", "th", "tr", "v", "z"];
      2 var nm2 = ["a", "i", "o", "u", "a", "i", "o", "u", "a", "i", "o", "u", "a", "a", "o", "o", "a", "o", "o", "a", "io", "aa", "ae", "ia"];
      3 var nm3 = ["c", "d", "k", "l", "r", "c", "d", "k", "l", "r", "c", "cc", "cr", "dr", "d", "k", "kk", "lc", "lg", "lk", "ll", "lt", "lv", "l", "r", "rl", "rt", "rc", "rg", "rn", "sc", "sr", "st", "sl", "th", "tr", "tt", "zc", "zk", "zl"];
      4 var nm4 = ["", "", "", "c", "n", "s", "t", "th"];
      5 var nm5 = ["", "", "", "", "", "d", "dh", "dr", "f", "h", "l", "m", "n", "ph", "q", "s", "th", "v", "y"];
      6 var nm6 = ["a", "e", "i", "y", "a", "e", "i", "y", "a", "e", "i", "y", "a", "e", "a", "a", "e", "e", "ie", "ae"];
      7 var nm7 = ["c", "cc", "ch", "d", "dd", "dr", "h", "hh", "lc", "ll", "lv", "ls", "lt", "lth", "ln", "lm", "l", "n", "nn", "nr", "nv", "nd", "ph", "r", "rl", "rr", "rv", "rl", "s", "ss", "sh", "st", "str", "sv", "t", "th", "tr", "v"];
      8 var nm8 = ["", "", "", "", "f", "h", "l", "n", "s", "th"];
      9 var br = "";
     10 
     11 function nameGen(type) {
     12     $('#placeholder').css('textTransform', 'capitalize');
     13     var tp = type;
     14     var element = document.createElement("div");
     15     element.setAttribute("id", "result");
     16     for (i = 0; i < 10; i++) {
     17         if (tp === 1) {
     18             rnd = Math.floor(Math.random() * nm5.length);
     19             rnd2 = Math.floor(Math.random() * nm6.length);
     20             rnd3 = Math.floor(Math.random() * nm7.length);
     21             rnd4 = Math.floor(Math.random() * nm6.length);
     22             rnd5 = Math.floor(Math.random() * nm8.length);
     23             if (i < 5) {
     24                 names = nm5[rnd] + nm6[rnd2] + nm7[rnd3] + nm6[rnd4] + nm8[rnd5];
     25             } else {
     26                 rnd6 = Math.floor(Math.random() * nm7.length);
     27                 rnd7 = Math.floor(Math.random() * nm6.length);
     28                 names = nm5[rnd] + nm6[rnd2] + nm7[rnd3] + nm6[rnd4] + nm7[rnd6] + nm6[rnd7] + nm8[rnd5];
     29             }
     30         } else {
     31             rnd = Math.floor(Math.random() * nm1.length);
     32             rnd2 = Math.floor(Math.random() * nm2.length);
     33             rnd3 = Math.floor(Math.random() * nm3.length);
     34             rnd4 = Math.floor(Math.random() * nm2.length);
     35             rnd5 = Math.floor(Math.random() * nm4.length);
     36             if (i < 5) {
     37                 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm4[rnd5];
     38             } else {
     39                 rnd6 = Math.floor(Math.random() * nm3.length);
     40                 rnd7 = Math.floor(Math.random() * nm2.length);
     41                 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm3[rnd6] + nm2[rnd7] + nm4[rnd5];
     42             }
     43         }
     44         br = document.createElement('br');
     45         element.appendChild(document.createTextNode(names));
     46         element.appendChild(br);
     47     }
     48     if (document.getElementById("result")) {
     49         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     50     }
     51     document.getElementById("placeholder").appendChild(element);
     52 }