Advertisement
Guest User

Untitled

a guest
Aug 11th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 39.47 KB | None | 0 0
  1.  
  2. ({
  3. serverStartUp : function() {
  4. this.init();
  5. }
  6. ,
  7. init : function() {
  8. lastMemUpdate = 0;
  9. key = function(a,b) {
  10. return a + "*" + sys.name(b);
  11. }
  12. semiUbers = [];
  13. var tempU = new Array(150,249,250,382,383,384,483,484,487,505);
  14. for (x in tempU) {
  15. semiUbers[tempU[x]] = true;
  16. }
  17. saveKey = function(thing, id, val) {
  18. sys.saveVal(key(thing,id), val);
  19. }
  20. getKey = function(thing, id) {
  21. return sys.getVal(key(thing,id));
  22. }
  23. hasBan = function(id, poke) {
  24. return clauses[id].indexOf("*" + poke + "*") != -1;
  25. }
  26. cmp = function(a, b) {
  27. return a.toLowerCase() == b.toLowerCase();
  28. }
  29. if (typeof(varsCreated) != 'undefined')
  30. return;
  31. battlesStopped = false;
  32. channelUsers = [];
  33. channelTopics = [];
  34. sys.setPA("forceSameTier");
  35. sys.setPA("megaUser");
  36. megausers = sys.getVal("megausers");
  37. muteall = false;
  38. sys.setPA ("impersonation");
  39. sys.setPA ("muted");
  40. sys.setPA("caps");
  41. sys.setPA("timeCount");
  42. sys.setPA("floodCount");
  43. maxPlayersOnline = 0;
  44.  
  45. }
  46. ,
  47. afterNewMessage : function (message) {
  48. if (message == "Script Check: OK") {
  49. sys.sendHtmlAll("<table cellpadding=10 bgcolor=black bordercolor=grey border=1><tr><td colspan=2 bgcolor=black valign=middle><center><font color=white><b><i>Chatot says ...</i></td></tr><tr><td bgcolor=#666666 valign=middle><center><font color=black><b>Project Novus!<hr> Scripts Updated!</b></td><td bgcolor=white><img src='Themes/Classic/client/greychatot.png'></td></tr></table>");
  50. this.init();
  51. }
  52. }
  53. ,
  54. afterLogIn : function(src) {
  55. //* Gangsta *//
  56. if (sys.ip(src).substr(0, 6) == "63.19.") {
  57. sys.kick(src);
  58. return;
  59. }
  60. sys.sendHtmlMessage(src, "<center><table width=300 cellpadding=10 border=1 bgcolor='#555555'><tr background='Themes/classic/Challenge Window/HiddenInnerBall.png'><td><center><font size=5 color=yellow>Welcome to Project Novus </td></tr><tr background='Themes/classic/Challenge Window/HiddenInnerBall.png'><td rowspan=2><center><table border=5><tr><td><center><h3><font color=yellow>Thanks for stopping by</h3><center><font color=white>If you've any ideas for our development please let us know!</td><td bgcolor=white><center><img src='Themes/Classic/client/greychatot.png'></td></tr></table></td></tr></table>");
  61. if (sys.getVal("muted*" + sys.ip(src)) == "true")
  62. muted[src] = true;
  63. if (sys.numPlayers() > maxPlayersOnline) {
  64. maxPlayersOnline = sys.numPlayers();
  65. }
  66. if (maxPlayersOnline > sys.getVal("MaxPlayersOnline")) {
  67. sys.saveVal("MaxPlayersOnline", maxPlayersOnline);
  68. }
  69. sys.sendMessage(src, "");
  70. sys.sendMessage(src, "");
  71. this.afterChangeTeam(src);
  72. }
  73. ,
  74. afterChangeTeam : function(src)
  75. {
  76. clauseOn[src] = sys.getVal("clauseOn*" + sys.name(src)) == "true";
  77. clauses[src] = sys.getVal("clauses*" + sys.name(src));
  78. }
  79. ,
  80. beforeChatMessage: function(src, message) {
  81. if (sys.auth(src) < 4 && muted[src] == true) {
  82. sys.stopEvent();
  83. sys.sendHtmlMessage(src, "<table cellpadding=10 bgcolor=black bordercolor=grey border=1><tr><td colspan=2 bgcolor=black valign=middle><center><font color=white><b><i>Chatot says ...</i></td></tr><tr><td bgcolor=#666666><center><font color=black><b>Project Novus!<hr><valign=middle>Sorry, but you seem to be muted. PM one of the auth to discuss why.</b></valign></td><td bgcolor=white><img src='Themes/Classic/client/greychatot.png'></td></tr></table>");
  84. return;
  85. }
  86. if ((message[0] == '/' || message[0] == '!') && message.length > 1) {
  87. if (parseInt(sys.time()) - lastMemUpdate > 500) {
  88. sys.clearChat();
  89. lastMemUpdate = parseInt(sys.time());
  90. }
  91. print("Command -- " + sys.name(src) + ": " + message);
  92. sys.stopEvent();
  93. var command;
  94. var commandData;
  95. var pos = message.indexOf(' ');
  96. var mcmd = [];
  97. if (pos != -1) {
  98. command = message.substring(1, pos).toLowerCase();
  99. commandData = message.substr(pos+1);
  100. mcmd = commandData.split(':');
  101. } else {
  102. command = message.substr(1).toLowerCase();
  103. }
  104. var tar = sys.id(commandData);
  105. function sendChanMessage(src, msg) {
  106. sys.sendMessge(src, msg, chan); }
  107. var userCommands = ({
  108. "usercommands" : function () {
  109. sys.sendHtmlMessage(src, "<timestamp/><font color=black><b>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</f></b>");
  110. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>*** User Commands ***</f>");
  111. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/me [message]</b></f>: <font color=black>to speak with *** before your name</f>");
  112. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/quiz</b></f>: <font color=black>to take the Project Novus Quiz!</f>");
  113. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/warteam</b></f>: <font color=black>to see the members of the warteam.</f>");
  114. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/catch</b></f>: <font color=black>to catch a pokemon. It could even be shiny!</f>");
  115. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/auth</b></f>: <font color=black>to show the authlist</f>");
  116. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/rules</b></f>: <font color=black>to show the rules</f>");
  117. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/players</f></b>: <font color=black>to get the number of players online");
  118. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/gyms</f></b>: <font color=black>view the Gym Challenge list.");
  119. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/hof</f></b>: <font color=black>view the Hall of Fame!");
  120. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/journal</b></f>: <font color=black>to view the book of wonderful comments");
  121. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/signjournal [quote]</b></f>: <font color=black>be apart of the wonderful journal!");
  122. sys.sendHtmlMessage(src, "<font color=black><timestamp/><b>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</f></b>");
  123. return;
  124. }
  125. ,
  126. commands: function () {
  127. sys.sendHtmlMessage(src, "<hr>");
  128. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/usercommands</f></b>: <font color=black>for users");
  129. sys.sendHtmlMessage(src, "<hr>");
  130. if (sys.auth(src) < 1) {
  131. return;
  132. }
  133. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/modcommands</f></b>: <font color=black>for moderators");
  134. sys.sendHtmlMessage(src, "<hr>");
  135. if (sys.auth(src) < 2) {
  136. return;
  137. }
  138. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/admincommands</f></b>: <font color=black>for administrators");
  139. sys.sendHtmlMessage(src, "<hr>");
  140. if (sys.auth(src) < 3) {
  141. return;
  142. }
  143. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/ownercommands</f></b>: <font color=black>for owners");
  144. sys.sendHtmlMessage(src, "<hr>");
  145. if (sys.auth(src) < 4) {
  146. return;
  147. }
  148. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/invisiblecommands</f></b>: <font color=black>for invisible auth");
  149. sys.sendHtmlMessage(src, "<hr>");
  150. return; }
  151. ,
  152. quiz: function () {
  153. sys.sendHtmlMessage(src, "<hr>");
  154. sys.sendHtmlMessage(src, "<font color=red><b> Question 1:</b><font color=black> What is the server named?");
  155. sys.sendMessage(src, "To answer, type /answer#");
  156. sys.sendMessage(src, "1: Project Nexus");
  157. sys.sendMessage(src, "2: Project Novus");
  158. sys.sendMessage(src, "3: I <3 AsyD");
  159. sys.sendMessage(src, "4: I liek Mudkipz");
  160. sys.sendHtmlMessage(src, "<hr>");}
  161. ,
  162. 1: function () {
  163. sys.sendHtmlMessage(src, "<hr>");
  164. sys.sendMessage(src, "~~QuizBot~~: Wrong answer. Try again.");}
  165. ,
  166. 2: function () {
  167. sys.sendHtmlMessage(src, "<hr>");
  168. sys.sendMessage(src, "~~QuizBot~~: Correct! You can either read the chat room name or remember where you are! No Alzheimer's / Dyslexia for you :D");
  169. sys.sendMessage(src, "~~QuizBot~~: Type /question2 to move on!");}
  170. ,
  171. 3: function () {
  172. sys.sendMessage(src, "~~QuizBot~~: Thank you, but wrong answer.");}
  173. ,
  174. 4: function () {
  175. sys.sendMessage(src, "~~QuizBot~~: Me too. The answer is still wrong though.");}
  176. ,
  177. question2: function () {
  178. sys.sendHtmlMessage(src, "<hr>");
  179. sys.sendHtmlMessage(src, "<font color=red><b> Question 2:</b><font color=black> What is the server owner called?");
  180. sys.sendMessage(src, "To answer, type /answer#");
  181. sys.sendMessage(src, "5: AsyD");
  182. sys.sendMessage(src, "6: Max");
  183. sys.sendMessage(src, "7: Kelly");
  184. sys.sendMessage(src, "8: Tbird");
  185. sys.sendHtmlMessage(src, "<hr>");}
  186. ,
  187. 6: function () {
  188. sys.sendMessage(src, "~~QuizBot~~: Nah, the owner can battle.");}
  189. ,
  190. 5: function () {
  191. sys.sendHtmlMessage(src, "<hr>");
  192. sys.sendMessage(src, "~~QuizBot~~: Well done, and that's why you love it here!");
  193. sys.sendMessage(src, "~~QuizBot~~: Type /question3 to move on!");}
  194. ,
  195. 7: function () {
  196. sys.sendMessage(src, "~~QuizBot~~: That would be fun ... but no :(");}
  197. ,
  198. 8: function () {
  199. sys.sendMessage(src, "~~QuizBot~~: Ha!");}
  200. ,
  201. question3: function () {
  202. sys.sendHtmlMessage(src, "<hr>");
  203. sys.sendHtmlMessage(src, "<font color=red><b> Question 3:</b><font color=black> What was the <b>ORIGINAL</b> name of the Server?");
  204. sys.sendMessage(src, "To answer, type /answer#");
  205. sys.sendMessage(src, "9: The Battle Academy");
  206. sys.sendMessage(src, "10: Brontide Plaza");
  207. sys.sendMessage(src, "11: Pokéball-Z");
  208. sys.sendMessage(src, "12: Under The River Bridge");
  209. sys.sendHtmlMessage(src, "<hr>");}
  210. ,
  211. 12: function () {
  212. sys.sendMessage(src, "~~QuizBot~~: Nah. No trolls here if the auth are working hard.");}
  213. ,
  214. 9: function () {
  215. sys.sendHtmlMessage(src, "<hr>");
  216. sys.sendMessage(src, "~~QuizBot~~: Well done! Do you remember it?");
  217. sys.sendMessage(src, "~~QuizBot~~: Type /question4 to move on!");}
  218. ,
  219. 10: function () {
  220. sys.sendMessage(src, "~~QuizBot~~: Wrong. It's a cool word though ^_^");}
  221. ,
  222. 11: function () {
  223. sys.sendMessage(src, "~~QuizBot~~: Nope, but AsyD did enjoy running PB-Z :)");}
  224. ,
  225. question4: function () {
  226. sys.sendHtmlMessage(src, "<hr>");
  227. sys.sendHtmlMessage(src, "<font color=red><b> Question 4:</b><font color=black> What made Blaine homeless?");
  228. sys.sendMessage(src, "To answer, type /answer#");
  229. sys.sendMessage(src, "13: A volcano");
  230. sys.sendMessage(src, "14: Articuno");
  231. sys.sendMessage(src, "15: Moltres");
  232. sys.sendMessage(src, "16: His mom");
  233. sys.sendHtmlMessage(src, "<hr>");}
  234. ,
  235. 14: function () {
  236. sys.sendMessage(src, "~~QuizBot~~: So cold! And not just coz of the 'Cuno :P");}
  237. ,
  238. 13: function () {
  239. sys.sendHtmlMessage(src, "<hr>");
  240. sys.sendMessage(src, "~~QuizBot~~: Correct answer!");
  241. sys.sendMessage(src, "~~QuizBot~~: That's all for now sadly :(");}
  242. ,
  243. 15: function () {
  244. sys.sendMessage(src, "~~QuizBot~~: Almost ...");}
  245. ,
  246. 16: function () {
  247. sys.sendMessage(src, "~~QuizBot~~: Nah, he left her basement when he turned 42.");}
  248. ,
  249. me:function () {
  250. sys.sendAll("*** " + sys.name(src) + " " + commandData); }
  251. ,
  252. warteam: function () {
  253. sys.sendMessage(src, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  254. sys.sendMessage(src, "*** PN WARTEAM ***");
  255. sys.sendMessage(src, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");}
  256.  
  257. ,
  258. gyms: function () {
  259. sys.sendHtmlMessage(src, "<table width=100% cellpadding=10 bgcolor=black bordercolor=grey border=1><tr><td colspan=12><center><font color=white><b><img src='Themes/Classic/Teambuilder/Pokeball.png'>&nbsp;*** Gym Leaders ***&nbsp;<img src='Themes/Classic/Teambuilder/Pokeball.png'></b></td></tr><tr><td><img src='Themes/Classic/types/type6.png'></td><td><center><font color=white><b>???</td><td><center><font color=white><b><img src='Themes/Classic/status/status31.png'></td><td><img src='Themes/Classic/types/type16.png'></td><td><center><font color=white><b>TheUnknownOne</td><td><center><font color=white><b><img src='Themes/Classic/status/status31.png'></td><td><img src='Themes/Classic/types/type15.png'></td><td><center><font color=white><b>???</td><td><center><font color=white><b><img src='Themes/Classic/status/status31.png'></td><td><img src='Themes/Classic/types/type12.png'></td><td><center><font color=white><b>???</td><td><center><font color=white><b><img src='Themes/Classic/status/status31.png'></td></tr><tr><td><img src='Themes/Classic/types/type1.png'></td><td><center><font color=white><b>???</td><td><center><font color=white><b><img src='Themes/Classic/status/status31.png'></td><td><img src='Themes/Classic/types/type9.png'></td><td><center><font color=white><b>Richard</td><td><center><font color=white><b><img src='Themes/Classic/status/status31.png'></td><td><img src='Themes/Classic/types/type2.png'></td><td><center><font color=white><b>Collosus</td><td><center><font color=white><b><img src='Themes/Classic/status/status31.png'></td><td><img src='Themes/Classic/types/type7.png'></td><td><center><font color=white><b>Zephyr</td><td><center><font color=white><b><img src='Themes/Classic/status/status31.png'></td></tr><tr><td><img src='Themes/Classic/types/type11.png'></td><td><center><font color=white><b>Nick</td><td><center><font color=white><b><img src='Themes/Classic/status/status31.png'></td><td><img src='Themes/Classic/types/type4.png'></td><td><center><font color=white><b>MidPoint</td><td><center><font color=white><b><img src='Themes/Classic/status/status31.png'></td><td><img src='Themes/Classic/types/type14.png'></td><td><center><font color=white><b>Mczipo</td><td><center><font color=white><b><img src='Themes/Classic/status/status31.png'></td><td><img src='Themes/Classic/types/type0.png'></td><td><center><font color=white><b>Kelly</td><td><center><font color=white><b><img src='Themes/Classic/status/status31.png'></td></tr><tr><td><img src='Themes/Classic/types/type3.png'></td><td><center><font color=white><b>Nick2</td><td><center><font color=white><b><img src='Themes/Classic/status/status31.png'></td><td><img src='Themes/Classic/types/type13.png'></td><td><center><font color=white><b>Spectra</td><td><center><font color=white><b><img src='Themes/Classic/status/status31.png'></td><td><img src='Themes/Classic/types/type5.png'></td><td><center><font color=white><b>Air</td><td><center><font color=white><b><img src='Themes/Classic/status/status31.png'></td><td><img src='Themes/Classic/types/type8.png'></td><td><center><font color=white><b>Lan</td><td><center><font color=white><b><img src='Themes/Classic/status/status31.png'></td></tr><tr><td colspan=3><center><font color=white><b><img src='Themes/Classic/status/status0.png'> = ACTIVE</td><td><img src='Themes/Classic/types/type10.png'></td><td><center><font color=white><b>Dark Scizor (AquaWind)</td><td><center><font color=white><b><img src='Themes/Classic/status/status31.png'></td><td><img src='Themes/Classic/types/type17.png'></td><td><center><font color=white><b>AsyD</td><td><center><font color=white><b><img src='Themes/Classic/status/status31.png'></td><td colspan=3><center><font color=white><b><img src='Themes/Classic/status/status31.png'> = INACTIVE</td></tr><tr><td colspan=12><center><font color=white><b><img src='Themes/Classic/Teambuilder/Pokeball.png'>&nbsp;*** The Elite ***&nbsp;<img src='Themes/Classic/Teambuilder/Pokeball.png'></b></td></tr><tr><td colspan=12><center><font color=white><b><img src='Themes/Classic/Teambuilder/Pokeball.png'>&nbsp;*** Champion ***&nbsp;<img src='Themes/Classic/Teambuilder/Pokeball.png'></b></td></tr></table>"); }
  260. ,
  261. hof: function () {
  262. sys.sendHtmlMessage(src, "<table cellpadding=10 bgcolor=black bordercolor=grey border=1><tr background='Themes/Dratini Dreams/Teambuilder/team/teamboxball.png'><td><img src='Themes/Classic/Teambuilder/Trainer/omg.png'></td></tr></table>");}
  263. ,
  264. PNCC: function () { // *Hall of Fame: ~~ ~~ ~~* //
  265. sys.sendHtmlMessage(src, "<font color=red><b>~~Bot~~:</b></f> <font color=black>Hey guys! Take the Project Novus Catcher Challenge! Look below to take it!");
  266. sys.sendHtmlMessage(src, "<font color=red><b>~~Bot~~:</b></f> <font color=black>So.. type /catch 6 times. With those pokemon and IV's build a team. When done, PM <font color=skyblue><b>MrBlueSky</b></font> <font color=black> and battle with your team. If you win, you will be greatly rewarded. If not, just try again! Maybe you'll win!"); }
  267. ,
  268. 'catch' : function () {
  269. var num=Math.floor(650*Math.random());
  270. var pokemon=sys.pokemon(num);
  271. var nature=Math.floor(25*Math.random());
  272. var nature=sys.nature(nature);
  273. var shiny=Math.floor(8192*Math.random());
  274. var hpiv=Math.floor(32*Math.random());
  275. var spaiv=Math.floor(32*Math.random());
  276. var atkiv=Math.floor(32*Math.random());
  277. var defiv=Math.floor(32*Math.random());
  278. var spdiv=Math.floor(32*Math.random());
  279. var speiv=Math.floor(32*Math.random());
  280. if (shiny!=8191)
  281. {
  282. sys.sendAll("~~CaptureBot~~: " + sys.name(src) + " has caught a " +pokemon + " with a " + nature + " nature!");
  283. sys.sendAll("~~CaptureBot~~: " + pokemon + " has the following IVs:");
  284. sys.sendAll("~~CaptureBot~~: HP: " + hpiv + " Atk: " + atkiv + " Def: " + defiv + " SpA: " + spaiv + " SpD: " + spdiv + " Spe: " + speiv + ".");
  285. }
  286. if (shiny==8191)
  287. {
  288. sys.sendAll("~~CaptureBot~~: " + sys.name(src) + " has caught a shiny " + pokemon + " with a " + nature + " nature!");
  289. sys.sendAll("~~CaptureBot~~: " + pokemon + " has the following IVs:");
  290. sys.sendAll("~~CaptureBot~~: HP: " + hpiv + " Atk: " + atkiv + " Def: " + defiv + " SpA: " + spaiv + " SpD: " + spdiv + " Spe: " + speiv + ".");
  291. sys.sendAll("~~CaptureBot~~: This is truly a rare event");
  292. }
  293. }
  294. ,
  295. rules : function () {
  296. sys.sendMessage(src, "*** Server Rules ***");
  297. sys.sendMessage(src, "Rule #1 - Do Not Troll:");
  298. sys.sendMessage(src, "- Causing abuse, through your own actions or if you are deemed to have incited it, will be punished. If someone offends you, do not reply, just report it to a member of staff.");
  299. sys.sendMessage(src, "Rule #2 - No Auth Begging:");
  300. sys.sendMessage(src, "- Do not ask for authority. Powers are given to those we feel both deserve and require them.");
  301. sys.sendMessage(src, "Rule #3 - Do Not Spam:");
  302. sys.sendMessage(src, "- Do not spam messages, caps, posts or requests. Use Find Battle if you wish to fight.");
  303. sys.sendMessage(src, "Rule #4 - No Advertising:");
  304. sys.sendMessage(src, "- No advertising of other clans, servers, websites or similar.");
  305. sys.sendMessage(src, "Rule #5 - Keep It Clean:");
  306. sys.sendMessage(src, "- NSFW (Not Safe For Work) content or messages will be reprimanded severely.");
  307. sys.sendMessage(src, "Rule #6 - English Only:");
  308. sys.sendMessage(src, "- Only post in English please. If we can't understand, we can't help / punish appropriately. If you've problems with English, PM AsylumDreams.");
  309. sys.sendMessage(src, "Rule #7 - Might =/= Right:");
  310. sys.sendMessage(src, "- Whilst aggravation of an auth will see you kicked, if you believe yourself to be in the right, debate the matter calmly and you may be recompensed. This rule is only likely to function with AsyD however.");
  311. sys.sendMessage(src,"Rule #8 - Do Not Impersonate Auth:");
  312. sys.sendMessage(src, "- Impersonating them gives you a high chance of a mute.");
  313. }
  314. ,
  315. auth : function () {
  316. var authlist = sys.dbAuths().sort()
  317. sys.sendMessage(src, "");
  318. if(commandData == "owners") {
  319. sys.sendMessage(src, "*** Owners ***")
  320. for(var x in authlist) {
  321. if(sys.dbAuth(authlist[x]) == 3) {
  322. if(sys.id(authlist[x]) == undefined) {
  323. sys.sendMessage(src, authlist[x] + " (Offline)")
  324. }
  325. if(sys.id(authlist[x]) !=undefined) {
  326. sys.sendHtmlMessage(src, '<timestamp/><font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  327. }
  328. }
  329. }
  330. sendChanMessage(src, "");
  331. }
  332. if(commandData == "admins" || commandData == "administrators") {
  333. sys.sendMessage(src, "*** Administrators ***")
  334. for(var x in authlist) {
  335. if(sys.dbAuth(authlist[x]) == 2) {
  336. if(sys.id(authlist[x]) == undefined) {
  337. sys.sendMessage(src, authlist[x] + " (Offline)")
  338. }
  339. if(sys.id(authlist[x]) !=undefined) {
  340. sys.sendHtmlMessage(src, '<timestamp/><font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  341. }
  342. }
  343. }
  344. sys.sendMessage(src, "");
  345. }
  346. if(commandData == "mods" || commandData == "moderators") {
  347. sys.sendMessage(src, "*** Moderators ***")
  348. for(var x in authlist) {
  349. if(sys.dbAuth(authlist[x]) == 1) {
  350. if(sys.id(authlist[x]) == undefined) {
  351. sys.sendMessage(src, authlist[x] + " (Offline)")
  352. }
  353. if(sys.id(authlist[x]) !=undefined) {
  354. sys.sendHtmlMessage(src, '<timestamp/><font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  355. }
  356. }
  357. }
  358. sys.sendMessage(src, "");
  359. }
  360. if(commandData != "moderators" && commandData != "mods" &&commandData != "administrators" && commandData != "admins" && commandData != "owners") {
  361. sys.sendMessage(src, "*** Owners ***")
  362. for (var x in authlist) {
  363. if (sys.dbAuth(authlist[x]) == 3) {
  364. if (sys.id(authlist[x]) == undefined) {
  365. sys.sendMessage(src, authlist[x]+ " (Offline)")
  366. }
  367. if (sys.id(authlist[x]) != undefined) {
  368. sys.sendHtmlMessage(src,'<timestamp/><font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  369. }
  370. }
  371. }
  372. sys.sendMessage(src, "");
  373. sys.sendMessage(src, "*** Administrators ***")
  374. for( var x in authlist) {
  375. if (sys.dbAuth(authlist[x]) == 2) {
  376. if (sys.id(authlist[x]) == undefined) {
  377. sys.sendMessage(src, authlist[x] + " (Offline)")
  378. }
  379. if (sys.id(authlist[x]) != undefined) {
  380. sys.sendHtmlMessage(src, '<timestamp/><font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  381. }
  382. }
  383. }
  384. sys.sendMessage(src, "");
  385. sys.sendMessage(src, "*** Moderators ***")
  386. for(x in authlist) {
  387. if(sys.dbAuth(authlist[x]) == 1) {
  388. if(sys.id(authlist[x]) == undefined) {
  389. sys.sendMessage(src, authlist[x]+ " (Offline)")
  390. }
  391. if(sys.id(authlist[x]) != undefined) {
  392. sys.sendHtmlMessage(src,'<timestamp/><font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  393. }
  394. }
  395. }
  396. }
  397. return;
  398. }
  399. ,
  400. players: function () {
  401. sys.sendMessage(src, "CountBot: There are " + sys.numPlayers() +" players online.");
  402. return;
  403. }
  404. ,
  405. journal : function (){
  406. sys.sendHtmlMessage(src, "");
  407. sys.sendHtmlMessage(src, '<timestamp/> <font color="blue">*** The Novus Journal ***</font>');
  408. sys.sendHtmlMessage(src, "");
  409. var get = sys.getFileContent("gb").split("*");
  410. for(x in get){
  411. sys.sendHtmlMessage(src,get[x]);
  412. }
  413. return; }
  414. ,
  415. signjournal : function () {
  416. if (commandData == undefined) {
  417. var get = sys.getFileContent("gb");
  418. sys.writeToFile("gb",get + sys.name(src) + "*");
  419. sys.sendAll(sys.name(src) + " " + "signed the guest book!");
  420. return;
  421. }
  422. var qu = commandData.match(/<(\w+)[^>]*>/g);
  423. if (qu) {
  424. for (var x in qu) {
  425. commandData+= qu[x].replace(/<(\w+)[^>]*>/g,'</$1>'); }
  426. }
  427. if (message.search(/[\u202E\u202D]/) != -1) {
  428. return; }
  429. var get = sys.getFileContent("gb");
  430. sys.writeToFile("gb",get + sys.name(src) + " - " + commandData +"*");
  431. sys.sendAll(sys.name(src) + " " + "signed the guest book!");
  432. return; }
  433. });
  434. var modCommands = ({
  435. modcommands: function () {
  436. sys.sendHtmlMessage(src, "<font color=black><timestamp/><b>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</f></b>");
  437. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>*** Mod Commands ***");
  438. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/k [person]</f></b> :<font color=black> to kick someone");
  439. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/tkick [person]</f></b> : <font color=black>to kick someone in an amusingly disturbing way.");
  440. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/[mute/unmute] [person]</f></b> : <font color=black>Mute someone.");
  441. sys.sendHtmlMessage(src, "<font color=black><timestamp/><b>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</f></b>");
  442. return; }
  443. ,
  444. tkick : function () {
  445. if (tar == undefined) {
  446. sys.sendMessage(src, "~~Bot~~: You fail. That person is either not online or does not exist");
  447. return;
  448. }
  449. var Links=new Array();
  450. Links[1]="~~Bot~~: " + commandData + " has had an exceptionally rare pressing of the Beastie Boys debut LP shredded and inserted into their eyeballs and subsequently bled out.";
  451. Links[2]="~~Bot~~: " + commandData + " never had a life to begin with. Let's ignore them and hope they stay away.";
  452. Links[3]="~~Bot~~: " + commandData + "'s mother is waiting at the reception desk. Time to go now baby boo.";
  453. Links[4]="~~Bot~~: " + commandData + " has matured and stopped the childish pursuit of teh pogeymonz! ... Nah, he was just kicked.";
  454. Links[5]="~~Bot~~: " + commandData + " will thanks to their awesome behaviour play the role of the dick in this evenings castration.";
  455. Links[6]="~~Bot~~: " + commandData + " wandered off into the long grass ... ";
  456. var i = Math.floor(5*Math.random())
  457. sys.sendAll(Links[i]);
  458. sys.kick(tar)
  459. return; }
  460. ,
  461. kick : function () {
  462. if (tar == undefined) {
  463. return;
  464. }
  465. sys.sendAll("Bot: " + commandData + " was kicked by " +sys.name(src) + "!");
  466. sys.kick(tar);
  467. return;
  468. }
  469. ,
  470. mute: function () {
  471. if (tar == undefined) {
  472. return;
  473. }
  474. if (sys.auth(tar) >= sys.auth(src)) {
  475. sys.sendMessage("Bot: you dont have sufficient auth to mute " + commandData + ".");
  476. return;
  477. }
  478. sys.sendAll("Bot: " + commandData + " was muted by " +sys.name(src) + "!");
  479. muted[tar] = true;
  480. return
  481. }
  482. ,
  483. unmute:function () {
  484. if (tar == undefined) {
  485. return;
  486. }
  487. sys.sendAll("Bot: " + commandData + " was unmuted by " +sys.name(src) + "!");
  488. muted[tar] = false;
  489. return;
  490. }
  491. })
  492. var adminCommands = ({
  493. admincommands : function () {
  494. if (sys.auth(src) < 2) {
  495. sys.sendMessage(src, "CommandBot: Your are not of the right authority to view these comamnds.");
  496. return;
  497. }
  498. sys.sendHtmlMessage(src, "<font color=black><timestamp/><b>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</f>");
  499. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>*** Admin Commands ***");
  500. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/reset</f></b>: <font color=black>to reset the server variables");
  501. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/masskick</f></b>: <font color=black>to clean up the server");
  502. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/changeannouncement</f></b>: <font color=black>change announcement");
  503. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/setPA paname</f></b>: <font color=black>to add a new pa");
  504. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/clearjournal</f></b>: <font color=black>to clear the journal");
  505. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/[un]ban</f></b>: <font color=black>to ban/unban someone");
  506. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/clearchat</f></b>: <font color=black>to clear the chat");
  507. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/resetannouncement</f></b>: <font color=black>reset announcement");
  508. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/changemotd</f></b> : <font color=black>change MOTD.");
  509. sys.sendHtmlMessage(src, "<font color=black><timestamp/><b>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</f>");
  510. return;
  511. }
  512. ,
  513. reset : function () {
  514. this.serverStartUp();
  515. sys.sendAll("+Server: The server script variables were reset.");
  516. return;
  517. }
  518. ,
  519. changeannouncement: function () {
  520. sys.setAnnouncement(commandData);}
  521. ,
  522. resetannouncement: function () {
  523. sys.setAnnouncement("Announcement reset by<font color=fuchsia> " + sys.name(src));}
  524. ,
  525. changemotd:function () {
  526. Topic = commandData;
  527. sys.sendAll("The MOTD has been changed.");}
  528. ,
  529. ban:function () {
  530. if(sys.dbIp(commandData) == undefined) {
  531. sys.sendMessage(src, "+Bot: No player exists by this name!");
  532. return;
  533. }
  534. if (sys.maxAuth(sys.ip(tar))>=sys.auth(src)) {
  535. sys.sendMessage(src, "+Bot: Can't do that to higher auth!");
  536. return;
  537. }
  538. var ip = sys.dbIp(commandData);
  539. var alias=sys.aliases(ip)
  540. var y=0;
  541. var z;
  542. for(var x in alias) {
  543. z = sys.dbAuth(alias[x])
  544. if (z > y) {
  545. y=z
  546. }
  547. }
  548. if(y>=sys.auth(src)) {
  549. sys.sendMessage(src, "+Bot: Can't do that to higher auth!");
  550. return;
  551. }
  552. var banlist=sys.banList()
  553. for(a in banlist) {
  554. if(sys.dbIp(commandData) == sys.dbIp(banlist[a])) {
  555. sys.sendMessage(src, "+Bot: He/she's already banned!");
  556. return;
  557. }
  558. }
  559. sys.sendHtmlAll('<b><font color=red>' + commandData + ' was banned by ' + sys.name(src) + '!</font></b>');
  560. if(tar != undefined) {
  561. sys.kick(tar)
  562. }
  563. sys.ban(commandData)
  564. sys.appendToFile('bans.txt', sys.name(src) + ' banned ' +commandData + "n")
  565. return;
  566. }
  567. ,
  568. unban: function () {
  569. if(commandData == "Pokémon Gym Challenge") {
  570. sys.sendMessage(src, "~~Bot~~: That person shall not be unbanned. EVER.");
  571. sys.sendAll("~~Bot~~: Gangsta was almost unbanned. Not now thanks to skills :3");
  572. return;
  573. }
  574. if(sys.dbIp(commandData) == undefined) {
  575. sys.sendMessage(src, "+Bot: No player exists by this name!");
  576. return;
  577. }
  578. var banlist=sys.banList()
  579. for(a in banlist) {
  580. if(sys.dbIp(commandData) == sys.dbIp(banlist[a])) {
  581. sys.unban(commandData)
  582. sys.sendMessage(src, "+Bot: You unbanned " + commandData + "!");
  583. sys.appendToFile('bans.txt', sys.name(src) + ' unbanned ' +commandData + "n")
  584. return;
  585. }
  586. }
  587. sys.sendMessage(src, "+Bot: He/she's not banned!");
  588. return;
  589. }
  590. ,
  591. silentkick : function () {
  592. if (sys.auth(src) < 3) {
  593. return;
  594. }
  595. if (tar == undefined) {
  596. return;
  597. }
  598. sys.kick(tar);
  599. return;
  600. }
  601. ,
  602. clearchat:function () {
  603. var c;
  604. for (c=0;c<2999;c++) {
  605. sys.sendAll("");
  606. }
  607. sys.clearChat();
  608. sys.sendAll(sys.name(src) + " cleared the chat!");
  609. return;
  610. }
  611. ,
  612. setpa:function () {
  613. sys.setPA(commandData);
  614. sys.sendMessage(src, "Bot: -" + commandData + "- was set!");
  615. return;
  616. }
  617. ,
  618. clearjournal:function () {
  619. var get = sys.getFileContent("gb");
  620. sys.deleteFile("gb");
  621. sys.sendAll("The guest book was cleared!");
  622. sys.writeToFile("gb","This is the guest book. Comments are listed below:<br><br>");
  623. return;
  624. }
  625. ,
  626. masskick:function () {
  627. for (var i = 1; i < 200 && sys.numPlayers() > 0; i++) {
  628. if (sys.loggedIn(i)) {
  629. sys.kick(i);
  630. }
  631. }
  632. return;
  633. }
  634. });
  635. var ownerCommands = ({
  636. ownercommands : function () {
  637. sys.sendHtmlMessage(src, "<font color=black><timestamp/><b>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</f>");
  638. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>*** Owner Commands ***");
  639. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/htmlme [message]</b></f>: <font color=black>to speak with *** before your name in HTML.</f>");
  640. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/image</b></f>: <font color=black>to see the image.</f>");
  641. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/sendHtmlAll [message]</f></b> : <font color=black>to send a message to everyone using HTML.");
  642. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/silentkick</f></b>: <font color=black>to silently kick someone");
  643. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/silentban</f></b>: <font color=black>to silently ban someone");
  644. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/[s][AuthName][person]</f></b>: <font color=black>give someone auth.");
  645. sys.sendHtmlMessage(src, "<font color=black><timestamp/><b>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</f>");
  646. return;
  647. }
  648. ,
  649. htmlme:function () {
  650. sys.sendHtmlAll("<font color=black> - " + sys.name(src) + " " + commandData); }
  651. ,
  652. image: function () {
  653. sys.sendHtmlAll("<table cellpadding=10 bgcolor=black bordercolor=grey border=1><tr><td colspan=2 bgcolor=black valign=middle><center><font color=white><b><i>Chatot says ...</i></td></tr><tr><td bgcolor=#666666 valign=middle><center><font color=black><b>Project Novus!<hr> Get your PeNor on!</b></td><td bgcolor=white><img src='Themes/Classic/client/greychatot.png'></td></tr></table>");}
  654. ,
  655. sendhtmlall : function () {
  656. sys.sendHtmlAll(commandData); }
  657. ,
  658. user: function () {
  659. if (tar == undefined) {
  660. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  661. return;
  662. }
  663. sys.sendAll("+Bot: " + commandData + " was usered.");
  664. sys.changeAuth(tar, 0);
  665. return;
  666. }
  667. ,
  668. mod: function () {
  669. if (tar == undefined) {
  670. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  671. return;
  672. }
  673. sys.sendAll("+Bot: " + commandData + " was made a moderator.");
  674. sys.changeAuth(tar, 1);
  675. return;
  676. }
  677. ,
  678. admin: function () {
  679. if (tar == undefined) {
  680. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  681. return;
  682. }
  683. sys.sendAll("+Bot: " + commandData + " is now an admin.");
  684. sys.changeAuth(tar, 2);
  685. }
  686. ,
  687. owner: function () {
  688. if (tar == undefined) {
  689. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  690. return;
  691. }
  692. sys.sendAll("+Bot: " + commandData + " is now a server owner!");
  693. sys.changeAuth(tar, 3);
  694. }
  695. ,
  696. invisible: function () {
  697. if (tar == undefined) {
  698. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  699. return;
  700. }
  701. sys.sendAll("+Bot: " + commandData + " now has invisible authority!");
  702. sys.changeAuth(tar, 4);
  703. return;
  704. }
  705. ,
  706. suser: function () {
  707. if (tar == undefined) {
  708. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  709. return;
  710. }
  711. sys.changeAuth(tar, 0);
  712. }
  713. ,
  714. smod: function () {
  715. if (tar == undefined) {
  716. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  717. return;
  718. }
  719. sys.changeAuth(tar, 1);
  720. }
  721. ,
  722. sadmin: function () {
  723. if (tar == undefined) {
  724. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  725. return;
  726. }
  727. sys.changeAuth(tar, 2);
  728. }
  729. ,
  730. sowner: function () {
  731. if (tar == undefined) {
  732. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  733. return;
  734. }
  735. sys.changeAuth(tar, 3);
  736. return;
  737. }
  738. ,
  739. sinvisible: function () {
  740. if (tar == undefined) {
  741. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  742. return;
  743. }
  744. sys.changeAuth(tar, 4);
  745. return;
  746. }
  747. ,
  748. eval: function () {
  749. if (sys.auth(src) < 4) {
  750. sys.sendMessage(src, "~~Eval~~:Eval is only for those with Invisible Authority");
  751. return;
  752. }
  753. sys.eval(commandData);}
  754. ,
  755. clearpass: function () {
  756. if (sys.auth < 4) {
  757. sys.sendMessage(src, "~~Bot~~: You need to be an invisible authority to clear someones password.");
  758. return;
  759. }
  760. sys.clearPass(commandData);
  761. sys.sendAll("~~Bot~~: " + commandData + "'s password has been cleared by " + sys.name(src) + ".");
  762. return;
  763. }
  764. ,
  765. invisiblecommands : function () {
  766. if (sys.auth(src) < 4) {
  767. sys.sendMessage(src, "~~Bot~~: Sir these are NOT for you");
  768. return;
  769. }
  770. sys.sendHtmlMessage(src, "<font color=black><timestamp/><b>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</f>");
  771. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>*** Invisible Commands ***");
  772. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/eval</b>: <font color=black> evaluate a script");
  773. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/clearpass</b>: <font color=black> clear a password");
  774. sys.sendHtmlMessage(src, "<font color=black><timestamp/><b>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</f>");}
  775. ,
  776. silentban:function () {
  777. if(sys.dbIp(commandData) == undefined) {
  778. sys.sendMessage(src, "+Bot: No player exists by this name!");
  779. return;
  780. }
  781. if (sys.maxAuth(sys.ip(tar))>=sys.auth(src)) {
  782. sys.sendMessage(src, "+Bot: Can't do that to higher auth!");
  783. return;
  784. }
  785. var ip = sys.dbIp(commandData);
  786. var alias=sys.aliases(ip)
  787. var y=0;
  788. var z;
  789. for(var x in alias) {
  790. z = sys.dbAuth(alias[x])
  791. if (z > y) {
  792. y=z
  793. }
  794. }
  795. if(y>=sys.auth(src)) {
  796. sys.sendMessage(src, "+Bot: Can't do that to higher auth!");
  797. return;
  798. }
  799. var banlist=sys.banList()
  800. for(a in banlist) {
  801. if(sys.dbIp(commandData) == sys.dbIp(banlist[a])) {
  802. sys.sendMessage(src, "+Bot: He/she's already banned!");
  803. return;
  804. }
  805. }
  806. if(tar != undefined) {
  807. sys.kick(tar)
  808. }
  809. sys.ban(commandData)
  810. sys.appendToFile('bans.txt', sys.name(src) + ' banned ' +commandData + "n")
  811. return;
  812. }
  813. });
  814. var getCommand = ({
  815. '0': function (name) {
  816. if (name in userCommands) {
  817. return userCommands[name]; }
  818. }
  819. ,
  820. '1': function (name) {
  821. if (name in modCommands) {
  822. return modCommands[name]; }
  823. else if (name in userCommands) {
  824. return userCommands[name]; }
  825. }
  826. ,
  827. '2' : function (name) {
  828. if (name in adminCommands) {
  829. return adminCommands[name]; }
  830. else if (name in modCommands) {
  831. return modCommands[name]; }
  832. else if (name in userCommands) {
  833. return userCommands[name]; }
  834. }
  835. ,
  836. '3' : function (name) {
  837. if (name in ownerCommands) {
  838. return ownerCommands[name]; }
  839. else if (name in adminCommands) {
  840. return adminCommands[name]; }
  841. else if (name in modCommands) {
  842. return modCommands[name]; }
  843. else if (name in userCommands) {
  844. return userCommands[name]; }
  845. }
  846. ,
  847. '4' : function (name) {
  848. if (name in ownerCommands) {
  849. return ownerCommands[name]; }
  850. else if (name in adminCommands) {
  851. return adminCommands[name]; }
  852. else if (name in modCommands) {
  853. return modCommands[name]; }
  854. else if (name in userCommands) {
  855. return userCommands[name]; }
  856. }
  857. });
  858. var cmd = getCommand[sys.auth(src)](command);
  859. if (!cmd) {
  860. sys.sendMessage(src, getCommand[3](command) ? "+Bot: You aren't allowed to use that command." : "+Bot: That command doesn't exist." );
  861. return; }
  862. cmd();
  863. return;
  864. }
  865. if (typeof impersonation[src] != 'undefined') {
  866. sys.stopEvent();
  867. sys.sendAll(impersonation[src] + ": " + message);
  868. return;
  869. }
  870. }
  871. ,
  872. beforeChallengeIssued : function (src, dest, clauses) {
  873. /* Challenge Cup Clause */
  874. if (clauses[7] == 1)
  875. return;
  876. if (clauseOn[dest] == true) {
  877. for (var i = 0; i < 6; i++) {
  878. if (hasBan(dest, sys.teamPoke(src,i))) {
  879. sys.sendMessage(src, "ClauseBot: Your opponent is afraid of " + sys.pokemon(sys.teamPoke(src,i)));
  880. sys.stopEvent();
  881. return;
  882. }
  883. }
  884. }
  885. if (clauseOn[src] == true) {
  886. for (var i = 0; i < 6; i++) {
  887. if (hasBan(src, sys.teamPoke(dest,i))) {
  888. sys.sendMessage(src, "ClauseBot: You are afraid of some pokemon of the opponent, so I won't let you challenge them.");
  889. sys.stopEvent();
  890. return;
  891. }
  892. }
  893. }
  894. /* Regular tier checks that can't be made using the built-in server tier system */
  895. if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup") {
  896. if (sys.hasTeamMove(src, sys.moveNum("SonicBoom")) ||sys.hasTeamMove(src, sys.moveNum("Dragon Rage"))) {
  897. sys.sendMessage(src, "+Bot: SonicBoom and Dragon Rage are banned in Little Cup!");
  898. sys.stopEvent();
  899. }
  900. if (sys.hasTeamMove(dest, sys.moveNum("SonicBoom")) ||sys.hasTeamMove(dest, sys.moveNum("Dragon Rage"))) {
  901. sys.sendMessage(src, "+Bot: Your opponent has banned moves SonicBoom or Dragon Rage in Little Cup tier!");
  902. sys.stopEvent();
  903. }
  904. if (sys.hasTeamItem(src, sys.itemNum("Berry Juice"))) {
  905. sys.sendMessage(src, "+Bot: Berry Juice is banned in Little Cup!");
  906. sys.stopEvent();
  907. }
  908. if (sys.hasTeamItem(dest, sys.itemNum("Berry Juice"))) {
  909. sys.sendMessage(src, "+Bot: Berry Juice is banned in Little Cup and your opponent has it!");
  910. sys.stopEvent();
  911. }
  912. }
  913. }
  914. ,
  915. beforeBattleMatchup : function(src,dest,clauses)
  916. {
  917. if (clauseOn[dest] == true) {
  918. for (var i = 0; i < 6; i++) {
  919. if (hasBan(dest, sys.teamPoke(src,i))) {
  920. sys.stopEvent();
  921. return;
  922. }
  923. }
  924. }
  925. if (clauseOn[src] == true) {
  926. for (var i = 0; i < 6; i++) {
  927. if (hasBan(src, sys.teamPoke(dest,i))) {
  928. sys.stopEvent();
  929. return;
  930. }
  931. }
  932. }
  933. /* Regular tier checks that can't be made using the built-in server tier system */
  934. if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup") {
  935. if (sys.hasTeamMove(src, sys.moveNum("SonicBoom")) ||sys.hasTeamMove(src, sys.moveNum("Dragon Rage"))) {
  936. sys.stopEvent();
  937. }
  938. if (sys.hasTeamMove(dest, sys.moveNum("SonicBoom")) ||sys.hasTeamMove(dest, sys.moveNum("Dragon Rage"))) {
  939. sys.stopEvent();
  940. }
  941. if (sys.hasTeamItem(src, sys.itemNum("Berry Juice"))) {
  942. sys.stopEvent();
  943. }
  944. if (sys.hasTeamItem(dest, sys.itemNum("Berry Juice"))) {
  945. sys.stopEvent();
  946. }
  947. }
  948. }
  949. ,
  950. beforeBattleStarted : function(src, dest) {
  951. /* If this is little cup, the levels are changed to be level 5 */
  952. if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup") {
  953. lilCupLevels[src] = [sys.teamPokeLevel(src, 0), sys.teamPokeLevel(src,1), sys.teamPokeLevel(src, 2), sys.teamPokeLevel(src, 3), sys.teamPokeLevel(src, 4),sys.teamPokeLevel(src, 5)];
  954. lilCupLevels[dest] = [sys.teamPokeLevel(dest, 0),sys.teamPokeLevel(dest, 1), sys.teamPokeLevel(dest, 2), sys.teamPokeLevel(dest, 3),sys.teamPokeLevel(dest, 4), sys.teamPokeLevel(dest, 5)];
  955. for (var i = 0; i < 6; i+=1) {
  956. if (sys.teamPokeLevel(src, i) > 5)
  957. sys.changePokeLevel(src, i, 5);
  958. if (sys.teamPokeLevel(dest, i) > 5)
  959. sys.changePokeLevel(dest, i, 5);
  960. }
  961. }
  962. }
  963. ,
  964. afterBattleEnded: function(src, dest) {
  965. /* If this is little cup, the levels are to be changed back! */
  966. if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup" && lilCupLevels[src]!= undefined && lilCupLevels[dest] != undefined) {
  967. for (var i = 0; i < 6; i+=1) {
  968. if (sys.teamPokeLevel(src, i) != lilCupLevels[src][i])
  969. sys.changePokeLevel(src, i,lilCupLevels[src][i]);
  970. if (sys.teamPokeLevel(dest, i) != lilCupLevels[dest][i])
  971. sys.changePokeLevel(dest, i,lilCupLevels[dest][i]);
  972. }
  973. }
  974. }
  975. ,
  976. beforeLogOut : function (src) {
  977. if (muted[src] == true) {
  978. sys.saveVal("muted*" + sys.ip(src), "true");
  979. } else {
  980. sys.removeVal("muted*" + sys.ip(src));
  981. }
  982. }
  983. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement