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

tsolyani.js (4254B)


      1 var nm1 = ["'", "'", "'", "'", "'", "'", "'", "b", "ch", "d", "dh", "f", "g", "gh", "h", "hl", "k", "kh", "l", "m", "n", "p", "q", "r", "s", "sh", "ss", "t", "th", "tl", "ts", "v", "w", "y", "z", "zh"];
      2 var nm1c = ["'", "'", "'", "'", "'", "'", "'", "B", "Ch", "D", "Dh", "F", "G", "Gh", "H", "Hl", "K", "Kh", "L", "M", "N", "P", "Q", "R", "S", "Sh", "Ss", "T", "Th", "Tl", "Ts", "V", "W", "Y", "Z", "Zh"];
      3 var nm2 = ["a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "y", "a", "e", "i", "o", "u", "a", "e", "i", "o", "u", "a", "e", "o", "i", "u", "au", "ai", "ua", "ue", "ae", "ai", "oi"];
      4 var nm2c = ["A", "E", "I", "O", "U", "A", "E", "I", "O", "U", "A", "E", "I", "O", "U", "A", "E", "I", "O", "U", "Y", "A", "E", "I", "O", "U", "A", "E", "I", "O", "U", "A", "E", "O", "I", "U", "Au", "Ai", "Ua", "Ue", "Ae", "Ai", "Oi"];
      5 var nm3 = ["", "", "", "", "", "", "", "", "", "", "", "", "l", "m", "n", "ng", "r", "s", "sh", "ss", "y"];
      6 var nm4 = ["hl", "k", "kh", "l", "l", "l", "l", "l", "l", "l", "m", "n", "m", "n", "m", "n", "m", "n", "ng", "r", "r", "r", "s", "sh", "tl"];
      7 var nm5 = ["hi", "hi", "hi", "hi", "hi", "hi", "hi", "hi", "dhu", "vu"];
      8 var br = "";
      9 
     10 function nameGen(type) {
     11     var tp = type;
     12     var element = document.createElement("div");
     13     element.setAttribute("id", "result");
     14     for (i = 0; i < 10; i++) {
     15         rnd = Math.floor(Math.random() * nm1.length);
     16         rnd2 = Math.floor(Math.random() * nm2.length);
     17         rnd3 = Math.floor(Math.random() * nm1.length);
     18         rnd4 = Math.floor(Math.random() * nm3.length);
     19         rnd5 = Math.floor(Math.random() * nm2.length);
     20         rnd6 = Math.floor(Math.random() * nm1.length);
     21         rnd7 = Math.floor(Math.random() * nm3.length);
     22         rnd8 = Math.floor(Math.random() * nm2.length);
     23         rnd9 = Math.floor(Math.random() * nm4.length);
     24         rnd10 = Math.floor(Math.random() * nm1.length);
     25         rnd11 = Math.floor(Math.random() * nm2.length);
     26         rnd12 = Math.floor(Math.random() * nm1.length);
     27         rnd13 = Math.floor(Math.random() * nm3.length);
     28         rnd14 = Math.floor(Math.random() * nm2.length);
     29         rnd15 = Math.floor(Math.random() * nm1.length);
     30         rnd16 = Math.floor(Math.random() * nm3.length);
     31         rnd17 = Math.floor(Math.random() * nm2.length);
     32         rnd18 = Math.floor(Math.random() * nm4.length);
     33         rnd19 = Math.floor(Math.random() * nm5.length);
     34         if (i % 2 === 0) {
     35             lName = nm5[rnd19] + nm1c[rnd10] + nm2[rnd11] + nm1[rnd12] + nm3[rnd13] + nm2[rnd14] + nm4[rnd18];
     36         } else if (i % 3 === 0) {
     37             lName = nm5[rnd19] + nm1c[rnd10] + nm2[rnd11] + nm1[rnd12] + nm3[rnd13] + nm2[rnd14];
     38         } else {
     39             lName = nm5[rnd19] + nm2c[rnd11] + nm1[rnd12] + nm3[rnd13] + nm2[rnd14] + nm4[rnd18];
     40         }
     41         if (i < 2) {
     42             names = nm2c[rnd2] + nm1[rnd3] + nm3[rnd4] + nm2[rnd5] + " " + lName;
     43         } else if (i < 4) {
     44             names = nm2c[rnd2] + nm1[rnd3] + nm3[rnd4] + nm2[rnd5] + nm4[rnd9] + " " + lName;
     45         } else if (i === 4) {
     46             names = nm2c[rnd2] + nm1[rnd3] + nm3[rnd4] + nm2[rnd5] + nm1[rnd6] + nm3[rnd7] + nm2[rnd8] + " " + lName;
     47         } else if (i === 5) {
     48             names = nm1c[rnd] + nm2[rnd2] + nm4[rnd9] + " " + lName;
     49         } else if (i === 6) {
     50             names = nm1c[rnd] + nm2[rnd2] + nm1[rnd3] + nm3[rnd4] + nm2[rnd5] + " " + lName;
     51         } else if (i === 7) {
     52             names = nm1c[rnd] + nm2[rnd2] + nm1[rnd3] + nm3[rnd4] + nm2[rnd5] + nm4[rnd9] + " " + lName;
     53         } else if (i === 8) {
     54             names = nm1c[rnd] + nm2[rnd2] + nm1[rnd3] + nm3[rnd4] + nm2[rnd5] + nm1[rnd6] + nm3[rnd7] + nm2[rnd8] + " " + lName;
     55         } else if (i === 9) {
     56             names = nm1c[rnd] + nm2[rnd2] + nm1[rnd3] + nm3[rnd4] + nm2[rnd5] + nm1[rnd6] + nm3[rnd7] + nm2[rnd8] + nm4[rnd9] + " " + lName;
     57         }
     58         br = document.createElement('br');
     59         element.appendChild(document.createTextNode(names));
     60         element.appendChild(br);
     61     }
     62     if (document.getElementById("result")) {
     63         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     64     }
     65     document.getElementById("placeholder").appendChild(element);
     66 }