legendaryCreatures.js (4627B)
1 var nm1 = ["Aklo", "Alec", "Ama", "Anu", "Ara", "Arach", "Ase", "Asu", "Ban", "Basi", "Behe", "Bi", "Bun", "Ca", "Cal", "Cala", "Chi", "Chu", "Cro", "Cy", "Dha", "Dham", "Dra", "Du", "Dulla", "Gol", "Gor", "Gri", "Grif", "Hai", "Har", "Hell", "Hi", "Hiba", "Hy", "Incu", "Ja", "Jac", "Jacka", "Kel", "La", "Lam", "Lama", "Lin", "Man", "Manti", "Me", "Medu", "Melu", "Mi", "Mino", "Ouro", "Pa", "Pabi", "Pabil", "Pe", "Pega", "Pery", "Phoe", "Sa", "Sel", "Si", "Sil", "Sile", "Su", "Succu", "Tara", "Taras", "Un", "Uni", "Va", "Vam", "Vana", "Wol", "Wolper", "Wy", "Ye", "Zla", "Zlato"]; 2 var nm2 = ["berus", "bis", "boros", "bra", "bus", "cabra", "camp", "clops", "core", "corn", "cotta", "dine", "dorm", "dra", "drius", "dusa", "fin", "ger", "gon", "griff", "han", "horn", "ket", "kie", "leni", "lenus", "lez", "lisk", "lope", "lops", "mera", "moth", "nara", "ne", "ni", "nix", "nost", "nus", "pad", "pie", "pir", "pire", "py", "que", "quix", "ren", "rion", "rog", "rok", "ron", "ros", "sag", "sena", "shee", "sine", "ssu", "su", "sura", "sus", "taur", "tinger", "ton", "torog", "trice", "tryon", "tyr", "vern", "yip", "zum"]; 3 var nm3 = ["a", "e", "i", "o", "u"]; 4 var nm4 = ["b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "x", "y", "z"]; 5 var nm6 = ["", "", "", "", "", "", "", "", "", "", "b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "r", "s", "t", "v", "w", "y", "z", "br", "ch", "cr", "dh", "dr", "fr", "gn", "gr", "kn", "kr", "kh", "ph", "sc", "sh", "sk", "st", "str", "th", "tr", "vr", "wr"]; 6 var nm7 = ["a", "a", "a", "a", "aa", "ai", "ao", "au", "e", "e", "e", "e", "ea", "ee", "ei", "eo", "i", "i", "i", "i", "ia", "ie", "io", "o", "o", "o", "o", "oa", "oo", "ou", "u", "u", "u", "ua", "ue"]; 7 var nm8 = ["b", "br", "c", "cc", "ch", "chn", "cl", "d", "dr", "ff", "g", "h", "kl", "l", "lk", "ll", "lp", "ls", "m", "mp", "n", "nd", "ng", "nsh", "nt", "p", "pp", "q", "r", "rb", "rg", "rp", "s", "sh", "sq", "ss", "t", "tr", "tt", "v", "y", "z"]; 8 var nm9 = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "d", "ff", "g", "k", "m", "mp", "n", "nd", "nx", "p", "ps", "r", "rm", "rn", "s", "sk", "st", "t", "th", "x", "z"]; 9 var br = ""; 10 11 function nameGen(type) { 12 $('#placeholder').css('textTransform', 'capitalize'); 13 var element = document.createElement("div"); 14 element.setAttribute("id", "result"); 15 for (i = 0; i < 10; i++) { 16 rnd7 = Math.random() * nm7.length | 0; 17 if (i < 5) { 18 rnd = Math.random() * nm1.length | 0; 19 rnd7b = Math.random() * nm7.length | 0; 20 rnd8 = Math.random() * nm8.length | 0; 21 rnd9 = Math.random() * nm9.length | 0; 22 if (i < 3) { 23 names = nm1[rnd] + nm8[rnd8] + nm7[rnd7b] + nm9[rnd9]; 24 } else { 25 nmRep = Math.random() * nm1[rnd].length | 0; 26 if (nm1[rnd].charAt(nmRep) === "a" || nm1[rnd].charAt(nmRep) === "e" || nm1[rnd].charAt(nmRep) === "i" || nm1[rnd].charAt(nmRep) === "o" || nm1[rnd].charAt(nmRep) === "u" || nm1[rnd].charAt(nmRep) === "y") { 27 nmRepl = nm3[Math.random() * nm3.length | 0]; 28 } else { 29 nmRepl = nm4[Math.random() * nm4.length | 0]; 30 } 31 nmR = nm1[rnd].substr(0, nmRep) + nmRepl + nm1[rnd].substr(nmRep + 1); 32 names = nmR + nm8[rnd8] + nm7[rnd7b] + nm9[rnd9]; 33 } 34 } else { 35 rnd = Math.random() * nm2.length | 0; 36 rnd6 = Math.random() * nm6.length | 0; 37 if (i < 8) { 38 names = nm6[rnd6] + nm7[rnd7] + nm2[rnd]; 39 } else { 40 nmRep = Math.random() * nm2[rnd].length | 0; 41 if (nm2[rnd].charAt(nmRep) === "a" || nm2[rnd].charAt(nmRep) === "e" || nm2[rnd].charAt(nmRep) === "i" || nm2[rnd].charAt(nmRep) === "o" || nm2[rnd].charAt(nmRep) === "u" || nm2[rnd].charAt(nmRep) === "y") { 42 nmRepl = nm3[Math.random() * nm3.length | 0]; 43 } else { 44 nmRepl = nm4[Math.random() * nm4.length | 0]; 45 } 46 nmR = nm2[rnd].substr(0, nmRep) + nmRepl + nm1[rnd].substr(nmRep + 1); 47 names = nm6[rnd6] + nm7[rnd7] + nmR; 48 } 49 } 50 br = document.createElement('br'); 51 element.appendChild(document.createTextNode(names)); 52 element.appendChild(br); 53 } 54 if (document.getElementById("result")) { 55 document.getElementById("placeholder").removeChild(document.getElementById("result")); 56 } 57 document.getElementById("placeholder").appendChild(element); 58 }