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

togrutaNames.js (3399B)


      1 var nm0 = ["", "", "", "", "", "", "", "", "", "a", "o", "u"];
      2 var nm1 = ["b", "c", "d", "h", "k", "m", "r", "s", "t", "v", "z"];
      3 var nm2 = ["a", "o", "u"];
      4 var nm3 = ["b", "br", "d", "k", "kr", "ky", "l", "n", "nz", "r", "rh", "s", "sht", "t", "vr", "z"];
      5 var nm4 = ["a", "aa", "ee", "i", "o", "y"];
      6 var nm5 = ["", "", "", "", "", "", "", "hd", "k", "n", "m", "r", "s", "sh"];
      7 var nm6 = ["", "", "", "", "a", "a", "o", "a"];
      8 var nm7 = ["b", "c", "d", "h", "k", "l", "m", "n", "r", "s", "sh", "z"];
      9 var nm8 = ["a", "aa", "e", "o"];
     10 var nm9 = ["d", "hn", "hl", "hs", "k", "l", "m", "mn", "n", "r", "rl", "rsh", "rn", "s", "ss", "sh", "shl", "t", "th", "tt"];
     11 var nm10 = ["a", "aa", "a", "a", "o"];
     12 var nm11 = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "n", "m", "h", "s", "sh"];
     13 var nm12 = ["b", "d", "h", "k", "l", "m", "n", "ph", "r", "s", "t", "v", "z"];
     14 var nm13 = ["a", "y", "aa", "i", "e"];
     15 var nm14 = ["br", "d", "k", "kr", "l", "m", "n", "r", "rn", "rl", "s", "ss", "sh", "shr", "vr", "w", "z"];
     16 var nm15 = ["a", "aa", "e", "u", "y", "a", "e", "u", "i", "o", "o", "ii", "ua", "ee"];
     17 var nm16 = ["", "", "", "", "ks", "l", "n", "m", "r", "s", "sh"];
     18 var br = "";
     19 
     20 function nameGen(type) {
     21     $('#placeholder').css('textTransform', 'capitalize');
     22     var tp = type;
     23     var element = document.createElement("div");
     24     element.setAttribute("id", "result");
     25     for (i = 0; i < 10; i++) {
     26         if (i < 5) {
     27             rnd = Math.floor(Math.random() * nm12.length);
     28             rnd2 = Math.floor(Math.random() * nm13.length);
     29             rnd3 = Math.floor(Math.random() * nm14.length);
     30             rnd4 = Math.floor(Math.random() * nm15.length);
     31             rnd5 = Math.floor(Math.random() * nm16.length);
     32             lName = nm12[rnd] + nm13[rnd2] + nm14[rnd3] + nm15[rnd4] + nm16[rnd5];
     33         } else {
     34             rnd = Math.floor(Math.random() * nm12.length);
     35             rnd2 = Math.floor(Math.random() * nm13.length);
     36             rnd5 = Math.floor(Math.random() * nm16.length);
     37             lName = nm12[rnd] + nm13[rnd2] + nm16[rnd5];
     38         }
     39         if (tp === 1) {
     40             rnd = Math.floor(Math.random() * nm6.length);
     41             rnd2 = Math.floor(Math.random() * nm7.length);
     42             rnd3 = Math.floor(Math.random() * nm8.length);
     43             rnd4 = Math.floor(Math.random() * nm9.length);
     44             rnd5 = Math.floor(Math.random() * nm10.length);
     45             rnd6 = Math.floor(Math.random() * nm11.length);
     46             names = nm6[rnd] + nm7[rnd2] + nm8[rnd3] + nm9[rnd4] + nm10[rnd5] + nm11[rnd6] + " " + lName;
     47         } else {
     48             rnd = Math.floor(Math.random() * nm0.length);
     49             rnd1 = Math.floor(Math.random() * nm1.length);
     50             rnd2 = Math.floor(Math.random() * nm2.length);
     51             rnd3 = Math.floor(Math.random() * nm3.length);
     52             rnd4 = Math.floor(Math.random() * nm4.length);
     53             rnd5 = Math.floor(Math.random() * nm5.length);
     54             names = nm0[rnd] + nm1[rnd1] + nm2[rnd2] + nm3[rnd3] + nm4[rnd4] + nm5[rnd5] + " " + lName;
     55         }
     56         br = document.createElement('br');
     57         element.appendChild(document.createTextNode(names));
     58         element.appendChild(br);
     59     }
     60     if (document.getElementById("result")) {
     61         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     62     }
     63     document.getElementById("placeholder").appendChild(element);
     64 }