Add timer commands (#327)
This commit is contained in:
@@ -295,6 +295,9 @@ public class CommandsExecutor {
|
|||||||
addCommand("startquest", 3, QuestStartCommand.class);
|
addCommand("startquest", 3, QuestStartCommand.class);
|
||||||
addCommand("completequest", 3, QuestCompleteCommand.class);
|
addCommand("completequest", 3, QuestCompleteCommand.class);
|
||||||
addCommand("resetquest", 3, QuestResetCommand.class);
|
addCommand("resetquest", 3, QuestResetCommand.class);
|
||||||
|
addCommand("timer", 3, TimerCommand.class);
|
||||||
|
addCommand("timermap", 3, TimerMapCommand.class);
|
||||||
|
addCommand("timerall", 3, TimerAllCommand.class);
|
||||||
|
|
||||||
commandsNameDesc.add(levelCommandsCursor);
|
commandsNameDesc.add(levelCommandsCursor);
|
||||||
}
|
}
|
||||||
|
|||||||
59
src/client/command/commands/gm3/TimerAllCommand.java
Normal file
59
src/client/command/commands/gm3/TimerAllCommand.java
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
This file is part of the HeavenMS MapleStory Server, commands OdinMS-based
|
||||||
|
Copyleft (L) 2016 - 2018 RonanLana
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as
|
||||||
|
published by the Free Software Foundation version 3 as published by
|
||||||
|
the Free Software Foundation. You may not use, modify or distribute
|
||||||
|
this program under any other version of the GNU Affero General Public
|
||||||
|
License.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
@Author: MedicOP - Add clock commands
|
||||||
|
*/
|
||||||
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
|
import client.MapleCharacter;
|
||||||
|
import client.MapleClient;
|
||||||
|
import client.command.Command;
|
||||||
|
import tools.MaplePacketCreator;
|
||||||
|
|
||||||
|
public class TimerAllCommand extends Command {
|
||||||
|
{
|
||||||
|
setDescription("");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute(MapleClient c, String[] params) {
|
||||||
|
MapleCharacter player = c.getPlayer();
|
||||||
|
if (params.length < 2) {
|
||||||
|
player.yellowMessage("Syntax: !timerall <seconds>|remove");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params[1].equalsIgnoreCase("remove")) {
|
||||||
|
for (MapleCharacter victim : player.getWorldServer().getPlayerStorage().getAllCharacters()) {
|
||||||
|
victim.announce(MaplePacketCreator.removeClock());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
int seconds = Integer.parseInt(params[1]);
|
||||||
|
for (MapleCharacter victim : player.getWorldServer().getPlayerStorage().getAllCharacters()) {
|
||||||
|
victim.announce(MaplePacketCreator.getClock(seconds));
|
||||||
|
}
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
player.yellowMessage("Syntax: !timerall <seconds>|remove");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
59
src/client/command/commands/gm3/TimerCommand.java
Normal file
59
src/client/command/commands/gm3/TimerCommand.java
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
This file is part of the HeavenMS MapleStory Server, commands OdinMS-based
|
||||||
|
Copyleft (L) 2016 - 2018 RonanLana
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as
|
||||||
|
published by the Free Software Foundation version 3 as published by
|
||||||
|
the Free Software Foundation. You may not use, modify or distribute
|
||||||
|
this program under any other version of the GNU Affero General Public
|
||||||
|
License.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
@Author: MedicOP - Add clock commands
|
||||||
|
*/
|
||||||
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
|
import client.MapleCharacter;
|
||||||
|
import client.MapleClient;
|
||||||
|
import client.command.Command;
|
||||||
|
import tools.MaplePacketCreator;
|
||||||
|
|
||||||
|
public class TimerCommand extends Command {
|
||||||
|
{
|
||||||
|
setDescription("");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute(MapleClient c, String[] params) {
|
||||||
|
MapleCharacter player = c.getPlayer();
|
||||||
|
if (params.length < 2) {
|
||||||
|
player.yellowMessage("Syntax: !timer <playername> <seconds>|remove");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||||
|
if (victim != null) {
|
||||||
|
if (params[1].equalsIgnoreCase("remove")) {
|
||||||
|
victim.announce(MaplePacketCreator.removeClock());
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
victim.announce(MaplePacketCreator.getClock(Integer.parseInt(params[1])));
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
player.yellowMessage("Syntax: !timer <playername> <seconds>|remove");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
player.message("Player '" + params[0] + "' could not be found.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
59
src/client/command/commands/gm3/TimerMapCommand.java
Normal file
59
src/client/command/commands/gm3/TimerMapCommand.java
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
This file is part of the HeavenMS MapleStory Server, commands OdinMS-based
|
||||||
|
Copyleft (L) 2016 - 2018 RonanLana
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as
|
||||||
|
published by the Free Software Foundation version 3 as published by
|
||||||
|
the Free Software Foundation. You may not use, modify or distribute
|
||||||
|
this program under any other version of the GNU Affero General Public
|
||||||
|
License.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
@Author: MedicOP - Add clock commands
|
||||||
|
*/
|
||||||
|
package client.command.commands.gm3;
|
||||||
|
|
||||||
|
import client.MapleCharacter;
|
||||||
|
import client.MapleClient;
|
||||||
|
import client.command.Command;
|
||||||
|
import tools.MaplePacketCreator;
|
||||||
|
|
||||||
|
public class TimerMapCommand extends Command {
|
||||||
|
{
|
||||||
|
setDescription("");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute(MapleClient c, String[] params) {
|
||||||
|
MapleCharacter player = c.getPlayer();
|
||||||
|
if (params.length < 2) {
|
||||||
|
player.yellowMessage("Syntax: !timermap <seconds>|remove");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (params[1].equalsIgnoreCase("remove")) {
|
||||||
|
for (MapleCharacter victim : player.getMap().getCharacters()) {
|
||||||
|
victim.announce(MaplePacketCreator.removeClock());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
int seconds = Integer.parseInt(params[1]);
|
||||||
|
for (MapleCharacter victim : player.getMap().getCharacters()) {
|
||||||
|
victim.announce(MaplePacketCreator.getClock(seconds));
|
||||||
|
}
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
player.yellowMessage("Syntax: !timermap <seconds>|remove");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user