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:
@@ -1,4 +1,4 @@
|
||||
#**HeavenMS**
|
||||
# HeavenMS
|
||||
|
||||
Credits:
|
||||
|
||||
@@ -96,6 +96,7 @@ Monsters, Maps & Reactors:
|
||||
* Monsterbook displays drop data info conformant with the underlying DB (needs custom wz). See more on the MobBookUpdate feature.
|
||||
* Every skill/mastery book is now droppable by mobs.
|
||||
* Mobs now can drop more than one of the same equipment (number of possible drops defined at droptime, uses the minimum/maximum quantity fields on DB).
|
||||
* Mobs only drops items that are visible/collectable by the player's party.
|
||||
* Redesigned HT mechanics for spawn and linked damage to the sponge.
|
||||
* Limited item count on maps, smartly expiring oldest registered items, preventing potential item flooding.
|
||||
* Implemented Zombify disease status.
|
||||
@@ -131,10 +132,12 @@ Player potentials:
|
||||
* Pet evolutions functional (not GMS-like).
|
||||
* Reviewed keybinding system.
|
||||
* Account's Character slots: either each world has it's own count or there's a shared value between all worlds.
|
||||
* Optional cash shop inventory separated by player classes or fully account-ranged.
|
||||
|
||||
Server potentials:
|
||||
|
||||
* Multi-worlds.
|
||||
* Dynamic world rates, each world can hold it's own rates from server bootup.
|
||||
* Dynamic World/Channel deployment. While not implemented here, new channel deployment sensitive to quantity of online players was originally resinate's idea.
|
||||
* Inventory auto-gather and auto-sorting feature.
|
||||
* Enhanced auto-pot system: pet uses as many potions as necessary to reach the desired threshold.
|
||||
@@ -143,7 +146,7 @@ Server potentials:
|
||||
* Enhanced inventory check: free slots on inventory smartly fetched on demand.
|
||||
* Enhanced auto-loot handler: optimized the brute-force checks for some cash items on the player equipped inventory at every requisition.
|
||||
* Tweaked pet/mount hunger: calculations for fullness/tiredness takes active time of the subject into account.
|
||||
* Consistent experience gain system.
|
||||
* Consistent experience and meso gain system.
|
||||
* NPC crafters (equips, plates/jewels, etc) now won't take items freely if the requirement conditions are not properly met.
|
||||
* Improved Duey mechanics: package received popup and reviewed many delivery mechanics.
|
||||
* Pet item pickup now gives preference to player attacks rather than forcing attack disables when automatically picking up.
|
||||
@@ -178,7 +181,9 @@ Admin/GM commands:
|
||||
|
||||
* Server commands layered by GM levels.
|
||||
* Spawn Zakum/Horntail/Pinkbean.
|
||||
* New commands.
|
||||
* Several new commands.
|
||||
* Rank command highlighting users either by world or server-wide.
|
||||
* Revamped command files layout -- thanks Arthur L.
|
||||
|
||||
External tools:
|
||||
|
||||
@@ -213,6 +218,7 @@ Project:
|
||||
* Improved login phase, using cache over DB queries.
|
||||
* Usage of HikariCP to improve the DB connection management.
|
||||
* Developed many survey tools for content profiling.
|
||||
* Developed a robust anti-exploit login coordinator system.
|
||||
* Protected many flaws with login management system.
|
||||
* Channel, World and Server-wide timer management.
|
||||
* Heavily reviewed future task management inside the project. Way less trivial schedules are spawned now, relieving task overload on the TimerManager.
|
||||
|
||||
@@ -23,6 +23,7 @@ Missing features list:
|
||||
- Some pirate skills doesn't work for 3rd parties.
|
||||
- Cache frequently used SQL data.
|
||||
- Pet commands are not being propagated to 3rd parties, and the commandResponse packet function seems somewhat wonky.
|
||||
- Pet speed.
|
||||
---------------------------
|
||||
|
||||
|
||||
|
||||
+20
-1
@@ -1246,4 +1246,23 @@ Retirado campo de GM da tabela "accounts".
|
||||
Corrigido estatuas do stage1 da GuildPQ nao funcionando corretamente.
|
||||
Alterado varias strings de NPCs e de mensagens utilizando a palavra "evento" querendo dizer instancias (julgamento subjetivo).
|
||||
Adicionado comandos para start, complete e reset quests.
|
||||
Adicionado scripts para meteoritos de Omega Sector.
|
||||
Adicionado scripts para meteoritos de Omega Sector.
|
||||
|
||||
18 - 19 Agosto 2018,
|
||||
Refatorado comandos, desacoplando e distribuindo código para várias classes separadas por GM ranks.
|
||||
Refatorado comando "ranks", não mais requisitando acesso à DB para recuperar informações de ranking.
|
||||
Corrigido comando "ranks" não avaliando donators corretamente.
|
||||
|
||||
20 - 23 Agosto 2018,
|
||||
Implementado mecânica com loot de mobs onde somente itens coletáveis pelo jogador/party podem aparecer.
|
||||
Implementado server flag que permite explorers, cygnus e legends compartilharem mesmo inventário de cash shop.
|
||||
Corrigido método de ganho de mesos ignorando atualização de meso quando há overflow.
|
||||
Implementado suporte para rates específicos pra cada world (exp, meso, drop, quest e travel rates).
|
||||
Adicionado listagem de tipos para o comando de debug.
|
||||
Implementado sistema anti-multicliente e detector de tentativas inautorizadas de acesso a contas durante a fase de login.
|
||||
Corrigido setGender não modificando estado do cliente para não-logado ao cancelar a ação.
|
||||
|
||||
24 Agosto 2018,
|
||||
Melhorado mecânica de logout de líder de party, passando a liderança adiante antes de efetivamente deslogar, permitindo assim instâncias a continuarem após a saída do mesmo, dadas circunstâncias favoráveis.
|
||||
Outra correção no XMLDomMapleData, que ainda continua dando NullPointerExceptions.
|
||||
Corrigido stati de mobs não protegido concorrentemente em certos casos.
|
||||
@@ -111,6 +111,7 @@ function writeFeatureTab_MonstersMapsReactors() {
|
||||
addFeature("Monsterbook displays updated drop data info.");
|
||||
addFeature("Every skill/mastery book is now obtainable.");
|
||||
addFeature("Mobs now can drop more than one of the same equip.");
|
||||
addFeature("Mobs only drop items collectable by the player/party.");
|
||||
addFeature("Redesigned HT mechanics: assemble & dmg taken.");
|
||||
addFeature("Implemented Zombify disease status.");
|
||||
addFeature("Added Boss HP Bar for dozens of bosses.");
|
||||
@@ -146,10 +147,12 @@ function writeFeatureTab_Playerpotentials() {
|
||||
addFeature("Pet evolutions functional (not GMS-like).");
|
||||
addFeature("Reviewed keybinding system.");
|
||||
addFeature("Character slots per world/server-wide.");
|
||||
addFeature("Optional cash shop inventory separated by classes.");
|
||||
}
|
||||
|
||||
function writeFeatureTab_Serverpotentials() {
|
||||
addFeature("Multi-worlds.");
|
||||
addFeature("Each world can hold it's own rates from server bootup.");
|
||||
addFeature("Dynamic World/Channel deployment.");
|
||||
addFeature("Inventory auto-gather and auto-sorting feature.");
|
||||
addFeature("Enhanced auto-pot system: smart pet potion handle.");
|
||||
@@ -158,13 +161,13 @@ function writeFeatureTab_Serverpotentials() {
|
||||
addFeature("Enhanced inventory check: free slots smartly fetched.");
|
||||
addFeature("Enhanced petloot handler: no brute-force inv. checks.");
|
||||
addFeature("Tweaked pet/mount hunger to a balanced growth rate.");
|
||||
addFeature("Consistent experience gain system.");
|
||||
addFeature("Consistent experience and meso gain system.");
|
||||
addFeature("NPC crafters won't take items freely anymore.");
|
||||
addFeature("Duey: pkg rcvd popup and many delivery mechanics.");
|
||||
addFeature("Pet pickup gives preference to player attacks.");
|
||||
addFeature("Channel capacity bar and worlds with capacity check.");
|
||||
addFeature("Diseases visible for others, even after changing maps.");
|
||||
addFeature("Persistent diseases. Players keep their status on login.");
|
||||
addFeature("Persistent diseases. Players keeps status on login.");
|
||||
addFeature("Poison damage value visible for other players.");
|
||||
addFeature("M. book announcer displays info based on demand.");
|
||||
addFeature("Custom jail system.");
|
||||
@@ -182,9 +185,11 @@ function writeFeatureTab_Serverpotentials() {
|
||||
}
|
||||
|
||||
function writeFeatureTab_AdminGMcommands() {
|
||||
addFeature("Server commands layered by GM levels.");
|
||||
addFeature("Spawn Zakum/Horntail/Pinkbean.");
|
||||
addFeature("Several new commands.");
|
||||
addFeature("Rank command highlighting users by world or overall.");
|
||||
addFeature("Server commands layered by GM levels.");
|
||||
addFeature("Revamped command files layout - thanks Arthur L!");
|
||||
}
|
||||
|
||||
function writeFeatureTab_CustomNPCs() {
|
||||
@@ -219,6 +224,7 @@ function writeFeatureTab_Project() {
|
||||
addFeature("Reviewed SQL data, eliminating duplicated entries.");
|
||||
addFeature("Improved login phase, using cache over DB queries.");
|
||||
addFeature("Protected many flaws with login management system.");
|
||||
addFeature("Developed a robust anti-exploit login coordinator.");
|
||||
addFeature("Usage of HikariCP to improve DB connection calls.");
|
||||
addFeature("Developed many survey tools for content profiling.");
|
||||
addFeature("ThreadTracker: runtime tool for deadlock detection.");
|
||||
|
||||
+15
-263
@@ -6,252 +6,18 @@
|
||||
Script: commands.js
|
||||
*/
|
||||
|
||||
importPackage(Packages.client.command);
|
||||
|
||||
var status;
|
||||
|
||||
var common_heading = "@";
|
||||
var staff_heading = "!";
|
||||
|
||||
var comm_lv6 = [];
|
||||
var desc_lv6 = [];
|
||||
|
||||
var comm_lv5 = [];
|
||||
var desc_lv5 = [];
|
||||
|
||||
var comm_lv4 = [];
|
||||
var desc_lv4 = [];
|
||||
|
||||
var comm_lv3 = [];
|
||||
var desc_lv3 = [];
|
||||
|
||||
var comm_lv2 = [];
|
||||
var desc_lv2 = [];
|
||||
|
||||
var comm_lv1 = [];
|
||||
var desc_lv1 = [];
|
||||
|
||||
var comm_lv0 = [];
|
||||
var desc_lv0 = [];
|
||||
|
||||
var levels = ["Common", "Donator", "JrGM", "GM", "SuperGM", "Developer", "Admin"];
|
||||
|
||||
var comm_cursor, desc_cursor;
|
||||
|
||||
function addCommand(comm, desc) {
|
||||
comm_cursor.push(comm);
|
||||
desc_cursor.push(desc);
|
||||
}
|
||||
|
||||
function writeHeavenMSCommandsLv6() { //Admin
|
||||
comm_cursor = comm_lv6;
|
||||
desc_cursor = desc_lv6;
|
||||
|
||||
addCommand("setgmlevel", "");
|
||||
addCommand("warpworld", "");
|
||||
addCommand("saveall", "");
|
||||
addCommand("dcall", "");
|
||||
addCommand("mapplayers", "");
|
||||
addCommand("getacc", "");
|
||||
addCommand("addchannel", "");
|
||||
addCommand("addworld", "");
|
||||
//addCommand("removechannel", "");
|
||||
//addCommand("removeworld", "");
|
||||
addCommand("shutdown", "");
|
||||
addCommand("shutdownnow", "");
|
||||
addCommand("clearquestcache", "");
|
||||
addCommand("clearquest", "");
|
||||
addCommand("spawnallpnpcs", "");
|
||||
addCommand("eraseallpnpcs", "");
|
||||
}
|
||||
|
||||
function writeHeavenMSCommandsLv5() { //Developer
|
||||
comm_cursor = comm_lv5;
|
||||
desc_cursor = desc_lv5;
|
||||
|
||||
addCommand("debugmonster", "");
|
||||
addCommand("debugpacket", "");
|
||||
addCommand("debugportal", "");
|
||||
addCommand("debugspawnpoint", "");
|
||||
addCommand("debugpos", "");
|
||||
addCommand("debugmap", "");
|
||||
addCommand("debugmobsp", "");
|
||||
addCommand("debugevent", "");
|
||||
addCommand("debugareas", "");
|
||||
addCommand("debugreactors", "");
|
||||
addCommand("debugcoupons", "");
|
||||
addCommand("debugplayercoupons", "");
|
||||
addCommand("debugtimer", "");
|
||||
addCommand("debugmarriage", "");
|
||||
addCommand("showpackets", "");
|
||||
addCommand("set", "");
|
||||
}
|
||||
|
||||
function writeHeavenMSCommandsLv4() { //SuperGM
|
||||
comm_cursor = comm_lv4;
|
||||
desc_cursor = desc_lv4;
|
||||
|
||||
addCommand("servermessage", "");
|
||||
addCommand("proitem", "");
|
||||
addCommand("seteqstat", "");
|
||||
addCommand("exprate", "");
|
||||
addCommand("mesorate", "");
|
||||
addCommand("droprate", "");
|
||||
addCommand("questrate", "");
|
||||
addCommand("itemvac", "");
|
||||
addCommand("forcevac", "");
|
||||
addCommand("zakum", "");
|
||||
addCommand("horntail", "");
|
||||
addCommand("pinkbean", "");
|
||||
addCommand("pap", "");
|
||||
addCommand("pianus", "");
|
||||
addCommand("cake", "");
|
||||
addCommand("playernpcremove", "");
|
||||
addCommand("playernpc", "");
|
||||
}
|
||||
|
||||
function writeHeavenMSCommandsLv3() { //GM
|
||||
comm_cursor = comm_lv3;
|
||||
desc_cursor = desc_lv3;
|
||||
|
||||
addCommand("debuff", "");
|
||||
addCommand("fly", "");
|
||||
addCommand("spawn", "");
|
||||
addCommand("mutemap", "");
|
||||
addCommand("checkdmg", "");
|
||||
addCommand("inmap", "");
|
||||
addCommand("reloadevents", "");
|
||||
addCommand("reloaddrops", "");
|
||||
addCommand("reloadportals", "");
|
||||
addCommand("reloadmap", "");
|
||||
addCommand("reloadshops", "");
|
||||
addCommand("hpmp", "");
|
||||
addCommand("maxhpmp", "");
|
||||
addCommand("music", "");
|
||||
addCommand("monitor", "");
|
||||
addCommand("monitors", "");
|
||||
addCommand("ignore", "");
|
||||
addCommand("ignored", "");
|
||||
addCommand("pos", "");
|
||||
addCommand("togglecoupon", "");
|
||||
addCommand("chat", "");
|
||||
addCommand("fame", "");
|
||||
addCommand("givenx", "");
|
||||
addCommand("givevp", "");
|
||||
addCommand("givems", "");
|
||||
addCommand("id", "");
|
||||
addCommand("expeds", "");
|
||||
addCommand("kill", "");
|
||||
addCommand("seed", "");
|
||||
addCommand("maxenergy", "");
|
||||
addCommand("killall", "");
|
||||
addCommand("notice", "");
|
||||
addCommand("rip", "");
|
||||
addCommand("openportal", "");
|
||||
addCommand("closeportal", "");
|
||||
addCommand("pe", "");
|
||||
addCommand("startevent", "");
|
||||
addCommand("endevent", "");
|
||||
addCommand("online2", "");
|
||||
addCommand("warpsnowball", "");
|
||||
addCommand("ban", "");
|
||||
addCommand("unban", "");
|
||||
addCommand("healmap", "");
|
||||
addCommand("healperson", "");
|
||||
addCommand("hurt", "");
|
||||
addCommand("killmap", "");
|
||||
addCommand("night", "");
|
||||
addCommand("npc", "");
|
||||
addCommand("face", "");
|
||||
addCommand("hair", "");
|
||||
addCommand("startquest", "");
|
||||
addCommand("completequest", "");
|
||||
addCommand("resetquest", "");
|
||||
}
|
||||
|
||||
function writeHeavenMSCommandsLv2() { //JrGM
|
||||
comm_cursor = comm_lv2;
|
||||
desc_cursor = desc_lv2;
|
||||
|
||||
addCommand("recharge", "");
|
||||
addCommand("whereami", "");
|
||||
addCommand("hide", "");
|
||||
addCommand("unhide", "");
|
||||
addCommand("sp", "");
|
||||
addCommand("ap", "");
|
||||
addCommand("empowerme", "");
|
||||
addCommand("buffmap", "");
|
||||
addCommand("buff", "");
|
||||
addCommand("bomb", "");
|
||||
addCommand("dc", "");
|
||||
addCommand("cleardrops", "");
|
||||
addCommand("clearslot", "");
|
||||
addCommand("warp", "");
|
||||
addCommand("warpto", "");
|
||||
addCommand("warphere", "");
|
||||
addCommand("reach", "");
|
||||
addCommand("gmshop", "");
|
||||
addCommand("heal", "");
|
||||
addCommand("item", "");
|
||||
addCommand("level", "");
|
||||
addCommand("levelpro", "");
|
||||
addCommand("setstat", "");
|
||||
addCommand("maxstat", "");
|
||||
addCommand("maxskill", "");
|
||||
addCommand("resetskill", "");
|
||||
addCommand("mesos", "");
|
||||
addCommand("search", "");
|
||||
addCommand("jail", "");
|
||||
addCommand("unjail", "");
|
||||
addCommand("job", "");
|
||||
addCommand("unbug", "");
|
||||
}
|
||||
|
||||
function writeHeavenMSCommandsLv1() { //Donator
|
||||
comm_cursor = comm_lv1;
|
||||
desc_cursor = desc_lv1;
|
||||
|
||||
addCommand("bosshp", "");
|
||||
addCommand("mobhp", "");
|
||||
addCommand("whatdropsfrom", "");
|
||||
addCommand("whodrops", "");
|
||||
addCommand("buffme", "");
|
||||
addCommand("goto", "");
|
||||
}
|
||||
|
||||
function writeHeavenMSCommandsLv0() { //Common
|
||||
comm_cursor = comm_lv0;
|
||||
desc_cursor = desc_lv0;
|
||||
|
||||
addCommand("commands", "");
|
||||
addCommand("droplimit", "");
|
||||
addCommand("time", "");
|
||||
addCommand("credits", "");
|
||||
addCommand("uptime", "");
|
||||
addCommand("gacha", "");
|
||||
addCommand("dispose", "");
|
||||
addCommand("equiplv", "");
|
||||
addCommand("showrates", "");
|
||||
addCommand("rates", "");
|
||||
addCommand("online", "");
|
||||
addCommand("gm", "");
|
||||
addCommand("reportbug", "");
|
||||
//addCommand("points", "");
|
||||
addCommand("joinevent", "");
|
||||
addCommand("leaveevent", "");
|
||||
addCommand("ranks", "");
|
||||
addCommand("str", "");
|
||||
addCommand("dex", "");
|
||||
addCommand("int", "");
|
||||
addCommand("luk", "");
|
||||
}
|
||||
var commands;
|
||||
|
||||
function writeHeavenMSCommands() {
|
||||
writeHeavenMSCommandsLv0(); //Common
|
||||
writeHeavenMSCommandsLv1(); //Donator
|
||||
writeHeavenMSCommandsLv2(); //JrGM
|
||||
writeHeavenMSCommandsLv3(); //GM
|
||||
writeHeavenMSCommandsLv4(); //Developer
|
||||
writeHeavenMSCommandsLv5(); //SuperGM
|
||||
writeHeavenMSCommandsLv6(); //Admin
|
||||
commands = CommandsExecutor.getInstance().getGmCommands();
|
||||
}
|
||||
|
||||
function start() {
|
||||
@@ -282,33 +48,19 @@ function action(mode, type, selection) {
|
||||
cm.sendSimple(sendStr);
|
||||
} else if(status == 1) {
|
||||
var lvComm, lvDesc, lvHead = (cm.getPlayer().gmLevel() < 2) ? common_heading : staff_heading;
|
||||
|
||||
if(selection == 0) {
|
||||
lvComm = comm_lv0;
|
||||
lvDesc = desc_lv0;
|
||||
} else if(selection == 1) {
|
||||
lvComm = comm_lv1;
|
||||
lvDesc = desc_lv1;
|
||||
} else if(selection == 2) {
|
||||
lvComm = comm_lv2;
|
||||
lvDesc = desc_lv2;
|
||||
} else if(selection == 3) {
|
||||
lvComm = comm_lv3;
|
||||
lvDesc = desc_lv3;
|
||||
} else if(selection == 4) {
|
||||
lvComm = comm_lv4;
|
||||
lvDesc = desc_lv4;
|
||||
} else if(selection == 5) {
|
||||
lvComm = comm_lv5;
|
||||
lvDesc = desc_lv5;
|
||||
} else {
|
||||
lvComm = comm_lv6;
|
||||
lvDesc = desc_lv6;
|
||||
|
||||
if(selection > 6) {
|
||||
selection = 6;
|
||||
} else if(selection < 0) {
|
||||
selection = 0;
|
||||
}
|
||||
|
||||
|
||||
lvComm = commands.get(selection).getLeft();
|
||||
lvDesc = commands.get(selection).getRight();
|
||||
|
||||
var sendStr = "The following commands are available for #b" + levels[selection] + "#k:\r\n\r\n";
|
||||
for(var i = 0; i < lvComm.length; i++) {
|
||||
sendStr += " #L" + i + "# " + lvHead + lvComm[i] + " - " + lvDesc[i];
|
||||
for(var i = 0; i < lvComm.size(); i++) {
|
||||
sendStr += " #L" + i + "# " + lvHead + lvComm.get(i) + " - " + lvDesc.get(i);
|
||||
sendStr += "#l\r\n";
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ function writeServerStaff_MoopleDEV() {
|
||||
}
|
||||
|
||||
function writeServerStaff_MetroMS() {
|
||||
addPerson("Moongra", "Developer");
|
||||
addPerson("Moogra", "Developer");
|
||||
setHistory(2009, 2010);
|
||||
}
|
||||
|
||||
@@ -73,6 +73,7 @@ function writeServerStaff_BubblesDEV() {
|
||||
|
||||
function writeServerStaff_ThePackII() {
|
||||
addPerson("Hofer", "Developer");
|
||||
addPerson("Moogra", "Developer");
|
||||
setHistory(2008, 2009);
|
||||
}
|
||||
|
||||
|
||||
+7
-9
@@ -1,4 +1,4 @@
|
||||
#EXECUTE THIS FIRST, THEN NEXT SQL: 'db_drops.sql'
|
||||
#EXECUTE THIS FIRST, THEN NEXT SQL: 'db_drops.sql'
|
||||
|
||||
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
||||
SET time_zone = "+00:00";
|
||||
@@ -44,7 +44,7 @@ CREATE TABLE IF NOT EXISTS `accounts` (
|
||||
`hwid` varchar(12) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `name` (`name`),
|
||||
KEY `ranking1` (`id`,`banned`,`gm`),
|
||||
KEY `ranking1` (`id`,`banned`),
|
||||
INDEX (id, name),
|
||||
INDEX (id, nxCredit, maplePoint, nxPrepaid)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
|
||||
@@ -13005,14 +13005,12 @@ CREATE TABLE IF NOT EXISTS `ipbans` (
|
||||
PRIMARY KEY (`ipbanid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `iplog` (
|
||||
`iplogid` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
CREATE TABLE IF NOT EXISTS `ipaccounts` (
|
||||
`accountid` int(11) NOT NULL DEFAULT '0',
|
||||
`ip` varchar(30) NOT NULL DEFAULT '',
|
||||
`login` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`iplogid`),
|
||||
KEY `accountid` (`accountid`,`ip`),
|
||||
KEY `ip` (`ip`)
|
||||
`ip` varchar(40) NOT NULL DEFAULT '',
|
||||
`relevance` tinyint(2) NOT NULL DEFAULT '0',
|
||||
`expiresat` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`accountid`,`ip`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `keymap` (
|
||||
|
||||
@@ -77,6 +77,7 @@ import server.events.gm.MapleFitness;
|
||||
import server.events.gm.MapleOla;
|
||||
import server.life.MapleMonster;
|
||||
import server.life.MobSkill;
|
||||
import server.loot.MapleLootManager;
|
||||
import server.maps.AbstractAnimatedMapleMapObject;
|
||||
import server.maps.MapleHiredMerchant;
|
||||
import server.maps.MapleDoor;
|
||||
@@ -92,6 +93,7 @@ import server.maps.MaplePlayerShop;
|
||||
import server.maps.MaplePlayerShopItem;
|
||||
import server.maps.MapleSummon;
|
||||
import server.life.MaplePlayerNPC;
|
||||
import server.life.MonsterDropEntry;
|
||||
import server.maps.SavedLocation;
|
||||
import server.maps.SavedLocationType;
|
||||
import server.partyquest.MonsterCarnival;
|
||||
@@ -279,7 +281,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
||||
private Lock chrLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_CHR, true);
|
||||
private Lock effLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_EFF, true);
|
||||
private Lock evtLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_EVT, true);
|
||||
private Lock petLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_PET, true); // for quest tasks as well
|
||||
private Lock petLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_PET, true); // for meso & quest tasks as well
|
||||
private Lock prtLock = MonitoredReentrantLockFactory.createLock(MonitoredLockType.CHARACTER_PRT);
|
||||
private Map<Integer, Set<Integer>> excluded = new LinkedHashMap<>();
|
||||
private Set<Integer> excludedItems = new LinkedHashSet<>();
|
||||
@@ -1852,7 +1854,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mapitem.getQuest() > 0 && !this.needQuestItem(mapitem.getQuest(), mapitem.getItemId())) {
|
||||
if (!this.needQuestItem(mapitem.getQuest(), mapitem.getItemId())) {
|
||||
client.announce(MaplePacketCreator.showItemUnavailable());
|
||||
client.announce(MaplePacketCreator.enableActions());
|
||||
return;
|
||||
@@ -1984,13 +1986,15 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
||||
public void deleteGuild(int guildId) {
|
||||
try {
|
||||
Connection con = DatabaseConnection.getConnection();
|
||||
try (PreparedStatement ps = con.prepareStatement("UPDATE characters SET guildid = 0, guildrank = 5 WHERE guildid = ?")) {
|
||||
ps.setInt(1, guildId);
|
||||
ps.execute();
|
||||
}
|
||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM guilds WHERE guildid = ?")) {
|
||||
ps.setInt(1, id);
|
||||
ps.execute();
|
||||
try {
|
||||
try (PreparedStatement ps = con.prepareStatement("UPDATE characters SET guildid = 0, guildrank = 5 WHERE guildid = ?")) {
|
||||
ps.setInt(1, guildId);
|
||||
ps.execute();
|
||||
}
|
||||
try (PreparedStatement ps = con.prepareStatement("DELETE FROM guilds WHERE guildid = ?")) {
|
||||
ps.setInt(1, id);
|
||||
ps.execute();
|
||||
}
|
||||
} finally {
|
||||
con.close();
|
||||
}
|
||||
@@ -2897,13 +2901,27 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
||||
}
|
||||
|
||||
public void gainMeso(int gain, boolean show, boolean enableActions, boolean inChat) {
|
||||
if (meso.get() + gain < 0) {
|
||||
client.announce(MaplePacketCreator.enableActions());
|
||||
return;
|
||||
long nextMeso;
|
||||
petLock.lock();
|
||||
try {
|
||||
nextMeso = meso.get() + gain;
|
||||
if (nextMeso > Integer.MAX_VALUE) {
|
||||
gain -= (nextMeso - Integer.MAX_VALUE);
|
||||
} else if (nextMeso < 0) {
|
||||
gain = -meso.get();
|
||||
}
|
||||
nextMeso = meso.addAndGet(gain);
|
||||
} finally {
|
||||
petLock.unlock();
|
||||
}
|
||||
updateSingleStat(MapleStat.MESO, meso.addAndGet(gain), enableActions);
|
||||
if (show) {
|
||||
client.announce(MaplePacketCreator.getShowMesoGain(gain, inChat));
|
||||
|
||||
if (gain != 0) {
|
||||
updateSingleStat(MapleStat.MESO, (int) nextMeso, enableActions);
|
||||
if (show) {
|
||||
client.announce(MaplePacketCreator.getShowMesoGain(gain, inChat));
|
||||
}
|
||||
} else {
|
||||
client.announce(MaplePacketCreator.enableActions());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4817,6 +4835,18 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public List<MonsterDropEntry> retrieveRelevantDrops(int monsterId) {
|
||||
List<MapleCharacter> pchars = new LinkedList<>();
|
||||
for (MapleCharacter chr : getPartyMembers()) {
|
||||
if (chr.isLoggedinWorld()) {
|
||||
pchars.add(chr);
|
||||
}
|
||||
}
|
||||
|
||||
if(pchars.isEmpty()) pchars.add(this);
|
||||
return MapleLootManager.retrieveRelevantDrops(monsterId, pchars);
|
||||
}
|
||||
|
||||
public MaplePlayerShop getPlayerShop() {
|
||||
return playerShop;
|
||||
|
||||
+96
-75
@@ -48,6 +48,8 @@ import tools.*;
|
||||
import javax.script.ScriptEngine;
|
||||
|
||||
import net.server.Server;
|
||||
import net.server.coordinator.MapleSessionCoordinator;
|
||||
import net.server.coordinator.MapleSessionCoordinator.AntiMulticlientResult;
|
||||
import net.server.channel.Channel;
|
||||
import net.server.guild.MapleGuild;
|
||||
import net.server.guild.MapleGuildCharacter;
|
||||
@@ -88,7 +90,7 @@ public class MapleClient {
|
||||
private final IoSession session;
|
||||
private MapleCharacter player;
|
||||
private int channel = 1;
|
||||
private int accId = 1;
|
||||
private int accId = 0;
|
||||
private boolean loggedIn = false;
|
||||
private boolean serverTransition = false;
|
||||
private Calendar birthday = null;
|
||||
@@ -462,7 +464,7 @@ public class MapleClient {
|
||||
public boolean checkPin(String other) {
|
||||
pinattempt++;
|
||||
if (pinattempt > 5) {
|
||||
session.close(false);
|
||||
MapleSessionCoordinator.getInstance().closeSession(session, false);
|
||||
}
|
||||
if (pin.equals(other)) {
|
||||
pinattempt = 0;
|
||||
@@ -496,7 +498,7 @@ public class MapleClient {
|
||||
|
||||
picattempt++;
|
||||
if (picattempt > 5) {
|
||||
session.close(false);
|
||||
MapleSessionCoordinator.getInstance().closeSession(session, false);
|
||||
}
|
||||
if (pic.equals(other)) {
|
||||
picattempt = 0;
|
||||
@@ -508,7 +510,7 @@ public class MapleClient {
|
||||
public int login(String login, String pwd) {
|
||||
loginattempt++;
|
||||
if (loginattempt > 4) {
|
||||
session.close(false);
|
||||
MapleSessionCoordinator.getInstance().closeSession(session, false);
|
||||
}
|
||||
int loginok = 5;
|
||||
Connection con = null;
|
||||
@@ -549,10 +551,6 @@ public class MapleClient {
|
||||
loggedIn = false;
|
||||
loginok = 4;
|
||||
}
|
||||
ps = con.prepareStatement("INSERT INTO iplog (accountid, ip) VALUES (?, ?)");
|
||||
ps.setInt(1, accId);
|
||||
ps.setString(2, session.getRemoteAddress().toString());
|
||||
ps.executeUpdate();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
@@ -571,10 +569,36 @@ public class MapleClient {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (loginok == 0) {
|
||||
loginattempt = 0;
|
||||
}
|
||||
return loginok;
|
||||
|
||||
if (loginok == 0 || loginok == 4) {
|
||||
AntiMulticlientResult res = MapleSessionCoordinator.getInstance().attemptSessionLogin(session, accId, loginok == 4);
|
||||
|
||||
switch (res) {
|
||||
case SUCCESS:
|
||||
if (loginok == 0) {
|
||||
loginattempt = 0;
|
||||
}
|
||||
|
||||
return loginok;
|
||||
|
||||
case REMOTE_LOGGEDIN:
|
||||
return 17;
|
||||
|
||||
case REMOTE_REACHED_LIMIT:
|
||||
return 13;
|
||||
|
||||
case REMOTE_PROCESSING:
|
||||
return 10;
|
||||
|
||||
case MANY_ACCOUNT_ATTEMPTS:
|
||||
return 16;
|
||||
|
||||
default:
|
||||
return 8;
|
||||
}
|
||||
} else {
|
||||
return loginok;
|
||||
}
|
||||
}
|
||||
|
||||
public Calendar getTempBanCalendar() {
|
||||
@@ -717,13 +741,15 @@ public class MapleClient {
|
||||
|
||||
public void updateLoginState(int newstate) {
|
||||
try {
|
||||
Connection con = DatabaseConnection.getConnection();
|
||||
try (PreparedStatement ps = con.prepareStatement("UPDATE accounts SET loggedin = ?, lastlogin = CURRENT_TIMESTAMP() WHERE id = ?")) {
|
||||
Connection con = DatabaseConnection.getConnection();
|
||||
try (PreparedStatement ps = con.prepareStatement("UPDATE accounts SET loggedin = ?, lastlogin = ? WHERE id = ?")) {
|
||||
// using sql currenttime here could potentially break the login, thanks Arnah for pointing this out
|
||||
|
||||
ps.setInt(1, newstate);
|
||||
ps.setInt(2, getAccID());
|
||||
ps.setTimestamp(2, new java.sql.Timestamp(Server.getInstance().getCurrentTime()));
|
||||
ps.setInt(3, getAccID());
|
||||
ps.executeUpdate();
|
||||
}
|
||||
|
||||
con.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
@@ -731,6 +757,7 @@ public class MapleClient {
|
||||
if (newstate == LOGIN_NOTLOGGEDIN) {
|
||||
loggedIn = false;
|
||||
serverTransition = false;
|
||||
setAccID(0);
|
||||
} else {
|
||||
serverTransition = (newstate == LOGIN_SERVER_TRANSITION);
|
||||
loggedIn = !serverTransition;
|
||||
@@ -756,9 +783,9 @@ public class MapleClient {
|
||||
|
||||
int state = rs.getInt("loggedin");
|
||||
if (state == LOGIN_SERVER_TRANSITION) {
|
||||
// Arnah's note: lastlogin is a date-type, in case of login and game servers being of different timezones this becomes broken
|
||||
if (rs.getTimestamp("lastlogin").getTime() + 30000 < System.currentTimeMillis()) {
|
||||
if (rs.getTimestamp("lastlogin").getTime() + 30000 < Server.getInstance().getCurrentTime()) {
|
||||
state = LOGIN_NOTLOGGEDIN;
|
||||
MapleSessionCoordinator.getInstance().closeSession(session, null);
|
||||
updateLoginState(LOGIN_NOTLOGGEDIN);
|
||||
}
|
||||
} else if (state == LOGIN_LOGGEDIN && player == null) {
|
||||
@@ -791,7 +818,30 @@ public class MapleClient {
|
||||
return date.get(Calendar.YEAR) == birthday.get(Calendar.YEAR) && date.get(Calendar.MONTH) == birthday.get(Calendar.MONTH) && date.get(Calendar.DAY_OF_MONTH) == birthday.get(Calendar.DAY_OF_MONTH);
|
||||
}
|
||||
|
||||
private void removePlayer() {
|
||||
private void removePartyPlayer(World wserv) {
|
||||
MapleMap map = player.getMap();
|
||||
final MapleParty party = player.getParty();
|
||||
final int idz = player.getId();
|
||||
final MaplePartyCharacter chrp = new MaplePartyCharacter(player);
|
||||
|
||||
if (party != null) {
|
||||
chrp.setOnline(false);
|
||||
wserv.updateParty(party.getId(), PartyOperation.LOG_ONOFF, chrp);
|
||||
if (party.getLeader().getId() == idz && map != null) {
|
||||
MaplePartyCharacter lchr = null;
|
||||
for (MaplePartyCharacter pchr : party.getMembers()) {
|
||||
if (pchr != null && pchr.getId() != idz && (lchr == null || lchr.getLevel() <= pchr.getLevel()) && map.getCharacterById(pchr.getId()) != null) {
|
||||
lchr = pchr;
|
||||
}
|
||||
}
|
||||
if (lchr != null) {
|
||||
wserv.updateParty(party.getId(), PartyOperation.CHANGE_LEADER, lchr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void removePlayer(World wserv) {
|
||||
try {
|
||||
player.setDisconnectedFromChannelWorld();
|
||||
player.notifyMapTransferToPartner(-1);
|
||||
@@ -799,11 +849,14 @@ public class MapleClient {
|
||||
|
||||
player.closePlayerInteractions();
|
||||
QuestScriptManager.getInstance().dispose(this);
|
||||
|
||||
|
||||
removePartyPlayer(wserv);
|
||||
|
||||
EventInstanceManager eim = player.getEventInstance();
|
||||
if (eim != null) {
|
||||
eim.playerDisconnected(player);
|
||||
}
|
||||
|
||||
if (player.getMap() != null) {
|
||||
int mapId = player.getMapId();
|
||||
player.getMap().removePlayer(player);
|
||||
@@ -823,37 +876,33 @@ public class MapleClient {
|
||||
}
|
||||
disconnecting = true;
|
||||
if (player != null && player.isLoggedin() && player.getClient() != null) {
|
||||
MapleMap map = player.getMap();
|
||||
final MapleParty party = player.getParty();
|
||||
final int idz = player.getId();
|
||||
final int messengerid = player.getMessenger() == null ? 0 : player.getMessenger().getId();
|
||||
//final int fid = player.getFamilyId();
|
||||
final BuddyList bl = player.getBuddylist();
|
||||
final MaplePartyCharacter chrp = new MaplePartyCharacter(player);
|
||||
final MapleMessengerCharacter chrm = new MapleMessengerCharacter(player, 0);
|
||||
final MapleGuildCharacter chrg = player.getMGC();
|
||||
final MapleGuild guild = player.getGuild();
|
||||
|
||||
player.cancelMagicDoor();
|
||||
|
||||
final World wserv = getWorldServer();
|
||||
if (channel == -1 || shutdown) {
|
||||
if(chrg != null) chrg.setCharacter(null);
|
||||
|
||||
if(wserv != null) wserv.removePlayer(player);
|
||||
removePlayer();
|
||||
|
||||
player.saveCooldowns();
|
||||
player.cancelAllDebuffs();
|
||||
player.saveCharToDB(true);
|
||||
|
||||
clear();
|
||||
return;
|
||||
}
|
||||
|
||||
removePlayer();
|
||||
|
||||
final World wserv = getWorldServer(); // obviously wserv is NOT null if this player was online on it
|
||||
try {
|
||||
if (channel == -1 || shutdown) {
|
||||
if(chrg != null) chrg.setCharacter(null);
|
||||
|
||||
wserv.removePlayer(player);
|
||||
removePlayer(wserv);
|
||||
|
||||
player.saveCooldowns();
|
||||
player.cancelAllDebuffs();
|
||||
player.saveCharToDB(true);
|
||||
|
||||
clear();
|
||||
return;
|
||||
}
|
||||
|
||||
removePlayer(wserv);
|
||||
|
||||
if (!cashshop) {
|
||||
if (!this.serverTransition) { // meaning not changing channels
|
||||
if (messengerid > 0) {
|
||||
@@ -878,42 +927,12 @@ public class MapleClient {
|
||||
server.setGuildMemberOnline(player, false, player.getClient().getChannel());
|
||||
player.getClient().announce(MaplePacketCreator.showGuildInfo(player));
|
||||
}
|
||||
if (party != null) {
|
||||
chrp.setOnline(false);
|
||||
wserv.updateParty(party.getId(), PartyOperation.LOG_ONOFF, chrp);
|
||||
if (map != null && party.getLeader().getId() == idz) {
|
||||
MaplePartyCharacter lchr = null;
|
||||
for (MaplePartyCharacter pchr : party.getMembers()) {
|
||||
if (pchr != null && map.getCharacterById(pchr.getId()) != null && (lchr == null || lchr.getLevel() <= pchr.getLevel())) {
|
||||
lchr = pchr;
|
||||
}
|
||||
}
|
||||
if (lchr != null) {
|
||||
wserv.updateParty(party.getId(), PartyOperation.CHANGE_LEADER, lchr);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (bl != null) {
|
||||
wserv.loggedOff(player.getName(), player.getId(), channel, player.getBuddylist().getBuddyIds());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!this.serverTransition) { // if dc inside of cash shop.
|
||||
if (party != null) {
|
||||
chrp.setOnline(false);
|
||||
wserv.updateParty(party.getId(), PartyOperation.LOG_ONOFF, chrp);
|
||||
if (map != null && party.getLeader().getId() == idz) {
|
||||
MaplePartyCharacter lchr = null;
|
||||
for (MaplePartyCharacter pchr : party.getMembers()) {
|
||||
if (pchr != null && map.getCharacterById(pchr.getId()) != null && (lchr == null || lchr.getLevel() <= pchr.getLevel())) {
|
||||
lchr = pchr;
|
||||
}
|
||||
}
|
||||
if (lchr != null) {
|
||||
wserv.updateParty(party.getId(), PartyOperation.CHANGE_LEADER, lchr);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!this.serverTransition) { // if dc inside of cash shop.
|
||||
if (bl != null) {
|
||||
wserv.loggedOff(player.getName(), player.getId(), channel, player.getBuddylist().getBuddyIds());
|
||||
}
|
||||
@@ -943,10 +962,10 @@ public class MapleClient {
|
||||
}
|
||||
}
|
||||
if (!serverTransition && isLoggedIn()) {
|
||||
MapleSessionCoordinator.getInstance().closeSession(session, false);
|
||||
updateLoginState(MapleClient.LOGIN_NOTLOGGEDIN);
|
||||
session.removeAttribute(MapleClient.CLIENT_KEY); // prevents double dcing during login
|
||||
session.close(false);
|
||||
|
||||
|
||||
clear();
|
||||
} else {
|
||||
engines.clear();
|
||||
@@ -1026,7 +1045,9 @@ public class MapleClient {
|
||||
try {
|
||||
if (lastPong < timeThen) {
|
||||
if (session != null && session.isConnected()) {
|
||||
session.close(false);
|
||||
MapleSessionCoordinator.getInstance().closeSession(session, false);
|
||||
updateLoginState(MapleClient.LOGIN_NOTLOGGEDIN);
|
||||
session.removeAttribute(MapleClient.CLIENT_KEY);
|
||||
}
|
||||
}
|
||||
} catch (NullPointerException e) {
|
||||
|
||||
@@ -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
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
@@ -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)]);
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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() + ".");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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!");
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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()));
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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>");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
@@ -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) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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") + ".");
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
@@ -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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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) {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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_));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user