From 2d8105b6d7da9be21ab8f2c618a2006ad812bc1d Mon Sep 17 00:00:00 2001 From: MarloDelatorre Date: Fri, 23 Aug 2024 17:18:32 -0700 Subject: [PATCH] Remove in game commands --- scripts/npc/commands.js | 72 --- src/main/java/client/command/Command.java | 62 -- .../java/client/command/CommandsExecutor.java | 561 ------------------ .../command/commands/gm0/DisposeCommand.java | 45 -- .../commands/gm0/DropLimitCommand.java | 45 -- .../command/commands/gm0/EquipLvCommand.java | 38 -- .../command/commands/gm0/GachaCommand.java | 69 --- .../command/commands/gm0/GmCommand.java | 63 -- .../command/commands/gm0/HelpCommand.java | 39 -- .../commands/gm0/JoinEventCommand.java | 69 --- .../commands/gm0/LeaveEventCommand.java | 59 -- .../commands/gm0/MapOwnerClaimCommand.java | 76 --- .../command/commands/gm0/OnlineCommand.java | 49 -- .../command/commands/gm0/RanksCommand.java | 48 -- .../command/commands/gm0/RatesCommand.java | 52 -- .../commands/gm0/ReadPointsCommand.java | 38 -- .../commands/gm0/ReportBugCommand.java | 56 -- .../commands/gm0/ShowRatesCommand.java | 81 --- .../command/commands/gm0/StaffCommand.java | 39 -- .../command/commands/gm0/StatDexCommand.java | 56 -- .../command/commands/gm0/StatIntCommand.java | 56 -- .../command/commands/gm0/StatLukCommand.java | 56 -- .../command/commands/gm0/StatStrCommand.java | 56 -- .../command/commands/gm0/TimeCommand.java | 45 -- .../commands/gm0/ToggleExpCommand.java | 44 -- .../command/commands/gm0/UptimeCommand.java | 49 -- .../command/commands/gm1/BossHpCommand.java | 52 -- .../command/commands/gm1/BuffMeCommand.java | 46 -- .../command/commands/gm1/GotoCommand.java | 129 ---- .../command/commands/gm1/MobHpCommand.java | 46 -- .../commands/gm1/WhatDropsFromCommand.java | 78 --- .../command/commands/gm1/WhoDropsCommand.java | 96 --- .../command/commands/gm2/ApCommand.java | 69 --- .../command/commands/gm2/BombCommand.java | 54 -- .../command/commands/gm2/BuffCommand.java | 51 -- .../command/commands/gm2/BuffMapCommand.java | 46 -- .../commands/gm2/ClearDropsCommand.java | 41 -- .../gm2/ClearSavedLocationsCommand.java | 56 -- .../commands/gm2/ClearSlotCommand.java | 140 ----- .../command/commands/gm2/DcCommand.java | 65 -- .../commands/gm2/EmpowerMeCommand.java | 44 -- .../commands/gm2/GachaListCommand.java | 37 -- .../command/commands/gm2/GmShopCommand.java | 39 -- .../command/commands/gm2/HealCommand.java | 41 -- .../command/commands/gm2/HideCommand.java | 42 -- .../command/commands/gm2/IdCommand.java | 143 ----- .../command/commands/gm2/ItemCommand.java | 92 --- .../command/commands/gm2/ItemDropCommand.java | 120 ---- .../command/commands/gm2/JailCommand.java | 75 --- .../command/commands/gm2/JobCommand.java | 67 --- .../command/commands/gm2/LevelCommand.java | 55 -- .../command/commands/gm2/LevelProCommand.java | 46 -- .../command/commands/gm2/LootCommand.java | 52 -- .../command/commands/gm2/MaxSkillCommand.java | 65 -- .../command/commands/gm2/MaxStatCommand.java | 54 -- .../command/commands/gm2/MobSkillCommand.java | 40 -- .../command/commands/gm2/ReachCommand.java | 57 -- .../command/commands/gm2/RechargeCommand.java | 60 -- .../commands/gm2/ResetSkillCommand.java | 65 -- .../command/commands/gm2/SearchCommand.java | 139 ----- .../command/commands/gm2/SetSlotCommand.java | 55 -- .../command/commands/gm2/SetStatCommand.java | 56 -- .../command/commands/gm2/SpCommand.java | 71 --- .../command/commands/gm2/SummonCommand.java | 85 --- .../command/commands/gm2/UnBugCommand.java | 39 -- .../command/commands/gm2/UnHideCommand.java | 42 -- .../command/commands/gm2/UnJailCommand.java | 56 -- .../command/commands/gm2/WarpAreaCommand.java | 68 --- .../command/commands/gm2/WarpCommand.java | 72 --- .../command/commands/gm2/WarpMapCommand.java | 63 -- .../command/commands/gm2/WhereaMiCommand.java | 94 --- .../command/commands/gm3/BanCommand.java | 86 --- .../command/commands/gm3/ChatCommand.java | 41 -- .../command/commands/gm3/CheckDmgCommand.java | 60 -- .../commands/gm3/ClosePortalCommand.java | 44 -- .../command/commands/gm3/DebuffCommand.java | 111 ---- .../command/commands/gm3/EndEventCommand.java | 41 -- .../command/commands/gm3/ExpedsCommand.java | 70 --- .../command/commands/gm3/FaceCommand.java | 76 --- .../command/commands/gm3/FameCommand.java | 53 -- .../command/commands/gm3/FlyCommand.java | 65 -- .../commands/gm3/GiveMesosCommand.java | 77 --- .../command/commands/gm3/GiveNxCommand.java | 83 --- .../command/commands/gm3/GiveRpCommand.java | 29 - .../command/commands/gm3/GiveVpCommand.java | 51 -- .../command/commands/gm3/HairCommand.java | 76 --- .../command/commands/gm3/HealMapCommand.java | 44 -- .../commands/gm3/HealPersonCommand.java | 45 -- .../command/commands/gm3/HpMpCommand.java | 56 -- .../command/commands/gm3/HurtCommand.java | 45 -- .../command/commands/gm3/IgnoreCommand.java | 57 -- .../command/commands/gm3/IgnoredCommand.java | 43 -- .../command/commands/gm3/InMapCommand.java | 45 -- .../command/commands/gm3/KillAllCommand.java | 58 -- .../command/commands/gm3/KillCommand.java | 53 -- .../command/commands/gm3/KillMapCommand.java | 42 -- .../commands/gm3/MaxEnergyCommand.java | 42 -- .../command/commands/gm3/MaxHpMpCommand.java | 62 -- .../command/commands/gm3/MonitorCommand.java | 56 -- .../command/commands/gm3/MonitorsCommand.java | 43 -- .../command/commands/gm3/MusicCommand.java | 76 --- .../command/commands/gm3/MuteMapCommand.java | 46 -- .../command/commands/gm3/NightCommand.java | 41 -- .../command/commands/gm3/NoticeCommand.java | 42 -- .../command/commands/gm3/NpcCommand.java | 56 -- .../commands/gm3/OnlineTwoCommand.java | 56 -- .../commands/gm3/OpenPortalCommand.java | 44 -- .../command/commands/gm3/PeCommand.java | 81 --- .../command/commands/gm3/PosCommand.java | 44 -- .../commands/gm3/QuestCompleteCommand.java | 60 -- .../commands/gm3/QuestResetCommand.java | 57 -- .../commands/gm3/QuestStartCommand.java | 60 -- .../commands/gm3/ReloadDropsCommand.java | 42 -- .../commands/gm3/ReloadEventsCommand.java | 45 -- .../commands/gm3/ReloadMapCommand.java | 55 -- .../commands/gm3/ReloadPortalsCommand.java | 42 -- .../commands/gm3/ReloadShopsCommand.java | 40 -- .../command/commands/gm3/RipCommand.java | 42 -- .../command/commands/gm3/SeedCommand.java | 60 -- .../command/commands/gm3/SpawnCommand.java | 57 -- .../commands/gm3/StartEventCommand.java | 59 -- .../commands/gm3/StartMapEventCommand.java | 38 -- .../commands/gm3/StopMapEventCommand.java | 38 -- .../command/commands/gm3/TimerAllCommand.java | 59 -- .../command/commands/gm3/TimerCommand.java | 59 -- .../command/commands/gm3/TimerMapCommand.java | 59 -- .../commands/gm3/ToggleCouponCommand.java | 45 -- .../command/commands/gm3/UnBanCommand.java | 64 -- .../commands/gm4/BossDropRateCommand.java | 47 -- .../command/commands/gm4/CakeCommand.java | 51 -- .../command/commands/gm4/DropRateCommand.java | 49 -- .../command/commands/gm4/ExpRateCommand.java | 48 -- .../commands/gm4/FishingRateCommand.java | 48 -- .../command/commands/gm4/ForceVacCommand.java | 82 --- .../command/commands/gm4/HorntailCommand.java | 46 -- .../command/commands/gm4/ItemVacCommand.java | 48 -- .../command/commands/gm4/MesoRateCommand.java | 48 -- .../command/commands/gm4/PapCommand.java | 44 -- .../command/commands/gm4/PianusCommand.java | 42 -- .../command/commands/gm4/PinkbeanCommand.java | 43 -- .../commands/gm4/PlayerNpcCommand.java | 48 -- .../commands/gm4/PlayerNpcRemoveCommand.java | 45 -- .../command/commands/gm4/PmobCommand.java | 102 ---- .../commands/gm4/PmobRemoveCommand.java | 110 ---- .../command/commands/gm4/PnpcCommand.java | 109 ---- .../commands/gm4/PnpcRemoveCommand.java | 110 ---- .../command/commands/gm4/ProItemCommand.java | 92 --- .../commands/gm4/QuestRateCommand.java | 49 -- .../commands/gm4/ServerMessageCommand.java | 40 -- .../commands/gm4/SetEqStatCommand.java | 83 --- .../commands/gm4/TravelRateCommand.java | 48 -- .../command/commands/gm4/ZakumCommand.java | 45 -- .../command/commands/gm5/DebugCommand.java | 173 ------ .../command/commands/gm5/IpListCommand.java | 60 -- .../command/commands/gm5/SetCommand.java | 41 -- .../commands/gm5/ShowMoveLifeCommand.java | 39 -- .../commands/gm5/ShowPacketsCommand.java | 39 -- .../commands/gm5/ShowSessionsCommand.java | 38 -- .../commands/gm6/ClearQuestCacheCommand.java | 42 -- .../commands/gm6/ClearQuestCommand.java | 47 -- .../command/commands/gm6/DCAllCommand.java | 49 -- .../command/commands/gm6/DevtestCommand.java | 40 -- .../commands/gm6/EraseAllPNpcsCommand.java | 39 -- .../command/commands/gm6/GetAccCommand.java | 49 -- .../commands/gm6/MapPlayersCommand.java | 55 -- .../command/commands/gm6/SaveAllCommand.java | 50 -- .../commands/gm6/ServerAddChannelCommand.java | 67 --- .../commands/gm6/ServerAddWorldCommand.java | 57 -- .../gm6/ServerRemoveChannelCommand.java | 59 -- .../gm6/ServerRemoveWorldCommand.java | 63 -- .../commands/gm6/SetGmLevelCommand.java | 55 -- .../command/commands/gm6/ShutdownCommand.java | 83 --- .../commands/gm6/SpawnAllPNpcsCommand.java | 41 -- .../commands/gm6/SupplyRateCouponCommand.java | 43 -- .../commands/gm6/WarpWorldCommand.java | 68 --- src/main/java/net/PacketProcessor.java | 2 - src/main/java/net/server/Server.java | 2 - .../channel/handlers/GeneralChatHandler.java | 73 --- 178 files changed, 10898 deletions(-) delete mode 100644 scripts/npc/commands.js delete mode 100644 src/main/java/client/command/Command.java delete mode 100644 src/main/java/client/command/CommandsExecutor.java delete mode 100644 src/main/java/client/command/commands/gm0/DisposeCommand.java delete mode 100644 src/main/java/client/command/commands/gm0/DropLimitCommand.java delete mode 100644 src/main/java/client/command/commands/gm0/EquipLvCommand.java delete mode 100644 src/main/java/client/command/commands/gm0/GachaCommand.java delete mode 100644 src/main/java/client/command/commands/gm0/GmCommand.java delete mode 100644 src/main/java/client/command/commands/gm0/HelpCommand.java delete mode 100644 src/main/java/client/command/commands/gm0/JoinEventCommand.java delete mode 100644 src/main/java/client/command/commands/gm0/LeaveEventCommand.java delete mode 100644 src/main/java/client/command/commands/gm0/MapOwnerClaimCommand.java delete mode 100644 src/main/java/client/command/commands/gm0/OnlineCommand.java delete mode 100644 src/main/java/client/command/commands/gm0/RanksCommand.java delete mode 100644 src/main/java/client/command/commands/gm0/RatesCommand.java delete mode 100644 src/main/java/client/command/commands/gm0/ReadPointsCommand.java delete mode 100644 src/main/java/client/command/commands/gm0/ReportBugCommand.java delete mode 100644 src/main/java/client/command/commands/gm0/ShowRatesCommand.java delete mode 100644 src/main/java/client/command/commands/gm0/StaffCommand.java delete mode 100644 src/main/java/client/command/commands/gm0/StatDexCommand.java delete mode 100644 src/main/java/client/command/commands/gm0/StatIntCommand.java delete mode 100644 src/main/java/client/command/commands/gm0/StatLukCommand.java delete mode 100644 src/main/java/client/command/commands/gm0/StatStrCommand.java delete mode 100644 src/main/java/client/command/commands/gm0/TimeCommand.java delete mode 100644 src/main/java/client/command/commands/gm0/ToggleExpCommand.java delete mode 100644 src/main/java/client/command/commands/gm0/UptimeCommand.java delete mode 100644 src/main/java/client/command/commands/gm1/BossHpCommand.java delete mode 100644 src/main/java/client/command/commands/gm1/BuffMeCommand.java delete mode 100644 src/main/java/client/command/commands/gm1/GotoCommand.java delete mode 100644 src/main/java/client/command/commands/gm1/MobHpCommand.java delete mode 100644 src/main/java/client/command/commands/gm1/WhatDropsFromCommand.java delete mode 100644 src/main/java/client/command/commands/gm1/WhoDropsCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/ApCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/BombCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/BuffCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/BuffMapCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/ClearDropsCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/ClearSavedLocationsCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/ClearSlotCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/DcCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/EmpowerMeCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/GachaListCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/GmShopCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/HealCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/HideCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/IdCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/ItemCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/ItemDropCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/JailCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/JobCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/LevelCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/LevelProCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/LootCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/MaxSkillCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/MaxStatCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/MobSkillCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/ReachCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/RechargeCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/ResetSkillCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/SearchCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/SetSlotCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/SetStatCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/SpCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/SummonCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/UnBugCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/UnHideCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/UnJailCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/WarpAreaCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/WarpCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/WarpMapCommand.java delete mode 100644 src/main/java/client/command/commands/gm2/WhereaMiCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/BanCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/ChatCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/CheckDmgCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/ClosePortalCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/DebuffCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/EndEventCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/ExpedsCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/FaceCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/FameCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/FlyCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/GiveMesosCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/GiveNxCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/GiveRpCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/GiveVpCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/HairCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/HealMapCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/HealPersonCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/HpMpCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/HurtCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/IgnoreCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/IgnoredCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/InMapCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/KillAllCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/KillCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/KillMapCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/MaxEnergyCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/MaxHpMpCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/MonitorCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/MonitorsCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/MusicCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/MuteMapCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/NightCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/NoticeCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/NpcCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/OnlineTwoCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/OpenPortalCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/PeCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/PosCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/QuestCompleteCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/QuestResetCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/QuestStartCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/ReloadDropsCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/ReloadEventsCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/ReloadMapCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/ReloadPortalsCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/ReloadShopsCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/RipCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/SeedCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/SpawnCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/StartEventCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/StartMapEventCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/StopMapEventCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/TimerAllCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/TimerCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/TimerMapCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/ToggleCouponCommand.java delete mode 100644 src/main/java/client/command/commands/gm3/UnBanCommand.java delete mode 100644 src/main/java/client/command/commands/gm4/BossDropRateCommand.java delete mode 100644 src/main/java/client/command/commands/gm4/CakeCommand.java delete mode 100644 src/main/java/client/command/commands/gm4/DropRateCommand.java delete mode 100644 src/main/java/client/command/commands/gm4/ExpRateCommand.java delete mode 100644 src/main/java/client/command/commands/gm4/FishingRateCommand.java delete mode 100644 src/main/java/client/command/commands/gm4/ForceVacCommand.java delete mode 100644 src/main/java/client/command/commands/gm4/HorntailCommand.java delete mode 100644 src/main/java/client/command/commands/gm4/ItemVacCommand.java delete mode 100644 src/main/java/client/command/commands/gm4/MesoRateCommand.java delete mode 100644 src/main/java/client/command/commands/gm4/PapCommand.java delete mode 100644 src/main/java/client/command/commands/gm4/PianusCommand.java delete mode 100644 src/main/java/client/command/commands/gm4/PinkbeanCommand.java delete mode 100644 src/main/java/client/command/commands/gm4/PlayerNpcCommand.java delete mode 100644 src/main/java/client/command/commands/gm4/PlayerNpcRemoveCommand.java delete mode 100644 src/main/java/client/command/commands/gm4/PmobCommand.java delete mode 100644 src/main/java/client/command/commands/gm4/PmobRemoveCommand.java delete mode 100644 src/main/java/client/command/commands/gm4/PnpcCommand.java delete mode 100644 src/main/java/client/command/commands/gm4/PnpcRemoveCommand.java delete mode 100644 src/main/java/client/command/commands/gm4/ProItemCommand.java delete mode 100644 src/main/java/client/command/commands/gm4/QuestRateCommand.java delete mode 100644 src/main/java/client/command/commands/gm4/ServerMessageCommand.java delete mode 100644 src/main/java/client/command/commands/gm4/SetEqStatCommand.java delete mode 100644 src/main/java/client/command/commands/gm4/TravelRateCommand.java delete mode 100644 src/main/java/client/command/commands/gm4/ZakumCommand.java delete mode 100644 src/main/java/client/command/commands/gm5/DebugCommand.java delete mode 100644 src/main/java/client/command/commands/gm5/IpListCommand.java delete mode 100644 src/main/java/client/command/commands/gm5/SetCommand.java delete mode 100644 src/main/java/client/command/commands/gm5/ShowMoveLifeCommand.java delete mode 100644 src/main/java/client/command/commands/gm5/ShowPacketsCommand.java delete mode 100644 src/main/java/client/command/commands/gm5/ShowSessionsCommand.java delete mode 100644 src/main/java/client/command/commands/gm6/ClearQuestCacheCommand.java delete mode 100644 src/main/java/client/command/commands/gm6/ClearQuestCommand.java delete mode 100644 src/main/java/client/command/commands/gm6/DCAllCommand.java delete mode 100644 src/main/java/client/command/commands/gm6/DevtestCommand.java delete mode 100644 src/main/java/client/command/commands/gm6/EraseAllPNpcsCommand.java delete mode 100644 src/main/java/client/command/commands/gm6/GetAccCommand.java delete mode 100644 src/main/java/client/command/commands/gm6/MapPlayersCommand.java delete mode 100644 src/main/java/client/command/commands/gm6/SaveAllCommand.java delete mode 100644 src/main/java/client/command/commands/gm6/ServerAddChannelCommand.java delete mode 100644 src/main/java/client/command/commands/gm6/ServerAddWorldCommand.java delete mode 100644 src/main/java/client/command/commands/gm6/ServerRemoveChannelCommand.java delete mode 100644 src/main/java/client/command/commands/gm6/ServerRemoveWorldCommand.java delete mode 100644 src/main/java/client/command/commands/gm6/SetGmLevelCommand.java delete mode 100644 src/main/java/client/command/commands/gm6/ShutdownCommand.java delete mode 100644 src/main/java/client/command/commands/gm6/SpawnAllPNpcsCommand.java delete mode 100644 src/main/java/client/command/commands/gm6/SupplyRateCouponCommand.java delete mode 100644 src/main/java/client/command/commands/gm6/WarpWorldCommand.java delete mode 100644 src/main/java/net/server/channel/handlers/GeneralChatHandler.java diff --git a/scripts/npc/commands.js b/scripts/npc/commands.js deleted file mode 100644 index 8dfdc7aa302..00000000000 --- a/scripts/npc/commands.js +++ /dev/null @@ -1,72 +0,0 @@ -/* @Author Ronan - * @Author Vcoc - Name: Steward - Map(s): Foyer - Info: Commands - Script: commands.js -*/ - -var status; - -var common_heading = "@"; -var staff_heading = "!"; - -var levels = ["Common", "Donator", "JrGM", "GM", "SuperGM", "Developer", "Admin"]; -var commands; - -function writeHeavenMSCommands() { - const CommandsExecutor = Java.type('client.command.CommandsExecutor'); - commands = CommandsExecutor.getInstance().getGmCommands(); -} - -function start() { - status = -1; - writeHeavenMSCommands(); - action(1, 0, 0); -} - -function action(mode, type, selection) { - if (mode == -1) { - cm.dispose(); - } else { - if (mode == 0 && type > 0) { - cm.dispose(); - return; - } - if (mode == 1) { - status++; - } else { - status--; - } - - if (status == 0) { - var sendStr = "There are all available commands for you:\r\n\r\n#b"; - for (var i = 0; i <= cm.getPlayer().gmLevel(); i++) { - sendStr += "#L" + i + "#" + levels[i] + "#l\r\n"; - } - - cm.sendSimple(sendStr); - } else if (status == 1) { - var lvComm, lvDesc, lvHead = (selection < 2) ? common_heading : staff_heading; - - 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.size(); i++) { - sendStr += " #L" + i + "# " + lvHead + lvComm.get(i) + " - " + lvDesc.get(i); - sendStr += "#l\r\n"; - } - - cm.sendPrev(sendStr); - } else { - cm.dispose(); - } - } -} diff --git a/src/main/java/client/command/Command.java b/src/main/java/client/command/Command.java deleted file mode 100644 index 6fd6080be92..00000000000 --- a/src/main/java/client/command/Command.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command; - -import client.Client; - -public abstract class Command { - - protected int rank; - protected String description; - - public abstract void execute(Client client, String[] params); - - public String getDescription() { - return description; - } - - protected void setDescription(String description) { - this.description = description; - } - - public int getRank() { - return rank; - } - - public void setRank(int rank) { - this.rank = rank; - } - - 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(); - } -} - diff --git a/src/main/java/client/command/CommandsExecutor.java b/src/main/java/client/command/CommandsExecutor.java deleted file mode 100644 index 164fb46ec02..00000000000 --- a/src/main/java/client/command/CommandsExecutor.java +++ /dev/null @@ -1,561 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command; - -import client.Client; -import client.command.commands.gm0.DisposeCommand; -import client.command.commands.gm0.DropLimitCommand; -import client.command.commands.gm0.EquipLvCommand; -import client.command.commands.gm0.GachaCommand; -import client.command.commands.gm0.GmCommand; -import client.command.commands.gm0.HelpCommand; -import client.command.commands.gm0.JoinEventCommand; -import client.command.commands.gm0.LeaveEventCommand; -import client.command.commands.gm0.MapOwnerClaimCommand; -import client.command.commands.gm0.OnlineCommand; -import client.command.commands.gm0.RanksCommand; -import client.command.commands.gm0.RatesCommand; -import client.command.commands.gm0.ReadPointsCommand; -import client.command.commands.gm0.ReportBugCommand; -import client.command.commands.gm0.ShowRatesCommand; -import client.command.commands.gm0.StaffCommand; -import client.command.commands.gm0.StatDexCommand; -import client.command.commands.gm0.StatIntCommand; -import client.command.commands.gm0.StatLukCommand; -import client.command.commands.gm0.StatStrCommand; -import client.command.commands.gm0.TimeCommand; -import client.command.commands.gm0.ToggleExpCommand; -import client.command.commands.gm0.UptimeCommand; -import client.command.commands.gm1.BossHpCommand; -import client.command.commands.gm1.BuffMeCommand; -import client.command.commands.gm1.GotoCommand; -import client.command.commands.gm1.MobHpCommand; -import client.command.commands.gm1.WhatDropsFromCommand; -import client.command.commands.gm1.WhoDropsCommand; -import client.command.commands.gm2.ApCommand; -import client.command.commands.gm2.BombCommand; -import client.command.commands.gm2.BuffCommand; -import client.command.commands.gm2.BuffMapCommand; -import client.command.commands.gm2.ClearDropsCommand; -import client.command.commands.gm2.ClearSavedLocationsCommand; -import client.command.commands.gm2.ClearSlotCommand; -import client.command.commands.gm2.DcCommand; -import client.command.commands.gm2.EmpowerMeCommand; -import client.command.commands.gm2.GachaListCommand; -import client.command.commands.gm2.GmShopCommand; -import client.command.commands.gm2.HealCommand; -import client.command.commands.gm2.HideCommand; -import client.command.commands.gm2.IdCommand; -import client.command.commands.gm2.ItemCommand; -import client.command.commands.gm2.ItemDropCommand; -import client.command.commands.gm2.JailCommand; -import client.command.commands.gm2.JobCommand; -import client.command.commands.gm2.LevelCommand; -import client.command.commands.gm2.LevelProCommand; -import client.command.commands.gm2.LootCommand; -import client.command.commands.gm2.MaxSkillCommand; -import client.command.commands.gm2.MaxStatCommand; -import client.command.commands.gm2.MobSkillCommand; -import client.command.commands.gm2.ReachCommand; -import client.command.commands.gm2.RechargeCommand; -import client.command.commands.gm2.ResetSkillCommand; -import client.command.commands.gm2.SearchCommand; -import client.command.commands.gm2.SetSlotCommand; -import client.command.commands.gm2.SetStatCommand; -import client.command.commands.gm2.SpCommand; -import client.command.commands.gm2.SummonCommand; -import client.command.commands.gm2.UnBugCommand; -import client.command.commands.gm2.UnHideCommand; -import client.command.commands.gm2.UnJailCommand; -import client.command.commands.gm2.WarpAreaCommand; -import client.command.commands.gm2.WarpCommand; -import client.command.commands.gm2.WarpMapCommand; -import client.command.commands.gm2.WhereaMiCommand; -import client.command.commands.gm3.BanCommand; -import client.command.commands.gm3.ChatCommand; -import client.command.commands.gm3.CheckDmgCommand; -import client.command.commands.gm3.ClosePortalCommand; -import client.command.commands.gm3.DebuffCommand; -import client.command.commands.gm3.EndEventCommand; -import client.command.commands.gm3.ExpedsCommand; -import client.command.commands.gm3.FaceCommand; -import client.command.commands.gm3.FameCommand; -import client.command.commands.gm3.FlyCommand; -import client.command.commands.gm3.GiveMesosCommand; -import client.command.commands.gm3.GiveNxCommand; -import client.command.commands.gm3.GiveRpCommand; -import client.command.commands.gm3.GiveVpCommand; -import client.command.commands.gm3.HairCommand; -import client.command.commands.gm3.HealMapCommand; -import client.command.commands.gm3.HealPersonCommand; -import client.command.commands.gm3.HpMpCommand; -import client.command.commands.gm3.HurtCommand; -import client.command.commands.gm3.IgnoreCommand; -import client.command.commands.gm3.IgnoredCommand; -import client.command.commands.gm3.InMapCommand; -import client.command.commands.gm3.KillAllCommand; -import client.command.commands.gm3.KillCommand; -import client.command.commands.gm3.KillMapCommand; -import client.command.commands.gm3.MaxEnergyCommand; -import client.command.commands.gm3.MaxHpMpCommand; -import client.command.commands.gm3.MonitorCommand; -import client.command.commands.gm3.MonitorsCommand; -import client.command.commands.gm3.MusicCommand; -import client.command.commands.gm3.MuteMapCommand; -import client.command.commands.gm3.NightCommand; -import client.command.commands.gm3.NoticeCommand; -import client.command.commands.gm3.NpcCommand; -import client.command.commands.gm3.OnlineTwoCommand; -import client.command.commands.gm3.OpenPortalCommand; -import client.command.commands.gm3.PeCommand; -import client.command.commands.gm3.PosCommand; -import client.command.commands.gm3.QuestCompleteCommand; -import client.command.commands.gm3.QuestResetCommand; -import client.command.commands.gm3.QuestStartCommand; -import client.command.commands.gm3.ReloadDropsCommand; -import client.command.commands.gm3.ReloadEventsCommand; -import client.command.commands.gm3.ReloadMapCommand; -import client.command.commands.gm3.ReloadPortalsCommand; -import client.command.commands.gm3.ReloadShopsCommand; -import client.command.commands.gm3.RipCommand; -import client.command.commands.gm3.SeedCommand; -import client.command.commands.gm3.SpawnCommand; -import client.command.commands.gm3.StartEventCommand; -import client.command.commands.gm3.StartMapEventCommand; -import client.command.commands.gm3.StopMapEventCommand; -import client.command.commands.gm3.TimerAllCommand; -import client.command.commands.gm3.TimerCommand; -import client.command.commands.gm3.TimerMapCommand; -import client.command.commands.gm3.ToggleCouponCommand; -import client.command.commands.gm3.UnBanCommand; -import client.command.commands.gm4.BossDropRateCommand; -import client.command.commands.gm4.CakeCommand; -import client.command.commands.gm4.DropRateCommand; -import client.command.commands.gm4.ExpRateCommand; -import client.command.commands.gm4.FishingRateCommand; -import client.command.commands.gm4.ForceVacCommand; -import client.command.commands.gm4.HorntailCommand; -import client.command.commands.gm4.ItemVacCommand; -import client.command.commands.gm4.MesoRateCommand; -import client.command.commands.gm4.PapCommand; -import client.command.commands.gm4.PianusCommand; -import client.command.commands.gm4.PinkbeanCommand; -import client.command.commands.gm4.PlayerNpcCommand; -import client.command.commands.gm4.PlayerNpcRemoveCommand; -import client.command.commands.gm4.PmobCommand; -import client.command.commands.gm4.PmobRemoveCommand; -import client.command.commands.gm4.PnpcCommand; -import client.command.commands.gm4.PnpcRemoveCommand; -import client.command.commands.gm4.ProItemCommand; -import client.command.commands.gm4.QuestRateCommand; -import client.command.commands.gm4.ServerMessageCommand; -import client.command.commands.gm4.SetEqStatCommand; -import client.command.commands.gm4.TravelRateCommand; -import client.command.commands.gm4.ZakumCommand; -import client.command.commands.gm5.DebugCommand; -import client.command.commands.gm5.IpListCommand; -import client.command.commands.gm5.SetCommand; -import client.command.commands.gm5.ShowMoveLifeCommand; -import client.command.commands.gm5.ShowPacketsCommand; -import client.command.commands.gm5.ShowSessionsCommand; -import client.command.commands.gm6.ClearQuestCacheCommand; -import client.command.commands.gm6.ClearQuestCommand; -import client.command.commands.gm6.DCAllCommand; -import client.command.commands.gm6.DevtestCommand; -import client.command.commands.gm6.EraseAllPNpcsCommand; -import client.command.commands.gm6.GetAccCommand; -import client.command.commands.gm6.MapPlayersCommand; -import client.command.commands.gm6.SaveAllCommand; -import client.command.commands.gm6.ServerAddChannelCommand; -import client.command.commands.gm6.ServerAddWorldCommand; -import client.command.commands.gm6.ServerRemoveChannelCommand; -import client.command.commands.gm6.ServerRemoveWorldCommand; -import client.command.commands.gm6.SetGmLevelCommand; -import client.command.commands.gm6.ShutdownCommand; -import client.command.commands.gm6.SpawnAllPNpcsCommand; -import client.command.commands.gm6.SupplyRateCouponCommand; -import client.command.commands.gm6.WarpWorldCommand; -import constants.id.MapId; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import tools.Pair; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; - -public class CommandsExecutor { - private static final Logger log = LoggerFactory.getLogger(CommandsExecutor.class); - private static final CommandsExecutor instance = new CommandsExecutor(); - private static final char USER_HEADING = '@'; - private static final char GM_HEADING = '!'; - - private final HashMap registeredCommands = new HashMap<>(); - private final List, List>> commandsNameDesc = new ArrayList<>(); - private Pair, List> levelCommandsCursor; - - public static CommandsExecutor getInstance() { - return instance; - } - - public static boolean isCommand(Client client, String content) { - char heading = content.charAt(0); - if (client.getPlayer().isGM()) { - return heading == USER_HEADING || heading == GM_HEADING; - } - return heading == USER_HEADING; - } - - private CommandsExecutor() { - registerLv0Commands(); - registerLv1Commands(); - registerLv2Commands(); - registerLv3Commands(); - registerLv4Commands(); - registerLv5Commands(); - registerLv6Commands(); - } - - public List, List>> getGmCommands() { - return commandsNameDesc; - } - - public void handle(Client client, String message) { - if (client.tryacquireClient()) { - try { - handleInternal(client, message); - } finally { - client.releaseClient(); - } - } else { - client.getPlayer().dropMessage(5, "Try again in a while... Latest commands are currently being processed."); - } - } - - private void handleInternal(Client client, String message) { - if (client.getPlayer().getMapId() == MapId.JAIL) { - client.getPlayer().yellowMessage("You do not have permission to use commands while in jail."); - return; - } - final String splitRegex = "[ ]"; - String[] splitedMessage = message.substring(1).split(splitRegex, 2); - if (splitedMessage.length < 2) { - splitedMessage = new String[]{splitedMessage[0], ""}; - } - - client.getPlayer().setLastCommandMessage(splitedMessage[1]); // thanks Tochi & Nulliphite for noticing string messages being marshalled lowercase - final String commandName = splitedMessage[0].toLowerCase(); - final String[] lowercaseParams = splitedMessage[1].toLowerCase().split(splitRegex); - - final Command 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 do not have permission to use this command."); - return; - } - String[] params; - if (lowercaseParams.length > 0 && !lowercaseParams[0].isEmpty()) { - params = Arrays.copyOfRange(lowercaseParams, 0, lowercaseParams.length); - } else { - params = new String[]{}; - } - - command.execute(client, params); - log.info("Chr {} used command {}", client.getPlayer().getName(), command.getClass().getSimpleName()); - } - - private void addCommandInfo(String name, Class commandClass) { - try { - levelCommandsCursor.getRight().add(commandClass.getDeclaredConstructor().newInstance().getDescription()); - levelCommandsCursor.getLeft().add(name); - } catch (Exception e) { - e.printStackTrace(); - } - } - - private void addCommand(String[] syntaxs, Class commandClass) { - for (String syntax : syntaxs) { - addCommand(syntax, 0, commandClass); - } - } - - private void addCommand(String syntax, Class commandClass) { - //for (String syntax : syntaxs){ - addCommand(syntax, 0, commandClass); - //} - } - - private void addCommand(String[] surtaxes, int rank, Class commandClass) { - for (String syntax : surtaxes) { - addCommand(syntax, rank, commandClass); - } - } - - private void addCommand(String syntax, int rank, Class commandClass) { - if (registeredCommands.containsKey(syntax.toLowerCase())) { - log.warn("Error on register command with name: {}. Already exists.", syntax); - return; - } - - String commandName = syntax.toLowerCase(); - addCommandInfo(commandName, commandClass); - - try { - Command commandInstance = commandClass.getDeclaredConstructor().newInstance(); // thanks Halcyon for noticing commands getting reinstanced every call - commandInstance.setRank(rank); - - registeredCommands.put(commandName, commandInstance); - } catch (Exception e) { - log.warn("Failed to create command instance", e); - } - } - - private void registerLv0Commands() { - levelCommandsCursor = new Pair<>(new ArrayList(), new ArrayList()); - - 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", ReadPointsCommand.class); - 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); - addCommand("toggleexp", ToggleExpCommand.class); - addCommand("mylawn", MapOwnerClaimCommand.class); - addCommand("bosshp", BossHpCommand.class); - addCommand("mobhp", MobHpCommand.class); - - commandsNameDesc.add(levelCommandsCursor); - } - - - private void registerLv1Commands() { - levelCommandsCursor = new Pair<>(new ArrayList(), new ArrayList()); - - 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<>(new ArrayList(), new ArrayList()); - - 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("clearsavelocs", 2, ClearSavedLocationsCommand.class); - addCommand("warp", 2, WarpCommand.class); - addCommand(new String[]{"warphere", "summon"}, 2, SummonCommand.class); - addCommand(new String[]{"warpto", "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("setslot", 2, SetSlotCommand.class); - addCommand("setstat", 2, SetStatCommand.class); - addCommand("maxstat", 2, MaxStatCommand.class); - addCommand("maxskill", 2, MaxSkillCommand.class); - addCommand("resetskill", 2, ResetSkillCommand.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); - addCommand("id", 2, IdCommand.class); - addCommand("gachalist", GachaListCommand.class); - addCommand("loot", LootCommand.class); - addCommand("mobskill", MobSkillCommand.class); - - commandsNameDesc.add(levelCommandsCursor); - } - - private void registerLv3Commands() { - levelCommandsCursor = new Pair<>(new ArrayList(), new ArrayList()); - - 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("togglewhitechat", 3, ChatCommand.class); - addCommand("fame", 3, FameCommand.class); - addCommand("givenx", 3, GiveNxCommand.class); - addCommand("givevp", 3, GiveVpCommand.class); - addCommand("givems", 3, GiveMesosCommand.class); - addCommand("giverp", 3, GiveRpCommand.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("startmapevent", 3, StartMapEventCommand.class); - addCommand("stopmapevent", 3, StopMapEventCommand.class); - addCommand("online2", 3, OnlineTwoCommand.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); - addCommand("timer", 3, TimerCommand.class); - addCommand("timermap", 3, TimerMapCommand.class); - addCommand("timerall", 3, TimerAllCommand.class); - addCommand("warpmap", 3, WarpMapCommand.class); - addCommand("warparea", 3, WarpAreaCommand.class); - - commandsNameDesc.add(levelCommandsCursor); - } - - private void registerLv4Commands() { - levelCommandsCursor = new Pair<>(new ArrayList(), new ArrayList()); - - addCommand("servermessage", 4, ServerMessageCommand.class); - addCommand("proitem", 4, ProItemCommand.class); - addCommand("seteqstat", 4, SetEqStatCommand.class); - addCommand("exprate", 4, ExpRateCommand.class); - addCommand("mesorate", 4, MesoRateCommand.class); - addCommand("droprate", 4, DropRateCommand.class); - addCommand("bossdroprate", 4, BossDropRateCommand.class); - addCommand("questrate", 4, QuestRateCommand.class); - addCommand("travelrate", 4, TravelRateCommand.class); - addCommand("fishrate", 4, FishingRateCommand.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("playernpc", 4, PlayerNpcCommand.class); - addCommand("playernpcremove", 4, PlayerNpcRemoveCommand.class); - addCommand("pnpc", 4, PnpcCommand.class); - addCommand("pnpcremove", 4, PnpcRemoveCommand.class); - addCommand("pmob", 4, PmobCommand.class); - addCommand("pmobremove", 4, PmobRemoveCommand.class); - - commandsNameDesc.add(levelCommandsCursor); - } - - private void registerLv5Commands() { - levelCommandsCursor = new Pair<>(new ArrayList(), new ArrayList()); - - addCommand("debug", 5, DebugCommand.class); - addCommand("set", 5, SetCommand.class); - addCommand("showpackets", 5, ShowPacketsCommand.class); - addCommand("showmovelife", 5, ShowMoveLifeCommand.class); - addCommand("showsessions", 5, ShowSessionsCommand.class); - addCommand("iplist", 5, IpListCommand.class); - - commandsNameDesc.add(levelCommandsCursor); - } - - private void registerLv6Commands() { - levelCommandsCursor = new Pair<>(new ArrayList(), new ArrayList()); - - 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("supplyratecoupon", 6, SupplyRateCouponCommand.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); - addCommand("devtest", 6, DevtestCommand.class); - - commandsNameDesc.add(levelCommandsCursor); - } - -} diff --git a/src/main/java/client/command/commands/gm0/DisposeCommand.java b/src/main/java/client/command/commands/gm0/DisposeCommand.java deleted file mode 100644 index c5f3543deba..00000000000 --- a/src/main/java/client/command/commands/gm0/DisposeCommand.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm0; - -import client.Client; -import client.command.Command; -import scripting.npc.NPCScriptManager; -import scripting.quest.QuestScriptManager; -import tools.PacketCreator; - -public class DisposeCommand extends Command { - { - setDescription("Dispose to fix NPC chat."); - } - - @Override - public void execute(Client c, String[] params) { - NPCScriptManager.getInstance().dispose(c); - QuestScriptManager.getInstance().dispose(c); - c.sendPacket(PacketCreator.enableActions()); - c.removeClickedNPC(); - c.getPlayer().message("You've been disposed."); - } -} diff --git a/src/main/java/client/command/commands/gm0/DropLimitCommand.java b/src/main/java/client/command/commands/gm0/DropLimitCommand.java deleted file mode 100644 index 5792d47bdb1..00000000000 --- a/src/main/java/client/command/commands/gm0/DropLimitCommand.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm0; - -import client.Client; -import client.command.Command; -import config.YamlConfig; - -public class DropLimitCommand extends Command { - { - setDescription("Check drop limit of current map."); - } - - @Override - public void execute(Client c, String[] params) { - int dropCount = c.getPlayer().getMap().getDroppedItemCount(); - if (((float) dropCount) / YamlConfig.config.server.ITEM_LIMIT_ON_MAP < 0.75f) { - c.getPlayer().showHint("Current drop count: #b" + dropCount + "#k / #e" + YamlConfig.config.server.ITEM_LIMIT_ON_MAP + "#n", 300); - } else { - c.getPlayer().showHint("Current drop count: #r" + dropCount + "#k / #e" + YamlConfig.config.server.ITEM_LIMIT_ON_MAP + "#n", 300); - } - - } -} diff --git a/src/main/java/client/command/commands/gm0/EquipLvCommand.java b/src/main/java/client/command/commands/gm0/EquipLvCommand.java deleted file mode 100644 index beafd307df2..00000000000 --- a/src/main/java/client/command/commands/gm0/EquipLvCommand.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm0; - -import client.Client; -import client.command.Command; - -public class EquipLvCommand extends Command { - { - setDescription("Show levels of all equipped items."); - } - - @Override - public void execute(Client c, String[] params) { - c.getPlayer().showAllEquipFeatures(); - } -} diff --git a/src/main/java/client/command/commands/gm0/GachaCommand.java b/src/main/java/client/command/commands/gm0/GachaCommand.java deleted file mode 100644 index 86cf37f552a..00000000000 --- a/src/main/java/client/command/commands/gm0/GachaCommand.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm0; - -import client.Client; -import client.command.Command; -import constants.id.NpcId; -import server.ItemInformationProvider; -import server.gachapon.Gachapon; - -public class GachaCommand extends Command { - { - setDescription("Show gachapon rewards."); - } - - @Override - public void execute(Client c, String[] params) { - Gachapon.GachaponType gacha = null; - String search = c.getPlayer().getLastCommandMessage(); - 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 = {NpcId.GACHAPON_HENESYS, NpcId.GACHAPON_ELLINIA, NpcId.GACHAPON_PERION, NpcId.GACHAPON_KERNING, - NpcId.GACHAPON_SLEEPYWOOD, NpcId.GACHAPON_MUSHROOM_SHRINE, NpcId.GACHAPON_SHOWA_MALE, - NpcId.GACHAPON_SHOWA_FEMALE, NpcId.GACHAPON_NLC, NpcId.GACHAPON_NAUTILUS}; - for (int i = 0; i < names.length; i++) { - if (search.equalsIgnoreCase(names[i])) { - gachaName = names[i]; - gacha = Gachapon.GachaponType.getByNpcId(ids[i]); - } - } - if (gacha == null) { - c.getPlayer().yellowMessage("Please use @gacha 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 += "-" + ItemInformationProvider.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.getAbstractPlayerInteraction().npcTalk(NpcId.MAPLE_ADMINISTRATOR, talkStr); - } -} diff --git a/src/main/java/client/command/commands/gm0/GmCommand.java b/src/main/java/client/command/commands/gm0/GmCommand.java deleted file mode 100644 index 5d24133717b..00000000000 --- a/src/main/java/client/command/commands/gm0/GmCommand.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm0; - -import client.Character; -import client.Client; -import client.command.Command; -import net.server.Server; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import tools.PacketCreator; -import tools.Randomizer; - -public class GmCommand extends Command { - { - setDescription("Send a message to the game masters."); - } - - private static final Logger log = LoggerFactory.getLogger(GmCommand.class); - - @Override - public void execute(Client 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.", - }; - Character player = c.getPlayer(); - if (params.length < 1 || params[0].length() < 3) { // #goodbye 'hi' - player.dropMessage(5, "Your message was too short. Please provide as much detail as possible."); - return; - } - String message = player.getLastCommandMessage(); - Server.getInstance().broadcastGMMessage(c.getWorld(), PacketCreator.sendYellowTip("[GM Message]:" + Character.makeMapleReadable(player.getName()) + ": " + message)); - Server.getInstance().broadcastGMMessage(c.getWorld(), PacketCreator.serverNotice(1, message)); - log.info("{}: {}", Character.makeMapleReadable(player.getName()), message); - player.dropMessage(5, "Your message '" + message + "' was sent to GMs."); - player.dropMessage(5, tips[Randomizer.nextInt(tips.length)]); - } -} diff --git a/src/main/java/client/command/commands/gm0/HelpCommand.java b/src/main/java/client/command/commands/gm0/HelpCommand.java deleted file mode 100644 index b8f94e50c80..00000000000 --- a/src/main/java/client/command/commands/gm0/HelpCommand.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm0; - -import client.Client; -import client.command.Command; -import constants.id.NpcId; - -public class HelpCommand extends Command { - { - setDescription("Show available commands."); - } - - @Override - public void execute(Client client, String[] params) { - client.getAbstractPlayerInteraction().openNpc(NpcId.STEWARD, "commands"); - } -} diff --git a/src/main/java/client/command/commands/gm0/JoinEventCommand.java b/src/main/java/client/command/commands/gm0/JoinEventCommand.java deleted file mode 100644 index 5459d709193..00000000000 --- a/src/main/java/client/command/commands/gm0/JoinEventCommand.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm0; - -import client.Character; -import client.Client; -import client.command.Command; -import constants.id.MapId; -import server.events.gm.Event; -import server.maps.FieldLimit; - -public class JoinEventCommand extends Command { - { - setDescription("Join active event."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (!FieldLimit.CANNOTMIGRATE.check(player.getMap().getFieldLimit())) { - Event event = c.getChannelServer().getEvent(); - if (event != null) { - if (event.getMapId() != player.getMapId()) { - if (event.getLimit() > 0) { - player.saveLocation("EVENT"); - - if (event.getMapId() == MapId.EVENT_COCONUT_HARVEST || event.getMapId() == MapId.EVENT_SNOWBALL_ENTRANCE) { - player.setTeam(event.getLimit() % 2); - } - - event.minusLimit(); - - player.saveLocationOnWarp(); - 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."); - } - } -} diff --git a/src/main/java/client/command/commands/gm0/LeaveEventCommand.java b/src/main/java/client/command/commands/gm0/LeaveEventCommand.java deleted file mode 100644 index 496b3917b28..00000000000 --- a/src/main/java/client/command/commands/gm0/LeaveEventCommand.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm0; - -import client.Character; -import client.Client; -import client.command.Command; - -public class LeaveEventCommand extends Command { - { - setDescription("Leave active event."); - } - - @Override - public void execute(Client c, String[] params) { - Character 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.saveLocationOnWarp(); - player.changeMap(returnMap); - if (c.getChannelServer().getEvent() != null) { - c.getChannelServer().getEvent().addLimit(); - } - } else { - player.dropMessage(5, "You are not currently in an event."); - } - - } -} diff --git a/src/main/java/client/command/commands/gm0/MapOwnerClaimCommand.java b/src/main/java/client/command/commands/gm0/MapOwnerClaimCommand.java deleted file mode 100644 index 8ff939a21a9..00000000000 --- a/src/main/java/client/command/commands/gm0/MapOwnerClaimCommand.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Ronan -*/ -package client.command.commands.gm0; - -import client.Character; -import client.Client; -import client.command.Command; -import config.YamlConfig; -import server.maps.MapleMap; - -public class MapOwnerClaimCommand extends Command { - { - setDescription("Claim ownership of the current map."); - } - - @Override - public void execute(Client c, String[] params) { - if (c.tryacquireClient()) { - try { - Character chr = c.getPlayer(); - - if (YamlConfig.config.server.USE_MAP_OWNERSHIP_SYSTEM) { - if (chr.getEventInstance() == null) { - MapleMap map = chr.getMap(); - if (map.countBosses() == 0) { // thanks Conrad for suggesting bosses prevent map leasing - MapleMap ownedMap = chr.getOwnedMap(); // thanks Conrad for suggesting not unlease a map as soon as player exits it - if (ownedMap != null) { - ownedMap.unclaimOwnership(chr); - - if (map == ownedMap) { - chr.dropMessage(5, "This lawn is now free real estate."); - return; - } - } - - if (map.claimOwnership(chr)) { - chr.dropMessage(5, "You have leased this lawn for a while, until you leave here or after 1 minute of inactivity."); - } else { - chr.dropMessage(5, "This lawn has already been leased by a player."); - } - } else { - chr.dropMessage(5, "This lawn is currently under a boss siege."); - } - } else { - chr.dropMessage(5, "This lawn cannot be leased."); - } - } else { - chr.dropMessage(5, "Feature unavailable."); - } - } finally { - c.releaseClient(); - } - } - } -} diff --git a/src/main/java/client/command/commands/gm0/OnlineCommand.java b/src/main/java/client/command/commands/gm0/OnlineCommand.java deleted file mode 100644 index 1b9a2f7e104..00000000000 --- a/src/main/java/client/command/commands/gm0/OnlineCommand.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm0; - -import client.Character; -import client.Client; -import client.command.Command; -import net.server.Server; -import net.server.channel.Channel; - -public class OnlineCommand extends Command { - { - setDescription("Show all online players."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - for (Channel ch : Server.getInstance().getChannelsFromWorld(player.getWorld())) { - player.yellowMessage("Players in Channel " + ch.getId() + ":"); - for (Character chr : ch.getPlayerStorage().getAllCharacters()) { - if (!chr.isGM()) { - player.message(" >> " + Character.makeMapleReadable(chr.getName()) + " is at " + chr.getMap().getMapName() + "."); - } - } - } - } -} diff --git a/src/main/java/client/command/commands/gm0/RanksCommand.java b/src/main/java/client/command/commands/gm0/RanksCommand.java deleted file mode 100644 index 3fc18572051..00000000000 --- a/src/main/java/client/command/commands/gm0/RanksCommand.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm0; - -import client.Character; -import client.Client; -import client.command.Command; -import constants.id.NpcId; -import net.server.Server; -import net.server.guild.GuildPackets; -import tools.Pair; - -import java.util.List; - -public class RanksCommand extends Command { - { - setDescription("Show player rankings."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - - List> worldRanking = Server.getInstance().getWorldPlayerRanking(player.getWorld()); - player.sendPacket(GuildPackets.showPlayerRanks(NpcId.MAPLE_ADMINISTRATOR, worldRanking)); - } -} diff --git a/src/main/java/client/command/commands/gm0/RatesCommand.java b/src/main/java/client/command/commands/gm0/RatesCommand.java deleted file mode 100644 index 95181d6dcf4..00000000000 --- a/src/main/java/client/command/commands/gm0/RatesCommand.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm0; - -import client.Character; -import client.Client; -import client.command.Command; -import config.YamlConfig; - -public class RatesCommand extends Command { - { - setDescription("Show your rates."); - } - - @Override - public void execute(Client c, String[] params) { - Character 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" + (player.hasNoviceExpRate() ? " - novice rate" : "") + "\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"; - showMsg_ += "BOSS DROP Rate: #e#b" + player.getBossDropRate() + "x#k#n" + "\r\n"; - if (YamlConfig.config.server.USE_QUEST_RATE) { - showMsg_ += "QUEST Rate: #e#b" + c.getWorldServer().getQuestRate() + "x#k#n" + "\r\n"; - } - - player.showHint(showMsg_, 300); - } -} diff --git a/src/main/java/client/command/commands/gm0/ReadPointsCommand.java b/src/main/java/client/command/commands/gm0/ReadPointsCommand.java deleted file mode 100644 index e71afb2269b..00000000000 --- a/src/main/java/client/command/commands/gm0/ReadPointsCommand.java +++ /dev/null @@ -1,38 +0,0 @@ -package client.command.commands.gm0; - -import client.Character; -import client.Client; -import client.command.Command; - -public class ReadPointsCommand extends Command { - { - setDescription("Show point total."); - } - - @Override - public void execute(Client client, String[] params) { - - Character player = client.getPlayer(); - if (params.length > 2) { - player.yellowMessage("Syntax: @points (rp|vp|all)"); - return; - } else if (params.length == 0) { - player.yellowMessage("RewardPoints: " + player.getRewardPoints() + " | " - + "VotePoints: " + player.getClient().getVotePoints()); - return; - } - - switch (params[0]) { - case "rp": - player.yellowMessage("RewardPoints: " + player.getRewardPoints()); - break; - case "vp": - player.yellowMessage("VotePoints: " + player.getClient().getVotePoints()); - break; - default: - player.yellowMessage("RewardPoints: " + player.getRewardPoints() + " | " - + "VotePoints: " + player.getClient().getVotePoints()); - break; - } - } -} \ No newline at end of file diff --git a/src/main/java/client/command/commands/gm0/ReportBugCommand.java b/src/main/java/client/command/commands/gm0/ReportBugCommand.java deleted file mode 100644 index 53e35013dbe..00000000000 --- a/src/main/java/client/command/commands/gm0/ReportBugCommand.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm0; - -import client.Character; -import client.Client; -import client.command.Command; -import net.server.Server; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import tools.PacketCreator; - -public class ReportBugCommand extends Command { - { - setDescription("Send in a bug report."); - } - - private static final Logger log = LoggerFactory.getLogger(ReportBugCommand.class); - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - - if (params.length < 1) { - player.dropMessage(5, "Message too short and not sent. Please do @bug "); - return; - } - String message = player.getLastCommandMessage(); - Server.getInstance().broadcastGMMessage(c.getWorld(), PacketCreator.sendYellowTip("[Bug]:" + Character.makeMapleReadable(player.getName()) + ": " + message)); - Server.getInstance().broadcastGMMessage(c.getWorld(), PacketCreator.serverNotice(1, message)); - log.info("{}: {}", Character.makeMapleReadable(player.getName()), message); - player.dropMessage(5, "Your bug '" + message + "' was submitted successfully to our developers. Thank you!"); - - } -} diff --git a/src/main/java/client/command/commands/gm0/ShowRatesCommand.java b/src/main/java/client/command/commands/gm0/ShowRatesCommand.java deleted file mode 100644 index 3a14f49e0fd..00000000000 --- a/src/main/java/client/command/commands/gm0/ShowRatesCommand.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm0; - -import client.Character; -import client.Client; -import client.command.Command; -import config.YamlConfig; - -public class ShowRatesCommand extends Command { - { - setDescription("Show all world/character rates."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - String showMsg = "#eEXP RATE#n" + "\r\n"; - showMsg += "World 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" + (player.hasNoviceExpRate() ? " - novice rate" : "") + "\r\n"; - - showMsg += "\r\n" + "#eMESO RATE#n" + "\r\n"; - showMsg += "World 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 += "World 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"; - - showMsg += "\r\n" + "#eBOSS DROP RATE#n" + "\r\n"; - showMsg += "World BOSS DROP Rate: #k" + c.getWorldServer().getBossDropRate() + "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 += "BOSS DROP Rate: #e#b" + player.getBossDropRate() + "x#k#n" + "\r\n"; - - if (YamlConfig.config.server.USE_QUEST_RATE) { - showMsg += "\r\n" + "#eQUEST RATE#n" + "\r\n"; - showMsg += "World QUEST Rate: #e#b" + c.getWorldServer().getQuestRate() + "x#k#n" + "\r\n"; - } - - showMsg += "\r\n"; - showMsg += "World TRAVEL Rate: #e#b" + c.getWorldServer().getTravelRate() + "x#k#n" + "\r\n"; - - player.showHint(showMsg, 300); - } -} diff --git a/src/main/java/client/command/commands/gm0/StaffCommand.java b/src/main/java/client/command/commands/gm0/StaffCommand.java deleted file mode 100644 index 3209342431c..00000000000 --- a/src/main/java/client/command/commands/gm0/StaffCommand.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm0; - -import client.Client; -import client.command.Command; -import constants.id.NpcId; - -public class StaffCommand extends Command { - { - setDescription("Show credits. These people made the server possible."); - } - - @Override - public void execute(Client c, String[] params) { - c.getAbstractPlayerInteraction().openNpc(NpcId.HERACLE, "credits"); - } -} diff --git a/src/main/java/client/command/commands/gm0/StatDexCommand.java b/src/main/java/client/command/commands/gm0/StatDexCommand.java deleted file mode 100644 index 59660c1a9bb..00000000000 --- a/src/main/java/client/command/commands/gm0/StatDexCommand.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm0; - -import client.Character; -import client.Client; -import client.command.Command; -import config.YamlConfig; - -public class StatDexCommand extends Command { - { - setDescription("Assign AP into DEX."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - int remainingAp = player.getRemainingAp(); - - int amount; - if (params.length > 0) { - try { - amount = Math.min(Integer.parseInt(params[0]), remainingAp); - } catch (NumberFormatException e) { - player.dropMessage("That is not a valid number!"); - return; - } - } else { - amount = Math.min(remainingAp, YamlConfig.config.server.MAX_AP - player.getDex()); - } - if (!player.assignDex(Math.max(amount, 0))) { - player.dropMessage("Please make sure your AP is not over " + YamlConfig.config.server.MAX_AP + " and you have enough to distribute."); - } - } -} diff --git a/src/main/java/client/command/commands/gm0/StatIntCommand.java b/src/main/java/client/command/commands/gm0/StatIntCommand.java deleted file mode 100644 index abfb761e717..00000000000 --- a/src/main/java/client/command/commands/gm0/StatIntCommand.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm0; - -import client.Character; -import client.Client; -import client.command.Command; -import config.YamlConfig; - -public class StatIntCommand extends Command { - { - setDescription("Assign AP into INT."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - int remainingAp = player.getRemainingAp(); - - int amount; - if (params.length > 0) { - try { - amount = Math.min(Integer.parseInt(params[0]), remainingAp); - } catch (NumberFormatException e) { - player.dropMessage("That is not a valid number!"); - return; - } - } else { - amount = Math.min(remainingAp, YamlConfig.config.server.MAX_AP - player.getInt()); - } - if (!player.assignInt(Math.max(amount, 0))) { - player.dropMessage("Please make sure your AP is not over " + YamlConfig.config.server.MAX_AP + " and you have enough to distribute."); - } - } -} diff --git a/src/main/java/client/command/commands/gm0/StatLukCommand.java b/src/main/java/client/command/commands/gm0/StatLukCommand.java deleted file mode 100644 index 20cab06e2d0..00000000000 --- a/src/main/java/client/command/commands/gm0/StatLukCommand.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm0; - -import client.Character; -import client.Client; -import client.command.Command; -import config.YamlConfig; - -public class StatLukCommand extends Command { - { - setDescription("Assign AP into LUK."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - int remainingAp = player.getRemainingAp(); - - int amount; - if (params.length > 0) { - try { - amount = Math.min(Integer.parseInt(params[0]), remainingAp); - } catch (NumberFormatException e) { - player.dropMessage("That is not a valid number!"); - return; - } - } else { - amount = Math.min(remainingAp, YamlConfig.config.server.MAX_AP - player.getLuk()); - } - if (!player.assignLuk(Math.max(amount, 0))) { - player.dropMessage("Please make sure your AP is not over " + YamlConfig.config.server.MAX_AP + " and you have enough to distribute."); - } - } -} diff --git a/src/main/java/client/command/commands/gm0/StatStrCommand.java b/src/main/java/client/command/commands/gm0/StatStrCommand.java deleted file mode 100644 index 2c8b7eaf840..00000000000 --- a/src/main/java/client/command/commands/gm0/StatStrCommand.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm0; - -import client.Character; -import client.Client; -import client.command.Command; -import config.YamlConfig; - -public class StatStrCommand extends Command { - { - setDescription("Assign AP into STR."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - int remainingAp = player.getRemainingAp(); - int amount; - if (params.length > 0) { - try { - amount = Math.min(Integer.parseInt(params[0]), remainingAp); - } catch (NumberFormatException e) { - player.dropMessage("That is not a valid number!"); - return; - } - } else { - amount = Math.min(remainingAp, YamlConfig.config.server.MAX_AP - player.getStr()); - } - - if (!player.assignStr(Math.max(amount, 0))) { - player.dropMessage("Please make sure your AP is not over " + YamlConfig.config.server.MAX_AP + " and you have enough to distribute."); - } - } -} diff --git a/src/main/java/client/command/commands/gm0/TimeCommand.java b/src/main/java/client/command/commands/gm0/TimeCommand.java deleted file mode 100644 index 9649ef2d101..00000000000 --- a/src/main/java/client/command/commands/gm0/TimeCommand.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm0; - -import client.Client; -import client.command.Command; - -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.TimeZone; - -public class TimeCommand extends Command { - { - setDescription("Show current server time."); - } - - @Override - public void execute(Client client, String[] params) { - DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss"); - dateFormat.setTimeZone(TimeZone.getDefault()); - client.getPlayer().yellowMessage("Ashes Server Time: " + dateFormat.format(new Date())); - } -} diff --git a/src/main/java/client/command/commands/gm0/ToggleExpCommand.java b/src/main/java/client/command/commands/gm0/ToggleExpCommand.java deleted file mode 100644 index 42ff35c9dba..00000000000 --- a/src/main/java/client/command/commands/gm0/ToggleExpCommand.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Ronan -*/ -package client.command.commands.gm0; - -import client.Client; -import client.command.Command; - -public class ToggleExpCommand extends Command { - { - setDescription("Toggle enable/disable all exp gain."); - } - - @Override - public void execute(Client c, String[] params) { - if (c.tryacquireClient()) { - try { - c.getPlayer().toggleExpGain(); // Vcoc's idea - } finally { - c.releaseClient(); - } - } - } -} diff --git a/src/main/java/client/command/commands/gm0/UptimeCommand.java b/src/main/java/client/command/commands/gm0/UptimeCommand.java deleted file mode 100644 index 8080a4d41bb..00000000000 --- a/src/main/java/client/command/commands/gm0/UptimeCommand.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm0; - -import client.Client; -import client.command.Command; -import net.server.Server; - -import static java.util.concurrent.TimeUnit.DAYS; -import static java.util.concurrent.TimeUnit.HOURS; -import static java.util.concurrent.TimeUnit.MINUTES; -import static java.util.concurrent.TimeUnit.SECONDS; - -public class UptimeCommand extends Command { - { - setDescription("Show server online time."); - } - - @Override - public void execute(Client c, String[] params) { - long milliseconds = System.currentTimeMillis() - Server.uptime; - int seconds = (int) (milliseconds / SECONDS.toMillis(1)) % 60; - int minutes = (int) ((milliseconds / MINUTES.toMillis(1)) % 60); - int hours = (int) ((milliseconds / HOURS.toMillis(1)) % 24); - int days = (int) ((milliseconds / DAYS.toMillis(1))); - c.getPlayer().yellowMessage("Server has been online for " + days + " days " + hours + " hours " + minutes + " minutes and " + seconds + " seconds."); - } -} diff --git a/src/main/java/client/command/commands/gm1/BossHpCommand.java b/src/main/java/client/command/commands/gm1/BossHpCommand.java deleted file mode 100644 index 4156cfd25c3..00000000000 --- a/src/main/java/client/command/commands/gm1/BossHpCommand.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm1; - -import client.Character; -import client.Client; -import client.command.Command; -import server.life.Monster; - -public class BossHpCommand extends Command { - { - setDescription("Show HP of bosses on current map."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - for (Monster monster : player.getMap().getAllMonsters()) { - 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); - } - } - } -} diff --git a/src/main/java/client/command/commands/gm1/BuffMeCommand.java b/src/main/java/client/command/commands/gm1/BuffMeCommand.java deleted file mode 100644 index ce2afba245b..00000000000 --- a/src/main/java/client/command/commands/gm1/BuffMeCommand.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm1; - -import client.Character; -import client.Client; -import client.SkillFactory; -import client.command.Command; - -public class BuffMeCommand extends Command { - { - setDescription("Activate GM buffs on self."); - } - - @Override - public void execute(Client c, String[] params) { - Character 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.healHpMp(); - } -} diff --git a/src/main/java/client/command/commands/gm1/GotoCommand.java b/src/main/java/client/command/commands/gm1/GotoCommand.java deleted file mode 100644 index dfbf0c61052..00000000000 --- a/src/main/java/client/command/commands/gm1/GotoCommand.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm1; - -import client.Character; -import client.Client; -import client.command.Command; -import constants.game.GameConstants; -import constants.id.NpcId; -import server.maps.FieldLimit; -import server.maps.MapFactory; -import server.maps.MapleMap; -import server.maps.MiniDungeonInfo; -import server.maps.Portal; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -public class GotoCommand extends Command { - - { - setDescription("Warp to a predefined map."); - - List> towns = new ArrayList<>(GameConstants.GOTO_TOWNS.entrySet()); - sortGotoEntries(towns); - - try { - // thanks shavit for noticing goto areas getting loaded from wz needlessly only for the name retrieval - - for (Map.Entry e : towns) { - GOTO_TOWNS_INFO += ("'" + e.getKey() + "' - #b" + (MapFactory.loadPlaceName(e.getValue())) + "#k\r\n"); - } - - List> areas = new ArrayList<>(GameConstants.GOTO_AREAS.entrySet()); - sortGotoEntries(areas); - for (Map.Entry e : areas) { - GOTO_AREAS_INFO += ("'" + e.getKey() + "' - #b" + (MapFactory.loadPlaceName(e.getValue())) + "#k\r\n"); - } - } catch (Exception e) { - e.printStackTrace(); - - GOTO_TOWNS_INFO = "(none)"; - GOTO_AREAS_INFO = "(none)"; - } - - } - - public static String GOTO_TOWNS_INFO = ""; - public static String GOTO_AREAS_INFO = ""; - - private static void sortGotoEntries(List> listEntries) { - listEntries.sort((e1, e2) -> e1.getValue().compareTo(e2.getValue())); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - String sendStr = "Syntax: #b@goto #k. Available areas:\r\n\r\n#rTowns:#k\r\n" + GOTO_TOWNS_INFO; - if (player.isGM()) { - sendStr += ("\r\n#rAreas:#k\r\n" + GOTO_AREAS_INFO); - } - - player.getAbstractPlayerInteraction().npcTalk(NpcId.SPINEL, sendStr); - return; - } - - if (!player.isAlive()) { - player.dropMessage(1, "This command cannot be used when you're dead."); - return; - } - - if (!player.isGM()) { - if (player.getEventInstance() != null || MiniDungeonInfo.isDungeonMap(player.getMapId()) || FieldLimit.CANNOTMIGRATE.check(player.getMap().getFieldLimit())) { - player.dropMessage(1, "This command can not be used in this map."); - return; - } - } - - Map gotomaps; - if (player.isGM()) { - gotomaps = new HashMap<>(GameConstants.GOTO_AREAS); // distinct map registry for GM/users suggested thanks to Vcoc - gotomaps.putAll(GameConstants.GOTO_TOWNS); // thanks Halcyon (UltimateMors) for pointing out duplicates on listed entries functionality - } else { - gotomaps = GameConstants.GOTO_TOWNS; - } - - if (gotomaps.containsKey(params[0])) { - MapleMap target = c.getChannelServer().getMapFactory().getMap(gotomaps.get(params[0])); - - // expedition issue with this command detected thanks to Masterrulax - Portal targetPortal = target.getRandomPlayerSpawnpoint(); - player.saveLocationOnWarp(); - player.changeMap(target, targetPortal); - } else { - // detailed info on goto available areas suggested thanks to Vcoc - String sendStr = "Area '#r" + params[0] + "#k' is not available. Available areas:\r\n\r\n#rTowns:#k" + GOTO_TOWNS_INFO; - if (player.isGM()) { - sendStr += ("\r\n#rAreas:#k\r\n" + GOTO_AREAS_INFO); - } - - player.getAbstractPlayerInteraction().npcTalk(NpcId.SPINEL, sendStr); - } - } -} diff --git a/src/main/java/client/command/commands/gm1/MobHpCommand.java b/src/main/java/client/command/commands/gm1/MobHpCommand.java deleted file mode 100644 index ee9310eadab..00000000000 --- a/src/main/java/client/command/commands/gm1/MobHpCommand.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm1; - -import client.Character; -import client.Client; -import client.command.Command; -import server.life.Monster; - -public class MobHpCommand extends Command { - { - setDescription("Show HP of mobs on current map."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - for (Monster monster : player.getMap().getAllMonsters()) { - if (monster != null && monster.getHp() > 0) { - player.yellowMessage(monster.getName() + " (" + monster.getId() + ") has " + monster.getHp() + " / " + monster.getMaxHp() + " HP."); - - } - } - } -} diff --git a/src/main/java/client/command/commands/gm1/WhatDropsFromCommand.java b/src/main/java/client/command/commands/gm1/WhatDropsFromCommand.java deleted file mode 100644 index 111d5ce6eea..00000000000 --- a/src/main/java/client/command/commands/gm1/WhatDropsFromCommand.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm1; - -import client.Character; -import client.Client; -import client.command.Command; -import constants.id.NpcId; -import server.ItemInformationProvider; -import server.life.MonsterDropEntry; -import server.life.MonsterInformationProvider; -import tools.Pair; - -import java.util.Iterator; - -public class WhatDropsFromCommand extends Command { - { - setDescription("Show what items drop from a mob."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.dropMessage(5, "Please do @whatdropsfrom "); - return; - } - String monsterName = player.getLastCommandMessage(); - String output = ""; - int limit = 3; - Iterator> listIterator = MonsterInformationProvider.getMobsIDsFromName(monsterName).iterator(); - for (int i = 0; i < limit; i++) { - if (listIterator.hasNext()) { - Pair data = listIterator.next(); - int mobId = data.getLeft(); - String mobName = data.getRight(); - output += mobName + " drops the following items:\r\n\r\n"; - for (MonsterDropEntry drop : MonsterInformationProvider.getInstance().retrieveDrop(mobId)) { - try { - String name = ItemInformationProvider.getInstance().getName(drop.itemId); - if (name == null || name.equals("null") || drop.chance == 0) { - continue; - } - float chance = Math.max(1000000 / drop.chance / (!MonsterInformationProvider.getInstance().isBoss(mobId) ? player.getDropRate() : player.getBossDropRate()), 1); - output += "- " + name + " (1/" + (int) chance + ")\r\n"; - } catch (Exception ex) { - ex.printStackTrace(); - continue; - } - } - output += "\r\n"; - } - } - - c.getAbstractPlayerInteraction().npcTalk(NpcId.MAPLE_ADMINISTRATOR, output); - } -} diff --git a/src/main/java/client/command/commands/gm1/WhoDropsCommand.java b/src/main/java/client/command/commands/gm1/WhoDropsCommand.java deleted file mode 100644 index 1c27c8c9b02..00000000000 --- a/src/main/java/client/command/commands/gm1/WhoDropsCommand.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm1; - -import client.Character; -import client.Client; -import client.command.Command; -import constants.id.NpcId; -import server.ItemInformationProvider; -import server.life.MonsterInformationProvider; -import tools.DatabaseConnection; -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("Show what drops an item."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.dropMessage(5, "Please do @whodrops "); - return; - } - - if (c.tryacquireClient()) { - try { - String searchString = player.getLastCommandMessage(); - String output = ""; - Iterator> listIterator = ItemInformationProvider.getInstance().getItemDataByName(searchString).iterator(); - if (listIterator.hasNext()) { - int count = 1; - while (listIterator.hasNext() && count <= 3) { - Pair 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()); - - try (ResultSet rs = ps.executeQuery()) { - while (rs.next()) { - String resultName = MonsterInformationProvider.getInstance().getMobNameFromId(rs.getInt("dropperid")); - if (resultName != null) { - output += resultName + ", "; - } - } - } - } 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.getAbstractPlayerInteraction().npcTalk(NpcId.MAPLE_ADMINISTRATOR, output); - } finally { - c.releaseClient(); - } - } else { - player.dropMessage(5, "Please wait a while for your request to be processed."); - } - } -} diff --git a/src/main/java/client/command/commands/gm2/ApCommand.java b/src/main/java/client/command/commands/gm2/ApCommand.java deleted file mode 100644 index 83068f8f01c..00000000000 --- a/src/main/java/client/command/commands/gm2/ApCommand.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.command.Command; -import config.YamlConfig; - -public class ApCommand extends Command { - { - setDescription("Set available AP."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !ap [] "); - return; - } - - if (params.length < 2) { - int newAp = Integer.parseInt(params[0]); - if (newAp < 0) { - newAp = 0; - } else if (newAp > YamlConfig.config.server.MAX_AP) { - newAp = YamlConfig.config.server.MAX_AP; - } - - player.changeRemainingAp(newAp, false); - } else { - Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]); - if (victim != null) { - int newAp = Integer.parseInt(params[1]); - if (newAp < 0) { - newAp = 0; - } else if (newAp > YamlConfig.config.server.MAX_AP) { - newAp = YamlConfig.config.server.MAX_AP; - } - - victim.changeRemainingAp(newAp, false); - } else { - player.message("Player '" + params[0] + "' could not be found."); - } - } - } -} diff --git a/src/main/java/client/command/commands/gm2/BombCommand.java b/src/main/java/client/command/commands/gm2/BombCommand.java deleted file mode 100644 index aa609bfefb0..00000000000 --- a/src/main/java/client/command/commands/gm2/BombCommand.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.command.Command; -import constants.id.MobId; -import net.server.Server; -import server.life.LifeFactory; -import tools.PacketCreator; - -public class BombCommand extends Command { - { - setDescription("Bomb a player, dealing damage."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length > 0) { - Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]); - if (victim != null) { - victim.getMap().spawnMonsterOnGroundBelow(LifeFactory.getMonster(MobId.ARPQ_BOMB), victim.getPosition()); - Server.getInstance().broadcastGMMessage(c.getWorld(), PacketCreator.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(LifeFactory.getMonster(MobId.ARPQ_BOMB), player.getPosition()); - } - } -} diff --git a/src/main/java/client/command/commands/gm2/BuffCommand.java b/src/main/java/client/command/commands/gm2/BuffCommand.java deleted file mode 100644 index a6033bb43cc..00000000000 --- a/src/main/java/client/command/commands/gm2/BuffCommand.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.Skill; -import client.SkillFactory; -import client.command.Command; - -public class BuffCommand extends Command { - { - setDescription("Activate a buff."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !buff "); - return; - } - int skillid = Integer.parseInt(params[0]); - - Skill skill = SkillFactory.getSkill(skillid); - if (skill != null) { - skill.getEffect(skill.getMaxLevel()).applyTo(player); - } - } -} diff --git a/src/main/java/client/command/commands/gm2/BuffMapCommand.java b/src/main/java/client/command/commands/gm2/BuffMapCommand.java deleted file mode 100644 index c1433d30c87..00000000000 --- a/src/main/java/client/command/commands/gm2/BuffMapCommand.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.SkillFactory; -import client.command.Command; - -public class BuffMapCommand extends Command { - { - setDescription("Give GM buffs to the whole map."); - } - - @Override - public void execute(Client c, String[] params) { - Character 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); - - } -} diff --git a/src/main/java/client/command/commands/gm2/ClearDropsCommand.java b/src/main/java/client/command/commands/gm2/ClearDropsCommand.java deleted file mode 100644 index 05c8e009faa..00000000000 --- a/src/main/java/client/command/commands/gm2/ClearDropsCommand.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.command.Command; - -public class ClearDropsCommand extends Command { - { - setDescription("Clear drops by player."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - player.getMap().clearDrops(player); - player.dropMessage(5, "Cleared dropped items"); - } -} diff --git a/src/main/java/client/command/commands/gm2/ClearSavedLocationsCommand.java b/src/main/java/client/command/commands/gm2/ClearSavedLocationsCommand.java deleted file mode 100644 index 0a5a87bdcc9..00000000000 --- a/src/main/java/client/command/commands/gm2/ClearSavedLocationsCommand.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.command.Command; -import server.maps.SavedLocationType; - -public class ClearSavedLocationsCommand extends Command { - { - setDescription("Clear saved locations for a player."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(), victim; - - if (params.length > 0) { - victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]); - if (victim == null) { - player.message("Player '" + params[0] + "' could not be found."); - return; - } - } else { - victim = c.getPlayer(); - } - - for (SavedLocationType type : SavedLocationType.values()) { - victim.clearSavedLocation(type); - } - - player.message("Cleared " + params[0] + "'s saved locations."); - } -} diff --git a/src/main/java/client/command/commands/gm2/ClearSlotCommand.java b/src/main/java/client/command/commands/gm2/ClearSlotCommand.java deleted file mode 100644 index 63f31350730..00000000000 --- a/src/main/java/client/command/commands/gm2/ClearSlotCommand.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.command.Command; -import client.inventory.InventoryType; -import client.inventory.Item; -import client.inventory.manipulator.InventoryManipulator; - -public class ClearSlotCommand extends Command { - { - setDescription("Clear all items in an inventory tab."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !clearslot "); - return; - } - String type = params[0]; - switch (type) { - case "all": - for (int i = 0; i < 101; i++) { - Item tempItem = c.getPlayer().getInventory(InventoryType.EQUIP).getItem((byte) i); - if (tempItem == null) { - continue; - } - InventoryManipulator.removeFromSlot(c, InventoryType.EQUIP, (byte) i, tempItem.getQuantity(), false, false); - } - for (int i = 0; i < 101; i++) { - Item tempItem = c.getPlayer().getInventory(InventoryType.USE).getItem((byte) i); - if (tempItem == null) { - continue; - } - InventoryManipulator.removeFromSlot(c, InventoryType.USE, (byte) i, tempItem.getQuantity(), false, false); - } - for (int i = 0; i < 101; i++) { - Item tempItem = c.getPlayer().getInventory(InventoryType.ETC).getItem((byte) i); - if (tempItem == null) { - continue; - } - InventoryManipulator.removeFromSlot(c, InventoryType.ETC, (byte) i, tempItem.getQuantity(), false, false); - } - for (int i = 0; i < 101; i++) { - Item tempItem = c.getPlayer().getInventory(InventoryType.SETUP).getItem((byte) i); - if (tempItem == null) { - continue; - } - InventoryManipulator.removeFromSlot(c, InventoryType.SETUP, (byte) i, tempItem.getQuantity(), false, false); - } - for (int i = 0; i < 101; i++) { - Item tempItem = c.getPlayer().getInventory(InventoryType.CASH).getItem((byte) i); - if (tempItem == null) { - continue; - } - InventoryManipulator.removeFromSlot(c, InventoryType.CASH, (byte) i, tempItem.getQuantity(), false, false); - } - player.yellowMessage("All Slots Cleared."); - break; - case "equip": - for (int i = 0; i < 101; i++) { - Item tempItem = c.getPlayer().getInventory(InventoryType.EQUIP).getItem((byte) i); - if (tempItem == null) { - continue; - } - InventoryManipulator.removeFromSlot(c, InventoryType.EQUIP, (byte) i, tempItem.getQuantity(), false, false); - } - player.yellowMessage("Equipment Slot Cleared."); - break; - case "use": - for (int i = 0; i < 101; i++) { - Item tempItem = c.getPlayer().getInventory(InventoryType.USE).getItem((byte) i); - if (tempItem == null) { - continue; - } - InventoryManipulator.removeFromSlot(c, InventoryType.USE, (byte) i, tempItem.getQuantity(), false, false); - } - player.yellowMessage("Use Slot Cleared."); - break; - case "setup": - for (int i = 0; i < 101; i++) { - Item tempItem = c.getPlayer().getInventory(InventoryType.SETUP).getItem((byte) i); - if (tempItem == null) { - continue; - } - InventoryManipulator.removeFromSlot(c, InventoryType.SETUP, (byte) i, tempItem.getQuantity(), false, false); - } - player.yellowMessage("Set-Up Slot Cleared."); - break; - case "etc": - for (int i = 0; i < 101; i++) { - Item tempItem = c.getPlayer().getInventory(InventoryType.ETC).getItem((byte) i); - if (tempItem == null) { - continue; - } - InventoryManipulator.removeFromSlot(c, InventoryType.ETC, (byte) i, tempItem.getQuantity(), false, false); - } - player.yellowMessage("ETC Slot Cleared."); - break; - case "cash": - for (int i = 0; i < 101; i++) { - Item tempItem = c.getPlayer().getInventory(InventoryType.CASH).getItem((byte) i); - if (tempItem == null) { - continue; - } - InventoryManipulator.removeFromSlot(c, InventoryType.CASH, (byte) i, tempItem.getQuantity(), false, false); - } - player.yellowMessage("Cash Slot Cleared."); - break; - default: - player.yellowMessage("Slot" + type + " does not exist!"); - break; - } - } -} diff --git a/src/main/java/client/command/commands/gm2/DcCommand.java b/src/main/java/client/command/commands/gm2/DcCommand.java deleted file mode 100644 index 1ae5f093d37..00000000000 --- a/src/main/java/client/command/commands/gm2/DcCommand.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.command.Command; - -public class DcCommand extends Command { - { - setDescription("Disconnect a player."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !dc "); - return; - } - - Character 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); - } -} diff --git a/src/main/java/client/command/commands/gm2/EmpowerMeCommand.java b/src/main/java/client/command/commands/gm2/EmpowerMeCommand.java deleted file mode 100644 index 58c52b9b479..00000000000 --- a/src/main/java/client/command/commands/gm2/EmpowerMeCommand.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.SkillFactory; -import client.command.Command; - -public class EmpowerMeCommand extends Command { - { - setDescription("Activate all useful buffs."); - } - - @Override - public void execute(Client c, String[] params) { - Character 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); - } - } -} diff --git a/src/main/java/client/command/commands/gm2/GachaListCommand.java b/src/main/java/client/command/commands/gm2/GachaListCommand.java deleted file mode 100644 index 805f550e532..00000000000 --- a/src/main/java/client/command/commands/gm2/GachaListCommand.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ -package client.command.commands.gm2; - -import client.Client; -import client.command.Command; - -/** - * @author Ronan - */ -public class GachaListCommand extends Command { - { - setDescription("Show gachapon rewards."); - } - - @Override - public void execute(Client c, String[] params) { - c.getAbstractPlayerInteraction().openNpc(10000, "gachaponInfo"); - } -} diff --git a/src/main/java/client/command/commands/gm2/GmShopCommand.java b/src/main/java/client/command/commands/gm2/GmShopCommand.java deleted file mode 100644 index ea286f32618..00000000000 --- a/src/main/java/client/command/commands/gm2/GmShopCommand.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Client; -import client.command.Command; -import server.ShopFactory; - -public class GmShopCommand extends Command { - { - setDescription("Open the GM shop."); - } - - @Override - public void execute(Client c, String[] params) { - ShopFactory.getInstance().getShop(1337).sendShop(c); - } -} diff --git a/src/main/java/client/command/commands/gm2/HealCommand.java b/src/main/java/client/command/commands/gm2/HealCommand.java deleted file mode 100644 index 620c7ddf062..00000000000 --- a/src/main/java/client/command/commands/gm2/HealCommand.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.command.Command; - -public class HealCommand extends Command { - { - setDescription("Fully heal your HP/MP."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - player.healHpMp(); - } - -} diff --git a/src/main/java/client/command/commands/gm2/HideCommand.java b/src/main/java/client/command/commands/gm2/HideCommand.java deleted file mode 100644 index 33a5f9b2c38..00000000000 --- a/src/main/java/client/command/commands/gm2/HideCommand.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.SkillFactory; -import client.command.Command; - -public class HideCommand extends Command { - { - setDescription("Hide from players."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - SkillFactory.getSkill(9101004).getEffect(SkillFactory.getSkill(9101004).getMaxLevel()).applyTo(player); - - } -} diff --git a/src/main/java/client/command/commands/gm2/IdCommand.java b/src/main/java/client/command/commands/gm2/IdCommand.java deleted file mode 100644 index 36d119b8a1e..00000000000 --- a/src/main/java/client/command/commands/gm2/IdCommand.java +++ /dev/null @@ -1,143 +0,0 @@ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.command.Command; -import constants.game.NpcChat; -import constants.id.NpcId; -import server.ThreadManager; -import tools.exceptions.IdTypeNotSupportedException; - -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.concurrent.ConcurrentHashMap; -import java.util.function.Predicate; -import java.util.stream.Collectors; - -public class IdCommand extends Command { - { - setDescription("Search in handbook."); - } - private final static int MAX_SEARCH_HITS = 100; - private final Map handbookDirectory = typeFilePaths(); - private final Map typeItems = new ConcurrentHashMap<>(); - - private Map typeFilePaths() { - return Map.ofEntries( - Map.entry("map", "handbook/Map.txt"), - Map.entry("etc", "handbook/Etc.txt"), - Map.entry("npc", "handbook/NPC.txt"), - Map.entry("use", "handbook/Use.txt"), - Map.entry("weapon", "handbook/Equip/Weapon.txt") // TODO add more into this - ); - } - - private static class HandbookFileItems { - private final List items; - - public HandbookFileItems(List fileLines) { - this.items = fileLines.stream() - .map(this::parseLine) - .filter(Predicate.not(Objects::isNull)) - .toList(); - } - - private HandbookItem parseLine(String line) { - if (line == null) { - return null; - } - - String[] splitLine = line.split(" - ", 2); - if (splitLine.length < 2 || splitLine[1].isBlank()) { - return null; - } - return new HandbookItem(splitLine[0], splitLine[1]); - } - - public List search(String query) { - if (query == null || query.isBlank()) { - return Collections.emptyList(); - } - return items.stream() - .filter(item -> item.matches(query)) - .toList(); - } - } - - private record HandbookItem(String id, String name) { - - public HandbookItem { - Objects.requireNonNull(id); - Objects.requireNonNull(name); - } - - public boolean matches(String query) { - if (query == null) { - return false; - } - return this.name.toLowerCase().contains(query.toLowerCase()); - } - } - - @Override - public void execute(Client client, final String[] params) { - final Character chr = client.getPlayer(); - if (params.length < 2) { - chr.yellowMessage("Syntax: !id "); - return; - } - final String type = params[0].toLowerCase(); - final String[] queryItems = Arrays.copyOfRange(params, 1, params.length); - final String query = String.join(" ", queryItems); - chr.yellowMessage("Querying for entry... May take some time... Please try to refine your search."); - Runnable queryRunnable = () -> { - try { - populateIdMap(type); - - final HandbookFileItems handbookFileItems = typeItems.get(type); - if (handbookFileItems == null) { - return; - } - final List searchHits = handbookFileItems.search(query); - - if (!searchHits.isEmpty()) { - String searchHitsText = searchHits.stream() - .limit(MAX_SEARCH_HITS) - .map(item -> "Id for %s is: #b%s#k".formatted(item.name, item.id)) - .collect(Collectors.joining(NpcChat.NEW_LINE)); - int hitsCount = Math.min(searchHits.size(), MAX_SEARCH_HITS); - String summaryText = "Results found: #r%d#k | Returned: #b%d#k/100 | Refine search query to improve time.".formatted(searchHits.size(), hitsCount); - String fullText = searchHitsText + NpcChat.NEW_LINE + summaryText; - chr.getAbstractPlayerInteraction().npcTalk(NpcId.MAPLE_ADMINISTRATOR, fullText); - } else { - chr.yellowMessage(String.format("Id not found for item: %s, of type: %s.", query, type)); - } - } catch (IdTypeNotSupportedException e) { - chr.yellowMessage("Your query type is not supported."); - } catch (IOException e) { - chr.yellowMessage("Error reading file, please contact your administrator."); - } - }; - - ThreadManager.getInstance().newTask(queryRunnable); - } - - private void populateIdMap(String type) throws IdTypeNotSupportedException, IOException { - final String filePath = handbookDirectory.get(type); - if (filePath == null) { - throw new IdTypeNotSupportedException(); - } - if (typeItems.containsKey(type)) { - return; - } - - final List fileLines = Files.readAllLines(Path.of(filePath)); - typeItems.put(type, new HandbookFileItems(fileLines)); - } -} diff --git a/src/main/java/client/command/commands/gm2/ItemCommand.java b/src/main/java/client/command/commands/gm2/ItemCommand.java deleted file mode 100644 index d74f47b1d21..00000000000 --- a/src/main/java/client/command/commands/gm2/ItemCommand.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.command.Command; -import client.inventory.Pet; -import client.inventory.manipulator.InventoryManipulator; -import config.YamlConfig; -import constants.inventory.ItemConstants; -import server.ItemInformationProvider; - -import static java.util.concurrent.TimeUnit.DAYS; - -public class ItemCommand extends Command { - { - setDescription("Spawn an item into your inventory."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - - if (params.length < 1) { - player.yellowMessage("Syntax: !item "); - return; - } - - int itemId = Integer.parseInt(params[0]); - ItemInformationProvider ii = ItemInformationProvider.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 (YamlConfig.config.server.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.toMillis(days); - int petid = Pet.createPet(itemId); - - InventoryManipulator.addById(c, itemId, quantity, player.getName(), petid, expiration); - return; - } else { - player.yellowMessage("Pet Syntax: !item "); - return; - } - } - - short flag = 0; - if (player.gmLevel() < 3) { - flag |= ItemConstants.ACCOUNT_SHARING; - flag |= ItemConstants.UNTRADEABLE; - } - - InventoryManipulator.addById(c, itemId, quantity, player.getName(), -1, flag, -1); - } -} diff --git a/src/main/java/client/command/commands/gm2/ItemDropCommand.java b/src/main/java/client/command/commands/gm2/ItemDropCommand.java deleted file mode 100644 index ff065c651fd..00000000000 --- a/src/main/java/client/command/commands/gm2/ItemDropCommand.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.command.Command; -import client.inventory.InventoryType; -import client.inventory.Item; -import client.inventory.Pet; -import config.YamlConfig; -import constants.inventory.ItemConstants; -import server.ItemInformationProvider; - -import static java.util.concurrent.TimeUnit.DAYS; - -public class ItemDropCommand extends Command { - { - setDescription("Spawn an item onto the ground."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - - if (params.length < 1) { - player.yellowMessage("Syntax: !drop "); - return; - } - - int itemId = Integer.parseInt(params[0]); - ItemInformationProvider ii = ItemInformationProvider.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 (YamlConfig.config.server.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.toMillis(days); - int petid = Pet.createPet(itemId); - - Item toDrop = new Item(itemId, (short) 0, quantity, petid); - toDrop.setExpiration(expiration); - - toDrop.setOwner(""); - if (player.gmLevel() < 3) { - short f = toDrop.getFlag(); - f |= ItemConstants.ACCOUNT_SHARING; - f |= ItemConstants.UNTRADEABLE; - f |= ItemConstants.SANDBOX; - - toDrop.setFlag(f); - toDrop.setOwner("TRIAL-MODE"); - } - - c.getPlayer().getMap().spawnItemDrop(c.getPlayer(), c.getPlayer(), toDrop, c.getPlayer().getPosition(), true, true); - - return; - } else { - player.yellowMessage("Pet Syntax: !drop "); - return; - } - } - - Item toDrop; - if (ItemConstants.getInventoryType(itemId) == InventoryType.EQUIP) { - toDrop = ii.getEquipById(itemId); - } else { - toDrop = new Item(itemId, (short) 0, quantity); - } - - toDrop.setOwner(player.getName()); - if (player.gmLevel() < 3) { - short f = toDrop.getFlag(); - f |= ItemConstants.ACCOUNT_SHARING; - f |= ItemConstants.UNTRADEABLE; - f |= ItemConstants.SANDBOX; - - toDrop.setFlag(f); - toDrop.setOwner("TRIAL-MODE"); - } - - c.getPlayer().getMap().spawnItemDrop(c.getPlayer(), c.getPlayer(), toDrop, c.getPlayer().getPosition(), true, true); - } -} diff --git a/src/main/java/client/command/commands/gm2/JailCommand.java b/src/main/java/client/command/commands/gm2/JailCommand.java deleted file mode 100644 index 671199d1e3d..00000000000 --- a/src/main/java/client/command/commands/gm2/JailCommand.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.command.Command; -import constants.id.MapId; -import server.maps.MapleMap; -import server.maps.Portal; - -import static java.util.concurrent.TimeUnit.MINUTES; - -public class JailCommand extends Command { - { - setDescription("Move a player to the jail."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !jail []"); - return; - } - - int minutesJailed = 5; - if (params.length >= 2) { - minutesJailed = Integer.parseInt(params[1]); - if (minutesJailed <= 0) { - player.yellowMessage("Syntax: !jail []"); - return; - } - } - - Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]); - if (victim != null) { - victim.addJailExpirationTime(MINUTES.toMillis(minutesJailed)); - - if (victim.getMapId() != MapId.JAIL) { // those gone to jail won't be changing map anyway - MapleMap target = c.getChannelServer().getMapFactory().getMap(MapId.JAIL); - Portal targetPortal = target.getPortal(0); - victim.saveLocationOnWarp(); - 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."); - } - } -} diff --git a/src/main/java/client/command/commands/gm2/JobCommand.java b/src/main/java/client/command/commands/gm2/JobCommand.java deleted file mode 100644 index c233499e404..00000000000 --- a/src/main/java/client/command/commands/gm2/JobCommand.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.Job; -import client.command.Command; - -public class JobCommand extends Command { - { - setDescription("Change job of a player."); - } - - @Override - public void execute(Client c, String[] params) { - Character 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(Job.getById(jobid)); - player.equipChanged(); - } else if (params.length == 2) { - Character victim = c.getWorldServer().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(Job.getById(jobid)); - player.equipChanged(); - } else { - player.message("Player '" + params[0] + "' could not be found."); - } - } else { - player.message("Syntax: !job "); - } - } -} diff --git a/src/main/java/client/command/commands/gm2/LevelCommand.java b/src/main/java/client/command/commands/gm2/LevelCommand.java deleted file mode 100644 index b0846be4eba..00000000000 --- a/src/main/java/client/command/commands/gm2/LevelCommand.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.command.Command; -import config.YamlConfig; - -public class LevelCommand extends Command { - { - setDescription("Set your level."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !level "); - return; - } - - player.loseExp(player.getExp(), false, false); - player.setLevel(Math.min(Integer.parseInt(params[0]), player.getMaxClassLevel()) - 1); - - player.resetPlayerRates(); - if (YamlConfig.config.server.USE_ADD_RATES_BY_LEVEL) { - player.setPlayerRates(); - } - player.setWorldRates(); - - player.levelUp(false); - } -} diff --git a/src/main/java/client/command/commands/gm2/LevelProCommand.java b/src/main/java/client/command/commands/gm2/LevelProCommand.java deleted file mode 100644 index 20afd63b502..00000000000 --- a/src/main/java/client/command/commands/gm2/LevelProCommand.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.command.Command; - -public class LevelProCommand extends Command { - { - setDescription("Set your level, one by one."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !levelpro "); - return; - } - while (player.getLevel() < Math.min(player.getMaxClassLevel(), Integer.parseInt(params[0]))) { - player.levelUp(false); - } - } -} diff --git a/src/main/java/client/command/commands/gm2/LootCommand.java b/src/main/java/client/command/commands/gm2/LootCommand.java deleted file mode 100644 index 6ad115e34de..00000000000 --- a/src/main/java/client/command/commands/gm2/LootCommand.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . - */ - -/* - @Author: Resinate -*/ -package client.command.commands.gm2; - -import client.Client; -import client.command.Command; -import server.maps.MapItem; -import server.maps.MapObject; -import server.maps.MapObjectType; - -import java.util.Arrays; -import java.util.List; - -public class LootCommand extends Command { - - { - setDescription("Loots all items that belong to you."); - } - - @Override - public void execute(Client c, String[] params) { - List items = c.getPlayer().getMap().getMapObjectsInRange(c.getPlayer().getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapObjectType.ITEM)); - for (MapObject item : items) { - MapItem mapItem = (MapItem) item; - if (mapItem.getOwnerId() == c.getPlayer().getId() || mapItem.getOwnerId() == c.getPlayer().getPartyId()) { - c.getPlayer().pickupItem(mapItem); - } - } - - } -} diff --git a/src/main/java/client/command/commands/gm2/MaxSkillCommand.java b/src/main/java/client/command/commands/gm2/MaxSkillCommand.java deleted file mode 100644 index 8f1ffbd9a61..00000000000 --- a/src/main/java/client/command/commands/gm2/MaxSkillCommand.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.Job; -import client.Skill; -import client.SkillFactory; -import client.command.Command; -import provider.Data; -import provider.DataProviderFactory; -import provider.wz.WZFiles; - -public class MaxSkillCommand extends Command { - { - setDescription("Max out all job skills."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - for (Data skill_ : DataProviderFactory.getDataProvider(WZFiles.STRING).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(Job.ARAN1) || player.getJob().isA(Job.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 maxed out."); - } -} diff --git a/src/main/java/client/command/commands/gm2/MaxStatCommand.java b/src/main/java/client/command/commands/gm2/MaxStatCommand.java deleted file mode 100644 index f3e7dd1c8bc..00000000000 --- a/src/main/java/client/command/commands/gm2/MaxStatCommand.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.Stat; -import client.command.Command; -import config.YamlConfig; - -public class MaxStatCommand extends Command { - { - setDescription("Max out all character stats."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - player.loseExp(player.getExp(), false, false); - player.setLevel(255); - player.resetPlayerRates(); - if (YamlConfig.config.server.USE_ADD_RATES_BY_LEVEL) { - player.setPlayerRates(); - } - player.setWorldRates(); - player.updateStrDexIntLuk(Short.MAX_VALUE); - player.setFame(13337); - player.updateMaxHpMaxMp(30000, 30000); - player.updateSingleStat(Stat.LEVEL, 255); - player.updateSingleStat(Stat.FAME, 13337); - player.yellowMessage("Stats maxed out."); - } -} diff --git a/src/main/java/client/command/commands/gm2/MobSkillCommand.java b/src/main/java/client/command/commands/gm2/MobSkillCommand.java deleted file mode 100644 index d5adbdf0b35..00000000000 --- a/src/main/java/client/command/commands/gm2/MobSkillCommand.java +++ /dev/null @@ -1,40 +0,0 @@ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.command.Command; -import server.life.MobSkill; -import server.life.MobSkillFactory; -import server.life.MobSkillType; - -import java.util.Collections; -import java.util.Optional; - -public class MobSkillCommand extends Command { - { - setDescription("Apply a mob skill to all mobs on the map. Args: "); - } - - @Override - public void execute(Client client, String[] params) { - if (params.length < 2) { - throw new IllegalArgumentException("Mob skill command requires two args: mob skill id and level"); - } - - String skillId = params[0]; - String skillLevel = params[1]; - Optional possibleType = MobSkillType.from(Integer.parseInt(skillId)); - Optional possibleSkill = possibleType.map( - type -> MobSkillFactory.getMobSkillOrThrow(type, Integer.parseInt(skillLevel)) - ); - if (possibleSkill.isEmpty()) { - return; - } - - Character chr = client.getPlayer(); - MobSkill mobSkill = possibleSkill.get(); - chr.getMap().getAllMonsters().forEach( - monster -> mobSkill.applyEffect(chr, monster, false, Collections.emptyList()) - ); - } -} diff --git a/src/main/java/client/command/commands/gm2/ReachCommand.java b/src/main/java/client/command/commands/gm2/ReachCommand.java deleted file mode 100644 index 41b3bb3a6b1..00000000000 --- a/src/main/java/client/command/commands/gm2/ReachCommand.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.command.Command; -import server.maps.MapleMap; - -public class ReachCommand extends Command { - { - setDescription("Warp to a player."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !reach "); - return; - } - - Character 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.saveLocationOnWarp(); - player.forceChangeMap(map, map.findClosestPortal(victim.getPosition())); - } - } else { - player.dropMessage(6, "Unknown player."); - } - } -} diff --git a/src/main/java/client/command/commands/gm2/RechargeCommand.java b/src/main/java/client/command/commands/gm2/RechargeCommand.java deleted file mode 100644 index 3aaa23bb0e9..00000000000 --- a/src/main/java/client/command/commands/gm2/RechargeCommand.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.command.Command; -import client.inventory.InventoryType; -import client.inventory.Item; -import constants.inventory.ItemConstants; -import server.ItemInformationProvider; - -public class RechargeCommand extends Command { - { - setDescription("Recharge and refill all USE items."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - ItemInformationProvider ii = ItemInformationProvider.getInstance(); - for (Item torecharge : c.getPlayer().getInventory(InventoryType.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."); - } -} diff --git a/src/main/java/client/command/commands/gm2/ResetSkillCommand.java b/src/main/java/client/command/commands/gm2/ResetSkillCommand.java deleted file mode 100644 index db578291ac1..00000000000 --- a/src/main/java/client/command/commands/gm2/ResetSkillCommand.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.Job; -import client.Skill; -import client.SkillFactory; -import client.command.Command; -import provider.Data; -import provider.DataProviderFactory; -import provider.wz.WZFiles; - -public class ResetSkillCommand extends Command { - { - setDescription("Set all skill levels to 0."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - for (Data skill_ : DataProviderFactory.getDataProvider(WZFiles.STRING).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(Job.ARAN1) || player.getJob().isA(Job.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."); - } -} diff --git a/src/main/java/client/command/commands/gm2/SearchCommand.java b/src/main/java/client/command/commands/gm2/SearchCommand.java deleted file mode 100644 index 3ce506185d7..00000000000 --- a/src/main/java/client/command/commands/gm2/SearchCommand.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.command.Command; -import constants.id.NpcId; -import provider.Data; -import provider.DataProvider; -import provider.DataProviderFactory; -import provider.DataTool; -import provider.wz.WZFiles; -import server.ItemInformationProvider; -import server.quest.Quest; -import tools.Pair; - -public class SearchCommand extends Command { - private static Data npcStringData; - private static Data mobStringData; - private static Data skillStringData; - private static Data mapStringData; - - { - setDescription("Search String.wz."); - - DataProvider dataProvider = DataProviderFactory.getDataProvider(WZFiles.STRING); - npcStringData = dataProvider.getData("Npc.img"); - mobStringData = dataProvider.getData("Mob.img"); - skillStringData = dataProvider.getData("Skill.img"); - mapStringData = dataProvider.getData("Map.img"); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 2) { - player.yellowMessage("Syntax: !search "); - return; - } - StringBuilder sb = new StringBuilder(); - - String search = joinStringFrom(params, 1); - long start = System.currentTimeMillis();//for the lulz - Data data = null; - if (!params[0].equalsIgnoreCase("ITEM")) { - int searchType = 0; - - if (params[0].equalsIgnoreCase("NPC")) { - data = npcStringData; - } else if (params[0].equalsIgnoreCase("MOB") || params[0].equalsIgnoreCase("MONSTER")) { - data = mobStringData; - } else if (params[0].equalsIgnoreCase("SKILL")) { - data = skillStringData; - } else if (params[0].equalsIgnoreCase("MAP")) { - data = mapStringData; - searchType = 1; - } else if (params[0].equalsIgnoreCase("QUEST")) { - data = mapStringData; - searchType = 2; - } else { - sb.append("#bInvalid search.\r\nSyntax: '!search [type] [name]', where [type] is MAP, QUEST, NPC, ITEM, MOB, or SKILL."); - } - if (data != null) { - String name; - - if (searchType == 0) { - for (Data searchData : data.getChildren()) { - name = DataTool.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 if (searchType == 1) { - String mapName, streetName; - - for (Data searchDataDir : data.getChildren()) { - for (Data searchData : searchDataDir.getChildren()) { - mapName = DataTool.getString(searchData.getChildByPath("mapName"), "NO-NAME"); - streetName = DataTool.getString(searchData.getChildByPath("streetName"), "NO-NAME"); - - if (mapName.toLowerCase().contains(search.toLowerCase()) || streetName.toLowerCase().contains(search.toLowerCase())) { - sb.append("#b").append(Integer.parseInt(searchData.getName())).append("#k - #r").append(streetName).append(" - ").append(mapName).append("\r\n"); - } - } - } - } else { - for (Quest mq : Quest.getMatchedQuests(search)) { - sb.append("#b").append(mq.getId()).append("#k - #r"); - - String parentName = mq.getParentName(); - if (!parentName.isEmpty()) { - sb.append(parentName).append(" - "); - } - sb.append(mq.getName()).append("\r\n"); - } - } - } - } else { - for (Pair itemPair : ItemInformationProvider.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.getAbstractPlayerInteraction().npcTalk(NpcId.MAPLE_ADMINISTRATOR, sb.toString()); - } -} diff --git a/src/main/java/client/command/commands/gm2/SetSlotCommand.java b/src/main/java/client/command/commands/gm2/SetSlotCommand.java deleted file mode 100644 index fd8124e2de4..00000000000 --- a/src/main/java/client/command/commands/gm2/SetSlotCommand.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Ronan -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.command.Command; - -public class SetSlotCommand extends Command { - { - setDescription("Set amount of inventory slots in all tabs."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !setslot "); - return; - } - - int slots = (Integer.parseInt(params[0]) / 4) * 4; - for (int i = 1; i < 5; i++) { - int curSlots = player.getSlots(i); - if (slots <= -curSlots) { - continue; - } - - player.gainSlots(i, slots - curSlots, true); - } - - player.yellowMessage("Slots updated."); - } -} diff --git a/src/main/java/client/command/commands/gm2/SetStatCommand.java b/src/main/java/client/command/commands/gm2/SetStatCommand.java deleted file mode 100644 index 7eae82c123e..00000000000 --- a/src/main/java/client/command/commands/gm2/SetStatCommand.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.command.Command; - -public class SetStatCommand extends Command { - { - setDescription("Set all primary stats to new value."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !setstat "); - return; - } - - try { - int x = Integer.parseInt(params[0]); - - if (x > Short.MAX_VALUE) { - x = Short.MAX_VALUE; - } else if (x < 4) { - x = 4; // thanks Vcoc for pointing the minimal allowed stat value here - } - - player.updateStrDexIntLuk(x); - } catch (NumberFormatException nfe) { - } - } -} diff --git a/src/main/java/client/command/commands/gm2/SpCommand.java b/src/main/java/client/command/commands/gm2/SpCommand.java deleted file mode 100644 index f905c21a7a3..00000000000 --- a/src/main/java/client/command/commands/gm2/SpCommand.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.command.Command; -import config.YamlConfig; - -public class SpCommand extends Command { - { - setDescription("Set available SP."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !sp [] "); - return; - } - - if (params.length == 1) { - int newSp = Integer.parseInt(params[0]); - if (newSp < 0) { - newSp = 0; - } else if (newSp > YamlConfig.config.server.MAX_AP) { - newSp = YamlConfig.config.server.MAX_AP; - } - - player.updateRemainingSp(newSp); - } else { - Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]); - if (victim != null) { - int newSp = Integer.parseInt(params[1]); - if (newSp < 0) { - newSp = 0; - } else if (newSp > YamlConfig.config.server.MAX_AP) { - newSp = YamlConfig.config.server.MAX_AP; - } - - victim.updateRemainingSp(newSp); - - player.dropMessage(5, "SP given."); - } else { - player.message("Player '" + params[0] + "' could not be found."); - } - } - } -} diff --git a/src/main/java/client/command/commands/gm2/SummonCommand.java b/src/main/java/client/command/commands/gm2/SummonCommand.java deleted file mode 100644 index b159a176e14..00000000000 --- a/src/main/java/client/command/commands/gm2/SummonCommand.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.command.Command; -import net.server.Server; -import net.server.channel.Channel; -import server.maps.MapleMap; - -public class SummonCommand extends Command { - { - setDescription("Move a player to your location."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !warphere "); - return; - } - - Character 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) { - if (!victim.isLoggedinWorld()) { - player.dropMessage(6, "Player currently not logged in or unreachable."); - return; - } - - 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()); - } - - try { - for (int i = 0; i < 7; i++) { // poll for a while until the player reconnects - if (victim.isLoggedinWorld()) { - break; - } - Thread.sleep(1777); - } - } catch (InterruptedException e) { - } - - MapleMap map = player.getMap(); - victim.saveLocationOnWarp(); - victim.forceChangeMap(map, map.findClosestPortal(player.getPosition())); - } else { - player.dropMessage(6, "Unknown player."); - } - } -} diff --git a/src/main/java/client/command/commands/gm2/UnBugCommand.java b/src/main/java/client/command/commands/gm2/UnBugCommand.java deleted file mode 100644 index fb175c540d2..00000000000 --- a/src/main/java/client/command/commands/gm2/UnBugCommand.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Client; -import client.command.Command; -import tools.PacketCreator; - -public class UnBugCommand extends Command { - { - setDescription("Unbug self."); - } - - @Override - public void execute(Client c, String[] params) { - c.getPlayer().getMap().broadcastMessage(PacketCreator.enableActions()); - } -} diff --git a/src/main/java/client/command/commands/gm2/UnHideCommand.java b/src/main/java/client/command/commands/gm2/UnHideCommand.java deleted file mode 100644 index 1e2cd29cef2..00000000000 --- a/src/main/java/client/command/commands/gm2/UnHideCommand.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.SkillFactory; -import client.command.Command; - -public class UnHideCommand extends Command { - { - setDescription("Toggle Hide."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - SkillFactory.getSkill(9101004).getEffect(SkillFactory.getSkill(9101004).getMaxLevel()).applyTo(player); - - } -} diff --git a/src/main/java/client/command/commands/gm2/UnJailCommand.java b/src/main/java/client/command/commands/gm2/UnJailCommand.java deleted file mode 100644 index 41843f38e19..00000000000 --- a/src/main/java/client/command/commands/gm2/UnJailCommand.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.command.Command; - -public class UnJailCommand extends Command { - { - setDescription("Free a player from jail."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !unjail "); - return; - } - - Character victim = c.getWorldServer().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."); - } - } -} diff --git a/src/main/java/client/command/commands/gm2/WarpAreaCommand.java b/src/main/java/client/command/commands/gm2/WarpAreaCommand.java deleted file mode 100644 index 8d3d986e5fa..00000000000 --- a/src/main/java/client/command/commands/gm2/WarpAreaCommand.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: MedicOP - Add warparea command -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.command.Command; -import server.maps.MapleMap; - -import java.awt.*; -import java.util.Collection; - -public class WarpAreaCommand extends Command { - { - setDescription("Warp all nearby players to a new map."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !warparea "); - return; - } - - try { - MapleMap target = c.getChannelServer().getMapFactory().getMap(Integer.parseInt(params[0])); - if (target == null) { - player.yellowMessage("Map ID " + params[0] + " is invalid."); - return; - } - - Point pos = player.getPosition(); - - Collection characters = player.getMap().getAllPlayers(); - - for (Character victim : characters) { - if (victim.getPosition().distanceSq(pos) <= 50000) { - victim.saveLocationOnWarp(); - victim.changeMap(target, target.getRandomPlayerSpawnpoint()); - } - } - } catch (Exception ex) { - player.yellowMessage("Map ID " + params[0] + " is invalid."); - } - } -} diff --git a/src/main/java/client/command/commands/gm2/WarpCommand.java b/src/main/java/client/command/commands/gm2/WarpCommand.java deleted file mode 100644 index 4f191a51969..00000000000 --- a/src/main/java/client/command/commands/gm2/WarpCommand.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.command.Command; -import server.maps.FieldLimit; -import server.maps.MapleMap; -import server.maps.MiniDungeonInfo; - -public class WarpCommand extends Command { - { - setDescription("Warp to a map."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !warp "); - 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.isAlive()) { - player.dropMessage(1, "This command cannot be used when you're dead."); - return; - } - - if (!player.isGM()) { - if (player.getEventInstance() != null || MiniDungeonInfo.isDungeonMap(player.getMapId()) || FieldLimit.CANNOTMIGRATE.check(player.getMap().getFieldLimit())) { - player.dropMessage(1, "This command cannot be used in this map."); - return; - } - } - - // expedition issue with this command detected thanks to Masterrulax - player.saveLocationOnWarp(); - player.changeMap(target, target.getRandomPlayerSpawnpoint()); - } catch (Exception ex) { - player.yellowMessage("Map ID " + params[0] + " is invalid."); - } - } -} diff --git a/src/main/java/client/command/commands/gm2/WarpMapCommand.java b/src/main/java/client/command/commands/gm2/WarpMapCommand.java deleted file mode 100644 index 3e7c5ab5e17..00000000000 --- a/src/main/java/client/command/commands/gm2/WarpMapCommand.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: MedicOP - Add warpmap command -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.command.Command; -import server.maps.MapleMap; - -import java.util.Collection; - -public class WarpMapCommand extends Command { - { - setDescription("Warp all characters on current map to a new map."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !warpmap "); - return; - } - - try { - MapleMap target = c.getChannelServer().getMapFactory().getMap(Integer.parseInt(params[0])); - if (target == null) { - player.yellowMessage("Map ID " + params[0] + " is invalid."); - return; - } - - Collection characters = player.getMap().getAllPlayers(); - - for (Character victim : characters) { - victim.saveLocationOnWarp(); - victim.changeMap(target, target.getRandomPlayerSpawnpoint()); - } - } catch (Exception ex) { - player.yellowMessage("Map ID " + params[0] + " is invalid."); - } - } -} diff --git a/src/main/java/client/command/commands/gm2/WhereaMiCommand.java b/src/main/java/client/command/commands/gm2/WhereaMiCommand.java deleted file mode 100644 index b4ddc29d9fb..00000000000 --- a/src/main/java/client/command/commands/gm2/WhereaMiCommand.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm2; - -import client.Character; -import client.Client; -import client.command.Command; -import server.life.Monster; -import server.life.NPC; -import server.life.PlayerNPC; -import server.maps.MapObject; - -import java.util.HashSet; - -public class WhereaMiCommand extends Command { - { - setDescription("Show info about objects on current map."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - - HashSet chars = new HashSet<>(); - HashSet npcs = new HashSet<>(); - HashSet playernpcs = new HashSet<>(); - HashSet mobs = new HashSet<>(); - - for (MapObject mmo : player.getMap().getMapObjects()) { - if (mmo instanceof NPC npc) { - npcs.add(npc); - } else if (mmo instanceof Character mc) { - chars.add(mc); - } else if (mmo instanceof Monster mob) { - if (mob.isAlive()) { - mobs.add(mob); - } - } else if (mmo instanceof PlayerNPC npc) { - playernpcs.add(npc); - } - } - - player.yellowMessage("Map ID: " + player.getMap().getId()); - - player.yellowMessage("Players on this map:"); - for (Character chr : chars) { - player.dropMessage(5, ">> " + chr.getName() + " - " + chr.getId() + " - Oid: " + chr.getObjectId()); - } - - if (!playernpcs.isEmpty()) { - player.yellowMessage("PlayerNPCs on this map:"); - for (PlayerNPC pnpc : playernpcs) { - player.dropMessage(5, ">> " + pnpc.getName() + " - Scriptid: " + pnpc.getScriptId() + " - Oid: " + pnpc.getObjectId()); - } - } - - if (!npcs.isEmpty()) { - player.yellowMessage("NPCs on this map:"); - for (NPC npc : npcs) { - player.dropMessage(5, ">> " + npc.getName() + " - " + npc.getId() + " - Oid: " + npc.getObjectId()); - } - } - - if (!mobs.isEmpty()) { - player.yellowMessage("Monsters on this map:"); - for (Monster mob : mobs) { - if (mob.isAlive()) { - player.dropMessage(5, ">> " + mob.getName() + " - " + mob.getId() + " - Oid: " + mob.getObjectId()); - } - } - } - } -} diff --git a/src/main/java/client/command/commands/gm3/BanCommand.java b/src/main/java/client/command/commands/gm3/BanCommand.java deleted file mode 100644 index c1ee362cedd..00000000000 --- a/src/main/java/client/command/commands/gm3/BanCommand.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import net.server.Server; -import server.TimerManager; -import tools.DatabaseConnection; -import tools.PacketCreator; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.SQLException; - -public class BanCommand extends Command { - { - setDescription("Ban a player."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 2) { - player.yellowMessage("Syntax: !ban (Please be descriptive)"); - return; - } - String ign = params[0]; - String reason = joinStringFrom(params, 1); - Character target = c.getChannelServer().getPlayerStorage().getCharacterByName(ign); - if (target != null) { - String readableTargetName = Character.makeMapleReadable(target.getName()); - String ip = target.getClient().getRemoteAddress(); - //Ban ip - try (Connection con = DatabaseConnection.getConnection()) { - if (ip.matches("/[0-9]{1,3}\\..*")) { - try (PreparedStatement ps = con.prepareStatement("INSERT INTO ipbans VALUES (DEFAULT, ?, ?)")) { - ps.setString(1, ip); - ps.setString(2, String.valueOf(target.getClient().getAccID())); - - ps.executeUpdate(); - } - } - } 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); - } - reason = c.getPlayer().getName() + " banned " + readableTargetName + " for " + reason + " (IP: " + ip + ")"; - target.ban(reason); - target.yellowMessage("You have been banned by #b" + c.getPlayer().getName() + " #k."); - target.yellowMessage("Reason: " + reason); - c.sendPacket(PacketCreator.getGMEffect(4, (byte) 0)); - final Character rip = target; - TimerManager.getInstance().schedule(() -> rip.getClient().disconnect(false, false), 5000); //5 Seconds - Server.getInstance().broadcastMessage(c.getWorld(), PacketCreator.serverNotice(6, "[RIP]: " + ign + " has been banned.")); - } else if (Character.ban(ign, reason, false)) { - c.sendPacket(PacketCreator.getGMEffect(4, (byte) 0)); - Server.getInstance().broadcastMessage(c.getWorld(), PacketCreator.serverNotice(6, "[RIP]: " + ign + " has been banned.")); - } else { - c.sendPacket(PacketCreator.getGMEffect(6, (byte) 1)); - } - } -} diff --git a/src/main/java/client/command/commands/gm3/ChatCommand.java b/src/main/java/client/command/commands/gm3/ChatCommand.java deleted file mode 100644 index 0ea9c366372..00000000000 --- a/src/main/java/client/command/commands/gm3/ChatCommand.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; - -public class ChatCommand extends Command { - { - setDescription("Toggle white GM chat."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - player.toggleWhiteChat(); - player.message("Your chat is now " + (player.getWhiteChat() ? " white" : "normal") + "."); - } -} diff --git a/src/main/java/client/command/commands/gm3/CheckDmgCommand.java b/src/main/java/client/command/commands/gm3/CheckDmgCommand.java deleted file mode 100644 index 82ffe11cd0d..00000000000 --- a/src/main/java/client/command/commands/gm3/CheckDmgCommand.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.BuffStat; -import client.Character; -import client.Client; -import client.command.Command; - -public class CheckDmgCommand extends Command { - { - setDescription("Show stats and damage of a player."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]); - if (victim != null) { - int maxBase = victim.calculateMaxBaseDamage(victim.getTotalWatk()); - Integer watkBuff = victim.getBuffedValue(BuffStat.WATK); - Integer matkBuff = victim.getBuffedValue(BuffStat.MATK); - int 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."); - } - } -} diff --git a/src/main/java/client/command/commands/gm3/ClosePortalCommand.java b/src/main/java/client/command/commands/gm3/ClosePortalCommand.java deleted file mode 100644 index 32f55c53c3d..00000000000 --- a/src/main/java/client/command/commands/gm3/ClosePortalCommand.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; - -public class ClosePortalCommand extends Command { - { - setDescription("Close a portal."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !closeportal "); - return; - } - player.getMap().getPortal(params[0]).setPortalState(false); - } -} diff --git a/src/main/java/client/command/commands/gm3/DebuffCommand.java b/src/main/java/client/command/commands/gm3/DebuffCommand.java deleted file mode 100644 index dedc6d853ce..00000000000 --- a/src/main/java/client/command/commands/gm3/DebuffCommand.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.Disease; -import client.command.Command; -import server.life.MobSkill; -import server.life.MobSkillFactory; -import server.life.MobSkillType; -import server.maps.MapObject; -import server.maps.MapObjectType; - -import java.util.Arrays; -import java.util.Optional; - -public class DebuffCommand extends Command { - { - setDescription("Put a debuff on all nearby players."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !debuff SLOW|SEDUCE|ZOMBIFY|CONFUSE|STUN|POISON|SEAL|DARKNESS|WEAKEN|CURSE"); - return; - } - - Disease disease = null; - Optional skill = Optional.empty(); - - switch (params[0].toUpperCase()) { - case "SLOW" -> { - disease = Disease.SLOW; - skill = MobSkillFactory.getMobSkill(MobSkillType.SLOW, 7); - } - case "SEDUCE" -> { - disease = Disease.SEDUCE; - skill = MobSkillFactory.getMobSkill(MobSkillType.SEDUCE, 7); - } - case "ZOMBIFY" -> { - disease = Disease.ZOMBIFY; - skill = MobSkillFactory.getMobSkill(MobSkillType.UNDEAD, 1); - } - case "CONFUSE" -> { - disease = Disease.CONFUSE; - skill = MobSkillFactory.getMobSkill(MobSkillType.REVERSE_INPUT, 2); - } - case "STUN" -> { - disease = Disease.STUN; - skill = MobSkillFactory.getMobSkill(MobSkillType.STUN, 7); - } - case "POISON" -> { - disease = Disease.POISON; - skill = MobSkillFactory.getMobSkill(MobSkillType.POISON, 5); - } - case "SEAL" -> { - disease = Disease.SEAL; - skill = MobSkillFactory.getMobSkill(MobSkillType.SEAL, 1); - } - case "DARKNESS" -> { - disease = Disease.DARKNESS; - skill = MobSkillFactory.getMobSkill(MobSkillType.DARKNESS, 1); - } - case "WEAKEN" -> { - disease = Disease.WEAKEN; - skill = MobSkillFactory.getMobSkill(MobSkillType.WEAKNESS, 1); - } - case "CURSE" -> { - disease = Disease.CURSE; - skill = MobSkillFactory.getMobSkill(MobSkillType.CURSE, 1); - } - } - - if (disease == null || skill.isEmpty()) { - player.yellowMessage("Syntax: !debuff SLOW|SEDUCE|ZOMBIFY|CONFUSE|STUN|POISON|SEAL|DARKNESS|WEAKEN|CURSE"); - return; - } - - for (MapObject mmo : player.getMap().getMapObjectsInRange(player.getPosition(), 777777.7, Arrays.asList(MapObjectType.PLAYER))) { - Character chr = (Character) mmo; - - if (chr.getId() != player.getId()) { - chr.giveDebuff(disease, skill.get()); - } - } - } -} diff --git a/src/main/java/client/command/commands/gm3/EndEventCommand.java b/src/main/java/client/command/commands/gm3/EndEventCommand.java deleted file mode 100644 index ceb13efd910..00000000000 --- a/src/main/java/client/command/commands/gm3/EndEventCommand.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; - -public class EndEventCommand extends Command { - { - setDescription("Close entry for ongoing event."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - c.getChannelServer().setEvent(null); - player.dropMessage(5, "You have ended the event. No more players may join."); - } -} diff --git a/src/main/java/client/command/commands/gm3/ExpedsCommand.java b/src/main/java/client/command/commands/gm3/ExpedsCommand.java deleted file mode 100644 index ed54ea911f7..00000000000 --- a/src/main/java/client/command/commands/gm3/ExpedsCommand.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import net.server.Server; -import net.server.channel.Channel; -import server.expeditions.Expedition; - -import java.util.List; -import java.util.Map.Entry; - -public class ExpedsCommand extends Command { - { - setDescription("Show all ongoing boss expeditions."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - for (Channel ch : Server.getInstance().getChannelsFromWorld(c.getWorld())) { - List expeds = ch.getExpeditions(); - if (expeds.isEmpty()) { - player.yellowMessage("No Expeditions in Channel " + ch.getId()); - continue; - } - player.yellowMessage("Expeditions in Channel " + ch.getId()); - int id = 0; - for (Expedition exped : expeds) { - 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 (Entry e : exped.getMembers().entrySet()) { - if (exped.isLeader(e.getKey())) { - continue; - } - player.yellowMessage(">>> Member " + memId + ": " + e.getValue()); - memId++; - } - } - } - } -} diff --git a/src/main/java/client/command/commands/gm3/FaceCommand.java b/src/main/java/client/command/commands/gm3/FaceCommand.java deleted file mode 100644 index 2ceed1145c0..00000000000 --- a/src/main/java/client/command/commands/gm3/FaceCommand.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.Stat; -import client.command.Command; -import constants.inventory.ItemConstants; -import server.ItemInformationProvider; - -public class FaceCommand extends Command { - { - setDescription("Change face of a player."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !face [] "); - return; - } - - try { - if (params.length == 1) { - int itemId = Integer.parseInt(params[0]); - if (!ItemConstants.isFace(itemId) || ItemInformationProvider.getInstance().getName(itemId) == null) { - player.yellowMessage("Face id '" + params[0] + "' does not exist."); - return; - } - - player.setFace(itemId); - player.updateSingleStat(Stat.FACE, itemId); - player.equipChanged(); - } else { - int itemId = Integer.parseInt(params[1]); - if (!ItemConstants.isFace(itemId) || ItemInformationProvider.getInstance().getName(itemId) == null) { - player.yellowMessage("Face id '" + params[1] + "' does not exist."); - } - - Character victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]); - if (victim != null) { - victim.setFace(itemId); - victim.updateSingleStat(Stat.FACE, itemId); - victim.equipChanged(); - } else { - player.yellowMessage("Player '" + params[0] + "' has not been found on this channel."); - } - } - } catch (Exception e) { - } - - } -} diff --git a/src/main/java/client/command/commands/gm3/FameCommand.java b/src/main/java/client/command/commands/gm3/FameCommand.java deleted file mode 100644 index 3cd2819e0be..00000000000 --- a/src/main/java/client/command/commands/gm3/FameCommand.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.Stat; -import client.command.Command; - -public class FameCommand extends Command { - { - setDescription("Set new fame value of a player."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 2) { - player.yellowMessage("Syntax: !fame "); - return; - } - - Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]); - if (victim != null) { - victim.setFame(Integer.parseInt(params[1])); - victim.updateSingleStat(Stat.FAME, victim.getFame()); - player.message("FAME given."); - } else { - player.message("Player '" + params[0] + "' could not be found."); - } - } -} diff --git a/src/main/java/client/command/commands/gm3/FlyCommand.java b/src/main/java/client/command/commands/gm3/FlyCommand.java deleted file mode 100644 index 21d92bc258a..00000000000 --- a/src/main/java/client/command/commands/gm3/FlyCommand.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import net.server.Server; - -public class FlyCommand extends Command { - { - setDescription("Enable/disable fly feature."); - } - - @Override - public void execute(Client c, String[] params) { // fly option will become available for any character of that account - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !fly "); - 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); - } -} diff --git a/src/main/java/client/command/commands/gm3/GiveMesosCommand.java b/src/main/java/client/command/commands/gm3/GiveMesosCommand.java deleted file mode 100644 index f625c0ed789..00000000000 --- a/src/main/java/client/command/commands/gm3/GiveMesosCommand.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; - -public class GiveMesosCommand extends Command { - { - setDescription("Give mesos to a player."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !givems [] "); - return; - } - - String recv_, value_; - long mesos_ = 0; - - if (params.length == 2) { - recv_ = params[0]; - value_ = params[1]; - } else { - recv_ = c.getPlayer().getName(); - value_ = params[0]; - } - - try { - mesos_ = Long.parseLong(value_); - if (mesos_ > Integer.MAX_VALUE) { - mesos_ = Integer.MAX_VALUE; - } else if (mesos_ < Integer.MIN_VALUE) { - mesos_ = Integer.MIN_VALUE; - } - } catch (NumberFormatException nfe) { - if (value_.contentEquals("max")) { // "max" descriptor suggestion thanks to Vcoc - mesos_ = Integer.MAX_VALUE; - } else if (value_.contentEquals("min")) { - mesos_ = Integer.MIN_VALUE; - } - } - - Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(recv_); - if (victim != null) { - victim.gainMeso((int) mesos_, true); - player.message("MESO given."); - } else { - player.message("Player '" + recv_ + "' could not be found."); - } - } -} diff --git a/src/main/java/client/command/commands/gm3/GiveNxCommand.java b/src/main/java/client/command/commands/gm3/GiveNxCommand.java deleted file mode 100644 index 783d35d699b..00000000000 --- a/src/main/java/client/command/commands/gm3/GiveNxCommand.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; - -public class GiveNxCommand extends Command { - { - setDescription("Give NX to a player."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !givenx [nx, mp, np] [] "); - return; - } - - String recv, typeStr = "nx"; - int value, type = 1; - if (params.length > 1) { - if (params[0].length() == 2) { - switch (params[0]) { - case "mp": // maplePoint - type = 2; - break; - case "np": // nxPrepaid - type = 4; - break; - default: - type = 1; - } - typeStr = params[0]; - - if (params.length > 2) { - recv = params[1]; - value = Integer.parseInt(params[2]); - } else { - recv = c.getPlayer().getName(); - value = Integer.parseInt(params[1]); - } - } else { - recv = params[0]; - value = Integer.parseInt(params[1]); - } - } else { - recv = c.getPlayer().getName(); - value = Integer.parseInt(params[0]); - } - - Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(recv); - if (victim != null) { - victim.getCashShop().gainCash(type, value); - player.message(typeStr.toUpperCase() + " given."); - } else { - player.message("Player '" + recv + "' could not be found."); - } - } -} diff --git a/src/main/java/client/command/commands/gm3/GiveRpCommand.java b/src/main/java/client/command/commands/gm3/GiveRpCommand.java deleted file mode 100644 index 84d8155e67d..00000000000 --- a/src/main/java/client/command/commands/gm3/GiveRpCommand.java +++ /dev/null @@ -1,29 +0,0 @@ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; - -public class GiveRpCommand extends Command { - { - setDescription("Give reward points to a player."); - } - - @Override - public void execute(Client client, String[] params) { - Character player = client.getPlayer(); - if (params.length < 2) { - player.yellowMessage("Syntax: !giverp "); - return; - } - - Character victim = client.getWorldServer().getPlayerStorage().getCharacterByName(params[0]); - if (victim != null) { - victim.setRewardPoints(victim.getRewardPoints() + Integer.parseInt(params[1])); - player.message("RP given. Player " + params[0] + " now has " + victim.getRewardPoints() - + " reward points."); - } else { - player.message("Player '" + params[0] + "' could not be found."); - } - } -} diff --git a/src/main/java/client/command/commands/gm3/GiveVpCommand.java b/src/main/java/client/command/commands/gm3/GiveVpCommand.java deleted file mode 100644 index 6bad23706a7..00000000000 --- a/src/main/java/client/command/commands/gm3/GiveVpCommand.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; - -public class GiveVpCommand extends Command { - { - setDescription("Give vote points to a player."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 2) { - player.yellowMessage("Syntax: !givevp "); - return; - } - - Character victim = c.getWorldServer().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."); - } - } -} diff --git a/src/main/java/client/command/commands/gm3/HairCommand.java b/src/main/java/client/command/commands/gm3/HairCommand.java deleted file mode 100644 index eaaebaae651..00000000000 --- a/src/main/java/client/command/commands/gm3/HairCommand.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.Stat; -import client.command.Command; -import constants.inventory.ItemConstants; -import server.ItemInformationProvider; - -public class HairCommand extends Command { - { - setDescription("Change hair of a player."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !hair [] "); - return; - } - - try { - if (params.length == 1) { - int itemId = Integer.parseInt(params[0]); - if (!ItemConstants.isHair(itemId) || ItemInformationProvider.getInstance().getName(itemId) == null) { - player.yellowMessage("Hair id '" + params[0] + "' does not exist."); - return; - } - - player.setHair(itemId); - player.updateSingleStat(Stat.HAIR, itemId); - player.equipChanged(); - } else { - int itemId = Integer.parseInt(params[1]); - if (!ItemConstants.isHair(itemId) || ItemInformationProvider.getInstance().getName(itemId) == null) { - player.yellowMessage("Hair id '" + params[1] + "' does not exist."); - return; - } - - Character victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]); - if (victim != null) { - victim.setHair(itemId); - victim.updateSingleStat(Stat.HAIR, itemId); - victim.equipChanged(); - } else { - player.yellowMessage("Player '" + params[0] + "' has not been found on this channel."); - } - } - } catch (Exception e) { - } - } -} diff --git a/src/main/java/client/command/commands/gm3/HealMapCommand.java b/src/main/java/client/command/commands/gm3/HealMapCommand.java deleted file mode 100644 index 295e46f6337..00000000000 --- a/src/main/java/client/command/commands/gm3/HealMapCommand.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; - -public class HealMapCommand extends Command { - { - setDescription("Heal all HP/MP of all players in the map."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - for (Character mch : player.getMap().getCharacters()) { - if (mch != null) { - mch.healHpMp(); - } - } - } -} diff --git a/src/main/java/client/command/commands/gm3/HealPersonCommand.java b/src/main/java/client/command/commands/gm3/HealPersonCommand.java deleted file mode 100644 index 50dcd176011..00000000000 --- a/src/main/java/client/command/commands/gm3/HealPersonCommand.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; - -public class HealPersonCommand extends Command { - { - setDescription("Heal all HP/MP of a player."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]); - if (victim != null) { - victim.healHpMp(); - } else { - player.message("Player '" + params[0] + "' could not be found."); - } - } -} diff --git a/src/main/java/client/command/commands/gm3/HpMpCommand.java b/src/main/java/client/command/commands/gm3/HpMpCommand.java deleted file mode 100644 index 520886bdb02..00000000000 --- a/src/main/java/client/command/commands/gm3/HpMpCommand.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; - -public class HpMpCommand extends Command { - { - setDescription("Set HP/MP of a player."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - Character victim = player; - int statUpdate = 1; - - if (params.length == 2) { - victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]); - statUpdate = Integer.parseInt(params[1]); - } else if (params.length == 1) { - statUpdate = Integer.parseInt(params[0]); - } else { - player.yellowMessage("Syntax: !hpmp [] "); - } - - if (victim != null) { - victim.updateHpMp(statUpdate); - } else { - player.message("Player '" + params[0] + "' could not be found on this world."); - } - } -} diff --git a/src/main/java/client/command/commands/gm3/HurtCommand.java b/src/main/java/client/command/commands/gm3/HurtCommand.java deleted file mode 100644 index ee4dc87ce0e..00000000000 --- a/src/main/java/client/command/commands/gm3/HurtCommand.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; - -public class HurtCommand extends Command { - { - setDescription("Nearly kill a player."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]); - if (victim != null) { - victim.updateHp(1); - } else { - player.message("Player '" + params[0] + "' could not be found."); - } - } -} diff --git a/src/main/java/client/command/commands/gm3/IgnoreCommand.java b/src/main/java/client/command/commands/gm3/IgnoreCommand.java deleted file mode 100644 index 8428bd22bf7..00000000000 --- a/src/main/java/client/command/commands/gm3/IgnoreCommand.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.autoban.AutobanFactory; -import client.command.Command; -import net.server.Server; -import tools.PacketCreator; - -public class IgnoreCommand extends Command { - { - setDescription("Toggle ignore a character from auto-ban alerts."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !ignore "); - return; - } - Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]); - if (victim == null) { - player.message("Player '" + params[0] + "' could not be found on this world."); - return; - } - - boolean ignored = AutobanFactory.toggleIgnored(victim.getId()); - player.yellowMessage(victim.getName() + " is " + (ignored ? "now being ignored." : "no longer being ignored.")); - String message_ = player.getName() + (ignored ? " has started ignoring " : " has stopped ignoring ") + victim.getName() + "."; - Server.getInstance().broadcastGMMessage(c.getWorld(), PacketCreator.serverNotice(5, message_)); - - } -} diff --git a/src/main/java/client/command/commands/gm3/IgnoredCommand.java b/src/main/java/client/command/commands/gm3/IgnoredCommand.java deleted file mode 100644 index f15ccd863a3..00000000000 --- a/src/main/java/client/command/commands/gm3/IgnoredCommand.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.autoban.AutobanFactory; -import client.command.Command; - -public class IgnoredCommand extends Command { - { - setDescription("Show all characters being ignored in auto-ban alerts."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - for (int chrId : AutobanFactory.getIgnoredChrIds()) { - player.yellowMessage(Character.getNameById(chrId) + " is being ignored."); - } - } -} diff --git a/src/main/java/client/command/commands/gm3/InMapCommand.java b/src/main/java/client/command/commands/gm3/InMapCommand.java deleted file mode 100644 index e7173b755c6..00000000000 --- a/src/main/java/client/command/commands/gm3/InMapCommand.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; - -public class InMapCommand extends Command { - { - setDescription("Show all players in the map."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - String st = ""; - for (Character chr : player.getMap().getCharacters()) { - st += chr.getName() + " "; - } - player.message(st); - - } -} diff --git a/src/main/java/client/command/commands/gm3/KillAllCommand.java b/src/main/java/client/command/commands/gm3/KillAllCommand.java deleted file mode 100644 index 787e48343f0..00000000000 --- a/src/main/java/client/command/commands/gm3/KillAllCommand.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import constants.id.MobId; -import server.life.Monster; -import server.maps.MapObject; -import server.maps.MapObjectType; -import server.maps.MapleMap; - -import java.util.Arrays; -import java.util.List; - -public class KillAllCommand extends Command { - { - setDescription("Kill all mobs in the map."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - MapleMap map = player.getMap(); - List monsters = map.getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapObjectType.MONSTER)); - int count = 0; - for (MapObject monstermo : monsters) { - Monster monster = (Monster) monstermo; - if (!monster.getStats().isFriendly() && !(monster.getId() >= MobId.DEAD_HORNTAIL_MIN && monster.getId() <= MobId.HORNTAIL)) { - map.damageMonster(player, monster, Integer.MAX_VALUE); - count++; - } - } - player.dropMessage(5, "Killed " + count + " monsters."); - } -} diff --git a/src/main/java/client/command/commands/gm3/KillCommand.java b/src/main/java/client/command/commands/gm3/KillCommand.java deleted file mode 100644 index aefb43e55a0..00000000000 --- a/src/main/java/client/command/commands/gm3/KillCommand.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import net.server.Server; -import tools.PacketCreator; - -public class KillCommand extends Command { - { - setDescription("Kill a player."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !kill "); - return; - } - - Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]); - if (victim != null) { - victim.updateHpMp(0); - Server.getInstance().broadcastGMMessage(c.getWorld(), PacketCreator.serverNotice(5, player.getName() + " used !kill on " + victim.getName())); - } else { - player.message("Player '" + params[0] + "' could not be found."); - } - } -} diff --git a/src/main/java/client/command/commands/gm3/KillMapCommand.java b/src/main/java/client/command/commands/gm3/KillMapCommand.java deleted file mode 100644 index babcb59807b..00000000000 --- a/src/main/java/client/command/commands/gm3/KillMapCommand.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; - -public class KillMapCommand extends Command { - { - setDescription("Kill all players in the map."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - for (Character mch : player.getMap().getCharacters()) { - mch.updateHp(0); - } - } -} diff --git a/src/main/java/client/command/commands/gm3/MaxEnergyCommand.java b/src/main/java/client/command/commands/gm3/MaxEnergyCommand.java deleted file mode 100644 index 977bb5f19f1..00000000000 --- a/src/main/java/client/command/commands/gm3/MaxEnergyCommand.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import tools.PacketCreator; - -public class MaxEnergyCommand extends Command { - { - setDescription("Set dojo energy to max value."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - c.getPlayer().setDojoEnergy(10000); - c.sendPacket(PacketCreator.getEnergy("energy", 10000)); - } -} diff --git a/src/main/java/client/command/commands/gm3/MaxHpMpCommand.java b/src/main/java/client/command/commands/gm3/MaxHpMpCommand.java deleted file mode 100644 index ed940562fdb..00000000000 --- a/src/main/java/client/command/commands/gm3/MaxHpMpCommand.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; - -public class MaxHpMpCommand extends Command { - { - setDescription("Set base HP/MP of a player."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - Character victim = player; - - int statUpdate = 1; - if (params.length >= 2) { - victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]); - statUpdate = Integer.parseInt(params[1]); - } else if (params.length == 1) { - statUpdate = Integer.parseInt(params[0]); - } else { - player.yellowMessage("Syntax: !maxhpmp [] "); - } - - if (victim != null) { - int extraHp = victim.getCurrentMaxHp() - victim.getClientMaxHp(); - int extraMp = victim.getCurrentMaxMp() - victim.getClientMaxMp(); - statUpdate = Math.max(1 + Math.max(extraHp, extraMp), statUpdate); - - int maxhpUpdate = statUpdate - extraHp; - int maxmpUpdate = statUpdate - extraMp; - victim.updateMaxHpMaxMp(maxhpUpdate, maxmpUpdate); - } else { - player.message("Player '" + params[0] + "' could not be found on this world."); - } - } -} diff --git a/src/main/java/client/command/commands/gm3/MonitorCommand.java b/src/main/java/client/command/commands/gm3/MonitorCommand.java deleted file mode 100644 index 7b138192526..00000000000 --- a/src/main/java/client/command/commands/gm3/MonitorCommand.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import net.packet.logging.MonitoredChrLogger; -import net.server.Server; -import tools.PacketCreator; - -public class MonitorCommand extends Command { - { - setDescription("Toggle monitored packet logging of a character."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !monitor "); - return; - } - Character 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 = MonitoredChrLogger.toggleMonitored(victim.getId()); - player.yellowMessage(victim.getId() + " is " + (monitored ? "now being monitored." : "no longer being monitored.")); - String message = player.getName() + (monitored ? " has started monitoring " : " has stopped monitoring ") + victim.getId() + "."; - Server.getInstance().broadcastGMMessage(c.getWorld(), PacketCreator.serverNotice(5, message)); - - } -} diff --git a/src/main/java/client/command/commands/gm3/MonitorsCommand.java b/src/main/java/client/command/commands/gm3/MonitorsCommand.java deleted file mode 100644 index 841433a7c74..00000000000 --- a/src/main/java/client/command/commands/gm3/MonitorsCommand.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import net.packet.logging.MonitoredChrLogger; - -public class MonitorsCommand extends Command { - { - setDescription("Show all characters being monitored for packet logging"); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - for (int chrId : MonitoredChrLogger.getMonitoredChrIds()) { - player.yellowMessage(Character.getNameById(chrId) + " is being monitored."); - } - } -} diff --git a/src/main/java/client/command/commands/gm3/MusicCommand.java b/src/main/java/client/command/commands/gm3/MusicCommand.java deleted file mode 100644 index a563c0b7e55..00000000000 --- a/src/main/java/client/command/commands/gm3/MusicCommand.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import constants.game.GameConstants; -import constants.id.NpcId; -import tools.PacketCreator; - -public class MusicCommand extends Command { - { - setDescription("Play a song."); - } - - private static String getSongList() { - String songList = "Song:\r\n"; - for (String s : GameConstants.GAME_SONGS) { - songList += (" " + s + "\r\n"); - } - - return songList; - } - - @Override - public void execute(Client c, String[] params) { - - Character player = c.getPlayer(); - if (params.length < 1) { - String sendMsg = ""; - - sendMsg += "Syntax: #r!music #k\r\n\r\n"; - sendMsg += getSongList(); - - c.sendPacket(PacketCreator.getNPCTalk(NpcId.BILLY, (byte) 0, sendMsg, "00 00", (byte) 0)); - return; - } - - String song = player.getLastCommandMessage(); - for (String s : GameConstants.GAME_SONGS) { - if (s.equalsIgnoreCase(song)) { // thanks Masterrulax for finding an issue here - player.getMap().broadcastMessage(PacketCreator.musicChange(s)); - player.yellowMessage("Now playing song " + s + "."); - return; - } - } - - String sendMsg = ""; - sendMsg += "Song not found, please enter a song below.\r\n\r\n"; - sendMsg += getSongList(); - - c.sendPacket(PacketCreator.getNPCTalk(NpcId.BILLY, (byte) 0, sendMsg, "00 00", (byte) 0)); - } -} diff --git a/src/main/java/client/command/commands/gm3/MuteMapCommand.java b/src/main/java/client/command/commands/gm3/MuteMapCommand.java deleted file mode 100644 index f442723bef9..00000000000 --- a/src/main/java/client/command/commands/gm3/MuteMapCommand.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; - -public class MuteMapCommand extends Command { - { - setDescription("Toggle mute players in the map."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (player.getMap().isMuted()) { - player.getMap().setMuted(false); - player.dropMessage(5, "The map you are in has been un-muted."); - } else { - player.getMap().setMuted(true); - player.dropMessage(5, "The map you are in has been muted."); - } - } -} diff --git a/src/main/java/client/command/commands/gm3/NightCommand.java b/src/main/java/client/command/commands/gm3/NightCommand.java deleted file mode 100644 index 3dfaeb5fe3a..00000000000 --- a/src/main/java/client/command/commands/gm3/NightCommand.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; - -public class NightCommand extends Command { - { - setDescription("Set sky background to black."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - player.getMap().broadcastNightEffect(); - player.yellowMessage("Done."); - } -} diff --git a/src/main/java/client/command/commands/gm3/NoticeCommand.java b/src/main/java/client/command/commands/gm3/NoticeCommand.java deleted file mode 100644 index 083365c9af9..00000000000 --- a/src/main/java/client/command/commands/gm3/NoticeCommand.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import net.server.Server; -import tools.PacketCreator; - -public class NoticeCommand extends Command { - { - setDescription("Send a blue message to everyone on the server."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - Server.getInstance().broadcastMessage(c.getWorld(), PacketCreator.serverNotice(6, "[Notice] " + player.getLastCommandMessage())); - } -} diff --git a/src/main/java/client/command/commands/gm3/NpcCommand.java b/src/main/java/client/command/commands/gm3/NpcCommand.java deleted file mode 100644 index 9fe52f77bf4..00000000000 --- a/src/main/java/client/command/commands/gm3/NpcCommand.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import server.life.LifeFactory; -import server.life.NPC; -import tools.PacketCreator; - -public class NpcCommand extends Command { - { - setDescription("Spawn an NPC on your location."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !npc "); - return; - } - NPC npc = LifeFactory.getNPC(Integer.parseInt(params[0])); - if (npc != null) { - npc.setPosition(player.getPosition()); - npc.setCy(player.getPosition().y); - npc.setRx0(player.getPosition().x + 50); - npc.setRx1(player.getPosition().x - 50); - npc.setFh(player.getMap().getFootholds().findBelow(c.getPlayer().getPosition()).getId()); - player.getMap().addMapObject(npc); - player.getMap().broadcastMessage(PacketCreator.spawnNPC(npc)); - } - } -} diff --git a/src/main/java/client/command/commands/gm3/OnlineTwoCommand.java b/src/main/java/client/command/commands/gm3/OnlineTwoCommand.java deleted file mode 100644 index cdba346eb3b..00000000000 --- a/src/main/java/client/command/commands/gm3/OnlineTwoCommand.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import net.server.Server; -import net.server.channel.Channel; - -public class OnlineTwoCommand extends Command { - { - setDescription("Show all online players."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - int total = 0; - for (Channel ch : Server.getInstance().getChannelsFromWorld(player.getWorld())) { - int size = ch.getPlayerStorage().getAllCharacters().size(); - total += size; - String s = "(Channel " + ch.getId() + " Online: " + size + ") : "; - if (ch.getPlayerStorage().getAllCharacters().size() < 50) { - for (Character chr : ch.getPlayerStorage().getAllCharacters()) { - s += Character.makeMapleReadable(chr.getName()) + ", "; - } - player.dropMessage(6, s.substring(0, s.length() - 2)); - } - } - - //player.dropMessage(6, "There are a total of " + total + " players online."); - player.showHint("Players online: #e#r" + total + "#k#n.", 300); - } -} diff --git a/src/main/java/client/command/commands/gm3/OpenPortalCommand.java b/src/main/java/client/command/commands/gm3/OpenPortalCommand.java deleted file mode 100644 index 41400b51580..00000000000 --- a/src/main/java/client/command/commands/gm3/OpenPortalCommand.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; - -public class OpenPortalCommand extends Command { - { - setDescription("Open a portal on the map."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !openportal "); - return; - } - player.getMap().getPortal(params[0]).setPortalState(true); - } -} diff --git a/src/main/java/client/command/commands/gm3/PeCommand.java b/src/main/java/client/command/commands/gm3/PeCommand.java deleted file mode 100644 index 6ee35f394a2..00000000000 --- a/src/main/java/client/command/commands/gm3/PeCommand.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import io.netty.buffer.Unpooled; -import net.PacketHandler; -import net.PacketProcessor; -import net.packet.ByteBufInPacket; -import net.packet.InPacket; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import tools.HexTool; - -import java.io.BufferedReader; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Properties; - -public class PeCommand extends Command { - { - setDescription("Handle synthesized packets from file, and handle them as if sent from a client"); - } - - private static final Logger log = LoggerFactory.getLogger(PeCommand.class); - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - String packet = ""; - try (BufferedReader br = Files.newBufferedReader(Path.of("pe.txt"))) { - Properties packetProps = new Properties(); - packetProps.load(br); - packet = packetProps.getProperty("pe"); - } catch (IOException ex) { - ex.printStackTrace(); - player.yellowMessage("Failed to load pe.txt"); - return; - - } - - byte[] packetContent = HexTool.toBytes(packet); - InPacket inPacket = new ByteBufInPacket(Unpooled.wrappedBuffer(packetContent)); - short packetId = inPacket.readShort(); - final PacketHandler packetHandler = PacketProcessor.getProcessor(0, c.getChannel()).getHandler(packetId); - if (packetHandler != null && packetHandler.validateState(c)) { - try { - player.yellowMessage("Receiving: " + packet); - packetHandler.handlePacket(inPacket, c); - } catch (final Throwable t) { - final String chrInfo = player != null ? player.getName() + " on map " + player.getMapId() : "?"; - log.warn("Error in packet handler {}. Chr {}, account {}. Packet: {}", packetHandler.getClass().getSimpleName(), - chrInfo, c.getAccountName(), packet, t); - } - } - } -} diff --git a/src/main/java/client/command/commands/gm3/PosCommand.java b/src/main/java/client/command/commands/gm3/PosCommand.java deleted file mode 100644 index 5928a351e50..00000000000 --- a/src/main/java/client/command/commands/gm3/PosCommand.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; - -public class PosCommand extends Command { - { - setDescription("Show current position and foothold."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - float xpos = player.getPosition().x; - float ypos = player.getPosition().y; - float fh = player.getMap().getFootholds().findBelow(player.getPosition()).getId(); - player.dropMessage(6, "Position: (" + xpos + ", " + ypos + ")"); - player.dropMessage(6, "Foothold ID: " + fh); - } -} diff --git a/src/main/java/client/command/commands/gm3/QuestCompleteCommand.java b/src/main/java/client/command/commands/gm3/QuestCompleteCommand.java deleted file mode 100644 index 98bdeb5f7bc..00000000000 --- a/src/main/java/client/command/commands/gm3/QuestCompleteCommand.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import server.quest.Quest; - -public class QuestCompleteCommand extends Command { - { - setDescription("Complete an active quest."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - - if (params.length < 1) { - player.yellowMessage("Syntax: !completequest "); - return; - } - - int questId = Integer.parseInt(params[0]); - - if (player.getQuestStatus(questId) == 1) { - Quest quest = Quest.getInstance(questId); - if (quest != null && quest.getNpcRequirement(true) != -1) { - c.getAbstractPlayerInteraction().forceCompleteQuest(questId, quest.getNpcRequirement(true)); - } else { - c.getAbstractPlayerInteraction().forceCompleteQuest(questId); - } - - player.dropMessage(5, "QUEST " + questId + " completed."); - } else { - player.dropMessage(5, "QUESTID " + questId + " not started or already completed."); - } - } -} diff --git a/src/main/java/client/command/commands/gm3/QuestResetCommand.java b/src/main/java/client/command/commands/gm3/QuestResetCommand.java deleted file mode 100644 index cfb35da64a2..00000000000 --- a/src/main/java/client/command/commands/gm3/QuestResetCommand.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import server.quest.Quest; - -public class QuestResetCommand extends Command { - { - setDescription("Reset a completed quest."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - - if (params.length < 1) { - player.yellowMessage("Syntax: !resetquest "); - return; - } - - int questid_ = Integer.parseInt(params[0]); - - if (player.getQuestStatus(questid_) != 0) { - Quest quest = Quest.getInstance(questid_); - if (quest != null) { - quest.reset(player); - player.dropMessage(5, "QUEST " + questid_ + " reseted."); - } else { // should not occur - player.dropMessage(5, "QUESTID " + questid_ + " is invalid."); - } - } - } -} diff --git a/src/main/java/client/command/commands/gm3/QuestStartCommand.java b/src/main/java/client/command/commands/gm3/QuestStartCommand.java deleted file mode 100644 index 3eeee90331c..00000000000 --- a/src/main/java/client/command/commands/gm3/QuestStartCommand.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import server.quest.Quest; - -public class QuestStartCommand extends Command { - { - setDescription("Start a quest."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - - if (params.length < 1) { - player.yellowMessage("Syntax: !startquest "); - return; - } - - int questid = Integer.parseInt(params[0]); - - if (player.getQuestStatus(questid) == 0) { - Quest quest = Quest.getInstance(questid); - if (quest != null && quest.getNpcRequirement(false) != -1) { - c.getAbstractPlayerInteraction().forceStartQuest(questid, quest.getNpcRequirement(false)); - } else { - c.getAbstractPlayerInteraction().forceStartQuest(questid); - } - - player.dropMessage(5, "QUEST " + questid + " started."); - } else { - player.dropMessage(5, "QUESTID " + questid + " already started/completed."); - } - } -} diff --git a/src/main/java/client/command/commands/gm3/ReloadDropsCommand.java b/src/main/java/client/command/commands/gm3/ReloadDropsCommand.java deleted file mode 100644 index da88d321b80..00000000000 --- a/src/main/java/client/command/commands/gm3/ReloadDropsCommand.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import server.life.MonsterInformationProvider; - -public class ReloadDropsCommand extends Command { - { - setDescription("Reload all drop data."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - MonsterInformationProvider.getInstance().clearDrops(); - player.dropMessage(5, "Reloaded Drops"); - } -} diff --git a/src/main/java/client/command/commands/gm3/ReloadEventsCommand.java b/src/main/java/client/command/commands/gm3/ReloadEventsCommand.java deleted file mode 100644 index 4feeeffa1b0..00000000000 --- a/src/main/java/client/command/commands/gm3/ReloadEventsCommand.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import net.server.Server; -import net.server.channel.Channel; - -public class ReloadEventsCommand extends Command { - { - setDescription("Reload all event data."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - for (Channel ch : Server.getInstance().getAllChannels()) { - ch.reloadEventScriptManager(); - } - player.dropMessage(5, "Reloaded Events"); - } -} diff --git a/src/main/java/client/command/commands/gm3/ReloadMapCommand.java b/src/main/java/client/command/commands/gm3/ReloadMapCommand.java deleted file mode 100644 index 17086974560..00000000000 --- a/src/main/java/client/command/commands/gm3/ReloadMapCommand.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import server.maps.MapleMap; - -import java.util.Collection; - -public class ReloadMapCommand extends Command { - { - setDescription("Reload the map."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - MapleMap newMap = c.getChannelServer().getMapFactory().resetMap(player.getMapId()); - int callerid = c.getPlayer().getId(); - - Collection characters = player.getMap().getAllPlayers(); - - for (Character chr : characters) { - chr.saveLocationOnWarp(); - chr.changeMap(newMap); - if (chr.getId() != callerid) { - chr.dropMessage("You have been relocated due to map reloading. Sorry for the inconvenience."); - } - } - newMap.respawn(); - } -} diff --git a/src/main/java/client/command/commands/gm3/ReloadPortalsCommand.java b/src/main/java/client/command/commands/gm3/ReloadPortalsCommand.java deleted file mode 100644 index 44f593c8017..00000000000 --- a/src/main/java/client/command/commands/gm3/ReloadPortalsCommand.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import scripting.portal.PortalScriptManager; - -public class ReloadPortalsCommand extends Command { - { - setDescription("Reload all portal scripts."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - PortalScriptManager.getInstance().reloadPortalScripts(); - player.dropMessage(5, "Reloaded Portals"); - } -} diff --git a/src/main/java/client/command/commands/gm3/ReloadShopsCommand.java b/src/main/java/client/command/commands/gm3/ReloadShopsCommand.java deleted file mode 100644 index f98daf3e20d..00000000000 --- a/src/main/java/client/command/commands/gm3/ReloadShopsCommand.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Client; -import client.command.Command; -import server.ShopFactory; - - -public class ReloadShopsCommand extends Command { - { - setDescription("Reload popup shops and NPC shops."); - } - - @Override - public void execute(Client c, String[] params) { - ShopFactory.getInstance().reloadShops(); - } -} diff --git a/src/main/java/client/command/commands/gm3/RipCommand.java b/src/main/java/client/command/commands/gm3/RipCommand.java deleted file mode 100644 index 0d17b6d41f9..00000000000 --- a/src/main/java/client/command/commands/gm3/RipCommand.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import net.server.Server; -import tools.PacketCreator; - -public class RipCommand extends Command { - { - setDescription("Send a RIP notice."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - Server.getInstance().broadcastMessage(c.getWorld(), PacketCreator.serverNotice(6, "[RIP]: " + joinStringFrom(params, 1))); - } -} diff --git a/src/main/java/client/command/commands/gm3/SeedCommand.java b/src/main/java/client/command/commands/gm3/SeedCommand.java deleted file mode 100644 index 19e3bb8cbd0..00000000000 --- a/src/main/java/client/command/commands/gm3/SeedCommand.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import client.inventory.Item; -import constants.id.ItemId; -import constants.id.MapId; - -import java.awt.*; - -public class SeedCommand extends Command { - { - setDescription("Drop all seeds inside Henesys PQ."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (player.getMapId() != MapId.HENESYS_PQ) { - player.yellowMessage("This command can only be used in HPQ."); - return; - } - Point[] pos = {new Point(7, -207), new Point(179, -447), new Point(-3, -687), new Point(-357, -687), new Point(-538, -447), new Point(-359, -207)}; - int[] seed = {ItemId.PINK_PRIMROSE_SEED, ItemId.PURPLE_PRIMROSE_SEED, ItemId.GREEN_PRIMROSE_SEED, - ItemId.BLUE_PRIMROSE_SEED, ItemId.YELLOW_PRIMROSE_SEED, ItemId.BROWN_PRIMROSE_SEED}; - for (int i = 0; i < pos.length; i++) { - Item item = new Item(seed[i], (byte) 0, (short) 1); - player.getMap().spawnItemDrop(player, player, item, pos[i], false, true); - try { - Thread.sleep(100); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - } -} diff --git a/src/main/java/client/command/commands/gm3/SpawnCommand.java b/src/main/java/client/command/commands/gm3/SpawnCommand.java deleted file mode 100644 index cc490d75be1..00000000000 --- a/src/main/java/client/command/commands/gm3/SpawnCommand.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import server.life.LifeFactory; -import server.life.Monster; - -public class SpawnCommand extends Command { - { - setDescription("Spawn mob(s) on your location."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !spawn []"); - return; - } - - Monster monster = LifeFactory.getMonster(Integer.parseInt(params[0])); - if (monster == null) { - return; - } - if (params.length == 2) { - for (int i = 0; i < Integer.parseInt(params[1]); i++) { - player.getMap().spawnMonsterOnGroundBelow(LifeFactory.getMonster(Integer.parseInt(params[0])), player.getPosition()); - } - } else { - player.getMap().spawnMonsterOnGroundBelow(LifeFactory.getMonster(Integer.parseInt(params[0])), player.getPosition()); - } - } -} diff --git a/src/main/java/client/command/commands/gm3/StartEventCommand.java b/src/main/java/client/command/commands/gm3/StartEventCommand.java deleted file mode 100644 index c5072bdc92d..00000000000 --- a/src/main/java/client/command/commands/gm3/StartEventCommand.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import net.server.Server; -import server.events.gm.Event; -import tools.PacketCreator; - -public class StartEventCommand extends Command { - { - setDescription("Start an event on current map."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - int players = 50; - if (params.length > 1) { - players = Integer.parseInt(params[0]); - } - c.getChannelServer().setEvent(new Event(player.getMapId(), players)); - Server.getInstance().broadcastMessage(c.getWorld(), PacketCreator.earnTitleMessage( - "[Event] An event has started on " - + player.getMap().getMapName() - + " and will allow " - + players - + " players to join. Type @joinevent to participate.")); - Server.getInstance().broadcastMessage(c.getWorld(), - PacketCreator.serverNotice(6, "[Event] An event has started on " - + player.getMap().getMapName() - + " and will allow " - + players - + " players to join. Type @joinevent to participate.")); - } -} diff --git a/src/main/java/client/command/commands/gm3/StartMapEventCommand.java b/src/main/java/client/command/commands/gm3/StartMapEventCommand.java deleted file mode 100644 index b269c04be62..00000000000 --- a/src/main/java/client/command/commands/gm3/StartMapEventCommand.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: MedicOP - Start actual event -*/ -package client.command.commands.gm3; - -import client.Client; -import client.command.Command; - -public class StartMapEventCommand extends Command { - { - setDescription("Start a \"classic\" event on current map."); - } - - @Override - public void execute(Client c, String[] params) { - c.getPlayer().getMap().startEvent(c.getPlayer()); - } -} diff --git a/src/main/java/client/command/commands/gm3/StopMapEventCommand.java b/src/main/java/client/command/commands/gm3/StopMapEventCommand.java deleted file mode 100644 index 8b541c69968..00000000000 --- a/src/main/java/client/command/commands/gm3/StopMapEventCommand.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: MedicOP - Stop actual event -*/ -package client.command.commands.gm3; - -import client.Client; -import client.command.Command; - -public class StopMapEventCommand extends Command { - { - setDescription("Stop ongoing \"classic\" event."); - } - - @Override - public void execute(Client c, String[] params) { - c.getPlayer().getMap().setEventStarted(false); - } -} diff --git a/src/main/java/client/command/commands/gm3/TimerAllCommand.java b/src/main/java/client/command/commands/gm3/TimerAllCommand.java deleted file mode 100644 index 18d0d3a9545..00000000000 --- a/src/main/java/client/command/commands/gm3/TimerAllCommand.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: MedicOP - Add clock commands -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import tools.PacketCreator; - -public class TimerAllCommand extends Command { - { - setDescription("Set a server wide timer."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !timerall |remove"); - return; - } - - if (params[0].equalsIgnoreCase("remove")) { - for (Character victim : player.getWorldServer().getPlayerStorage().getAllCharacters()) { - victim.sendPacket(PacketCreator.removeClock()); - } - } else { - try { - int seconds = Integer.parseInt(params[0]); - for (Character victim : player.getWorldServer().getPlayerStorage().getAllCharacters()) { - victim.sendPacket(PacketCreator.getClock(seconds)); - } - } catch (NumberFormatException e) { - player.yellowMessage("Syntax: !timerall |remove"); - } - } - } -} diff --git a/src/main/java/client/command/commands/gm3/TimerCommand.java b/src/main/java/client/command/commands/gm3/TimerCommand.java deleted file mode 100644 index 9c7a5cfb545..00000000000 --- a/src/main/java/client/command/commands/gm3/TimerCommand.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: MedicOP - Add clock commands -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import tools.PacketCreator; - -public class TimerCommand extends Command { - { - setDescription("Set timer on a player in current map."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 2) { - player.yellowMessage("Syntax: !timer |remove"); - return; - } - - Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]); - if (victim != null) { - if (params[1].equalsIgnoreCase("remove")) { - victim.sendPacket(PacketCreator.removeClock()); - } else { - try { - victim.sendPacket(PacketCreator.getClock(Integer.parseInt(params[1]))); - } catch (NumberFormatException e) { - player.yellowMessage("Syntax: !timer |remove"); - } - } - } else { - player.message("Player '" + params[0] + "' could not be found."); - } - } -} diff --git a/src/main/java/client/command/commands/gm3/TimerMapCommand.java b/src/main/java/client/command/commands/gm3/TimerMapCommand.java deleted file mode 100644 index 2456dd682b8..00000000000 --- a/src/main/java/client/command/commands/gm3/TimerMapCommand.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: MedicOP - Add clock commands -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import tools.PacketCreator; - -public class TimerMapCommand extends Command { - { - setDescription("Set timer on all players in current map."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !timermap |remove"); - return; - } - - if (params[0].equalsIgnoreCase("remove")) { - for (Character victim : player.getMap().getCharacters()) { - victim.sendPacket(PacketCreator.removeClock()); - } - } else { - try { - int seconds = Integer.parseInt(params[0]); - for (Character victim : player.getMap().getCharacters()) { - victim.sendPacket(PacketCreator.getClock(seconds)); - } - } catch (NumberFormatException e) { - player.yellowMessage("Syntax: !timermap |remove"); - } - } - } -} diff --git a/src/main/java/client/command/commands/gm3/ToggleCouponCommand.java b/src/main/java/client/command/commands/gm3/ToggleCouponCommand.java deleted file mode 100644 index 03046c04bae..00000000000 --- a/src/main/java/client/command/commands/gm3/ToggleCouponCommand.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import net.server.Server; - -public class ToggleCouponCommand extends Command { - { - setDescription("Toggle enable/disable a coupon."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !togglecoupon "); - return; - } - Server.getInstance().toggleCoupon(Integer.parseInt(params[0])); - } -} diff --git a/src/main/java/client/command/commands/gm3/UnBanCommand.java b/src/main/java/client/command/commands/gm3/UnBanCommand.java deleted file mode 100644 index dca847cde99..00000000000 --- a/src/main/java/client/command/commands/gm3/UnBanCommand.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm3; - -import client.Character; -import client.Client; -import client.command.Command; -import tools.DatabaseConnection; - -import java.sql.Connection; -import java.sql.PreparedStatement; - -public class UnBanCommand extends Command { - { - setDescription("Unban a player."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !unban "); - return; - } - - try (Connection con = DatabaseConnection.getConnection()) { - int aid = Character.getAccountIdByName(params[0]); - - try (PreparedStatement p = con.prepareStatement("UPDATE accounts SET banned = -1 WHERE id = " + aid)) { - p.executeUpdate(); - } - - try (PreparedStatement p = con.prepareStatement("DELETE FROM ipbans WHERE aid = " + aid)) { - p.executeUpdate(); - } - } catch (Exception e) { - e.printStackTrace(); - player.message("Failed to unban " + params[0]); - return; - } - player.message("Unbanned " + params[0]); - } -} diff --git a/src/main/java/client/command/commands/gm4/BossDropRateCommand.java b/src/main/java/client/command/commands/gm4/BossDropRateCommand.java deleted file mode 100644 index 0bf9a549274..00000000000 --- a/src/main/java/client/command/commands/gm4/BossDropRateCommand.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server - Copyleft (L) 2016 - 2019 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 . -*/ -package client.command.commands.gm4; - -import client.Character; -import client.Client; -import client.command.Command; -import tools.PacketCreator; - -/** - * @author Ronan - */ -public class BossDropRateCommand extends Command { - { - setDescription("Set world boss drop rate."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !bossdroprate "); - return; - } - - int bossdroprate = Math.max(Integer.parseInt(params[0]), 1); - c.getWorldServer().setBossDropRate(bossdroprate); - c.getWorldServer().broadcastPacket(PacketCreator.serverNotice(6, "[Rate] Boss Drop Rate has been changed to " + bossdroprate + "x.")); - } -} diff --git a/src/main/java/client/command/commands/gm4/CakeCommand.java b/src/main/java/client/command/commands/gm4/CakeCommand.java deleted file mode 100644 index 3b2ba63f1a2..00000000000 --- a/src/main/java/client/command/commands/gm4/CakeCommand.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm4; - -import client.Character; -import client.Client; -import client.command.Command; -import constants.id.MobId; -import server.life.LifeFactory; -import server.life.Monster; - -public class CakeCommand extends Command { - { - setDescription("Spawn Cake boss with specified HP."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - Monster monster = LifeFactory.getMonster(MobId.GIANT_CAKE); - if (params.length == 1) { - double mobHp = Double.parseDouble(params[0]); - int newHp = (mobHp <= 0) ? Integer.MAX_VALUE : ((mobHp > Integer.MAX_VALUE) ? Integer.MAX_VALUE : (int) mobHp); - - monster.setStartingHp(newHp); - } - - player.getMap().spawnMonsterOnGroundBelow(monster, player.getPosition()); - } -} diff --git a/src/main/java/client/command/commands/gm4/DropRateCommand.java b/src/main/java/client/command/commands/gm4/DropRateCommand.java deleted file mode 100644 index 1a94e3d77e8..00000000000 --- a/src/main/java/client/command/commands/gm4/DropRateCommand.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm4; - -import client.Character; -import client.Client; -import client.command.Command; -import tools.PacketCreator; - -public class DropRateCommand extends Command { - { - setDescription("Set world drop rate."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !droprate "); - return; - } - - int droprate = Math.max(Integer.parseInt(params[0]), 1); - c.getWorldServer().setDropRate(droprate); - c.getWorldServer().broadcastPacket(PacketCreator.serverNotice(6, "[Rate] Drop Rate has been changed to " + droprate + "x.")); - - } -} diff --git a/src/main/java/client/command/commands/gm4/ExpRateCommand.java b/src/main/java/client/command/commands/gm4/ExpRateCommand.java deleted file mode 100644 index 5b363c6927a..00000000000 --- a/src/main/java/client/command/commands/gm4/ExpRateCommand.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm4; - -import client.Character; -import client.Client; -import client.command.Command; -import tools.PacketCreator; - -public class ExpRateCommand extends Command { - { - setDescription("Set world exp rate."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !exprate "); - return; - } - - int exprate = Math.max(Integer.parseInt(params[0]), 1); - c.getWorldServer().setExpRate(exprate); - c.getWorldServer().broadcastPacket(PacketCreator.serverNotice(6, "[Rate] Exp Rate has been changed to " + exprate + "x.")); - } -} diff --git a/src/main/java/client/command/commands/gm4/FishingRateCommand.java b/src/main/java/client/command/commands/gm4/FishingRateCommand.java deleted file mode 100644 index 532d94f6495..00000000000 --- a/src/main/java/client/command/commands/gm4/FishingRateCommand.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Ronan -*/ -package client.command.commands.gm4; - -import client.Character; -import client.Client; -import client.command.Command; -import tools.PacketCreator; - -public class FishingRateCommand extends Command { - { - setDescription("Set fishing rate."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !fishrate "); - return; - } - - int fishrate = Math.max(Integer.parseInt(params[0]), 1); - c.getWorldServer().setFishingRate(fishrate); - c.getWorldServer().broadcastPacket(PacketCreator.serverNotice(6, "[Rate] Fishing Rate has been changed to " + fishrate + "x.")); - } -} diff --git a/src/main/java/client/command/commands/gm4/ForceVacCommand.java b/src/main/java/client/command/commands/gm4/ForceVacCommand.java deleted file mode 100644 index 02a3a816a9c..00000000000 --- a/src/main/java/client/command/commands/gm4/ForceVacCommand.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm4; - -import client.Character; -import client.Client; -import client.command.Command; -import client.inventory.Pet; -import client.inventory.manipulator.InventoryManipulator; -import constants.id.ItemId; -import server.maps.MapItem; -import server.maps.MapObject; -import server.maps.MapObjectType; -import tools.PacketCreator; - -import java.util.Arrays; -import java.util.List; - -public class ForceVacCommand extends Command { - { - setDescription("Loot all drops on the map."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - List items = player.getMap().getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapObjectType.ITEM)); - for (MapObject item : items) { - MapItem mapItem = (MapItem) item; - - mapItem.lockItem(); - try { - if (mapItem.isPickedUp()) { - continue; - } - - if (mapItem.getMeso() > 0) { - player.gainMeso(mapItem.getMeso(), true); - } else if (player.applyConsumeOnPickup(mapItem.getItemId())) { // thanks Vcoc for pointing out consumables on pickup not being processed here - } else if (ItemId.isNxCard(mapItem.getItemId())) { - // Add NX to account, show effect and make item disappear - player.getCashShop().gainCash(1, mapItem.getItemId() == ItemId.NX_CARD_100 ? 100 : 250); - } else if (mapItem.getItem().getItemId() >= 5000000 && mapItem.getItem().getItemId() <= 5000100) { - int petId = Pet.createPet(mapItem.getItem().getItemId()); - if (petId == -1) { - continue; - } - InventoryManipulator.addById(c, mapItem.getItem().getItemId(), mapItem.getItem().getQuantity(), null, petId); - } else if (InventoryManipulator.addFromDrop(c, mapItem.getItem(), true)) { - if (mapItem.getItemId() == ItemId.NX_CARD_100) { - player.updateAriantScore(); - } - } - - player.getMap().pickItemDrop(PacketCreator.removeItemFromMap(mapItem.getObjectId(), 2, player.getId()), mapItem); - } finally { - mapItem.unlockItem(); - } - } - } -} diff --git a/src/main/java/client/command/commands/gm4/HorntailCommand.java b/src/main/java/client/command/commands/gm4/HorntailCommand.java deleted file mode 100644 index dffe66d390f..00000000000 --- a/src/main/java/client/command/commands/gm4/HorntailCommand.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm4; - -import client.Character; -import client.Client; -import client.command.Command; -import server.maps.MapleMap; - -import java.awt.*; - -public class HorntailCommand extends Command { - { - setDescription("Spawn Horntail on your location."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - final Point targetPoint = player.getPosition(); - final MapleMap targetMap = player.getMap(); - - targetMap.spawnHorntailOnGroundBelow(targetPoint); - } -} diff --git a/src/main/java/client/command/commands/gm4/ItemVacCommand.java b/src/main/java/client/command/commands/gm4/ItemVacCommand.java deleted file mode 100644 index a0bf4238bb5..00000000000 --- a/src/main/java/client/command/commands/gm4/ItemVacCommand.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm4; - -import client.Character; -import client.Client; -import client.command.Command; -import server.maps.MapObject; -import server.maps.MapObjectType; - -import java.util.Arrays; -import java.util.List; - -public class ItemVacCommand extends Command { - { - setDescription("Loot all drops on the map."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - List list = player.getMap().getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapObjectType.ITEM)); - for (MapObject item : list) { - player.pickupItem(item); - } - } -} diff --git a/src/main/java/client/command/commands/gm4/MesoRateCommand.java b/src/main/java/client/command/commands/gm4/MesoRateCommand.java deleted file mode 100644 index 4680c0cefc3..00000000000 --- a/src/main/java/client/command/commands/gm4/MesoRateCommand.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm4; - -import client.Character; -import client.Client; -import client.command.Command; -import tools.PacketCreator; - -public class MesoRateCommand extends Command { - { - setDescription("Set world meso rate."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !mesorate "); - return; - } - - int mesorate = Math.max(Integer.parseInt(params[0]), 1); - c.getWorldServer().setMesoRate(mesorate); - c.getWorldServer().broadcastPacket(PacketCreator.serverNotice(6, "[Rate] Meso Rate has been changed to " + mesorate + "x.")); - } -} diff --git a/src/main/java/client/command/commands/gm4/PapCommand.java b/src/main/java/client/command/commands/gm4/PapCommand.java deleted file mode 100644 index f0ddecc7924..00000000000 --- a/src/main/java/client/command/commands/gm4/PapCommand.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm4; - -import client.Character; -import client.Client; -import client.command.Command; -import constants.id.MobId; -import server.life.LifeFactory; - -public class PapCommand extends Command { - { - setDescription("Spawn Papulatus on your location."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - - // thanks Conrad for noticing mobid typo here - player.getMap().spawnMonsterOnGroundBelow(LifeFactory.getMonster(MobId.PAPULATUS_CLOCK), player.getPosition()); - } -} diff --git a/src/main/java/client/command/commands/gm4/PianusCommand.java b/src/main/java/client/command/commands/gm4/PianusCommand.java deleted file mode 100644 index 4a5d7fe7393..00000000000 --- a/src/main/java/client/command/commands/gm4/PianusCommand.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm4; - -import client.Character; -import client.Client; -import client.command.Command; -import constants.id.MobId; -import server.life.LifeFactory; - -public class PianusCommand extends Command { - { - setDescription("Spawn Pianus (R) on your location."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - player.getMap().spawnMonsterOnGroundBelow(LifeFactory.getMonster(MobId.PIANUS_R), player.getPosition()); - } -} diff --git a/src/main/java/client/command/commands/gm4/PinkbeanCommand.java b/src/main/java/client/command/commands/gm4/PinkbeanCommand.java deleted file mode 100644 index 37cee3ae119..00000000000 --- a/src/main/java/client/command/commands/gm4/PinkbeanCommand.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm4; - -import client.Character; -import client.Client; -import client.command.Command; -import constants.id.MobId; -import server.life.LifeFactory; - -public class PinkbeanCommand extends Command { - { - setDescription("Spawn Pink Bean on your location."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - player.getMap().spawnMonsterOnGroundBelow(LifeFactory.getMonster(MobId.PINK_BEAN), player.getPosition()); - - } -} diff --git a/src/main/java/client/command/commands/gm4/PlayerNpcCommand.java b/src/main/java/client/command/commands/gm4/PlayerNpcCommand.java deleted file mode 100644 index d4d5ae0316c..00000000000 --- a/src/main/java/client/command/commands/gm4/PlayerNpcCommand.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm4; - -import client.Character; -import client.Client; -import client.command.Command; -import server.life.PlayerNPC; - -public class PlayerNpcCommand extends Command { - { - setDescription("Spawn a player NPC of an online player."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !playernpc "); - return; - } - - if (!PlayerNPC.spawnPlayerNPC(player.getMapId(), player.getPosition(), c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]))) { - player.dropMessage(5, "Could not deploy PlayerNPC. Either there's no room available here or depleted out scriptids to use."); - } - } -} diff --git a/src/main/java/client/command/commands/gm4/PlayerNpcRemoveCommand.java b/src/main/java/client/command/commands/gm4/PlayerNpcRemoveCommand.java deleted file mode 100644 index 68616156ba0..00000000000 --- a/src/main/java/client/command/commands/gm4/PlayerNpcRemoveCommand.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm4; - -import client.Character; -import client.Client; -import client.command.Command; -import server.life.PlayerNPC; - -public class PlayerNpcRemoveCommand extends Command { - { - setDescription("Remove a \"lv 200\" player NPC."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !playernpcremove "); - return; - } - PlayerNPC.removePlayerNPC(c.getChannelServer().getPlayerStorage().getCharacterByName(params[0])); - } -} diff --git a/src/main/java/client/command/commands/gm4/PmobCommand.java b/src/main/java/client/command/commands/gm4/PmobCommand.java deleted file mode 100644 index 7b918a8d940..00000000000 --- a/src/main/java/client/command/commands/gm4/PmobCommand.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Ronan -*/ -package client.command.commands.gm4; - -import client.Character; -import client.Client; -import client.command.Command; -import net.server.channel.Channel; -import server.life.LifeFactory; -import server.life.Monster; -import server.maps.MapleMap; -import tools.DatabaseConnection; - -import java.awt.*; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.SQLException; - -public class PmobCommand extends Command { - { - setDescription("Spawn a permanent mob on your location."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !pmob []"); - return; - } - - // command suggestion thanks to HighKey21, none, bibiko94 (TAYAMO), asafgb - int mapId = player.getMapId(); - int mobId = Integer.parseInt(params[0]); - int mobTime = (params.length > 1) ? Integer.parseInt(params[1]) : -1; - - Point checkpos = player.getMap().getGroundBelow(player.getPosition()); - int xpos = checkpos.x; - int ypos = checkpos.y; - int fh = player.getMap().getFootholds().findBelow(checkpos).getId(); - - Monster mob = LifeFactory.getMonster(mobId); - if (mob != null && !mob.getName().equals("MISSINGNO")) { - mob.setPosition(checkpos); - mob.setCy(ypos); - mob.setRx0(xpos + 50); - mob.setRx1(xpos - 50); - mob.setFh(fh); - try (Connection con = DatabaseConnection.getConnection(); - PreparedStatement ps = con.prepareStatement("INSERT INTO plife ( life, f, fh, cy, rx0, rx1, type, x, y, world, map, mobtime, hide ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )")) { - ps.setInt(1, mobId); - ps.setInt(2, 0); - ps.setInt(3, fh); - ps.setInt(4, ypos); - ps.setInt(5, xpos + 50); - ps.setInt(6, xpos - 50); - ps.setString(7, "m"); - ps.setInt(8, xpos); - ps.setInt(9, ypos); - ps.setInt(10, player.getWorld()); - ps.setInt(11, mapId); - ps.setInt(12, mobTime); - ps.setInt(13, 0); - ps.executeUpdate(); - - for (Channel ch : player.getWorldServer().getChannels()) { - MapleMap map = ch.getMapFactory().getMap(mapId); - map.addMonsterSpawn(mob, mobTime, -1); - map.addAllMonsterSpawn(mob, mobTime, -1); - } - - player.yellowMessage("Pmob created."); - } catch (SQLException e) { - e.printStackTrace(); - player.dropMessage(5, "Failed to store pmob in the database."); - } - } else { - player.dropMessage(5, "You have entered an invalid mob id."); - } - } -} \ No newline at end of file diff --git a/src/main/java/client/command/commands/gm4/PmobRemoveCommand.java b/src/main/java/client/command/commands/gm4/PmobRemoveCommand.java deleted file mode 100644 index f2abbea2a0f..00000000000 --- a/src/main/java/client/command/commands/gm4/PmobRemoveCommand.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Ronan -*/ -package client.command.commands.gm4; - -import client.Character; -import client.Client; -import client.command.Command; -import net.server.channel.Channel; -import server.maps.MapleMap; -import tools.DatabaseConnection; -import tools.Pair; - -import java.awt.*; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.LinkedList; -import java.util.List; - -public class PmobRemoveCommand extends Command { - { - setDescription("Remove all permanent mobs of the same type on the map."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - - int mapId = player.getMapId(); - int mobId = params.length > 0 ? Integer.parseInt(params[0]) : -1; - - Point pos = player.getPosition(); - int xpos = pos.x; - int ypos = pos.y; - - List>> toRemove = new LinkedList<>(); - try (Connection con = DatabaseConnection.getConnection()) { - final PreparedStatement ps; - if (mobId > -1) { - String select = "SELECT * FROM plife WHERE world = ? AND map = ? AND type LIKE ? AND life = ?"; - ps = con.prepareStatement(select, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); - ps.setInt(1, player.getWorld()); - ps.setInt(2, mapId); - ps.setString(3, "m"); - ps.setInt(4, mobId); - } else { - String select = "SELECT * FROM plife WHERE world = ? AND map = ? AND type LIKE ? AND x >= ? AND x <= ? AND y >= ? AND y <= ?"; - ps = con.prepareStatement(select, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); - ps.setInt(1, player.getWorld()); - ps.setInt(2, mapId); - ps.setString(3, "m"); - ps.setInt(4, xpos - 50); - ps.setInt(5, xpos + 50); - ps.setInt(6, ypos - 50); - ps.setInt(7, ypos + 50); - } - - try (ResultSet rs = ps.executeQuery()) { - while (true) { - rs.beforeFirst(); - if (!rs.next()) { - break; - } - - toRemove.add(new Pair<>(rs.getInt("life"), new Pair<>(rs.getInt("x"), rs.getInt("y")))); - rs.deleteRow(); - } - } - ps.close(); - } catch (SQLException e) { - e.printStackTrace(); - player.dropMessage(5, "Failed to remove pmob from the database."); - } - - if (!toRemove.isEmpty()) { - for (Channel ch : player.getWorldServer().getChannels()) { - MapleMap map = ch.getMapFactory().getMap(mapId); - - for (Pair> r : toRemove) { - map.removeMonsterSpawn(r.getLeft(), r.getRight().getLeft(), r.getRight().getRight()); - map.removeAllMonsterSpawn(r.getLeft(), r.getRight().getLeft(), r.getRight().getRight()); - } - } - } - - player.yellowMessage("Cleared " + toRemove.size() + " pmob placements."); - } -} \ No newline at end of file diff --git a/src/main/java/client/command/commands/gm4/PnpcCommand.java b/src/main/java/client/command/commands/gm4/PnpcCommand.java deleted file mode 100644 index e6212b27c49..00000000000 --- a/src/main/java/client/command/commands/gm4/PnpcCommand.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Ronan -*/ -package client.command.commands.gm4; - -import client.Character; -import client.Client; -import client.command.Command; -import net.server.channel.Channel; -import server.life.LifeFactory; -import server.life.NPC; -import server.maps.MapleMap; -import tools.DatabaseConnection; -import tools.PacketCreator; - -import java.awt.*; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.SQLException; - -public class PnpcCommand extends Command { - { - setDescription("Spawn a permanent NPC on your location."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !pnpc "); - return; - } - - // command suggestion thanks to HighKey21, none, bibiko94 (TAYAMO), asafgb - int mapId = player.getMapId(); - int npcId = Integer.parseInt(params[0]); - if (player.getMap().containsNPC(npcId)) { - player.dropMessage(5, "This map already contains the specified NPC."); - return; - } - - NPC npc = LifeFactory.getNPC(npcId); - - Point checkpos = player.getMap().getGroundBelow(player.getPosition()); - int xpos = checkpos.x; - int ypos = checkpos.y; - int fh = player.getMap().getFootholds().findBelow(checkpos).getId(); - - if (npc != null && !npc.getName().equals("MISSINGNO")) { - try (Connection con = DatabaseConnection.getConnection(); - PreparedStatement ps = con.prepareStatement("INSERT INTO plife ( life, f, fh, cy, rx0, rx1, type, x, y, world, map, mobtime, hide ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )")) { - ps.setInt(1, npcId); - ps.setInt(2, 0); - ps.setInt(3, fh); - ps.setInt(4, ypos); - ps.setInt(5, xpos + 50); - ps.setInt(6, xpos - 50); - ps.setString(7, "n"); - ps.setInt(8, xpos); - ps.setInt(9, ypos); - ps.setInt(10, player.getWorld()); - ps.setInt(11, mapId); - ps.setInt(12, -1); - ps.setInt(13, 0); - ps.executeUpdate(); - - for (Channel ch : player.getWorldServer().getChannels()) { - npc = LifeFactory.getNPC(npcId); - npc.setPosition(checkpos); - npc.setCy(ypos); - npc.setRx0(xpos + 50); - npc.setRx1(xpos - 50); - npc.setFh(fh); - - MapleMap map = ch.getMapFactory().getMap(mapId); - map.addMapObject(npc); - map.broadcastMessage(PacketCreator.spawnNPC(npc)); - } - - player.yellowMessage("Pnpc created."); - } catch (SQLException e) { - e.printStackTrace(); - player.dropMessage(5, "Failed to store pNPC in the database."); - } - } else { - player.dropMessage(5, "You have entered an invalid NPC id."); - } - } -} \ No newline at end of file diff --git a/src/main/java/client/command/commands/gm4/PnpcRemoveCommand.java b/src/main/java/client/command/commands/gm4/PnpcRemoveCommand.java deleted file mode 100644 index a062496d150..00000000000 --- a/src/main/java/client/command/commands/gm4/PnpcRemoveCommand.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Ronan -*/ -package client.command.commands.gm4; - -import client.Character; -import client.Client; -import client.command.Command; -import net.server.channel.Channel; -import server.maps.MapleMap; -import tools.DatabaseConnection; -import tools.Pair; - -import java.awt.*; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.LinkedList; -import java.util.List; - -public class PnpcRemoveCommand extends Command { - { - setDescription("Remove a permanent NPC on the map."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - - int mapId = player.getMapId(); - int npcId = params.length > 0 ? Integer.parseInt(params[0]) : -1; - - Point pos = player.getPosition(); - int xpos = pos.x; - int ypos = pos.y; - - List>> toRemove = new LinkedList<>(); - try (Connection con = DatabaseConnection.getConnection()) { - final PreparedStatement ps; - if (npcId > -1) { - String select = "SELECT * FROM plife WHERE world = ? AND map = ? AND type LIKE ? AND life = ?"; - ps = con.prepareStatement(select, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); - ps.setInt(1, player.getWorld()); - ps.setInt(2, mapId); - ps.setString(3, "n"); - ps.setInt(4, npcId); - } else { - String select = "SELECT * FROM plife WHERE world = ? AND map = ? AND type LIKE ? AND x >= ? AND x <= ? AND y >= ? AND y <= ?"; - ps = con.prepareStatement(select, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); - ps.setInt(1, player.getWorld()); - ps.setInt(2, mapId); - ps.setString(3, "n"); - ps.setInt(4, xpos - 50); - ps.setInt(5, xpos + 50); - ps.setInt(6, ypos - 50); - ps.setInt(7, ypos + 50); - } - - try (ResultSet rs = ps.executeQuery()) { - while (true) { - rs.beforeFirst(); - if (!rs.next()) { - break; - } - - toRemove.add(new Pair<>(rs.getInt("life"), new Pair<>(rs.getInt("x"), rs.getInt("y")))); - rs.deleteRow(); - } - } - - ps.close(); - } catch (SQLException e) { - e.printStackTrace(); - player.dropMessage(5, "Failed to remove pNPC from the database."); - } - - if (!toRemove.isEmpty()) { - for (Channel ch : player.getWorldServer().getChannels()) { - MapleMap map = ch.getMapFactory().getMap(mapId); - - for (Pair> r : toRemove) { - map.destroyNPC(r.getLeft()); - } - } - } - - player.yellowMessage("Cleared " + toRemove.size() + " pNPC placements."); - } -} \ No newline at end of file diff --git a/src/main/java/client/command/commands/gm4/ProItemCommand.java b/src/main/java/client/command/commands/gm4/ProItemCommand.java deleted file mode 100644 index 7ecab53fad5..00000000000 --- a/src/main/java/client/command/commands/gm4/ProItemCommand.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm4; - -import client.Character; -import client.Client; -import client.command.Command; -import client.inventory.Equip; -import client.inventory.InventoryType; -import client.inventory.Item; -import client.inventory.manipulator.InventoryManipulator; -import constants.inventory.ItemConstants; -import server.ItemInformationProvider; - -public class ProItemCommand extends Command { - { - setDescription("Spawn an item with custom stats."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 2) { - player.yellowMessage("Syntax: !proitem []"); - return; - } - - ItemInformationProvider ii = ItemInformationProvider.getInstance(); - int itemid = Integer.parseInt(params[0]); - - if (ii.getName(itemid) == null) { - player.yellowMessage("Item id '" + params[0] + "' does not exist."); - return; - } - - short stat = (short) Math.max(0, Short.parseShort(params[1])); - short spdjmp = params.length >= 3 ? (short) Math.max(0, Short.parseShort(params[2])) : 0; - - InventoryType type = ItemConstants.getInventoryType(itemid); - if (type.equals(InventoryType.EQUIP)) { - Item it = ii.getEquipById(itemid); - it.setOwner(player.getName()); - - hardsetItemStats((Equip) it, stat, spdjmp); - InventoryManipulator.addFromDrop(c, it); - } else { - player.dropMessage(6, "Make sure it's an equippable item."); - } - } - - private static void hardsetItemStats(Equip equip, short stat, short spdjmp) { - equip.setStr(stat); - equip.setDex(stat); - equip.setInt(stat); - equip.setLuk(stat); - equip.setMatk(stat); - equip.setWatk(stat); - equip.setAcc(stat); - equip.setAvoid(stat); - equip.setJump(spdjmp); - equip.setSpeed(spdjmp); - equip.setWdef(stat); - equip.setMdef(stat); - equip.setHp(stat); - equip.setMp(stat); - - short flag = equip.getFlag(); - flag |= ItemConstants.UNTRADEABLE; - equip.setFlag(flag); - } -} diff --git a/src/main/java/client/command/commands/gm4/QuestRateCommand.java b/src/main/java/client/command/commands/gm4/QuestRateCommand.java deleted file mode 100644 index c880d7a166c..00000000000 --- a/src/main/java/client/command/commands/gm4/QuestRateCommand.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm4; - -import client.Character; -import client.Client; -import client.command.Command; -import tools.PacketCreator; - -public class QuestRateCommand extends Command { - { - setDescription("Set world quest rate."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !questrate "); - return; - } - - int questrate = Math.max(Integer.parseInt(params[0]), 1); - c.getWorldServer().setQuestRate(questrate); - c.getWorldServer().broadcastPacket(PacketCreator.serverNotice(6, "[Rate] Quest Rate has been changed to " + questrate + "x.")); - - } -} diff --git a/src/main/java/client/command/commands/gm4/ServerMessageCommand.java b/src/main/java/client/command/commands/gm4/ServerMessageCommand.java deleted file mode 100644 index 2fd43e483cd..00000000000 --- a/src/main/java/client/command/commands/gm4/ServerMessageCommand.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm4; - -import client.Character; -import client.Client; -import client.command.Command; - -public class ServerMessageCommand extends Command { - { - setDescription("Set scrolling server message."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - c.getWorldServer().setServerMessage(player.getLastCommandMessage()); - } -} diff --git a/src/main/java/client/command/commands/gm4/SetEqStatCommand.java b/src/main/java/client/command/commands/gm4/SetEqStatCommand.java deleted file mode 100644 index 115654b4b6a..00000000000 --- a/src/main/java/client/command/commands/gm4/SetEqStatCommand.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm4; - -import client.Character; -import client.Client; -import client.command.Command; -import client.inventory.Equip; -import client.inventory.Inventory; -import client.inventory.InventoryType; -import constants.inventory.ItemConstants; - -public class SetEqStatCommand extends Command { - { - setDescription("Set stats of all equips in inventory."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !seteqstat []"); - return; - } - - short newStat = (short) Math.max(0, Integer.parseInt(params[0])); - short newSpdJmp = params.length >= 2 ? (short) Integer.parseInt(params[1]) : 0; - Inventory equip = player.getInventory(InventoryType.EQUIP); - - for (byte i = 1; i <= equip.getSlotLimit(); i++) { - try { - Equip eq = (Equip) equip.getItem(i); - if (eq == null) { - continue; - } - - eq.setWdef(newStat); - eq.setAcc(newStat); - eq.setAvoid(newStat); - eq.setJump(newSpdJmp); - eq.setMatk(newStat); - eq.setMdef(newStat); - eq.setHp(newStat); - eq.setMp(newStat); - eq.setSpeed(newSpdJmp); - eq.setWatk(newStat); - eq.setDex(newStat); - eq.setInt(newStat); - eq.setStr(newStat); - eq.setLuk(newStat); - - short flag = eq.getFlag(); - flag |= ItemConstants.UNTRADEABLE; - eq.setFlag(flag); - - player.forceUpdateItem(eq); - } catch (Exception e) { - e.printStackTrace(); - } - } - } -} diff --git a/src/main/java/client/command/commands/gm4/TravelRateCommand.java b/src/main/java/client/command/commands/gm4/TravelRateCommand.java deleted file mode 100644 index aabb8605aaa..00000000000 --- a/src/main/java/client/command/commands/gm4/TravelRateCommand.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm4; - -import client.Character; -import client.Client; -import client.command.Command; -import tools.PacketCreator; - -public class TravelRateCommand extends Command { - { - setDescription("Set world travel rate."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !travelrate "); - return; - } - - int travelrate = Math.max(Integer.parseInt(params[0]), 1); - c.getWorldServer().setTravelRate(travelrate); - c.getWorldServer().broadcastPacket(PacketCreator.serverNotice(6, "[Rate] Travel Rate has been changed to " + travelrate + "x.")); - } -} diff --git a/src/main/java/client/command/commands/gm4/ZakumCommand.java b/src/main/java/client/command/commands/gm4/ZakumCommand.java deleted file mode 100644 index eeea31f45f1..00000000000 --- a/src/main/java/client/command/commands/gm4/ZakumCommand.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm4; - -import client.Character; -import client.Client; -import client.command.Command; -import constants.id.MobId; -import server.life.LifeFactory; - -public class ZakumCommand extends Command { - { - setDescription("Spawn Zakum on your location."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - player.getMap().spawnFakeMonsterOnGroundBelow(LifeFactory.getMonster(MobId.ZAKUM_1), player.getPosition()); - for (int mobId = MobId.ZAKUM_ARM_1; mobId <= MobId.ZAKUM_ARM_8; mobId++) { - player.getMap().spawnMonsterOnGroundBelow(LifeFactory.getMonster(mobId), player.getPosition()); - } - } -} diff --git a/src/main/java/client/command/commands/gm5/DebugCommand.java b/src/main/java/client/command/commands/gm5/DebugCommand.java deleted file mode 100644 index 5800f1ea929..00000000000 --- a/src/main/java/client/command/commands/gm5/DebugCommand.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm5; - -import client.Character; -import client.Client; -import client.command.Command; -import constants.id.NpcId; -import net.server.Server; -import server.TimerManager; -import server.life.Monster; -import server.life.SpawnPoint; -import server.maps.MapObject; -import server.maps.MapObjectType; -import server.maps.Portal; -import server.maps.Reactor; - -import java.awt.*; -import java.util.Arrays; -import java.util.List; - -public class DebugCommand extends Command { - private final static String[] debugTypes = {"monster", "packet", "portal", "spawnpoint", "pos", "map", "mobsp", "event", "areas", "reactors", "servercoupons", "playercoupons", "timer", "marriage", "buff", ""}; - - { - setDescription("Show a debug message."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - - if (params.length < 1) { - player.yellowMessage("Syntax: !debug "); - return; - } - - switch (params[0]) { - case "type": - case "help": - String msgTypes = "Available #bdebug types#k:\r\n\r\n"; - for (int i = 0; i < debugTypes.length; i++) { - msgTypes += ("#L" + i + "#" + debugTypes[i] + "#l\r\n"); - } - - c.getAbstractPlayerInteraction().npcTalk(NpcId.STEWARD, msgTypes); - break; - - case "monster": - List monsters = player.getMap().getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapObjectType.MONSTER)); - for (MapObject monstermo : monsters) { - Monster monster = (Monster) monstermo; - Character controller = monster.getController(); - player.message("Monster ID: " + monster.getId() + " Aggro target: " + ((controller != null) ? controller.getName() + " Has aggro: " + monster.isControllerHasAggro() + " Knowns aggro: " + monster.isControllerKnowsAboutAggro() : "")); - } - break; - - case "packet": - //player.getMap().broadcastMessage(PacketCreator.customPacket(joinStringFrom(params, 1))); - break; - - case "portal": - Portal portal = player.getMap().findClosestPortal(player.getPosition()); - if (portal != null) { - player.dropMessage(6, "Closest portal: " + portal.getId() + " '" + portal.getName() + "' Type: " + portal.getType() + " --> toMap: " + portal.getTargetMapId() + " scriptname: '" + portal.getScriptName() + "' state: " + (portal.getPortalState() ? 1 : 0) + "."); - } else { - player.dropMessage(6, "There is no portal on this map."); - } - break; - - case "spawnpoint": - SpawnPoint sp = player.getMap().findClosestSpawnpoint(player.getPosition()); - if (sp != null) { - player.dropMessage(6, "Closest mob spawn point: " + " Position: x " + sp.getPosition().getX() + " y " + sp.getPosition().getY() + " Spawns mobid: '" + sp.getMonsterId() + "' --> canSpawn: " + !sp.getDenySpawn() + " canSpawnRightNow: " + sp.shouldSpawn() + "."); - } else { - player.dropMessage(6, "There is no mob spawn point on this map."); - } - break; - - case "pos": - player.dropMessage(6, "Current map position: (" + player.getPosition().getX() + ", " + player.getPosition().getY() + ")."); - break; - - case "map": - player.dropMessage(6, "Current map id " + player.getMap().getId() + ", event: '" + ((player.getMap().getEventInstance() != null) ? player.getMap().getEventInstance().getName() : "null") + "'; Players: " + player.getMap().getAllPlayers().size() + ", Mobs: " + player.getMap().countMonsters() + ", Reactors: " + player.getMap().countReactors() + ", Items: " + player.getMap().countItems() + ", Objects: " + player.getMap().getMapObjects().size() + "."); - break; - - case "mobsp": - player.getMap().reportMonsterSpawnPoints(player); - break; - - case "event": - if (player.getEventInstance() == null) { - player.dropMessage(6, "Player currently not in an event."); - } else { - player.dropMessage(6, "Current event name: " + player.getEventInstance().getName() + "."); - } - break; - - case "areas": - player.dropMessage(6, "Configured areas on map " + player.getMapId() + ":"); - - byte index = 0; - for (Rectangle rect : player.getMap().getAreas()) { - player.dropMessage(6, "Id: " + index + " -> posX: " + rect.getX() + " posY: '" + rect.getY() + "' dX: " + rect.getWidth() + " dY: " + rect.getHeight() + "."); - index++; - } - break; - - case "reactors": - player.dropMessage(6, "Current reactor states on map " + player.getMapId() + ":"); - - for (MapObject mmo : player.getMap().getReactors()) { - Reactor mr = (Reactor) mmo; - player.dropMessage(6, "Id: " + mr.getId() + " Oid: " + mr.getObjectId() + " name: '" + mr.getName() + "' -> Type: " + mr.getReactorType() + " State: " + mr.getState() + " Event State: " + mr.getEventState() + " Position: x " + mr.getPosition().getX() + " y " + mr.getPosition().getY() + "."); - } - break; - - case "servercoupons": - case "coupons": - String s = "Currently active SERVER coupons: "; - for (Integer i : Server.getInstance().getActiveCoupons()) { - s += (i + " "); - } - - player.dropMessage(6, s); - break; - - case "playercoupons": - String st = "Currently active PLAYER coupons: "; - for (Integer i : player.getActiveCoupons()) { - st += (i + " "); - } - - player.dropMessage(6, st); - break; - - case "timer": - TimerManager tMan = TimerManager.getInstance(); - player.dropMessage(6, "Total Task: " + tMan.getTaskCount() + " Current Task: " + tMan.getQueuedTasks() + " Active Task: " + tMan.getActiveCount() + " Completed Task: " + tMan.getCompletedTaskCount()); - break; - - case "marriage": - c.getChannelServer().debugMarriageStatus(); - break; - - case "buff": - c.getPlayer().debugListAllBuffs(); - break; - } - } -} diff --git a/src/main/java/client/command/commands/gm5/IpListCommand.java b/src/main/java/client/command/commands/gm5/IpListCommand.java deleted file mode 100644 index 3661c8f31b9..00000000000 --- a/src/main/java/client/command/commands/gm5/IpListCommand.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server - Copyleft (L) 2016 - 2019 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 . -*/ -package client.command.commands.gm5; - -import client.Character; -import client.Client; -import client.command.Command; -import constants.game.GameConstants; -import net.server.Server; -import net.server.world.World; - -import java.util.Collection; - -/** - * @author Mist - * @author Blood (Tochi) - * @author Ronan - */ -public class IpListCommand extends Command { - { - setDescription("Show IP of all players."); - } - - @Override - public void execute(Client c, String[] params) { - String str = "Player-IP relation:"; - - for (World w : Server.getInstance().getWorlds()) { - Collection chars = w.getPlayerStorage().getAllCharacters(); - - if (!chars.isEmpty()) { - str += "\r\n" + GameConstants.WORLD_NAMES[w.getId()] + "\r\n"; - - for (Character chr : chars) { - str += " " + chr.getName() + " - " + chr.getClient().getRemoteAddress() + "\r\n"; - } - } - } - - c.getAbstractPlayerInteraction().npcTalk(22000, str); - } - -} \ No newline at end of file diff --git a/src/main/java/client/command/commands/gm5/SetCommand.java b/src/main/java/client/command/commands/gm5/SetCommand.java deleted file mode 100644 index f42dd1fb1bf..00000000000 --- a/src/main/java/client/command/commands/gm5/SetCommand.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm5; - -import client.Client; -import client.command.Command; -import constants.net.ServerConstants; - -public class SetCommand extends Command { - { - setDescription("Store value in an array, for testing."); - } - - @Override - public void execute(Client c, String[] params) { - for (int i = 0; i < params.length; i++) { - ServerConstants.DEBUG_VALUES[i] = Integer.parseInt(params[i]); - } - } -} diff --git a/src/main/java/client/command/commands/gm5/ShowMoveLifeCommand.java b/src/main/java/client/command/commands/gm5/ShowMoveLifeCommand.java deleted file mode 100644 index d269cc956f1..00000000000 --- a/src/main/java/client/command/commands/gm5/ShowMoveLifeCommand.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm5; - -import client.Client; -import client.command.Command; -import config.YamlConfig; - -public class ShowMoveLifeCommand extends Command { - { - setDescription("Toggle show move life in console."); - } - - @Override - public void execute(Client c, String[] params) { - YamlConfig.config.server.USE_DEBUG_SHOW_RCVD_MVLIFE = !YamlConfig.config.server.USE_DEBUG_SHOW_RCVD_MVLIFE; - } -} diff --git a/src/main/java/client/command/commands/gm5/ShowPacketsCommand.java b/src/main/java/client/command/commands/gm5/ShowPacketsCommand.java deleted file mode 100644 index 03bf3bf49ea..00000000000 --- a/src/main/java/client/command/commands/gm5/ShowPacketsCommand.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm5; - -import client.Client; -import client.command.Command; -import config.YamlConfig; - -public class ShowPacketsCommand extends Command { - { - setDescription("Toggle show received packets in console."); - } - - @Override - public void execute(Client c, String[] params) { - YamlConfig.config.server.USE_DEBUG_SHOW_RCVD_PACKET = !YamlConfig.config.server.USE_DEBUG_SHOW_RCVD_PACKET; - } -} diff --git a/src/main/java/client/command/commands/gm5/ShowSessionsCommand.java b/src/main/java/client/command/commands/gm5/ShowSessionsCommand.java deleted file mode 100644 index acc4d78e51c..00000000000 --- a/src/main/java/client/command/commands/gm5/ShowSessionsCommand.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server - Copyleft (L) 2016 - 2019 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 . -*/ -package client.command.commands.gm5; - -import client.Client; -import client.command.Command; -import net.server.coordinator.session.SessionCoordinator; - -/** - * @author Ronan - */ -public class ShowSessionsCommand extends Command { - { - setDescription("Show online sessions."); - } - - @Override - public void execute(Client c, String[] params) { - SessionCoordinator.getInstance().printSessionTrace(c); - } -} diff --git a/src/main/java/client/command/commands/gm6/ClearQuestCacheCommand.java b/src/main/java/client/command/commands/gm6/ClearQuestCacheCommand.java deleted file mode 100644 index 5f094f5600f..00000000000 --- a/src/main/java/client/command/commands/gm6/ClearQuestCacheCommand.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm6; - -import client.Character; -import client.Client; -import client.command.Command; -import server.quest.Quest; - -public class ClearQuestCacheCommand extends Command { - { - setDescription("Clear all quest cache."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - Quest.clearCache(); - player.dropMessage(5, "Quest Cache Cleared."); - } -} diff --git a/src/main/java/client/command/commands/gm6/ClearQuestCommand.java b/src/main/java/client/command/commands/gm6/ClearQuestCommand.java deleted file mode 100644 index 79707eff055..00000000000 --- a/src/main/java/client/command/commands/gm6/ClearQuestCommand.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm6; - -import client.Character; -import client.Client; -import client.command.Command; -import server.quest.Quest; - -public class ClearQuestCommand extends Command { - { - setDescription("Clear cache of a quest."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.dropMessage(5, "Please include a quest ID."); - return; - } - Quest.clearCache(Integer.parseInt(params[0])); - player.dropMessage(5, "Quest Cache for quest " + params[0] + " cleared."); - - } -} diff --git a/src/main/java/client/command/commands/gm6/DCAllCommand.java b/src/main/java/client/command/commands/gm6/DCAllCommand.java deleted file mode 100644 index f8298a4534a..00000000000 --- a/src/main/java/client/command/commands/gm6/DCAllCommand.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm6; - -import client.Character; -import client.Client; -import client.command.Command; -import net.server.Server; -import net.server.world.World; - -public class DCAllCommand extends Command { - { - setDescription("Disconnect all players (online or logged in)."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - for (World world : Server.getInstance().getWorlds()) { - for (Character chr : world.getPlayerStorage().getAllCharacters()) { - if (!chr.isGM()) { - chr.getClient().disconnect(false, false); - } - } - } - player.message("All players successfully disconnected."); - } -} diff --git a/src/main/java/client/command/commands/gm6/DevtestCommand.java b/src/main/java/client/command/commands/gm6/DevtestCommand.java deleted file mode 100644 index c0fd30dd577..00000000000 --- a/src/main/java/client/command/commands/gm6/DevtestCommand.java +++ /dev/null @@ -1,40 +0,0 @@ -package client.command.commands.gm6; - -import client.Client; -import client.command.Command; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import scripting.AbstractScriptManager; - -import javax.script.Invocable; -import javax.script.ScriptEngine; -import javax.script.ScriptException; - -public class DevtestCommand extends Command { - { - setDescription("Runs devtest.js. Developer utility - test stuff without restarting the server."); - } - - private static final Logger log = LoggerFactory.getLogger(DevtestCommand.class); - - private static class DevtestScriptManager extends AbstractScriptManager { - - @Override - public ScriptEngine getInvocableScriptEngine(String path) { - return super.getInvocableScriptEngine(path); - } - - } - - @Override - public void execute(Client client, String[] params) { - DevtestScriptManager scriptManager = new DevtestScriptManager(); - ScriptEngine scriptEngine = scriptManager.getInvocableScriptEngine("devtest.js"); - try { - Invocable invocable = (Invocable) scriptEngine; - invocable.invokeFunction("run", client.getPlayer()); - } catch (ScriptException | NoSuchMethodException e) { - log.info("devtest.js run() threw an exception", e); - } - } -} diff --git a/src/main/java/client/command/commands/gm6/EraseAllPNpcsCommand.java b/src/main/java/client/command/commands/gm6/EraseAllPNpcsCommand.java deleted file mode 100644 index 6f6394454c8..00000000000 --- a/src/main/java/client/command/commands/gm6/EraseAllPNpcsCommand.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm6; - -import client.Client; -import client.command.Command; -import server.life.PlayerNPC; - -public class EraseAllPNpcsCommand extends Command { - { - setDescription("Remove all player NPCs."); - } - - @Override - public void execute(Client c, String[] params) { - PlayerNPC.removeAllPlayerNPC(); - } -} diff --git a/src/main/java/client/command/commands/gm6/GetAccCommand.java b/src/main/java/client/command/commands/gm6/GetAccCommand.java deleted file mode 100644 index 00b81c69ac5..00000000000 --- a/src/main/java/client/command/commands/gm6/GetAccCommand.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm6; - -import client.Character; -import client.Client; -import client.command.Command; - -public class GetAccCommand extends Command { - { - setDescription("Show account name of an online player."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !getacc "); - return; - } - Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]); - if (victim != null) { - player.message(victim.getName() + "'s account name is " + victim.getClient().getAccountName() + "."); - } else { - player.message("Player '" + params[0] + "' could not be found on this world."); - } - } -} diff --git a/src/main/java/client/command/commands/gm6/MapPlayersCommand.java b/src/main/java/client/command/commands/gm6/MapPlayersCommand.java deleted file mode 100644 index 2404bd9bc06..00000000000 --- a/src/main/java/client/command/commands/gm6/MapPlayersCommand.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm6; - -import client.Character; -import client.Client; -import client.command.Command; -import net.server.Server; -import net.server.world.World; - -public class MapPlayersCommand extends Command { - { - setDescription("Show all players on the map."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - String names = ""; - int map = player.getMapId(); - for (World world : Server.getInstance().getWorlds()) { - for (Character chr : world.getPlayerStorage().getAllCharacters()) { - int curMap = chr.getMapId(); - String hp = Integer.toString(chr.getHp()); - String maxhp = Integer.toString(chr.getCurrentMaxHp()); - String name = chr.getName() + ": " + hp + "/" + maxhp; - if (map == curMap) { - names = names.equals("") ? name : (names + ", " + name); - } - } - } - player.message("Players on mapid " + map + ": " + names); - } -} diff --git a/src/main/java/client/command/commands/gm6/SaveAllCommand.java b/src/main/java/client/command/commands/gm6/SaveAllCommand.java deleted file mode 100644 index 28df7b456f6..00000000000 --- a/src/main/java/client/command/commands/gm6/SaveAllCommand.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm6; - -import client.Character; -import client.Client; -import client.command.Command; -import net.server.Server; -import net.server.world.World; -import tools.PacketCreator; - -public class SaveAllCommand extends Command { - { - setDescription("Save all characters."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - for (World world : Server.getInstance().getWorlds()) { - for (Character chr : world.getPlayerStorage().getAllCharacters()) { - chr.saveCharToDB(); - } - } - String message = player.getName() + " used !saveall."; - Server.getInstance().broadcastGMMessage(c.getWorld(), PacketCreator.serverNotice(5, message)); - player.message("All players saved successfully."); - } -} diff --git a/src/main/java/client/command/commands/gm6/ServerAddChannelCommand.java b/src/main/java/client/command/commands/gm6/ServerAddChannelCommand.java deleted file mode 100644 index 4f438c6b538..00000000000 --- a/src/main/java/client/command/commands/gm6/ServerAddChannelCommand.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm6; - -import client.Character; -import client.Client; -import client.command.Command; -import net.server.Server; -import server.ThreadManager; - -public class ServerAddChannelCommand extends Command { - { - setDescription("Add a new channel to a world."); - } - - @Override - public void execute(Client c, String[] params) { - final Character player = c.getPlayer(); - - if (params.length < 1) { - player.dropMessage(5, "Syntax: @addchannel "); - return; - } - - final int worldid = Integer.parseInt(params[0]); - - ThreadManager.getInstance().newTask(() -> { - int chid = Server.getInstance().addChannel(worldid); - if (player.isLoggedinWorld()) { - if (chid >= 0) { - player.dropMessage(5, "NEW Channel " + chid + " successfully deployed on world " + worldid + "."); - } else { - if (chid == -3) { - player.dropMessage(5, "Invalid worldid detected. Channel creation aborted."); - } else if (chid == -2) { - player.dropMessage(5, "Reached channel limit on worldid " + worldid + ". Channel creation aborted."); - } else if (chid == -1) { - player.dropMessage(5, "Error detected when loading the 'world.ini' file. Channel creation aborted."); - } else { - player.dropMessage(5, "NEW Channel failed to be deployed. Check if the needed port is already in use or other limitations are taking place."); - } - } - } - }); - } -} diff --git a/src/main/java/client/command/commands/gm6/ServerAddWorldCommand.java b/src/main/java/client/command/commands/gm6/ServerAddWorldCommand.java deleted file mode 100644 index ae611f904d4..00000000000 --- a/src/main/java/client/command/commands/gm6/ServerAddWorldCommand.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm6; - -import client.Character; -import client.Client; -import client.command.Command; -import net.server.Server; -import server.ThreadManager; - -public class ServerAddWorldCommand extends Command { - { - setDescription("Add a new world."); - } - - @Override - public void execute(Client c, String[] params) { - final Character player = c.getPlayer(); - - ThreadManager.getInstance().newTask(() -> { - int wid = Server.getInstance().addWorld(); - - if (player.isLoggedinWorld()) { - if (wid >= 0) { - player.dropMessage(5, "NEW World " + wid + " successfully deployed."); - } else { - if (wid == -2) { - player.dropMessage(5, "Error detected when loading the 'world.ini' file. World creation aborted."); - } else { - player.dropMessage(5, "NEW World failed to be deployed. Check if needed ports are already in use or maximum world count has been reached."); - } - } - } - }); - } -} diff --git a/src/main/java/client/command/commands/gm6/ServerRemoveChannelCommand.java b/src/main/java/client/command/commands/gm6/ServerRemoveChannelCommand.java deleted file mode 100644 index e0051403276..00000000000 --- a/src/main/java/client/command/commands/gm6/ServerRemoveChannelCommand.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm6; - -import client.Character; -import client.Client; -import client.command.Command; -import net.server.Server; -import server.ThreadManager; - -public class ServerRemoveChannelCommand extends Command { - { - setDescription("Remove channel from a world."); - } - - @Override - public void execute(Client c, String[] params) { - final Character player = c.getPlayer(); - - if (params.length < 1) { - player.dropMessage(5, "Syntax: @removechannel "); - return; - } - - final int worldId = Integer.parseInt(params[0]); - ThreadManager.getInstance().newTask(() -> { - if (Server.getInstance().removeChannel(worldId)) { - if (player.isLoggedinWorld()) { - player.dropMessage(5, "Successfully removed a channel on World " + worldId + ". Current channel count: " + Server.getInstance().getWorld(worldId).getChannelsSize() + "."); - } - } else { - if (player.isLoggedinWorld()) { - player.dropMessage(5, "Failed to remove last Channel on world " + worldId + ". Check if either that world exists or there are people currently playing there."); - } - } - }); - } -} diff --git a/src/main/java/client/command/commands/gm6/ServerRemoveWorldCommand.java b/src/main/java/client/command/commands/gm6/ServerRemoveWorldCommand.java deleted file mode 100644 index 522d891c637..00000000000 --- a/src/main/java/client/command/commands/gm6/ServerRemoveWorldCommand.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm6; - -import client.Character; -import client.Client; -import client.command.Command; -import net.server.Server; -import server.ThreadManager; - -public class ServerRemoveWorldCommand extends Command { - { - setDescription("Remove a world."); - } - - @Override - public void execute(Client c, String[] params) { - final Character player = c.getPlayer(); - - final int rwid = Server.getInstance().getWorldsSize() - 1; - if (rwid <= 0) { - player.dropMessage(5, "Unable to remove world 0."); - return; - } - - ThreadManager.getInstance().newTask(() -> { - if (Server.getInstance().removeWorld()) { - if (player.isLoggedinWorld()) { - player.dropMessage(5, "Successfully removed a world. Current world count: " + Server.getInstance().getWorldsSize() + "."); - } - } else { - if (player.isLoggedinWorld()) { - if (rwid < 0) { - player.dropMessage(5, "No registered worlds to remove."); - } else { - player.dropMessage(5, "Failed to remove world " + rwid + ". Check if there are people currently playing there."); - } - } - } - }); - } -} diff --git a/src/main/java/client/command/commands/gm6/SetGmLevelCommand.java b/src/main/java/client/command/commands/gm6/SetGmLevelCommand.java deleted file mode 100644 index 9387ac0cb85..00000000000 --- a/src/main/java/client/command/commands/gm6/SetGmLevelCommand.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm6; - -import client.Character; -import client.Client; -import client.command.Command; - -public class SetGmLevelCommand extends Command { - { - setDescription("Set GM level of a player."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 2) { - player.yellowMessage("Syntax: !setgmlevel "); - return; - } - - int newLevel = Integer.parseInt(params[1]); - Character target = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]); - if (target != null) { - target.setGMLevel(newLevel); - target.getClient().setGMLevel(newLevel); - - target.dropMessage("You are now a level " + newLevel + " GM. See @commands for a list of available commands."); - player.dropMessage(target + " is now a level " + newLevel + " GM."); - } else { - player.dropMessage("Player '" + params[0] + "' was not found on this channel."); - } - } -} diff --git a/src/main/java/client/command/commands/gm6/ShutdownCommand.java b/src/main/java/client/command/commands/gm6/ShutdownCommand.java deleted file mode 100644 index a083c9b63f3..00000000000 --- a/src/main/java/client/command/commands/gm6/ShutdownCommand.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - This file is part of the HeavenMS MapleStory Server, commands OdinMS-based - Copyleft (L) 2016 - 2019 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 . -*/ - -/* - @Author: Arthur L - Refactored command content into modules -*/ -package client.command.commands.gm6; - -import client.Character; -import client.Client; -import client.command.Command; -import net.server.Server; -import net.server.world.World; -import server.TimerManager; - -import static java.util.concurrent.TimeUnit.DAYS; -import static java.util.concurrent.TimeUnit.HOURS; -import static java.util.concurrent.TimeUnit.MINUTES; -import static java.util.concurrent.TimeUnit.SECONDS; - -public class ShutdownCommand extends Command { - { - setDescription("Shut down the server."); - } - - @Override - public void execute(Client c, String[] params) { - Character player = c.getPlayer(); - if (params.length < 1) { - player.yellowMessage("Syntax: !shutdown [