Advertisement
Guest User

Untitled

a guest
Aug 7th, 2017
445
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 99.52 KB | None | 0 0
  1. ({
  2. serverStartUp : function() {
  3. this.init();
  4. }
  5. ,
  6. init : function() {
  7. lastMemUpdate = 0;
  8.  
  9. key = function(a,b) {
  10. return a + "*" + sys.name(b);
  11. }
  12.  
  13. semiUbers = [];
  14.  
  15. var tempU = new Array(150,249,250,382,383,384,483,484,487,505);
  16. for (x in tempU) {
  17. semiUbers[tempU[x]] = true;
  18. }
  19.  
  20. saveKey = function(thing, id, val) {
  21. sys.saveVal(key(thing,id), val);
  22. }
  23.  
  24. getKey = function(thing, id) {
  25. return sys.getVal(key(thing,id));
  26. }
  27.  
  28. hasBan = function(id, poke) {
  29. return clauses[id].indexOf("*" + poke + "*") != -1;
  30. }
  31.  
  32. cmp = function(a, b) {
  33. return a.toLowerCase() == b.toLowerCase();
  34. }
  35.  
  36. if (typeof(varsCreated) != 'undefined')
  37. return;
  38.  
  39. battlesStopped = false;
  40. channelUsers = [];
  41. channelTopics = [];
  42.  
  43. sys.setPA("forceSameTier");
  44. sys.setPA("touruser");
  45. sys.setPA("rangebans");
  46. sys.setPA("tourmod");
  47. sys.setPA("tourowner");
  48. sys.setPA("megaUser");
  49. megausers = sys.getVal("megausers");
  50.  
  51. siggamute = (sys.getVal("SiggaMute") == "1");
  52. siggaban = (sys.getVal("SiggaBan") == "1");
  53.  
  54.  
  55. muteall = false;
  56.  
  57. sys.setPA ("impersonation");
  58. sys.setPA ("muted");
  59. sys.setPA("caps");
  60. sys.setPA("timeCount");
  61. sys.setPA("floodCount");
  62. sys.setPA("joinoff");
  63. maxPlayersOnline = 0;
  64.  
  65. if (sys.existChannel("RP Channel")) {
  66. rpchannel = sys.channelId("RP Channel");
  67. } else {
  68. rpchannel = sys.createChannel("RP Channel");
  69. }
  70. if (sys.existChannel("RP Channel")== false) {
  71. sys.createChannel("RP Channel");
  72. }
  73. if (sys.existChannel("League")) {
  74. leaguechannel = sys.channelId("League");
  75. } else {
  76. leaguechannel = sys.createChannel("League");
  77. }
  78. if (sys.existChannel("League")== false) {
  79. sys.createChannel("League");
  80. }
  81. if (sys.existChannel("Staff Channel")) {
  82. staffchannel = sys.channelId("Staff Channel");
  83. } else {
  84. staffchannel = sys.createChannel("Staff Channel");
  85. }
  86. if (sys.existChannel("Staff Channel")== false) {
  87. sys.createChannel("Staff Channel");
  88. }
  89. if (sys.existChannel("Scripting School")) {
  90. sschannel = sys.channelId("Scripting School");
  91. } else {
  92. sschannel = sys.createChannel("Scripting School");
  93. }
  94. if (sys.existChannel("Scripting School")== false) {
  95. sys.createChannel("Scripting School");
  96. }
  97. if (sys.existChannel("Scripting Room")) {
  98. srchannel = sys.channelId("Scripting Room");
  99. } else {
  100. srchannel = sys.createChannel("Scripting Room");
  101. }
  102. if (sys.existChannel("Scripting Room")== false) {
  103. sys.createChannel("Scripting Room");
  104. }
  105.  
  106. }
  107.  
  108. ,
  109.  
  110.  
  111. afterNewMessage : function (message) {
  112. if (message == "Script Check: OK") {
  113. sys.sendHtmlAll("<timestamp/><font color=orange><b>~~Server~~</f></b>:<font color=black> Script Check: <font color=black>Scripts were updated by the server!</f>");
  114. this.init();
  115. }
  116. }
  117.  
  118. ,
  119.  
  120. afterLogIn : function(src) {
  121. /* Welcome TUO*/
  122. if (sys.name(src) == "TheUnknownOne") {
  123. sys.sendHtmlAll("<font color=red><b>~~Server~~</b>: <font color=black>Please welcome the server co-owner <b>" + sys.name(src) + "</b>!");
  124. sys.changeAuth(src, 3);
  125. return;
  126. }
  127. /* Welcome Darkness*/
  128. if (sys.name(src) == "Darkness") {
  129. sys.sendHtmlAll("<font color=black><b>~~Server~~</b>: <font color=black>Please welcome one of the site owners <b>Darkness</b>!");
  130. return;
  131. }
  132. /* Welcome Coyotte508*/
  133. if (sys.name(src) == "coyotte508") {
  134. sys.sendHtmlAll("<font color=green><b>~~Server~~</b>: <font color=black>Please welcome the head programmer of PO <b>coyotte508</b>!");
  135. return;
  136. }
  137. /* Welcome Crystal Moogle*/
  138. if (sys.name(src) == "Crystal Moogle") {
  139. sys.sendHtmlAll("<font color=pink><b>~~Server~~</b>: <font color=black>Please welcome one of the site owners <b>Crystal Moogle</b>!");
  140. return;
  141. }
  142. sys.sendHtmlMessage(src, "<font color=green><b>+CommandBot</b>:</f> <font color=black>Use /commands or !commands to see the commands!");
  143.  
  144. if (sys.auth(src) == 0) {
  145. sys.sendHtmlAll("<font color=green><timestamp/><b>~~Server~~:</font></b> Please welcome <b>" + sys.name(src) + "</font></b>!");
  146. }
  147. if (sys.auth(src) == 1) {
  148. sys.sendHtmlAll("<font color=blue><timestamp/>~~Server~~:</font><b> Please welcome moderator <b>" + sys.name(src) + "</font></b>!");
  149. }
  150. if (sys.auth(src) == 2) {
  151. sys.sendHtmlAll("<font color=orange><timestamp/><b>~~Server~~:</font><b> Please welcome administrator <b>" + sys.name(src) + "</font></b>!");
  152. }
  153. if (sys.auth(src) == 3) {
  154. sys.sendHtmlAll("<font color=red><timestamp/><b>~~Server~~:</font><b> Please welcome owner <b>" + sys.name(src) + "</font></b>!");
  155. }
  156. if (sys.auth(src) == 4) {
  157. sys.sendHtmlAll("<font color=LimeGreen><timestamp/><b>~~Server~~:</font><b> Please welcome Hidden Auth <b>" + sys.name(src) + "</font></b>!");
  158. }
  159.  
  160. if (sys.getVal("muted*" + sys.ip(src)) == "true")
  161. muted[src] = true;
  162.  
  163. if (sys.numPlayers() > maxPlayersOnline) {
  164. maxPlayersOnline = sys.numPlayers();
  165. }
  166.  
  167. if (maxPlayersOnline > sys.getVal("MaxPlayersOnline")) {
  168. sys.saveVal("MaxPlayersOnline", maxPlayersOnline);
  169. }
  170.  
  171. if (!Topic) {Topic = sys.getFileContent("topic.txt");}
  172. sys.sendHtmlMessage(src,'<b><font color=limegreen>±Motd:<font color=black> </b>' + Topic);
  173. sys.sendMessage(src,"");
  174.  
  175. sys.sendMessage(src, "");
  176.  
  177. this.afterChangeTeam(src);
  178. }
  179.  
  180. ,
  181.  
  182. beforeChatMessage: function(src, message) {
  183. if (sys.auth(src) < 3 && muted[src] == true) {
  184. sys.stopEvent();
  185. sys.sendMessage(src, "~~Server~~: Sorry you have been muted for breaking the rules!");
  186. return;
  187. }
  188.  
  189. if ((message[0] == '/' || message[0] == '!') && message.length > 1) {
  190. if (parseInt(sys.time()) - lastMemUpdate > 500) {
  191. sys.clearChat();
  192. lastMemUpdate = parseInt(sys.time());
  193. }
  194. print("Command -- " + sys.name(src) + ": " + message);
  195. sys.stopEvent();
  196. var command;
  197. var commandData;
  198. var pos = message.indexOf(' ');
  199. var mcmd = [];
  200.  
  201. if (pos != -1) {
  202. command = message.substring(1, pos).toLowerCase();
  203. commandData = message.substr(pos+1);
  204. mcmd = commandData.split(':');
  205. } else {
  206. command = message.substr(1).toLowerCase();
  207. }
  208. var tar = sys.id(commandData);
  209.  
  210. function sendChanMessage(src, msg) {
  211. sys.sendMessage(src, msg, chan); }
  212.  
  213. var userCommands = ({
  214. "usercommands" : function () {
  215. sys.sendHtmlMessage(src, "<hr>");
  216. sys.sendHtmlMessage(src, "<font color=cornflowerblue><timestamp/><b>*** <font color=black>User Commands <font color=cornflowerblue>***</f>");
  217. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/catch</b></f>: <font color=black>to catch a pokemon. Theres a small chance you get a <font color=gold><b>Shiny</b><font color=black>, if you do be sure to put it in the journal!</f>");
  218. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/auth <font color=red>Name</b></f>: <font color=black>to show the server authlist</f>");
  219. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> Name<font color=black> is either Mods, Admins or Owners, if you leave the <font color=green>Auth<font color=black> blank it shows all server auth.</f>");
  220. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/rules</b></f>: <font color=black>to show the server rules</f>");
  221. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/players</f></b>: <font color=black>to get the number of players online");
  222. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/torture <font color=red>Person</b></f> : <font color=black>to torture someone, its fun too! It gets a random result é.é");
  223. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> Person<font color=black> is any online person on the server.</f>");
  224. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/credits</b></f>: <font color=black>to view the credits and how to get these scripts.");
  225. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/viewjournal</b></f>: <font color=black>to view the book of wonderful comments");
  226. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=black> IF you see a trolled guest book please report this to the server Admins/Owners.");
  227. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/signjournal <font color=red> Quote/Message</b></f>: <font color=black>be apart of the wonderful journal!");
  228. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=red>Quote/Message</f><font color=black> is any quote or message you would like to share.");
  229. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=red></f><font color=black>IF you ever troll the guest book the chance is high that you are getting banned.</f>");
  230. sys.sendHtmlMessage(src, "<hr>");
  231. return;
  232. }
  233. ,
  234. commands: function () {
  235. sys.sendHtmlMessage(src, "<hr>");
  236. sys.sendHtmlMessage(src, "<font color=limegreen><timestamp/><b>*** Commands ***");
  237. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/UserCommands</f></b>: <font color=green>For Users");
  238. sys.sendHtmlMessage(src, "<font color=purple><timestamp/><b>/HtmlCommands</f></b>: <font color=purple>For HTML Commands");
  239. sys.sendHtmlMessage(src, "<font color=gold><timestamp/><b>/TourCommands</f></b>: <font color=gold>For Tour Commands");
  240. if (sys.auth(src) < 1) {
  241. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>~~Bot~~</f></b>: <font color=black>Sorry but you need auth if you want to see the other commands.");
  242. sys.sendHtmlMessage(src, "<hr>");
  243. return;
  244. }
  245. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>/ModCommands</f></b>: <font color=blue>For Moderators");
  246. if (sys.auth(src) < 2) {
  247. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>~~Bot~~</f></b>: <font color=black>Sorry but you need higher auth if you want to see the other commands.");
  248. sys.sendHtmlMessage(src, "<hr>");
  249. return;
  250. }
  251. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>/AdminCommands</f></b>: <font color=orange>For Administrators");
  252. if (sys.auth(src) < 3) {
  253. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>~~Bot~~</f></b>: <font color=black>Sorry but you need higher auth if you want to see the other commands.");
  254. sys.sendHtmlMessage(src, "<hr>");
  255. return;
  256. }
  257. sys.sendHtmlMessage(src, "<font color=red><timestamp/><b>/OwnerCommands</f></b>: <font color=red>For Owners");
  258. sys.sendHtmlMessage(src, "<hr>");
  259. return; }
  260. ,
  261. me:function () {
  262. sys.sendAll("*** " + sys.name(src) + " " + commandData); }
  263. ,
  264. htmlme:function () {
  265. sys.sendHtmlAll("<font color=fuchsia><timestamp/>*** </font> <b>" + sys.name(src) + "</b> " + commandData); }
  266. ,
  267. htmlcommands: function () {
  268. sys.sendHtmlMessage(src, "<hr>");
  269. sys.sendHtmlMessage(src, "<font color=red><timestamp/><b>*** <font color=black>Html Commands <font color=red>***</f>");
  270. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/sendAll <font color=red>Message<font color=black></b> : <font color=black>to send a message to everyone</f>.");
  271. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> Message<font color=black> is any message.</f>");
  272. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/sendmessage <font color=red>Message<font color=black></b> : <font color=black>to send a message to yourself.");
  273. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> Message<font color=black> is any message.</f>");
  274. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/sendHtmlAll <font color=red>Message<font color=black></b> : <font color=black>to send a message to everyone using HTML.");
  275. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> Message<font color=black> is any message, HTML Allowed</f>");
  276. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/sendHtmlMessage <font color=red>Message<font color=black></b> : <font color=black>to send a message to yourself using HTML.");
  277. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> Message<font color=black> is any message, HTML Allowed</f>");
  278. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/me <font color=red>Message</b><font color=black>: to send a message to everyone with *** before your name</f>");
  279. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> Message<font color=black> is any message.</f>");
  280. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/htmlme <font color=red>Message</b><font color=black>: to send a message to everyone with *** before your name and HTML</f>");
  281. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> Message<font color=black> is any message, HTML Allowed</f>");
  282. sys.sendHtmlMessage(src, "<hr>");
  283. return; }
  284. ,
  285. tourcommands: function () {
  286. sys.sendHtmlMessage(src, "<hr>");
  287. sys.sendHtmlMessage(src, "<font color=gold><timestamp/><b>*** <font color=black>Tour Commands <font color=gold>***</f>");
  288. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/join <font color=black></b> : <font color=black>to join the tour</f>.");
  289. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/leave <font color=black></b> : <font color=black>to leave the tour</f>.");
  290. if (sys.auth(src) < 1) {
  291. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>~~Bot~~:</b> <font color=black>Sorry but to the see other commands you need auth.</f>.");
  292. sys.sendHtmlMessage(src, "<hr>");
  293. return;
  294. }
  295. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/settier <font color=red>Tier<font color=black></b> : <font color=black>to send a the message what the tier is</f>.");
  296. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> Tier<font color=black> is any message, if you want a falid tour put a tier that exists.</f>");
  297. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/setpeople <font color=red>People<font color=black></b> : <font color=black>to send the message that shows how many people may join the tour.");
  298. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> People<font color=black> is any number of people, for a falid tour put numbers.</f>");
  299. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/tour <font color=black></b> : <font color=black>to show that a tour is about to start.");
  300. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/round <font color=red>Number<font color=black></b> : <font color=black>to show the current round.");
  301. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> Number<font color=black> is any number</f>");
  302. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/round<font color=red>1/2/3/4/5</b><font color=black>: to show the current round</f>");
  303. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> 1/2/3/4/5<font color=black> is the current round, must be placed like /round1 to work and this only works for numbers 1 to 5.</f>");
  304. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/joinon <font color=black></b> : <font color=black>to start the signups</f>.");
  305. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/joinoff <font color=black></b> : <font color=black>to end the signups</f>.");
  306. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/massdq <font color=black></b> : <font color=black>to DQ all people in the tour.");
  307. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/endtour <font color=black></b> : <font color=black>to end the current tour.");
  308. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/push <font color=red>Person<font color=black></b> : <font color=black>to put someone in the tour.");
  309. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> Person<font color=black> is any online player.</f>");
  310. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/dq <font color=red>Person<font color=black></b> : <font color=black>to DQ someone from the tour.");
  311. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note:<font color=red> Person<font color=black> is any online player.</f>");
  312. if (sys.auth(src) < 3) {
  313. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>~~Bot~~:</b> <font color=black>Sorry but to the see other commands you need higher auth.</f>.");
  314. sys.sendHtmlMessage(src, "<hr>");
  315. return;
  316. }
  317. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/<font color=blue>AuthName<font color=red> Person</f></b>: <font color=black>give someone tour auth.");
  318. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=blue> TourAuthName</f><font color=black> is any tourauthname, <font color=red>Person<font color=black> is any online player.");
  319. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/tourauthnames</f></b>: <font color=black>view authnames for the /TourAuthName.");
  320. sys.sendHtmlMessage(src, "<hr>");
  321. return; }
  322. ,
  323. join : function () {
  324. sys.sendHtmlAll("<font color=orange><timestamp/><b>~~Bot~~:</font></b> </b>" + sys.name(src) + "</b> has joined the tour</font></b>!");
  325. return; }
  326. ,
  327. leave : function () {
  328. sys.sendHtmlAll("<font color=orange><timestamp/><b>~~Bot~~:</font></b> </b>" + sys.name(src) + "</b> has left the tour</font></b>!");
  329. return; }
  330. ,
  331. dq : function () {
  332. if (sys.auth(src) < 1) {
  333. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>~~Bot~~:</b> <font color=black>Sorry but to use this command you need auth.</f>.");
  334. return;
  335. }
  336. if (tar == undefined) {
  337. return;
  338. }
  339. sys.sendHtmlAll("<font color=orange><timestamp/><b>~~Bot~~:</font></b> </b>" + commandData + "</b> has been DQed by " + sys.name(src) + "</font></b>!");
  340. sys.sendHtmlMessage(tar, "<font color=orange><timestamp/><b>~~Bot~~:</font></b> You have been DQed from the tour by " + sys.name(src) + "</font></b>!");
  341. return; }
  342. ,
  343. push : function () {
  344. if (sys.auth(src) < 1) {
  345. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>~~Bot~~:</b> <font color=black>Sorry but to use the command you need auth.</f>.");
  346. return;
  347. }
  348. if (tar == undefined) {
  349. return;
  350. }
  351. sys.sendHtmlAll("<font color=orange><timestamp/><b>~~Bot~~:</font></b> </b>" + commandData + "</b> has been pushed in the tour by " + sys.name(src) + "</font></b>!");
  352. sys.sendHtmlMessage(tar, "<font color=orange><timestamp/><b>~~Bot~~:</font></b> You have been pushed in the tour by " + sys.name(src) + "</font></b>!");
  353. return; }
  354. ,
  355. massdq : function () {
  356. if (sys.auth(src) < 1) {
  357. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>~~Bot~~:</b> <font color=black>Sorry but to use this command you need auth.</f>.");
  358. return;
  359. }
  360. sys.sendHtmlAll("<font color=orange><timestamp/><b>~~Bot~~:</font></b> </b>All people who joined have been DQed by" + sys.name(src) + "</font></b>!");
  361. return; }
  362. ,
  363. sendmessage : function () {
  364. sys.sendMessage(src, commandData); }
  365. ,
  366. sendhtmlmessage : function () {
  367. sys.sendHtmlMessage(src, commandData); }
  368. ,
  369. sendall : function () {
  370. sys.sendAll(commandData); }
  371. ,
  372. sendhtmlall : function () {
  373. sys.sendHtmlAll(commandData); }
  374. ,
  375. credits:function () {
  376. sys.sendHtmlMessage(src, "<hr>");
  377. sys.sendHtmlMessage(src, "<timestamp/><b><font color=skyblue><font size=3>Max for making the basic of these scripts!");
  378. sys.sendHtmlMessage(src, "<timestamp/><b><font color=red><font size=3>TheUnknownOne for adding commands and the tour script also for the editing!");
  379. sys.sendHtmlMessage(src, "<timestamp/><b><font color=darkblue><font size=3>Arceus for the catch command!");
  380. sys.sendHtmlMessage(src, "<timestamp/><b><font color=green><font size=3>Intel_iX for the editing and speeding the scripts up!");
  381. sys.sendHtmlMessage(src, "<timestamp/><b><font color=blue><font size=3>Ian for the clearchat command and the MOTD!");
  382. sys.sendHtmlMessage(src, "<timestamp/><b><font color=black><font size=3>If you want these scripts ask TheUnknownOne or Email <TheUnknownOne25@gmail.com>");
  383. sys.sendHtmlMessage(src, "<hr>");
  384. return; }
  385. ,
  386. torture : function () {
  387. if (tar == undefined) {
  388. sys.sendMessage(src, "~~Bot~~: You fail. That person is either not on or does not exist");
  389. return;
  390. }
  391.  
  392. var Links=new Array();
  393. Links[1]="~~Bot~~: " + commandData + " has died from a falling meteorite by " + sys.name(src) + "!";
  394. Links[2]="~~Bot~~: " + commandData + " has been picked up and chucked down a hole by " + sys.name(src) + ".";
  395. Links[3]="~~Bot~~: " + commandData + " has been told to go to his room and die of bordum by " + sys.name(src) + ".";
  396. Links[4]="~~Bot~~: " + commandData + " had a heart attack and fell of the Grand Canyon by " + sys.name(src) + ".";
  397. Links[5]="~~Bot~~: " + commandData + " got hit by a car and died in the hospital by " + sys.name(src) + ".";
  398. Links[6]="~~Bot~~: " + commandData + " was made to smell spygirl's underwhere by " + sys.name(src) + ".";
  399. var i = Math.floor(6*Math.random())
  400. sys.sendAll(Links[i]);
  401. return; }
  402. ,
  403. 'catch' : function () {
  404. var num=Math.floor(650*Math.random());
  405. var pokemon=sys.pokemon(num);
  406. var nature=Math.floor(25*Math.random());
  407. var nature=sys.nature(nature);
  408. var shiny=Math.floor(8192*Math.random());
  409. var hpiv=Math.floor(32*Math.random());
  410. var spaiv=Math.floor(32*Math.random());
  411. var atkiv=Math.floor(32*Math.random());
  412. var defiv=Math.floor(32*Math.random());
  413. var spdiv=Math.floor(32*Math.random());
  414. var speiv=Math.floor(32*Math.random());
  415. if (shiny!=8191)
  416. {
  417. sys.sendAll("~~CaptureBot~~: " + sys.name(src) + " has caught a " +pokemon + " with a " + nature + " nature!");
  418. sys.sendAll("~~CaptureBot~~: " + pokemon + " has the following IVs:");
  419. sys.sendAll("~~CaptureBot~~: HP: " + hpiv + " Atk: " + atkiv + " Def: " + defiv + " SpA: " + spaiv + " SpD: " + spdiv + " Spe: " + speiv + ".");
  420. }
  421. if (shiny==8191)
  422. {
  423. sys.sendAll("~~CaptureBot~~: " + sys.name(src) + " has caught a shiny " + pokemon + " with a " + nature + " nature!");
  424. sys.sendAll("~~CaptureBot~~: " + pokemon + " has the following IVs:");
  425. sys.sendAll("~~CaptureBot~~: HP: " + hpiv + " Atk: " + atkiv + " Def: " + defiv + " SpA: " + spaiv + " SpD: " + spdiv + " Spe: " + speiv + ".");
  426. sys.sendAll("~~CaptureBot~~: This is a rare event");
  427. }
  428. }
  429. ,
  430. rules : function () {
  431. sys.sendHtmlMessage(src, "<br>");
  432. sys.sendHtmlMessage(src, "<font color=red>*** <font color=black><b>Server Rules</b> <font color=black>***</f></b>");
  433. sys.sendHtmlMessage(src, "<b><font color=red>Rule #1<font color=black> - Do Not Abuse CAPS:</f></b>");
  434. sys.sendHtmlMessage(src, "- <b>The occasional word in CAPS is acceptable, however repeated use is not.</b>");
  435. sys.sendHtmlMessage(src, "<b><font color=red>Rule #2 - No Flooding the Chat:</f></b>");
  436. sys.sendHtmlMessage(src, "- <b>Please do not post a large amount of short messages when you can easily post one or two long messages.</f></b>");
  437. sys.sendHtmlMessage(src, "<b><font color=red>Rule #3 - Do not Challenge Spam:</f></b>");
  438. sys.sendHtmlMessage(src, "- <b>If a person refuses your challenge, this means they do not want to battle you. Find someone else to battle with.</f></b>");
  439. sys.sendHtmlMessage(src, "<b><font color=red>Rule #4 - Don't ask for battles in the main chat:</f></b>");
  440. sys.sendHtmlMessage(src, "- <b>There is a 'Find Battle' tab that you can use to find a battle immediately. If after a while you cannot find a match, then you can ask for one in the chat.</f></b>");
  441. sys.sendHtmlMessage(src, "<b><font color=red>Rule #5 - No Trolling/Flaming/Insulting of Any kind:</f></b>");
  442. sys.sendHtmlMessage(src, "- <b>Behaving stupidly and excessive vulgarity will not be tolerated</f></b>.");
  443. sys.sendHtmlMessage(src, "<b><font color=red>Rule #6 - Please only speak English:</f></b>");
  444. sys.sendHtmlMessage(src, "- <b>Most people speak a different language, which is ok. But please speak english</f></b>.");
  445. sys.sendHtmlMessage(src, "<b><font color=red>Rule #7 - No Advertising:");
  446. sys.sendHtmlMessage(src, "- <b>There will be absolutely no advertising on the server</f></b>.");
  447. sys.sendHtmlMessage(src, "<b><font color=red>Rule #8 - No Obscene or Pornographic Content Allowed:</f></b>");
  448. sys.sendHtmlMessage(src, "- <b>This includes links, texts, images, and any other kind of media. This will result in a instant ban.</f></b>");
  449. sys.sendHtmlMessage(src, "<b><font color=red>Rule #9 - Do not ask for Auth:</f></b>");
  450. sys.sendHtmlMessage(src," - <b>Authority is given upon merit. By asking you have pretty much eliminated your chances at becoming an Auth in the future.</f></b>");
  451. sys.sendHtmlMessage(src,"<b><font color=red>Rule #10 - Do not Insult Auth:</f></b>");
  452. sys.sendHtmlMessage(src, "- <b>Insulting Auth will result in immediate punishment.</f></b>");
  453. sys.sendHtmlMessage(src, "<br>");
  454. if (sys.auth(src) < 1) {
  455. return;
  456. }
  457. sys.sendHtmlMessage(src, "<br>");
  458. sys.sendHtmlMessage(src, "<font color=black>*** <font color=blue><b>Auth Rules</b> <font color=black>***</f></b>");
  459. sys.sendHtmlMessage(src, "<b><font color=red>Rule #1 - Behave yourself, act appropriately:");
  460. sys.sendHtmlMessage(src, "- <b>This is includes flaming, insulting, trolling of ANY KIND");
  461. sys.sendHtmlMessage(src,"<b><font color=red>Rule # 2 - Do not advertize:</f></b>");
  462. sys.sendHtmlMessage(src,"- <b>Do not advertize any other server or pages. Youtube or game, music pages are okay, but an excesive advertizing of them, could cause problems.</f></b>");
  463. sys.sendHtmlMessage(src,"<b><font color=red>Rule #3 - No Obscene or Pornographic Content Allowed:");
  464. sys.sendHtmlMessage(src,"- <b>This includes links, texts, images, and any other kind of obscene media. This will result in a instant ban.</f></b>");
  465. sys.sendHtmlMessage(src,"<b><font color=red>Rule #4 - Do not ask for Auth:</f></b>");
  466. sys.sendHtmlMessage(src,"- <b>Authority is given upon merit. By asking you have pretty much eliminated your chances at becoming an Auth in the future.</f></b>");
  467. sys.sendHtmlMessage(src, "<b><font color=red>Rule #5 - Do not Challenge Spam:</f></b>");
  468. sys.sendHtmlMessage(src, "- <b>If a person refuses your challenge, this means they do not want to battle you. Find someone else to battle with.</f></b>");
  469. sys.sendHtmlMessage(src, "<br>");
  470. }
  471. ,
  472. auth : function () {
  473. var authlist = sys.dbAuths().sort()
  474. sys.sendMessage(src, "");
  475. if(commandData == "owners") {
  476. sys.sendMessage(src, "*** Owners ***")
  477. for(var x in authlist) {
  478. if(sys.dbAuth(authlist[x]) == 3) {
  479. if(sys.id(authlist[x]) == undefined) {
  480. sys.sendMessage(src, authlist[x] + " (Offline)")
  481. }
  482. if(sys.id(authlist[x]) !=undefined) {
  483. sys.sendHtmlMessage(src, '<timestamp/><font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  484. }
  485. }
  486. }
  487. sys.sendMessage(src, "");
  488. }
  489. if(commandData == "admins" || commandData == "Administrators") {
  490. sys.sendMessage(src, "*** Administrators ***")
  491. for(var x in authlist) {
  492. if(sys.dbAuth(authlist[x]) == 2) {
  493. if(sys.id(authlist[x]) == undefined) {
  494. sys.sendMessage(src, authlist[x] + " (Offline)")
  495. }
  496. if(sys.id(authlist[x]) !=undefined) {
  497. sys.sendHtmlMessage(src, '<timestamp/><font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  498. }
  499. }
  500. }
  501. sys.sendMessage(src, "");
  502. }
  503. if(commandData == "mods" || commandData == "Moderators") {
  504. sys.sendMessage(src, "*** Moderators ***")
  505. for(var x in authlist) {
  506. if(sys.dbAuth(authlist[x]) == 1) {
  507. if(sys.id(authlist[x]) == undefined) {
  508. sys.sendMessage(src, authlist[x] + " (Offline)")
  509. }
  510. if(sys.id(authlist[x]) !=undefined) {
  511. sys.sendHtmlMessage(src, '<timestamp/><font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  512. }
  513. }
  514. }
  515. sys.sendMessage(src, "");
  516. }
  517.  
  518. if(commandData != "moderators" && commandData != "mods" &&commandData != "administrators" && commandData != "admins" && commandData != "owners") {
  519.  
  520. sys.sendMessage(src, "*** Owners ***")
  521. for (var x in authlist) {
  522. if (sys.dbAuth(authlist[x]) == 3) {
  523. if (sys.id(authlist[x]) == undefined) {
  524. sys.sendMessage(src, authlist[x]+ " (Offline)")
  525. }
  526. if (sys.id(authlist[x]) != undefined) {
  527. sys.sendHtmlMessage(src,'<timestamp/><font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  528. }
  529. }
  530. }
  531. sys.sendMessage(src, "");
  532. sys.sendMessage(src, "*** Administrators ***")
  533. for( var x in authlist) {
  534. if (sys.dbAuth(authlist[x]) == 2) {
  535. if (sys.id(authlist[x]) == undefined) {
  536. sys.sendMessage(src, authlist[x] + " (Offline)")
  537. }
  538. if (sys.id(authlist[x]) != undefined) {
  539. sys.sendHtmlMessage(src, '<timestamp/><font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  540. }
  541. }
  542. }
  543. sys.sendMessage(src, "");
  544. sys.sendMessage(src, "*** Moderators ***")
  545. for(x in authlist) {
  546. if(sys.dbAuth(authlist[x]) == 1) {
  547. if(sys.id(authlist[x]) == undefined) {
  548. sys.sendMessage(src, authlist[x]+ " (Offline)")
  549. }
  550. if(sys.id(authlist[x]) != undefined) {
  551. sys.sendHtmlMessage(src,'<timestamp/><font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
  552. }
  553. }
  554. }
  555. }
  556. return;
  557. }
  558. ,
  559. players: function () {
  560. sys.sendMessage(src, "+CountBot: There are " + sys.numPlayers() +" players online.");
  561. return;
  562. }
  563.  
  564. ,
  565. viewjournal : function (){
  566. sys.sendHtmlMessage(src, "");
  567. sys.sendHtmlMessage(src, '<timestamp/> <font color="red">*** The Guest Book ***</font>');
  568. sys.sendHtmlMessage(src, "");
  569. var get = sys.getFileContent("gb").split("*");
  570. for(x in get){
  571. sys.sendHtmlMessage(src,get[x]);
  572. }
  573. return; }
  574. ,
  575. signjournal : function () {
  576. if (commandData == undefined) {
  577. var get = sys.getFileContent("gb");
  578. sys.writeToFile("gb",get + sys.name(src) + "*");
  579. sys.sendAll(sys.name(src) + " " + "signed the guest book!");
  580. return;
  581. }
  582. var qu = commandData.match(/<(\w+)[^>]*>/g);
  583. if (qu) {
  584. for (var x in qu) {
  585. commandData+= qu[x].replace(/<(\w+)[^>]*>/g,'</$1>'); }
  586. }
  587. if (message.search(/[\u202E\u202D]/) != -1) {
  588. return; }
  589. var get = sys.getFileContent("gb");
  590. sys.writeToFile("gb",get + sys.name(src) + " - " + commandData +"*");
  591. sys.sendAll(sys.name(src) + " " + "signed the guest book!");
  592. return; }
  593. });
  594.  
  595. var modCommands = ({
  596. modcommands: function () {
  597. sys.sendHtmlMessage(src, "<hr>");
  598. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>*** <font color=black>Mod Commands <font color=orange>***");
  599. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/imp <font color=red>Person</f></b> : <font color=black>to impersonate someone");
  600. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=red>Person</f><font color=black> is either an online player or any name.");
  601. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/impOff</f></b> : <font color=black>to stop impersonating.");
  602. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/kick <font color=red>Person</f></b> :<font color=black> to kick someone");
  603. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=red>Person</f><font color=black> is any online player.");
  604. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/<font color=blue>Mute/Unmute <font color=red>Person</f></b> : <font color=black>to Mute/Unmute someone.");
  605. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=blue>Mute/Unmute</f><font color=black> is to Mute(shut someone up) or Unmute(to allow that person to talk again),<font color=red> Person<font color=black> is any online player.");
  606. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/changemotd <font color=red>Message</f></b> : <font color=black>to change MOTD.");
  607. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=red>Message</f><font color=black> is any message for people to see if they log on, HTML Allowed.");
  608. sys.sendHtmlMessage(src, "<hr>");
  609. return; }
  610. ,
  611. imp: function () {
  612. impersonation[src] = commandData;
  613. sys.sendMessage(src, "+Bot: Now you are " + impersonation[src] +"!");
  614. return;
  615. }
  616. ,
  617. changemotd: function () {
  618. Topic = commandData;
  619. sys.sendHtmlAll("<font color=red>+Bot: The MOTD has been changed.");
  620. }
  621.  
  622. ,
  623. joinon: function () {
  624. joinoff[src]=false
  625. sys.sendHtmlAll("<font color=orange><b><font size=3>~~Bot~~:</b></font> The signups have been started by " + sys.name(src) + ", type <b>/join</b> to join the tour!</f>");
  626. return;
  627. }
  628. ,
  629. joinoff: function () {
  630. joinoff[src]=true
  631. sys.sendHtmlAll("<font color=orange><b><font size=3>~~Bot~~:</b></font> The signups have been ended by " + sys.name(src) + ".</f>");
  632. return;
  633. }
  634. ,
  635. endtour: function () {
  636. sys.sendHtmlAll("<font color=orange><b><font size=3>~~Bot~~:</b></font> The Tour has been ended by " + sys.name(src) + ".</f>");
  637. return;
  638. }
  639. ,
  640. tour: function () {
  641. sys.sendHtmlAll("<hr>");
  642. sys.sendHtmlAll("<timestamp/><font color=red><b>*** TOURNAMENT ***</f></b></font>");
  643. sys.sendHtmlAll("<timestamp/><font color=blue><b>*** The tier will be decided when you see the message</f></b></font>");
  644. sys.sendHtmlMessage(src,"<timestamp/><font color=orange><b>~~Bot~~:</f></b><font color=black> Type /settier to set the tier</f>");
  645. sys.sendHtmlAll("<timestamp/><font color=blue><b>*** The amount of people will be decided when you see the message</f></b></font>");
  646. sys.sendHtmlMessage(src, "<timestamp/><font color=orange><b>~~Bot~~:</f></b><font color=black> Type /setpeople to set the amount of players");
  647. sys.sendHtmlAll("<timestamp/><font color=orange><b>~~Bot~~:</f></b><font color=black> Type /join to join the tour!");
  648. sys.sendHtmlAll("<timestamp/><font color=orange><b>~~Bot~~:</f></b><font color=black> Type /leave to leave the tour!");
  649. sys.sendHtmlAll("<hr>");
  650. return;
  651. }
  652. ,
  653. settier : function () {
  654. sys.sendHtmlAll("<b><font size=5><font color=red>A(n) " + commandData + " Tour has been started by " + sys.name(src) + "!</font></b></f>");
  655. return;
  656. }
  657. ,
  658. setpeople : function () {
  659. sys.sendHtmlAll("<b><font size=5><font color=red>The Number of players allowed for the tour are: " + commandData + "!</font></f></b>");
  660. return;
  661. }
  662. ,
  663. round1 : function () {
  664. sys.sendHtmlAll("<b><font size=5><font color=red>Round 1 has been started by " + sys.name(src) + " !</font></f></b>");
  665. return;
  666. }
  667. ,
  668. round2 : function () {
  669. sys.sendHtmlAll("<b><font size=5><font color=red>Round 2 has been started by " + sys.name(src) + " !</font></f></b>");
  670. return;
  671. }
  672.  
  673. ,
  674. round3: function () {
  675. sys.sendHtmlAll("<b><font size=5><font color=red>Round 3 has been started by " + sys.name(src) + " !</font></f></b>");
  676. return;
  677. }
  678. ,
  679. round4: function () {
  680. sys.sendHtmlAll("<b><font size=5><font color=red>Round 4 has been started by " + sys.name(src) + " !</font></f></b>");
  681. return;
  682. }
  683. ,
  684. round5: function () {
  685. sys.sendHtmlAll("<b><font size=5><font color=red>Round 5 has been started by " + sys.name(src) + " !</font></f></b>");
  686. return;
  687. }
  688. ,
  689. round: function () {
  690. sys.sendHtmlAll("<b><font size=5><font color=red>Round " + commandData + " has been started by " + sys.name(src) + " !</font></f></b>");
  691. return;
  692. }
  693. ,
  694. impoff : function () {
  695. delete impersonation[src];
  696. sys.sendMessage(src, "+Bot: Now you are yourself!");
  697. return;
  698. }
  699. ,
  700. kick : function () {
  701. if (tar == undefined) {
  702. return;
  703. }
  704. sys.sendHtmlAll("<font color=red><b>+KickBot:</b> " + commandData + " Was kicked for something by " +sys.name(src) + "!");
  705. sys.kick(tar);
  706. return;
  707. }
  708. ,
  709. mute: function () {
  710. if (tar == undefined) {
  711. return;
  712. }
  713. if (sys.auth(tar) >= sys.auth(src)) {
  714. sys.sendMessage("+Bot: you dont have sufficient auth to mute " + commandData + ".");
  715. return;
  716. }
  717. sys.sendHtmlAll("<font color=blue><b>+MuteBot:</b> " + commandData + " Was muted by " +sys.name(src) + "!");
  718. muted[tar] = true;
  719. return
  720. }
  721. ,
  722. unmute:function () {
  723. if (tar == undefined) {
  724. return;
  725. }
  726. sys.sendHtmlAll("<font color=green><b>+MuteBot:</b> " + commandData + " Was unmuted by " +sys.name(src) + "!");
  727. muted[tar] = false;
  728. return;
  729. }
  730. })
  731. var adminCommands = ({
  732. admincommands : function () {
  733. if (sys.auth(src) < 2) {
  734. sys.sendMessage(src, "+CommandBot: Your are not of the right authority to view these commands.");
  735. return;
  736. }
  737.  
  738. sys.sendHtmlMessage(src, "<hr>");
  739. sys.sendHtmlMessage(src, "<font color=red><timestamp/><b>*** <font color=black>Admin Commands <font color=red>***</b></f>");
  740. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/reset</f></b>: <font color=black>to reset the server variables");
  741. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/masskick</f></b>: <font color=black>to clean up the server");
  742. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/setPA <font color=red>Paname</f></b>: <font color=black>to add a new pa");
  743. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=red>Paname</f><font color=black> is a PA to put in the scripts, be carefull as this can make an error.");
  744. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/clearjournal</f></b>: <font color=black>to clear the journal");
  745. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/<font color=blue>Ban/Unban</f><font color=red> Person</b>: <font color=black>to ban/unban someone");
  746. sys.sendHtmlMessage(src, "<font color=blue>°<b>Note: <font color=black>To <font color=blue>Ban<font color=black>(keep there IP from entering the server) and <font color=blue>Unban<font color=black>(let a banned person get in the server again),<font color=red> Person</f><font color=black> is any online or offline player in the members database.");
  747. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/clearchat</f></b>: <font color=black>to clear the chat");
  748. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/<font color=blue>forcerule</f><font color=red> Rule</b>: <font color=black>to show a rule to everyone");
  749. sys.sendHtmlMessage(src, "<font color=blue>°<b>Note: <Font color=red>Rule<font color=black> is rule 1-10.");
  750. sys.sendHtmlMessage(src, "<hr>");
  751. return;
  752. }
  753. ,
  754. forcerule: function () {
  755. if (commandData == undefined) {
  756. sys.sendMessage(src, "~~Bot~~:Not a valid rule");
  757. return;
  758. }
  759. if (commandData == 1) {
  760. sys.sendAll("Rule #1 - Do Not Abuse CAPS:");
  761. sys.sendAll("- The occasional word in CAPS is acceptable, however repeated use is not.");
  762. return;
  763. }
  764. if (commandData == 2) {
  765. sys.sendAll("Rule #2 - No Flooding the Chat:");
  766. sys.sendAll("- Please do not post a large amount of short messages when you can easily post one or two long messages.");
  767. return;
  768. }
  769. if (commandData == 3) {
  770. sys.sendAll("Rule #3 - Do not Challenge Spam:");
  771. sys.sendAll("- If a person refuses your challenge, this means they do not want to battle you. Find someone else to battle with.");
  772. return;
  773. }
  774. if (commandData == 4) {
  775. sys.sendAll("Rule #4 - Don't ask for battles in the main chat:");
  776. sys.sendAll("- There is a 'Find Battle' tab that you can use to find a battle immediately. If after a while you cannot find a match, then you can ask for one in the chat.");
  777. return;
  778. }
  779. if (commandData == 5) {
  780. sys.sendAll("Rule #5 - No Trolling/Flaming/Insulting of Any kind:");
  781. sys.sendAll("- Behaving stupidly and excessive vulgarity will not be tolerated.");
  782. return;
  783. }
  784. if (commandData == 6) {
  785. sys.sendAll("Rule #6 - Please only speak English:");
  786. sys.sendAll("- Most people speak a different language, which is ok. But please speak english.");
  787. return;
  788. }
  789. if (commandData == 7) {
  790. sys.sendAll("Rule #7 - No Advertising:");
  791. sys.sendAll("- There will be absolutely no advertising on the server.");
  792. return;
  793. }
  794. if (commandData == 8) {
  795. sys.sendAll("Rule #8 - No Obscene or Pornographic Content Allowed:");
  796. sys.sendAll("- This includes links, texts, images, and any other kind of media. This will result in a instant ban.");
  797. return;
  798. }
  799. if (commandData == 9) {
  800. sys.sendAll("Rule #9 - Do not ask for Auth:");
  801. sys.sendAll(" - Authority is given upon merit. By asking you have pretty much eliminated your chances at becoming an Auth in the future.");
  802. return;
  803. }
  804. if (commandData == 10) {
  805. sys.sendAll("Rule #10 - Do not Insult Auth:");
  806. sys.sendAll("- Insulting Auth will result in immediate punishment.");}
  807. return;
  808. }
  809. ,
  810. reset : function () {
  811. this.serverStartUp();
  812. sys.sendAll("~~Server~~: The server script variables were reset.");
  813. return;
  814. }
  815. ,
  816. changeannouncement: function () {
  817. if (sys.auth(src) < 3) {
  818. return;
  819. }
  820. sys.setAnnouncement(commandData);}
  821. ,
  822. resetannouncement: function () {
  823. if (sys.auth(src) < 3) {
  824. return;
  825. }
  826. sys.setAnnouncement("Announcement reset by<font color=fuchsia> " + sys.name(src));}
  827. ,
  828. changemotd:function () {
  829. Topic = commandData;
  830. sys.sendAll("The MOTD has been changed.");}
  831. ,
  832. ban:function () {
  833. if(sys.dbIp(commandData) == undefined) {
  834. sendChanMessage(src, "+Bot: No player exists by this name!");
  835. return;
  836. }
  837.  
  838. if (sys.maxAuth(sys.ip(tar))>=sys.auth(src)) {
  839. sendChanMessage(src, "+Bot: Can't do that to higher auth!");
  840. return;
  841. }
  842. var ip = sys.dbIp(commandData);
  843. var alias=sys.aliases(ip)
  844. var y=0;
  845. var z;
  846. for(var x in alias) {
  847. z = sys.dbAuth(alias[x])
  848. if (z > y) {
  849. y=z
  850. }
  851. }
  852. if(y>=sys.auth(src)) {
  853. sendChanMessage(src, "+Bot: Can't do that to higher auth!");
  854. return;
  855. }
  856. var banlist=sys.banList()
  857. for(a in banlist) {
  858. if(sys.dbIp(commandData) == sys.dbIp(banlist[a])) {
  859. sendChanMessage(src, "+Bot: He/she's already banned!");
  860. return;
  861. }
  862. }
  863.  
  864. sys.sendHtmlAll('<b><font color=red>' + commandData + ' was banned by ' + sys.name(src) + '!</font></b>');
  865. if(tar != undefined) {
  866. sys.kick(tar)
  867. }
  868. sys.ban(commandData)
  869. sys.appendToFile('bans.txt', sys.name(src) + ' banned ' +commandData + "n")
  870. return;
  871. }
  872. ,
  873. unban: function () {
  874. if(sys.dbIp(commandData) == undefined) {
  875. sendChanMessage(src, "+Bot: No player exists by this name!");
  876. return;
  877. }
  878. var banlist=sys.banList()
  879. for(a in banlist) {
  880. if(sys.dbIp(commandData) == sys.dbIp(banlist[a])) {
  881. sys.unban(commandData)
  882. sys.sendHtmlAll('<b><font color=red>' + commandData + ' was unbanned by ' + sys.name(src) + '!</font></b>');
  883. sys.appendToFile('bans.txt', sys.name(src) + ' unbanned ' +commandData + "n")
  884. return;
  885. }
  886. }
  887. sendChanMessage(src, "+Bot: He/she's not banned!");
  888. return;
  889.  
  890. }
  891. ,
  892.  
  893. silentkick : function () {
  894. if (sys.auth(src) < 3) {
  895. return;
  896. }
  897. if (tar == undefined) {
  898. return;
  899. }
  900. sys.kick(tar);
  901. return;
  902. }
  903. ,
  904. clearchat:function () {
  905. var c;
  906. for (c=0;c<2999;c++) {
  907. sys.sendAll("");
  908. }
  909. sys.clearChat();
  910. sys.sendAll(sys.name(src) + " Has Cleared the chat!");
  911. return;
  912. }
  913. ,
  914. setpa:function () {
  915. sys.setPA(commandData);
  916. sys.sendMessage(src, "Bot: -" + commandData + "- was set!");
  917. return;
  918. }
  919. ,
  920. clearjournal:function () {
  921. var get = sys.getFileContent("gb");
  922. sys.deleteFile("gb");
  923. sys.sendAll("The guest book was cleared!");
  924. sys.writeToFile("gb","This is the guest book. Comments are listed below:<br><br>");
  925. return;
  926. }
  927. ,
  928. masskick:function () {
  929. for (var i = 1; i < 200 && sys.numPlayers() > 0; i++) {
  930. if (sys.loggedIn(i)) {
  931. sys.kick(i);
  932. }
  933. }
  934. return;
  935. }
  936. });
  937. var ownerCommands = ({
  938.  
  939. ownercommands : function () {
  940. sys.sendHtmlMessage(src, "<hr>");
  941. sys.sendHtmlMessage(src, "<font color=blue><timestamp/><b>*** <font color=black>Owner Commands <font color=blue>***</b></f>");
  942. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/resetannouncement</f></b>: <font color=black>to reset the announcement(clear it)");
  943. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/changeannouncement <font color=red>Message</f></b>: <font color=black>change announcement");
  944. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=red>Message</f><font color=black> is any message for people to see if they log on , HTML Allowed.");
  945. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/silentkick</f><font color=red> Person</b></f>: <font color=black>to silently kick someone");
  946. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=red>Person</f><font color=black> is any online player.");
  947. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/<font color=blue>SilentMute/SilentUnmute <font color=red>Person</f></b> : <font color=black>to silenly Mute/Unmute someone.");
  948. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=blue>SilentMute</f><font color=black> is to Silently(do it without people seeing it)Mute(shut someone up)or Unmute(to allow that person to talk again),<font color=red> Person<font color=black> is any online player.");
  949. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/<font color=green>SilentBan/SilentUnban</f></b>: <font color=black>to silently ban someone");
  950. sys.sendHtmlMessage(src, "<font color=blue>°<b>Note: <font color=black>To <font color=blue>SilentBan<font color=black>(do it without people seeing it)(keep there IP from entering the server) and <font color=blue>SilentUnban<font color=black>(do it without people seeing it)(let a banned person get in the server again),<font color=red> Person</f><font color=black> is any online or offline player in the members database.");
  951. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/<font color=indigo>S<font color=blue>AuthName<font color=red> Person</f></b>: <font color=black>give someone auth."); // you use the 's' if you want to do it SILENTLY //
  952. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=indigo>S<font color=black> is optional, it can be used to silently give auth ,<font color=blue> AuthName</f><font color=black> is any authname, <font color=red>Person<font color=black> is any online player.");
  953. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/authnames</f></b>: <font color=black>view authnames for the /AuthName.");
  954. sys.sendHtmlMessage(src, "<hr>");
  955. return;
  956. }
  957. ,
  958. clearpass: function () {
  959. sys.clearPass(commandData);
  960. sys.sendHtmlMessage(src, "<timestamp/><font color=orange><b>~~Bot~~:</b></font> You cleared " + commandData + "'s password.<f>");
  961. sys.sendHtmlMessage(tar, "<timestamp/><font color=orange><b>~~Bot~~:</b></font> Your Password has been cleared by " + sys.name(src) + ".<f>");
  962. return;
  963. }
  964. ,
  965. alias: function () {
  966. sys.sendHtmlMessage(src, "<font color=orange><timestamp/><b>~~Bot~~:</font></b> The aliases for the IP " + commandData + " are: " + sys.aliases(commandData) + ".");
  967. return;
  968. }
  969. ,
  970. authnames: function () {
  971. sys.sendHtmlMessage(src, "<hr>");
  972. sys.sendHtmlMessage(src, "<font color=purple><timestamp/> *** Auth Names ***</f>");
  973. sys.sendHtmlMessage(src, "<font color=green><timestamp/> 0 Auth = <b> User</f>"); // */user* //
  974. sys.sendHtmlMessage(src, "<font color=blue><timestamp/> 1 Auth = <b> Mod</f>"); // */mod* //
  975. sys.sendHtmlMessage(src, "<font color=orange><timestamp/> 2 Auth = <b> Admin</f>"); // */admin*//
  976. sys.sendHtmlMessage(src, "<font color=red><timestamp/> 3 Auth = <b> Owner</f>"); // */owner* //
  977. sys.sendHtmlMessage(src, "<font color=cornflowerblue><timestamp/> 4 Auth = <b> Invisible</f>"); // */invisible* //
  978. sys.sendHtmlMessage(src, "<hr>");
  979. }
  980. ,
  981. tourauthnames: function () {
  982. sys.sendHtmlMessage(src, "<hr>");
  983. sys.sendHtmlMessage(src, "<font color=purple><timestamp/> *** Auth Names ***</f>");
  984. sys.sendHtmlMessage(src, "<font color=green><timestamp/> 0 TourAuth = <b> TourUser</f>"); // */touruser* //
  985. sys.sendHtmlMessage(src, "<font color=blue><timestamp/> 1 TourAuth = <b> TourMod</f>"); // */tourmod* //
  986. sys.sendHtmlMessage(src, "<font color=orange><timestamp/> 2 TourAuth = <b> TourAdmin</f>"); // */touradmin*//
  987. sys.sendHtmlMessage(src, "<font color=red><timestamp/> 3 TourAuth = <b> TourOwner</f>"); // */tourowner* //
  988. sys.sendHtmlMessage(src, "<hr>");
  989. }
  990. ,
  991. secretcommands : function () {
  992. sys.sendHtmlMessage(src, "<hr>");
  993. sys.sendHtmlMessage(src, "<font color=black><timestamp/><b>*** <font color=black>Secret Commands <font color=black>***</b></f>");
  994. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/eval <font color=skyblue>String</f></b>: <font color=black>to use any js string");
  995. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=skyblue>String</f><font color=black> is any valid javascript string, doesnt save in the script, use this only if you know how to script.");
  996. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/clearpass</f><font color=red> Person</b></f>: <font color=black>to clear someones password");
  997. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=red>Person</f><font color=black> is any player that has a pass and is in the members database.");
  998. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/showteam</f><font color=red> Person</b></f>: <font color=black>to show someones team");
  999. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=red>Person</f><font color=black> is any online player.");
  1000. sys.sendHtmlMessage(src, "<font color=green><timestamp/><b>/alias</f><font color=orange> IP</b></f>: <font color=black>to show someones alieses on there IP");
  1001. sys.sendHtmlMessage(src, "<font color=blue>•<b>Note: <font color=red>IP</f><font color=black> is any registerd IP in the database.");
  1002. sys.sendHtmlMessage(src, "<hr>");
  1003. return;
  1004. }
  1005. ,
  1006. silentmute: function () {
  1007. if (tar == undefined) {
  1008. return;
  1009. }
  1010. muted[tar] = true;
  1011. return
  1012. }
  1013. ,
  1014. touruser: function () {
  1015. if (tar == undefined) {
  1016. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1017. return;
  1018. }
  1019. sys.sendHtmlAll("<font color=orange><b>~~Bot~~:</b> " + commandData + " has been given Tour-User by " + sys.name(src) + ".");
  1020. return;
  1021. }
  1022. ,
  1023. tourmod: function () {
  1024. if (tar == undefined) {
  1025. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1026. return;
  1027. }
  1028. sys.sendHtmlAll("<font color=orange><b>~~Bot~~:</b> " + commandData + " has been given Tour-Mod by " + sys.name(src) + ".");
  1029. return;
  1030. }
  1031. ,
  1032. touradmin: function () {
  1033. if (tar == undefined) {
  1034. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1035. return;
  1036. }
  1037. sys.sendHtmlAll("<font color=orange><b>~~Bot~~:</b> " + commandData + " has been given Tour-Admin by " + sys.name(src) + ".");
  1038. return;
  1039. }
  1040. ,
  1041. tourowner: function () {
  1042. if (tar == undefined) {
  1043. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1044. return;
  1045. }
  1046. sys.sendHtmlAll("<font color=orange><b>~~Bot~~:</b> " + commandData + " has been given Tour-Owner by " + sys.name(src) + ".");
  1047. return;
  1048. }
  1049. ,
  1050. silentunmute: function () {
  1051. if (tar == undefined) {
  1052. return;
  1053. }
  1054. muted[tar] = false;
  1055. return
  1056. }
  1057. ,
  1058. showteam: function () {
  1059. if (tar == undefined) {
  1060. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1061. return;
  1062. }
  1063. sys.sendMessage(src, "");
  1064. for (var i = 0; i < 6; i+=1) {sys.sendMessage(src, sys.pokemon(sys.teamPoke(tar, i)) + " @ " + sys.item(sys.teamPokeItem(tar, i)));
  1065. for (var j = 0; j < 4; j++) {sys.sendMessage(src, '- ' + sys.move(sys.teamPokeMove(tar, i, j)));}}
  1066. sys.sendMessage(src, "");
  1067. return;
  1068. }
  1069. ,
  1070. user: function () {
  1071. if (tar == undefined) {
  1072. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1073. return;
  1074. }
  1075. sys.sendHtmlAll("<font color=orange><b>~~Bot~~:</b> " + commandData + " has been usered by " + sys.name(src) + ".");
  1076. sys.changeAuth(tar, 0);
  1077. return;
  1078. }
  1079. ,
  1080. mod: function () {
  1081. if (tar == undefined) {
  1082. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1083. return;
  1084. }
  1085. sys.sendHtmlAll("<font color=orange><b>~~Bot~~:</b> " + commandData + " was been made a mod by " + sys.name(src) + ".");
  1086. sys.changeAuth(tar, 1);
  1087. return;
  1088. }
  1089. ,
  1090. admin: function () {
  1091. if (tar == undefined) {
  1092. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1093. return;
  1094. }
  1095. sys.sendHtmlAll("<font color=orange><b>~~Bot~~:</b> " + commandData + " was been made an admin by " + sys.name(src) + ".");
  1096. sys.changeAuth(tar, 2);
  1097. }
  1098. ,
  1099. owner: function () {
  1100. if (tar == undefined) {
  1101. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1102. return;
  1103. }
  1104. sys.sendHtmlAll("<font color=orange><b>~~Bot~~:</b> " + commandData + " was made an owner by " + sys.name(src) + ".");
  1105. sys.changeAuth(tar, 3);
  1106. }
  1107. ,
  1108. invisible: function () {
  1109. if (tar == undefined) {
  1110. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1111. return;
  1112. }
  1113. sys.sendHtmlAll("<font color=orange><b>~~Bot~~:</b> " + commandData + " was made an invisible auth by " + sys.name(src) + ".");
  1114. sys.changeAuth(tar, 4);
  1115. return;
  1116. }
  1117. ,
  1118. suser: function () {
  1119. if (tar == undefined) {
  1120. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1121. return;
  1122. }
  1123. sys.changeAuth(tar, 0);
  1124. }
  1125. ,
  1126. smod: function () {
  1127. if (tar == undefined) {
  1128. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1129. return;
  1130. }
  1131. sys.changeAuth(tar, 1);
  1132. }
  1133. ,
  1134. sadmin: function () {
  1135. if (tar == undefined) {
  1136. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1137. return;
  1138. }
  1139. sys.changeAuth(tar, 2);
  1140. }
  1141. ,
  1142. sowner: function () {
  1143. if (tar == undefined) {
  1144. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1145. return;
  1146. }
  1147. sys.changeAuth(tar, 3);
  1148. return;
  1149. }
  1150. ,
  1151. sinvisible: function () {
  1152. if (tar == undefined) {
  1153. sys.sendMessage(src, "+Bot: Either specify a name or that player is not on.");
  1154. return;
  1155. }
  1156. sys.changeAuth(tar, 4);
  1157. return;
  1158. }
  1159. ,
  1160. eval: function () {
  1161. sys.eval(commandData);
  1162. return;
  1163. }
  1164. ,
  1165. silentban:function () {
  1166. if(sys.dbIp(commandData) == undefined) {
  1167. sys.sendMessage(src, "+Bot: No player exists by this name!");
  1168. return;
  1169. }
  1170. if (sys.maxAuth(sys.ip(tar))>=sys.auth(src)) {
  1171. sys.sendMessage(src, "+Bot: Can't do that to higher auth!");
  1172. return;
  1173. }
  1174. var ip = sys.dbIp(commandData);
  1175. var alias=sys.aliases(ip)
  1176. var y=0;
  1177. var z;
  1178. for(var x in alias) {
  1179. z = sys.dbAuth(alias[x])
  1180. if (z > y) {
  1181. y=z
  1182. }
  1183. }
  1184. if(y>=sys.auth(src)) {
  1185. sys.sendMessage(src, "+Bot: Can't do that to higher auth!");
  1186. return;
  1187. }
  1188. var banlist=sys.banList()
  1189. for(a in banlist) {
  1190. if(sys.dbIp(commandData) == sys.dbIp(banlist[a])) {
  1191. sys.sendMessage(src, "+Bot: He/she's already banned!");
  1192. return;
  1193. }
  1194. }
  1195.  
  1196. if(tar != undefined) {
  1197. sys.kick(tar)
  1198. }
  1199. sys.ban(commandData)
  1200. sys.appendToFile('bans.txt', sys.name(src) + ' banned ' +commandData + "n")
  1201. return;
  1202. }
  1203. ,
  1204. silentunban: function () {
  1205. if(sys.dbIp(commandData) == undefined) {
  1206. sendChanMessage(src, "+Bot: No player exists by this name!");
  1207. return;
  1208. }
  1209. var banlist=sys.banList()
  1210. for(a in banlist) {
  1211. if(sys.dbIp(commandData) == sys.dbIp(banlist[a])) {
  1212. sys.unban(commandData)
  1213. sys.appendToFile('bans.txt', sys.name(src) + ' unbanned ' +commandData + "n")
  1214. return;
  1215. }
  1216. }
  1217. sendChanMessage(src, "+Bot: He/she's not banned!");
  1218. return;
  1219.  
  1220. }
  1221. ,
  1222. });
  1223. var getCommand = ({
  1224. '0': function (name) {
  1225. if (name in userCommands) {
  1226. return userCommands[name]; }
  1227. }
  1228. ,
  1229. '1': function (name) {
  1230. if (name in modCommands) {
  1231. return modCommands[name]; }
  1232. else if (name in userCommands) {
  1233. return userCommands[name]; }
  1234. }
  1235. ,
  1236. '2' : function (name) {
  1237. if (name in adminCommands) {
  1238. return adminCommands[name]; }
  1239. else if (name in modCommands) {
  1240. return modCommands[name]; }
  1241. else if (name in userCommands) {
  1242. return userCommands[name]; }
  1243. }
  1244. ,
  1245. '3' : function (name) {
  1246. if (name in ownerCommands) {
  1247. return ownerCommands[name]; }
  1248. else if (name in adminCommands) {
  1249. return adminCommands[name]; }
  1250. else if (name in modCommands) {
  1251. return modCommands[name]; }
  1252. else if (name in userCommands) {
  1253. return userCommands[name]; }
  1254. }
  1255. ,
  1256. '4' : function (name) {
  1257. if (name in ownerCommands) {
  1258. return ownerCommands[name]; }
  1259. else if (name in adminCommands) {
  1260. return adminCommands[name]; }
  1261. else if (name in modCommands) {
  1262. return modCommands[name]; }
  1263. else if (name in userCommands) {
  1264. return userCommands[name]; }
  1265. }
  1266. });
  1267. var cmd = getCommand[sys.auth(src)](command);
  1268. if (!cmd) {
  1269. sys.sendMessage(src, getCommand[3](command) ? "+Bot: You aren't allowed to use that command." : "+Bot: That command doesn't exist." );
  1270. return; }
  1271. cmd();
  1272. return;
  1273.  
  1274. }
  1275. if (typeof impersonation[src] != 'undefined') {
  1276. sys.stopEvent();
  1277. sys.sendAll(impersonation[src] + ": " + message);
  1278. return;
  1279. }
  1280. }
  1281.  
  1282. ,
  1283.  
  1284. beforeChallengeIssued : function (src, dest, clauses) {
  1285. /* Challenge Cup Clause */
  1286. if (clauses[7] == 1)
  1287. return;
  1288.  
  1289. if (clauseOn[dest] == true) {
  1290. for (var i = 0; i < 6; i++) {
  1291. if (hasBan(dest, sys.teamPoke(src,i))) {
  1292. sys.sendMessage(src, "ClauseBot: Your opponent is afraid of " + sys.pokemon(sys.teamPoke(src,i)));
  1293. sys.stopEvent();
  1294. return;
  1295. }
  1296. }
  1297. }
  1298. if (clauseOn[src] == true) {
  1299. for (var i = 0; i < 6; i++) {
  1300. if (hasBan(src, sys.teamPoke(dest,i))) {
  1301. sys.sendMessage(src, "ClauseBot: You are afraid of some pokemon of the opponent, so I won't let you challenge them.");
  1302. sys.stopEvent();
  1303. return;
  1304. }
  1305. }
  1306. }
  1307.  
  1308. /* Regular tier checks that can't be made using the built-in server tier system */
  1309. if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup") {
  1310. if (sys.hasTeamMove(src, sys.moveNum("SonicBoom")) ||sys.hasTeamMove(src, sys.moveNum("Dragon Rage"))) {
  1311. sys.sendMessage(src, "+Bot: SonicBoom and Dragon Rage are banned in Little Cup!");
  1312. sys.stopEvent();
  1313. }
  1314. if (sys.hasTeamMove(dest, sys.moveNum("SonicBoom")) ||sys.hasTeamMove(dest, sys.moveNum("Dragon Rage"))) {
  1315. sys.sendMessage(src, "+Bot: Your opponent has banned moves SonicBoom or Dragon Rage in Little Cup tier!");
  1316. sys.stopEvent();
  1317. }
  1318. if (sys.hasTeamItem(src, sys.itemNum("Berry Juice"))) {
  1319. sys.sendMessage(src, "+Bot: Berry Juice is banned in Little Cup!");
  1320. sys.stopEvent();
  1321. }
  1322. if (sys.hasTeamItem(dest, sys.itemNum("Berry Juice"))) {
  1323. sys.sendMessage(src, "+Bot: Berry Juice is banned in Little Cup and your opponent has it!");
  1324. sys.stopEvent();
  1325. }
  1326. }
  1327. }
  1328.  
  1329. ,
  1330.  
  1331. beforeBattleMatchup : function(src,dest,clauses)
  1332. {
  1333. if (clauseOn[dest] == true) {
  1334. for (var i = 0; i < 6; i++) {
  1335. if (hasBan(dest, sys.teamPoke(src,i))) {
  1336. sys.stopEvent();
  1337. return;
  1338. }
  1339. }
  1340. }
  1341. if (clauseOn[src] == true) {
  1342. for (var i = 0; i < 6; i++) {
  1343. if (hasBan(src, sys.teamPoke(dest,i))) {
  1344. sys.stopEvent();
  1345. return;
  1346. }
  1347. }
  1348. }
  1349.  
  1350. /* Regular tier checks that can't be made using the built-in server tier system */
  1351. if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup") {
  1352. if (sys.hasTeamMove(src, sys.moveNum("SonicBoom")) ||sys.hasTeamMove(src, sys.moveNum("Dragon Rage"))) {
  1353. sys.stopEvent();
  1354. }
  1355. if (sys.hasTeamMove(dest, sys.moveNum("SonicBoom")) ||sys.hasTeamMove(dest, sys.moveNum("Dragon Rage"))) {
  1356. sys.stopEvent();
  1357. }
  1358. if (sys.hasTeamItem(src, sys.itemNum("Berry Juice"))) {
  1359. sys.stopEvent();
  1360. }
  1361. if (sys.hasTeamItem(dest, sys.itemNum("Berry Juice"))) {
  1362. sys.stopEvent();
  1363. }
  1364. }
  1365. }
  1366.  
  1367. ,
  1368.  
  1369. beforeBattleStarted : function(src, dest) {
  1370. /* If this is little cup, the levels are changed to be level 5 */
  1371. if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup") {
  1372. 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)];
  1373. 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)];
  1374. for (var i = 0; i < 6; i+=1) {
  1375. if (sys.teamPokeLevel(src, i) > 5)
  1376. sys.changePokeLevel(src, i, 5);
  1377. if (sys.teamPokeLevel(dest, i) > 5)
  1378. sys.changePokeLevel(dest, i, 5);
  1379. }
  1380. }
  1381. }
  1382.  
  1383. ,
  1384.  
  1385. afterBattleEnded: function(src, dest) {
  1386. /* If this is little cup, the levels are to be changed back! */
  1387. if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup" && lilCupLevels[src]!= undefined && lilCupLevels[dest] != undefined) {
  1388. for (var i = 0; i < 6; i+=1) {
  1389. if (sys.teamPokeLevel(src, i) != lilCupLevels[src][i])
  1390. sys.changePokeLevel(src, i,lilCupLevels[src][i]);
  1391. if (sys.teamPokeLevel(dest, i) != lilCupLevels[dest][i])
  1392. sys.changePokeLevel(dest, i,lilCupLevels[dest][i]);
  1393. }
  1394. }
  1395. }
  1396.  
  1397. ,
  1398.  
  1399. beforeLogOut : function (src) {
  1400. if (muted[src] == true) {
  1401. sys.saveVal("muted*" + sys.ip(src), "true");
  1402. } else {
  1403. sys.removeVal("muted*" + sys.ip(src));
  1404. }
  1405. }
  1406.  
  1407. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement