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

wowTolvir.js (2427B)


      1 var nm1 = ["", "", "", "", "", "b", "c", "ch", "cr", "d", "g", "gh", "h", "j", "k", "m", "n", "ph", "s", "t", "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", "e", "i", "o", "u", "y", "ya", "ae", "ao", "oe", "ai"];
      3 var nm3 = ["b", "bh", "d", "h", "k", "kh", "l", "lh", "m", "md", "mkh", "mm", "n", "nb", "nh", "njt", "nkh", "nr", "nt", "r", "rm", "rs", "rw", "s", "sh", "t", "th", "v", "z"];
      4 var nm4 = ["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", "aa", "uu"];
      5 var nm5 = ["b", "bh", "d", "g", "h", "k", "l", "lh", "m", "n", "nh", "q", "r", "s", "sh", "ss", "t", "th", "v", "z"];
      6 var nm6 = ["", "", "", "", "", "d", "f", "hn", "l", "m", "n", "p", "ph", "q", "r", "s", "sh", "t", "th", "x"];
      7 var br = "";
      8 
      9 function nameGen(type) {
     10     var tp = type;
     11     $('#placeholder').css('textTransform', 'capitalize');
     12     var element = document.createElement("div");
     13     element.setAttribute("id", "result");
     14     for (i = 0; i < 10; i++) {
     15         nameMas();
     16         while (nMs === "") {
     17             nameMas();
     18         }
     19         br = document.createElement('br');
     20         element.appendChild(document.createTextNode(nMs));
     21         element.appendChild(br);
     22     }
     23     if (document.getElementById("result")) {
     24         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     25     }
     26     document.getElementById("placeholder").appendChild(element);
     27 }
     28 
     29 function nameMas() {
     30     nTp = Math.random() * 2 | 0;
     31     rnd = Math.random() * nm1.length | 0;
     32     rnd2 = Math.random() * nm2.length | 0;
     33     rnd3 = Math.random() * nm3.length | 0;
     34     rnd4 = Math.random() * nm4.length | 0;
     35     rnd5 = Math.random() * nm6.length | 0;
     36     while (nm3[rnd3] === nm1[rnd] || nm3[rnd3] === nm6[rnd5]) {
     37         rnd3 = Math.random() * nm3.length | 0;
     38     }
     39     if (nTp < 4) {
     40         rnd6 = Math.random() * nm5.length | 0;
     41         rnd7 = Math.random() * nm4.length | 0;
     42         while (nm5[rnd6] === nm3[rnd3]) {
     43             rnd6 = Math.random() * nm5.length | 0;
     44         }
     45         nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm5[rnd6] + nm4[rnd7] + nm6[rnd5];
     46     } else {
     47         nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm6[rnd5];
     48     }
     49     testSwear(nMs);
     50 }