pathfinderOread.js (2844B)
1 var nm1 = ["", "", "", "b", "d", "g", "j", "l", "m", "n", "p", "r", "s", "t", "v"]; 2 var nm2 = ["a", "e", "i", "o", "u", "a", "o", "u", "y"]; 3 var nm3 = ["d", "dd", "f", "fd", "ft", "hd", "hn", "hv", "l", "ll", "ln", "lm", "ld", "lv", "lt", "lth", "lm", "m", "md", "mt", "mh", "mv", "n", "nd", "nt", "nv", "nh", "nn", "nm", "nh", "nr", "r", "rt", "rh", "rn", "rm", "rl", "rv", "rr", "rd", "th", "tr", "thr", "v", "vh", "vr"]; 4 var nm4 = ["", "m", "n", "r", "s", "t"]; 5 var nm5 = ["", "", "", "b", "bh", "d", "dh", "gh", "h", "l", "m", "n", "p", "r", "rh", "s", "sh", "t", "th", "v", "w"]; 6 var nm6 = ["a", "e", "i", "o", "u", "a", "i", "e"]; 7 var nm7 = ["c", "ch", "d", "dh", "f", "ff", "fh", "fth", "h", "hn", "hv", "hl", "hs", "l", "lh", "ln", "lm", "ls", "lsh", "m", "mn", "mm", "mh", "my", "n", "nn", "nh", "ny", "ns", "nth", "nf", "r", "ry", "rh", "rs", "rsh", "rth", "s", "sh", "sth", "sht", "sn", "sm", "sy", "sl", "t", "th", "ty", "thy", "y"]; 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() * nm6.length); 19 rnd3 = Math.floor(Math.random() * nm7.length); 20 rnd4 = Math.floor(Math.random() * nm6.length); 21 if (i < 5) { 22 names = nm5[rnd] + nm6[rnd2] + nm7[rnd3] + nm6[rnd4]; 23 } else { 24 rnd6 = Math.floor(Math.random() * nm7.length); 25 rnd7 = Math.floor(Math.random() * nm6.length); 26 names = nm5[rnd] + nm6[rnd2] + nm7[rnd3] + nm6[rnd4] + nm7[rnd6] + nm6[rnd7]; 27 } 28 } else { 29 rnd = Math.floor(Math.random() * nm1.length); 30 rnd2 = Math.floor(Math.random() * nm2.length); 31 rnd3 = Math.floor(Math.random() * nm3.length); 32 rnd4 = Math.floor(Math.random() * nm2.length); 33 rnd5 = Math.floor(Math.random() * nm4.length); 34 if (i < 5) { 35 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm4[rnd5]; 36 } else { 37 rnd6 = Math.floor(Math.random() * nm3.length); 38 rnd7 = Math.floor(Math.random() * nm2.length); 39 names = nm1[rnd] + nm2[rnd2] + nm3[rnd3] + nm2[rnd4] + nm3[rnd6] + nm2[rnd7] + nm4[rnd5]; 40 } 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 }