Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
16b0a36c86 | ||
|
|
313f48d4ce | ||
|
|
db82cbcfae | ||
|
|
eed47a9064 | ||
|
|
9945d37df8 | ||
|
|
4e743128e9 | ||
|
|
2ed35db216 | ||
|
|
df0c7f8b46 | ||
|
|
9fe6ba4483 | ||
|
|
dee8651e61 | ||
|
|
948a9de667 | ||
|
|
d55437ddf3 | ||
|
|
98fd8c13d4 | ||
|
|
04a92fe0c1 |
7
.gitignore
vendored
7
.gitignore
vendored
@@ -1,5 +1,6 @@
|
||||
/logs/**
|
||||
.idea/
|
||||
.idea/*
|
||||
!.idea/codeStyles/
|
||||
*.iml
|
||||
/target
|
||||
|
||||
@@ -16,3 +17,7 @@
|
||||
.project
|
||||
# JDT-specific (Eclipse Java Development Tools)
|
||||
.classpath
|
||||
|
||||
# Database
|
||||
database/docker-db-data
|
||||
database/docker-pg-db-data
|
||||
|
||||
8
.idea/codeStyles/Project.xml
generated
Normal file
8
.idea/codeStyles/Project.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<JavaCodeStyleSettings>
|
||||
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
|
||||
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
|
||||
</JavaCodeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
||||
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
@@ -0,0 +1,5 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||
</state>
|
||||
</component>
|
||||
@@ -107,7 +107,7 @@ You will start by installing the game with the old installer, then overwrite som
|
||||
1. Download _MapleGlobal-v83-setup.exe_ from my [Google Drive](https://drive.google.com/drive/folders/1hgnb92MGL6xqEp9szEMBh0K9pSJcJ6IT). This is the official installer from back then.
|
||||
2. Install it in a directory of your choice.
|
||||
3. Delete the following files from the installation directory: _HShield_ (entire directory), _ASPLnchr.exe_, _MapleStory.exe_, and _Patcher.exe_.
|
||||
4. Download _CosmicWZ-v1-2021.05.10.zip_ from my [Google Drive](https://drive.google.com/drive/folders/1hgnb92MGL6xqEp9szEMBh0K9pSJcJ6IT).
|
||||
4. Download _CosmicWZ-2024-05-21-v0.13.0.zip_ from my [Google Drive](https://drive.google.com/drive/folders/1hgnb92MGL6xqEp9szEMBh0K9pSJcJ6IT).
|
||||
5. Unzip it and copy all .wz-files into the installation directory. Replace the existing ones.
|
||||
6. Download _HeavenMS-localhost-WINDOW.exe_ from [hostr.co](https://hostr.co/amuX5SLeeVZx). This is a client modified to connect to your localhost instead of Nexon's server (along with some fixes and custom changes).
|
||||
- Your antivirus will likely detect the file as a trojan or similar and automatically delete it. To prevent this from happening, add your _Downloads_ directory and the installation directory as exclusions in your antivirus software. On W11, this is under "Virus & threat protection settings" -> "Add or remove exclusions".
|
||||
|
||||
@@ -220,7 +220,6 @@ server:
|
||||
USE_MTS: false
|
||||
USE_CPQ: true #Renders the CPQ available or not.
|
||||
USE_AUTOHIDE_GM: true #When enabled, GMs are automatically hidden when joining. Thanks to Steven Deblois (steven1152).
|
||||
USE_BUYBACK_SYSTEM: false #Enables the HeavenMS-builtin buyback system, to be used by dead players when clicking the MTS button.
|
||||
USE_FIXED_RATIO_HPMP_UPDATE: false #Enables the HeavenMS-builtin HPMP update based on the current pool to max pool ratio.
|
||||
USE_FAMILY_SYSTEM: true
|
||||
USE_DUEY: true
|
||||
@@ -447,14 +446,6 @@ server:
|
||||
WEDDING_GIFT_LIMIT: 1 #Max number of gifts per person to same wishlist on marriage instances.
|
||||
WEDDING_BLESSER_SHOWFX: true #Pops bubble sprite effect on players blessing the couple. Setting this false shows the blessing effect on the couple instead.
|
||||
|
||||
#Buyback Configuration
|
||||
USE_BUYBACK_WITH_MESOS: true #Enables usage of either mesos or NX for the buyback fee.
|
||||
BUYBACK_FEE: 77.70 #Sets the base amount needed to buyback (level 30 or under will use the base value).
|
||||
BUYBACK_LEVEL_STACK_FEE: 85.47 #Sets the level-stacking portion of the amount needed to buyback (fee will sum up linearly until level 120, when it reaches the peak).
|
||||
BUYBACK_MESO_MULTIPLIER: 1000 #Sets a multiplier for the fee when using meso as the charge unit.
|
||||
BUYBACK_RETURN_MINUTES: 1 #Sets the maximum amount of time the player can wait before decide to buyback.
|
||||
BUYBACK_COOLDOWN_MINUTES: 7 #Sets the time the player must wait before using buyback again.
|
||||
|
||||
# Login timeout by shavit
|
||||
TIMEOUT_DURATION: 3600000 # Kicks clients who don't send any packet to the game server in due time (in millisseconds).
|
||||
|
||||
|
||||
@@ -302,10 +302,10 @@ Localhost:
|
||||
* Removed caps for MATK, WDEF, MDEF, ACC and AVOID.
|
||||
* Removed "AP excess" popup and "Admin/MWLB" action block, original credits to kevintjuh93.
|
||||
* Removed "You've gained a level!" popup, original credits to PrinceReborn.
|
||||
* Removed "Cannot enter MTS from this map." popup on maps that blocks transitions (such change channel, CS/MTS), rendering the buyback option now available for all maps.
|
||||
* Removed "Cannot enter MTS from this map." popup on maps that blocks transitions (such change channel, CS/MTS).
|
||||
* Removed a check for players wishing to create/join a party being novices under level 10.
|
||||
* Set a new high cap for SPEED.
|
||||
* Removed the AP assign block for novices.
|
||||
* Removed a block that would show up when trying to apply an attack gem on equipments that aren't weapons.
|
||||
|
||||
---------------------------
|
||||
---------------------------
|
||||
|
||||
3
scripts/devtest.js
Normal file
3
scripts/devtest.js
Normal file
@@ -0,0 +1,3 @@
|
||||
function run(chr) {
|
||||
chr.message("devtest.js")
|
||||
}
|
||||
@@ -36,12 +36,6 @@ function stopEntry() {
|
||||
}
|
||||
|
||||
function takeoff() {
|
||||
const PacketCreator = Java.type('tools.PacketCreator');
|
||||
|
||||
//sound src: https://www.soundjay.com/transportation/metro-door-close-01.mp3
|
||||
KC_docked.broadcastMessage(PacketCreator.playSound("subway/whistle"));
|
||||
NLC_docked.broadcastMessage(PacketCreator.playSound("subway/whistle"));
|
||||
|
||||
em.setProperty("docked", "false");
|
||||
KC_Waiting.warpEveryone(Subway_to_NLC.getId());
|
||||
NLC_Waiting.warpEveryone(Subway_to_KC.getId());
|
||||
@@ -52,10 +46,6 @@ function arrived() {
|
||||
Subway_to_KC.warpEveryone(KC_docked.getId(), 0);
|
||||
Subway_to_NLC.warpEveryone(NLC_docked.getId(), 0);
|
||||
scheduleNew();
|
||||
|
||||
const PacketCreator = Java.type('tools.PacketCreator');
|
||||
KC_docked.broadcastMessage(PacketCreator.playSound("subway/whistle"));
|
||||
NLC_docked.broadcastMessage(PacketCreator.playSound("subway/whistle"));
|
||||
}
|
||||
|
||||
function cancelSchedule() {}
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
var status;
|
||||
|
||||
var anthemSong = "Field/anthem/brazil"; // sound src: https://c7.rbxcdn.com/f91060652a6e9fbfbf92cb1418435448
|
||||
var ambientSong = "Bgm04/Shinin'Harbor";
|
||||
|
||||
var feature_tree = [];
|
||||
@@ -217,7 +216,6 @@ function writeFeatureTab_Serverpotentials() {
|
||||
addFeature("Poison damage value visible for other players.");
|
||||
addFeature("M. book announcer displays info based on demand.");
|
||||
addFeature("Custom jail system.");
|
||||
addFeature("Custom buyback system, uses mesos / NX, via MTS.");
|
||||
addFeature("Custom fishing system having 'seasonal' catch times.");
|
||||
addFeature("Actual fishing handling w/ F. Net - thanks Dragohe4rt!");
|
||||
addFeature("Custom map leasing system.");
|
||||
@@ -260,7 +258,7 @@ function writeFeatureTab_CustomNPCs() {
|
||||
function writeFeatureTab_Localhostedits() {
|
||||
addFeature("Removed the 'n' NPC dialog issue.");
|
||||
addFeature("Removed caps for MATK, WMDEF, ACC and AVOID.");
|
||||
addFeature("Removed MTS block, buyback available anywhere.");
|
||||
addFeature("Removed MTS block.");
|
||||
addFeature("Removed party blocks for novices under level 10.");
|
||||
addFeature("Set a much more higher cap for SPEED.");
|
||||
addFeature("Removed AP usage block for novices.");
|
||||
@@ -308,8 +306,6 @@ function writeAllFeatures() {
|
||||
}
|
||||
|
||||
function start() {
|
||||
const PacketCreator = Java.type('tools.PacketCreator');
|
||||
cm.getPlayer().sendPacket(PacketCreator.musicChange(anthemSong));
|
||||
status = -1;
|
||||
writeAllFeatures();
|
||||
action(1, 0, 0);
|
||||
@@ -369,4 +365,4 @@ function generateSelectionMenu(array) {
|
||||
menu += "#L" + i + "#" + array[i] + "#l\r\n";
|
||||
}
|
||||
return menu;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,8 +50,14 @@ function end(mode, type, selection) {
|
||||
status++;
|
||||
}
|
||||
|
||||
// TODO: there are 10 different riffs; quest2288/0 through quest2288/9.
|
||||
// One of the riffs should play randomly upon the death of Spirit of Rock, but there is currently no system in place to achieve that in a reasonable way.
|
||||
// Spirit of Rock (4300013) spawns an invisible mob on death (Spirit of Rock's Soul, 4300017) which was likely used in some clever way in GMS.
|
||||
// The map (103040430) has two scripts which could be useful: onFirstUserEnter=Depart_Boss_F_Enter and onUserEnter=Depart_BossEnter
|
||||
// Currently, the best hypothesis is that one of the map scripts registers some form of "mob spawn" action/script that runs once the invisible mob spawns.
|
||||
// The script would randomly pick one of the 10 riffs and then register it with all chrs on the map (to later be used by this quest 2293) and play it.
|
||||
if (status == 0) {
|
||||
qm.sendSimple("Here, I'll give you some samples. Please listen to them and choose one. Please listen carefully before making your choide.\r\n\
|
||||
qm.sendSimple("Here, I'll give you some samples. Please listen to them and choose one. Please listen carefully before making your choice.\r\n\
|
||||
\t#b#L1# Listen to song No. 1#l \r\n\
|
||||
\t#L2# Listen to Song No. 2#l \r\n\
|
||||
\t#L3# Listen to Song No. 3#l \r\n\
|
||||
@@ -67,7 +73,7 @@ function end(mode, type, selection) {
|
||||
qm.sendOk("Was it this?");
|
||||
status = -1;
|
||||
} else if (selection == 3) {
|
||||
qm.playSound("quest2293/Die");
|
||||
qm.playSound("quest2288/6");
|
||||
qm.sendOk("You heard that?");
|
||||
status = -1;
|
||||
} else if (selection == 4) {
|
||||
@@ -88,4 +94,4 @@ function end(mode, type, selection) {
|
||||
} else if (status == 3) {
|
||||
qm.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,12 @@ import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Deque;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Map;
|
||||
|
||||
public class BuddyList {
|
||||
public enum BuddyOperation {
|
||||
|
||||
@@ -24,8 +24,17 @@ package client;
|
||||
|
||||
import client.autoban.AutobanManager;
|
||||
import client.creator.CharacterFactoryRecipe;
|
||||
import client.inventory.*;
|
||||
import client.inventory.Equip;
|
||||
import client.inventory.Equip.StatUpgrade;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryProof;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.ItemFactory;
|
||||
import client.inventory.ModifyInventory;
|
||||
import client.inventory.Pet;
|
||||
import client.inventory.PetDataFactory;
|
||||
import client.inventory.WeaponType;
|
||||
import client.inventory.manipulator.CashIdGenerator;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import client.keybind.KeyBinding;
|
||||
@@ -40,7 +49,35 @@ import constants.id.ItemId;
|
||||
import constants.id.MapId;
|
||||
import constants.id.MobId;
|
||||
import constants.inventory.ItemConstants;
|
||||
import constants.skills.*;
|
||||
import constants.skills.Aran;
|
||||
import constants.skills.Beginner;
|
||||
import constants.skills.Bishop;
|
||||
import constants.skills.BlazeWizard;
|
||||
import constants.skills.Bowmaster;
|
||||
import constants.skills.Brawler;
|
||||
import constants.skills.Buccaneer;
|
||||
import constants.skills.Corsair;
|
||||
import constants.skills.Crusader;
|
||||
import constants.skills.DarkKnight;
|
||||
import constants.skills.DawnWarrior;
|
||||
import constants.skills.Evan;
|
||||
import constants.skills.FPArchMage;
|
||||
import constants.skills.Hermit;
|
||||
import constants.skills.Hero;
|
||||
import constants.skills.ILArchMage;
|
||||
import constants.skills.Legend;
|
||||
import constants.skills.Magician;
|
||||
import constants.skills.Marauder;
|
||||
import constants.skills.Marksman;
|
||||
import constants.skills.NightLord;
|
||||
import constants.skills.Noblesse;
|
||||
import constants.skills.Paladin;
|
||||
import constants.skills.Priest;
|
||||
import constants.skills.Ranger;
|
||||
import constants.skills.Shadower;
|
||||
import constants.skills.Sniper;
|
||||
import constants.skills.ThunderBreaker;
|
||||
import constants.skills.Warrior;
|
||||
import net.packet.Packet;
|
||||
import net.server.PlayerBuffValueHolder;
|
||||
import net.server.PlayerCoolDownValueHolder;
|
||||
@@ -52,39 +89,98 @@ import net.server.guild.GuildCharacter;
|
||||
import net.server.guild.GuildPackets;
|
||||
import net.server.services.task.world.CharacterSaveService;
|
||||
import net.server.services.type.WorldServices;
|
||||
import net.server.world.*;
|
||||
import net.server.world.Messenger;
|
||||
import net.server.world.MessengerCharacter;
|
||||
import net.server.world.Party;
|
||||
import net.server.world.PartyCharacter;
|
||||
import net.server.world.PartyOperation;
|
||||
import net.server.world.World;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import scripting.AbstractPlayerInteraction;
|
||||
import scripting.event.EventInstanceManager;
|
||||
import scripting.item.ItemScriptManager;
|
||||
import server.*;
|
||||
import server.CashShop;
|
||||
import server.ExpLogger;
|
||||
import server.ExpLogger.ExpLogRecord;
|
||||
import server.ItemInformationProvider;
|
||||
import server.ItemInformationProvider.ScriptedItem;
|
||||
import server.Marriage;
|
||||
import server.Shop;
|
||||
import server.StatEffect;
|
||||
import server.Storage;
|
||||
import server.ThreadManager;
|
||||
import server.TimerManager;
|
||||
import server.Trade;
|
||||
import server.events.Events;
|
||||
import server.events.RescueGaga;
|
||||
import server.events.gm.Fitness;
|
||||
import server.events.gm.Ola;
|
||||
import server.life.*;
|
||||
import server.maps.*;
|
||||
import server.life.MobSkill;
|
||||
import server.life.MobSkillFactory;
|
||||
import server.life.MobSkillId;
|
||||
import server.life.MobSkillType;
|
||||
import server.life.Monster;
|
||||
import server.life.PlayerNPC;
|
||||
import server.maps.AbstractAnimatedMapObject;
|
||||
import server.maps.Door;
|
||||
import server.maps.DoorObject;
|
||||
import server.maps.Dragon;
|
||||
import server.maps.FieldLimit;
|
||||
import server.maps.HiredMerchant;
|
||||
import server.maps.MapEffect;
|
||||
import server.maps.MapItem;
|
||||
import server.maps.MapManager;
|
||||
import server.maps.MapObject;
|
||||
import server.maps.MapObjectType;
|
||||
import server.maps.MapleMap;
|
||||
import server.maps.MiniGame;
|
||||
import server.maps.MiniGame.MiniGameResult;
|
||||
import server.maps.PlayerShop;
|
||||
import server.maps.PlayerShopItem;
|
||||
import server.maps.Portal;
|
||||
import server.maps.SavedLocation;
|
||||
import server.maps.SavedLocationType;
|
||||
import server.maps.Summon;
|
||||
import server.minigame.RockPaperScissor;
|
||||
import server.partyquest.AriantColiseum;
|
||||
import server.partyquest.MonsterCarnival;
|
||||
import server.partyquest.MonsterCarnivalParty;
|
||||
import server.partyquest.PartyQuest;
|
||||
import server.quest.Quest;
|
||||
import tools.*;
|
||||
import tools.DatabaseConnection;
|
||||
import tools.LongTool;
|
||||
import tools.PacketCreator;
|
||||
import tools.Pair;
|
||||
import tools.Randomizer;
|
||||
import tools.exceptions.NotEnabledException;
|
||||
import tools.packets.WeddingPackets;
|
||||
|
||||
import java.awt.*;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.sql.*;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.sql.Timestamp;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.EnumMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.Stack;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
@@ -94,7 +190,9 @@ import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static java.util.concurrent.TimeUnit.*;
|
||||
import static java.util.concurrent.TimeUnit.DAYS;
|
||||
import static java.util.concurrent.TimeUnit.MINUTES;
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
|
||||
public class Character extends AbstractCharacterObject {
|
||||
private static final Logger log = LoggerFactory.getLogger(Character.class);
|
||||
@@ -128,7 +226,7 @@ public class Character extends AbstractCharacterObject {
|
||||
private int expRate = 1, mesoRate = 1, dropRate = 1, expCoupon = 1, mesoCoupon = 1, dropCoupon = 1;
|
||||
private int omokwins, omokties, omoklosses, matchcardwins, matchcardties, matchcardlosses;
|
||||
private int owlSearch;
|
||||
private long lastfametime, lastUsedCashItem, lastExpression = 0, lastHealed, lastBuyback = 0, lastDeathtime, jailExpiration = -1;
|
||||
private long lastfametime, lastUsedCashItem, lastExpression = 0, lastHealed, lastDeathtime, jailExpiration = -1;
|
||||
private transient int localstr, localdex, localluk, localint_, localmagic, localwatk;
|
||||
private transient int equipmaxhp, equipmaxmp, equipstr, equipdex, equipluk, equipint_, equipmagic, equipwatk, localchairhp, localchairmp;
|
||||
private int localchairrate;
|
||||
@@ -6054,65 +6152,6 @@ public class Character extends AbstractCharacterObject {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean canBuyback(int fee, boolean usingMesos) {
|
||||
return (usingMesos ? this.getMeso() : cashshop.getCash(1)) >= fee;
|
||||
}
|
||||
|
||||
private void applyBuybackFee(int fee, boolean usingMesos) {
|
||||
if (usingMesos) {
|
||||
this.gainMeso(-fee);
|
||||
} else {
|
||||
cashshop.gainCash(1, -fee);
|
||||
}
|
||||
}
|
||||
|
||||
private long getNextBuybackTime() {
|
||||
return lastBuyback + MINUTES.toMillis(YamlConfig.config.server.BUYBACK_COOLDOWN_MINUTES);
|
||||
}
|
||||
|
||||
private boolean isBuybackInvincible() {
|
||||
return Server.getInstance().getCurrentTime() - lastBuyback < 4200;
|
||||
}
|
||||
|
||||
private int getBuybackFee() {
|
||||
float fee = YamlConfig.config.server.BUYBACK_FEE;
|
||||
int grade = Math.min(Math.max(level, 30), 120) - 30;
|
||||
|
||||
fee += (grade * YamlConfig.config.server.BUYBACK_LEVEL_STACK_FEE);
|
||||
if (YamlConfig.config.server.USE_BUYBACK_WITH_MESOS) {
|
||||
fee *= YamlConfig.config.server.BUYBACK_MESO_MULTIPLIER;
|
||||
}
|
||||
|
||||
return (int) Math.floor(fee);
|
||||
}
|
||||
|
||||
public void showBuybackInfo() {
|
||||
String s = "#eBUYBACK STATUS#n\r\n\r\nCurrent buyback fee: #b" + getBuybackFee() + " " + (YamlConfig.config.server.USE_BUYBACK_WITH_MESOS ? "mesos" : "NX") + "#k\r\n\r\n";
|
||||
|
||||
long timeNow = Server.getInstance().getCurrentTime();
|
||||
boolean avail = true;
|
||||
if (!isAlive()) {
|
||||
long timeLapsed = timeNow - lastDeathtime;
|
||||
long timeRemaining = MINUTES.toMillis(YamlConfig.config.server.BUYBACK_RETURN_MINUTES) - (timeLapsed + Math.max(0, getNextBuybackTime() - timeNow));
|
||||
if (timeRemaining < 1) {
|
||||
s += "Buyback #e#rUNAVAILABLE#k#n";
|
||||
avail = false;
|
||||
} else {
|
||||
s += "Buyback countdown: #e#b" + getTimeRemaining(MINUTES.toMillis(YamlConfig.config.server.BUYBACK_RETURN_MINUTES) - timeLapsed) + "#k#n";
|
||||
}
|
||||
s += "\r\n";
|
||||
}
|
||||
|
||||
if (timeNow < getNextBuybackTime() && avail) {
|
||||
s += "Buyback available in #r" + getTimeRemaining(getNextBuybackTime() - timeNow) + "#k";
|
||||
s += "\r\n";
|
||||
} else {
|
||||
s += "Buyback #bavailable#k";
|
||||
}
|
||||
|
||||
this.showHint(s);
|
||||
}
|
||||
|
||||
private static String getTimeRemaining(long timeLeft) {
|
||||
int seconds = (int) Math.floor(timeLeft / SECONDS.toMillis(1)) % 60;
|
||||
int minutes = (int) Math.floor(timeLeft / MINUTES.toMillis(1)) % 60;
|
||||
@@ -6120,34 +6159,6 @@ public class Character extends AbstractCharacterObject {
|
||||
return (minutes > 0 ? (String.format("%02d", minutes) + " minutes, ") : "") + String.format("%02d", seconds) + " seconds";
|
||||
}
|
||||
|
||||
public boolean couldBuyback() { // Ronan's buyback system
|
||||
long timeNow = Server.getInstance().getCurrentTime();
|
||||
|
||||
if (timeNow - lastDeathtime > MINUTES.toMillis(YamlConfig.config.server.BUYBACK_RETURN_MINUTES)) {
|
||||
this.dropMessage(5, "The period of time to decide has expired, therefore you are unable to buyback.");
|
||||
return false;
|
||||
}
|
||||
|
||||
long nextBuybacktime = getNextBuybackTime();
|
||||
if (timeNow < nextBuybacktime) {
|
||||
long timeLeft = nextBuybacktime - timeNow;
|
||||
this.dropMessage(5, "Next buyback available in " + getTimeRemaining(timeLeft) + ".");
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean usingMesos = YamlConfig.config.server.USE_BUYBACK_WITH_MESOS;
|
||||
int fee = getBuybackFee();
|
||||
|
||||
if (!canBuyback(fee, usingMesos)) {
|
||||
this.dropMessage(5, "You don't have " + fee + " " + (usingMesos ? "mesos" : "NX") + " to buyback.");
|
||||
return false;
|
||||
}
|
||||
|
||||
lastBuyback = timeNow;
|
||||
applyBuybackFee(fee, usingMesos);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isBuffFrom(BuffStat stat, Skill skill) {
|
||||
effLock.lock();
|
||||
chrLock.lock();
|
||||
@@ -8911,11 +8922,7 @@ public class Character extends AbstractCharacterObject {
|
||||
boolean playerDied = false;
|
||||
if (hp <= 0) {
|
||||
if (oldHp > hp) {
|
||||
if (!isBuybackInvincible()) {
|
||||
playerDied = true;
|
||||
} else {
|
||||
hp = 1;
|
||||
}
|
||||
playerDied = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,11 @@ import net.server.coordinator.session.SessionCoordinator.AntiMulticlientResult;
|
||||
import net.server.guild.Guild;
|
||||
import net.server.guild.GuildCharacter;
|
||||
import net.server.guild.GuildPackets;
|
||||
import net.server.world.*;
|
||||
import net.server.world.MessengerCharacter;
|
||||
import net.server.world.Party;
|
||||
import net.server.world.PartyCharacter;
|
||||
import net.server.world.PartyOperation;
|
||||
import net.server.world.World;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import scripting.AbstractPlayerInteraction;
|
||||
@@ -73,9 +77,23 @@ import java.net.InetSocketAddress;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.sql.*;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.*;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.Semaphore;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
@@ -1581,4 +1599,4 @@ public class Client extends ChannelInboundHandlerAdapter {
|
||||
public void setLanguage(int lingua) {
|
||||
this.lang = lingua;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,8 +28,12 @@ import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
|
||||
@@ -24,7 +24,11 @@ package client;
|
||||
import server.quest.Quest;
|
||||
import tools.StringUtil;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Matze
|
||||
|
||||
@@ -21,8 +21,63 @@
|
||||
*/
|
||||
package client;
|
||||
|
||||
import constants.skills.*;
|
||||
import provider.*;
|
||||
import constants.skills.Aran;
|
||||
import constants.skills.Archer;
|
||||
import constants.skills.Assassin;
|
||||
import constants.skills.Bandit;
|
||||
import constants.skills.Beginner;
|
||||
import constants.skills.Bishop;
|
||||
import constants.skills.BlazeWizard;
|
||||
import constants.skills.Bowmaster;
|
||||
import constants.skills.Buccaneer;
|
||||
import constants.skills.ChiefBandit;
|
||||
import constants.skills.Cleric;
|
||||
import constants.skills.Corsair;
|
||||
import constants.skills.Crossbowman;
|
||||
import constants.skills.Crusader;
|
||||
import constants.skills.DarkKnight;
|
||||
import constants.skills.DawnWarrior;
|
||||
import constants.skills.DragonKnight;
|
||||
import constants.skills.Evan;
|
||||
import constants.skills.FPArchMage;
|
||||
import constants.skills.FPMage;
|
||||
import constants.skills.FPWizard;
|
||||
import constants.skills.Fighter;
|
||||
import constants.skills.GM;
|
||||
import constants.skills.Gunslinger;
|
||||
import constants.skills.Hermit;
|
||||
import constants.skills.Hero;
|
||||
import constants.skills.Hunter;
|
||||
import constants.skills.ILArchMage;
|
||||
import constants.skills.ILMage;
|
||||
import constants.skills.ILWizard;
|
||||
import constants.skills.Legend;
|
||||
import constants.skills.Magician;
|
||||
import constants.skills.Marauder;
|
||||
import constants.skills.Marksman;
|
||||
import constants.skills.NightLord;
|
||||
import constants.skills.NightWalker;
|
||||
import constants.skills.Noblesse;
|
||||
import constants.skills.Page;
|
||||
import constants.skills.Paladin;
|
||||
import constants.skills.Pirate;
|
||||
import constants.skills.Priest;
|
||||
import constants.skills.Ranger;
|
||||
import constants.skills.Rogue;
|
||||
import constants.skills.Shadower;
|
||||
import constants.skills.Sniper;
|
||||
import constants.skills.Spearman;
|
||||
import constants.skills.SuperGM;
|
||||
import constants.skills.ThunderBreaker;
|
||||
import constants.skills.Warrior;
|
||||
import constants.skills.WhiteKnight;
|
||||
import constants.skills.WindArcher;
|
||||
import provider.Data;
|
||||
import provider.DataDirectoryEntry;
|
||||
import provider.DataFileEntry;
|
||||
import provider.DataProvider;
|
||||
import provider.DataProviderFactory;
|
||||
import provider.DataTool;
|
||||
import provider.wz.WZFiles;
|
||||
import server.StatEffect;
|
||||
import server.life.Element;
|
||||
|
||||
@@ -24,13 +24,180 @@
|
||||
package client.command;
|
||||
|
||||
import client.Client;
|
||||
import client.command.commands.gm0.*;
|
||||
import client.command.commands.gm1.*;
|
||||
import client.command.commands.gm2.*;
|
||||
import client.command.commands.gm3.*;
|
||||
import client.command.commands.gm4.*;
|
||||
import client.command.commands.gm5.*;
|
||||
import client.command.commands.gm6.*;
|
||||
import client.command.commands.gm0.ChangeLanguageCommand;
|
||||
import client.command.commands.gm0.DisposeCommand;
|
||||
import client.command.commands.gm0.DropLimitCommand;
|
||||
import client.command.commands.gm0.EnableAuthCommand;
|
||||
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;
|
||||
@@ -177,7 +344,6 @@ public class CommandsExecutor {
|
||||
addCommand("droplimit", DropLimitCommand.class);
|
||||
addCommand("time", TimeCommand.class);
|
||||
addCommand("credits", StaffCommand.class);
|
||||
addCommand("buyback", BuyBackCommand.class);
|
||||
addCommand("uptime", UptimeCommand.class);
|
||||
addCommand("gacha", GachaCommand.class);
|
||||
addCommand("dispose", DisposeCommand.class);
|
||||
@@ -391,6 +557,7 @@ public class CommandsExecutor {
|
||||
addCommand("addworld", 6, ServerAddWorldCommand.class);
|
||||
addCommand("removechannel", 6, ServerRemoveChannelCommand.class);
|
||||
addCommand("removeworld", 6, ServerRemoveWorldCommand.class);
|
||||
addCommand("devtest", 6, DevtestCommand.class);
|
||||
|
||||
commandsNameDesc.add(levelCommandsCursor);
|
||||
}
|
||||
|
||||
@@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
@Author: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.gm0;
|
||||
|
||||
import client.Client;
|
||||
import client.command.Command;
|
||||
import client.processor.action.BuybackProcessor;
|
||||
|
||||
public class BuyBackCommand extends Command {
|
||||
{
|
||||
setDescription("Revive yourself after a death.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(Client c, String[] params) {
|
||||
if (params.length < 1) {
|
||||
c.getPlayer().yellowMessage("Syntax: @buyback <info|now>");
|
||||
return;
|
||||
}
|
||||
|
||||
if (params[0].contentEquals("now")) {
|
||||
BuybackProcessor.processBuyback(c);
|
||||
} else {
|
||||
c.getPlayer().showBuybackInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,10 @@ import client.Client;
|
||||
import client.command.Command;
|
||||
import net.server.Server;
|
||||
|
||||
import static java.util.concurrent.TimeUnit.*;
|
||||
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 {
|
||||
{
|
||||
|
||||
@@ -28,7 +28,11 @@ import client.Client;
|
||||
import client.command.Command;
|
||||
import constants.game.GameConstants;
|
||||
import constants.id.NpcId;
|
||||
import server.maps.*;
|
||||
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;
|
||||
|
||||
@@ -11,7 +11,11 @@ import tools.exceptions.IdTypeNotSupportedException;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.*;
|
||||
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;
|
||||
|
||||
@@ -24,7 +24,10 @@
|
||||
package client.command.commands.gm2;
|
||||
|
||||
import client.Character;
|
||||
import client.*;
|
||||
import client.Client;
|
||||
import client.Job;
|
||||
import client.Skill;
|
||||
import client.SkillFactory;
|
||||
import client.command.Command;
|
||||
import provider.Data;
|
||||
import provider.DataProviderFactory;
|
||||
|
||||
@@ -24,7 +24,10 @@
|
||||
package client.command.commands.gm2;
|
||||
|
||||
import client.Character;
|
||||
import client.*;
|
||||
import client.Client;
|
||||
import client.Job;
|
||||
import client.Skill;
|
||||
import client.SkillFactory;
|
||||
import client.command.Command;
|
||||
import provider.Data;
|
||||
import provider.DataProviderFactory;
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,10 @@ import net.server.Server;
|
||||
import net.server.world.World;
|
||||
import server.TimerManager;
|
||||
|
||||
import static java.util.concurrent.TimeUnit.*;
|
||||
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 {
|
||||
{
|
||||
|
||||
@@ -31,7 +31,14 @@ import server.ItemInformationProvider;
|
||||
import server.ThreadManager;
|
||||
import tools.Pair;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
@@ -652,4 +659,4 @@ public class Inventory implements Iterable<Item> {
|
||||
public void dispose() {
|
||||
owner = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,11 @@ package client.inventory;
|
||||
import tools.DatabaseConnection;
|
||||
import tools.Pair;
|
||||
|
||||
import java.sql.*;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
@@ -418,4 +422,4 @@ public enum ItemFactory {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,12 @@ package client.inventory.manipulator;
|
||||
import client.BuffStat;
|
||||
import client.Character;
|
||||
import client.Client;
|
||||
import client.inventory.*;
|
||||
import client.inventory.Equip;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.ModifyInventory;
|
||||
import client.inventory.Pet;
|
||||
import client.newyear.NewYearCardRecord;
|
||||
import config.YamlConfig;
|
||||
import constants.id.ItemId;
|
||||
|
||||
@@ -1,83 +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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package client.processor.action; // thanks Alex for pointing out some package structures containing broad modules
|
||||
|
||||
import client.Character;
|
||||
import client.Client;
|
||||
import server.maps.MapleMap;
|
||||
import tools.PacketCreator;
|
||||
|
||||
/**
|
||||
* @author RonanLana
|
||||
*/
|
||||
public class BuybackProcessor {
|
||||
|
||||
public static void processBuyback(Client c) {
|
||||
Character chr = c.getPlayer();
|
||||
boolean buyback;
|
||||
|
||||
c.lockClient();
|
||||
try {
|
||||
buyback = !chr.isAlive() && chr.couldBuyback();
|
||||
} finally {
|
||||
c.unlockClient();
|
||||
}
|
||||
|
||||
if (buyback) {
|
||||
String jobString;
|
||||
switch (chr.getJobStyle()) {
|
||||
case WARRIOR:
|
||||
jobString = "warrior";
|
||||
break;
|
||||
|
||||
case MAGICIAN:
|
||||
jobString = "magician";
|
||||
break;
|
||||
|
||||
case BOWMAN:
|
||||
jobString = "bowman";
|
||||
break;
|
||||
|
||||
case THIEF:
|
||||
jobString = "thief";
|
||||
break;
|
||||
|
||||
case BRAWLER:
|
||||
case GUNSLINGER:
|
||||
jobString = "pirate";
|
||||
break;
|
||||
|
||||
default:
|
||||
jobString = "beginner";
|
||||
}
|
||||
|
||||
chr.healHpMp();
|
||||
chr.purgeDebuffs();
|
||||
chr.broadcastStance(chr.isFacingLeft() ? 5 : 4);
|
||||
|
||||
MapleMap map = chr.getMap();
|
||||
map.broadcastMessage(PacketCreator.playSound("Buyback/" + jobString));
|
||||
map.broadcastMessage(PacketCreator.earnTitleMessage(chr.getName() + " just bought back into the game!"));
|
||||
|
||||
chr.sendPacket(PacketCreator.showBuybackEffect());
|
||||
map.broadcastMessage(chr, PacketCreator.showForeignBuybackEffect(chr.getId()), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,12 @@ import tools.DatabaseConnection;
|
||||
import tools.PacketCreator;
|
||||
import tools.Pair;
|
||||
|
||||
import java.sql.*;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
|
||||
@@ -41,7 +41,11 @@ import tools.DatabaseConnection;
|
||||
import tools.PacketCreator;
|
||||
import tools.Pair;
|
||||
|
||||
import java.sql.*;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -24,13 +24,22 @@
|
||||
package client.processor.stat;
|
||||
|
||||
import client.Character;
|
||||
import client.*;
|
||||
import client.Client;
|
||||
import client.Job;
|
||||
import client.Skill;
|
||||
import client.SkillFactory;
|
||||
import client.Stat;
|
||||
import client.autoban.AutobanFactory;
|
||||
import client.inventory.Equip;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import config.YamlConfig;
|
||||
import constants.skills.*;
|
||||
import constants.skills.BlazeWizard;
|
||||
import constants.skills.Brawler;
|
||||
import constants.skills.DawnWarrior;
|
||||
import constants.skills.Magician;
|
||||
import constants.skills.ThunderBreaker;
|
||||
import constants.skills.Warrior;
|
||||
import net.packet.InPacket;
|
||||
import tools.PacketCreator;
|
||||
import tools.Randomizer;
|
||||
|
||||
@@ -68,7 +68,6 @@ public class ServerConfig {
|
||||
public boolean USE_MTS;
|
||||
public boolean USE_CPQ;
|
||||
public boolean USE_AUTOHIDE_GM;
|
||||
public boolean USE_BUYBACK_SYSTEM;
|
||||
public boolean USE_FIXED_RATIO_HPMP_UPDATE;
|
||||
public boolean USE_FAMILY_SYSTEM;
|
||||
public boolean USE_DUEY;
|
||||
@@ -295,14 +294,6 @@ public class ServerConfig {
|
||||
public int WEDDING_GIFT_LIMIT;
|
||||
public boolean WEDDING_BLESSER_SHOWFX;
|
||||
|
||||
//Buyback Configuration
|
||||
public boolean USE_BUYBACK_WITH_MESOS;
|
||||
public float BUYBACK_FEE;
|
||||
public float BUYBACK_LEVEL_STACK_FEE;
|
||||
public int BUYBACK_MESO_MULTIPLIER;
|
||||
public int BUYBACK_RETURN_MINUTES;
|
||||
public int BUYBACK_COOLDOWN_MINUTES;
|
||||
|
||||
// Login timeout by shavit
|
||||
public long TIMEOUT_DURATION;
|
||||
|
||||
|
||||
@@ -23,11 +23,174 @@ package net;
|
||||
|
||||
import net.netty.LoginServer;
|
||||
import net.opcodes.RecvOpcode;
|
||||
import net.server.channel.handlers.*;
|
||||
import net.server.channel.handlers.AcceptFamilyHandler;
|
||||
import net.server.channel.handlers.AdminChatHandler;
|
||||
import net.server.channel.handlers.AdminCommandHandler;
|
||||
import net.server.channel.handlers.AdminLogHandler;
|
||||
import net.server.channel.handlers.AllianceOperationHandler;
|
||||
import net.server.channel.handlers.AranComboHandler;
|
||||
import net.server.channel.handlers.AutoAggroHandler;
|
||||
import net.server.channel.handlers.AutoAssignHandler;
|
||||
import net.server.channel.handlers.BBSOperationHandler;
|
||||
import net.server.channel.handlers.BeholderHandler;
|
||||
import net.server.channel.handlers.BuddylistModifyHandler;
|
||||
import net.server.channel.handlers.CancelBuffHandler;
|
||||
import net.server.channel.handlers.CancelChairHandler;
|
||||
import net.server.channel.handlers.CancelDebuffHandler;
|
||||
import net.server.channel.handlers.CancelItemEffectHandler;
|
||||
import net.server.channel.handlers.CashOperationHandler;
|
||||
import net.server.channel.handlers.CashShopSurpriseHandler;
|
||||
import net.server.channel.handlers.ChangeChannelHandler;
|
||||
import net.server.channel.handlers.ChangeMapHandler;
|
||||
import net.server.channel.handlers.ChangeMapSpecialHandler;
|
||||
import net.server.channel.handlers.CharInfoRequestHandler;
|
||||
import net.server.channel.handlers.ClickGuideHandler;
|
||||
import net.server.channel.handlers.CloseChalkboardHandler;
|
||||
import net.server.channel.handlers.CloseRangeDamageHandler;
|
||||
import net.server.channel.handlers.CoconutHandler;
|
||||
import net.server.channel.handlers.CouponCodeHandler;
|
||||
import net.server.channel.handlers.DamageSummonHandler;
|
||||
import net.server.channel.handlers.DenyAllianceRequestHandler;
|
||||
import net.server.channel.handlers.DenyGuildRequestHandler;
|
||||
import net.server.channel.handlers.DenyPartyRequestHandler;
|
||||
import net.server.channel.handlers.DistributeAPHandler;
|
||||
import net.server.channel.handlers.DistributeSPHandler;
|
||||
import net.server.channel.handlers.DoorHandler;
|
||||
import net.server.channel.handlers.DueyHandler;
|
||||
import net.server.channel.handlers.EnterCashShopHandler;
|
||||
import net.server.channel.handlers.EnterMTSHandler;
|
||||
import net.server.channel.handlers.FaceExpressionHandler;
|
||||
import net.server.channel.handlers.FamilyAddHandler;
|
||||
import net.server.channel.handlers.FamilyPreceptsHandler;
|
||||
import net.server.channel.handlers.FamilySeparateHandler;
|
||||
import net.server.channel.handlers.FamilySummonResponseHandler;
|
||||
import net.server.channel.handlers.FamilyUseHandler;
|
||||
import net.server.channel.handlers.FieldDamageMobHandler;
|
||||
import net.server.channel.handlers.FredrickHandler;
|
||||
import net.server.channel.handlers.GeneralChatHandler;
|
||||
import net.server.channel.handlers.GiveFameHandler;
|
||||
import net.server.channel.handlers.GrenadeEffectHandler;
|
||||
import net.server.channel.handlers.GuildOperationHandler;
|
||||
import net.server.channel.handlers.HealOvertimeHandler;
|
||||
import net.server.channel.handlers.HiredMerchantRequest;
|
||||
import net.server.channel.handlers.InnerPortalHandler;
|
||||
import net.server.channel.handlers.InventoryMergeHandler;
|
||||
import net.server.channel.handlers.InventorySortHandler;
|
||||
import net.server.channel.handlers.ItemMoveHandler;
|
||||
import net.server.channel.handlers.ItemPickupHandler;
|
||||
import net.server.channel.handlers.ItemRewardHandler;
|
||||
import net.server.channel.handlers.KeymapChangeHandler;
|
||||
import net.server.channel.handlers.LeftKnockbackHandler;
|
||||
import net.server.channel.handlers.MTSHandler;
|
||||
import net.server.channel.handlers.MagicDamageHandler;
|
||||
import net.server.channel.handlers.MakerSkillHandler;
|
||||
import net.server.channel.handlers.MesoDropHandler;
|
||||
import net.server.channel.handlers.MessengerHandler;
|
||||
import net.server.channel.handlers.MobBanishPlayerHandler;
|
||||
import net.server.channel.handlers.MobDamageMobFriendlyHandler;
|
||||
import net.server.channel.handlers.MobDamageMobHandler;
|
||||
import net.server.channel.handlers.MonsterBombHandler;
|
||||
import net.server.channel.handlers.MonsterBookCoverHandler;
|
||||
import net.server.channel.handlers.MonsterCarnivalHandler;
|
||||
import net.server.channel.handlers.MoveDragonHandler;
|
||||
import net.server.channel.handlers.MoveLifeHandler;
|
||||
import net.server.channel.handlers.MovePetHandler;
|
||||
import net.server.channel.handlers.MovePlayerHandler;
|
||||
import net.server.channel.handlers.MoveSummonHandler;
|
||||
import net.server.channel.handlers.MultiChatHandler;
|
||||
import net.server.channel.handlers.NPCAnimationHandler;
|
||||
import net.server.channel.handlers.NPCMoreTalkHandler;
|
||||
import net.server.channel.handlers.NPCShopHandler;
|
||||
import net.server.channel.handlers.NPCTalkHandler;
|
||||
import net.server.channel.handlers.NewYearCardHandler;
|
||||
import net.server.channel.handlers.NoteActionHandler;
|
||||
import net.server.channel.handlers.OpenFamilyHandler;
|
||||
import net.server.channel.handlers.OpenFamilyPedigreeHandler;
|
||||
import net.server.channel.handlers.OwlWarpHandler;
|
||||
import net.server.channel.handlers.PartyOperationHandler;
|
||||
import net.server.channel.handlers.PartySearchRegisterHandler;
|
||||
import net.server.channel.handlers.PartySearchStartHandler;
|
||||
import net.server.channel.handlers.PartySearchUpdateHandler;
|
||||
import net.server.channel.handlers.PetAutoPotHandler;
|
||||
import net.server.channel.handlers.PetChatHandler;
|
||||
import net.server.channel.handlers.PetCommandHandler;
|
||||
import net.server.channel.handlers.PetExcludeItemsHandler;
|
||||
import net.server.channel.handlers.PetFoodHandler;
|
||||
import net.server.channel.handlers.PetLootHandler;
|
||||
import net.server.channel.handlers.PlayerInteractionHandler;
|
||||
import net.server.channel.handlers.PlayerLoggedinHandler;
|
||||
import net.server.channel.handlers.PlayerMapTransitionHandler;
|
||||
import net.server.channel.handlers.QuestActionHandler;
|
||||
import net.server.channel.handlers.QuickslotKeyMappedModifiedHandler;
|
||||
import net.server.channel.handlers.RPSActionHandler;
|
||||
import net.server.channel.handlers.RaiseIncExpHandler;
|
||||
import net.server.channel.handlers.RaiseUIStateHandler;
|
||||
import net.server.channel.handlers.RangedAttackHandler;
|
||||
import net.server.channel.handlers.ReactorHitHandler;
|
||||
import net.server.channel.handlers.RemoteGachaponHandler;
|
||||
import net.server.channel.handlers.RemoteStoreHandler;
|
||||
import net.server.channel.handlers.ReportHandler;
|
||||
import net.server.channel.handlers.RingActionHandler;
|
||||
import net.server.channel.handlers.ScriptedItemHandler;
|
||||
import net.server.channel.handlers.ScrollHandler;
|
||||
import net.server.channel.handlers.SkillBookHandler;
|
||||
import net.server.channel.handlers.SkillEffectHandler;
|
||||
import net.server.channel.handlers.SkillMacroHandler;
|
||||
import net.server.channel.handlers.SnowballHandler;
|
||||
import net.server.channel.handlers.SpawnPetHandler;
|
||||
import net.server.channel.handlers.SpecialMoveHandler;
|
||||
import net.server.channel.handlers.SpouseChatHandler;
|
||||
import net.server.channel.handlers.StorageHandler;
|
||||
import net.server.channel.handlers.SummonDamageHandler;
|
||||
import net.server.channel.handlers.TakeDamageHandler;
|
||||
import net.server.channel.handlers.TouchMonsterDamageHandler;
|
||||
import net.server.channel.handlers.TouchReactorHandler;
|
||||
import net.server.channel.handlers.TouchingCashShopHandler;
|
||||
import net.server.channel.handlers.TransferNameHandler;
|
||||
import net.server.channel.handlers.TransferNameResultHandler;
|
||||
import net.server.channel.handlers.TransferWorldHandler;
|
||||
import net.server.channel.handlers.TrockAddMapHandler;
|
||||
import net.server.channel.handlers.UseCashItemHandler;
|
||||
import net.server.channel.handlers.UseCatchItemHandler;
|
||||
import net.server.channel.handlers.UseChairHandler;
|
||||
import net.server.channel.handlers.UseDeathItemHandler;
|
||||
import net.server.channel.handlers.UseGachaExpHandler;
|
||||
import net.server.channel.handlers.UseHammerHandler;
|
||||
import net.server.channel.handlers.UseItemEffectHandler;
|
||||
import net.server.channel.handlers.UseItemHandler;
|
||||
import net.server.channel.handlers.UseMapleLifeHandler;
|
||||
import net.server.channel.handlers.UseMountFoodHandler;
|
||||
import net.server.channel.handlers.UseOwlOfMinervaHandler;
|
||||
import net.server.channel.handlers.UseSolomonHandler;
|
||||
import net.server.channel.handlers.UseSummonBagHandler;
|
||||
import net.server.channel.handlers.UseWaterOfLifeHandler;
|
||||
import net.server.channel.handlers.WeddingHandler;
|
||||
import net.server.channel.handlers.WeddingTalkHandler;
|
||||
import net.server.channel.handlers.WeddingTalkMoreHandler;
|
||||
import net.server.channel.handlers.WhisperHandler;
|
||||
import net.server.handlers.CustomPacketHandler;
|
||||
import net.server.handlers.KeepAliveHandler;
|
||||
import net.server.handlers.LoginRequiringNoOpHandler;
|
||||
import net.server.handlers.login.*;
|
||||
import net.server.handlers.login.AcceptToSHandler;
|
||||
import net.server.handlers.login.AfterLoginHandler;
|
||||
import net.server.handlers.login.CharSelectedHandler;
|
||||
import net.server.handlers.login.CharSelectedWithPicHandler;
|
||||
import net.server.handlers.login.CharlistRequestHandler;
|
||||
import net.server.handlers.login.CheckCharNameHandler;
|
||||
import net.server.handlers.login.CreateCharHandler;
|
||||
import net.server.handlers.login.DeleteCharHandler;
|
||||
import net.server.handlers.login.GuestLoginHandler;
|
||||
import net.server.handlers.login.LoginPasswordHandler;
|
||||
import net.server.handlers.login.RegisterPicHandler;
|
||||
import net.server.handlers.login.RegisterPinHandler;
|
||||
import net.server.handlers.login.RelogRequestHandler;
|
||||
import net.server.handlers.login.ServerStatusRequestHandler;
|
||||
import net.server.handlers.login.ServerlistRequestHandler;
|
||||
import net.server.handlers.login.SetGenderHandler;
|
||||
import net.server.handlers.login.ViewAllCharHandler;
|
||||
import net.server.handlers.login.ViewAllCharRegisterPicHandler;
|
||||
import net.server.handlers.login.ViewAllCharSelectedHandler;
|
||||
import net.server.handlers.login.ViewAllCharSelectedWithPicHandler;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -286,4 +449,4 @@ public final class PacketProcessor {
|
||||
registerHandler(RecvOpcode.USE_ITEMUI, new RaiseIncExpHandler());
|
||||
registerHandler(RecvOpcode.CHANGE_QUICKSLOT, new QuickslotKeyMappedModifiedHandler());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,11 @@ package net.server;
|
||||
import client.Character;
|
||||
import client.Client;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReadWriteLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
@@ -124,4 +128,4 @@ public class PlayerStorage {
|
||||
rlock.unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,17 @@ import net.server.coordinator.session.SessionCoordinator;
|
||||
import net.server.guild.Alliance;
|
||||
import net.server.guild.Guild;
|
||||
import net.server.guild.GuildCharacter;
|
||||
import net.server.task.*;
|
||||
import net.server.task.BossLogTask;
|
||||
import net.server.task.CharacterDiseaseTask;
|
||||
import net.server.task.CouponTask;
|
||||
import net.server.task.DueyFredrickTask;
|
||||
import net.server.task.EventRecallCoordinatorTask;
|
||||
import net.server.task.InvitationTask;
|
||||
import net.server.task.LoginCoordinatorTask;
|
||||
import net.server.task.LoginStorageTask;
|
||||
import net.server.task.RankingCommandTask;
|
||||
import net.server.task.RankingLoginTask;
|
||||
import net.server.task.RespawnTask;
|
||||
import net.server.world.World;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.slf4j.Logger;
|
||||
@@ -69,8 +79,20 @@ import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.SortedMap;
|
||||
import java.util.TimeZone;
|
||||
import java.util.TreeMap;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
@@ -80,7 +102,10 @@ import java.util.concurrent.locks.ReadWriteLock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
|
||||
import static java.util.concurrent.TimeUnit.*;
|
||||
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 Server {
|
||||
private static final Logger log = LoggerFactory.getLogger(Server.class);
|
||||
|
||||
@@ -41,7 +41,11 @@ import server.TimerManager;
|
||||
import server.events.gm.Event;
|
||||
import server.expeditions.Expedition;
|
||||
import server.expeditions.ExpeditionType;
|
||||
import server.maps.*;
|
||||
import server.maps.HiredMerchant;
|
||||
import server.maps.MapManager;
|
||||
import server.maps.MapleMap;
|
||||
import server.maps.MiniDungeon;
|
||||
import server.maps.MiniDungeonInfo;
|
||||
import tools.PacketCreator;
|
||||
import tools.Pair;
|
||||
|
||||
@@ -49,14 +53,25 @@ import java.io.IOException;
|
||||
import java.nio.file.DirectoryStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
|
||||
import static java.util.concurrent.TimeUnit.*;
|
||||
import static java.util.concurrent.TimeUnit.HOURS;
|
||||
import static java.util.concurrent.TimeUnit.MINUTES;
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
|
||||
public final class Channel {
|
||||
private static final Logger log = LoggerFactory.getLogger(Channel.class);
|
||||
@@ -1035,4 +1050,4 @@ public final class Channel {
|
||||
log.debug("Guest list: {}", ongoingChapelGuests);
|
||||
log.debug("Starttime: {}", ongoingStartTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,8 +21,11 @@
|
||||
*/
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import client.BuffStat;
|
||||
import client.Character;
|
||||
import client.*;
|
||||
import client.Job;
|
||||
import client.Skill;
|
||||
import client.SkillFactory;
|
||||
import client.autoban.AutobanFactory;
|
||||
import client.status.MonsterStatus;
|
||||
import client.status.MonsterStatusEffect;
|
||||
@@ -31,14 +34,66 @@ import constants.game.GameConstants;
|
||||
import constants.id.ItemId;
|
||||
import constants.id.MapId;
|
||||
import constants.id.MobId;
|
||||
import constants.skills.*;
|
||||
import constants.skills.Aran;
|
||||
import constants.skills.Assassin;
|
||||
import constants.skills.Bandit;
|
||||
import constants.skills.Beginner;
|
||||
import constants.skills.Bishop;
|
||||
import constants.skills.BlazeWizard;
|
||||
import constants.skills.Bowmaster;
|
||||
import constants.skills.Brawler;
|
||||
import constants.skills.Buccaneer;
|
||||
import constants.skills.ChiefBandit;
|
||||
import constants.skills.Cleric;
|
||||
import constants.skills.Corsair;
|
||||
import constants.skills.Crossbowman;
|
||||
import constants.skills.Crusader;
|
||||
import constants.skills.DawnWarrior;
|
||||
import constants.skills.DragonKnight;
|
||||
import constants.skills.Evan;
|
||||
import constants.skills.FPArchMage;
|
||||
import constants.skills.FPMage;
|
||||
import constants.skills.FPWizard;
|
||||
import constants.skills.Fighter;
|
||||
import constants.skills.Gunslinger;
|
||||
import constants.skills.Hermit;
|
||||
import constants.skills.Hero;
|
||||
import constants.skills.Hunter;
|
||||
import constants.skills.ILArchMage;
|
||||
import constants.skills.ILMage;
|
||||
import constants.skills.Legend;
|
||||
import constants.skills.Marauder;
|
||||
import constants.skills.Marksman;
|
||||
import constants.skills.NightLord;
|
||||
import constants.skills.NightWalker;
|
||||
import constants.skills.Noblesse;
|
||||
import constants.skills.Outlaw;
|
||||
import constants.skills.Page;
|
||||
import constants.skills.Paladin;
|
||||
import constants.skills.Ranger;
|
||||
import constants.skills.Rogue;
|
||||
import constants.skills.Shadower;
|
||||
import constants.skills.Sniper;
|
||||
import constants.skills.Spearman;
|
||||
import constants.skills.SuperGM;
|
||||
import constants.skills.ThunderBreaker;
|
||||
import constants.skills.WhiteKnight;
|
||||
import constants.skills.WindArcher;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
import net.server.PlayerBuffValueHolder;
|
||||
import scripting.AbstractPlayerInteraction;
|
||||
import server.StatEffect;
|
||||
import server.TimerManager;
|
||||
import server.life.*;
|
||||
import server.life.Element;
|
||||
import server.life.ElementalEffectiveness;
|
||||
import server.life.MobSkill;
|
||||
import server.life.MobSkillFactory;
|
||||
import server.life.MobSkillId;
|
||||
import server.life.MobSkillType;
|
||||
import server.life.Monster;
|
||||
import server.life.MonsterDropEntry;
|
||||
import server.life.MonsterInformationProvider;
|
||||
import server.maps.MapItem;
|
||||
import server.maps.MapObject;
|
||||
import server.maps.MapObjectType;
|
||||
@@ -47,8 +102,12 @@ import tools.PacketCreator;
|
||||
import tools.Randomizer;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.Map;
|
||||
|
||||
import static java.util.concurrent.TimeUnit.MINUTES;
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
@@ -630,9 +689,10 @@ public abstract class AbstractDealDamageHandler extends AbstractPacketHandler {
|
||||
calcDmgMax = chr.calculateMaxBaseDamage(chr.getTotalWatk());
|
||||
}
|
||||
|
||||
StatEffect effect = null;
|
||||
if (ret.skill != 0) {
|
||||
Skill skill = SkillFactory.getSkill(ret.skill);
|
||||
StatEffect effect = skill.getEffect(ret.skilllevel);
|
||||
effect = skill.getEffect(ret.skilllevel);
|
||||
|
||||
if (magic) {
|
||||
// Since the skill is magic based, use the magic formula
|
||||
@@ -871,6 +931,16 @@ public abstract class AbstractDealDamageHandler extends AbstractPacketHandler {
|
||||
damage = -Integer.MAX_VALUE + damage - 1;
|
||||
}
|
||||
|
||||
if(effect != null) {
|
||||
int maxattack = Math.max(effect.getBulletCount(), effect.getAttackCount());
|
||||
if (shadowPartner) {
|
||||
maxattack = maxattack * 2;
|
||||
}
|
||||
if (ret.numDamage > maxattack) {
|
||||
AutobanFactory.DAMAGE_HACK.addPoint(chr.getAutobanManager(), "Too many lines: " + ret.numDamage + " Max lines: " + maxattack + " SID: " + ret.skill + " MobID: " + (monster != null ? monster.getId() : "null") + " Map: " + chr.getMap().getMapName() + " (" + chr.getMapId() + ")");
|
||||
}
|
||||
}
|
||||
|
||||
allDamageNumbers.add(damage);
|
||||
}
|
||||
if (ret.skill != Corsair.RAPID_FIRE || ret.skill != Aran.HIDDEN_FULL_DOUBLE || ret.skill != Aran.HIDDEN_FULL_TRIPLE || ret.skill != Aran.HIDDEN_OVER_DOUBLE || ret.skill != Aran.HIDDEN_OVER_TRIPLE) {
|
||||
|
||||
@@ -26,7 +26,12 @@ import net.packet.InPacket;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import server.maps.AnimatedMapObject;
|
||||
import server.movement.*;
|
||||
import server.movement.AbsoluteLifeMovement;
|
||||
import server.movement.ChangeEquip;
|
||||
import server.movement.JumpDownMovement;
|
||||
import server.movement.LifeMovementFragment;
|
||||
import server.movement.RelativeLifeMovement;
|
||||
import server.movement.TeleportMovement;
|
||||
import tools.exceptions.EmptyMovementException;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
@@ -21,10 +21,13 @@
|
||||
*/
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import client.*;
|
||||
import client.BuddyList;
|
||||
import client.BuddyList.BuddyAddResult;
|
||||
import client.Character;
|
||||
import client.BuddyList.BuddyOperation;
|
||||
import client.BuddylistEntry;
|
||||
import client.Character;
|
||||
import client.CharacterNameAndId;
|
||||
import client.Client;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
import net.server.world.World;
|
||||
|
||||
@@ -23,7 +23,14 @@ package net.server.channel.handlers;
|
||||
|
||||
import client.Client;
|
||||
import client.SkillFactory;
|
||||
import constants.skills.*;
|
||||
import constants.skills.Bishop;
|
||||
import constants.skills.Bowmaster;
|
||||
import constants.skills.Corsair;
|
||||
import constants.skills.Evan;
|
||||
import constants.skills.FPArchMage;
|
||||
import constants.skills.ILArchMage;
|
||||
import constants.skills.Marksman;
|
||||
import constants.skills.WindArcher;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.PacketHandler;
|
||||
import net.packet.InPacket;
|
||||
@@ -53,4 +60,4 @@ public final class CancelBuffHandler extends AbstractPacketHandler implements Pa
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ public class CashShopSurpriseHandler extends AbstractPacketHandler {
|
||||
if (cssResult != null) {
|
||||
Item cssItem = cssResult.getLeft(), cssBox = cssResult.getRight();
|
||||
c.sendPacket(PacketCreator.onCashGachaponOpenSuccess(c.getAccID(), cssBox.getSN(), cssBox.getQuantity(), cssItem, cssItem.getItemId(), cssItem.getQuantity(), true));
|
||||
c.sendPacket(PacketCreator.showCashInventory(c));
|
||||
} else {
|
||||
c.sendPacket(PacketCreator.onCashItemGachaponOpenFailed());
|
||||
}
|
||||
|
||||
@@ -21,12 +21,22 @@
|
||||
*/
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import client.BuffStat;
|
||||
import client.Character;
|
||||
import client.*;
|
||||
import client.Client;
|
||||
import client.Job;
|
||||
import client.Skill;
|
||||
import client.SkillFactory;
|
||||
import config.YamlConfig;
|
||||
import constants.game.GameConstants;
|
||||
import constants.id.MapId;
|
||||
import constants.skills.*;
|
||||
import constants.skills.Crusader;
|
||||
import constants.skills.DawnWarrior;
|
||||
import constants.skills.DragonKnight;
|
||||
import constants.skills.Hero;
|
||||
import constants.skills.NightWalker;
|
||||
import constants.skills.Rogue;
|
||||
import constants.skills.WindArcher;
|
||||
import net.packet.InPacket;
|
||||
import server.StatEffect;
|
||||
import tools.PacketCreator;
|
||||
@@ -183,4 +193,4 @@ public final class CloseRangeDamageHandler extends AbstractDealDamageHandler {
|
||||
|
||||
applyAttack(attack, chr, attackCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,11 @@ import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,7 +25,6 @@ import client.Character;
|
||||
import client.Client;
|
||||
import client.inventory.Equip;
|
||||
import client.inventory.Item;
|
||||
import client.processor.action.BuybackProcessor;
|
||||
import config.YamlConfig;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
@@ -45,136 +44,132 @@ import java.util.List;
|
||||
|
||||
|
||||
public final class EnterMTSHandler extends AbstractPacketHandler {
|
||||
|
||||
@Override
|
||||
public final void handlePacket(InPacket p, Client c) {
|
||||
public void handlePacket(InPacket p, Client c) {
|
||||
Character chr = c.getPlayer();
|
||||
|
||||
if (!chr.isAlive() && YamlConfig.config.server.USE_BUYBACK_SYSTEM) {
|
||||
BuybackProcessor.processBuyback(c);
|
||||
if (!YamlConfig.config.server.USE_MTS) {
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
} else {
|
||||
if (!YamlConfig.config.server.USE_MTS) {
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
return;
|
||||
}
|
||||
|
||||
if (chr.getEventInstance() != null) {
|
||||
c.sendPacket(PacketCreator.serverNotice(5, "Entering Cash Shop or MTS are disabled when registered on an event."));
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
return;
|
||||
}
|
||||
|
||||
if (MiniDungeonInfo.isDungeonMap(chr.getMapId())) {
|
||||
c.sendPacket(PacketCreator.serverNotice(5, "Changing channels or entering Cash Shop or MTS are disabled when inside a Mini-Dungeon."));
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
return;
|
||||
}
|
||||
|
||||
if (FieldLimit.CANNOTMIGRATE.check(chr.getMap().getFieldLimit())) {
|
||||
chr.dropMessage(1, "You can't do it here in this map.");
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!chr.isAlive()) {
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
return;
|
||||
}
|
||||
if (chr.getLevel() < 10) {
|
||||
c.sendPacket(PacketCreator.blockedMessage2(5));
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
return;
|
||||
}
|
||||
|
||||
chr.closePlayerInteractions();
|
||||
chr.closePartySearchInteractions();
|
||||
|
||||
chr.unregisterChairBuff();
|
||||
Server.getInstance().getPlayerBuffStorage().addBuffsToStorage(chr.getId(), chr.getAllBuffs());
|
||||
Server.getInstance().getPlayerBuffStorage().addDiseasesToStorage(chr.getId(), chr.getAllDiseases());
|
||||
chr.setAwayFromChannelWorld();
|
||||
chr.notifyMapTransferToPartner(-1);
|
||||
chr.removeIncomingInvites();
|
||||
chr.cancelAllBuffs(true);
|
||||
chr.cancelAllDebuffs();
|
||||
chr.cancelBuffExpireTask();
|
||||
chr.cancelDiseaseExpireTask();
|
||||
chr.cancelSkillCooldownTask();
|
||||
chr.cancelExpirationTask();
|
||||
|
||||
chr.forfeitExpirableQuests();
|
||||
chr.cancelQuestExpirationTask();
|
||||
|
||||
chr.saveCharToDB();
|
||||
|
||||
c.getChannelServer().removePlayer(chr);
|
||||
chr.getMap().removePlayer(c.getPlayer());
|
||||
try {
|
||||
c.sendPacket(PacketCreator.openCashShop(c, true));
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
chr.getCashShop().open(true);// xD
|
||||
c.enableCSActions();
|
||||
c.sendPacket(PacketCreator.MTSWantedListingOver(0, 0));
|
||||
c.sendPacket(PacketCreator.showMTSCash(c.getPlayer()));
|
||||
List<MTSItemInfo> items = new ArrayList<>();
|
||||
int pages = 0;
|
||||
try (Connection con = DatabaseConnection.getConnection()) {
|
||||
try (PreparedStatement ps = con.prepareStatement("SELECT * FROM mts_items WHERE tab = 1 AND transfer = 0 ORDER BY id DESC LIMIT 16, 16");
|
||||
ResultSet rs = ps.executeQuery()) {
|
||||
while (rs.next()) {
|
||||
if (rs.getInt("type") != 1) {
|
||||
Item i = new Item(rs.getInt("itemid"), (short) 0, (short) rs.getInt("quantity"));
|
||||
i.setOwner(rs.getString("owner"));
|
||||
items.add(new MTSItemInfo(i, rs.getInt("price") + 100 + (int) (rs.getInt("price") * 0.1), rs.getInt("id"), rs.getInt("seller"), rs.getString("sellername"), rs.getString("sell_ends")));
|
||||
} else {
|
||||
Equip equip = new Equip(rs.getInt("itemid"), (byte) rs.getInt("position"), -1);
|
||||
equip.setOwner(rs.getString("owner"));
|
||||
equip.setQuantity((short) 1);
|
||||
equip.setAcc((short) rs.getInt("acc"));
|
||||
equip.setAvoid((short) rs.getInt("avoid"));
|
||||
equip.setDex((short) rs.getInt("dex"));
|
||||
equip.setHands((short) rs.getInt("hands"));
|
||||
equip.setHp((short) rs.getInt("hp"));
|
||||
equip.setInt((short) rs.getInt("int"));
|
||||
equip.setJump((short) rs.getInt("jump"));
|
||||
equip.setVicious((short) rs.getInt("vicious"));
|
||||
equip.setFlag((short) rs.getInt("flag"));
|
||||
equip.setLuk((short) rs.getInt("luk"));
|
||||
equip.setMatk((short) rs.getInt("matk"));
|
||||
equip.setMdef((short) rs.getInt("mdef"));
|
||||
equip.setMp((short) rs.getInt("mp"));
|
||||
equip.setSpeed((short) rs.getInt("speed"));
|
||||
equip.setStr((short) rs.getInt("str"));
|
||||
equip.setWatk((short) rs.getInt("watk"));
|
||||
equip.setWdef((short) rs.getInt("wdef"));
|
||||
equip.setUpgradeSlots((byte) rs.getInt("upgradeslots"));
|
||||
equip.setLevel((byte) rs.getInt("level"));
|
||||
equip.setItemLevel(rs.getByte("itemlevel"));
|
||||
equip.setItemExp(rs.getInt("itemexp"));
|
||||
equip.setRingId(rs.getInt("ringid"));
|
||||
equip.setExpiration(rs.getLong("expiration"));
|
||||
equip.setGiftFrom(rs.getString("giftFrom"));
|
||||
|
||||
items.add(new MTSItemInfo(equip, rs.getInt("price") + 100 + (int) (rs.getInt("price") * 0.1), rs.getInt("id"), rs.getInt("seller"), rs.getString("sellername"), rs.getString("sell_ends")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try (PreparedStatement ps = con.prepareStatement("SELECT COUNT(*) FROM mts_items");
|
||||
ResultSet rs = ps.executeQuery()) {
|
||||
if (rs.next()) {
|
||||
pages = (int) Math.ceil(rs.getInt(1) / 16);
|
||||
}
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
c.sendPacket(PacketCreator.sendMTS(items, 1, 0, 0, pages));
|
||||
c.sendPacket(PacketCreator.transferInventory(getTransfer(chr.getId())));
|
||||
c.sendPacket(PacketCreator.notYetSoldInv(getNotYetSold(chr.getId())));
|
||||
return;
|
||||
}
|
||||
|
||||
if (chr.getEventInstance() != null) {
|
||||
c.sendPacket(PacketCreator.serverNotice(5, "Entering Cash Shop or MTS are disabled when registered on an event."));
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
return;
|
||||
}
|
||||
|
||||
if (MiniDungeonInfo.isDungeonMap(chr.getMapId())) {
|
||||
c.sendPacket(PacketCreator.serverNotice(5, "Changing channels or entering Cash Shop or MTS are disabled when inside a Mini-Dungeon."));
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
return;
|
||||
}
|
||||
|
||||
if (FieldLimit.CANNOTMIGRATE.check(chr.getMap().getFieldLimit())) {
|
||||
chr.dropMessage(1, "You can't do it here in this map.");
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!chr.isAlive()) {
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
return;
|
||||
}
|
||||
if (chr.getLevel() < 10) {
|
||||
c.sendPacket(PacketCreator.blockedMessage2(5));
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
return;
|
||||
}
|
||||
|
||||
chr.closePlayerInteractions();
|
||||
chr.closePartySearchInteractions();
|
||||
|
||||
chr.unregisterChairBuff();
|
||||
Server.getInstance().getPlayerBuffStorage().addBuffsToStorage(chr.getId(), chr.getAllBuffs());
|
||||
Server.getInstance().getPlayerBuffStorage().addDiseasesToStorage(chr.getId(), chr.getAllDiseases());
|
||||
chr.setAwayFromChannelWorld();
|
||||
chr.notifyMapTransferToPartner(-1);
|
||||
chr.removeIncomingInvites();
|
||||
chr.cancelAllBuffs(true);
|
||||
chr.cancelAllDebuffs();
|
||||
chr.cancelBuffExpireTask();
|
||||
chr.cancelDiseaseExpireTask();
|
||||
chr.cancelSkillCooldownTask();
|
||||
chr.cancelExpirationTask();
|
||||
|
||||
chr.forfeitExpirableQuests();
|
||||
chr.cancelQuestExpirationTask();
|
||||
|
||||
chr.saveCharToDB();
|
||||
|
||||
c.getChannelServer().removePlayer(chr);
|
||||
chr.getMap().removePlayer(c.getPlayer());
|
||||
try {
|
||||
c.sendPacket(PacketCreator.openCashShop(c, true));
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
chr.getCashShop().open(true);// xD
|
||||
c.enableCSActions();
|
||||
c.sendPacket(PacketCreator.MTSWantedListingOver(0, 0));
|
||||
c.sendPacket(PacketCreator.showMTSCash(c.getPlayer()));
|
||||
List<MTSItemInfo> items = new ArrayList<>();
|
||||
int pages = 0;
|
||||
try (Connection con = DatabaseConnection.getConnection()) {
|
||||
try (PreparedStatement ps = con.prepareStatement("SELECT * FROM mts_items WHERE tab = 1 AND transfer = 0 ORDER BY id DESC LIMIT 16, 16");
|
||||
ResultSet rs = ps.executeQuery()) {
|
||||
while (rs.next()) {
|
||||
if (rs.getInt("type") != 1) {
|
||||
Item i = new Item(rs.getInt("itemid"), (short) 0, (short) rs.getInt("quantity"));
|
||||
i.setOwner(rs.getString("owner"));
|
||||
items.add(new MTSItemInfo(i, rs.getInt("price") + 100 + (int) (rs.getInt("price") * 0.1), rs.getInt("id"), rs.getInt("seller"), rs.getString("sellername"), rs.getString("sell_ends")));
|
||||
} else {
|
||||
Equip equip = new Equip(rs.getInt("itemid"), (byte) rs.getInt("position"), -1);
|
||||
equip.setOwner(rs.getString("owner"));
|
||||
equip.setQuantity((short) 1);
|
||||
equip.setAcc((short) rs.getInt("acc"));
|
||||
equip.setAvoid((short) rs.getInt("avoid"));
|
||||
equip.setDex((short) rs.getInt("dex"));
|
||||
equip.setHands((short) rs.getInt("hands"));
|
||||
equip.setHp((short) rs.getInt("hp"));
|
||||
equip.setInt((short) rs.getInt("int"));
|
||||
equip.setJump((short) rs.getInt("jump"));
|
||||
equip.setVicious((short) rs.getInt("vicious"));
|
||||
equip.setFlag((short) rs.getInt("flag"));
|
||||
equip.setLuk((short) rs.getInt("luk"));
|
||||
equip.setMatk((short) rs.getInt("matk"));
|
||||
equip.setMdef((short) rs.getInt("mdef"));
|
||||
equip.setMp((short) rs.getInt("mp"));
|
||||
equip.setSpeed((short) rs.getInt("speed"));
|
||||
equip.setStr((short) rs.getInt("str"));
|
||||
equip.setWatk((short) rs.getInt("watk"));
|
||||
equip.setWdef((short) rs.getInt("wdef"));
|
||||
equip.setUpgradeSlots((byte) rs.getInt("upgradeslots"));
|
||||
equip.setLevel((byte) rs.getInt("level"));
|
||||
equip.setItemLevel(rs.getByte("itemlevel"));
|
||||
equip.setItemExp(rs.getInt("itemexp"));
|
||||
equip.setRingId(rs.getInt("ringid"));
|
||||
equip.setExpiration(rs.getLong("expiration"));
|
||||
equip.setGiftFrom(rs.getString("giftFrom"));
|
||||
|
||||
items.add(new MTSItemInfo(equip, rs.getInt("price") + 100 + (int) (rs.getInt("price") * 0.1), rs.getInt("id"), rs.getInt("seller"), rs.getString("sellername"), rs.getString("sell_ends")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try (PreparedStatement ps = con.prepareStatement("SELECT COUNT(*) FROM mts_items");
|
||||
ResultSet rs = ps.executeQuery()) {
|
||||
if (rs.next()) {
|
||||
pages = (int) Math.ceil(rs.getInt(1) / 16);
|
||||
}
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
c.sendPacket(PacketCreator.sendMTS(items, 1, 0, 0, pages));
|
||||
c.sendPacket(PacketCreator.transferInventory(getTransfer(chr.getId())));
|
||||
c.sendPacket(PacketCreator.notYetSoldInv(getNotYetSold(chr.getId())));
|
||||
}
|
||||
|
||||
private List<MTSItemInfo> getNotYetSold(int cid) {
|
||||
@@ -276,4 +271,4 @@ public final class EnterMTSHandler extends AbstractPacketHandler {
|
||||
}
|
||||
return items;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,11 @@ package net.server.channel.handlers;
|
||||
|
||||
import client.Character;
|
||||
import client.Client;
|
||||
import client.inventory.*;
|
||||
import client.inventory.Equip;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.ModifyInventory;
|
||||
import config.YamlConfig;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
|
||||
@@ -48,7 +48,6 @@ import java.sql.SQLException;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
public final class MTSHandler extends AbstractPacketHandler {
|
||||
|
||||
@@ -21,8 +21,11 @@
|
||||
*/
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import client.BuffStat;
|
||||
import client.Character;
|
||||
import client.*;
|
||||
import client.Client;
|
||||
import client.Skill;
|
||||
import client.SkillFactory;
|
||||
import config.YamlConfig;
|
||||
import constants.id.MapId;
|
||||
import constants.skills.Bishop;
|
||||
|
||||
@@ -27,7 +27,12 @@ import config.YamlConfig;
|
||||
import net.packet.InPacket;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import server.life.*;
|
||||
import server.life.MobSkill;
|
||||
import server.life.MobSkillFactory;
|
||||
import server.life.MobSkillId;
|
||||
import server.life.MobSkillType;
|
||||
import server.life.Monster;
|
||||
import server.life.MonsterInformationProvider;
|
||||
import server.maps.MapObject;
|
||||
import server.maps.MapObjectType;
|
||||
import server.maps.MapleMap;
|
||||
@@ -176,4 +181,4 @@ public final class MoveLifeHandler extends AbstractMovementPacketHandler {
|
||||
private static boolean inRangeInclusive(Byte pVal, Integer pMin, Integer pMax) {
|
||||
return !(pVal < pMin) || (pVal > pMax);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,8 +39,15 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import server.ItemInformationProvider;
|
||||
import server.Trade;
|
||||
import server.maps.*;
|
||||
import server.maps.FieldLimit;
|
||||
import server.maps.HiredMerchant;
|
||||
import server.maps.MapObject;
|
||||
import server.maps.MapObjectType;
|
||||
import server.maps.MiniGame;
|
||||
import server.maps.MiniGame.MiniGameType;
|
||||
import server.maps.PlayerShop;
|
||||
import server.maps.PlayerShopItem;
|
||||
import server.maps.Portal;
|
||||
import tools.PacketCreator;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
@@ -21,9 +21,21 @@
|
||||
*/
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import client.BuddyList;
|
||||
import client.BuddylistEntry;
|
||||
import client.Character;
|
||||
import client.*;
|
||||
import client.inventory.*;
|
||||
import client.CharacterNameAndId;
|
||||
import client.Client;
|
||||
import client.Disease;
|
||||
import client.Family;
|
||||
import client.FamilyEntry;
|
||||
import client.Mount;
|
||||
import client.SkillFactory;
|
||||
import client.inventory.Equip;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.Pet;
|
||||
import client.keybind.KeyBinding;
|
||||
import config.YamlConfig;
|
||||
import constants.game.GameConstants;
|
||||
@@ -56,8 +68,13 @@ import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public final class PlayerLoggedinHandler extends AbstractPacketHandler {
|
||||
|
||||
@@ -21,8 +21,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import client.BuffStat;
|
||||
import client.Character;
|
||||
import client.*;
|
||||
import client.Client;
|
||||
import client.Skill;
|
||||
import client.SkillFactory;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
@@ -32,7 +35,13 @@ import config.YamlConfig;
|
||||
import constants.id.ItemId;
|
||||
import constants.id.MapId;
|
||||
import constants.inventory.ItemConstants;
|
||||
import constants.skills.*;
|
||||
import constants.skills.Aran;
|
||||
import constants.skills.Buccaneer;
|
||||
import constants.skills.NightLord;
|
||||
import constants.skills.NightWalker;
|
||||
import constants.skills.Shadower;
|
||||
import constants.skills.ThunderBreaker;
|
||||
import constants.skills.WindArcher;
|
||||
import net.packet.InPacket;
|
||||
import net.packet.Packet;
|
||||
import org.slf4j.Logger;
|
||||
@@ -237,4 +246,4 @@ public final class RangedAttackHandler extends AbstractDealDamageHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,23 @@
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import client.Client;
|
||||
import constants.skills.*;
|
||||
import constants.skills.Bishop;
|
||||
import constants.skills.Bowmaster;
|
||||
import constants.skills.Brawler;
|
||||
import constants.skills.ChiefBandit;
|
||||
import constants.skills.Corsair;
|
||||
import constants.skills.DarkKnight;
|
||||
import constants.skills.Evan;
|
||||
import constants.skills.FPArchMage;
|
||||
import constants.skills.FPMage;
|
||||
import constants.skills.Gunslinger;
|
||||
import constants.skills.Hero;
|
||||
import constants.skills.ILArchMage;
|
||||
import constants.skills.Marksman;
|
||||
import constants.skills.NightWalker;
|
||||
import constants.skills.Paladin;
|
||||
import constants.skills.ThunderBreaker;
|
||||
import constants.skills.WindArcher;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
import org.slf4j.Logger;
|
||||
@@ -65,4 +81,4 @@ public final class SkillEffectHandler extends AbstractPacketHandler {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,13 @@ import client.Client;
|
||||
import client.Skill;
|
||||
import client.SkillFactory;
|
||||
import config.YamlConfig;
|
||||
import constants.skills.*;
|
||||
import constants.skills.Brawler;
|
||||
import constants.skills.Corsair;
|
||||
import constants.skills.DarkKnight;
|
||||
import constants.skills.Hero;
|
||||
import constants.skills.Paladin;
|
||||
import constants.skills.Priest;
|
||||
import constants.skills.SuperGM;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
import net.server.Server;
|
||||
@@ -153,4 +159,4 @@ public final class SpecialMoveHandler extends AbstractPacketHandler {
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,8 +21,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import client.BuffStat;
|
||||
import client.Character;
|
||||
import client.*;
|
||||
import client.Client;
|
||||
import client.Skill;
|
||||
import client.SkillFactory;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
@@ -39,7 +42,12 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import server.StatEffect;
|
||||
import server.life.LifeFactory.loseItem;
|
||||
import server.life.*;
|
||||
import server.life.MobAttackInfo;
|
||||
import server.life.MobAttackInfoFactory;
|
||||
import server.life.MobSkill;
|
||||
import server.life.MobSkillFactory;
|
||||
import server.life.MobSkillType;
|
||||
import server.life.Monster;
|
||||
import server.maps.MapObject;
|
||||
import server.maps.MapleMap;
|
||||
import tools.PacketCreator;
|
||||
|
||||
@@ -28,7 +28,11 @@ import net.packet.InPacket;
|
||||
import tools.DatabaseConnection;
|
||||
import tools.PacketCreator;
|
||||
|
||||
import java.sql.*;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Calendar;
|
||||
|
||||
import static java.util.concurrent.TimeUnit.DAYS;
|
||||
@@ -81,4 +85,4 @@ public final class TransferNameHandler extends AbstractPacketHandler {
|
||||
}
|
||||
c.sendPacket(PacketCreator.sendNameTransferRules(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,11 @@ import net.server.Server;
|
||||
import tools.DatabaseConnection;
|
||||
import tools.PacketCreator;
|
||||
|
||||
import java.sql.*;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
/**
|
||||
* @author Ronan
|
||||
@@ -76,4 +80,4 @@ public final class TransferWorldHandler extends AbstractPacketHandler {
|
||||
}
|
||||
c.sendPacket(PacketCreator.sendWorldTransferRules(0, c));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,10 +22,22 @@
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import client.Character;
|
||||
import client.*;
|
||||
import client.creator.veteran.*;
|
||||
import client.inventory.*;
|
||||
import client.Client;
|
||||
import client.Skill;
|
||||
import client.SkillFactory;
|
||||
import client.SkillMacro;
|
||||
import client.creator.veteran.BowmanCreator;
|
||||
import client.creator.veteran.MagicianCreator;
|
||||
import client.creator.veteran.PirateCreator;
|
||||
import client.creator.veteran.ThiefCreator;
|
||||
import client.creator.veteran.WarriorCreator;
|
||||
import client.inventory.Equip;
|
||||
import client.inventory.Equip.ScrollResult;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.ModifyInventory;
|
||||
import client.inventory.Pet;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import client.inventory.manipulator.KarmaManipulator;
|
||||
import client.processor.npc.DueyProcessor;
|
||||
@@ -46,7 +58,12 @@ import server.ItemInformationProvider;
|
||||
import server.Shop;
|
||||
import server.ShopFactory;
|
||||
import server.TimerManager;
|
||||
import server.maps.*;
|
||||
import server.maps.AbstractMapObject;
|
||||
import server.maps.FieldLimit;
|
||||
import server.maps.Kite;
|
||||
import server.maps.MapleMap;
|
||||
import server.maps.MapleTVEffect;
|
||||
import server.maps.PlayerShopItem;
|
||||
import service.NoteService;
|
||||
import tools.PacketCreator;
|
||||
import tools.Pair;
|
||||
|
||||
@@ -25,8 +25,12 @@ import net.server.Server;
|
||||
import net.server.coordinator.matchchecker.MatchCheckerListenerFactory.MatchCheckerType;
|
||||
import net.server.world.World;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.Semaphore;
|
||||
|
||||
/**
|
||||
|
||||
@@ -33,8 +33,14 @@ import provider.wz.WZFiles;
|
||||
import tools.PacketCreator;
|
||||
import tools.Pair;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReadWriteLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
|
||||
@@ -22,7 +22,11 @@ package net.server.coordinator.partysearch;
|
||||
import client.Character;
|
||||
import tools.IntervalBuilder;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReadWriteLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
|
||||
@@ -32,8 +32,14 @@ import tools.DatabaseConnection;
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.time.Instant;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@@ -4,7 +4,11 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import tools.DatabaseConnection;
|
||||
|
||||
import java.sql.*;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -27,8 +27,14 @@ import server.life.Monster;
|
||||
import server.maps.MapleMap;
|
||||
import tools.Pair;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
@@ -42,7 +42,13 @@ import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
|
||||
@@ -37,7 +37,13 @@ import java.io.UnsupportedEncodingException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.sql.*;
|
||||
import java.sql.Connection;
|
||||
import java.sql.Date;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Calendar;
|
||||
|
||||
public final class LoginPasswordHandler implements PacketHandler {
|
||||
|
||||
@@ -29,7 +29,11 @@ import net.packet.InPacket;
|
||||
import net.server.Server;
|
||||
import tools.PacketCreator;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.SortedMap;
|
||||
import java.util.TreeMap;
|
||||
|
||||
public final class ViewAllCharHandler extends AbstractPacketHandler {
|
||||
private static final int CHARACTER_LIMIT = 60; // Client will crash if sending 61 or more characters
|
||||
|
||||
@@ -24,7 +24,11 @@ import net.server.Server;
|
||||
import server.TimerManager;
|
||||
import tools.Pair;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
|
||||
@@ -22,7 +22,12 @@ package net.server.services.type;
|
||||
import net.server.services.BaseService;
|
||||
import net.server.services.Service;
|
||||
import net.server.services.ServiceType;
|
||||
import net.server.services.task.channel.*;
|
||||
import net.server.services.task.channel.EventService;
|
||||
import net.server.services.task.channel.MobAnimationService;
|
||||
import net.server.services.task.channel.MobClearSkillService;
|
||||
import net.server.services.task.channel.MobMistService;
|
||||
import net.server.services.task.channel.MobStatusService;
|
||||
import net.server.services.task.channel.OverallService;
|
||||
|
||||
/**
|
||||
* @author Ronan
|
||||
|
||||
@@ -32,7 +32,12 @@ import server.maps.MapleMap;
|
||||
import server.partyquest.MonsterCarnival;
|
||||
import tools.PacketCreator;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
@@ -46,21 +46,57 @@ import net.server.guild.GuildSummary;
|
||||
import net.server.services.BaseService;
|
||||
import net.server.services.ServicesManager;
|
||||
import net.server.services.type.WorldServices;
|
||||
import net.server.task.*;
|
||||
import net.server.task.CharacterAutosaverTask;
|
||||
import net.server.task.CharacterHpDecreaseTask;
|
||||
import net.server.task.FamilyDailyResetTask;
|
||||
import net.server.task.FishingTask;
|
||||
import net.server.task.HiredMerchantTask;
|
||||
import net.server.task.MapOwnershipTask;
|
||||
import net.server.task.MountTirednessTask;
|
||||
import net.server.task.PartySearchTask;
|
||||
import net.server.task.PetFullnessTask;
|
||||
import net.server.task.ServerMessageTask;
|
||||
import net.server.task.TimedMapObjectTask;
|
||||
import net.server.task.TimeoutTask;
|
||||
import net.server.task.WeddingReservationTask;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import scripting.event.EventInstanceManager;
|
||||
import server.Storage;
|
||||
import server.TimerManager;
|
||||
import server.maps.*;
|
||||
import server.maps.AbstractMapObject;
|
||||
import server.maps.HiredMerchant;
|
||||
import server.maps.MapleMap;
|
||||
import server.maps.MiniDungeon;
|
||||
import server.maps.MiniDungeonInfo;
|
||||
import server.maps.PlayerShop;
|
||||
import server.maps.PlayerShopItem;
|
||||
import tools.DatabaseConnection;
|
||||
import tools.PacketCreator;
|
||||
import tools.Pair;
|
||||
import tools.packets.Fishing;
|
||||
|
||||
import java.sql.*;
|
||||
import java.util.*;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.PriorityQueue;
|
||||
import java.util.Set;
|
||||
import java.util.SortedMap;
|
||||
import java.util.TreeMap;
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
@@ -69,7 +105,10 @@ import java.util.concurrent.locks.ReadWriteLock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
|
||||
import static java.util.concurrent.TimeUnit.*;
|
||||
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;
|
||||
|
||||
/**
|
||||
* @author kevintjuh93
|
||||
|
||||
@@ -21,7 +21,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package server;
|
||||
|
||||
import client.inventory.*;
|
||||
import client.inventory.Equip;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.ItemFactory;
|
||||
import client.inventory.Pet;
|
||||
import config.YamlConfig;
|
||||
import constants.id.ItemId;
|
||||
import constants.inventory.ItemConstants;
|
||||
@@ -32,13 +36,18 @@ import provider.DataProviderFactory;
|
||||
import provider.DataTool;
|
||||
import provider.wz.WZFiles;
|
||||
import tools.DatabaseConnection;
|
||||
import tools.PacketCreator;
|
||||
import tools.Pair;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
@@ -399,6 +408,17 @@ public class CashShop {
|
||||
}
|
||||
}
|
||||
|
||||
public int getItemsSize() {
|
||||
int size = 0;
|
||||
lock.lock();
|
||||
try {
|
||||
size = inventory.size();
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
public List<Integer> getWishList() {
|
||||
return wishList;
|
||||
}
|
||||
@@ -536,14 +556,14 @@ public class CashShop {
|
||||
Item css = getCashShopItemByItemid(ItemId.CASH_SHOP_SURPRISE);
|
||||
|
||||
if (css != null) {
|
||||
if (getItemsSize() >= 100) {
|
||||
return null;
|
||||
}
|
||||
|
||||
CashItem cItem = CashItemFactory.getRandomCashItem();
|
||||
|
||||
if (cItem != null) {
|
||||
if (css.getQuantity() > 1) {
|
||||
/* if(NOT ENOUGH SPACE) { looks like we're not dealing with cash inventory limit whatsoever, k then
|
||||
return null;
|
||||
} */
|
||||
|
||||
css.setQuantity((short) (css.getQuantity() - 1));
|
||||
} else {
|
||||
removeFromInventory(css);
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
package server;
|
||||
|
||||
import config.YamlConfig;
|
||||
import tools.DatabaseConnection;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
import java.sql.Timestamp;
|
||||
import static java.util.concurrent.TimeUnit.*;
|
||||
|
||||
import config.YamlConfig;
|
||||
import tools.DatabaseConnection;
|
||||
import static java.util.concurrent.TimeUnit.MINUTES;
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
|
||||
public class ExpLogger {
|
||||
private static final LinkedBlockingQueue<ExpLogRecord> expLoggerQueue = new LinkedBlockingQueue<>();
|
||||
|
||||
@@ -21,8 +21,13 @@
|
||||
*/
|
||||
package server;
|
||||
|
||||
import client.BuffStat;
|
||||
import client.Character;
|
||||
import client.*;
|
||||
import client.Disease;
|
||||
import client.Job;
|
||||
import client.Mount;
|
||||
import client.Skill;
|
||||
import client.SkillFactory;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
@@ -33,7 +38,57 @@ import config.YamlConfig;
|
||||
import constants.id.ItemId;
|
||||
import constants.id.MapId;
|
||||
import constants.inventory.ItemConstants;
|
||||
import constants.skills.*;
|
||||
import constants.skills.Aran;
|
||||
import constants.skills.Assassin;
|
||||
import constants.skills.Bandit;
|
||||
import constants.skills.Beginner;
|
||||
import constants.skills.Bishop;
|
||||
import constants.skills.BlazeWizard;
|
||||
import constants.skills.Bowmaster;
|
||||
import constants.skills.Brawler;
|
||||
import constants.skills.Buccaneer;
|
||||
import constants.skills.ChiefBandit;
|
||||
import constants.skills.Cleric;
|
||||
import constants.skills.Corsair;
|
||||
import constants.skills.Crossbowman;
|
||||
import constants.skills.Crusader;
|
||||
import constants.skills.DarkKnight;
|
||||
import constants.skills.DawnWarrior;
|
||||
import constants.skills.DragonKnight;
|
||||
import constants.skills.Evan;
|
||||
import constants.skills.FPArchMage;
|
||||
import constants.skills.FPMage;
|
||||
import constants.skills.FPWizard;
|
||||
import constants.skills.Fighter;
|
||||
import constants.skills.GM;
|
||||
import constants.skills.Gunslinger;
|
||||
import constants.skills.Hermit;
|
||||
import constants.skills.Hero;
|
||||
import constants.skills.Hunter;
|
||||
import constants.skills.ILArchMage;
|
||||
import constants.skills.ILMage;
|
||||
import constants.skills.ILWizard;
|
||||
import constants.skills.Legend;
|
||||
import constants.skills.Magician;
|
||||
import constants.skills.Marauder;
|
||||
import constants.skills.Marksman;
|
||||
import constants.skills.NightLord;
|
||||
import constants.skills.NightWalker;
|
||||
import constants.skills.Noblesse;
|
||||
import constants.skills.Outlaw;
|
||||
import constants.skills.Page;
|
||||
import constants.skills.Paladin;
|
||||
import constants.skills.Pirate;
|
||||
import constants.skills.Priest;
|
||||
import constants.skills.Ranger;
|
||||
import constants.skills.Rogue;
|
||||
import constants.skills.Shadower;
|
||||
import constants.skills.Sniper;
|
||||
import constants.skills.Spearman;
|
||||
import constants.skills.SuperGM;
|
||||
import constants.skills.ThunderBreaker;
|
||||
import constants.skills.WhiteKnight;
|
||||
import constants.skills.WindArcher;
|
||||
import net.packet.Packet;
|
||||
import net.server.Server;
|
||||
import net.server.world.Party;
|
||||
@@ -44,15 +99,27 @@ import server.life.MobSkill;
|
||||
import server.life.MobSkillFactory;
|
||||
import server.life.MobSkillType;
|
||||
import server.life.Monster;
|
||||
import server.maps.*;
|
||||
import server.maps.Door;
|
||||
import server.maps.FieldLimit;
|
||||
import server.maps.MapObject;
|
||||
import server.maps.MapObjectType;
|
||||
import server.maps.MapleMap;
|
||||
import server.maps.Mist;
|
||||
import server.maps.Portal;
|
||||
import server.maps.Summon;
|
||||
import server.maps.SummonMovementType;
|
||||
import server.partyquest.CarnivalFactory;
|
||||
import server.partyquest.CarnivalFactory.MCSkill;
|
||||
import tools.PacketCreator;
|
||||
import tools.Pair;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumMap;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Matze
|
||||
|
||||
@@ -38,7 +38,12 @@ import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
@@ -358,4 +363,4 @@ public class Storage {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,11 @@
|
||||
*/
|
||||
package server;
|
||||
|
||||
import java.util.concurrent.*;
|
||||
import java.util.concurrent.ArrayBlockingQueue;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.RejectedExecutionHandler;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
import static java.util.concurrent.TimeUnit.MINUTES;
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
|
||||
@@ -37,8 +37,14 @@ import server.maps.MapleMap;
|
||||
import tools.PacketCreator;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Properties;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
|
||||
@@ -23,7 +23,11 @@ import config.YamlConfig;
|
||||
import tools.DatabaseConnection;
|
||||
import tools.Pair;
|
||||
|
||||
import java.sql.*;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Calendar;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -33,8 +33,12 @@ import tools.Pair;
|
||||
import tools.StringUtil;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class LifeFactory {
|
||||
private static final Logger log = LoggerFactory.getLogger(LifeFactory.class);
|
||||
|
||||
@@ -38,8 +38,11 @@ import server.maps.Mist;
|
||||
import tools.Randomizer;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumMap;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Danny (Leifde)
|
||||
|
||||
@@ -28,8 +28,11 @@ import provider.DataTool;
|
||||
import provider.wz.WZFiles;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReadWriteLock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
|
||||
@@ -21,13 +21,26 @@
|
||||
*/
|
||||
package server.life;
|
||||
|
||||
import client.BuffStat;
|
||||
import client.Character;
|
||||
import client.*;
|
||||
import client.Client;
|
||||
import client.FamilyEntry;
|
||||
import client.Job;
|
||||
import client.Skill;
|
||||
import client.SkillFactory;
|
||||
import client.status.MonsterStatus;
|
||||
import client.status.MonsterStatusEffect;
|
||||
import config.YamlConfig;
|
||||
import constants.id.MobId;
|
||||
import constants.skills.*;
|
||||
import constants.skills.Crusader;
|
||||
import constants.skills.FPMage;
|
||||
import constants.skills.Hermit;
|
||||
import constants.skills.ILMage;
|
||||
import constants.skills.NightLord;
|
||||
import constants.skills.NightWalker;
|
||||
import constants.skills.Priest;
|
||||
import constants.skills.Shadower;
|
||||
import constants.skills.WhiteKnight;
|
||||
import net.packet.Packet;
|
||||
import net.server.channel.Channel;
|
||||
import net.server.coordinator.world.MonsterAggroCoordinator;
|
||||
@@ -56,9 +69,17 @@ import tools.Randomizer;
|
||||
|
||||
import java.awt.*;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
@@ -2177,4 +2198,4 @@ public class Monster extends AbstractLoadedLife {
|
||||
|
||||
this.getMap().dismissRemoveAfter(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,13 @@ import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class MonsterInformationProvider {
|
||||
private static final Logger log = LoggerFactory.getLogger(MonsterInformationProvider.class);
|
||||
|
||||
@@ -27,7 +27,13 @@ import server.life.LifeFactory.selfDestruction;
|
||||
import tools.Pair;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.*;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Frz
|
||||
|
||||
@@ -44,9 +44,19 @@ import tools.PacketCreator;
|
||||
import tools.Pair;
|
||||
|
||||
import java.awt.*;
|
||||
import java.sql.*;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,7 +22,11 @@
|
||||
package server.maps;
|
||||
|
||||
import io.netty.buffer.Unpooled;
|
||||
import net.packet.*;
|
||||
import net.packet.ByteBufInPacket;
|
||||
import net.packet.ByteBufOutPacket;
|
||||
import net.packet.InPacket;
|
||||
import net.packet.OutPacket;
|
||||
import net.packet.Packet;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
|
||||
@@ -45,7 +45,12 @@ import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
@@ -52,9 +52,21 @@ import scripting.map.MapScriptManager;
|
||||
import server.ItemInformationProvider;
|
||||
import server.StatEffect;
|
||||
import server.TimerManager;
|
||||
import server.events.gm.*;
|
||||
import server.life.*;
|
||||
import server.events.gm.Coconut;
|
||||
import server.events.gm.Fitness;
|
||||
import server.events.gm.Ola;
|
||||
import server.events.gm.OxQuiz;
|
||||
import server.events.gm.Snowball;
|
||||
import server.life.LifeFactory;
|
||||
import server.life.LifeFactory.selfDestruction;
|
||||
import server.life.Monster;
|
||||
import server.life.MonsterDropEntry;
|
||||
import server.life.MonsterGlobalDropEntry;
|
||||
import server.life.MonsterInformationProvider;
|
||||
import server.life.MonsterListener;
|
||||
import server.life.NPC;
|
||||
import server.life.PlayerNPC;
|
||||
import server.life.SpawnPoint;
|
||||
import server.partyquest.CarnivalFactory;
|
||||
import server.partyquest.CarnivalFactory.MCSkill;
|
||||
import server.partyquest.GuardianSpawnPoint;
|
||||
@@ -64,9 +76,22 @@ import tools.Randomizer;
|
||||
|
||||
import java.awt.*;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
|
||||
@@ -25,7 +25,11 @@ import client.Character;
|
||||
import client.Client;
|
||||
import client.Skill;
|
||||
import client.SkillFactory;
|
||||
import constants.skills.*;
|
||||
import constants.skills.BlazeWizard;
|
||||
import constants.skills.Evan;
|
||||
import constants.skills.FPMage;
|
||||
import constants.skills.NightWalker;
|
||||
import constants.skills.Shadower;
|
||||
import net.packet.Packet;
|
||||
import server.StatEffect;
|
||||
import server.life.MobSkill;
|
||||
|
||||
@@ -33,7 +33,12 @@ import server.Trade;
|
||||
import tools.PacketCreator;
|
||||
import tools.Pair;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
@@ -617,4 +622,4 @@ public class PlayerShop extends AbstractMapObject {
|
||||
return mesos;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,13 +32,52 @@ import provider.DataProvider;
|
||||
import provider.DataProviderFactory;
|
||||
import provider.DataTool;
|
||||
import provider.wz.WZFiles;
|
||||
import server.quest.actions.*;
|
||||
import server.quest.requirements.*;
|
||||
import server.quest.actions.AbstractQuestAction;
|
||||
import server.quest.actions.BuffAction;
|
||||
import server.quest.actions.ExpAction;
|
||||
import server.quest.actions.FameAction;
|
||||
import server.quest.actions.InfoAction;
|
||||
import server.quest.actions.ItemAction;
|
||||
import server.quest.actions.MesoAction;
|
||||
import server.quest.actions.NextQuestAction;
|
||||
import server.quest.actions.PetSkillAction;
|
||||
import server.quest.actions.PetSpeedAction;
|
||||
import server.quest.actions.PetTamenessAction;
|
||||
import server.quest.actions.QuestAction;
|
||||
import server.quest.actions.SkillAction;
|
||||
import server.quest.requirements.AbstractQuestRequirement;
|
||||
import server.quest.requirements.BuffExceptRequirement;
|
||||
import server.quest.requirements.BuffRequirement;
|
||||
import server.quest.requirements.CompletedQuestRequirement;
|
||||
import server.quest.requirements.EndDateRequirement;
|
||||
import server.quest.requirements.FieldEnterRequirement;
|
||||
import server.quest.requirements.InfoExRequirement;
|
||||
import server.quest.requirements.InfoNumberRequirement;
|
||||
import server.quest.requirements.IntervalRequirement;
|
||||
import server.quest.requirements.ItemRequirement;
|
||||
import server.quest.requirements.JobRequirement;
|
||||
import server.quest.requirements.MaxLevelRequirement;
|
||||
import server.quest.requirements.MesoRequirement;
|
||||
import server.quest.requirements.MinLevelRequirement;
|
||||
import server.quest.requirements.MinTamenessRequirement;
|
||||
import server.quest.requirements.MobRequirement;
|
||||
import server.quest.requirements.MonsterBookCountRequirement;
|
||||
import server.quest.requirements.NpcRequirement;
|
||||
import server.quest.requirements.PetRequirement;
|
||||
import server.quest.requirements.QuestRequirement;
|
||||
import server.quest.requirements.ScriptRequirement;
|
||||
import tools.PacketCreator;
|
||||
import tools.StringUtil;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.Collection;
|
||||
import java.util.EnumMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import static java.util.concurrent.TimeUnit.HOURS;
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
|
||||
@@ -20,11 +20,29 @@
|
||||
*/
|
||||
package tools;
|
||||
|
||||
import client.BuddylistEntry;
|
||||
import client.BuffStat;
|
||||
import client.Character;
|
||||
import client.*;
|
||||
import client.Character.SkillEntry;
|
||||
import client.inventory.*;
|
||||
import client.Client;
|
||||
import client.Disease;
|
||||
import client.FamilyEntitlement;
|
||||
import client.FamilyEntry;
|
||||
import client.MonsterBook;
|
||||
import client.Mount;
|
||||
import client.QuestStatus;
|
||||
import client.Ring;
|
||||
import client.Skill;
|
||||
import client.SkillMacro;
|
||||
import client.Stat;
|
||||
import client.inventory.Equip;
|
||||
import client.inventory.Equip.ScrollResult;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.ItemFactory;
|
||||
import client.inventory.ModifyInventory;
|
||||
import client.inventory.Pet;
|
||||
import client.keybind.KeyBinding;
|
||||
import client.keybind.QuickslotBinding;
|
||||
import client.newyear.NewYearCardRecord;
|
||||
@@ -62,19 +80,45 @@ import net.server.world.World;
|
||||
import server.CashShop.CashItem;
|
||||
import server.CashShop.CashItemFactory;
|
||||
import server.CashShop.SpecialCashItem;
|
||||
import server.*;
|
||||
import server.DueyPackage;
|
||||
import server.ItemInformationProvider;
|
||||
import server.MTSItemInfo;
|
||||
import server.ShopItem;
|
||||
import server.Trade;
|
||||
import server.events.gm.Snowball;
|
||||
import server.life.*;
|
||||
import server.maps.*;
|
||||
import server.life.MobSkill;
|
||||
import server.life.MobSkillId;
|
||||
import server.life.Monster;
|
||||
import server.life.NPC;
|
||||
import server.life.PlayerNPC;
|
||||
import server.maps.AbstractMapObject;
|
||||
import server.maps.Door;
|
||||
import server.maps.DoorObject;
|
||||
import server.maps.Dragon;
|
||||
import server.maps.HiredMerchant;
|
||||
import server.maps.MapItem;
|
||||
import server.maps.MapleMap;
|
||||
import server.maps.MiniGame;
|
||||
import server.maps.MiniGame.MiniGameResult;
|
||||
import server.maps.Mist;
|
||||
import server.maps.PlayerShop;
|
||||
import server.maps.PlayerShopItem;
|
||||
import server.maps.Reactor;
|
||||
import server.maps.Summon;
|
||||
import server.movement.LifeMovementFragment;
|
||||
|
||||
import java.awt.*;
|
||||
import java.net.InetAddress;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.TimeZone;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -6136,23 +6180,6 @@ public class PacketCreator {
|
||||
return showSpecialEffect(15);
|
||||
}
|
||||
|
||||
public static Packet showBuybackEffect() {
|
||||
final OutPacket p = OutPacket.create(SendOpcode.SHOW_ITEM_GAIN_INCHAT);
|
||||
p.writeByte(11);
|
||||
p.writeInt(0);
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
public static Packet showForeignBuybackEffect(int cid) {
|
||||
final OutPacket p = OutPacket.create(SendOpcode.SHOW_FOREIGN_EFFECT);
|
||||
p.writeInt(cid);
|
||||
p.writeByte(11);
|
||||
p.writeInt(0);
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
/**
|
||||
* 0 = Levelup 6 = Exp did not drop (Safety Charms) 7 = Enter portal sound
|
||||
* 8 = Job change 9 = Quest complete 10 = Recovery 11 = Buff effect
|
||||
|
||||
@@ -2,7 +2,10 @@ package tools.mapletools;
|
||||
|
||||
import provider.wz.WZFiles;
|
||||
|
||||
import java.io.*;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.nio.file.DirectoryStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
@@ -3,11 +3,23 @@ package tools.mapletools;
|
||||
import provider.wz.WZFiles;
|
||||
import tools.Pair;
|
||||
|
||||
import java.io.*;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author RonanLana
|
||||
|
||||
@@ -8,7 +8,11 @@ import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author RonanLana
|
||||
|
||||
@@ -3,7 +3,9 @@ package tools.mapletools;
|
||||
import provider.wz.WZFiles;
|
||||
import tools.Pair;
|
||||
|
||||
import java.io.*;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.nio.file.DirectoryStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
@@ -11,7 +13,11 @@ import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author RonanLana
|
||||
|
||||
@@ -2,7 +2,12 @@ package tools.mapletools;
|
||||
|
||||
import provider.wz.WZFiles;
|
||||
|
||||
import java.io.*;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
@@ -2,10 +2,15 @@ package tools.mapletools;
|
||||
|
||||
import tools.Pair;
|
||||
|
||||
import java.io.*;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.sql.*;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
@@ -2,7 +2,9 @@ package tools.mapletools;
|
||||
|
||||
import provider.wz.WZFiles;
|
||||
|
||||
import java.io.*;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.sql.Connection;
|
||||
|
||||
@@ -2,11 +2,23 @@ package tools.mapletools;
|
||||
|
||||
import provider.wz.WZFiles;
|
||||
|
||||
import java.io.*;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.Stack;
|
||||
|
||||
/**
|
||||
* @author RonanLana
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user