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

wakfuEcaflip.js (2902B)


      1 var nm1 = ["ch", "d", "g", "k", "n", "q", "r", "t", "v", "y", "z"];
      2 var nm2 = ["a", "e", "i", "o", "u", "a", "e", "ue", "ua", "ei"];
      3 var nm3 = ["ch", "d", "dr", "gr", "gch", "ll", "lch", "lr", "lt", "lch", "n", "nd", "nk", "nt", "r", "rr", "rn", "rt", "t", "tt", "th", "tch", "z"];
      4 var nm4 = ["a", "i", "u", "a", "i", "e"];
      5 var nm5 = ["b", "d", "g", "m", "n", "sh", "z"];
      6 var nm6 = ["f", "h", "l", "m", "n", "ph", "v", "z"];
      7 var nm7 = ["a", "e", "i", "a", "e", "i", "o"];
      8 var nm8 = ["h", "l", "m", "r", "s", "v", "y", "z"];
      9 var nm9 = ["a", "a", "e", "i", "o"];
     10 var nm10 = ["d", "l", "ll", "ln", "lm", "n", "nd", "nn", "r", "rn", "rl", "y", "z", "zh"];
     11 var nm11 = ["a", "a", "e", "i", "o", "a", "e", "i"];
     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         nameMas();
     21         while (nMs === "") {
     22             nameMas();
     23         }
     24         names = nMs;
     25         if (tp === 1) {
     26             nameFem();
     27             while (nMs === "") {
     28                 nameFem();
     29             }
     30         } else {
     31             nameMas();
     32             while (nMs === "") {
     33                 nameMas();
     34             }
     35         }
     36         names = nMs + " " + names;
     37         br = document.createElement('br');
     38         element.appendChild(document.createTextNode(names));
     39         element.appendChild(br);
     40     }
     41     if (document.getElementById("result")) {
     42         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     43     }
     44     document.getElementById("placeholder").appendChild(element);
     45 }
     46 
     47 function nameMas() {
     48     nTp = Math.random() * 4 | 0;
     49     rnd = Math.random() * nm1.length | 0;
     50     rnd2 = Math.random() * nm2.length | 0;
     51     if (nTp === 0) {
     52         rnd3 = Math.random() * nm5.length | 0;
     53         nMs = nm1[rnd] + nm2[rnd2] + nm5[rnd3];
     54     } else {
     55         rnd3 = Math.random() * nm3.length | 0;
     56         rnd4 = Math.random() * nm4.length | 0;
     57         if (nTp === 1) {
     58             rnd5 = Math.random() * nm3.length | 0;
     59             rnd6 = Math.random() * nm2.length | 0;
     60             nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd6] + nm3[rnd5] + nm4[rnd4];
     61         } else {
     62             nMs = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4];
     63         }
     64     }
     65     testSwear(nMs);
     66 }
     67 
     68 function nameFem() {
     69     nTp = Math.random() * 4 | 0;
     70     rnd = Math.random() * nm6.length | 0;
     71     rnd2 = Math.random() * nm7.length | 0;
     72     rnd3 = Math.random() * nm8.length | 0;
     73     rnd4 = Math.random() * nm9.length | 0;
     74     if (nTp < 3) {
     75         rnd5 = Math.random() * nm7.length | 0;
     76         rnd6 = Math.random() * nm8.length | 0;
     77         nMs = nm6[rnd] + nm7[rnd2] + nm8[rnd3] + nm7[rnd5] + nm8[rnd6] + nm9[rnd4];
     78     } else {
     79         nMs = nm6[rnd] + nm7[rnd2] + nm8[rnd3] + nm9[rnd4];
     80     }
     81     testSwear(nMs);
     82 }