egh this wasn't to hard to make and is not really needed but what the hell lolz?This is for ThePack! Should work with V17/26(Can someone test?
this is used for like events
UPDATE 1: Made !eventon say the channel # instead of "c.getChannel"
UPDATE 2: Made !eventon say the GameMasters name who's hosting the event
UPDATE 3: Revamped and Added Traitors Methods. Deleted GM Name Calling out.
eg.
1. GM does !eventon which sends a notice to everyone saying "If you would like to join the event please do @eventon whilst in channel <Channel GM who did the command is on>"
2. Players do @eventon and it says "You're event status has been set to on, please wait for a GM to warp you to the event"
3. GM does !warpevent which Warps all players who is not on the same map as the GM to that map and sends a message saying "Welcome to the Event, please await a GM's instructions before doing anything!" and sends a message who had eventwarp off(it's off by default...) saying "Sorry you have just missed the Event."
That's it
Go to MapleCharacter and Add
BelowCode:public boolean eventwarp = false;
and addCode:private MapleMap map;
Below the setMap FunctionCode:public void eventwarpEnabled(boolean yn) { this.eventwarp = yn; } public boolean geteventwarpEnabled() { return this.eventwarp; }
Now for the Commands :
GM Commands
Player CommandsCode:} else if (splitted[0].equals("!eventon")) { for (ChannelServer cservs : ChannelServer.getAllInstances()) { for (MapleCharacter mch : cservs.getPlayerStorage().getAllCharacters()) { if (c.getPlayer().getClient().getChannelServer().eventOn == false) { int mapid = getOptionalIntArg(splitted, 1, player.getMapId()); c.getPlayer().getClient().getChannelServer().eventOn = true; c.getPlayer().getClient().getChannelServer().eventMap = mapid; String type; String message1; String message2; String message3; type = "[Event]"; message1 = "An Event has started in " + c.getPlayer().getMap().getMapName() + ", Channel " + c.getPlayer().getClient().getChannel(); message2 = "Please type @warpon while in Channel " + c.getChannel() + " to be warped to the event. If you change your mind type @warpoff"; MaplePacket packet1 = MaplePacketCreator.serverNotice(6, type + message1); MaplePacket packet2 = MaplePacketCreator.serverNotice(6, message2); c.getPlayer().getMap().broadcastMessage(packet1); c.getPlayer().getMap().broadcastMessage(packet2);:laugh: } else { mch.dropMessage("Sorry an Event has already started in this Channel!"); } } } } else if (splitted[0].equals("!eventoff")) { for (ChannelServer cservs : ChannelServer.getAllInstances()) { for (MapleCharacter mch : cservs.getPlayerStorage().getAllCharacters()) { if (c.getPlayer().getClient().getChannelServer().eventOn == true) { c.getPlayer().getClient().getChannelServer().eventOn = false; mch.eventwarpEnabled(false); String type; String message1; type = "[Event]"; message1 = "The Event in Channel " + c.getChannel() + " has ended. Thanks and Congratulations to all of those who participated."; mch.dropMessage(type + message1); } else { mc.dropMessage("Sorry an Event has not been started in this Channel!"); } } } } else if (splitted[0].equals("!eventwarp") || splitted[0].equals("!warpevent")) { for (ChannelServer cservs : ChannelServer.getAllInstances()) { for (MapleCharacter mch : cservs.getPlayerStorage().getAllCharacters()) { if (c.getPlayer().getClient().getChannelServer().eventOn == true) { if (mch.getMapId() != c.getPlayer().getMapId() && mch.geteventwarpEnabled() == true) { mch.changeMap(c.getPlayer().getMap(), c.getPlayer().getPosition()); String type; String message1; type = "[Event]"; message1 = "Welcome to The Event, Please await a GM's instructions before attempting to do anything."; mch.dropMessage(type + message1); } else if (mch.getMapId() != c.getPlayer().getMapId() && mch.geteventwarpEnabled() != true) { String type; String message2; type = "[Event]"; message2 = "Your Eventwarp's status was set to off and therefor you have Missed the Event. Kindly ask a GM to warp you."; mch.dropMessage(type + message2); } else if (c.getPlayer().getClient().getChannelServer().eventOn != true) { mc.dropMessage("Sorry but an Event has not yet started in this Channel!"); } } } }
Add Definitions if you need to!Code:} else if (splitted[0].equals("@warpon") || splitted[0].equals("@eventon")) { if (c.getPlayer().geteventwarpEnabled() == false && c.getPlayer().getClient().getChannelServer().eventOn == true) { c.getPlayer().eventwarpEnabled(true); mc.dropMessage("Your Event warp status has been set to on, please wait for a GM to warp you to the Event!"); mc.dropMessage("Remember to be in the same channel as the GM Event."); } else if (c.getPlayer().geteventwarpEnabled() == false && c.getPlayer().getClient().getChannelServer().eventOn == false){ mc.dropMessage("There isn't an Event going on right now, try again Later."); } else if (c.getPlayer().geteventwarpEnabled() == true && c.getPlayer().getClient().getChannelServer().eventOn == true){ mc.dropMessage("Your event warp Status is already on, please wait for a GM to warp you."); } } else if (splitted[0].equals("@warpoff") || splitted[0].equals("@eventoff")) { if (c.getPlayer().geteventwarpEnabled() == true && c.getPlayer().getClient().getChannelServer().eventOn == true) { c.getPlayer().eventwarpEnabled(false); mc.dropMessage("Your Event warp status has been set to off, you will no longer be warped to the Event!"); mc.dropMessage("Type @warpon to be warped to the Event!"); } else if (c.getPlayer().geteventwarpEnabled() == false && c.getPlayer().getClient().getChannelServer().eventOn == true){ mc.dropMessage("Your event warp Status is already off."); }




Reply With Quote![[Release]Event Warp[Updated 12-26]](http://ragezone.com/hyper728.png)


