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

wakfuIop.js (3239B)


      1 var nm1 = ["ch", "dr", "g", "gr", "l", "n", "p", "s", "tr", "v", "y"];
      2 var nm2 = ["a", "e", "i", "a", "e", "i", "o", "u", "au", "ou", "ie"];
      3 var nm3 = ["dr", "f", "ff", "ln", "ld", "ldr", "lt", "rn", "rc", "rd", "st", "st", "sn", "v", "z"];
      4 var nm4 = ["a", "e", "i", "o", "e"];
      5 var nm5 = ["b", "d", "g", "m", "l", "n", "p", "v", "z"];
      6 var nm6 = ["a", "e", "i", "a", "e", "i", "o"];
      7 var nm7 = ["l", "ll", "n", "nd", "r", "rd", "s", "st"];
      8 var nm8 = ["", "", "", "c", "f", "h", "n", "ph", "t", "y", "z"];
      9 var nm9 = ["a", "e", "a", "e", "i", "o"];
     10 var nm10 = ["b", "d", "l", "m", "n", "r", "v", "y", "z"];
     11 var nm11 = ["a", "e", "i", "o"];
     12 var nm12 = ["c", "h", "l", "m", "n", "r", "s", "t", "v"];
     13 var nm13 = ["e", "i", "y", "e", "i", "y", "e", "i", "y", "o", "ie", "ia", "ile", "elle", "ine"];
     14 var br = "";
     15 
     16 function nameGen(type) {
     17     var tp = type;
     18     $('#placeholder').css('textTransform', 'capitalize');
     19     var element = document.createElement("div");
     20     element.setAttribute("id", "result");
     21     for (i = 0; i < 10; i++) {
     22         if (tp === 1) {
     23             nameFem();
     24             while (nMs === "") {
     25                 nameFem();
     26             }
     27         } else {
     28             nameMas();
     29             while (nMs === "") {
     30                 nameMas();
     31             }
     32         }
     33         br = document.createElement('br');
     34         element.appendChild(document.createTextNode(nMs));
     35         element.appendChild(br);
     36     }
     37     if (document.getElementById("result")) {
     38         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     39     }
     40     document.getElementById("placeholder").appendChild(element);
     41 }
     42 
     43 function nameMas() {
     44     nTp = Math.random() * 3 | 0;
     45     rnd = Math.random() * nm1.length | 0;
     46     rnd2 = Math.random() * nm2.length | 0;
     47     rnd3 = Math.random() * nm3.length | 0;
     48     rnd4 = Math.random() * nm6.length | 0;
     49     rnd5 = Math.random() * nm7.length | 0;
     50     while (nm1[rnd] === nm3[rnd3] || nm3[rnd3] === nm7[rnd5]) {
     51         rnd3 = Math.random() * nm3.length | 0;
     52     }
     53     if (nTp < 2) {
     54         nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm6[rnd4] + nm7[rnd5];
     55     } else {
     56         rnd6 = Math.random() * nm4.length | 0;
     57         rnd7 = Math.random() * nm5.length | 0;
     58         while (nm3[rnd3] === nm5[rnd7] || nm5[rnd7] === nm7[rnd5]) {
     59             rnd7 = Math.random() * nm5.length | 0;
     60         }
     61         nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd6] + nm5[rnd7] + nm6[rnd4] + nm7[rnd5];
     62     }
     63     testSwear(nMs);
     64 }
     65 
     66 function nameFem() {
     67     nTp = Math.random() * 3 | 0;
     68     rnd = Math.random() * nm8.length | 0;
     69     rnd2 = Math.random() * nm9.length | 0;
     70     rnd3 = Math.random() * nm12.length | 0;
     71     rnd4 = Math.random() * nm13.length | 0;
     72     if (nTp === 0) {
     73         while (nm8[rnd] === nm12[rnd3]) {
     74             rnd3 = Math.random() * nm12.length | 0;
     75         }
     76         nMs = nm8[rnd] + nm9[rnd2] + nm12[rnd3] + nm13[rnd4];
     77     } else {
     78         rnd5 = Math.random() * nm10.length | 0;
     79         rnd6 = Math.random() * nm11.length | 0;
     80         while (nm8[rnd] === nm10[rnd5] || nm10[rnd5] === nm12[rnd3]) {
     81             rnd5 = Math.random() * nm10.length | 0;
     82         }
     83         nMs = nm8[rnd] + nm9[rnd2] + nm10[rnd5] + nm11[rnd6] + nm12[rnd3] + nm13[rnd4];
     84     }
     85     testSwear(nMs);
     86 }