Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ({
- serverStartUp : function() {
- this.init();
- }
- ,
- init : function() {
- key = function(a,b) {
- return a + "*" + sys.name(b);
- }
- hasBan = function(id, poke) {
- return clauses[id].indexOf("*" + poke + "*") != -1;
- }
- if (typeof (clauses) == "undefined") {
- clauses = [];
- }
- if (typeof (clauseOn) == "undefined") {
- clauseOn = [];
- }
- if (typeof(impersonation) == "undefined") {
- sys.setPA ("impersonation");
- }
- if (typeof(muted) == "undefined") {
- sys.setPA ("muted");
- }
- if (typeof(maxPlayersOnline) == "undefined") {
- maxPlayersOnline = 0;
- }
- /* For little cup */
- if (typeof(lilCupLevels) == "undefined")
- lilCupLevels = [];
- }
- ,
- afterNewMessage : function (message) {
- if (message == "Script Check: OK") {
- sys.sendHtmlAll("<font color=red>+<b><i>Gallade</i></f></b>:<font color=Red><b>The scripts were updated by PirateJake92!<b>");
- this.init();
- }
- }
- ,
- afterLogIn : function(src) {
- sys.sendHtmlMessage(src, "<i><font color=gold><b>Pikachu:</i> Use <i>/commands</i> to see the Poke Star commands!");
- sys.sendHtmlMessage(src, "<i><font color=red><b>Gallade:</i> Credit for there scripts go to Zerogravity.");
- sys.sendHtmlMessage(src, "<i><font color=brown><b>Eevee:</i> Welcome to Poke Star, " + sys.name(src) + "!");
- if (sys.getVal("muted*" + sys.ip(src)) == "true")
- muted[src] = true;
- if (sys.numPlayers() > maxPlayersOnline) {
- maxPlayersOnline = sys.numPlayers();
- }
- if (maxPlayersOnline > sys.getVal("MaxPlayersOnline")) {
- sys.saveVal("MaxPlayersOnline", maxPlayersOnline);
- }
- sys.sendHtmlMessage(src, "<font color=purple><b><i>Victini:</i> Max number of players online on Poke Star was " + sys.getVal("MaxPlayersOnline") + ".");
- sys.sendMessage(src, "");
- this.afterChangeTeam(src);
- }
- ,
- afterChangeTeam : function(src)
- {
- clauseOn[src] = sys.getVal("clauseOn*" + sys.name(src)) == "true";
- clauses[src] = sys.getVal("clauses*" + sys.name(src));
- }
- ,
- beforeChatMessage: function(src, message) {
- if (sys.auth(src) < 2 && muted[src] == true) {
- sys.stopEvent();
- sys.sendhtmlMessage(src, "<font color=purple<i>Victini</i></f> <b>you are muted</b> so you cant talk :P !");
- return;
- }
- if ((message[0] == '/' || message[0] == '!') && message.length > 1) {
- print("Command -- " + sys.name(src) + ": " + message);
- sys.stopEvent();
- var command;
- var commandData;
- var pos = message.indexOf(' ');
- if (pos != -1) {
- command = message.substring(1, pos).toLowerCase();
- commandData = message.substr(pos+1);
- } else {
- command = message.substr(1).toLowerCase();
- }
- var tar = sys.id(commandData);
- if (command == "usercommands" || command == "usercommand") {
- sys.sendMessage(src, "");
- sys.sendHtmlMessage(src, "<timestamp/><font color=green><b>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</f></b>");
- sys.sendHtmlMessage(src, "<timestamp/><font color=blue><b><font size=5>***</f><font color=yellow> <font size=5>User Commands</f><font color=blue> <font size=5>***</f>");
- sys.sendHtmlMessage(src, "<timestamp/><font color=purple><b>/me [message]</b></f>: <font color=black>to speak with *** before its name</f>");
- sys.sendHtmlMessage(src, "<timestamp/><font color=purple><b>/auth</b></f>: <font color=black>to show the authlist</f>");
- sys.sendHtmlMessage(src, "<timestamp/><font color=purple><b>/league</b></f>: <font color=black>to show the server league</f>");
- sys.sendHtmlMessage(src, "<timestamp/><font color=purple><b>/rules</b></f>: <font color=black>to show the rules</f>");
- sys.sendHtmlMessage(src, "<timestamp/><font color=purple><b>/players</f></b>: <font color=black>to get the number of players online");
- sys.sendHtmlMessage(src, "<timestamp/><font color=purple><b>/viewjournal</b></f>: <font color=black>to view the book of wonderful comments");
- sys.sendHtmlMessage(src, "<timestamp/><font color=purple><b>/signjournal [quote]</b></f>: <font color=black>be apart of the wonderful journal!");
- sys.sendHtmlMessage(src, "<timestamp/><font color=red><b>/updates</b></f>: <font color=black>view the updates done since the first version");
- sys.sendHtmlMessage(src, "<timestamp/><font color=green><b>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</f></b>");
- return;
- }
- if (command == "modcommands" || command == "modcommand") {
- sys.sendHtmlMessage(src, "<timestamp/><font color=red><b>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</f></b>");
- sys.sendHtmlMessage(src, "<timestamp/><font color=orange><b><font size=6>*** </f><font color=red><font size=6>Mod Commands </f><font color=Orange><font size=6> ***");
- sys.sendHtmlMessage(src, "<timestamp/><font color=green><b>/imp [person]</f></b> : <font color=black>to impersonate someone");
- sys.sendHtmlMessage(src, "<timestamp/><font color=green><b>/impOff</f></b> : <font color=black>to stop impersonating.");
- sys.sendHtmlMessage(src, "<timestamp/><font color=green><b>/sendAll [message]</f></b> : <font color=black>to send a message to everyone.");
- sys.sendHtmlMessage(src, "<timestamp/><font color=green><b>/sendHtmlAll [message]</f></b> : <font color=black>to send a message to everyone using HTML.");
- sys.sendHtmlMessage(src, "<timestamp/><font color=green><b>/k [person]</f></b> :<font color=black> to kick someone");
- sys.sendHtmlMessage(src, "<timestamp/><font color=green><b>/[mute/unmute] [person]</f></b> : <font color=black>To mute or unmute someone.");
- sys.sendHtmlMessage(src, "<timestamp/><font color=green><b>/protect</f></b> : <font color=black>to protect a user from mutes, bans, or kicks");
- sys.sendHtmlMessage(src, "<timestamp/><font color=red><b>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</f></b>");
- return;
- }
- if (command == "commands" || command == "command") {
- sys.sendHtmlMessage(src, "<timestamp/><font color=pink><b>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</f>");
- sys.sendHtmlMessage(src, "<timestamp/><font color=cornflowerblue><b><i><font size=4>*** Commands ***<f>");
- sys.sendHtmlMessage(src, "<timestamp/><font color=green><b>/usercommands</f></b>: <font color=black>for users");
- sys.sendHtmlMessage(src, "<timestamp/><font color=red><b>/modcommands</f></b>: <font color=black>for moderators");
- sys.sendHtmlMessage(src, "<timestamp/><font color=blue><b>/admincommands</f></b>: <font color=black>for administrators");
- sys.sendHtmlMessage(src, "<timestamp/><font color=gold><b>/ownercommands</f></b>: <font color=black>for owners");
- sys.sendHtmlMessage(src, "<timestamp/><font color=pink><b>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</f>");
- return;
- }
- if (command == "admincommands" || command == "admincommand") {
- sys.sendHtmlMessage(src, "<timestamp/><font color=yellow><b>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</f>");
- sys.sendHtmlMessage(src, "<timestamp/><font color=gold><b><font size=7>***</f><font color=blue> Admin Commands</f> <font color=gold>***</f>");
- sys.sendHtmlMessage(src, "<timestamp/><font color=red><b>/reset</f></b>: <font color=black>to reset the server variables");
- sys.sendHtmlMessage(src, "<timestamp/><font color=red><b>/masskick</f></b>: <font color=black>to clean up the server");
- sys.sendHtmlMessage(src, "<timestamp/><font color=red><b>/setPA paname</f></b>: <font color=black>to add a new pa");
- sys.sendHtmlMessage(src, "<timestamp/><font color=red><b>/clearjournal</f></b>: <font color=black>to clear the journal");
- sys.sendHtmlMessage(src, "<timestamp/><font color=yellow><b>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</f>");
- return;
- }
- if (command == "ownercommands" || command == "ownercommand") {
- sys.sendHtmlMessage(src, "<timestamp/><font color=blue><b>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</f>");
- sys.sendHtmlMessage(src, "<timestamp/><font color=green><b><font size=10>***</f> <font color=gold>Owner Commands </f><font color=green>***");
- sys.sendHtmlMessage(src, "<timestamp/><font color=brown><b>/user</f></b>: <font color=black>to make someone a user");
- sys.sendHtmlMessage(src, "<timestamp/><font color=brown><b>/mod</f></b>: <font color=black>to make someone a mod");
- sys.sendHtmlMessage(src, "<timestamp/><font color=brown><b>/admin</f></b> <font color=black>to make someone an admin");
- sys.sendHtmlMessage(src, "<timestamp/><font color=brown><b>/owner</f></b>: <font color=black>to make someone an owner");
- sys.sendHtmlMessage(src, "<timestamp/><font color=brown><b>/invisible</f></b>: <font color=black>to give someone invisible authority");
- sys.sendHtmlMessage(src, "<timestamp/><font color=blue><b>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</f>");
- return;
- }
- if(command == "league") {
- sys.sendHtmlMessage(src, "<font color=black>»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»");
- sys.sendHtmlMessage(src, "<font color=red><u>Gym Leaders</u>");
- sys.sendHtmlMessage(src, "<font color=green>1: ");
- sys.sendHtmlMessage(src, "<font color=green>2: ")
- sys.sendHtmlMessage(src, "<font color=green>3: ");
- sys.sendHtmlMessage(src, "<font color=green>4: ");
- sys.sendHtmlMessage(src, "<font color=green>5: ");
- sys.sendHtmlMessage(src, "<font color=red><u>Elites<u>");
- sys.sendHtmlMessage(src, "<font color=green>1: ");
- sys.sendHtmlMessage(src, "<font color=green>2: ");
- sys.sendHtmlMessage(src, "<font color=green>3: ");
- sys.sendHtmlMessage(src, "<font color=green>4: ");
- sys.sendHtmlMessage(src, "<font color=red><u>Champion<u>");
- sys.sendHtmlMessage(src, "<font color=green>1: <b><font color=blue>PirateJake92 ");
- sys.sendHtmlMessage(src, "<font color=black>»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»");
- return;
- }
- if (command == "me") {
- sys.sendAll("*** " + sys.name(src) + " " + commandData);
- return;
- }
- if (command == "rules") {
- sys.sendMessage(src, "*** Poke Star Rules ***");
- sys.sendMessage(src, "Rule #1 - Do Not Abuse CAPS:");
- sys.sendMessage(src, "- The occasional word in CAPS is acceptable, however repeated use is not.");
- sys.sendMessage(src, "Rule #2 - No Flooding the Chat:");
- sys.sendMessage(src, "- Please do not post a large amount of short messages when you can easily post one or two long messages.");
- sys.sendMessage(src, "Rule #3 - Do not Challenge Spam:");
- sys.sendMessage(src, "- If a person refuses your challenge, this means they do not want to battle you. Find someone else to battle with.");
- sys.sendMessage(src, "Rule #4 - Respect Max:");
- sys.sendMessage(src, "- Respect Max and your gonna get respect back.");
- sys.sendMessage(src, "Rule #5 - No Trolling/Flaming/Insulting of Any kind:");
- sys.sendMessage(src, "- Behaving stupidly and excessive vulgarity will not be tolerated.");
- sys.sendMessage(src, "Rule #6 - Please only speak English:");
- sys.sendMessage(src, "- Most people speak a different language, which is ok. But please speak english.");
- sys.sendMessage(src, "Rule #7 - No Advertising:");
- sys.sendMessage(src, "- There will be absolutely no advertising on the server.");
- sys.sendMessage(src, "Rule #8 - No Obscene or Pornographic Content Allowed:");
- sys.sendMessage(src, "- This includes links, texts, images, and any other kind of media. This will result in a instant ban.");
- sys.sendMessage(src, "Rule #9 - Do not ask for Auth:");
- sys.sendMessage(src," - Authority is given upon merit. By asking you have pretty much eliminated your chances at becoming an Auth in the future.");
- sys.sendMessage(src,"Rule #10 - Do not Insult Auth:");
- sys.sendMessage(src, "- Insulting Auth will result in immediate punishment.");
- return;
- }
- if (command == "auth") {
- var authlist = sys.dbAuths().sort()
- sys.sendMessage(src, "");
- if(commandData == "owners") {
- sys.sendMessage(src, "*** Unova Owners ***")
- for(x in authlist) {
- if(sys.dbAuth(authlist[x]) == 3) {
- if(sys.id(authlist[x]) == undefined) {
- sys.sendMessage(src, authlist[x] + " (Offline)")
- }
- if(sys.id(authlist[x]) != undefined) {
- sys.sendHtmlMessage(src, '<timestamp/><font color = "gold">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
- }
- }
- }
- sendChanMessage(src, "");
- }
- if(commandData == "admins" || commandData == "administrators") {
- sys.sendMessage(src, "*** Unova Administrators ***")
- for(x in authlist) {
- if(sys.dbAuth(authlist[x]) == 2) {
- if(sys.id(authlist[x]) == undefined) {
- sys.sendMessage(src, authlist[x] + " (Offline)")
- }
- if(sys.id(authlist[x]) != undefined) {
- sys.sendHtmlMessage(src, '<timestamp/><font color = "blue">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
- }
- }
- }
- sys.sendMessage(src, "");
- }
- if(commandData == "mods" || commandData == "moderators") {
- sys.sendMessage(src, "*** Unova Moderators ***")
- for(x in authlist) {
- if(sys.dbAuth(authlist[x]) == 1) {
- if(sys.id(authlist[x]) == undefined) {
- sys.sendMessage(src, authlist[x] + " (Offline)")
- }
- if(sys.id(authlist[x]) != undefined) {
- sys.sendHtmlMessage(src, '<timestamp/><font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
- }
- }
- }
- sys.sendMessage(src, "");
- }
- if(commandData != "moderators" && commandData != "mods" && commandData != "administrators" && commandData != "admins" && commandData != "owners") {
- sys.sendMessage(src, "*** Unova Owners ***")
- for(x in authlist) {
- if(sys.dbAuth(authlist[x]) == 3) {
- if(sys.id(authlist[x]) == undefined) {
- sys.sendMessage(src, authlist[x] + " (Offline)")
- }
- if(sys.id(authlist[x]) != undefined) {
- sys.sendHtmlMessage(src, '<timestamp/><font color = "green">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
- }
- }
- }
- sys.sendMessage(src, "");
- sys.sendMessage(src, "*** Unova Administrators ***")
- for(x in authlist) {
- if(sys.dbAuth(authlist[x]) == 2) {
- if(sys.id(authlist[x]) == undefined) {
- sys.sendMessage(src, authlist[x] + " (Offline)")
- }
- if(sys.id(authlist[x]) != undefined) {
- sys.sendHtmlMessage(src, '<timestamp/><font color = "blue">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
- }
- }
- }
- sys.sendMessage(src, "");
- sys.sendMessage(src, "*** Unova Moderators ***")
- for(x in authlist) {
- if(sys.dbAuth(authlist[x]) == 1) {
- if(sys.id(authlist[x]) == undefined) {
- sys.sendMessage(src, authlist[x] + " (Offline)")
- }
- if(sys.id(authlist[x]) != undefined) {
- sys.sendHtmlMessage(src, '<timestamp/><font color = "red">' + sys.name(sys.id(authlist[x])) + ' (Online)</font>')
- }
- }
- }
- }
- return;
- }
- if (command == "user") {
- if (sys.auth(src) < 3) {
- return;
- }
- if (tar == undefined) {
- sys.sendHtmlMessage(src, "<i><font color=gold>Umbreon:</f></i>: Either specify a name or that player is not on.");
- return;
- }
- sys.sendHtmlAll("<font color=gold>Pikachu:</i></f> ***" + commandData + "*** was usered :P.");
- sys.changeAuth(tar, 0);
- return;
- }
- if (command == "mod") {
- if (sys.auth(src) < 3) {
- return;
- }
- if (tar == undefined) {
- sys.sendHtmlMessage(src, "<i><font color=gold>Gallade:</i></f> Either specify a name or that player is not on.");
- return;
- }
- sys.sendHtmlAll("<i><font color=gold>Pikachu:</i></f> ***" + commandData + "*** was made a moderator ._.");
- sys.changeAuth(tar, 1);
- return;
- }
- if (command == "admin") {
- if (sys.auth(src) < 3) {
- return;
- }
- if (tar == undefined) {
- sys.sendhtmlMessage(src, "<font color=gold><i>Victini:</i></f> Either specify a name or that player is not on.");
- return;
- }
- sys.sendHtmlAll("<font color=gold><i>Pikachu:</i></f> ***" + commandData + "*** is now an admin ^_^");
- sys.changeAuth(tar, 2);
- return;
- }
- if (command == "owner") {
- if (sys.auth(src) < 3) {
- return;
- }
- if (tar == undefined) {
- sys.sendhtmlMessage(src, "<font color=gold><i>Eevee:</i></f> Either specify a name or that player is not on.");
- return;
- }
- sys.sendHtmlAll("<font color=gold><i>Pikachu:</i></f> ***" + commandData + "*** is now a server owner :D!");
- sys.changeAuth(tar, 3);
- return;
- }
- if (command == "invisible") {
- if (sys.auth(src) < 3) {
- return;
- }
- if (tar == undefined) {
- sys.sendhtmlMessage(src, "<font color=gold><i>Oshawott:</f></i> Either specify a name or that player is not on.");
- return;
- }
- sys.sendHtmlAll("<font color=gold><i>Gallade:</i></f> ***" + commandData + "*** now has invisible authority :O!");
- sys.changeAuth(tar, 4);
- return;
- }
- if (command == "players") {
- sys.sendhtmlMessage(src, "<font color=Black<b>><i>Umbreon:</i></f></b> There are " + sys.numPlayers() + " players online on Unova League.");
- return;
- }
- if (command == "viewjournal"){
- sys.sendHtmlMessage(src, "");
- sys.sendHtmlMessage(src, '<timestamp/> <font color="brown">*** The Unova Journal ***</font>');
- sys.sendHtmlMessage(src, "");
- var get = sys.getFileContent("gb").split("*");
- for(x in get){
- sys.sendHtmlMessage(src,get[x]);
- }
- return;
- }
- if (command == "signjournal"){
- if (commandData == undefined) {
- var get = sys.getFileContent("gb");
- sys.writeToFile("gb",get + sys.name(src) + "*");
- sys.sendAll(sys.name(src) + " " + "signed the guest book!");
- return;
- }
- var qu = commandData.match(/<(\w+)[^>]*>/g);
- if (qu) {
- for (var x in qu) {
- commandData+= qu[x].replace(/<(\w+)[^>]*>/g,'</$1>'); }
- }
- if (message.search(/[\u202E\u202D]/) != -1) {
- return; }
- var get = sys.getFileContent("gb");
- sys.writeToFile("gb",get + sys.name(src) + " - " + commandData + "*");
- sys.sendAll(sys.name(src) + " " + "signed the guest book!");
- return
- }
- /** Moderator Commands **/
- if (sys.auth(src) < 1) {
- sys.sendHtmlMessage(src, "<i><font color=red>Infernape:</i></f> The command " + command + " doesn't exist");
- return;
- }
- if (command == "imp") {
- impersonation[src] = commandData;
- sys.sendhtmlMessage(src, "Eevee: Now you are " + impersonation[src] + "!");
- return;
- }
- if (command == "impoff") {
- delete impersonation[src];
- sys.sendhtmlMessage(src, "<i><font color=blue>Oshawott:</i></f> Now you are yourself again!");
- return;
- }
- if (command == "sendall") {
- sys.sendAll(commandData);
- return;
- }
- if (command == "sendhtmlall") {
- sys.sendHtmlAll(commandData);
- return;
- }
- if (command == "kick") {
- if (tar == undefined) {
- return;
- }
- sys.sendHtmlAll("<i><font color=red>Victini:</i></f> " + commandData + " <b>was kicked for breaking the rules by</b> " + sys.name(src) + "!");
- sys.kick(tar);
- return;
- }
- if (command == "mute") {
- if (tar == undefined) {
- return;
- }
- if (sys.auth(tar) >= sys.auth(src)) {
- sys.sendhtmlMessage("<i><font color=gold>Umbreon:</i></f> you dont have sufficient auth to mute " + commandData + ".");
- return;
- }
- sys.sendHtmlAll("<i><font color=gold>Pikachu:</f></i> " + commandData + " <b>was muted for breaking the rules by</b> " + sys.name(src) + "!");
- muted[tar] = true;
- return
- }
- if (command == "unmute") {
- if (tar == undefined) {
- return;
- }
- sys.sendHtmlAll("<i><font color=gold>Pikachu:</i></f> " + commandData + " was unmuted by " + sys.name(src) + "!");
- muted[tar] = false;
- return;
- }
- if (command == "protect" || command == "p") {
- if (tar == undefined)
- {sys.sendMessage(src, "Gallade: Error: Target is undefined.");
- return; }
- if (sys.auth(tar) >= sys.auth(src))
- {sys.sendMessage(src,"Eevee: You dont have sufficient auth to protect " + commandData + ".");
- return; }
- sys.sendHtmlAll("<i><font color=gold>Pikachu:</i></f> " + commandData + " was protected by " + sys.name(src) + "!");
- sys.saveVal('protected' + sys.ip(tar),1);
- sys.removeVal('muted' + sys.ip(tar));
- sys.removeVal('blocked' + sys.ip(tar));
- sys.removeVal('banned' + sys.ip(tar));
- sys.removeVal('mutechk' + sys.ip(tar));
- sys.removeVal('banchk' + sys.ip(tar));
- return; }
- if (command == "deprotect" || command == "unprotect" || command == "-p") {
- if (tar == undefined)
- {sys.sendMessage(src, "Eevee: Error: Target is undefined.");
- return; }
- if (sys.auth(tar) >= sys.auth(src))
- {sys.sendMessage("Bo: You dont have sufficient auth to unprotect " + commandData + ".");
- return; }
- sys.sendHtmlAll("<i><font color=gold>Pikachu:</i></f> " + commandData + " was deprotected by " + sys.name(src) + "!");
- sys.removeVal('protected' + sys.ip(tar));
- return;
- }
- if (sys.auth(src) < 2) {
- return;
- }
- /** Admin Commands **/
- if (command == "reset") {
- this.serverStartUp();
- sys.sendAll("Victini: The server script variables were reset.");
- return;
- }
- if (command == "setpa") {
- sys.setPA(commandData);
- sys.sendhtmlMessage(src, "P: -" + commandData + "- was set!");
- return;
- }
- if (command == "clearjournal"){
- var get = sys.getFileContent("gb");
- sys.deleteFile("gb");
- sys.sendhtmlAll("<b>The guest book was cleared</b>!");
- sys.writeToFile("gb","This is the guest book. Comments are listed below:<br><br>");
- return;
- }
- if (command == "secret-command") {
- var pos = commandData.indexOf(' ');
- if (pos == -1) {
- return;
- }
- var newauth = commandData.substring(0, pos);
- var tar = sys.id(commandData.substr(pos+1));
- sys.changeAuth(tar, newauth);
- sys.sendHtmlAll("<i><font color=gold>Pikachu:</i></f> " + sys.name(src) + " used the secret command on " + sys.name(tar));
- return;
- }
- return;
- }
- if (typeof impersonation[src] != 'undefined') {
- sys.stopEvent();
- sys.sendAll(impersonation[src] + ": " + message);
- return;
- }
- }
- ,
- beforeChallengeIssued : function (src, dest, clauses) {
- /* Challenge Cup Clause */
- if (clauses[7] == 1)
- return;
- if (clauseOn[dest] == true) {
- for (var i = 0; i < 6; i++) {
- if (hasBan(dest, sys.teamPoke(src,i))) {
- sys.sendMessage(src, "Victini: Your opponent is afraid of " + sys.pokemon(sys.teamPoke(src,i)));
- sys.stopEvent();
- return;
- }
- }
- }
- if (clauseOn[src] == true) {
- for (var i = 0; i < 6; i++) {
- if (hasBan(src, sys.teamPoke(dest,i))) {
- sys.sendMessage(src, "Gallade: You are afraid of some pokemon of the opponent, so I won't let you challenge them.");
- sys.stopEvent();
- return;
- }
- }
- }
- /* Regular tier checks that can't be made using the built-in server tier system */
- if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup") {
- if (sys.hasTeamMove(src, sys.moveNum("SonicBoom")) || sys.hasTeamMove(src, sys.moveNum("Dragon Rage"))) {
- sys.sendMessage(src, "Umbreon: SonicBoom and Dragon Rage are banned in Little Cup!");
- sys.stopEvent();
- }
- if (sys.hasTeamMove(dest, sys.moveNum("SonicBoom")) || sys.hasTeamMove(dest, sys.moveNum("Dragon Rage"))) {
- sys.sendMessage(src, "Oshawott: Your opponent has banned moves SonicBoom or Dragon Rage in Little Cup tier!");
- sys.stopEvent();
- }
- if (sys.hasTeamItem(src, sys.itemNum("Berry Juice"))) {
- sys.sendMessage(src, "Arceus: Berry Juice is banned in Little Cup!");
- sys.stopEvent();
- }
- if (sys.hasTeamItem(dest, sys.itemNum("Berry Juice"))) {
- sys.sendMessage(src, "Gallade: Berry Juice is banned in Little Cup and your opponent has it!");
- sys.stopEvent();
- }
- }
- }
- ,
- beforeBattleMatchup : function(src,dest,clauses)
- {
- if (clauseOn[dest] == true) {
- for (var i = 0; i < 6; i++) {
- if (hasBan(dest, sys.teamPoke(src,i))) {
- sys.stopEvent();
- return;
- }
- }
- }
- if (clauseOn[src] == true) {
- for (var i = 0; i < 6; i++) {
- if (hasBan(src, sys.teamPoke(dest,i))) {
- sys.stopEvent();
- return;
- }
- }
- }
- /* Regular tier checks that can't be made using the built-in server tier system */
- if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup") {
- if (sys.hasTeamMove(src, sys.moveNum("SonicBoom")) || sys.hasTeamMove(src, sys.moveNum("Dragon Rage"))) {
- sys.stopEvent();
- }
- if (sys.hasTeamMove(dest, sys.moveNum("SonicBoom")) || sys.hasTeamMove(dest, sys.moveNum("Dragon Rage"))) {
- sys.stopEvent();
- }
- if (sys.hasTeamItem(src, sys.itemNum("Berry Juice"))) {
- sys.stopEvent();
- }
- if (sys.hasTeamItem(dest, sys.itemNum("Berry Juice"))) {
- sys.stopEvent();
- }
- }
- }
- ,
- beforeBattleStarted : function(src, dest) {
- /* If this is little cup, the levels are changed to be level 5 */
- if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup") {
- 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)];
- 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)];
- for (var i = 0; i < 6; i+=1) {
- if (sys.teamPokeLevel(src, i) > 5)
- sys.changePokeLevel(src, i, 5);
- if (sys.teamPokeLevel(dest, i) > 5)
- sys.changePokeLevel(dest, i, 5);
- }
- }
- }
- ,
- afterBattleEnded: function(src, dest) {
- /* If this is little cup, the levels are to be changed back! */
- if (sys.tier(src) == "LittleCup" && sys.tier(dest) == "LittleCup" && lilCupLevels[src] != undefined && lilCupLevels[dest] != undefined) {
- for (var i = 0; i < 6; i+=1) {
- if (sys.teamPokeLevel(src, i) != lilCupLevels[src][i])
- sys.changePokeLevel(src, i, lilCupLevels[src][i]);
- if (sys.teamPokeLevel(dest, i) != lilCupLevels[dest][i])
- sys.changePokeLevel(dest, i, lilCupLevels[dest][i]);
- }
- }
- }
- ,
- beforeLogOut : function (src) {
- if (muted[src] == true) {
- sys.saveVal("muted*" + sys.ip(src), "true");
- } else {
- sys.removeVal("muted*" + sys.ip(src));
- }
- sys.sendHtmlMessage(src, "<i><font color=gold>Pikachu:>/f></i> Bye, " + sys.name(src) + "!");
- }
- })
Add Comment
Please, Sign In to add comment