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

ghiscariNames.js (3398B)


      1 var nm1 = ["", "", "dr", "g", "gr", "h", "kr", "m", "pr", "q", "r", "sr", "sh", "z", "zh"];
      2 var nm2 = ["a", "ei", "i", "o", "e", "a", "e", "i", "o", "a", "a"];
      3 var nm3 = ["dn", "d", "gh", "ghd", "gn", "nd", "md", "k", "kh", "kn", "kl", "q", "qh", "qn", "rd", "rn", "rm", "sn", "zd", "zh", "zn", "zm", "zl"];
      4 var nm4 = ["hr", "hl", "k", "l", "n", "q", "r", "s", "z"];
      5 var nm5 = ["zo", "na", "mo"];
      6 var nm6 = ["Ch", "D", "G", "H", "K", "L", "M", "N", "P", "Pr", "R", "S", "Sh", "Z", "Zh"];
      7 var nm7 = ["a", "e", "i", "o", "a", "a"];
      8 var nm8 = ["dn", "g", "gd", "ghd", "gn", "nd", "n", "m", "md", "kh", "l", "q", "qh", "qn", "r", "rr", "sh", "ss", "zz", "zd", "zh", "zn", "zm", "zl"];
      9 var nm9 = ["", "", "", "d", "dh", "g", "gh", "h", "k", "l", "m", "n", "p", "qu", "r", "rh", "sh", "yh", "zh", "z"];
     10 var nm10 = ["a", "e", "i", "u", "o", "a", "a"];
     11 var nm11 = ["", "", "", "", "", "dh", "g", "hn", "hz", "hl", "kn", "kl", "l", "llh", "md", "nd", "q", "qu", "qq", "r", "rr", "rd", "sh", "sn", "z", "zk", "zz", "zn", "zd", "zh"];
     12 var nm12 = ["", "a", "e", "i", "u", "o", "a", "a"];
     13 var nm13 = ["", "", "", "hl", "k", "n", "q", "r", "z", "zn"];
     14 var br = "";
     15 
     16 function nameGen(type) {
     17     var tp = type;
     18     var element = document.createElement("div");
     19     element.setAttribute("id", "result");
     20     for (i = 0; i < 10; i++) {
     21         rnd9 = Math.floor(Math.random() * nm9.length);
     22         rnd10 = Math.floor(Math.random() * nm10.length);
     23         rnd11 = Math.floor(Math.random() * nm11.length);
     24         rnd12 = Math.floor(Math.random() * nm12.length);
     25         rnd13 = Math.floor(Math.random() * nm13.length);
     26         names2 = nm9[rnd9] + nm10[rnd10] + nm11[rnd11] + nm12[rnd12] + nm13[rnd13];
     27         if (rnd11 < 5) {
     28             rnd12 = 0;
     29         } else {
     30             while (rnd12 === 0) {
     31                 rnd12 = Math.floor(Math.random() * nm12.length);
     32             }
     33         }
     34         if (tp === 1) {
     35             rnd = Math.floor(Math.random() * nm6.length);
     36             rnd2 = Math.floor(Math.random() * nm7.length);
     37             rnd3 = Math.floor(Math.random() * nm8.length);
     38             rnd4 = Math.floor(Math.random() * nm7.length);
     39             rnd5 = Math.floor(Math.random() * nm8.length);
     40             rnd6 = Math.floor(Math.random() * nm7.length);
     41             names1 = nm6[rnd] + nm7[rnd2] + nm8[rnd3] + nm7[rnd4] + nm8[rnd5] + nm7[rnd6];
     42             names = names1 + " " + names2.substr(0, 1).toUpperCase() + names2.substr(1);
     43         } else {
     44             rnd = Math.floor(Math.random() * nm1.length);
     45             rnd2 = Math.floor(Math.random() * nm2.length);
     46             rnd3 = Math.floor(Math.random() * nm3.length);
     47             rnd4 = Math.floor(Math.random() * nm2.length);
     48             rnd5 = Math.floor(Math.random() * nm4.length);
     49             rnd6 = Math.floor(Math.random() * nm5.length);
     50             names1 = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm4[rnd5];
     51             names = names1.substr(0, 1).toUpperCase() + names1.substr(1) + " " + nm5[rnd6] + " " + names2.substr(0, 1).toUpperCase() + names2.substr(1);
     52         }
     53         br = document.createElement('br');
     54         element.appendChild(document.createTextNode(names));
     55         element.appendChild(br);
     56     }
     57     if (document.getElementById("result")) {
     58         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     59     }
     60     document.getElementById("placeholder").appendChild(element);
     61 }