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

mgtNaga.js (3297B)


      1 var nm1 = ["", "", "", "", "", "c", "g", "h", "j", "kh", "n", "r", "s", "t", "th", "y", "z"];
      2 var nm2 = ["a", "e", "i", "a", "e", "i", "o", "u"];
      3 var nm3 = ["d", "g", "k", "l", "n", "r", "s", "t", "d", "g", "k", "l", "n", "r", "s", "t", "d", "dd", "dr", "g", "gg", "gr", "gl", "gn", "gd", "k", "kk", "kl", "kn", "kd", "kdr", "kr", "l", "ll", "lk", "ld", "lg", "ldr", "lgr", "lkr", "n", "nn", "nd", "ndr", "ng", "ngr", "r", "rr", "rh", "rn", "s", "sh", "shr", "sr", "shn", "sn", "t", "thn", "thr", "tr"];
      4 var nm4 = ["d", "g", "k", "l", "n", "r", "s", "t"];
      5 var nm5 = ["Archer", "Assassin", "Augur", "Bonekeeper", "Brute", "Butcher", "Champion", "Clairvoyant", "Conqueror", "Conscript", "Deceiver", "Defender", "Defiant", "Diviner", "Drowner", "Enforcer", "Executioner", "Fiend", "Flayer", "Guerrilla", "Insurgent", "Keeper", "Mutineer", "Oracle", "Ranger", "Rebel", "Renegade", "Resistance", "Savage", "Scout", "Seer", "Shepherd", "Skullkeeper", "Slayer", "Soothsayer", "Spell-Eater", "Spellcaster", "Spellcatcher", "Spellsnatcher", "Spy", "Strangler", "Subjugator", "Swindler", "Tyrant", "Vandal", "Vanquisher", "Victor", "Vigilante", "Vindicator", "Vizier", "Wanderer", "Warrior"];
      6 var br = "";
      7 
      8 function nameGen() {
      9     $('#placeholder').css('textTransform', 'capitalize');
     10     var element = document.createElement("div");
     11     element.setAttribute("id", "result");
     12     for (i = 0; i < 10; i++) {
     13         rnd = Math.floor(Math.random() * nm1.length);
     14         rnd2 = Math.floor(Math.random() * nm2.length);
     15         rnd3 = Math.floor(Math.random() * nm3.length);
     16         rnd4 = Math.floor(Math.random() * nm2.length);
     17         while (nm3[rnd3] === nm1[rnd]) {
     18             rnd3 = Math.floor(Math.random() * nm3.length);
     19         }
     20         if (i % 2 === 0) {
     21             lName = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4];
     22         } else {
     23             rnd5 = Math.floor(Math.random() * nm4.length);
     24             rnd6 = Math.floor(Math.random() * nm2.length);
     25             while (nm3[rnd3] === nm4[rnd5]) {
     26                 rnd5 = Math.floor(Math.random() * nm4.length);
     27             }
     28             lName = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm4[rnd5] + nm2[rnd6];
     29         }
     30         if (i < 6) {
     31             rnd = Math.floor(Math.random() * nm1.length);
     32             rnd2 = Math.floor(Math.random() * nm2.length);
     33             rnd3 = Math.floor(Math.random() * nm3.length);
     34             rnd4 = Math.floor(Math.random() * nm2.length);
     35             if (i < 3) {
     36                 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + " " + lName;
     37             } else {
     38                 rnd5 = Math.floor(Math.random() * nm4.length);
     39                 rnd6 = Math.floor(Math.random() * nm2.length);
     40                 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm4[rnd5] + nm2[rnd6] + " " + lName;
     41             }
     42         } else {
     43             rnd = Math.floor(Math.random() * nm5.length);
     44             names = lName + " " + nm5[rnd];
     45         }
     46         br = document.createElement('br');
     47         element.appendChild(document.createTextNode(names));
     48         element.appendChild(br);
     49     }
     50     if (document.getElementById("result")) {
     51         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     52     }
     53     document.getElementById("placeholder").appendChild(element);
     54 }