Commands overhaul + Selective loot + Antimulticlient Coordinator
Completely overhauled commands layout, each command splitted in Java classes. Optimized "ranks" command, no more calling the DB to get ranking info. Implemented a mechanic where mobs only spawns loots that are visible/collectable by the player's party. Implemented a server flag which sets whether explorers, cygnus and legends are allowed to share the cash shop inventory or not. Implemented support for dynamic server rates at bootup. Rates can now be assigned at the configuration.ini file. Devised the anti-multiclient login coordinator feature. Besides multiclient attempts by the same machine, it also prevents unauthorized login attempts into an account. Fixed PQ instances being forcefully closed even when party leader reassignment upon logout is available. Fixed mob statis not concurrently protected.
This commit is contained in:
53
src/client/command/Command.java
Normal file
53
src/client/command/Command.java
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command;
|
||||
|
||||
import client.MapleClient;
|
||||
|
||||
public abstract class Command {
|
||||
|
||||
protected String description;
|
||||
|
||||
public abstract void execute(MapleClient client, String[] params);
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
protected void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
protected String joinStringFrom(String arr[], int start) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (int i = start; i < arr.length; i++) {
|
||||
builder.append(arr[i]);
|
||||
if (i != arr.length - 1) {
|
||||
builder.append(" ");
|
||||
}
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
356
src/client/command/CommandsExecutor.java
Normal file
356
src/client/command/CommandsExecutor.java
Normal file
@@ -0,0 +1,356 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command;
|
||||
|
||||
import client.MapleClient;
|
||||
import client.command.commands.v0.*;
|
||||
import client.command.commands.v1.*;
|
||||
import client.command.commands.v2.*;
|
||||
import client.command.commands.v3.*;
|
||||
import client.command.commands.v4.*;
|
||||
import client.command.commands.v5.*;
|
||||
import client.command.commands.v6.*;
|
||||
import tools.FilePrinter;
|
||||
import tools.Pair;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class CommandsExecutor {
|
||||
|
||||
public static CommandsExecutor instance = new CommandsExecutor();
|
||||
|
||||
public static CommandsExecutor getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
private static final char USER_HEADING = '@';
|
||||
private static final char GM_HEADING = '!';
|
||||
|
||||
public static boolean isCommand(MapleClient client, String content){
|
||||
char heading = content.charAt(0);
|
||||
if (client.getPlayer().isGM()){
|
||||
return heading == USER_HEADING || heading == GM_HEADING;
|
||||
}
|
||||
return heading == USER_HEADING;
|
||||
}
|
||||
|
||||
private HashMap<String, RegisteredCommand> registeredCommands = new HashMap<>();
|
||||
private Pair<List<String>, List<String>> levelCommandsCursor;
|
||||
private List<Pair<List<String>, List<String>>> commandsNameDesc = new ArrayList<>();
|
||||
|
||||
private CommandsExecutor(){
|
||||
registerLv0Commands();
|
||||
registerLv1Commands();
|
||||
registerLv2Commands();
|
||||
registerLv3Commands();
|
||||
registerLv4Commands();
|
||||
registerLv5Commands();
|
||||
registerLv6Commands();
|
||||
}
|
||||
|
||||
public List<Pair<List<String>, List<String>>> getGmCommands() {
|
||||
return commandsNameDesc;
|
||||
}
|
||||
|
||||
public void handle(MapleClient client, String message){
|
||||
final String[] spitedMessage = message.toLowerCase().substring(1).split("[ ]");
|
||||
final String commandName = spitedMessage[0];
|
||||
final RegisteredCommand command = registeredCommands.get(commandName);
|
||||
if (command == null){
|
||||
client.getPlayer().yellowMessage("Command '" + commandName + "' is not available. See @commands for a list of available commands.");
|
||||
return;
|
||||
}
|
||||
if (client.getPlayer().gmLevel() < command.getRank()){
|
||||
client.getPlayer().yellowMessage("You not have permission to use this command.");
|
||||
return;
|
||||
}
|
||||
String[] params;
|
||||
if (spitedMessage.length > 1) {
|
||||
params = Arrays.copyOfRange(spitedMessage, 1, spitedMessage.length);
|
||||
} else {
|
||||
params = new String[]{};
|
||||
}
|
||||
try {
|
||||
Command commandInstance = command.getCommandClass().newInstance();
|
||||
commandInstance.execute(client, params);
|
||||
writeLog(client, message);
|
||||
} catch (InstantiationException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void writeLog(MapleClient client, String command){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy HH:mm");
|
||||
FilePrinter.print(FilePrinter.USED_COMMANDS, client.getPlayer().getName() + " used: " + command + " on "
|
||||
+ sdf.format(Calendar.getInstance().getTime()) + "\r\n");
|
||||
}
|
||||
|
||||
private void addCommandInfo(String name, Class<? extends Command> commandClass) {
|
||||
try {
|
||||
levelCommandsCursor.getRight().add(commandClass.newInstance().getDescription());
|
||||
levelCommandsCursor.getLeft().add(name);
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void addCommand(String[] syntaxs, Class<? extends Command> commandClass){
|
||||
for (String syntax : syntaxs){
|
||||
addCommand(syntax, 0, commandClass);
|
||||
}
|
||||
}
|
||||
private void addCommand(String syntax, Class<? extends Command> commandClass){
|
||||
//for (String syntax : syntaxs){
|
||||
addCommand(syntax, 0, commandClass);
|
||||
//}
|
||||
}
|
||||
|
||||
private void addCommand(String[] surtaxes, int rank, Class<? extends Command> commandClass){
|
||||
for (String syntax : surtaxes){
|
||||
addCommand(syntax, rank, commandClass);
|
||||
}
|
||||
}
|
||||
|
||||
private void addCommand(String syntax, int rank, Class<? extends Command> commandClass){
|
||||
if (registeredCommands.containsKey(syntax.toLowerCase())){
|
||||
System.out.println("Error on register command with name: " + syntax + ". Already exists.");
|
||||
return;
|
||||
}
|
||||
|
||||
RegisteredCommand registeredCommand = new RegisteredCommand(commandClass, rank);
|
||||
|
||||
String commandName = syntax.toLowerCase();
|
||||
addCommandInfo(commandName, commandClass);
|
||||
registeredCommands.put(commandName, registeredCommand);
|
||||
}
|
||||
|
||||
private void registerLv0Commands(){
|
||||
levelCommandsCursor = new Pair<>((List<String>) new ArrayList<String>(), (List<String>) new ArrayList<String>());
|
||||
|
||||
addCommand(new String[]{"help", "commands"}, HelpCommand.class);
|
||||
addCommand("droplimit", DropLimitCommand.class);
|
||||
addCommand("time", TimeCommand.class);
|
||||
addCommand("credits", StaffCommand.class);
|
||||
addCommand("uptime", UptimeCommand.class);
|
||||
addCommand("gacha", GachaCommand.class);
|
||||
addCommand("dispose", DisposeCommand.class);
|
||||
addCommand("equiplv", EquipLvCommand.class);
|
||||
addCommand("showrates", ShowRatesCommand.class);
|
||||
addCommand("rates", RatesCommand.class);
|
||||
addCommand("online", OnlineCommand.class);
|
||||
addCommand("gm", GmCommand.class);
|
||||
addCommand("reportbug", ReportBugCommand.class);
|
||||
//addCommand("points", "");
|
||||
addCommand("joinevent", JoinEventCommand.class);
|
||||
addCommand("leaveevent", LeaveEventCommand.class);
|
||||
addCommand("ranks", RanksCommand.class);
|
||||
addCommand("str", StatStrCommand.class);
|
||||
addCommand("dex", StatDexCommand.class);
|
||||
addCommand("int", StatIntCommand.class);
|
||||
addCommand("luk", StatLukCommand.class);
|
||||
|
||||
commandsNameDesc.add(levelCommandsCursor);
|
||||
}
|
||||
|
||||
|
||||
private void registerLv1Commands() {
|
||||
levelCommandsCursor = new Pair<>((List<String>) new ArrayList<String>(), (List<String>) new ArrayList<String>());
|
||||
|
||||
addCommand("bosshp", 1, BossHpCommand.class);
|
||||
addCommand("mobhp", 1, MobHpCommand.class);
|
||||
addCommand("whatdropsfrom", 1, WhatDropsFromCommand.class);
|
||||
addCommand("whodrops", 1, WhoDropsCommand.class);
|
||||
addCommand("buffme", 1, BuffMeCommand.class);
|
||||
addCommand("goto", 1, GotoCommand.class);
|
||||
|
||||
commandsNameDesc.add(levelCommandsCursor);
|
||||
}
|
||||
|
||||
|
||||
private void registerLv2Commands(){
|
||||
levelCommandsCursor = new Pair<>((List<String>) new ArrayList<String>(), (List<String>) new ArrayList<String>());
|
||||
|
||||
addCommand("recharge", 2, RechargeCommand.class);
|
||||
addCommand("whereami", 2, WhereaMiCommand.class);
|
||||
addCommand("hide", 2, HideCommand.class);
|
||||
addCommand("unhide", 2, UnHideCommand.class);
|
||||
addCommand("sp", 2, SpCommand.class);
|
||||
addCommand("ap", 2, ApCommand.class);
|
||||
addCommand("empowerme", 2, EmpowerMeCommand.class);
|
||||
addCommand("buffmap", 2, BuffMapCommand.class);
|
||||
addCommand("buff", 2, BuffCommand.class);
|
||||
addCommand("bomb", 2, BombCommand.class);
|
||||
addCommand("dc", 2, DcCommand.class);
|
||||
addCommand("cleardrops", 2, ClearDropsCommand.class);
|
||||
addCommand("clearslot", 2, ClearSlotCommand.class);
|
||||
addCommand("warp", 2, WarpCommand.class);
|
||||
addCommand("warpto", 2, WarpToCommand.class);
|
||||
addCommand(new String[]{"warphere", "summon"}, 2, SummonCommand.class);
|
||||
addCommand(new String[]{"reach", "follow"}, 2, ReachCommand.class);
|
||||
addCommand("gmshop", 2, GmShopCommand.class);
|
||||
addCommand("heal", 2, HealCommand.class);
|
||||
addCommand("item", 2, ItemCommand.class);
|
||||
addCommand("drop", 2, ItemDropCommand.class);
|
||||
addCommand("level", 2, LevelCommand.class);
|
||||
addCommand("levelpro", 2, LevelProCommand.class);
|
||||
addCommand("setstat", 2, SetStatCommand.class);
|
||||
addCommand("maxstat", 2, MaxStatCommand.class);
|
||||
addCommand("maxskill", 2, MaxSkillCommand.class);
|
||||
addCommand("resetskill", 2, ResetSkillCommand.class);
|
||||
addCommand("mesos", 2, MesosCommand.class);
|
||||
addCommand("search", 2, SearchCommand.class);
|
||||
addCommand("jail", 2, JailCommand.class);
|
||||
addCommand("unjail", 2, UnJailCommand.class);
|
||||
addCommand("job", 2, JobCommand.class);
|
||||
addCommand("unbug", 2, UnBugCommand.class);
|
||||
|
||||
commandsNameDesc.add(levelCommandsCursor);
|
||||
}
|
||||
|
||||
private void registerLv3Commands() {
|
||||
levelCommandsCursor = new Pair<>((List<String>) new ArrayList<String>(), (List<String>) new ArrayList<String>());
|
||||
|
||||
addCommand("debuff", 3, DebuffCommand.class);
|
||||
addCommand("fly", 3, FlyCommand.class);
|
||||
addCommand("spawn", 3, SpawnCommand.class);
|
||||
addCommand("mutemap", 3, MuteMapCommand.class);
|
||||
addCommand("checkdmg", 3, CheckDmgCommand.class);
|
||||
addCommand("inmap", 3, InMapCommand.class);
|
||||
addCommand("reloadevents", 3, ReloadEventsCommand.class);
|
||||
addCommand("reloaddrops", 3, ReloadDropsCommand.class);
|
||||
addCommand("reloadportals", 3, ReloadPortalsCommand.class);
|
||||
addCommand("reloadmap", 3, ReloadMapCommand.class);
|
||||
addCommand("reloadshops", 3, ReloadShopsCommand.class);
|
||||
addCommand("hpmp", 3, HpMpCommand.class);
|
||||
addCommand("maxhpmp", 3, MaxHpMpCommand.class);
|
||||
addCommand("music", 3, MusicCommand.class);
|
||||
addCommand("monitor", 3, MonitorCommand.class);
|
||||
addCommand("monitors", 3, MonitorsCommand.class);
|
||||
addCommand("ignore", 3, IgnoreCommand.class);
|
||||
addCommand("ignored", 3, IgnoredCommand.class);
|
||||
addCommand("pos", 3, PosCommand.class);
|
||||
addCommand("togglecoupon", 3, ToggleCouponCommand.class);
|
||||
addCommand("chat", 3, ChatCommand.class);
|
||||
addCommand("fame", 3, FameCommand.class);
|
||||
addCommand("givenx", 3, GiveNxCommand.class);
|
||||
addCommand("givevp", 3, GiveVpCommand.class);
|
||||
addCommand("givems", 3, GiveMesosCommand.class);
|
||||
addCommand("id", 3, IdCommand.class);
|
||||
addCommand("expeds", 3, ExpedsCommand.class);
|
||||
addCommand("kill", 3, KillCommand.class);
|
||||
addCommand("seed", 3, SeedCommand.class);
|
||||
addCommand("maxenergy", 3, MaxEnergyCommand.class);
|
||||
addCommand("killall", 3, KillAllCommand.class);
|
||||
addCommand("notice", 3, NoticeCommand.class);
|
||||
addCommand("rip", 3, RipCommand.class);
|
||||
addCommand("openportal", 3, OpenPortalCommand.class);
|
||||
addCommand("closeportal", 3, ClosePortalCommand.class);
|
||||
addCommand("pe", 3, PeCommand.class);
|
||||
addCommand("startevent", 3, StartEventCommand.class);
|
||||
addCommand("endevent", 3, EndEventCommand.class);
|
||||
addCommand("online2", 3, OnlineTwoCommand.class);
|
||||
addCommand("warpsnowball", 3, WarpSnowBallCommand.class);
|
||||
addCommand("ban", 3, BanCommand.class);
|
||||
addCommand("unban", 3, UnBanCommand.class);
|
||||
addCommand("healmap", 3, HealMapCommand.class);
|
||||
addCommand("healperson", 3, HealPersonCommand.class);
|
||||
addCommand("hurt", 3, HurtCommand.class);
|
||||
addCommand("killmap", 3, KillMapCommand.class);
|
||||
addCommand("night", 3, NightCommand.class);
|
||||
addCommand("npc", 3, NpcCommand.class);
|
||||
addCommand("face", 3, FaceCommand.class);
|
||||
addCommand("hair", 3, HairCommand.class);
|
||||
addCommand("startquest", 3, QuestStartCommand.class);
|
||||
addCommand("completequest", 3, QuestCompleteCommand.class);
|
||||
addCommand("resetquest", 3, QuestResetCommand.class);
|
||||
|
||||
commandsNameDesc.add(levelCommandsCursor);
|
||||
}
|
||||
|
||||
private void registerLv4Commands(){
|
||||
levelCommandsCursor = new Pair<>((List<String>) new ArrayList<String>(), (List<String>) new ArrayList<String>());
|
||||
|
||||
addCommand("servermessage", 4, ServerMessageCommand.class);
|
||||
addCommand("proitem", 4, ProItemCommand.class);
|
||||
addCommand("seteqstat", 4, SetQStatCommand.class);
|
||||
addCommand("exprate", 4, ExpRateCommand.class);
|
||||
addCommand("mesorate", 4, MesoRateCommand.class);
|
||||
addCommand("droprate", 4, DropRateCommand.class);
|
||||
addCommand("questrate", 4, QuestRateCommand.class);
|
||||
addCommand("travelrate", 4, TravelRateCommand.class);
|
||||
addCommand("itemvac", 4, ItemVacCommand.class);
|
||||
addCommand("forcevac", 4, ForceVacCommand.class);
|
||||
addCommand("zakum", 4, ZakumCommand.class);
|
||||
addCommand("horntail", 4, HorntailCommand.class);
|
||||
addCommand("pinkbean", 4, PinkbeanCommand.class);
|
||||
addCommand("pap", 4, PapCommand.class);
|
||||
addCommand("pianus", 4, PianusCommand.class);
|
||||
addCommand("cake", 4, CakeCommand.class);
|
||||
addCommand("playernpcremove", 4, PlayerNpcRemoveCommand.class);
|
||||
addCommand("playernpc", 4, PlayerNpcCommand.class);
|
||||
|
||||
commandsNameDesc.add(levelCommandsCursor);
|
||||
}
|
||||
|
||||
private void registerLv5Commands(){
|
||||
levelCommandsCursor = new Pair<>((List<String>) new ArrayList<String>(), (List<String>) new ArrayList<String>());
|
||||
|
||||
addCommand("debug", 5, DebugCommand.class);
|
||||
addCommand("set", 5, SetCommand.class);
|
||||
addCommand("showpackets", 5, ShowPacketsCommand.class);
|
||||
|
||||
commandsNameDesc.add(levelCommandsCursor);
|
||||
}
|
||||
|
||||
private void registerLv6Commands(){
|
||||
levelCommandsCursor = new Pair<>((List<String>) new ArrayList<String>(), (List<String>) new ArrayList<String>());
|
||||
|
||||
addCommand("setgmlevel", 6, SetGmLevelCommand.class);
|
||||
addCommand("warpworld", 6, WarpWorldCommand.class);
|
||||
addCommand("saveall", 6, SaveAllCommand.class);
|
||||
addCommand("dcall", 6, DCAllCommand.class);
|
||||
addCommand("mapplayers", 6, MapPlayersCommand.class);
|
||||
addCommand("getacc", 6, GetAccCommand.class);
|
||||
addCommand("shutdown", 6, ShutdownCommand.class);
|
||||
addCommand("clearquestcache", 6, ClearQuestCacheCommand.class);
|
||||
addCommand("clearquest", 6, ClearQuestCommand.class);
|
||||
addCommand("spawnallpnpcs", 6, SpawnAllPNpcsCommand.class);
|
||||
addCommand("eraseallpnpcs", 6, EraseAllPNpcsCommand.class);
|
||||
addCommand("addchannel", 6, ServerAddChannelCommand.class);
|
||||
addCommand("addworld", 6, ServerAddWorldCommand.class);
|
||||
addCommand("removechannel", 6, ServerRemoveChannelCommand.class);
|
||||
addCommand("removeworld", 6, ServerRemoveWorldCommand.class);
|
||||
|
||||
commandsNameDesc.add(levelCommandsCursor);
|
||||
}
|
||||
|
||||
}
|
||||
43
src/client/command/RegisteredCommand.java
Normal file
43
src/client/command/RegisteredCommand.java
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command;
|
||||
|
||||
class RegisteredCommand {
|
||||
|
||||
private final Class<? extends Command> commandClass;
|
||||
private final int rank;
|
||||
|
||||
RegisteredCommand(Class<? extends Command> commandClass, int rank){
|
||||
this.commandClass = commandClass;
|
||||
this.rank = rank;
|
||||
}
|
||||
|
||||
public Class<? extends Command> getCommandClass() {
|
||||
return commandClass;
|
||||
}
|
||||
|
||||
public int getRank() {
|
||||
return rank;
|
||||
}
|
||||
}
|
||||
35
src/client/command/commands/v0/BuyBackCommand.java
Normal file
35
src/client/command/commands/v0/BuyBackCommand.java
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v0;
|
||||
|
||||
import client.MapleClient;
|
||||
import client.command.Command;
|
||||
import client.processor.BuybackProcessor;
|
||||
|
||||
public class BuyBackCommand extends Command {
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
BuybackProcessor.processBuyback(c);
|
||||
}
|
||||
}
|
||||
43
src/client/command/commands/v0/DisposeCommand.java
Normal file
43
src/client/command/commands/v0/DisposeCommand.java
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v0;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import scripting.npc.NPCScriptManager;
|
||||
import tools.MaplePacketCreator;
|
||||
|
||||
public class DisposeCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
NPCScriptManager.getInstance().dispose(c);
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
c.removeClickedNPC();
|
||||
c.getPlayer().message("You've been disposed.");
|
||||
}
|
||||
}
|
||||
45
src/client/command/commands/v0/DropLimitCommand.java
Normal file
45
src/client/command/commands/v0/DropLimitCommand.java
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v0;
|
||||
|
||||
import client.MapleClient;
|
||||
import client.command.Command;
|
||||
import constants.ServerConstants;
|
||||
|
||||
public class DropLimitCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
int dropCount = c.getPlayer().getMap().getDroppedItemCount();
|
||||
if(((float) dropCount) / ServerConstants.ITEM_LIMIT_ON_MAP < 0.75f) {
|
||||
c.getPlayer().showHint("Current drop count: #b" + dropCount + "#k / #e" + ServerConstants.ITEM_LIMIT_ON_MAP + "#n", 300);
|
||||
} else {
|
||||
c.getPlayer().showHint("Current drop count: #r" + dropCount + "#k / #e" + ServerConstants.ITEM_LIMIT_ON_MAP + "#n", 300);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
38
src/client/command/commands/v0/EquipLvCommand.java
Normal file
38
src/client/command/commands/v0/EquipLvCommand.java
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v0;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
|
||||
public class EquipLvCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
c.getPlayer().showAllEquipFeatures();
|
||||
}
|
||||
}
|
||||
66
src/client/command/commands/v0/GachaCommand.java
Normal file
66
src/client/command/commands/v0/GachaCommand.java
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v0;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.gachapon.MapleGachapon;
|
||||
import tools.MaplePacketCreator;
|
||||
|
||||
public class GachaCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleGachapon.Gachapon gacha = null;
|
||||
String search = joinStringFrom(params,0);
|
||||
String gachaName = "";
|
||||
String [] names = {"Henesys", "Ellinia", "Perion", "Kerning City", "Sleepywood", "Mushroom Shrine", "Showa Spa Male", "Showa Spa Female", "New Leaf City", "Nautilus Harbor"};
|
||||
int [] ids = {9100100, 9100101, 9100102, 9100103, 9100104, 9100105, 9100106, 9100107, 9100109, 9100117};
|
||||
for (int i = 0; i < names.length; i++){
|
||||
if (search.equalsIgnoreCase(names[i])){
|
||||
gachaName = names[i];
|
||||
gacha = MapleGachapon.Gachapon.getByNpcId(ids[i]);
|
||||
}
|
||||
}
|
||||
if (gacha == null){
|
||||
c.getPlayer().yellowMessage("Please use @gacha <name> where name corresponds to one of the below:");
|
||||
for (String name : names){
|
||||
c.getPlayer().yellowMessage(name);
|
||||
}
|
||||
return;
|
||||
}
|
||||
String talkStr = "The #b" + gachaName + "#k Gachapon contains the following items.\r\n\r\n";
|
||||
for (int i = 0; i < 2; i++){
|
||||
for (int id : gacha.getItems(i)){
|
||||
talkStr += "-" + MapleItemInformationProvider.getInstance().getName(id) + "\r\n";
|
||||
}
|
||||
}
|
||||
talkStr += "\r\nPlease keep in mind that there are items that are in all gachapons and are not listed here.";
|
||||
c.announce(MaplePacketCreator.getNPCTalk(9010000, (byte) 0, talkStr, "00 00", (byte) 0));
|
||||
}
|
||||
}
|
||||
60
src/client/command/commands/v0/GmCommand.java
Normal file
60
src/client/command/commands/v0/GmCommand.java
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v0;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import net.server.Server;
|
||||
import tools.FilePrinter;
|
||||
import tools.MaplePacketCreator;
|
||||
import tools.Randomizer;
|
||||
|
||||
public class GmCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
String[] tips = {
|
||||
"Please only use @gm in emergencies or to report somebody.",
|
||||
"To report a bug or make a suggestion, use the forum.",
|
||||
"Please do not use @gm to ask if a GM is online.",
|
||||
"Do not ask if you can receive help, just state your issue.",
|
||||
"Do not say 'I have a bug to report', just state it.",
|
||||
};
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params[0].length() < 3) { // #goodbye 'hi'
|
||||
player.dropMessage(5, "Your message was too short. Please provide as much detail as possible.");
|
||||
return;
|
||||
}
|
||||
String message = joinStringFrom(params, 0);
|
||||
Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.sendYellowTip("[GM MESSAGE]:" + MapleCharacter.makeMapleReadable(player.getName()) + ": " + message));
|
||||
Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.serverNotice(1, message));
|
||||
FilePrinter.printError("gm.txt", MapleCharacter.makeMapleReadable(player.getName()) + ": " + message + "\r\n");
|
||||
player.dropMessage(5, "Your message '" + message + "' was sent to GMs.");
|
||||
player.dropMessage(5, tips[Randomizer.nextInt(tips.length)]);
|
||||
}
|
||||
}
|
||||
38
src/client/command/commands/v0/HelpCommand.java
Normal file
38
src/client/command/commands/v0/HelpCommand.java
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v0;
|
||||
|
||||
import client.MapleClient;
|
||||
import client.command.Command;
|
||||
|
||||
public class HelpCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient client, String[] params) {
|
||||
client.getAbstractPlayerInteraction().openNpc(9201143, "commands");
|
||||
}
|
||||
}
|
||||
66
src/client/command/commands/v0/JoinEventCommand.java
Normal file
66
src/client/command/commands/v0/JoinEventCommand.java
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v0;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import server.events.gm.MapleEvent;
|
||||
import server.maps.FieldLimit;
|
||||
|
||||
public class JoinEventCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if(!FieldLimit.CANNOTMIGRATE.check(player.getMap().getFieldLimit())) {
|
||||
MapleEvent event = c.getChannelServer().getEvent();
|
||||
if(event != null) {
|
||||
if(event.getMapId() != player.getMapId()) {
|
||||
if(event.getLimit() > 0) {
|
||||
player.saveLocation("EVENT");
|
||||
|
||||
if(event.getMapId() == 109080000 || event.getMapId() == 109060001)
|
||||
player.setTeam(event.getLimit() % 2);
|
||||
|
||||
event.minusLimit();
|
||||
|
||||
player.changeMap(event.getMapId());
|
||||
} else {
|
||||
player.dropMessage(5, "The limit of players for the event has already been reached.");
|
||||
}
|
||||
} else {
|
||||
player.dropMessage(5, "You are already in the event.");
|
||||
}
|
||||
} else {
|
||||
player.dropMessage(5, "There is currently no event in progress.");
|
||||
}
|
||||
} else {
|
||||
player.dropMessage(5, "You are currently in a map where you can't join an event.");
|
||||
}
|
||||
}
|
||||
}
|
||||
58
src/client/command/commands/v0/LeaveEventCommand.java
Normal file
58
src/client/command/commands/v0/LeaveEventCommand.java
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v0;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
|
||||
public class LeaveEventCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
int returnMap = player.getSavedLocation("EVENT");
|
||||
if(returnMap != -1) {
|
||||
if(player.getOla() != null) {
|
||||
player.getOla().resetTimes();
|
||||
player.setOla(null);
|
||||
}
|
||||
if(player.getFitness() != null) {
|
||||
player.getFitness().resetTimes();
|
||||
player.setFitness(null);
|
||||
}
|
||||
|
||||
player.changeMap(returnMap);
|
||||
if(c.getChannelServer().getEvent() != null) {
|
||||
c.getChannelServer().getEvent().addLimit();
|
||||
}
|
||||
} else {
|
||||
player.dropMessage(5, "You are not currently in an event.");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
49
src/client/command/commands/v0/OnlineCommand.java
Normal file
49
src/client/command/commands/v0/OnlineCommand.java
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v0;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import net.server.Server;
|
||||
import net.server.channel.Channel;
|
||||
|
||||
public class OnlineCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
for (Channel ch : Server.getInstance().getChannelsFromWorld(player.getWorld())) {
|
||||
player.yellowMessage("Players in Channel " + ch.getId() + ":");
|
||||
for (MapleCharacter chr : ch.getPlayerStorage().getAllCharacters()) {
|
||||
if (!chr.isGM()) {
|
||||
player.message(" >> " + MapleCharacter.makeMapleReadable(chr.getName()) + " is at " + chr.getMap().getMapName() + ".");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
47
src/client/command/commands/v0/RanksCommand.java
Normal file
47
src/client/command/commands/v0/RanksCommand.java
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v0;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import net.server.Server;
|
||||
import tools.MaplePacketCreator;
|
||||
|
||||
import java.util.List;
|
||||
import tools.Pair;
|
||||
|
||||
public class RanksCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
|
||||
List<Pair<String, Integer>> worldRanking = Server.getInstance().getWorldPlayerRanking(player.getWorld());
|
||||
player.announce(MaplePacketCreator.showPlayerRanks(9010000, worldRanking));
|
||||
}
|
||||
}
|
||||
49
src/client/command/commands/v0/RatesCommand.java
Normal file
49
src/client/command/commands/v0/RatesCommand.java
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v0;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import constants.ServerConstants;
|
||||
|
||||
public class RatesCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
|
||||
// travel rates not applicable since it's intrinsically a server/environment rate rather than a character rate
|
||||
String showMsg_ = "#eCHARACTER RATES#n" + "\r\n\r\n";
|
||||
showMsg_ += "EXP Rate: #e#b" + player.getExpRate() + "x#k#n" + "\r\n";
|
||||
showMsg_ += "MESO Rate: #e#b" + player.getMesoRate() + "x#k#n" + "\r\n";
|
||||
showMsg_ += "DROP Rate: #e#b" + player.getDropRate() + "x#k#n" + "\r\n";
|
||||
if(ServerConstants.USE_QUEST_RATE) showMsg_ += "QUEST Rate: #e#b" + c.getWorldServer().getQuestRate() + "x#k#n" + "\r\n";
|
||||
|
||||
player.showHint(showMsg_, 300);
|
||||
}
|
||||
}
|
||||
53
src/client/command/commands/v0/ReportBugCommand.java
Normal file
53
src/client/command/commands/v0/ReportBugCommand.java
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v0;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import net.server.Server;
|
||||
import tools.FilePrinter;
|
||||
import tools.MaplePacketCreator;
|
||||
|
||||
public class ReportBugCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
|
||||
if (params.length < 1) {
|
||||
player.dropMessage(5, "Message too short and not sent. Please do @bug <bug>");
|
||||
return;
|
||||
}
|
||||
String message = joinStringFrom(params, 0);
|
||||
Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.sendYellowTip("[BUG]:" + MapleCharacter.makeMapleReadable(player.getName()) + ": " + message));
|
||||
Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.serverNotice(1, message));
|
||||
FilePrinter.printError("bug.txt", MapleCharacter.makeMapleReadable(player.getName()) + ": " + message + "\r\n");
|
||||
player.dropMessage(5, "Your bug '" + message + "' was submitted successfully to our developers. Thank you!");
|
||||
|
||||
}
|
||||
}
|
||||
67
src/client/command/commands/v0/ShowRatesCommand.java
Normal file
67
src/client/command/commands/v0/ShowRatesCommand.java
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v0;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import constants.ServerConstants;
|
||||
|
||||
public class ShowRatesCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
String showMsg = "#eEXP RATE#n" + "\r\n";
|
||||
showMsg += "Server EXP Rate: #k" + c.getWorldServer().getExpRate() + "x#k" + "\r\n";
|
||||
showMsg += "Player EXP Rate: #k" + player.getRawExpRate() + "x#k" + "\r\n";
|
||||
if(player.getCouponExpRate() != 1) showMsg += "Coupon EXP Rate: #k" + player.getCouponExpRate() + "x#k" + "\r\n";
|
||||
showMsg += "EXP Rate: #e#b" + player.getExpRate() + "x#k#n" + "\r\n";
|
||||
|
||||
showMsg += "\r\n" + "#eMESO RATE#n" + "\r\n";
|
||||
showMsg += "Server MESO Rate: #k" + c.getWorldServer().getMesoRate() + "x#k" + "\r\n";
|
||||
showMsg += "Player MESO Rate: #k" + player.getRawMesoRate() + "x#k" + "\r\n";
|
||||
if(player.getCouponMesoRate() != 1) showMsg += "Coupon MESO Rate: #k" + player.getCouponMesoRate() + "x#k" + "\r\n";
|
||||
showMsg += "MESO Rate: #e#b" + player.getMesoRate() + "x#k#n" + "\r\n";
|
||||
|
||||
showMsg += "\r\n" + "#eDROP RATE#n" + "\r\n";
|
||||
showMsg += "Server DROP Rate: #k" + c.getWorldServer().getDropRate() + "x#k" + "\r\n";
|
||||
showMsg += "Player DROP Rate: #k" + player.getRawDropRate() + "x#k" + "\r\n";
|
||||
if(player.getCouponDropRate() != 1) showMsg += "Coupon DROP Rate: #k" + player.getCouponDropRate() + "x#k" + "\r\n";
|
||||
showMsg += "DROP Rate: #e#b" + player.getDropRate() + "x#k#n" + "\r\n";
|
||||
|
||||
if(ServerConstants.USE_QUEST_RATE) {
|
||||
showMsg += "\r\n" + "#eQUEST RATE#n" + "\r\n";
|
||||
showMsg += "Server QUEST Rate: #e#b" + c.getWorldServer().getQuestRate() + "x#k#n" + "\r\n";
|
||||
}
|
||||
|
||||
showMsg += "\r\n" + "#eTRAVEL RATE#n" + "\r\n";
|
||||
showMsg += "Server TRAVEL Rate: #e#b" + c.getWorldServer().getTravelRate() + "x#k#n" + "\r\n";
|
||||
|
||||
player.showHint(showMsg, 300);
|
||||
}
|
||||
}
|
||||
38
src/client/command/commands/v0/StaffCommand.java
Normal file
38
src/client/command/commands/v0/StaffCommand.java
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v0;
|
||||
|
||||
import client.MapleClient;
|
||||
import client.command.Command;
|
||||
|
||||
public class StaffCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
c.getAbstractPlayerInteraction().openNpc(2010007, "credits");
|
||||
}
|
||||
}
|
||||
57
src/client/command/commands/v0/StatDexCommand.java
Normal file
57
src/client/command/commands/v0/StatDexCommand.java
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v0;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import client.MapleStat;
|
||||
import client.command.Command;
|
||||
|
||||
public class StatDexCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
int remainingAp = player.getRemainingAp();
|
||||
|
||||
int amount = (params.length > 0) ? Math.min(Integer.parseInt(params[0]), remainingAp) : remainingAp;
|
||||
if (amount > 0 && amount <= remainingAp && amount <= 32763) {
|
||||
int playerStat = player.getDex();
|
||||
|
||||
if (amount + playerStat <= 32767 && amount + playerStat >= 4) {
|
||||
player.setDex(playerStat + amount);
|
||||
player.updateSingleStat(MapleStat.DEX, playerStat);
|
||||
player.setRemainingAp(remainingAp - amount);
|
||||
player.updateSingleStat(MapleStat.AVAILABLEAP, remainingAp);
|
||||
} else {
|
||||
player.dropMessage("Please make sure the stat you are trying to raise is not over 32,767 or under 4.");
|
||||
}
|
||||
} else {
|
||||
player.dropMessage("Please make sure your AP is not over 32,767 and you have enough to distribute.");
|
||||
}
|
||||
}
|
||||
}
|
||||
57
src/client/command/commands/v0/StatIntCommand.java
Normal file
57
src/client/command/commands/v0/StatIntCommand.java
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v0;
|
||||
|
||||
import client.MapleStat;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class StatIntCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
int remainingAp = player.getRemainingAp();
|
||||
|
||||
int amount = (params.length > 0) ? Math.min(Integer.parseInt(params[0]), remainingAp) : remainingAp;
|
||||
if (amount > 0 && amount <= remainingAp && amount <= 32763) {
|
||||
int playerStat = player.getInt();
|
||||
|
||||
if (amount + playerStat <= 32767 && amount + playerStat >= 4) {
|
||||
player.setInt(playerStat + amount);
|
||||
player.updateSingleStat(MapleStat.INT, playerStat);
|
||||
player.setRemainingAp(remainingAp - amount);
|
||||
player.updateSingleStat(MapleStat.AVAILABLEAP, remainingAp);
|
||||
} else {
|
||||
player.dropMessage("Please make sure the stat you are trying to raise is not over 32,767 or under 4.");
|
||||
}
|
||||
} else {
|
||||
player.dropMessage("Please make sure your AP is not over 32,767 and you have enough to distribute.");
|
||||
}
|
||||
}
|
||||
}
|
||||
57
src/client/command/commands/v0/StatLukCommand.java
Normal file
57
src/client/command/commands/v0/StatLukCommand.java
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v0;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import client.MapleStat;
|
||||
import client.command.Command;
|
||||
|
||||
public class StatLukCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
int remainingAp = player.getRemainingAp();
|
||||
|
||||
int amount = (params.length > 0) ? Math.min(Integer.parseInt(params[0]), remainingAp) : remainingAp;
|
||||
if (amount > 0 && amount <= remainingAp && amount <= 32763) {
|
||||
int playerStat = player.getLuk();
|
||||
|
||||
if (amount + playerStat <= 32767 && amount + playerStat >= 4) {
|
||||
player.setLuk(playerStat + amount);
|
||||
player.updateSingleStat(MapleStat.LUK, playerStat);
|
||||
player.setRemainingAp(remainingAp - amount);
|
||||
player.updateSingleStat(MapleStat.AVAILABLEAP, remainingAp);
|
||||
} else {
|
||||
player.dropMessage("Please make sure the stat you are trying to raise is not over 32,767 or under 4.");
|
||||
}
|
||||
} else {
|
||||
player.dropMessage("Please make sure your AP is not over 32,767 and you have enough to distribute.");
|
||||
}
|
||||
}
|
||||
}
|
||||
57
src/client/command/commands/v0/StatStrCommand.java
Normal file
57
src/client/command/commands/v0/StatStrCommand.java
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v0;
|
||||
|
||||
import client.MapleStat;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class StatStrCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
int remainingAp = player.getRemainingAp();
|
||||
|
||||
int amount = (params.length > 0) ? Math.min(Integer.parseInt(params[0]), remainingAp) : remainingAp;
|
||||
if (amount > 0 && amount <= remainingAp && amount <= 32763) {
|
||||
int playerStat = player.getStr();
|
||||
|
||||
if (amount + playerStat <= 32767 && amount + playerStat >= 4) {
|
||||
player.setStr(playerStat + amount);
|
||||
player.updateSingleStat(MapleStat.STR, playerStat);
|
||||
player.setRemainingAp(remainingAp - amount);
|
||||
player.updateSingleStat(MapleStat.AVAILABLEAP, remainingAp);
|
||||
} else {
|
||||
player.dropMessage("Please make sure the stat you are trying to raise is not over 32,767 or under 4.");
|
||||
}
|
||||
} else {
|
||||
player.dropMessage("Please make sure your AP is not over 32,767 and you have enough to distribute.");
|
||||
}
|
||||
}
|
||||
}
|
||||
46
src/client/command/commands/v0/TimeCommand.java
Normal file
46
src/client/command/commands/v0/TimeCommand.java
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v0;
|
||||
|
||||
import client.MapleClient;
|
||||
import client.command.Command;
|
||||
import constants.ServerConstants;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.TimeZone;
|
||||
|
||||
public class TimeCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient client, String[] params) {
|
||||
DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
|
||||
dateFormat.setTimeZone(TimeZone.getTimeZone(ServerConstants.TIMEZONE));
|
||||
client.getPlayer().yellowMessage("HeavenMS Server Time: " + dateFormat.format(new Date()));
|
||||
}
|
||||
}
|
||||
44
src/client/command/commands/v0/UptimeCommand.java
Normal file
44
src/client/command/commands/v0/UptimeCommand.java
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v0;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import net.server.Server;
|
||||
|
||||
public class UptimeCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
long milliseconds = System.currentTimeMillis() - Server.uptime;
|
||||
int seconds = (int) (milliseconds / 1000) % 60 ;
|
||||
int minutes = (int) ((milliseconds / (1000*60)) % 60);
|
||||
int hours = (int) ((milliseconds / (1000*60*60)) % 24);
|
||||
int days = (int) ((milliseconds / (1000*60*60*24)));
|
||||
c.getPlayer().yellowMessage("Server has been online for " + days + " days " + hours + " hours " + minutes + " minutes and " + seconds + " seconds.");
|
||||
}
|
||||
}
|
||||
52
src/client/command/commands/v1/BossHpCommand.java
Normal file
52
src/client/command/commands/v1/BossHpCommand.java
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v1;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import server.life.MapleMonster;
|
||||
|
||||
public class BossHpCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
for(MapleMonster monster : player.getMap().getMonsters()) {
|
||||
if(monster != null && monster.isBoss() && monster.getHp() > 0) {
|
||||
long percent = monster.getHp() * 100L / monster.getMaxHp();
|
||||
String bar = "[";
|
||||
for (int i = 0; i < 100; i++){
|
||||
bar += i < percent ? "|" : ".";
|
||||
}
|
||||
bar += "]";
|
||||
player.yellowMessage(monster.getName() + " (" + monster.getId() + ") has " + percent + "% HP left.");
|
||||
player.yellowMessage("HP: " + bar);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
50
src/client/command/commands/v1/BuffMeCommand.java
Normal file
50
src/client/command/commands/v1/BuffMeCommand.java
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v1;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.MapleStat;
|
||||
import client.SkillFactory;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
|
||||
public class BuffMeCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
SkillFactory.getSkill(4101004).getEffect(SkillFactory.getSkill(4101004).getMaxLevel()).applyTo(player);
|
||||
SkillFactory.getSkill(2311003).getEffect(SkillFactory.getSkill(2311003).getMaxLevel()).applyTo(player);
|
||||
SkillFactory.getSkill(1301007).getEffect(SkillFactory.getSkill(1301007).getMaxLevel()).applyTo(player);
|
||||
SkillFactory.getSkill(2301004).getEffect(SkillFactory.getSkill(2301004).getMaxLevel()).applyTo(player);
|
||||
SkillFactory.getSkill(1005).getEffect(SkillFactory.getSkill(1005).getMaxLevel()).applyTo(player);
|
||||
player.setHp(player.getMaxHp());
|
||||
player.updateSingleStat(MapleStat.HP, player.getMaxHp());
|
||||
player.setMp(player.getMaxMp());
|
||||
player.updateSingleStat(MapleStat.MP, player.getMaxMp());
|
||||
}
|
||||
}
|
||||
108
src/client/command/commands/v1/GotoCommand.java
Normal file
108
src/client/command/commands/v1/GotoCommand.java
Normal file
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v1;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import server.MaplePortal;
|
||||
import server.maps.MapleMap;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class GotoCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
final HashMap<String, Integer> gotomaps = new HashMap<String, Integer>();
|
||||
gotomaps.put("gmmap", 180000000);
|
||||
gotomaps.put("southperry", 60000);
|
||||
gotomaps.put("amherst", 1000000);
|
||||
gotomaps.put("henesys", 100000000);
|
||||
gotomaps.put("ellinia", 101000000);
|
||||
gotomaps.put("perion", 102000000);
|
||||
gotomaps.put("kerning", 103000000);
|
||||
gotomaps.put("lith", 104000000);
|
||||
gotomaps.put("sleepywood", 105040300);
|
||||
gotomaps.put("florina", 110000000);
|
||||
gotomaps.put("nautilus", 120000000);
|
||||
gotomaps.put("ereve", 130000000);
|
||||
gotomaps.put("rien", 140000000);
|
||||
gotomaps.put("orbis", 200000000);
|
||||
gotomaps.put("happy", 209000000);
|
||||
gotomaps.put("elnath", 211000000);
|
||||
gotomaps.put("ludi", 220000000);
|
||||
gotomaps.put("aqua", 230000000);
|
||||
gotomaps.put("leafre", 240000000);
|
||||
gotomaps.put("mulung", 250000000);
|
||||
gotomaps.put("herb", 251000000);
|
||||
gotomaps.put("omega", 221000000);
|
||||
gotomaps.put("korean", 222000000);
|
||||
gotomaps.put("ellin", 300000000);
|
||||
gotomaps.put("nlc", 600000000);
|
||||
gotomaps.put("excavation", 990000000);
|
||||
gotomaps.put("pianus", 230040420);
|
||||
gotomaps.put("horntail", 240060200);
|
||||
gotomaps.put("mushmom", 100000005);
|
||||
gotomaps.put("griffey", 240020101);
|
||||
gotomaps.put("manon", 240020401);
|
||||
gotomaps.put("horseman", 682000001);
|
||||
gotomaps.put("balrog", 105090900);
|
||||
gotomaps.put("zakum", 211042300);
|
||||
gotomaps.put("papu", 220080001);
|
||||
gotomaps.put("showa", 801000000);
|
||||
gotomaps.put("guild", 200000301);
|
||||
gotomaps.put("shrine", 800000000);
|
||||
gotomaps.put("skelegon", 240040511);
|
||||
gotomaps.put("hpq", 100000200);
|
||||
gotomaps.put("ht", 240050400);
|
||||
gotomaps.put("ariant", 260000000);
|
||||
gotomaps.put("magatia", 261000000);
|
||||
gotomaps.put("singapore", 540000000);
|
||||
gotomaps.put("keep", 610020006);
|
||||
gotomaps.put("amoria", 680000000);
|
||||
gotomaps.put("temple", 270000100);
|
||||
gotomaps.put("neo", 240070000);
|
||||
gotomaps.put("fm", 910000000);
|
||||
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1){
|
||||
player.yellowMessage("Syntax: @goto <map name>");
|
||||
return;
|
||||
}
|
||||
if (gotomaps.containsKey(params[0])) {
|
||||
MapleMap target = c.getChannelServer().getMapFactory().getMap(gotomaps.get(params[0]));
|
||||
MaplePortal targetPortal = target.getPortal(0);
|
||||
if (player.getEventInstance() != null) {
|
||||
player.getEventInstance().removePlayer(player);
|
||||
}
|
||||
player.changeMap(target, targetPortal);
|
||||
} else {
|
||||
player.dropMessage(5, "That map does not exist.");
|
||||
}
|
||||
}
|
||||
}
|
||||
46
src/client/command/commands/v1/MobHpCommand.java
Normal file
46
src/client/command/commands/v1/MobHpCommand.java
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v1;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import server.life.MapleMonster;
|
||||
|
||||
public class MobHpCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
for(MapleMonster monster : player.getMap().getMonsters()) {
|
||||
if (monster != null && monster.getHp() > 0) {
|
||||
player.yellowMessage(monster.getName() + " (" + monster.getId() + ") has " + monster.getHp() + " / " + monster.getMaxHp() + " HP.");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
77
src/client/command/commands/v1/WhatDropsFromCommand.java
Normal file
77
src/client/command/commands/v1/WhatDropsFromCommand.java
Normal file
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v1;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.life.MapleMonsterInformationProvider;
|
||||
import server.life.MonsterDropEntry;
|
||||
import tools.MaplePacketCreator;
|
||||
import tools.Pair;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
public class WhatDropsFromCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.dropMessage(5, "Please do @whatdropsfrom <monster name>");
|
||||
return;
|
||||
}
|
||||
String monsterName = joinStringFrom(params, 0);
|
||||
String output = "";
|
||||
int limit = 3;
|
||||
Iterator<Pair<Integer, String>> listIterator = MapleMonsterInformationProvider.getMobsIDsFromName(monsterName).iterator();
|
||||
for (int i = 0; i < limit; i++) {
|
||||
if(listIterator.hasNext()) {
|
||||
Pair<Integer, String> data = listIterator.next();
|
||||
int mobId = data.getLeft();
|
||||
String mobName = data.getRight();
|
||||
output += mobName + " drops the following items:\r\n\r\n";
|
||||
for (MonsterDropEntry drop : MapleMonsterInformationProvider.getInstance().retrieveDrop(mobId)){
|
||||
try {
|
||||
String name = MapleItemInformationProvider.getInstance().getName(drop.itemId);
|
||||
if (name.equals("null") || drop.chance == 0){
|
||||
continue;
|
||||
}
|
||||
float chance = 1000000 / drop.chance / player.getDropRate();
|
||||
output += "- " + name + " (1/" + (int) chance + ")\r\n";
|
||||
} catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
output += "\r\n";
|
||||
}
|
||||
}
|
||||
c.announce(MaplePacketCreator.getNPCTalk(9010000, (byte) 0, output, "00 00", (byte) 0));
|
||||
}
|
||||
}
|
||||
88
src/client/command/commands/v1/WhoDropsCommand.java
Normal file
88
src/client/command/commands/v1/WhoDropsCommand.java
Normal file
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v1;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.life.MapleMonsterInformationProvider;
|
||||
import tools.DatabaseConnection;
|
||||
import tools.MaplePacketCreator;
|
||||
import tools.Pair;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
public class WhoDropsCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.dropMessage(5, "Please do @whodrops <item name>");
|
||||
return;
|
||||
}
|
||||
String searchString = joinStringFrom(params, 0);
|
||||
String output = "";
|
||||
Iterator<Pair<Integer, String>> listIterator = MapleItemInformationProvider.getInstance().getItemDataByName(searchString).iterator();
|
||||
if(listIterator.hasNext()) {
|
||||
int count = 1;
|
||||
while(listIterator.hasNext() && count <= 3) {
|
||||
Pair<Integer, String> data = listIterator.next();
|
||||
output += "#b" + data.getRight() + "#k is dropped by:\r\n";
|
||||
try {
|
||||
Connection con = DatabaseConnection.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("SELECT dropperid FROM drop_data WHERE itemid = ? LIMIT 50");
|
||||
ps.setInt(1, data.getLeft());
|
||||
ResultSet rs = ps.executeQuery();
|
||||
while(rs.next()) {
|
||||
String resultName = MapleMonsterInformationProvider.getMobNameFromID(rs.getInt("dropperid"));
|
||||
if (resultName != null) {
|
||||
output += resultName + ", ";
|
||||
}
|
||||
}
|
||||
rs.close();
|
||||
ps.close();
|
||||
con.close();
|
||||
} catch (Exception e) {
|
||||
player.dropMessage(6, "There was a problem retrieving the required data. Please try again.");
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
output += "\r\n\r\n";
|
||||
count++;
|
||||
}
|
||||
} else {
|
||||
player.dropMessage(5, "The item you searched for doesn't exist.");
|
||||
return;
|
||||
}
|
||||
c.announce(MaplePacketCreator.getNPCTalk(9010000, (byte) 0, output, "00 00", (byte) 0));
|
||||
}
|
||||
}
|
||||
66
src/client/command/commands/v2/ApCommand.java
Normal file
66
src/client/command/commands/v2/ApCommand.java
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.MapleStat;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import constants.ServerConstants;
|
||||
|
||||
public class ApCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !ap [<playername>] <newap>");
|
||||
return;
|
||||
}
|
||||
|
||||
if (params.length < 2) {
|
||||
int newAp = Integer.parseInt(params[0]);
|
||||
if (newAp < 0) newAp = 0;
|
||||
else if (newAp > ServerConstants.MAX_AP) newAp = ServerConstants.MAX_AP;
|
||||
|
||||
player.setRemainingAp(newAp);
|
||||
player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
|
||||
} else {
|
||||
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||
if (victim != null) {
|
||||
int newAp = Integer.parseInt(params[1]);
|
||||
if (newAp < 0) newAp = 0;
|
||||
else if (newAp > ServerConstants.MAX_AP) newAp = ServerConstants.MAX_AP;
|
||||
|
||||
victim.setRemainingAp(newAp);
|
||||
victim.updateSingleStat(MapleStat.AVAILABLEAP, victim.getRemainingAp());
|
||||
} else {
|
||||
player.message("Player '" + params[0] + "' could not be found on this channel.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
53
src/client/command/commands/v2/BombCommand.java
Normal file
53
src/client/command/commands/v2/BombCommand.java
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import net.server.Server;
|
||||
import server.life.MapleLifeFactory;
|
||||
import tools.MaplePacketCreator;
|
||||
|
||||
public class BombCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length > 0) {
|
||||
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||
if (victim != null) {
|
||||
victim.getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9300166), victim.getPosition());
|
||||
Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.serverNotice(5, player.getName() + " used !bomb on " + victim.getName()));
|
||||
} else {
|
||||
player.message("Player '" + params[0] + "' could not be found on this world.");
|
||||
}
|
||||
} else {
|
||||
player.getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9300166), player.getPosition());
|
||||
}
|
||||
}
|
||||
}
|
||||
49
src/client/command/commands/v2/BuffCommand.java
Normal file
49
src/client/command/commands/v2/BuffCommand.java
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.Skill;
|
||||
import client.SkillFactory;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class BuffCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !buff <buffid>");
|
||||
return;
|
||||
}
|
||||
int skillid = Integer.parseInt(params[0]);
|
||||
|
||||
Skill skill = SkillFactory.getSkill(skillid);
|
||||
if (skill != null) skill.getEffect(skill.getMaxLevel()).applyTo(player);
|
||||
}
|
||||
}
|
||||
46
src/client/command/commands/v2/BuffMapCommand.java
Normal file
46
src/client/command/commands/v2/BuffMapCommand.java
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.SkillFactory;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class BuffMapCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
SkillFactory.getSkill(9101001).getEffect(SkillFactory.getSkill(9101001).getMaxLevel()).applyTo(player, true);
|
||||
SkillFactory.getSkill(9101002).getEffect(SkillFactory.getSkill(9101002).getMaxLevel()).applyTo(player, true);
|
||||
SkillFactory.getSkill(9101003).getEffect(SkillFactory.getSkill(9101003).getMaxLevel()).applyTo(player, true);
|
||||
SkillFactory.getSkill(9101008).getEffect(SkillFactory.getSkill(9101008).getMaxLevel()).applyTo(player, true);
|
||||
SkillFactory.getSkill(1005).getEffect(SkillFactory.getSkill(1005).getMaxLevel()).applyTo(player, true);
|
||||
|
||||
}
|
||||
}
|
||||
41
src/client/command/commands/v2/ClearDropsCommand.java
Normal file
41
src/client/command/commands/v2/ClearDropsCommand.java
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class ClearDropsCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
player.getMap().clearDrops(player);
|
||||
player.dropMessage(5, "Cleared dropped items");
|
||||
}
|
||||
}
|
||||
130
src/client/command/commands/v2/ClearSlotCommand.java
Normal file
130
src/client/command/commands/v2/ClearSlotCommand.java
Normal file
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.MapleInventoryType;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
|
||||
public class ClearSlotCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !clearslot <all, equip, use, setup, etc or cash.>");
|
||||
return;
|
||||
}
|
||||
String type = params[0];
|
||||
switch (type) {
|
||||
case "all":
|
||||
for (int i = 0; i < 101; i++) {
|
||||
Item tempItem = c.getPlayer().getInventory(MapleInventoryType.EQUIP).getItem((byte) i);
|
||||
if (tempItem == null)
|
||||
continue;
|
||||
MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.EQUIP, (byte) i, tempItem.getQuantity(), false, true);
|
||||
}
|
||||
for (int i = 0; i < 101; i++) {
|
||||
Item tempItem = c.getPlayer().getInventory(MapleInventoryType.USE).getItem((byte) i);
|
||||
if (tempItem == null)
|
||||
continue;
|
||||
MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.USE, (byte) i, tempItem.getQuantity(), false, true);
|
||||
}
|
||||
for (int i = 0; i < 101; i++) {
|
||||
Item tempItem = c.getPlayer().getInventory(MapleInventoryType.ETC).getItem((byte) i);
|
||||
if (tempItem == null)
|
||||
continue;
|
||||
MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.ETC, (byte) i, tempItem.getQuantity(), false, true);
|
||||
}
|
||||
for (int i = 0; i < 101; i++) {
|
||||
Item tempItem = c.getPlayer().getInventory(MapleInventoryType.SETUP).getItem((byte) i);
|
||||
if (tempItem == null)
|
||||
continue;
|
||||
MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.SETUP, (byte) i, tempItem.getQuantity(), false, true);
|
||||
}
|
||||
for (int i = 0; i < 101; i++) {
|
||||
Item tempItem = c.getPlayer().getInventory(MapleInventoryType.CASH).getItem((byte) i);
|
||||
if (tempItem == null)
|
||||
continue;
|
||||
MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.CASH, (byte) i, tempItem.getQuantity(), false, true);
|
||||
}
|
||||
player.yellowMessage("All Slots Cleared.");
|
||||
break;
|
||||
case "equip":
|
||||
for (int i = 0; i < 101; i++) {
|
||||
Item tempItem = c.getPlayer().getInventory(MapleInventoryType.EQUIP).getItem((byte) i);
|
||||
if (tempItem == null)
|
||||
continue;
|
||||
MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.EQUIP, (byte) i, tempItem.getQuantity(), false, true);
|
||||
}
|
||||
player.yellowMessage("Equipment Slot Cleared.");
|
||||
break;
|
||||
case "use":
|
||||
for (int i = 0; i < 101; i++) {
|
||||
Item tempItem = c.getPlayer().getInventory(MapleInventoryType.USE).getItem((byte) i);
|
||||
if (tempItem == null)
|
||||
continue;
|
||||
MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.USE, (byte) i, tempItem.getQuantity(), false, true);
|
||||
}
|
||||
player.yellowMessage("Use Slot Cleared.");
|
||||
break;
|
||||
case "setup":
|
||||
for (int i = 0; i < 101; i++) {
|
||||
Item tempItem = c.getPlayer().getInventory(MapleInventoryType.SETUP).getItem((byte) i);
|
||||
if (tempItem == null)
|
||||
continue;
|
||||
MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.SETUP, (byte) i, tempItem.getQuantity(), false, true);
|
||||
}
|
||||
player.yellowMessage("Set-Up Slot Cleared.");
|
||||
break;
|
||||
case "etc":
|
||||
for (int i = 0; i < 101; i++) {
|
||||
Item tempItem = c.getPlayer().getInventory(MapleInventoryType.ETC).getItem((byte) i);
|
||||
if (tempItem == null)
|
||||
continue;
|
||||
MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.ETC, (byte) i, tempItem.getQuantity(), false, true);
|
||||
}
|
||||
player.yellowMessage("ETC Slot Cleared.");
|
||||
break;
|
||||
case "cash":
|
||||
for (int i = 0; i < 101; i++) {
|
||||
Item tempItem = c.getPlayer().getInventory(MapleInventoryType.CASH).getItem((byte) i);
|
||||
if (tempItem == null)
|
||||
continue;
|
||||
MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.CASH, (byte) i, tempItem.getQuantity(), false, true);
|
||||
}
|
||||
player.yellowMessage("Cash Slot Cleared.");
|
||||
break;
|
||||
default:
|
||||
player.yellowMessage("Slot" + type + " does not exist!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
65
src/client/command/commands/v2/DcCommand.java
Normal file
65
src/client/command/commands/v2/DcCommand.java
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class DcCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !dc <playername>");
|
||||
return;
|
||||
}
|
||||
|
||||
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||
if (victim == null) {
|
||||
victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||
if (victim == null) {
|
||||
victim = player.getMap().getCharacterByName(params[0]);
|
||||
if (victim != null) {
|
||||
try {//sometimes bugged because the map = null
|
||||
victim.getClient().disconnect(true, false);
|
||||
player.getMap().removePlayer(victim);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (player.gmLevel() < victim.gmLevel()) {
|
||||
victim = player;
|
||||
}
|
||||
victim.getClient().disconnect(false, false);
|
||||
}
|
||||
}
|
||||
44
src/client/command/commands/v2/EmpowerMeCommand.java
Normal file
44
src/client/command/commands/v2/EmpowerMeCommand.java
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.SkillFactory;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class EmpowerMeCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
final int[] array = {2311003, 2301004, 1301007, 4101004, 2001002, 1101007, 1005, 2301003, 5121009, 1111002, 4111001, 4111002, 4211003, 4211005, 1321000, 2321004, 3121002};
|
||||
for (int i : array) {
|
||||
SkillFactory.getSkill(i).getEffect(SkillFactory.getSkill(i).getMaxLevel()).applyTo(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
40
src/client/command/commands/v2/GmShopCommand.java
Normal file
40
src/client/command/commands/v2/GmShopCommand.java
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import server.MapleShopFactory;
|
||||
|
||||
public class GmShopCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleShopFactory.getInstance().getShop(1337).sendShop(c);
|
||||
}
|
||||
}
|
||||
41
src/client/command/commands/v2/HealCommand.java
Normal file
41
src/client/command/commands/v2/HealCommand.java
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class HealCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
player.setHpMp(30000);
|
||||
}
|
||||
|
||||
}
|
||||
42
src/client/command/commands/v2/HideCommand.java
Normal file
42
src/client/command/commands/v2/HideCommand.java
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.SkillFactory;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class HideCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
SkillFactory.getSkill(9101004).getEffect(SkillFactory.getSkill(9101004).getMaxLevel()).applyTo(player);
|
||||
|
||||
}
|
||||
}
|
||||
88
src/client/command/commands/v2/ItemCommand.java
Normal file
88
src/client/command/commands/v2/ItemCommand.java
Normal file
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import client.inventory.MaplePet;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import constants.ItemConstants;
|
||||
import constants.ServerConstants;
|
||||
import server.MapleItemInformationProvider;
|
||||
|
||||
public class ItemCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !item <itemid> <quantity>");
|
||||
return;
|
||||
}
|
||||
|
||||
int itemId = Integer.parseInt(params[0]);
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
|
||||
if(ii.getName(itemId) == null) {
|
||||
player.yellowMessage("Item id '" + params[0] + "' does not exist.");
|
||||
return;
|
||||
}
|
||||
|
||||
short quantity = 1;
|
||||
if(params.length >= 2) quantity = Short.parseShort(params[1]);
|
||||
|
||||
if (ServerConstants.BLOCK_GENERATE_CASH_ITEM && ii.isCash(itemId)) {
|
||||
player.yellowMessage("You cannot create a cash item with this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (ItemConstants.isPet(itemId)) {
|
||||
if (params.length >= 2){ // thanks to istreety & TacoBell
|
||||
quantity = 1;
|
||||
long days = Math.max(1, Integer.parseInt(params[1]));
|
||||
long expiration = System.currentTimeMillis() + (days * 24 * 60 * 60 * 1000);
|
||||
int petid = MaplePet.createPet(itemId);
|
||||
|
||||
MapleInventoryManipulator.addById(c, itemId, quantity, player.getName(), petid, expiration);
|
||||
return;
|
||||
} else {
|
||||
player.yellowMessage("Pet Syntax: !item <itemid> <expiration>");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
byte flag = 0;
|
||||
if(player.gmLevel() < 3) {
|
||||
flag |= ItemConstants.ACCOUNT_SHARING;
|
||||
flag |= ItemConstants.UNTRADEABLE;
|
||||
}
|
||||
|
||||
MapleInventoryManipulator.addById(c, itemId, quantity, player.getName(), -1, flag, -1);
|
||||
}
|
||||
}
|
||||
117
src/client/command/commands/v2/ItemDropCommand.java
Normal file
117
src/client/command/commands/v2/ItemDropCommand.java
Normal file
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.MapleInventoryType;
|
||||
import client.inventory.MaplePet;
|
||||
import constants.ItemConstants;
|
||||
import constants.ServerConstants;
|
||||
import server.MapleItemInformationProvider;
|
||||
|
||||
public class ItemDropCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !item <itemid> <quantity>");
|
||||
return;
|
||||
}
|
||||
|
||||
int itemId = Integer.parseInt(params[0]);
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
|
||||
if(ii.getName(itemId) == null) {
|
||||
player.yellowMessage("Item id '" + params[0] + "' does not exist.");
|
||||
return;
|
||||
}
|
||||
|
||||
short quantity = 1;
|
||||
if(params.length >= 2) quantity = Short.parseShort(params[1]);
|
||||
|
||||
if (ServerConstants.BLOCK_GENERATE_CASH_ITEM && ii.isCash(itemId)) {
|
||||
player.yellowMessage("You cannot create a cash item with this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (ItemConstants.isPet(itemId)) {
|
||||
if (params.length >= 2){ // thanks to istreety & TacoBell
|
||||
quantity = 1;
|
||||
long days = Math.max(1, Integer.parseInt(params[1]));
|
||||
long expiration = System.currentTimeMillis() + (days * 24 * 60 * 60 * 1000);
|
||||
int petid = MaplePet.createPet(itemId);
|
||||
|
||||
Item toDrop = new Item(itemId, (short) 0, quantity, petid);
|
||||
toDrop.setExpiration(expiration);
|
||||
|
||||
toDrop.setOwner("");
|
||||
if(player.gmLevel() < 3) {
|
||||
byte b = toDrop.getFlag();
|
||||
b |= ItemConstants.ACCOUNT_SHARING;
|
||||
b |= ItemConstants.UNTRADEABLE;
|
||||
b |= ItemConstants.SANDBOX;
|
||||
|
||||
toDrop.setFlag(b);
|
||||
toDrop.setOwner("TRIAL-MODE");
|
||||
}
|
||||
|
||||
c.getPlayer().getMap().spawnItemDrop(c.getPlayer(), c.getPlayer(), toDrop, c.getPlayer().getPosition(), true, true);
|
||||
|
||||
return;
|
||||
} else {
|
||||
player.yellowMessage("Pet Syntax: !item <itemid> <expiration>");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Item toDrop;
|
||||
if (ItemConstants.getInventoryType(itemId) == MapleInventoryType.EQUIP) {
|
||||
toDrop = ii.getEquipById(itemId);
|
||||
} else {
|
||||
toDrop = new Item(itemId, (short) 0, quantity);
|
||||
}
|
||||
|
||||
toDrop.setOwner(player.getName());
|
||||
if(player.gmLevel() < 3) {
|
||||
byte b = toDrop.getFlag();
|
||||
b |= ItemConstants.ACCOUNT_SHARING;
|
||||
b |= ItemConstants.UNTRADEABLE;
|
||||
b |= ItemConstants.SANDBOX;
|
||||
|
||||
toDrop.setFlag(b);
|
||||
toDrop.setOwner("TRIAL-MODE");
|
||||
}
|
||||
|
||||
c.getPlayer().getMap().spawnItemDrop(c.getPlayer(), c.getPlayer(), toDrop, c.getPlayer().getPosition(), true, true);
|
||||
}
|
||||
}
|
||||
73
src/client/command/commands/v2/JailCommand.java
Normal file
73
src/client/command/commands/v2/JailCommand.java
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import server.MaplePortal;
|
||||
import server.maps.MapleMap;
|
||||
|
||||
public class JailCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !jail <playername> [<minutes>]");
|
||||
return;
|
||||
}
|
||||
|
||||
int minutesJailed = 5;
|
||||
if (params.length >= 2) {
|
||||
minutesJailed = Integer.valueOf(params[1]);
|
||||
if (minutesJailed <= 0) {
|
||||
player.yellowMessage("Syntax: !jail <playername> [<minutes>]");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||
if (victim != null) {
|
||||
victim.addJailExpirationTime(minutesJailed * 60 * 1000);
|
||||
|
||||
int mapid = 300000012;
|
||||
|
||||
if (victim.getMapId() != mapid) { // those gone to jail won't be changing map anyway
|
||||
MapleMap target = c.getChannelServer().getMapFactory().getMap(mapid);
|
||||
MaplePortal targetPortal = target.getPortal(0);
|
||||
victim.changeMap(target, targetPortal);
|
||||
player.message(victim.getName() + " was jailed for " + minutesJailed + " minutes.");
|
||||
} else {
|
||||
player.message(victim.getName() + "'s time in jail has been extended for " + minutesJailed + " minutes.");
|
||||
}
|
||||
|
||||
} else {
|
||||
player.message("Player '" + params[0] + "' could not be found on this channel.");
|
||||
}
|
||||
}
|
||||
}
|
||||
67
src/client/command/commands/v2/JobCommand.java
Normal file
67
src/client/command/commands/v2/JobCommand.java
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.MapleJob;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class JobCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length == 1) {
|
||||
int jobid = Integer.parseInt(params[0]);
|
||||
if (jobid < 0 || jobid >= 2200) {
|
||||
player.message("Jobid " + jobid + " is not available.");
|
||||
return;
|
||||
}
|
||||
|
||||
player.changeJob(MapleJob.getById(jobid));
|
||||
player.equipChanged();
|
||||
} else if (params.length == 2) {
|
||||
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||
|
||||
if (victim != null) {
|
||||
int jobid = Integer.parseInt(params[1]);
|
||||
if (jobid < 0 || jobid >= 2200) {
|
||||
player.message("Jobid " + jobid + " is not available.");
|
||||
return;
|
||||
}
|
||||
|
||||
victim.changeJob(MapleJob.getById(jobid));
|
||||
player.equipChanged();
|
||||
} else {
|
||||
player.message("Player '" + params[0] + "' could not be found on this channel.");
|
||||
}
|
||||
} else {
|
||||
player.message("Syntax: !job <job id> <opt: IGN of another person>");
|
||||
}
|
||||
}
|
||||
}
|
||||
53
src/client/command/commands/v2/LevelCommand.java
Normal file
53
src/client/command/commands/v2/LevelCommand.java
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import constants.ServerConstants;
|
||||
|
||||
public class LevelCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !level <newlevel>");
|
||||
return;
|
||||
}
|
||||
|
||||
player.loseExp(player.getExp(), false, false);
|
||||
player.setLevel(Math.min(Integer.parseInt(params[0]), player.getMaxClassLevel()) - 1);
|
||||
|
||||
player.resetPlayerRates();
|
||||
if (ServerConstants.USE_ADD_RATES_BY_LEVEL) player.setPlayerRates();
|
||||
player.setWorldRates();
|
||||
|
||||
player.levelUp(false);
|
||||
}
|
||||
}
|
||||
46
src/client/command/commands/v2/LevelProCommand.java
Normal file
46
src/client/command/commands/v2/LevelProCommand.java
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class LevelProCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !levelpro <newlevel>");
|
||||
return;
|
||||
}
|
||||
while (player.getLevel() < Math.min(player.getMaxClassLevel(), Integer.parseInt(params[0]))) {
|
||||
player.levelUp(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
60
src/client/command/commands/v2/MaxSkillCommand.java
Normal file
60
src/client/command/commands/v2/MaxSkillCommand.java
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.*;
|
||||
import client.command.Command;
|
||||
import provider.MapleData;
|
||||
import provider.MapleDataProviderFactory;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class MaxSkillCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
for (MapleData skill_ : MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/" + "String.wz")).getData("Skill.img").getChildren()) {
|
||||
try {
|
||||
Skill skill = SkillFactory.getSkill(Integer.parseInt(skill_.getName()));
|
||||
player.changeSkillLevel(skill, (byte) skill.getMaxLevel(), skill.getMaxLevel(), -1);
|
||||
} catch (NumberFormatException nfe) {
|
||||
nfe.printStackTrace();
|
||||
break;
|
||||
} catch (NullPointerException npe) { }
|
||||
}
|
||||
|
||||
if (player.getJob().isA(MapleJob.ARAN1) || player.getJob().isA(MapleJob.LEGEND)) {
|
||||
Skill skill = SkillFactory.getSkill(5001005);
|
||||
player.changeSkillLevel(skill, (byte) -1, -1, -1);
|
||||
} else {
|
||||
Skill skill = SkillFactory.getSkill(21001001);
|
||||
player.changeSkillLevel(skill, (byte) -1, -1, -1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
63
src/client/command/commands/v2/MaxStatCommand.java
Normal file
63
src/client/command/commands/v2/MaxStatCommand.java
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.MapleStat;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import client.command.CommandsExecutor;
|
||||
import constants.ServerConstants;
|
||||
|
||||
public class MaxStatCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
player.loseExp(player.getExp(), false, false);
|
||||
player.setLevel(255);
|
||||
player.resetPlayerRates();
|
||||
if (ServerConstants.USE_ADD_RATES_BY_LEVEL) player.setPlayerRates();
|
||||
player.setWorldRates();
|
||||
player.setStr(Short.MAX_VALUE);
|
||||
player.setDex(Short.MAX_VALUE);
|
||||
player.setInt(Short.MAX_VALUE);
|
||||
player.setLuk(Short.MAX_VALUE);
|
||||
player.updateSingleStat(MapleStat.STR, Short.MAX_VALUE);
|
||||
player.updateSingleStat(MapleStat.DEX, Short.MAX_VALUE);
|
||||
player.updateSingleStat(MapleStat.INT, Short.MAX_VALUE);
|
||||
player.updateSingleStat(MapleStat.LUK, Short.MAX_VALUE);
|
||||
player.setFame(13337);
|
||||
player.setMaxHp(30000);
|
||||
player.setMaxMp(30000);
|
||||
player.updateSingleStat(MapleStat.LEVEL, 255);
|
||||
player.updateSingleStat(MapleStat.FAME, 13337);
|
||||
player.updateSingleStat(MapleStat.MAXHP, 30000);
|
||||
player.updateSingleStat(MapleStat.MAXMP, 30000);
|
||||
player.yellowMessage("Stats maxed out.");
|
||||
}
|
||||
}
|
||||
42
src/client/command/commands/v2/MesosCommand.java
Normal file
42
src/client/command/commands/v2/MesosCommand.java
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class MesosCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length >= 1) {
|
||||
player.gainMeso(Integer.parseInt(params[0]), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
56
src/client/command/commands/v2/ReachCommand.java
Normal file
56
src/client/command/commands/v2/ReachCommand.java
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import server.maps.MapleMap;
|
||||
|
||||
public class ReachCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !reach <playername>");
|
||||
return;
|
||||
}
|
||||
|
||||
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||
if (victim != null && victim.isLoggedin()) {
|
||||
if (player.getClient().getChannel() != victim.getClient().getChannel()) {
|
||||
player.dropMessage(5, "Player '" + victim.getName() + "' is at channel " + victim.getClient().getChannel() + ".");
|
||||
} else {
|
||||
MapleMap map = victim.getMap();
|
||||
player.forceChangeMap(map, map.findClosestPortal(victim.getPosition()));
|
||||
}
|
||||
} else {
|
||||
player.dropMessage(6, "Unknown player.");
|
||||
}
|
||||
}
|
||||
}
|
||||
60
src/client/command/commands/v2/RechargeCommand.java
Normal file
60
src/client/command/commands/v2/RechargeCommand.java
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.MapleInventoryType;
|
||||
import constants.ItemConstants;
|
||||
import server.MapleItemInformationProvider;
|
||||
|
||||
public class RechargeCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
for (Item torecharge : c.getPlayer().getInventory(MapleInventoryType.USE).list()) {
|
||||
if (ItemConstants.isThrowingStar(torecharge.getItemId())){
|
||||
torecharge.setQuantity(ii.getSlotMax(c, torecharge.getItemId()));
|
||||
c.getPlayer().forceUpdateItem(torecharge);
|
||||
} else if (ItemConstants.isArrow(torecharge.getItemId())){
|
||||
torecharge.setQuantity(ii.getSlotMax(c, torecharge.getItemId()));
|
||||
c.getPlayer().forceUpdateItem(torecharge);
|
||||
} else if (ItemConstants.isBullet(torecharge.getItemId())){
|
||||
torecharge.setQuantity(ii.getSlotMax(c, torecharge.getItemId()));
|
||||
c.getPlayer().forceUpdateItem(torecharge);
|
||||
} else if (ItemConstants.isConsumable(torecharge.getItemId())){
|
||||
torecharge.setQuantity(ii.getSlotMax(c, torecharge.getItemId()));
|
||||
c.getPlayer().forceUpdateItem(torecharge);
|
||||
}
|
||||
}
|
||||
player.dropMessage(5, "USE Recharged.");
|
||||
}
|
||||
}
|
||||
62
src/client/command/commands/v2/ResetSkillCommand.java
Normal file
62
src/client/command/commands/v2/ResetSkillCommand.java
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.*;
|
||||
import client.command.Command;
|
||||
import provider.MapleData;
|
||||
import provider.MapleDataProviderFactory;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class ResetSkillCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
for (MapleData skill_ : MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/" + "String.wz")).getData("Skill.img").getChildren()) {
|
||||
try {
|
||||
Skill skill = SkillFactory.getSkill(Integer.parseInt(skill_.getName()));
|
||||
player.changeSkillLevel(skill, (byte) 0, skill.getMaxLevel(), -1);
|
||||
} catch (NumberFormatException nfe) {
|
||||
nfe.printStackTrace();
|
||||
break;
|
||||
} catch (NullPointerException npe) {
|
||||
}
|
||||
}
|
||||
|
||||
if (player.getJob().isA(MapleJob.ARAN1) || player.getJob().isA(MapleJob.LEGEND)) {
|
||||
Skill skill = SkillFactory.getSkill(5001005);
|
||||
player.changeSkillLevel(skill, (byte) -1, -1, -1);
|
||||
} else {
|
||||
Skill skill = SkillFactory.getSkill(21001001);
|
||||
player.changeSkillLevel(skill, (byte) -1, -1, -1);
|
||||
}
|
||||
|
||||
player.yellowMessage("Skills reseted.");
|
||||
}
|
||||
}
|
||||
98
src/client/command/commands/v2/SearchCommand.java
Normal file
98
src/client/command/commands/v2/SearchCommand.java
Normal file
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import provider.MapleData;
|
||||
import provider.MapleDataProvider;
|
||||
import provider.MapleDataProviderFactory;
|
||||
import provider.MapleDataTool;
|
||||
import server.MapleItemInformationProvider;
|
||||
import tools.MaplePacketCreator;
|
||||
import tools.Pair;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class SearchCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 2) {
|
||||
player.yellowMessage("Syntax: !search <type> <name>");
|
||||
return;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
String search = joinStringFrom(params,1);
|
||||
long start = System.currentTimeMillis();//for the lulz
|
||||
MapleData data = null;
|
||||
MapleDataProvider dataProvider = MapleDataProviderFactory.getDataProvider(new File("wz/String.wz"));
|
||||
if (!params[0].equalsIgnoreCase("ITEM")) {
|
||||
if (params[0].equalsIgnoreCase("NPC")) {
|
||||
data = dataProvider.getData("Npc.img");
|
||||
} else if (params[0].equalsIgnoreCase("MOB") || params[0].equalsIgnoreCase("MONSTER")) {
|
||||
data = dataProvider.getData("Mob.img");
|
||||
} else if (params[0].equalsIgnoreCase("SKILL")) {
|
||||
data = dataProvider.getData("Skill.img");
|
||||
/*} else if (sub[1].equalsIgnoreCase("MAP")) {
|
||||
TODO
|
||||
*/
|
||||
} else {
|
||||
sb.append("#bInvalid search.\r\nSyntax: '!search [type] [name]', where [type] is NPC, ITEM, MOB, or SKILL.");
|
||||
}
|
||||
if (data != null) {
|
||||
String name;
|
||||
for (MapleData searchData : data.getChildren()) {
|
||||
name = MapleDataTool.getString(searchData.getChildByPath("name"), "NO-NAME");
|
||||
if (name.toLowerCase().contains(search.toLowerCase())) {
|
||||
sb.append("#b").append(Integer.parseInt(searchData.getName())).append("#k - #r").append(name).append("\r\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (Pair<Integer, String> itemPair : MapleItemInformationProvider.getInstance().getAllItems()) {
|
||||
if (sb.length() < 32654) {//ohlol
|
||||
if (itemPair.getRight().toLowerCase().contains(search.toLowerCase())) {
|
||||
sb.append("#b").append(itemPair.getLeft()).append("#k - #r").append(itemPair.getRight()).append("\r\n");
|
||||
}
|
||||
} else {
|
||||
sb.append("#bCouldn't load all items, there are too many results.\r\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sb.length() == 0) {
|
||||
sb.append("#bNo ").append(params[0].toLowerCase()).append("s found.\r\n");
|
||||
}
|
||||
sb.append("\r\n#kLoaded within ").append((double) (System.currentTimeMillis() - start) / 1000).append(" seconds.");//because I can, and it's free
|
||||
|
||||
c.announce(MaplePacketCreator.getNPCTalk(9010000, (byte) 0, sb.toString(), "00 00", (byte) 0));
|
||||
}
|
||||
}
|
||||
63
src/client/command/commands/v2/SetStatCommand.java
Normal file
63
src/client/command/commands/v2/SetStatCommand.java
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.MapleStat;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class SetStatCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !setstat <newstat>");
|
||||
return;
|
||||
}
|
||||
|
||||
int x;
|
||||
try {
|
||||
x = Integer.parseInt(params[0]);
|
||||
|
||||
if (x > Short.MAX_VALUE) x = Short.MAX_VALUE;
|
||||
else if (x < 0) x = 0;
|
||||
|
||||
player.setStr(x);
|
||||
player.setDex(x);
|
||||
player.setInt(x);
|
||||
player.setLuk(x);
|
||||
player.updateSingleStat(MapleStat.STR, x);
|
||||
player.updateSingleStat(MapleStat.DEX, x);
|
||||
player.updateSingleStat(MapleStat.INT, x);
|
||||
player.updateSingleStat(MapleStat.LUK, x);
|
||||
|
||||
} catch (NumberFormatException nfe) {
|
||||
}
|
||||
}
|
||||
}
|
||||
68
src/client/command/commands/v2/SpCommand.java
Normal file
68
src/client/command/commands/v2/SpCommand.java
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.MapleStat;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import constants.ServerConstants;
|
||||
|
||||
public class SpCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !sp [<playername>] <newsp>");
|
||||
return;
|
||||
}
|
||||
|
||||
if (params.length == 1) {
|
||||
int newSp = Integer.parseInt(params[0]);
|
||||
if (newSp < 0) newSp = 0;
|
||||
else if (newSp > ServerConstants.MAX_AP) newSp = ServerConstants.MAX_AP;
|
||||
|
||||
player.setRemainingSp(newSp);
|
||||
player.updateSingleStat(MapleStat.AVAILABLESP, player.getRemainingSp());
|
||||
} else {
|
||||
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||
if (victim != null) {
|
||||
int newSp = Integer.parseInt(params[1]);
|
||||
if (newSp < 0) newSp = 0;
|
||||
else if (newSp > ServerConstants.MAX_AP) newSp = ServerConstants.MAX_AP;
|
||||
|
||||
victim.setRemainingSp(newSp);
|
||||
victim.updateSingleStat(MapleStat.AVAILABLESP, player.getRemainingSp());
|
||||
|
||||
player.dropMessage(5, "SP given.");
|
||||
} else {
|
||||
player.message("Player '" + params[0] + "' could not be found on this channel.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
83
src/client/command/commands/v2/SummonCommand.java
Normal file
83
src/client/command/commands/v2/SummonCommand.java
Normal file
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import net.server.Server;
|
||||
import net.server.channel.Channel;
|
||||
|
||||
public class SummonCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !warphere <playername>");
|
||||
return;
|
||||
}
|
||||
|
||||
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||
if (victim == null) {//If victim isn't on current channel, loop all channels on current world.
|
||||
for (Channel ch : Server.getInstance().getChannelsFromWorld(c.getWorld())) {
|
||||
victim = ch.getPlayerStorage().getCharacterByName(params[0]);
|
||||
if (victim != null) {
|
||||
break;//We found the person, no need to continue the loop.
|
||||
}
|
||||
}
|
||||
}
|
||||
if (victim != null) {
|
||||
boolean changingEvent = true;
|
||||
|
||||
if (victim.getEventInstance() != null) {
|
||||
if (player.getEventInstance() != null && victim.getEventInstance().getLeaderId() == player.getEventInstance().getLeaderId()) {
|
||||
changingEvent = false;
|
||||
} else {
|
||||
victim.getEventInstance().unregisterPlayer(victim);
|
||||
}
|
||||
}
|
||||
//Attempt to join the warpers instance.
|
||||
if (player.getEventInstance() != null && changingEvent) {
|
||||
if (player.getClient().getChannel() == victim.getClient().getChannel()) {//just in case.. you never know...
|
||||
player.getEventInstance().registerPlayer(victim);
|
||||
victim.changeMap(player.getEventInstance().getMapInstance(player.getMapId()), player.getMap().findClosestPortal(player.getPosition()));
|
||||
} else {
|
||||
player.dropMessage("Target isn't on your channel, not able to warp into event instance.");
|
||||
}
|
||||
} else {//If victim isn't in an event instance or is in the same event instance as the one the caller is, just warp them.
|
||||
victim.changeMap(player.getMapId(), player.getMap().findClosestPortal(player.getPosition()));
|
||||
}
|
||||
if (player.getClient().getChannel() != victim.getClient().getChannel()) {//And then change channel if needed.
|
||||
victim.dropMessage("Changing channel, please wait a moment.");
|
||||
victim.getClient().changeChannel(player.getClient().getChannel());
|
||||
}
|
||||
} else {
|
||||
player.dropMessage(6, "Unknown player.");
|
||||
}
|
||||
}
|
||||
}
|
||||
40
src/client/command/commands/v2/UnBugCommand.java
Normal file
40
src/client/command/commands/v2/UnBugCommand.java
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import tools.MaplePacketCreator;
|
||||
|
||||
public class UnBugCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
c.getPlayer().getMap().broadcastMessage(MaplePacketCreator.enableActions());
|
||||
}
|
||||
}
|
||||
42
src/client/command/commands/v2/UnHideCommand.java
Normal file
42
src/client/command/commands/v2/UnHideCommand.java
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.SkillFactory;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class UnHideCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
SkillFactory.getSkill(9101004).getEffect(SkillFactory.getSkill(9101004).getMaxLevel()).applyTo(player);
|
||||
|
||||
}
|
||||
}
|
||||
56
src/client/command/commands/v2/UnJailCommand.java
Normal file
56
src/client/command/commands/v2/UnJailCommand.java
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class UnJailCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !unjail <playername>");
|
||||
return;
|
||||
}
|
||||
|
||||
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||
if (victim != null) {
|
||||
if (victim.getJailExpirationTimeLeft() <= 0) {
|
||||
player.message("This player is already free.");
|
||||
return;
|
||||
}
|
||||
victim.removeJailExpirationTime();
|
||||
victim.message("By lack of concrete proof you are now unjailed. Enjoy freedom!");
|
||||
player.message(victim.getName() + " was unjailed.");
|
||||
} else {
|
||||
player.message("Player '" + params[0] + "' could not be found on this channel.");
|
||||
}
|
||||
}
|
||||
}
|
||||
58
src/client/command/commands/v2/WarpCommand.java
Normal file
58
src/client/command/commands/v2/WarpCommand.java
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import server.maps.MapleMap;
|
||||
|
||||
public class WarpCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !warp <mapid>");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
MapleMap target = c.getChannelServer().getMapFactory().getMap(Integer.parseInt(params[0]));
|
||||
if (target == null) {
|
||||
player.yellowMessage("Map ID " + params[0] + " is invalid.");
|
||||
return;
|
||||
}
|
||||
if (player.getEventInstance() != null) {
|
||||
player.getEventInstance().leftParty(player);
|
||||
}
|
||||
player.changeMap(target, target.getRandomPlayerSpawnpoint());
|
||||
} catch (Exception ex) {
|
||||
player.yellowMessage("Map ID " + params[0] + " is invalid.");
|
||||
}
|
||||
}
|
||||
}
|
||||
78
src/client/command/commands/v2/WarpToCommand.java
Normal file
78
src/client/command/commands/v2/WarpToCommand.java
Normal file
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import net.server.Server;
|
||||
import net.server.channel.Channel;
|
||||
|
||||
public class WarpToCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 2) {
|
||||
player.yellowMessage("Syntax: !warpto <playername> <mapid>");
|
||||
return;
|
||||
}
|
||||
|
||||
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||
if (victim == null) {//If victim isn't on current channel or isnt a character try and find him by loop all channels on current world.
|
||||
for (Channel ch : Server.getInstance().getChannelsFromWorld(c.getWorld())) {
|
||||
victim = ch.getPlayerStorage().getCharacterByName(params[0]);
|
||||
if (victim != null) {
|
||||
break;//We found the person, no need to continue the loop.
|
||||
}
|
||||
}
|
||||
}
|
||||
if (victim != null) {//If target isn't null attempt to warp.
|
||||
//Remove warper from current event instance.
|
||||
if (player.getEventInstance() != null) {
|
||||
player.getEventInstance().unregisterPlayer(player);
|
||||
}
|
||||
//Attempt to join the victims warp instance.
|
||||
if (victim.getEventInstance() != null) {
|
||||
if (victim.getClient().getChannel() == player.getClient().getChannel()) {//just in case.. you never know...
|
||||
//victim.getEventInstance().registerPlayer(player);
|
||||
player.changeMap(victim.getEventInstance().getMapInstance(victim.getMapId()), victim.getMap().findClosestPortal(victim.getPosition()));
|
||||
} else {
|
||||
player.dropMessage(6, "Please change to channel " + victim.getClient().getChannel());
|
||||
}
|
||||
} else {//If victim isn't in an event instance, just warp them.
|
||||
player.changeMap(victim.getMapId(), victim.getMap().findClosestPortal(victim.getPosition()));
|
||||
}
|
||||
if (player.getClient().getChannel() != victim.getClient().getChannel()) {//And then change channel if needed.
|
||||
player.dropMessage("Changing channel, please wait a moment.");
|
||||
player.getClient().changeChannel(victim.getClient().getChannel());
|
||||
}
|
||||
} else {
|
||||
player.dropMessage(6, "Unknown player.");
|
||||
}
|
||||
}
|
||||
}
|
||||
64
src/client/command/commands/v2/WhereaMiCommand.java
Normal file
64
src/client/command/commands/v2/WhereaMiCommand.java
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v2;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import server.life.MapleMonster;
|
||||
import server.life.MapleNPC;
|
||||
import server.maps.MapleMapObject;
|
||||
|
||||
public class WhereaMiCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
player.yellowMessage("Map ID: " + player.getMap().getId());
|
||||
player.yellowMessage("Players on this map:");
|
||||
for (MapleMapObject mmo : player.getMap().getPlayers()) {
|
||||
MapleCharacter chr = (MapleCharacter) mmo;
|
||||
player.dropMessage(5, ">> " + chr.getName() + " - " + chr.getId() + " - Oid: " + chr.getObjectId());
|
||||
}
|
||||
player.yellowMessage("NPCs on this map:");
|
||||
for (MapleMapObject npcs : player.getMap().getMapObjects()) {
|
||||
if (npcs instanceof MapleNPC) {
|
||||
MapleNPC npc = (MapleNPC) npcs;
|
||||
player.dropMessage(5, ">> " + npc.getName() + " - " + npc.getId() + " - Oid: " + npc.getObjectId());
|
||||
}
|
||||
}
|
||||
player.yellowMessage("Monsters on this map:");
|
||||
for (MapleMapObject mobs : player.getMap().getMapObjects()) {
|
||||
if (mobs instanceof MapleMonster) {
|
||||
MapleMonster mob = (MapleMonster) mobs;
|
||||
if (mob.isAlive()) {
|
||||
player.dropMessage(5, ">> " + mob.getName() + " - " + mob.getId() + " - Oid: " + mob.getObjectId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
96
src/client/command/commands/v3/BanCommand.java
Normal file
96
src/client/command/commands/v3/BanCommand.java
Normal file
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import net.server.Server;
|
||||
import server.TimerManager;
|
||||
import tools.DatabaseConnection;
|
||||
import tools.MaplePacketCreator;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class BanCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 2) {
|
||||
player.yellowMessage("Syntax: !ban <IGN> <Reason> (Please be descriptive)");
|
||||
return;
|
||||
}
|
||||
String ign = params[0];
|
||||
String reason = joinStringFrom(params, 1);
|
||||
MapleCharacter target = c.getChannelServer().getPlayerStorage().getCharacterByName(ign);
|
||||
if (target != null) {
|
||||
String readableTargetName = MapleCharacter.makeMapleReadable(target.getName());
|
||||
String ip = target.getClient().getSession().getRemoteAddress().toString().split(":")[0];
|
||||
//Ban ip
|
||||
PreparedStatement ps = null;
|
||||
try {
|
||||
Connection con = DatabaseConnection.getConnection();
|
||||
if (ip.matches("/[0-9]{1,3}\\..*")) {
|
||||
ps = con.prepareStatement("INSERT INTO ipbans VALUES (DEFAULT, ?, ?)");
|
||||
ps.setString(1, ip);
|
||||
ps.setString(2, String.valueOf(target.getClient().getAccID()));
|
||||
|
||||
ps.executeUpdate();
|
||||
ps.close();
|
||||
}
|
||||
|
||||
con.close();
|
||||
} catch (SQLException ex) {
|
||||
ex.printStackTrace();
|
||||
c.getPlayer().message("Error occured while banning IP address");
|
||||
c.getPlayer().message(target.getName() + "'s IP was not banned: " + ip);
|
||||
}
|
||||
target.getClient().banMacs();
|
||||
reason = c.getPlayer().getName() + " banned " + readableTargetName + " for " + reason + " (IP: " + ip + ") " + "(MAC: " + c.getMacs() + ")";
|
||||
target.ban(reason);
|
||||
target.yellowMessage("You have been banned by #b" + c.getPlayer().getName() + " #k.");
|
||||
target.yellowMessage("Reason: " + reason);
|
||||
c.announce(MaplePacketCreator.getGMEffect(4, (byte) 0));
|
||||
final MapleCharacter rip = target;
|
||||
TimerManager.getInstance().schedule(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
rip.getClient().disconnect(false, false);
|
||||
}
|
||||
}, 5000); //5 Seconds
|
||||
Server.getInstance().broadcastMessage(c.getWorld(), MaplePacketCreator.serverNotice(6, "[RIP]: " + ign + " has been banned."));
|
||||
} else if (MapleCharacter.ban(ign, reason, false)) {
|
||||
c.announce(MaplePacketCreator.getGMEffect(4, (byte) 0));
|
||||
Server.getInstance().broadcastMessage(c.getWorld(), MaplePacketCreator.serverNotice(6, "[RIP]: " + ign + " has been banned."));
|
||||
} else {
|
||||
c.announce(MaplePacketCreator.getGMEffect(6, (byte) 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
41
src/client/command/commands/v3/ChatCommand.java
Normal file
41
src/client/command/commands/v3/ChatCommand.java
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class ChatCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
player.toggleWhiteChat();
|
||||
player.message("Your chat is now " + (player.getWhiteChat() ? " white" : "normal") + ".");
|
||||
}
|
||||
}
|
||||
56
src/client/command/commands/v3/CheckDmgCommand.java
Normal file
56
src/client/command/commands/v3/CheckDmgCommand.java
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.MapleBuffStat;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class CheckDmgCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||
if (victim != null) {
|
||||
int maxBase = victim.calculateMaxBaseDamage(victim.getTotalWatk());
|
||||
Integer watkBuff = victim.getBuffedValue(MapleBuffStat.WATK);
|
||||
Integer matkBuff = victim.getBuffedValue(MapleBuffStat.MATK);
|
||||
Integer blessing = victim.getSkillLevel(10000000 * player.getJobType() + 12);
|
||||
if (watkBuff == null) watkBuff = 0;
|
||||
if (matkBuff == null) matkBuff = 0;
|
||||
|
||||
player.dropMessage(5, "Cur Str: " + victim.getTotalStr() + " Cur Dex: " + victim.getTotalDex() + " Cur Int: " + victim.getTotalInt() + " Cur Luk: " + victim.getTotalLuk());
|
||||
player.dropMessage(5, "Cur WATK: " + victim.getTotalWatk() + " Cur MATK: " + victim.getTotalMagic());
|
||||
player.dropMessage(5, "Cur WATK Buff: " + watkBuff + " Cur MATK Buff: " + matkBuff + " Cur Blessing Level: " + blessing);
|
||||
player.dropMessage(5, victim.getName() + "'s maximum base damage (before skills) is " + maxBase);
|
||||
} else {
|
||||
player.message("Player '" + params[0] + "' could not be found on this world.");
|
||||
}
|
||||
}
|
||||
}
|
||||
44
src/client/command/commands/v3/ClosePortalCommand.java
Normal file
44
src/client/command/commands/v3/ClosePortalCommand.java
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class ClosePortalCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !closeportal <portalid>");
|
||||
return;
|
||||
}
|
||||
player.getMap().getPortal(params[0]).setPortalState(false);
|
||||
}
|
||||
}
|
||||
118
src/client/command/commands/v3/DebuffCommand.java
Normal file
118
src/client/command/commands/v3/DebuffCommand.java
Normal file
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.MapleDisease;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import server.life.MobSkill;
|
||||
import server.life.MobSkillFactory;
|
||||
import server.maps.MapleMapObject;
|
||||
import server.maps.MapleMapObjectType;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class DebuffCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !debuff SLOW|SEDUCE|ZOMBIFY|CONFUSE|STUN|POISON|SEAL|DARKNESS|WEAKEN|CURSE");
|
||||
return;
|
||||
}
|
||||
|
||||
MapleDisease disease = null;
|
||||
MobSkill skill = null;
|
||||
|
||||
switch (params[0].toUpperCase()) {
|
||||
case "SLOW":
|
||||
disease = MapleDisease.SLOW;
|
||||
skill = MobSkillFactory.getMobSkill(126, 7);
|
||||
break;
|
||||
|
||||
case "SEDUCE":
|
||||
disease = MapleDisease.SEDUCE;
|
||||
skill = MobSkillFactory.getMobSkill(128, 7);
|
||||
break;
|
||||
|
||||
case "ZOMBIFY":
|
||||
disease = MapleDisease.ZOMBIFY;
|
||||
skill = MobSkillFactory.getMobSkill(133, 1);
|
||||
break;
|
||||
|
||||
case "CONFUSE":
|
||||
disease = MapleDisease.CONFUSE;
|
||||
skill = MobSkillFactory.getMobSkill(132, 2);
|
||||
break;
|
||||
|
||||
case "STUN":
|
||||
disease = MapleDisease.STUN;
|
||||
skill = MobSkillFactory.getMobSkill(123, 7);
|
||||
break;
|
||||
|
||||
case "POISON":
|
||||
disease = MapleDisease.POISON;
|
||||
skill = MobSkillFactory.getMobSkill(125, 5);
|
||||
break;
|
||||
|
||||
case "SEAL":
|
||||
disease = MapleDisease.SEAL;
|
||||
skill = MobSkillFactory.getMobSkill(120, 1);
|
||||
break;
|
||||
|
||||
case "DARKNESS":
|
||||
disease = MapleDisease.DARKNESS;
|
||||
skill = MobSkillFactory.getMobSkill(121, 1);
|
||||
break;
|
||||
|
||||
case "WEAKEN":
|
||||
disease = MapleDisease.WEAKEN;
|
||||
skill = MobSkillFactory.getMobSkill(122, 1);
|
||||
break;
|
||||
|
||||
case "CURSE":
|
||||
disease = MapleDisease.CURSE;
|
||||
skill = MobSkillFactory.getMobSkill(124, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
if (disease == null) {
|
||||
player.yellowMessage("Syntax: !debuff SLOW|SEDUCE|ZOMBIFY|CONFUSE|STUN|POISON|SEAL|DARKNESS|WEAKEN|CURSE");
|
||||
return;
|
||||
}
|
||||
|
||||
for (MapleMapObject mmo : player.getMap().getMapObjectsInRange(player.getPosition(), 777777.7, Arrays.asList(MapleMapObjectType.PLAYER))) {
|
||||
MapleCharacter chr = (MapleCharacter) mmo;
|
||||
|
||||
if (chr.getId() != player.getId()) {
|
||||
chr.giveDebuff(disease, skill);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
41
src/client/command/commands/v3/EndEventCommand.java
Normal file
41
src/client/command/commands/v3/EndEventCommand.java
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class EndEventCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
c.getChannelServer().setEvent(null);
|
||||
player.dropMessage(5, "You have ended the event. No more players may join.");
|
||||
}
|
||||
}
|
||||
66
src/client/command/commands/v3/ExpedsCommand.java
Normal file
66
src/client/command/commands/v3/ExpedsCommand.java
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import net.server.Server;
|
||||
import net.server.channel.Channel;
|
||||
import server.expeditions.MapleExpedition;
|
||||
|
||||
public class ExpedsCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
for (Channel ch : Server.getInstance().getChannelsFromWorld(c.getWorld())) {
|
||||
if (ch.getExpeditions().isEmpty()) {
|
||||
player.yellowMessage("No Expeditions in Channel " + ch.getId());
|
||||
continue;
|
||||
}
|
||||
player.yellowMessage("Expeditions in Channel " + ch.getId());
|
||||
int id = 0;
|
||||
for (MapleExpedition exped : ch.getExpeditions()) {
|
||||
id++;
|
||||
player.yellowMessage("> Expedition " + id);
|
||||
player.yellowMessage(">> Type: " + exped.getType().toString());
|
||||
player.yellowMessage(">> Status: " + (exped.isRegistering() ? "REGISTERING" : "UNDERWAY"));
|
||||
player.yellowMessage(">> Size: " + exped.getMembers().size());
|
||||
player.yellowMessage(">> Leader: " + exped.getLeader().getName());
|
||||
int memId = 2;
|
||||
for (MapleCharacter member : exped.getMembers()) {
|
||||
if (exped.isLeader(member)) {
|
||||
continue;
|
||||
}
|
||||
player.yellowMessage(">>> Member " + memId + ": " + member.getName());
|
||||
memId++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
75
src/client/command/commands/v3/FaceCommand.java
Normal file
75
src/client/command/commands/v3/FaceCommand.java
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.MapleStat;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import server.MapleItemInformationProvider;
|
||||
|
||||
public class FaceCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !face [<playername>] <faceid>");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if (params.length == 1) {
|
||||
int itemId = Integer.parseInt(params[0]);
|
||||
if (!(itemId >= 20000 && itemId < 22000) || MapleItemInformationProvider.getInstance().getName(itemId) == null) {
|
||||
player.yellowMessage("Face id '" + params[0] + "' does not exist.");
|
||||
return;
|
||||
}
|
||||
|
||||
player.setFace(itemId);
|
||||
player.updateSingleStat(MapleStat.FACE, itemId);
|
||||
player.equipChanged();
|
||||
} else {
|
||||
int itemId = Integer.parseInt(params[1]);
|
||||
if (!(itemId >= 20000 && itemId < 22000) || MapleItemInformationProvider.getInstance().getName(itemId) == null) {
|
||||
player.yellowMessage("Face id '" + params[1] + "' does not exist.");
|
||||
}
|
||||
|
||||
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||
if (victim == null) {
|
||||
victim.setFace(itemId);
|
||||
victim.updateSingleStat(MapleStat.FACE, itemId);
|
||||
victim.equipChanged();
|
||||
} else {
|
||||
player.yellowMessage("Player '" + params[0] + "' has not been found on this channel.");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
53
src/client/command/commands/v3/FameCommand.java
Normal file
53
src/client/command/commands/v3/FameCommand.java
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.MapleStat;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class FameCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 2) {
|
||||
player.yellowMessage("Syntax: !fame <playername> <gainfame>");
|
||||
return;
|
||||
}
|
||||
|
||||
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||
if (victim != null) {
|
||||
victim.setFame(Integer.parseInt(params[1]));
|
||||
victim.updateSingleStat(MapleStat.FAME, victim.getFame());
|
||||
player.message("FAME given.");
|
||||
} else {
|
||||
player.message("Player '" + params[0] + "' could not be found on this channel.");
|
||||
}
|
||||
}
|
||||
}
|
||||
61
src/client/command/commands/v3/FlyCommand.java
Normal file
61
src/client/command/commands/v3/FlyCommand.java
Normal file
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import net.server.Server;
|
||||
|
||||
public class FlyCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) { // fly option will become available for any character of that account
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !fly <on/off>");
|
||||
return;
|
||||
}
|
||||
|
||||
Integer accid = c.getAccID();
|
||||
Server srv = Server.getInstance();
|
||||
String sendStr = "";
|
||||
if (params[0].equalsIgnoreCase("on")) {
|
||||
sendStr += "Enabled Fly feature (F1). With fly active, you cannot attack.";
|
||||
if (!srv.canFly(accid)) sendStr += " Re-login to take effect.";
|
||||
|
||||
srv.changeFly(c.getAccID(), true);
|
||||
} else {
|
||||
sendStr += "Disabled Fly feature. You can now attack.";
|
||||
if (srv.canFly(accid)) sendStr += " Re-login to take effect.";
|
||||
|
||||
srv.changeFly(c.getAccID(), false);
|
||||
}
|
||||
|
||||
player.dropMessage(6, sendStr);
|
||||
}
|
||||
}
|
||||
60
src/client/command/commands/v3/GiveMesosCommand.java
Normal file
60
src/client/command/commands/v3/GiveMesosCommand.java
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class GiveMesosCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !givems [<playername>] <gainmeso>");
|
||||
return;
|
||||
}
|
||||
|
||||
String recv_;
|
||||
int value_;
|
||||
if (params.length == 2) {
|
||||
recv_ = params[0];
|
||||
value_ = Integer.parseInt(params[1]);
|
||||
} else {
|
||||
recv_ = c.getPlayer().getName();
|
||||
value_ = Integer.parseInt(params[0]);
|
||||
}
|
||||
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(recv_);
|
||||
if (victim != null) {
|
||||
victim.gainMeso(value_, true);
|
||||
player.message("MESO given.");
|
||||
} else {
|
||||
player.message("Player '" + recv_ + "' could not be found on this channel.");
|
||||
}
|
||||
}
|
||||
}
|
||||
61
src/client/command/commands/v3/GiveNxCommand.java
Normal file
61
src/client/command/commands/v3/GiveNxCommand.java
Normal file
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class GiveNxCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !givenx [<playername>] <gainnx>");
|
||||
return;
|
||||
}
|
||||
|
||||
String recv;
|
||||
int value;
|
||||
if (params.length > 1) {
|
||||
recv = params[0];
|
||||
value = Integer.parseInt(params[1]);
|
||||
} else {
|
||||
recv = c.getPlayer().getName();
|
||||
value = Integer.parseInt(params[0]);
|
||||
}
|
||||
|
||||
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(recv);
|
||||
if (victim != null) {
|
||||
victim.getCashShop().gainCash(1, value);
|
||||
player.message("NX given.");
|
||||
} else {
|
||||
player.message("Player '" + recv + "' could not be found on this channel.");
|
||||
}
|
||||
}
|
||||
}
|
||||
51
src/client/command/commands/v3/GiveVpCommand.java
Normal file
51
src/client/command/commands/v3/GiveVpCommand.java
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class GiveVpCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 2) {
|
||||
player.yellowMessage("Syntax: !givevp <playername> <gainvotepoint>");
|
||||
return;
|
||||
}
|
||||
|
||||
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||
if (victim != null) {
|
||||
victim.getClient().addVotePoints(Integer.parseInt(params[1]));
|
||||
player.message("VP given.");
|
||||
} else {
|
||||
player.message("Player '" + params[0] + "' could not be found on this channel.");
|
||||
}
|
||||
}
|
||||
}
|
||||
75
src/client/command/commands/v3/HairCommand.java
Normal file
75
src/client/command/commands/v3/HairCommand.java
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.MapleStat;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import server.MapleItemInformationProvider;
|
||||
|
||||
public class HairCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !hair [<playername>] <hairid>");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if (params.length == 1) {
|
||||
int itemId = Integer.parseInt(params[0]);
|
||||
if (!(itemId >= 30000 && itemId < 35000) || MapleItemInformationProvider.getInstance().getName(itemId) == null) {
|
||||
player.yellowMessage("Hair id '" + params[0] + "' does not exist.");
|
||||
return;
|
||||
}
|
||||
|
||||
player.setHair(itemId);
|
||||
player.updateSingleStat(MapleStat.HAIR, itemId);
|
||||
player.equipChanged();
|
||||
} else {
|
||||
int itemId = Integer.parseInt(params[1]);
|
||||
if (!(itemId >= 30000 && itemId < 35000) || MapleItemInformationProvider.getInstance().getName(itemId) == null) {
|
||||
player.yellowMessage("Hair id '" + params[1] + "' does not exist.");
|
||||
return;
|
||||
}
|
||||
|
||||
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||
if (victim != null) {
|
||||
victim.setHair(itemId);
|
||||
victim.updateSingleStat(MapleStat.HAIR, itemId);
|
||||
victim.equipChanged();
|
||||
} else {
|
||||
player.yellowMessage("Player '" + params[0] + "' has not been found on this channel.");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
48
src/client/command/commands/v3/HealMapCommand.java
Normal file
48
src/client/command/commands/v3/HealMapCommand.java
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.MapleStat;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class HealMapCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
for (MapleCharacter mch : player.getMap().getCharacters()) {
|
||||
if (mch != null) {
|
||||
mch.setHp(mch.getMaxHp());
|
||||
mch.updateSingleStat(MapleStat.HP, mch.getMaxHp());
|
||||
mch.setMp(mch.getMaxMp());
|
||||
mch.updateSingleStat(MapleStat.MP, mch.getMaxMp());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
49
src/client/command/commands/v3/HealPersonCommand.java
Normal file
49
src/client/command/commands/v3/HealPersonCommand.java
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.MapleStat;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class HealPersonCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||
if (victim != null) {
|
||||
victim.setHp(victim.getMaxHp());
|
||||
victim.updateSingleStat(MapleStat.HP, victim.getMaxHp());
|
||||
victim.setMp(victim.getMaxMp());
|
||||
victim.updateSingleStat(MapleStat.MP, victim.getMaxMp());
|
||||
} else {
|
||||
player.message("Player '" + params[0] + "' could not be found on this channel.");
|
||||
}
|
||||
}
|
||||
}
|
||||
62
src/client/command/commands/v3/HpMpCommand.java
Normal file
62
src/client/command/commands/v3/HpMpCommand.java
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.MapleStat;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class HpMpCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
MapleCharacter victim = player;
|
||||
int statUpdate = 1;
|
||||
|
||||
if (params.length == 2) {
|
||||
victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||
statUpdate = Integer.valueOf(params[1]);
|
||||
} else if (params.length == 1) {
|
||||
statUpdate = Integer.valueOf(params[0]);
|
||||
} else {
|
||||
player.yellowMessage("Syntax: !hpmp [<playername>] <value>");
|
||||
}
|
||||
|
||||
if (victim != null) {
|
||||
victim.setHp(statUpdate);
|
||||
victim.setMp(statUpdate);
|
||||
victim.updateSingleStat(MapleStat.HP, statUpdate);
|
||||
victim.updateSingleStat(MapleStat.MP, statUpdate);
|
||||
|
||||
victim.checkBerserk(victim.isHidden());
|
||||
} else {
|
||||
player.message("Player '" + params[0] + "' could not be found on this world.");
|
||||
}
|
||||
}
|
||||
}
|
||||
47
src/client/command/commands/v3/HurtCommand.java
Normal file
47
src/client/command/commands/v3/HurtCommand.java
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.MapleStat;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class HurtCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||
if (victim != null) {
|
||||
victim.setHp(1);
|
||||
victim.updateSingleStat(MapleStat.HP, 1);
|
||||
} else {
|
||||
player.message("Player '" + params[0] + "' could not be found on this channel.");
|
||||
}
|
||||
}
|
||||
}
|
||||
57
src/client/command/commands/v3/IdCommand.java
Normal file
57
src/client/command/commands/v3/IdCommand.java
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.URL;
|
||||
|
||||
public class IdCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !id <id>");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
try (BufferedReader dis = new BufferedReader(new InputStreamReader(new URL("http://www.mapletip.com/search_java.php?search_value=" + params[0] + "&check=true").openConnection().getInputStream()))) {
|
||||
String s;
|
||||
while ((s = dis.readLine()) != null) {
|
||||
player.dropMessage(s);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
61
src/client/command/commands/v3/IgnoreCommand.java
Normal file
61
src/client/command/commands/v3/IgnoreCommand.java
Normal file
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import net.server.Server;
|
||||
import tools.MapleLogger;
|
||||
import tools.MaplePacketCreator;
|
||||
|
||||
public class IgnoreCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !ignore <ign>");
|
||||
return;
|
||||
}
|
||||
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||
if (victim == null) {
|
||||
player.message("Player '" + params[0] + "' could not be found on this world.");
|
||||
return;
|
||||
}
|
||||
boolean monitored_ = MapleLogger.ignored.contains(victim.getName());
|
||||
if (monitored_) {
|
||||
MapleLogger.ignored.remove(victim.getName());
|
||||
} else {
|
||||
MapleLogger.ignored.add(victim.getName());
|
||||
}
|
||||
player.yellowMessage(victim.getName() + " is " + (!monitored_ ? "now being ignored." : "no longer being ignored."));
|
||||
String message_ = player.getName() + (!monitored_ ? " has started ignoring " : " has stopped ignoring ") + victim.getName() + ".";
|
||||
Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.serverNotice(5, message_));
|
||||
|
||||
}
|
||||
}
|
||||
43
src/client/command/commands/v3/IgnoredCommand.java
Normal file
43
src/client/command/commands/v3/IgnoredCommand.java
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import tools.MapleLogger;
|
||||
|
||||
public class IgnoredCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
for (String ign : MapleLogger.ignored) {
|
||||
player.yellowMessage(ign + " is being ignored.");
|
||||
}
|
||||
}
|
||||
}
|
||||
45
src/client/command/commands/v3/InMapCommand.java
Normal file
45
src/client/command/commands/v3/InMapCommand.java
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class InMapCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
String st = "";
|
||||
for (MapleCharacter chr : player.getMap().getCharacters()) {
|
||||
st += chr.getName() + " ";
|
||||
}
|
||||
player.message(st);
|
||||
|
||||
}
|
||||
}
|
||||
57
src/client/command/commands/v3/KillAllCommand.java
Normal file
57
src/client/command/commands/v3/KillAllCommand.java
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import server.life.MapleMonster;
|
||||
import server.maps.MapleMap;
|
||||
import server.maps.MapleMapObject;
|
||||
import server.maps.MapleMapObjectType;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class KillAllCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
MapleMap map = player.getMap();
|
||||
List<MapleMapObject> monsters = map.getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.MONSTER));
|
||||
int count = 0;
|
||||
for (MapleMapObject monstermo : monsters) {
|
||||
MapleMonster monster = (MapleMonster) monstermo;
|
||||
if (!monster.getStats().isFriendly() && !(monster.getId() >= 8810010 && monster.getId() <= 8810018)) {
|
||||
map.damageMonster(player, monster, Integer.MAX_VALUE);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
player.dropMessage(5, "Killed " + count + " monsters.");
|
||||
}
|
||||
}
|
||||
53
src/client/command/commands/v3/KillCommand.java
Normal file
53
src/client/command/commands/v3/KillCommand.java
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import net.server.Server;
|
||||
import tools.MaplePacketCreator;
|
||||
|
||||
public class KillCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !kill <playername>");
|
||||
return;
|
||||
}
|
||||
|
||||
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||
if (victim != null) {
|
||||
victim.setHpMp(0);
|
||||
Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.serverNotice(5, player.getName() + " used !kill on " + victim.getName()));
|
||||
} else {
|
||||
player.message("Player '" + params[0] + "' could not be found on this channel.");
|
||||
}
|
||||
}
|
||||
}
|
||||
44
src/client/command/commands/v3/KillMapCommand.java
Normal file
44
src/client/command/commands/v3/KillMapCommand.java
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.MapleStat;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class KillMapCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
for (MapleCharacter mch : player.getMap().getCharacters()) {
|
||||
mch.setHp(0);
|
||||
mch.updateSingleStat(MapleStat.HP, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
42
src/client/command/commands/v3/MaxEnergyCommand.java
Normal file
42
src/client/command/commands/v3/MaxEnergyCommand.java
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import tools.MaplePacketCreator;
|
||||
|
||||
public class MaxEnergyCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
c.getPlayer().setDojoEnergy(10000);
|
||||
c.announce(MaplePacketCreator.getEnergy("energy", 10000));
|
||||
}
|
||||
}
|
||||
79
src/client/command/commands/v3/MaxHpMpCommand.java
Normal file
79
src/client/command/commands/v3/MaxHpMpCommand.java
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.MapleStat;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import tools.MaplePacketCreator;
|
||||
import tools.Pair;
|
||||
|
||||
public class MaxHpMpCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
MapleCharacter victim = player;
|
||||
int statUpdate = 1;
|
||||
|
||||
if (params.length >= 2) {
|
||||
victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||
statUpdate = Math.max(1, Integer.valueOf(params[1]));
|
||||
} else if (params.length == 1) {
|
||||
statUpdate = Math.max(1, Integer.valueOf(params[0]));
|
||||
} else {
|
||||
player.yellowMessage("Syntax: !maxhpmp [<playername>] <value>");
|
||||
}
|
||||
|
||||
if (victim != null) {
|
||||
List<Pair<MapleStat, Integer>> statup = new ArrayList<>(4);
|
||||
|
||||
if (victim.getHp() > statUpdate) {
|
||||
victim.setHp(statUpdate);
|
||||
statup.add(new Pair<>(MapleStat.HP, statUpdate));
|
||||
}
|
||||
statup.add(new Pair<>(MapleStat.MAXHP, statUpdate));
|
||||
|
||||
if (victim.getMp() > statUpdate) {
|
||||
victim.setMp(statUpdate);
|
||||
statup.add(new Pair<>(MapleStat.MP, statUpdate));
|
||||
}
|
||||
statup.add(new Pair<>(MapleStat.MAXMP, statUpdate));
|
||||
c.announce(MaplePacketCreator.updatePlayerStats(statup, victim));
|
||||
|
||||
victim.setMaxHp(statUpdate);
|
||||
victim.setMaxMp(statUpdate);
|
||||
|
||||
victim.checkBerserk(victim.isHidden());
|
||||
} else {
|
||||
player.message("Player '" + params[0] + "' could not be found on this world.");
|
||||
}
|
||||
}
|
||||
}
|
||||
61
src/client/command/commands/v3/MonitorCommand.java
Normal file
61
src/client/command/commands/v3/MonitorCommand.java
Normal file
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import net.server.Server;
|
||||
import tools.MapleLogger;
|
||||
import tools.MaplePacketCreator;
|
||||
|
||||
public class MonitorCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !monitor <ign>");
|
||||
return;
|
||||
}
|
||||
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||
if (victim == null) {
|
||||
player.message("Player '" + params[0] + "' could not be found on this world.");
|
||||
return;
|
||||
}
|
||||
boolean monitored = MapleLogger.monitored.contains(victim.getName());
|
||||
if (monitored) {
|
||||
MapleLogger.monitored.remove(victim.getName());
|
||||
} else {
|
||||
MapleLogger.monitored.add(victim.getName());
|
||||
}
|
||||
player.yellowMessage(victim.getName() + " is " + (!monitored ? "now being monitored." : "no longer being monitored."));
|
||||
String message = player.getName() + (!monitored ? " has started monitoring " : " has stopped monitoring ") + victim.getName() + ".";
|
||||
Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.serverNotice(5, message));
|
||||
|
||||
}
|
||||
}
|
||||
43
src/client/command/commands/v3/MonitorsCommand.java
Normal file
43
src/client/command/commands/v3/MonitorsCommand.java
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import tools.MapleLogger;
|
||||
|
||||
public class MonitorsCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
for (String ign : MapleLogger.monitored) {
|
||||
player.yellowMessage(ign + " is being monitored.");
|
||||
}
|
||||
}
|
||||
}
|
||||
213
src/client/command/commands/v3/MusicCommand.java
Normal file
213
src/client/command/commands/v3/MusicCommand.java
Normal file
@@ -0,0 +1,213 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import tools.MaplePacketCreator;
|
||||
|
||||
public class MusicCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
final String[] songs = {
|
||||
"Jukebox/Congratulation",
|
||||
"Bgm00/SleepyWood",
|
||||
"Bgm00/FloralLife",
|
||||
"Bgm00/GoPicnic",
|
||||
"Bgm00/Nightmare",
|
||||
"Bgm00/RestNPeace",
|
||||
"Bgm01/AncientMove",
|
||||
"Bgm01/MoonlightShadow",
|
||||
"Bgm01/WhereTheBarlogFrom",
|
||||
"Bgm01/CavaBien",
|
||||
"Bgm01/HighlandStar",
|
||||
"Bgm01/BadGuys",
|
||||
"Bgm02/MissingYou",
|
||||
"Bgm02/WhenTheMorningComes",
|
||||
"Bgm02/EvilEyes",
|
||||
"Bgm02/JungleBook",
|
||||
"Bgm02/AboveTheTreetops",
|
||||
"Bgm03/Subway",
|
||||
"Bgm03/Elfwood",
|
||||
"Bgm03/BlueSky",
|
||||
"Bgm03/Beachway",
|
||||
"Bgm03/SnowyVillage",
|
||||
"Bgm04/PlayWithMe",
|
||||
"Bgm04/WhiteChristmas",
|
||||
"Bgm04/UponTheSky",
|
||||
"Bgm04/ArabPirate",
|
||||
"Bgm04/Shinin'Harbor",
|
||||
"Bgm04/WarmRegard",
|
||||
"Bgm05/WolfWood",
|
||||
"Bgm05/DownToTheCave",
|
||||
"Bgm05/AbandonedMine",
|
||||
"Bgm05/MineQuest",
|
||||
"Bgm05/HellGate",
|
||||
"Bgm06/FinalFight",
|
||||
"Bgm06/WelcomeToTheHell",
|
||||
"Bgm06/ComeWithMe",
|
||||
"Bgm06/FlyingInABlueDream",
|
||||
"Bgm06/FantasticThinking",
|
||||
"Bgm07/WaltzForWork",
|
||||
"Bgm07/WhereverYouAre",
|
||||
"Bgm07/FunnyTimeMaker",
|
||||
"Bgm07/HighEnough",
|
||||
"Bgm07/Fantasia",
|
||||
"Bgm08/LetsMarch",
|
||||
"Bgm08/ForTheGlory",
|
||||
"Bgm08/FindingForest",
|
||||
"Bgm08/LetsHuntAliens",
|
||||
"Bgm08/PlotOfPixie",
|
||||
"Bgm09/DarkShadow",
|
||||
"Bgm09/TheyMenacingYou",
|
||||
"Bgm09/FairyTale",
|
||||
"Bgm09/FairyTalediffvers",
|
||||
"Bgm09/TimeAttack",
|
||||
"Bgm10/Timeless",
|
||||
"Bgm10/TimelessB",
|
||||
"Bgm10/BizarreTales",
|
||||
"Bgm10/TheWayGrotesque",
|
||||
"Bgm10/Eregos",
|
||||
"Bgm11/BlueWorld",
|
||||
"Bgm11/Aquarium",
|
||||
"Bgm11/ShiningSea",
|
||||
"Bgm11/DownTown",
|
||||
"Bgm11/DarkMountain",
|
||||
"Bgm12/AquaCave",
|
||||
"Bgm12/DeepSee",
|
||||
"Bgm12/WaterWay",
|
||||
"Bgm12/AcientRemain",
|
||||
"Bgm12/RuinCastle",
|
||||
"Bgm12/Dispute",
|
||||
"Bgm13/CokeTown",
|
||||
"Bgm13/Leafre",
|
||||
"Bgm13/Minar'sDream",
|
||||
"Bgm13/AcientForest",
|
||||
"Bgm13/TowerOfGoddess",
|
||||
"Bgm14/DragonLoad",
|
||||
"Bgm14/HonTale",
|
||||
"Bgm14/CaveOfHontale",
|
||||
"Bgm14/DragonNest",
|
||||
"Bgm14/Ariant",
|
||||
"Bgm14/HotDesert",
|
||||
"Bgm15/MureungHill",
|
||||
"Bgm15/MureungForest",
|
||||
"Bgm15/WhiteHerb",
|
||||
"Bgm15/Pirate",
|
||||
"Bgm15/SunsetDesert",
|
||||
"Bgm16/Duskofgod",
|
||||
"Bgm16/FightingPinkBeen",
|
||||
"Bgm16/Forgetfulness",
|
||||
"Bgm16/Remembrance",
|
||||
"Bgm16/Repentance",
|
||||
"Bgm16/TimeTemple",
|
||||
"Bgm17/MureungSchool1",
|
||||
"Bgm17/MureungSchool2",
|
||||
"Bgm17/MureungSchool3",
|
||||
"Bgm17/MureungSchool4",
|
||||
"Bgm18/BlackWing",
|
||||
"Bgm18/DrillHall",
|
||||
"Bgm18/QueensGarden",
|
||||
"Bgm18/RaindropFlower",
|
||||
"Bgm18/WolfAndSheep",
|
||||
"Bgm19/BambooGym",
|
||||
"Bgm19/CrystalCave",
|
||||
"Bgm19/MushCatle",
|
||||
"Bgm19/RienVillage",
|
||||
"Bgm19/SnowDrop",
|
||||
"Bgm20/GhostShip",
|
||||
"Bgm20/NetsPiramid",
|
||||
"Bgm20/UnderSubway",
|
||||
"Bgm21/2021year",
|
||||
"Bgm21/2099year",
|
||||
"Bgm21/2215year",
|
||||
"Bgm21/2230year",
|
||||
"Bgm21/2503year",
|
||||
"Bgm21/KerningSquare",
|
||||
"Bgm21/KerningSquareField",
|
||||
"Bgm21/KerningSquareSubway",
|
||||
"Bgm21/TeraForest",
|
||||
"BgmEvent/FunnyRabbit",
|
||||
"BgmEvent/FunnyRabbitFaster",
|
||||
"BgmEvent/wedding",
|
||||
"BgmEvent/weddingDance",
|
||||
"BgmEvent/wichTower",
|
||||
"BgmGL/amoria",
|
||||
"BgmGL/Amorianchallenge",
|
||||
"BgmGL/chapel",
|
||||
"BgmGL/cathedral",
|
||||
"BgmGL/Courtyard",
|
||||
"BgmGL/CrimsonwoodKeep",
|
||||
"BgmGL/CrimsonwoodKeepInterior",
|
||||
"BgmGL/GrandmastersGauntlet",
|
||||
"BgmGL/HauntedHouse",
|
||||
"BgmGL/NLChunt",
|
||||
"BgmGL/NLCtown",
|
||||
"BgmGL/NLCupbeat",
|
||||
"BgmGL/PartyQuestGL",
|
||||
"BgmGL/PhantomForest",
|
||||
"BgmJp/Feeling",
|
||||
"BgmJp/BizarreForest",
|
||||
"BgmJp/Hana",
|
||||
"BgmJp/Yume",
|
||||
"BgmJp/Bathroom",
|
||||
"BgmJp/BattleField",
|
||||
"BgmJp/FirstStepMaster",
|
||||
"BgmMY/Highland",
|
||||
"BgmMY/KualaLumpur",
|
||||
"BgmSG/BoatQuay_field",
|
||||
"BgmSG/BoatQuay_town",
|
||||
"BgmSG/CBD_field",
|
||||
"BgmSG/CBD_town",
|
||||
"BgmSG/Ghostship",
|
||||
"BgmUI/ShopBgm",
|
||||
"BgmUI/Title"
|
||||
};
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !music <song>");
|
||||
for (String s : songs) {
|
||||
player.yellowMessage(s);
|
||||
}
|
||||
return;
|
||||
}
|
||||
String song = joinStringFrom(params, 0);
|
||||
for (String s : songs) {
|
||||
if (s.equals(song)) {
|
||||
player.getMap().broadcastMessage(MaplePacketCreator.musicChange(s));
|
||||
player.yellowMessage("Now playing song " + song + ".");
|
||||
break;
|
||||
}
|
||||
}
|
||||
player.yellowMessage("Song not found, please enter a song below.");
|
||||
for (String s : songs) {
|
||||
player.yellowMessage(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
46
src/client/command/commands/v3/MuteMapCommand.java
Normal file
46
src/client/command/commands/v3/MuteMapCommand.java
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class MuteMapCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (player.getMap().isMuted()) {
|
||||
player.getMap().setMuted(false);
|
||||
player.dropMessage(5, "The map you are in has been un-muted.");
|
||||
} else {
|
||||
player.getMap().setMuted(true);
|
||||
player.dropMessage(5, "The map you are in has been muted.");
|
||||
}
|
||||
}
|
||||
}
|
||||
41
src/client/command/commands/v3/NightCommand.java
Normal file
41
src/client/command/commands/v3/NightCommand.java
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class NightCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
player.getMap().broadcastNightEffect();
|
||||
player.yellowMessage("Done.");
|
||||
}
|
||||
}
|
||||
42
src/client/command/commands/v3/NoticeCommand.java
Normal file
42
src/client/command/commands/v3/NoticeCommand.java
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import net.server.Server;
|
||||
import tools.MaplePacketCreator;
|
||||
|
||||
public class NoticeCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
Server.getInstance().broadcastMessage(c.getWorld(), MaplePacketCreator.serverNotice(6, "[Notice] " + joinStringFrom(params, 0)));
|
||||
}
|
||||
}
|
||||
56
src/client/command/commands/v3/NpcCommand.java
Normal file
56
src/client/command/commands/v3/NpcCommand.java
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import server.life.MapleLifeFactory;
|
||||
import server.life.MapleNPC;
|
||||
import tools.MaplePacketCreator;
|
||||
|
||||
public class NpcCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !npc <npcid>");
|
||||
return;
|
||||
}
|
||||
MapleNPC npc = MapleLifeFactory.getNPC(Integer.parseInt(params[0]));
|
||||
if (npc != null) {
|
||||
npc.setPosition(player.getPosition());
|
||||
npc.setCy(player.getPosition().y);
|
||||
npc.setRx0(player.getPosition().x + 50);
|
||||
npc.setRx1(player.getPosition().x - 50);
|
||||
npc.setFh(player.getMap().getFootholds().findBelow(c.getPlayer().getPosition()).getId());
|
||||
player.getMap().addMapObject(npc);
|
||||
player.getMap().broadcastMessage(MaplePacketCreator.spawnNPC(npc));
|
||||
}
|
||||
}
|
||||
}
|
||||
56
src/client/command/commands/v3/OnlineTwoCommand.java
Normal file
56
src/client/command/commands/v3/OnlineTwoCommand.java
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import net.server.Server;
|
||||
import net.server.channel.Channel;
|
||||
|
||||
public class OnlineTwoCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
int total = 0;
|
||||
for (Channel ch : Server.getInstance().getChannelsFromWorld(player.getWorld())) {
|
||||
int size = ch.getPlayerStorage().getAllCharacters().size();
|
||||
total += size;
|
||||
String s = "(Channel " + ch.getId() + " Online: " + size + ") : ";
|
||||
if (ch.getPlayerStorage().getAllCharacters().size() < 50) {
|
||||
for (MapleCharacter chr : ch.getPlayerStorage().getAllCharacters()) {
|
||||
s += MapleCharacter.makeMapleReadable(chr.getName()) + ", ";
|
||||
}
|
||||
player.dropMessage(6, s.substring(0, s.length() - 2));
|
||||
}
|
||||
}
|
||||
|
||||
//player.dropMessage(6, "There are a total of " + total + " players online.");
|
||||
player.showHint("Players online: #e#r" + total + "#k#n.", 300);
|
||||
}
|
||||
}
|
||||
44
src/client/command/commands/v3/OpenPortalCommand.java
Normal file
44
src/client/command/commands/v3/OpenPortalCommand.java
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
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: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.v3;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
|
||||
public class OpenPortalCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !openportal <portalid>");
|
||||
return;
|
||||
}
|
||||
player.getMap().getPortal(params[0]).setPortalState(true);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user