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

wakfuFeca.js (2512B)


      1 var nm1 = ["a", "i", "o", "a", "o"];
      2 var nm2 = ["d", "l", "m", "n", "r", "s", "t", "y", "z"];
      3 var nm3 = ["a", "e", "o", "u", "o"];
      4 var nm4 = ["g", "k", "m", "n", "r", "s", "t", "v", "z"];
      5 var nm5 = ["a", "e", "o", "ei", "ae", "oi", "ai"];
      6 var nm6 = ["d", "f", "h", "l", "m", "n", "r", "s", "v", "y"];
      7 var nm7 = ["a", "e", "i", "e"];
      8 var nm8 = ["c", "g", "k", "l", "m", "n", "r", "s", "v", "y", "z"];
      9 var nm9 = ["a", "a", "e", "o", "i", "u"];
     10 var nm10 = ["l", "n", "s", "r", "v", "y", "z"];
     11 var nm11 = ["a", "e", "i", "a"];
     12 var br = "";
     13 
     14 function nameGen(type) {
     15     var tp = type;
     16     $('#placeholder').css('textTransform', 'capitalize');
     17     var element = document.createElement("div");
     18     element.setAttribute("id", "result");
     19     for (i = 0; i < 10; i++) {
     20         if (tp === 1) {
     21             nameFem();
     22             while (nMs === "") {
     23                 nameFem();
     24             }
     25         } else {
     26             nameMas();
     27             while (nMs === "") {
     28                 nameMas();
     29             }
     30         }
     31         br = document.createElement('br');
     32         element.appendChild(document.createTextNode(nMs));
     33         element.appendChild(br);
     34     }
     35     if (document.getElementById("result")) {
     36         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     37     }
     38     document.getElementById("placeholder").appendChild(element);
     39 }
     40 
     41 function nameMas() {
     42     rnd = Math.random() * nm1.length | 0;
     43     rnd2 = Math.random() * nm2.length | 0;
     44     rnd3 = Math.random() * nm3.length | 0;
     45     rnd4 = Math.random() * nm4.length | 0;
     46     rnd5 = Math.random() * nm5.length | 0;
     47     while (nm2[rnd2] === nm4[rnd4]) {
     48         rnd2 = Math.random() * nm2.length | 0;
     49     }
     50     nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm5[rnd5];
     51     testSwear(nMs);
     52 }
     53 
     54 function nameFem() {
     55     nTp = Math.random() * 3 | 0;
     56     rnd = Math.random() * nm6.length | 0;
     57     rnd2 = Math.random() * nm7.length | 0;
     58     rnd3 = Math.random() * nm8.length | 0;
     59     rnd4 = Math.random() * nm9.length | 0;
     60     if (nTp < 2) {
     61         while (nm6[rnd] === nm8[rnd3]) {
     62             rnd3 = Math.random() * nm8.length | 0;
     63         }
     64         nMs = nm6[rnd] + nm7[rnd2] + nm8[rnd3] + nm9[rnd4];
     65     } else {
     66         rnd5 = Math.random() * nm10.length | 0;
     67         rnd6 = Math.random() * nm11.length | 0;
     68         while (nm10[rnd5] === nm8[rnd2]) {
     69             rnd5 = Math.random() * nm10.length | 0;
     70         }
     71         nMs = nm6[rnd] + nm7[rnd2] + nm8[rnd3] + nm9[rnd4] + nm10[rnd5] + nm11[rnd6];
     72     }
     73     testSwear(nMs);
     74 }