[Release][Updated]Event Warp Command[1-3]
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 :blink:
Go to MapleCharacter and Add
Code:
public boolean eventwarp = false;
Below
Code:
private MapleMap map;
and add
Code:
public void eventwarpEnabled(boolean yn) {
this.eventwarp = yn;
}
public boolean geteventwarpEnabled() {
return this.eventwarp;
}
Below the setMap Function
Now for the Commands :
GM Commands
Code:
} 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!");
}
}
}
}
Player Commands
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.");
}
Add Definitions if you need to!
Re: [Release][Updated]Event Warp Command[1-3]
Re: [Release][Updated]Event Warp Command[1-3]
Nice i may add this to my server.
Re: [Release][Updated]Event Warp Command[1-3]
Re: [Release][Updated]Event Warp Command[1-3]
is there a way you can fix this to work with the repack 2? cause it will not fit in for therepack 2... it gives you to much error
Re: [Release][Updated]Event Warp Command[1-3]
Looks nice, at first I thought it was the one from vahalla.
Re: [Release][Updated]Event Warp Command[1-3]
I Have ThePack 71 Its Work>??
Couse I Cant Do Complin
Re: [Release][Updated]Event Warp Command[1-3]
Nice, that saved alot of time Smega'ing or writing the notices that people are going to be having an event ;)
Re: [Release][Updated]Event Warp Command[1-3]
how do you use the !warpevent command? i have it added and every thing works fine but i cant seem to get !warpevent to work.... when i do " !warpevent 109050000 " it doesnt do anything.... how do i get this command to work?
Re: [Release][Updated]Event Warp Command[1-3]
Re: [Release][Updated]Event Warp Command[1-3]
Re: [Release][Updated]Event Warp Command[1-3]
Uhhh...why did I find " :laugh: " within the GM commands? Lolol
EDIT: was suppose to be in text form...lol
Re: [Release][Updated]Event Warp Command[1-3]
Why am I the only one that noticed this was bumped?
Re: [Release][Updated]Event Warp Command[1-3]
God dammit, stop bringing back old threads -.-
Re: [Release][Updated]Event Warp Command[1-3]