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

wowRedDragons.js (3202B)


      1 var nm1 = ["", "", "", "", "b", "c", "d", "g", "h", "k", "m", "n", "r", "s", "t", "v", "z"];
      2 var nm2 = ["a", "e", "o", "a", "e", "o", "a", "e", "o", "u", "y", "ae"];
      3 var nm3 = ["cr", "d", "dr", "fr", "l", "lg", "ln", "m", "ndr", "q", "r", "rdr", "rd", "rg", "rr", "rsh", "str", "vr"];
      4 var nm4 = ["a", "e", "i", "o", "a", "e", "i", "o", "a", "e", "i", "o", "a", "e", "i", "o", "ia", "io"];
      5 var nm5 = ["d", "k", "n", "r", "s"];
      6 var nm6 = ["", "", "a", "i", "o"];
      7 var nm7 = ["strasz", "strasz", "strasz", "strasz", "strasz", "strasz", "sanz", "rasz"];
      8 var nm8 = ["", "", "", "", "", "c", "g", "h", "k", "n", "r", "rh", "s", "t", "th", "v", "x", "z"];
      9 var nm9 = ["a", "e", "o", "y", "a", "e", "o", "y", "ea", "ie", "au"];
     10 var nm10 = ["h", "l", "m", "n", "r", "tr", "v"];
     11 var nm11 = ["a", "e", "i"];
     12 var nm12 = ["", "", "", "c", "k", "l", "n", "x"];
     13 var br = "";
     14 
     15 function nameGen(type) {
     16     var tp = type;
     17     $('#placeholder').css('textTransform', 'capitalize');
     18     var element = document.createElement("div");
     19     element.setAttribute("id", "result");
     20     for (i = 0; i < 10; i++) {
     21         if (tp === 1) {
     22             nameFem();
     23             while (nMs === "") {
     24                 nameFem();
     25             }
     26             nMs = nMs + "strasza";
     27         } else {
     28             nameMas();
     29             while (nMs === "") {
     30                 nameMas();
     31             }
     32             rnd6 = Math.random() * nm7.length | 0;
     33             nMs = nMs + nm7[rnd6];
     34         }
     35         br = document.createElement('br');
     36         element.appendChild(document.createTextNode(nMs));
     37         element.appendChild(br);
     38     }
     39     if (document.getElementById("result")) {
     40         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     41     }
     42     document.getElementById("placeholder").appendChild(element);
     43 }
     44 
     45 function nameMas() {
     46     rnd = Math.random() * nm1.length | 0;
     47     rnd2 = Math.random() * nm2.length | 0;
     48     if (i < 3) {
     49         while (nm1[rnd] === "") {
     50             rnd = Math.random() * nm1.length | 0;
     51         }
     52         nMs = nm1[rnd] + nm2[rnd2];
     53     } else {
     54         rnd3 = Math.random() * nm3.length | 0;
     55         rnd4 = Math.random() * nm4.length | 0;
     56         if (i < 7) {
     57             while (nm3[rnd3] === nm1[rnd]) {
     58                 rnd3 = Math.random() * nm3.length | 0;
     59             }
     60             nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4];
     61         } else {
     62             rnd5 = Math.random() * nm5.length | 0;
     63             rnd6 = Math.random() * nm6.length | 0;
     64             while (nm3[rnd3] === nm1[rnd] || nm3[rnd3] === nm5[rnd5]) {
     65                 rnd3 = Math.random() * nm3.length | 0;
     66             }
     67             nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm5[rnd5] + nm6[rnd6];
     68         }
     69     }
     70     testSwear(nMs);
     71 }
     72 
     73 function nameFem() {
     74     rnd = Math.random() * nm8.length | 0;
     75     rnd2 = Math.random() * nm9.length | 0;
     76     rnd3 = Math.random() * nm10.length | 0;
     77     rnd4 = Math.random() * nm11.length | 0;
     78     rnd5 = Math.random() * nm12.length | 0;
     79     while (nm10[rnd3] === nm8[rnd] || nm10[rnd3] === nm12[rnd5]) {
     80         rnd3 = Math.random() * nm10.length | 0;
     81     }
     82     nMs = nm8[rnd] + nm9[rnd2] + nm10[rnd3] + nm11[rnd4] + nm12[rnd5];
     83     testSwear(nMs);
     84 }