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

wakfuCra.js (2188B)


      1 var nm1 = ["cl", "fl", "gl", "h", "l", "m", "n", "r", "y", "v", "z"];
      2 var nm2 = ["a", "o", "u", "a", "o", "u", "i"];
      3 var nm3 = ["b", "g", "p", "r", "s", "t", "v", "z"];
      4 var nm4 = ["a", "e", "i", "o", "a", "e", "i"];
      5 var nm5 = ["c", "l", "m", "n", "s", "th"];
      6 var nm6 = ["c", "cl", "chl", "f", "fl", "g", "h", "l", "m", "n", "ph", "s", "t", "v", "z"];
      7 var nm7 = ["eo", "oi", "ea", "a", "e", "i", "y", "a", "e", "i", "a", "e", "i"];
      8 var nm8 = ["ch", "l", "ll", "m", "n", "nn", "ph", "r", "s", "z"];
      9 var nm9 = ["a", "e", "a", "e", "ee", "ia", "ie"];
     10 var br = "";
     11 
     12 function nameGen(type) {
     13     var tp = type;
     14     $('#placeholder').css('textTransform', 'capitalize');
     15     var element = document.createElement("div");
     16     element.setAttribute("id", "result");
     17     for (i = 0; i < 10; i++) {
     18         if (tp === 1) {
     19             nameFem();
     20             while (nMs === "") {
     21                 nameFem();
     22             }
     23         } else {
     24             nameMas();
     25             while (nMs === "") {
     26                 nameMas();
     27             }
     28         }
     29         br = document.createElement('br');
     30         element.appendChild(document.createTextNode(nMs));
     31         element.appendChild(br);
     32     }
     33     if (document.getElementById("result")) {
     34         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     35     }
     36     document.getElementById("placeholder").appendChild(element);
     37 }
     38 
     39 function nameMas() {
     40     rnd = Math.random() * nm1.length | 0;
     41     rnd2 = Math.random() * nm2.length | 0;
     42     rnd3 = Math.random() * nm3.length | 0;
     43     rnd4 = Math.random() * nm4.length | 0;
     44     rnd5 = Math.random() * nm5.length | 0;
     45     while (nm1[rnd] === nm3[rnd3] || nm3[rnd3] === nm5[rnd5]) {
     46         rnd3 = Math.random() * nm3.length | 0;
     47     }
     48     nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm5[rnd5];
     49     testSwear(nMs);
     50 }
     51 
     52 function nameFem() {
     53     rnd = Math.random() * nm6.length | 0;
     54     rnd2 = Math.random() * nm7.length | 0;
     55     rnd3 = Math.random() * nm8.length | 0;
     56     rnd4 = Math.random() * nm9.length | 0;
     57     while (nm6[rnd] === nm8[rnd3]) {
     58         rnd3 = Math.random() * nm8.length | 0;
     59     }
     60     nMs = nm6[rnd] + nm7[rnd2] + nm8[rnd3] + nm9[rnd4];
     61     testSwear(nMs);
     62 }