pathfinderTengu.js (4765B)
1 var nm1 = ["", "", "", "", "", "b", "ch", "gr", "j", "k", "kr", "p", "pr", "q", "qr", "r", "s", "t", "tr", "tch", "x", "v", "z"]; 2 var nm2 = ["a", "e", "o", "u", "a", "e", "o", "u", "a", "e", "o", "u", "a", "e", "o", "u", "i", "i", "a", "e", "o", "u", "au", "ai", "oi", "ou"]; 3 var nm3 = ["ch", "j", "k", "kk", "l", "ll", "m", "n", "nn", "p", "pp", "q", "r", "rr", "s", "t", "v", "y", "x", "z", "zz"]; 4 var nm4 = ["", "", "", "", "", "", "", "", "", "", "ck", "gh", "k", "l", "n", "r"]; 5 var nm5 = ["", "", "", "", "", "ch", "d", "g", "gh", "k", "kh", "m", "n", "p", "q", "r", "s", "sh", "t", "th", "v", "z", "zh"]; 6 var nm6 = ["a", "e", "o", "u", "a", "e", "o", "u", "a", "e", "o", "u", "a", "e", "o", "u", "i", "i", "a", "e", "o", "u", "ai", "io", "ee", "ae"]; 7 var nm7 = ["b", "ch", "g", "j", "k", "ky", "lk", "l", "ll", "ly", "m", "mk", "nk", "ny", "p", "py", "r", "rr", "rk", "s", "t", "ty", "tch", "v", "vy", "z", "zz"]; 8 var nm8 = ["", "", "", "", "", "", "", "", "", "", "k", "l", "n", "r"]; 9 var nm9 = ["", "", "", "", "", "b", "ch", "d", "g", "j", "k", "kr", "m", "n", "p", "pr", "q", "r", "s", "t", "tch", "v", "z"]; 10 var nm10 = ["a", "e", "i", "o", "u", "a", "o", "e", "a", "o", "e", "u"]; 11 var nm11 = ["ch", "g", "j", "k", "kk", "ky", "l", "ll", "m", "n", "ng", "nk", "p", "pp", "q", "r", "rr", "s", "t", "tch", "v", "y", "z", "zz"]; 12 var nm12 = ["", "", "ck", "k", "l", "n", "r", "t"]; 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 rnd8 = Math.floor(Math.random() * nm9.length); 22 rnd9 = Math.floor(Math.random() * nm10.length); 23 rnd10 = Math.floor(Math.random() * nm11.length); 24 rnd11 = Math.floor(Math.random() * nm10.length); 25 rnd12 = Math.floor(Math.random() * nm12.length); 26 lastName = nm9[rnd8] + nm10[rnd9] + nm11[rnd10] + nm10[rnd11] + nm12[rnd12]; 27 if (tp === 1) { 28 rnd = Math.floor(Math.random() * nm5.length); 29 rnd2 = Math.floor(Math.random() * nm6.length); 30 rnd5 = Math.floor(Math.random() * nm8.length); 31 if (i < 3) { 32 while (rnd < 5) { 33 rnd = Math.floor(Math.random() * nm5.length); 34 } 35 while (rnd5 < 10) { 36 rnd5 = Math.floor(Math.random() * nm8.length); 37 } 38 names = nm5[rnd] + nm6[rnd2] + nm8[rnd5] + " " + lastName; 39 } else if (i < 7) { 40 rnd3 = Math.floor(Math.random() * nm7.length); 41 rnd4 = Math.floor(Math.random() * nm6.length); 42 names = nm5[rnd] + nm6[rnd2] + nm7[rnd3] + nm6[rnd4] + nm8[rnd5] + " " + lastName; 43 } else { 44 rnd3 = Math.floor(Math.random() * nm7.length); 45 rnd4 = Math.floor(Math.random() * nm6.length); 46 rnd6 = Math.floor(Math.random() * nm7.length); 47 rnd7 = Math.floor(Math.random() * nm6.length); 48 names = nm5[rnd] + nm6[rnd2] + nm7[rnd3] + nm6[rnd4] + nm7[rnd6] + nm6[rnd7] + nm8[rnd5] + " " + lastName; 49 } 50 } else { 51 rnd = Math.floor(Math.random() * nm1.length); 52 rnd2 = Math.floor(Math.random() * nm2.length); 53 rnd5 = Math.floor(Math.random() * nm4.length); 54 if (i < 3) { 55 while (rnd < 5) { 56 rnd = Math.floor(Math.random() * nm1.length); 57 } 58 while (rnd5 < 10) { 59 rnd5 = Math.floor(Math.random() * nm4.length); 60 } 61 names = nm1[rnd] + nm2[rnd2] + nm4[rnd5] + " " + lastName; 62 } else if (i < 7) { 63 rnd3 = Math.floor(Math.random() * nm3.length); 64 rnd4 = Math.floor(Math.random() * nm2.length); 65 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm4[rnd5] + " " + lastName; 66 } else { 67 rnd3 = Math.floor(Math.random() * nm3.length); 68 rnd4 = Math.floor(Math.random() * nm2.length); 69 rnd6 = Math.floor(Math.random() * nm3.length); 70 rnd7 = Math.floor(Math.random() * nm2.length); 71 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm3[rnd6] + nm2[rnd7] + nm4[rnd5] + " " + lastName; 72 } 73 } 74 br = document.createElement('br'); 75 element.appendChild(document.createTextNode(names)); 76 element.appendChild(br); 77 } 78 if (document.getElementById("result")) { 79 document.getElementById("placeholder").removeChild(document.getElementById("result")); 80 } 81 document.getElementById("placeholder").appendChild(element); 82 }