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

yetiNames.js (8808B)


      1 var nm1 = ["", "", "", "", "", "b", "ch", "dz", "dj", "g", "gy", "h", "j", "k", "ky", "l", "m", "n", "r", "s", "sz", "sh", "t", "th", "v", "z"];
      2 var nm2 = ["a", "e", "i", "o", "u", "a", "o", "u"];
      3 var nm3 = ["dd", "h", "k", "l", "ll", "m", "n", "r", "s", "t", "z", "dd", "h", "k", "kk", "l", "ll", "lr", "m", "n", "ng", "nr", "nz", "r", "rr", "s", "sh", "sr", "t", "ts", "vr", "y", "z"];
      4 var nm4 = ["", "", "c", "hn", "hl", "l", "m", "n", "ng", "r", "rs", "s", "sh"];
      5 var nm4b = ["h", "k", "l", "ll", "m", "n", "r", "s", "t", "z"];
      6 var nm5 = ["", "", "", "", "", "f", "gy", "h", "k", "ky", "l", "m", "n", "ph", "r", "s", "sh", "th", "w", "y", "z"];
      7 var nm6 = ["a", "e", "i", "o", "u", "a", "e", "i"];
      8 var nm7 = ["b", "f", "g", "h", "k", "l", "ll", "m", "n", "r", "rr", "s", "t", "w", "z", "b", "f", "g", "gy", "h", "hn", "hl", "k", "l", "ll", "m", "n", "ng", "nn", "r", "rr", "rl", "ry", "rs", "s", "sh", "t", "ty", "th", "w", "z"];
      9 var nm8 = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "h", "hn", "l", "m", "n", "ng", "ph", "s", "sh", "th", "y"];
     10 var nm9 = ["b", "f", "g", "h", "k", "l", "ll", "m", "n", "r", "rr", "s", "t", "w", "z"];
     11 var nm10 = ["", "", "", "", "", "", "f", "g", "gy", "h", "k", "ky", "l", "m", "n", "ph", "r", "s", "sh", "th", "v", "w", "y", "z"];
     12 var nm11 = ["a", "e", "i", "o", "u", "a"];
     13 var nm12 = ["b", "dd", "g", "h", "k", "kk", "l", "ll", "m", "n", "nn", "r", "rr", "s", "t", "w", "y", "z", "b", "dd", "g", "gy", "h", "hn", "k", "kk", "l", "ll", "lr", "m", "n", "ng", "nn", "nr", "r", "rr", "ry", "s", "sh", "sr", "t", "th", "ts", "vr", "w", "y", "z"];
     14 var nm13 = ["", "", "", "", "", "", "", "", "h", "hl", "hn", "l", "m", "n", "ng", "ph", "r", "rs", "s", "sh", "th"];
     15 var nm14 = ["b", "dd", "g", "h", "k", "kk", "l", "ll", "m", "n", "nn", "r", "rr", "s", "t", "w", "y", "z"];
     16 var br = "";
     17 
     18 function nameGen(type) {
     19     $('#placeholder').css('textTransform', 'capitalize');
     20     var tp = type;
     21     var element = document.createElement("div");
     22     element.setAttribute("id", "result");
     23     for (i = 0; i < 10; i++) {
     24         if (tp === 1) {
     25             rnd = Math.floor(Math.random() * nm5.length);
     26             rnd2 = Math.floor(Math.random() * nm6.length);
     27             rnd3 = Math.floor(Math.random() * nm7.length);
     28             rnd4 = Math.floor(Math.random() * nm6.length);
     29             rnd5 = Math.floor(Math.random() * nm8.length);
     30             if (i < 6) {
     31                 while (nm5[rnd] === nm7[rnd3]) {
     32                     rnd3 = Math.floor(Math.random() * nm7.length);
     33                 }
     34                 if (rnd < 5) {
     35                     while (rnd5 < 15 || nm7[rnd3] === nm8[rnd5]) {
     36                         rnd5 = Math.floor(Math.random() * nm8.length);
     37                     }
     38                 }
     39                 names = nm5[rnd] + nm6[rnd2] + nm7[rnd3] + nm6[rnd4] + nm8[rnd5];
     40             } else if (i < 8) {
     41                 rnd6 = Math.floor(Math.random() * nm9.length);
     42                 rnd7 = Math.floor(Math.random() * nm6.length);
     43                 while (nm5[rnd] === nm7[rnd3]) {
     44                     rnd3 = Math.floor(Math.random() * nm7.length);
     45                 }
     46                 while (nm9[rnd6] === nm8[rnd5]) {
     47                     rnd5 = Math.floor(Math.random() * nm8.length);
     48                 }
     49                 while (nm9[rnd6] === nm7[rnd3]) {
     50                     rnd6 = Math.floor(Math.random() * nm9.length);
     51                 }
     52                 names = nm5[rnd] + nm6[rnd2] + nm7[rnd3] + nm6[rnd4] + nm9[rnd6] + nm6[rnd7] + nm8[rnd5];
     53             } else {
     54                 rnd6 = Math.floor(Math.random() * nm9.length);
     55                 rnd7 = Math.floor(Math.random() * nm6.length);
     56                 while (nm5[rnd] === nm7[rnd3]) {
     57                     rnd3 = Math.floor(Math.random() * nm7.length);
     58                 }
     59                 while (nm7[rnd3] === nm8[rnd5]) {
     60                     rnd5 = Math.floor(Math.random() * nm8.length);
     61                 }
     62                 while (nm9[rnd6] === nm7[rnd3]) {
     63                     rnd6 = Math.floor(Math.random() * nm9.length);
     64                 }
     65                 names = nm5[rnd] + nm6[rnd2] + nm9[rnd6] + nm6[rnd7] + nm7[rnd3] + nm6[rnd4] + nm8[rnd5];
     66             }
     67         } else if (tp === 2) {
     68             rnd = Math.floor(Math.random() * nm10.length);
     69             rnd2 = Math.floor(Math.random() * nm11.length);
     70             rnd3 = Math.floor(Math.random() * nm12.length);
     71             rnd4 = Math.floor(Math.random() * nm11.length);
     72             rnd5 = Math.floor(Math.random() * nm13.length);
     73             if (i < 6) {
     74                 while (nm10[rnd] === nm12[rnd3]) {
     75                     rnd3 = Math.floor(Math.random() * nm12.length);
     76                 }
     77                 if (rnd < 5) {
     78                     while (rnd5 < 15 || nm12[rnd3] === nm13[rnd5]) {
     79                         rnd5 = Math.floor(Math.random() * nm13.length);
     80                     }
     81                 }
     82                 names = nm10[rnd] + nm11[rnd2] + nm12[rnd3] + nm11[rnd4] + nm13[rnd5];
     83             } else if (i < 8) {
     84                 rnd6 = Math.floor(Math.random() * nm14.length);
     85                 rnd7 = Math.floor(Math.random() * nm11.length);
     86                 while (nm10[rnd] === nm12[rnd3]) {
     87                     rnd3 = Math.floor(Math.random() * nm12.length);
     88                 }
     89                 while (nm14[rnd6] === nm13[rnd5]) {
     90                     rnd5 = Math.floor(Math.random() * nm13.length);
     91                 }
     92                 while (nm14[rnd6] === nm12[rnd3]) {
     93                     rnd6 = Math.floor(Math.random() * nm14.length);
     94                 }
     95                 names = nm10[rnd] + nm11[rnd2] + nm12[rnd3] + nm11[rnd4] + nm14[rnd6] + nm11[rnd7] + nm13[rnd5];
     96             } else {
     97                 rnd6 = Math.floor(Math.random() * nm14.length);
     98                 rnd7 = Math.floor(Math.random() * nm11.length);
     99                 while (nm10[rnd] === nm12[rnd3]) {
    100                     rnd3 = Math.floor(Math.random() * nm12.length);
    101                 }
    102                 while (nm14[rnd6] === nm13[rnd5]) {
    103                     rnd5 = Math.floor(Math.random() * nm13.length);
    104                 }
    105                 while (nm14[rnd6] === nm12[rnd3]) {
    106                     rnd6 = Math.floor(Math.random() * nm14.length);
    107                 }
    108                 names = nm10[rnd] + nm11[rnd2] + nm14[rnd6] + nm11[rnd7] + nm12[rnd3] + nm11[rnd4] + nm13[rnd5];
    109             }
    110         } else {
    111             rnd = Math.floor(Math.random() * nm1.length);
    112             rnd2 = Math.floor(Math.random() * nm2.length);
    113             rnd3 = Math.floor(Math.random() * nm3.length);
    114             rnd4 = Math.floor(Math.random() * nm2.length);
    115             rnd5 = Math.floor(Math.random() * nm4.length);
    116             if (i < 5) {
    117                 while (nm1[rnd] === nm3[rnd3]) {
    118                     rnd3 = Math.floor(Math.random() * nm3.length);
    119                 }
    120                 if (rnd < 5) {
    121                     while (rnd5 < 2 || nm3[rnd3] === nm4[rnd5]) {
    122                         rnd5 = Math.floor(Math.random() * nm4.length);
    123                     }
    124                 }
    125                 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm4[rnd5];
    126             } else if (i < 8) {
    127                 rnd6 = Math.floor(Math.random() * nm4b.length);
    128                 rnd7 = Math.floor(Math.random() * nm2.length);
    129                 while (nm1[rnd] === nm3[rnd3]) {
    130                     rnd3 = Math.floor(Math.random() * nm3.length);
    131                 }
    132                 while (nm4b[rnd6] === nm4[rnd5]) {
    133                     rnd5 = Math.floor(Math.random() * nm4.length);
    134                 }
    135                 while (nm4b[rnd6] === nm3[rnd3]) {
    136                     rnd6 = Math.floor(Math.random() * nm4b.length);
    137                 }
    138                 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm4b[rnd6] + nm2[rnd7] + nm4[rnd5];
    139             } else {
    140                 rnd6 = Math.floor(Math.random() * nm4b.length);
    141                 rnd7 = Math.floor(Math.random() * nm2.length);
    142                 while (nm1[rnd] === nm3[rnd3]) {
    143                     rnd3 = Math.floor(Math.random() * nm3.length);
    144                 }
    145                 while (nm3[rnd3] === nm4[rnd5]) {
    146                     rnd5 = Math.floor(Math.random() * nm4.length);
    147                 }
    148                 while (nm4b[rnd6] === nm3[rnd3]) {
    149                     rnd6 = Math.floor(Math.random() * nm4b.length);
    150                 }
    151                 names = nm1[rnd] + nm2[rnd2] + nm4b[rnd6] + nm2[rnd7] + nm3[rnd3] + nm2[rnd4] + nm4[rnd5];
    152             }
    153         }
    154         br = document.createElement('br');
    155         element.appendChild(document.createTextNode(names));
    156         element.appendChild(br);
    157     }
    158     if (document.getElementById("result")) {
    159         document.getElementById("placeholder").removeChild(document.getElementById("result"));
    160     }
    161     document.getElementById("placeholder").appendChild(element);
    162 }