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

mgtCentaurs.js (5630B)


      1 var nm1 = ["b", "c", "g", "j", "k", "r", "s", "v", "x", "z"];
      2 var nm2 = ["a", "e", "o", "a", "e", "o", "a", "e", "o", "i", "u"];
      3 var nm3 = ["d", "g", "l", "m", "n", "r", "t", "v", "y", "z"];
      4 var nm4 = ["c", "d", "g", "j", "k", "n", "t", "v", "z"];
      5 var nm5 = ["c", "l", "n", "r", "s", "t", "x"];
      6 var nm5b = ["", "", "", "", "", "c", "l", "n", "r", "s", "t", "x"];
      7 var nm6 = ["", "", "c", "d", "f", "h", "l", "m", "n", "ph", "s", "t"];
      8 var nm7 = ["a", "i", "e", "a", "i", "e", "a", "i", "e", "y", "y", "a", "i", "e", "a", "i", "e", "y", "ea", "ia", "ua"];
      9 var nm8 = ["d", "h", "l", "m", "n", "r", "s", "t", "z"];
     10 var nm9 = ["d", "f", "k", "l", "m", "n", "r", "s", "t"];
     11 var nm10 = ["Abandoned", "Accursed", "Adept", "Adored", "Aggravated", "Aggressive", "Agitated", "Alienated", "Angry", "Animated", "Austere", "Battlefield", "Blind", "Boreal", "Brave", "Broken", "Careful", "Careless", "Cautious", "Centaur", "Chief", "Colossal", "Composed", "Corrupt", "Corrupted", "Crooked", "Cruel", "Defiant", "Delirious", "Determined", "Devoted", "Diligent", "Disloyal", "Dowsing", "Faithful", "Fearless", "Feisty", "Forsaken", "Gifted", "Graceful", "Grand", "Grim", "Idle", "Infamous", "Juvenile", "Kind", "Kindhearted", "Leaf", "Loaming", "Lone", "Mindless", "Misguided", "Naive", "Nervous", "Nimble", "Outlandish", "Phantom", "Possessed", "Prestigious", "Prime", "Roaming", "Serene", "Shadowy", "Sneaking", "Sneaky", "Spellbane", "Spellbound", "Spirit", "Swift", "Thunderous", "Tired", "Torn", "Trusted", "Turbulent", "Twin", "Unruly", "Unwielding", "Venerated", "Vengeful", "Warped", "Watchful", "Wicked", "Wild", "Wrathful", "Wretched", "Young"];
     12 var nm11 = ["Adept", "Archer", "Barbarian", "Battlemaster", "Binder", "Brawler", "Brute", "Caster", "Centaur", "Champion", "Charger", "Chieftain", "Courser", "Crusader", "Dancer", "Disciple", "Elder", "Fanatic", "Guardian", "Healer", "Herald", "Hero", "Marauder", "Oracle", "Outrider", "Protector", "Raider", "Ranger", "Rootbinder", "Rootcaster", "Rootcrasher", "Safeguard", "Savage", "Scavenger", "Scout", "Scrounger", "Seer", "Sentinel", "Shaman", "Slayer", "Spellcaster", "Stomper", "Tactician", "Thunderhoof", "Trailblazer", "Trampler", "Trapper", "Trickster", "Veteran", "Vinecaster", "Vinecrasher", "Warchief", "Warden", "Warmage", "Warmaster", "Weaver"];
     13 var br = "";
     14 
     15 function nameGen(type) {
     16     $('#placeholder').css('textTransform', 'capitalize');
     17     var tp = type;
     18     var element = document.createElement("div");
     19     element.setAttribute("id", "result");
     20     for (i = 0; i < 10; i++) {
     21         if (i % 3 === 0) {
     22             rnd = Math.floor(Math.random() * nm1.length);
     23             rnd2 = Math.floor(Math.random() * nm2.length);
     24             rnd3 = Math.floor(Math.random() * nm3.length);
     25             rnd4 = Math.floor(Math.random() * nm2.length);
     26             rnd5 = Math.floor(Math.random() * nm5b.length);
     27             rnd6 = Math.floor(Math.random() * nm11.length);
     28             lName = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd2] + nm5b[rnd5] + "'s " + nm11[rnd6];
     29         } else {
     30             rnd = Math.floor(Math.random() * nm10.length);
     31             rnd2 = Math.floor(Math.random() * nm11.length);
     32             while (nm10[rnd] === nm11[rnd2]) {
     33                 rnd2 = Math.floor(Math.random() * nm11.length);
     34             }
     35             lName = nm10[rnd] + " " + nm11[rnd2];
     36         }
     37         if (tp === 1) {
     38             if (i < 6) {
     39                 rnd = Math.floor(Math.random() * nm6.length);
     40                 rnd2 = Math.floor(Math.random() * nm7.length);
     41                 rnd3 = Math.floor(Math.random() * nm8.length);
     42                 rnd4 = Math.floor(Math.random() * nm7.length);
     43                 if (i < 3) {
     44                     names = nm6[rnd] + nm7[rnd2] + nm8[rnd3] + nm7[rnd4] + ", " + lName;
     45                 } else {
     46                     rnd8 = Math.floor(Math.random() * nm9.length);
     47                     rnd9 = Math.floor(Math.random() * nm2.length);
     48                     while (nm9[rnd8] === nm8[rnd3]) {
     49                         rnd8 = Math.floor(Math.random() * nm9.length);
     50                     }
     51                     names = nm6[rnd] + nm7[rnd2] + nm8[rnd3] + nm7[rnd4] + nm9[rnd8] + nm7[rnd9] + ", " + lName;
     52                 }
     53             } else {
     54                 names = lName;
     55             }
     56         } else {
     57             if (i < 6) {
     58                 rnd = Math.floor(Math.random() * nm1.length);
     59                 rnd2 = Math.floor(Math.random() * nm2.length);
     60                 rnd3 = Math.floor(Math.random() * nm3.length);
     61                 rnd4 = Math.floor(Math.random() * nm2.length);
     62                 rnd5 = Math.floor(Math.random() * nm5.length);
     63                 if (i < 3) {
     64                     names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm5[rnd5] + ", " + lName;
     65                 } else {
     66                     rnd8 = Math.floor(Math.random() * nm4.length);
     67                     rnd9 = Math.floor(Math.random() * nm2.length);
     68                     while (nm4[rnd8] === nm3[rnd3]) {
     69                         rnd8 = Math.floor(Math.random() * nm4.length);
     70                     }
     71                     names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm4[rnd8] + nm2[rnd9] + nm5[rnd5] + ", " + lName;
     72                 }
     73             } else {
     74                 names = lName;
     75             }
     76         }
     77         br = document.createElement('br');
     78         element.appendChild(document.createTextNode(names));
     79         element.appendChild(br);
     80     }
     81     if (document.getElementById("result")) {
     82         document.getElementById("placeholder").removeChild(document.getElementById("result"));
     83     }
     84     document.getElementById("placeholder").appendChild(element);
     85 }