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

dragonkinNames.js (6859B)


      1 var nm1 = ["", "", "", "", "", "b", "br", "dr", "g", "gr", "h", "k", "kr", "m", "n", "r", "s", "sr", "str", "t", "tr", "v", "z"];
      2 var nm2 = ["a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "ai", "ae", "ia", "iu", "io", "eo"];
      3 var nm3 = ["cr", "cg", "cn", "csh", "cd", "cdr", "dr", "dg", "dgr", "dk", "dkr", "k", "kr", "kt", "kth", "ksh", "l", "lk", "lt", "ldr", "lg", "lgr", "lsh", "lz", "n", "nd", "ndr", "nsh", "nsk", "r", "rc", "rph", "rsh", "rth", "rd", "rdr", "rgr", "rg", "rz", "rzr", "rsh", "s", "sth", "shk", "sk", "sg", "skr", "th", "tr", "tr", "tg", "z", "zz", "zg", "zk"];
      4 var nm4 = ["b", "d", "g", "j", "k", "l", "n", "r", "s", "sh", "z"];
      5 var nm5 = ["", "", "", "c", "d", "g", "gg", "k", "ks", "n", "nd", "ph", "s", "th", "x", "z"];
      6 var nm6 = ["", "", "", "", "", "", "", "", "", "", "b", "bh", "c", "ch", "d", "g", "h", "kh", "l", "m", "n", "ph", "phr", "r", "s", "shr", "str", "sth", "t", "th", "tr", "z", "zh"];
      7 var nm7 = ["a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "ai", "ae", "ia", "ea", "ie", "ei"];
      8 var nm8 = ["dr", "dh", "dn", "dhr", "gn", "gr", "ghr", "gtr", "gt", "k", "kk", "kh", "kt", "kth", "l", "lk", "ll", "lg", "ld", "ldr", "lgr", "ln", "lm", "lkh", "ls", "lz", "n", "nd", "ndh", "ndr", "ns", "nsh", "nz", "nh", "nhr", "ng", "ngh", "r", "rc", "rph", "rsh", "rz", "rl", "s", "sh", "ss", "sth", "sht", "shl", "sn", "sg", "sk", "th", "thr", "thn", "tr", "z", "zh"];
      9 var nm9 = ["l", "m", "n", "r", "s", "sh", "t", "th", "x", "z"];
     10 var nm10 = ["", "", "", "", "", "", "", "", "", "", "h", "s", "sh", "th", "x", "z"];
     11 var nm11 = ["", "", "", "", "", "", "", "b", "ch", "d", "g", "h", "k", "kr", "l", "m", "n", "r", "s", "sr", "str", "sth", "t", "tr", "th", "z"];
     12 var nm12 = ["a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "ai", "ae", "ia", "ea", "io", "ie"];
     13 var nm13 = ["cr", "cn", "cd", "dr", "dh", "dg", "dhr", "gn", "gr", "ghr", "k", "kk", "kt", "kth", "l", "lk", "ll", "lg", "ld", "ldr", "lgr", "lz", "n", "nd", "ndr", "ns", "nsh", "nz", "ng", "r", "rc", "rph", "rsh", "rz", "rd", "rdr", "rgr", "rg", "s", "sh", "ss", "sth", "sht", "sth", "sn", "sg", "sk", "th", "thr", "tr", "z", "zg", "zh"];
     14 var nm14 = ["b", "d", "g", "l", "n", "r", "s", "sh", "t", "th", "z"];
     15 var nm15 = ["", "", "", "h", "n", "s", "sh", "t", "th", "x", "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() * nm6.length);
     26             rnd2 = Math.floor(Math.random() * nm7.length);
     27             rnd3 = Math.floor(Math.random() * nm8.length);
     28             rnd4 = Math.floor(Math.random() * nm7.length);
     29             rnd5 = Math.floor(Math.random() * nm10.length);
     30             while (nm8[rnd3] === nm6[rnd] || nm8[rnd3] === nm10[rnd5]) {
     31                 rnd3 = Math.floor(Math.random() * nm8.length);
     32             }
     33             if (i < 6) {
     34                 names = nm6[rnd] + nm7[rnd2] + nm8[rnd3] + nm7[rnd4] + nm10[rnd5];
     35             } else {
     36                 rnd6 = Math.floor(Math.random() * nm9.length);
     37                 rnd7 = Math.floor(Math.random() * nm7.length);
     38                 while (nm8[rnd3] === nm9[rnd6] || nm9[rnd6] === nm10[rnd5]) {
     39                     rnd6 = Math.floor(Math.random() * nm9.length);
     40                 }
     41                 if (i < 8) {
     42                     names = nm6[rnd] + nm7[rnd2] + nm8[rnd3] + nm7[rnd4] + nm9[rnd6] + nm7[rnd7] + nm10[rnd5];
     43                 } else {
     44                     names = nm6[rnd] + nm7[rnd2] + nm9[rnd6] + nm7[rnd7] + nm8[rnd3] + nm7[rnd4] + nm10[rnd5];
     45                 }
     46             }
     47         } else if (tp === 2) {
     48             rnd = Math.floor(Math.random() * nm11.length);
     49             rnd2 = Math.floor(Math.random() * nm12.length);
     50             rnd3 = Math.floor(Math.random() * nm13.length);
     51             rnd4 = Math.floor(Math.random() * nm12.length);
     52             rnd5 = Math.floor(Math.random() * nm15.length);
     53             while (nm13[rnd3] === nm11[rnd] || nm13[rnd3] === nm15[rnd5]) {
     54                 rnd3 = Math.floor(Math.random() * nm13.length);
     55             }
     56             if (i < 6) {
     57                 names = nm11[rnd] + nm12[rnd2] + nm13[rnd3] + nm12[rnd4] + nm15[rnd5];
     58             } else {
     59                 rnd6 = Math.floor(Math.random() * nm14.length);
     60                 rnd7 = Math.floor(Math.random() * nm12.length);
     61                 while (nm13[rnd3] === nm14[rnd6] || nm14[rnd6] === nm15[rnd5]) {
     62                     rnd6 = Math.floor(Math.random() * nm14.length);
     63                 }
     64                 if (i < 8) {
     65                     names = nm11[rnd] + nm12[rnd2] + nm13[rnd3] + nm12[rnd4] + nm14[rnd6] + nm12[rnd7] + nm15[rnd5];
     66                 } else {
     67                     names = nm11[rnd] + nm12[rnd2] + nm14[rnd6] + nm12[rnd7] + nm13[rnd3] + nm12[rnd4] + nm15[rnd5];
     68                 }
     69             }
     70         } else {
     71             rnd = Math.floor(Math.random() * nm1.length);
     72             rnd2 = Math.floor(Math.random() * nm2.length);
     73             rnd3 = Math.floor(Math.random() * nm3.length);
     74             rnd4 = Math.floor(Math.random() * nm2.length);
     75             rnd5 = Math.floor(Math.random() * nm5.length);
     76             while (nm3[rnd3] === nm1[rnd] || nm3[rnd3] === nm5[rnd5]) {
     77                 rnd3 = Math.floor(Math.random() * nm3.length);
     78             }
     79             if (i < 6) {
     80                 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm5[rnd5];
     81             } else {
     82                 rnd6 = Math.floor(Math.random() * nm4.length);
     83                 rnd7 = Math.floor(Math.random() * nm2.length);
     84                 while (nm3[rnd3] === nm4[rnd6] || nm4[rnd6] === nm5[rnd5]) {
     85                     rnd6 = Math.floor(Math.random() * nm4.length);
     86                 }
     87                 if (i < 8) {
     88                     names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm4[rnd6] + nm2[rnd7] + nm5[rnd5];
     89                 } else {
     90                     names = nm1[rnd] + nm2[rnd2] + nm4[rnd6] + nm2[rnd7] + nm3[rnd3] + nm2[rnd4] + nm5[rnd5];
     91                 }
     92             }
     93         }
     94         br = document.createElement('br');
     95         element.appendChild(document.createTextNode(names));
     96         element.appendChild(br);
     97     }
     98     if (document.getElementById("result")) {
     99         document.getElementById("placeholder").removeChild(document.getElementById("result"));
    100     }
    101     document.getElementById("placeholder").appendChild(element);
    102 }