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

pathfinderUndine.js (3513B)


      1 var nm1 = ["", "", "", "", "", "bh", "d", "dh", "g", "gh", "j", "kh", "m", "n", "r", "rh", "sh", "v", "z"];
      2 var nm2 = ["a", "e", "i", "o", "a", "e", "i", "o", "a", "e", "i", "o", "a", "e", "i", "o", "a", "e", "i", "o", "a", "e", "i", "o", "aa", "oo"];
      3 var nm3 = ["b", "bd", "c", "cd", "d", "dd", "db", "g", "gd", "gv", "gn", "gm", "j", "k", "kb", "kd", "kn", "km", "kv", "m", "md", "mm", "mb", "n", "nn", "nb", "nd", "r", "rd", "rg", "rv", "rz", "v", "b", "c", "d", "g", "j", "k", "m", "n", "r", "v"];
      4 var nm4 = ["d", "hz", "j", "k", "m", "n", "r", "sh", "v"];
      5 var nm5 = ["", "", "", "b", "c", "d", "f", "h", "l", "m", "n", "p", "r", "s", "w", "z"];
      6 var nm6 = ["a", "e", "i", "u", "a", "e", "i", "u", "a", "e", "i", "u", "a", "e", "i", "u", "a", "e", "i", "u", "y", "y", "y", "ya", "aa"];
      7 var nm7 = ["b", "bh", "d", "dz", "dh", "fd", "fn", "ff", "f", "fz", "hn", "hl", "hr", "hm", "h", "hh", "l", "lg", "ld", "lb", "lf", "ln", "m", "mm", "mn", "mr", "mf", "n", "nn", "nr", "nd", "nf", "nh", "r", "rh", "rb", "rv", "rd", "rz", "v", "vr", "b", "d", "f", "h", "l", "n", "m", "r", "v", "b", "d", "f", "h", "l", "n", "m", "r", "v"];
      8 var nm8 = ["", "", "", "", "", "", "", "", "", "", "h", "n"];
      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             rnd = Math.floor(Math.random() * nm5.length);
     19             rnd2 = Math.floor(Math.random() * nm6.length);
     20             rnd3 = Math.floor(Math.random() * nm7.length);
     21             rnd4 = Math.floor(Math.random() * nm6.length);
     22             rnd5 = Math.floor(Math.random() * nm8.length);
     23             if (i < 5) {
     24                 names = nm5[rnd] + nm6[rnd2] + nm7[rnd3] + nm6[rnd4] + nm8[rnd5];
     25             } else {
     26                 rnd6 = Math.floor(Math.random() * nm7.length);
     27                 rnd7 = Math.floor(Math.random() * nm6.length);
     28                 names = nm5[rnd] + nm6[rnd2] + nm7[rnd3] + nm6[rnd4] + nm7[rnd6] + nm6[rnd7] + nm8[rnd5];
     29             }
     30         } else {
     31             rnd = Math.floor(Math.random() * nm1.length);
     32             rnd2 = Math.floor(Math.random() * nm2.length);
     33             rnd5 = Math.floor(Math.random() * nm4.length);
     34             if (i < 3) {
     35                 while (rnd < 5) {
     36                     rnd = Math.floor(Math.random() * nm1.length);
     37                 }
     38                 names = nm1[rnd] + nm2[rnd2] + nm4[rnd5];
     39             } else if (i < 7) {
     40                 rnd3 = Math.floor(Math.random() * nm3.length);
     41                 rnd4 = Math.floor(Math.random() * nm2.length);
     42                 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm4[rnd5];
     43             } else {
     44                 rnd3 = Math.floor(Math.random() * nm3.length);
     45                 rnd4 = Math.floor(Math.random() * nm2.length);
     46                 rnd6 = Math.floor(Math.random() * nm3.length);
     47                 rnd7 = Math.floor(Math.random() * nm2.length);
     48                 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm3[rnd6] + nm2[rnd7] + nm4[rnd5];
     49             }
     50         }
     51         br = document.createElement('br');
     52         element.appendChild(document.createTextNode(names));
     53         element.appendChild(br);
     54     }
     55     if (document.getElementById("result")) {
     56         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     57     }
     58     document.getElementById("placeholder").appendChild(element);
     59 }