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

diabloNephalem.js (2913B)


      1 var nm1 = ["", "", "", "", "b", "c", "d", "g", "j", "k", "l", "m", "n", "ph", "r", "t", "v", "w", "z"];
      2 var nm2 = ["a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "ia", "oe", "io", "y"];
      3 var nm3 = ["c", "dr", "gr", "l", "ld", "lm", "ln", "m", "md", "mn", "n", "nd", "r", "rl", "rd", "s", "ss", "th", "thm", "z"];
      4 var nm4 = ["", "", "", "", "", "b", "c", "d", "k", "l", "ln", "lm", "n", "r", "s"];
      5 var nm5 = ["", "", "", "", "", "ch", "h", "j", "l", "m", "n", "ph", "r", "rh", "s", "sh", "w", "z"];
      6 var nm6 = ["a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "y"];
      7 var nm7 = ["dr", "l", "ll", "lm", "ln", "ld", "m", "mn", "n", "nm", "nn", "nr", "mr", "lgr", "n", "r", "rl", "rn", "rm", "rsh", "s", "sh", "ss", "th"];
      8 var nm8 = ["", "", "", "", "", "l", "n", "r", "s", "sh"];
      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             nameFem();
     19             while (nMs === "") {
     20                 nameFem();
     21             }
     22         } else {
     23             nameMas();
     24             while (nMs === "") {
     25                 nameMas();
     26             }
     27         }
     28         br = document.createElement('br');
     29         element.appendChild(document.createTextNode(nMs));
     30         element.appendChild(br);
     31     }
     32     if (document.getElementById("result")) {
     33         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     34     }
     35     document.getElementById("placeholder").appendChild(element);
     36 }
     37 
     38 function nameFem() {
     39     rnd = Math.floor(Math.random() * nm5.length);
     40     rnd2 = Math.floor(Math.random() * nm6.length);
     41     rnd3 = Math.floor(Math.random() * nm7.length);
     42     rnd4 = Math.floor(Math.random() * nm6.length);
     43     rnd5 = Math.floor(Math.random() * nm8.length);
     44     if (i < 5) {
     45         nMs = nm5[rnd] + nm6[rnd2] + nm7[rnd3] + nm6[rnd4] + nm8[rnd5];
     46     } else {
     47         rnd6 = Math.floor(Math.random() * nm7.length);
     48         rnd7 = Math.floor(Math.random() * nm6.length);
     49         nMs = nm5[rnd] + nm6[rnd2] + nm7[rnd3] + nm6[rnd4] + nm7[rnd6] + nm6[rnd7] + nm8[rnd5];
     50     }
     51     testSwear(nMs);
     52 }
     53 
     54 function nameMas() {
     55     rnd = Math.floor(Math.random() * nm1.length);
     56     rnd2 = Math.floor(Math.random() * nm2.length);
     57     rnd3 = Math.floor(Math.random() * nm3.length);
     58     rnd4 = Math.floor(Math.random() * nm2.length);
     59     rnd5 = Math.floor(Math.random() * nm4.length);
     60     if (i < 5) {
     61         nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm4[rnd5];
     62     } else {
     63         rnd6 = Math.floor(Math.random() * nm3.length);
     64         rnd7 = Math.floor(Math.random() * nm2.length);
     65         nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm3[rnd6] + nm2[rnd7] + nm4[rnd5];
     66     }
     67     testSwear(nMs);
     68 }