pathfinderFetchling.js (2539B)
1 var nm1 = ["", "", "", "br", "dr", "gr", "j", "m", "n", "q", "qr", "r", "s", "tr", "x", "y", "z"]; 2 var nm2 = ["a", "e", "i", "o", "u"]; 3 var nm3 = ["c", "d", "g", "h", "j", "k", "l", "m", "n", "r", "s", "t", "v", "z"]; 4 var nm4 = ["", "", "", "c", "h", "l", "m", "n", "r", "t", "x"]; 5 var nm5 = ["c", "f", "g", "h", "l", "m", "n", "q", "r", "s", "t", "th", "v", "y", "z"]; 6 var nm7 = ["c", "fz", "fn", "g", "gv", "gn", "gz", "h", "hn", "hv", "hz", "l", "lv", "lr", "ls", "lz", "m", "mr", "mv", "mz", "nv", "nz", "nr", "r", "rr", "rs", "rz", "rh", "rv", "sc", "sh", "sr", "sv", "th", "thr", "tv", "tn"]; 7 var nm8 = ["", "", "", "", "", "", "", "", "", "", "", "", "", "h", "l", "m", "n", "s", "x"]; 8 var br = ""; 9 10 function nameGen(type) { 11 $('#placeholder').css('textTransform', 'capitalize'); 12 var tp = type; 13 var element = document.createElement("div"); 14 element.setAttribute("id", "result"); 15 for (i = 0; i < 10; i++) { 16 if (tp === 1) { 17 rnd = Math.floor(Math.random() * nm5.length); 18 rnd2 = Math.floor(Math.random() * nm2.length); 19 rnd3 = Math.floor(Math.random() * nm7.length); 20 rnd4 = Math.floor(Math.random() * nm2.length); 21 rnd5 = Math.floor(Math.random() * nm8.length); 22 if (i < 6) { 23 names = nm5[rnd] + nm2[rnd2] + nm7[rnd3] + nm2[rnd4] + nm8[rnd5]; 24 } else { 25 rnd6 = Math.floor(Math.random() * nm7.length); 26 rnd7 = Math.floor(Math.random() * nm2.length); 27 names = nm5[rnd] + nm2[rnd2] + nm7[rnd3] + nm2[rnd4] + nm7[rnd6] + nm2[rnd7] + nm8[rnd5]; 28 } 29 } else { 30 rnd = Math.floor(Math.random() * nm1.length); 31 rnd2 = Math.floor(Math.random() * nm2.length); 32 rnd3 = Math.floor(Math.random() * nm3.length); 33 rnd4 = Math.floor(Math.random() * nm2.length); 34 rnd5 = Math.floor(Math.random() * nm4.length); 35 if (rnd < 3) { 36 while (rnd5 < 3) { 37 rnd5 = Math.floor(Math.random() * nm4.length); 38 } 39 } 40 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm4[rnd5]; 41 } 42 br = document.createElement('br'); 43 element.appendChild(document.createTextNode(names)); 44 element.appendChild(br); 45 } 46 if (document.getElementById("result")) { 47 document.getElementById("placeholder").removeChild(document.getElementById("result")); 48 } 49 document.getElementById("placeholder").appendChild(element); 50 }