Mob banish on touch + GMS-like cosmetics + Clear missing names
Fixed erroneous clean slate scroll block on equipments having certain properties. Implemented a log for bought cash items from Cash Shop. Implemented mob's player banish by touch (e. g. used by mobs from the Hypnotize quest). Thoroughly revised stylist/surgeon NPCs, adding several missing GMS-like cosmetic contents. Thoroughly revised String.wz names having missing item content throughout the WZ files. Revised missing name info for several faces throughout the WZ files. Solved a possible deadlock case related with a player vision's spawn object method. Fixed an issue with "Movement allowed only within account" items being given as "Untradeable" by NPCs. Happy Holidays and Great New Year everyone!!!
This commit is contained in:
@@ -97,7 +97,7 @@ public enum MapleBuffStat {
|
||||
PICKPOCKET(0x800000000000000L),
|
||||
PUPPET(0x800000000000000L),
|
||||
MESOGUARD(0x1000000000000000L),
|
||||
//0x2000000000000000L
|
||||
EXP_INCREASE(0x2000000000000000L),
|
||||
WEAKEN(0x4000000000000000L),
|
||||
//THAT GAP
|
||||
|
||||
|
||||
@@ -1243,9 +1243,11 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
int banSp = this.getMap().findClosestPlayerSpawnpoint(this.getPosition()).getId();
|
||||
long banTime = System.currentTimeMillis();
|
||||
|
||||
dropMessage(5, msg);
|
||||
if (msg != null) dropMessage(5, msg);
|
||||
|
||||
MapleMap map_ = getWarpMap(mapid);
|
||||
changeMap(map_, map_.getPortal(portal));
|
||||
MaplePortal portal_ = map_.getPortal(portal);
|
||||
changeMap(map_, portal_ != null ? portal_ : map_.getRandomPlayerSpawnpoint());
|
||||
|
||||
setBanishPlayerData(banMap, banSp, banTime);
|
||||
}
|
||||
@@ -2123,7 +2125,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
try (PreparedStatement ps2 = con.prepareStatement("DELETE FROM inventoryequipment WHERE inventoryitemid = ?")) {
|
||||
ps2.setInt(1, inventoryitemid);
|
||||
ps2.executeUpdate();
|
||||
@@ -2897,7 +2899,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
gainExpInternal(-loss, 0, 0, show, inChat, white);
|
||||
}
|
||||
|
||||
private void gainExpInternal(long gain, int equip, int party, boolean show, boolean inChat, boolean white) {
|
||||
private synchronized void gainExpInternal(long gain, int equip, int party, boolean show, boolean inChat, boolean white) { // need of method synchonization here detected thanks to MedicOP
|
||||
long total = Math.max(gain, -exp.get());
|
||||
|
||||
if (level < getMaxLevel()) {
|
||||
@@ -5161,7 +5163,7 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
return rankMove;
|
||||
}
|
||||
|
||||
private void clearSavedLocation(SavedLocationType type) {
|
||||
public void clearSavedLocation(SavedLocationType type) {
|
||||
savedLocations[type.ordinal()] = null;
|
||||
}
|
||||
|
||||
@@ -7441,6 +7443,17 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}
|
||||
}
|
||||
|
||||
public void saveLocationOnWarp() { // suggestion to remember the map before warp command thanks to Lei
|
||||
MaplePortal closest = map.findClosestPortal(getPosition());
|
||||
int curMapid = getMapId();
|
||||
|
||||
for (int i = 0; i < savedLocations.length; i++) {
|
||||
if (savedLocations[i] == null) {
|
||||
savedLocations[i] = new SavedLocation(curMapid, closest != null ? closest.getId() : 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void saveLocation(String type) {
|
||||
MaplePortal closest = map.findClosestPortal(getPosition());
|
||||
savedLocations[SavedLocationType.fromString(type).ordinal()] = new SavedLocation(getMapId(), closest != null ? closest.getId() : 0);
|
||||
@@ -8612,8 +8625,8 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
}
|
||||
|
||||
/*
|
||||
for (Entry<StatUpgrade, Float> e : statups.entrySet()) {
|
||||
System.out.println(e);
|
||||
for (Entry<StatUpgrade, Float> es : statups.entrySet()) {
|
||||
System.out.println(es);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
@@ -216,6 +216,7 @@ public class CommandsExecutor {
|
||||
addCommand("dc", 2, DcCommand.class);
|
||||
addCommand("cleardrops", 2, ClearDropsCommand.class);
|
||||
addCommand("clearslot", 2, ClearSlotCommand.class);
|
||||
addCommand("clearsavelocs", 2, ClearSavedLocationsCommand.class);
|
||||
addCommand("warp", 2, WarpCommand.class);
|
||||
addCommand(new String[]{"warphere", "summon"}, 2, SummonCommand.class);
|
||||
addCommand(new String[]{"warpto", "reach", "follow"}, 2, ReachCommand.class);
|
||||
@@ -229,7 +230,6 @@ public class CommandsExecutor {
|
||||
addCommand("maxstat", 2, MaxStatCommand.class);
|
||||
addCommand("maxskill", 2, MaxSkillCommand.class);
|
||||
addCommand("resetskill", 2, ResetSkillCommand.class);
|
||||
addCommand("mesos", 2, MesosCommand.class);
|
||||
addCommand("search", 2, SearchCommand.class);
|
||||
addCommand("jail", 2, JailCommand.class);
|
||||
addCommand("unjail", 2, UnJailCommand.class);
|
||||
|
||||
@@ -49,6 +49,7 @@ public class JoinEventCommand extends Command {
|
||||
|
||||
event.minusLimit();
|
||||
|
||||
player.saveLocationOnWarp();
|
||||
player.changeMap(event.getMapId());
|
||||
} else {
|
||||
player.dropMessage(5, "The limit of players for the event has already been reached.");
|
||||
|
||||
@@ -46,6 +46,7 @@ public class LeaveEventCommand extends Command {
|
||||
player.setFitness(null);
|
||||
}
|
||||
|
||||
player.saveLocationOnWarp();
|
||||
player.changeMap(returnMap);
|
||||
if(c.getChannelServer().getEvent() != null) {
|
||||
c.getChannelServer().getEvent().addLimit();
|
||||
|
||||
@@ -51,6 +51,7 @@ public class GotoCommand extends Command {
|
||||
|
||||
// expedition issue with this command detected thanks to Masterrulax
|
||||
MaplePortal targetPortal = target.getRandomPlayerSpawnpoint();
|
||||
player.saveLocationOnWarp();
|
||||
player.changeMap(target, targetPortal);
|
||||
} else {
|
||||
player.dropMessage(5, "Area '" + params[0] + "' is not registered.");
|
||||
|
||||
@@ -26,17 +26,31 @@ package client.command.commands.gm2;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import server.maps.SavedLocationType;
|
||||
|
||||
public class MesosCommand extends Command {
|
||||
public class ClearSavedLocationsCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length >= 1) {
|
||||
player.gainMeso(Integer.parseInt(params[0]), true);
|
||||
MapleCharacter player = c.getPlayer(), victim;
|
||||
|
||||
if (params.length > 0) {
|
||||
victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
|
||||
if (victim == null) {
|
||||
player.message("Player '" + params[0] + "' could not be found on this channel.");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
victim = c.getPlayer();
|
||||
}
|
||||
|
||||
for (SavedLocationType type : SavedLocationType.values()) {
|
||||
victim.clearSavedLocation(type);
|
||||
}
|
||||
|
||||
player.message("Cleared " + params[0] + "'s saved locations.");
|
||||
}
|
||||
}
|
||||
@@ -60,6 +60,7 @@ public class JailCommand extends Command {
|
||||
if (victim.getMapId() != mapid) { // those gone to jail won't be changing map anyway
|
||||
MapleMap target = c.getChannelServer().getMapFactory().getMap(mapid);
|
||||
MaplePortal targetPortal = target.getPortal(0);
|
||||
victim.saveLocationOnWarp();
|
||||
victim.changeMap(target, targetPortal);
|
||||
player.message(victim.getName() + " was jailed for " + minutesJailed + " minutes.");
|
||||
} else {
|
||||
|
||||
@@ -47,6 +47,7 @@ public class ReachCommand extends Command {
|
||||
player.dropMessage(5, "Player '" + victim.getName() + "' is at channel " + victim.getClient().getChannel() + ".");
|
||||
} else {
|
||||
MapleMap map = victim.getMap();
|
||||
player.saveLocationOnWarp();
|
||||
player.forceChangeMap(map, map.findClosestPortal(victim.getPosition()));
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
*/
|
||||
package client.command.commands.gm2;
|
||||
|
||||
import client.MapleStat;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
@@ -45,7 +44,7 @@ public class SetStatCommand extends Command {
|
||||
int x = Integer.parseInt(params[0]);
|
||||
|
||||
if (x > Short.MAX_VALUE) x = Short.MAX_VALUE;
|
||||
else if (x < 0) x = 0;
|
||||
else if (x < 4) x = 4; // thanks Vcoc for pointing the minimal allowed stat value here
|
||||
|
||||
player.updateStrDexIntLuk(x);
|
||||
} catch (NumberFormatException nfe) {}
|
||||
|
||||
@@ -68,11 +68,13 @@ public class SummonCommand extends Command {
|
||||
if (player.getEventInstance() != null && changingEvent) {
|
||||
if (player.getClient().getChannel() == victim.getClient().getChannel()) {
|
||||
player.getEventInstance().registerPlayer(victim);
|
||||
victim.saveLocationOnWarp();
|
||||
victim.changeMap(player.getEventInstance().getMapInstance(player.getMapId()), player.getMap().findClosestPortal(player.getPosition()));
|
||||
} else {
|
||||
player.dropMessage("Target isn't on your channel, not able to warp into event instance.");
|
||||
}
|
||||
} else {//If victim isn't in an event instance or is in the same event instance as the one the caller is, just warp them.
|
||||
victim.saveLocationOnWarp();
|
||||
victim.changeMap(player.getMapId(), player.getMap().findClosestPortal(player.getPosition()));
|
||||
}
|
||||
if (player.getClient().getChannel() != victim.getClient().getChannel()) {//And then change channel if needed.
|
||||
|
||||
@@ -49,6 +49,7 @@ public class WarpCommand extends Command {
|
||||
}
|
||||
|
||||
// expedition issue with this command detected thanks to Masterrulax
|
||||
player.saveLocationOnWarp();
|
||||
player.changeMap(target, target.getRandomPlayerSpawnpoint());
|
||||
} catch (Exception ex) {
|
||||
player.yellowMessage("Map ID " + params[0] + " is invalid.");
|
||||
|
||||
@@ -41,6 +41,7 @@ public class ReloadMapCommand extends Command {
|
||||
int callerid = c.getPlayer().getId();
|
||||
|
||||
for (MapleCharacter chr : oldMap.getCharacters()) {
|
||||
chr.saveLocationOnWarp();
|
||||
chr.changeMap(newMap);
|
||||
if (chr.getId() != callerid)
|
||||
chr.dropMessage("You have been relocated due to map reloading. Sorry for the inconvenience.");
|
||||
|
||||
@@ -40,6 +40,7 @@ public class WarpSnowBallCommand extends Command {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
List<MapleCharacter> chars = new ArrayList<>(player.getMap().getCharacters());
|
||||
for (MapleCharacter chr : chars) {
|
||||
chr.saveLocationOnWarp();
|
||||
chr.changeMap(109060000, chr.getTeam());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,6 +216,7 @@ public final class PacketProcessor {
|
||||
registerHandler(RecvOpcode.TOUCH_MONSTER_ATTACK, new TouchMonsterDamageHandler());
|
||||
registerHandler(RecvOpcode.TROCK_ADD_MAP, new TrockAddMapHandler());
|
||||
registerHandler(RecvOpcode.HIRED_MERCHANT_REQUEST, new HiredMerchantRequest());
|
||||
registerHandler(RecvOpcode.MOB_BANISH_PLAYER, new MobBanishPlayerHandler());
|
||||
registerHandler(RecvOpcode.MOB_DAMAGE_MOB, new MobDamageMobHandler());
|
||||
registerHandler(RecvOpcode.REPORT, new ReportHandler());
|
||||
registerHandler(RecvOpcode.MONSTER_BOOK_COVER, new MonsterBookCoverHandler());
|
||||
|
||||
@@ -69,6 +69,7 @@ public enum RecvOpcode {
|
||||
FACE_EXPRESSION(0x33),
|
||||
USE_ITEMEFFECT(0x34),
|
||||
USE_DEATHITEM(0x35),
|
||||
MOB_BANISH_PLAYER(0x38),
|
||||
MONSTER_BOOK_COVER(0x39),
|
||||
NPC_TALK(0x3A),
|
||||
REMOTE_STORE(0x3B),
|
||||
|
||||
@@ -39,6 +39,7 @@ import server.CashShop.CashItem;
|
||||
import server.CashShop.CashItemFactory;
|
||||
import client.inventory.manipulator.MapleInventoryManipulator;
|
||||
import constants.ServerConstants;
|
||||
import server.MapleItemInformationProvider;
|
||||
import tools.FilePrinter;
|
||||
import tools.MaplePacketCreator;
|
||||
import tools.Pair;
|
||||
@@ -62,7 +63,7 @@ public final class CashOperationHandler extends AbstractMaplePacketHandler {
|
||||
final int useNX = slea.readInt();
|
||||
final int snCS = slea.readInt();
|
||||
CashItem cItem = CashItemFactory.getItem(snCS);
|
||||
if (!canBuy(cItem, cs.getCash(useNX))) {
|
||||
if (!canBuy(chr, cItem, cs.getCash(useNX))) {
|
||||
FilePrinter.printError(FilePrinter.ITEM, "Denied to sell cash item with SN " + snCS); // preventing NPE here thanks to MedicOP
|
||||
c.enableCSActions();
|
||||
return;
|
||||
@@ -98,7 +99,7 @@ public final class CashOperationHandler extends AbstractMaplePacketHandler {
|
||||
CashItem cItem = CashItemFactory.getItem(slea.readInt());
|
||||
Map<String, String> recipient = MapleCharacter.getCharacterFromDatabase(slea.readMapleAsciiString());
|
||||
String message = slea.readMapleAsciiString();
|
||||
if (!canBuy(cItem, cs.getCash(4)) || message.length() < 1 || message.length() > 73) {
|
||||
if (!canBuy(chr, cItem, cs.getCash(4)) || message.length() < 1 || message.length() > 73) {
|
||||
c.enableCSActions();
|
||||
return;
|
||||
}
|
||||
@@ -151,7 +152,7 @@ public final class CashOperationHandler extends AbstractMaplePacketHandler {
|
||||
} else {
|
||||
CashItem cItem = CashItemFactory.getItem(slea.readInt());
|
||||
int type = (cItem.getItemId() - 9110000) / 1000;
|
||||
if (!canBuy(cItem, cs.getCash(cash))) {
|
||||
if (!canBuy(chr, cItem, cs.getCash(cash))) {
|
||||
c.enableCSActions();
|
||||
return;
|
||||
}
|
||||
@@ -181,7 +182,7 @@ public final class CashOperationHandler extends AbstractMaplePacketHandler {
|
||||
} else {
|
||||
CashItem cItem = CashItemFactory.getItem(slea.readInt());
|
||||
|
||||
if (!canBuy(cItem, cs.getCash(cash))) {
|
||||
if (!canBuy(chr, cItem, cs.getCash(cash))) {
|
||||
c.enableCSActions();
|
||||
return;
|
||||
}
|
||||
@@ -199,7 +200,7 @@ public final class CashOperationHandler extends AbstractMaplePacketHandler {
|
||||
int cash = slea.readInt();
|
||||
CashItem cItem = CashItemFactory.getItem(slea.readInt());
|
||||
|
||||
if (!canBuy(cItem, cs.getCash(cash))) {
|
||||
if (!canBuy(chr, cItem, cs.getCash(cash))) {
|
||||
c.enableCSActions();
|
||||
return;
|
||||
}
|
||||
@@ -380,7 +381,12 @@ public final class CashOperationHandler extends AbstractMaplePacketHandler {
|
||||
return c.checkBirthDate(cal);
|
||||
}
|
||||
|
||||
private static boolean canBuy(CashItem item, int cash) {
|
||||
return item != null && item.isOnSale() && item.getPrice() <= cash;
|
||||
private static boolean canBuy(MapleCharacter chr, CashItem item, int cash) {
|
||||
if (item != null && item.isOnSale() && item.getPrice() <= cash) {
|
||||
FilePrinter.print(FilePrinter.CASHITEM_BOUGHT, chr + " bought " + MapleItemInformationProvider.getInstance().getName(item.getItemId()) + " (SN " + item.getSN() + ") for " + item.getPrice());
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,10 @@ public final class ItemRewardHandler extends AbstractMaplePacketHandler {
|
||||
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
|
||||
byte slot = (byte) slea.readShort();
|
||||
int itemId = slea.readInt(); // will load from xml I don't care.
|
||||
if (c.getPlayer().getInventory(MapleInventoryType.USE).getItem(slot).getItemId() != itemId || c.getPlayer().getInventory(MapleInventoryType.USE).countById(itemId) < 1) return;
|
||||
|
||||
Item it = c.getPlayer().getInventory(MapleInventoryType.USE).getItem(slot); // null check here thanks to Thora
|
||||
if (it == null || it.getItemId() != itemId || c.getPlayer().getInventory(MapleInventoryType.USE).countById(itemId) < 1) return;
|
||||
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
Pair<Integer, List<RewardItem>> rewards = ii.getItemReward(itemId);
|
||||
for (RewardItem reward : rewards.getRight()) {
|
||||
|
||||
45
src/net/server/channel/handlers/MobBanishPlayerHandler.java
Normal file
45
src/net/server/channel/handlers/MobBanishPlayerHandler.java
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
This file is part of the HeavenMS MapleStory Server
|
||||
Copyleft (L) 2016 - 2018 RonanLana
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation version 3 as published by
|
||||
the Free Software Foundation. You may not use, modify or distribute
|
||||
this program under any other version of the GNU Affero General Public
|
||||
License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import server.life.MapleMonster;
|
||||
import server.life.MapleLifeFactory.BanishInfo;
|
||||
import net.AbstractMaplePacketHandler;
|
||||
import tools.data.input.SeekableLittleEndianAccessor;
|
||||
|
||||
public final class MobBanishPlayerHandler extends AbstractMaplePacketHandler {
|
||||
|
||||
@Override
|
||||
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
|
||||
int mobid = slea.readInt(); // mob banish handling detected thanks to MedicOP
|
||||
|
||||
MapleCharacter chr = c.getPlayer();
|
||||
MapleMonster mob = chr.getMap().getMonsterById(mobid);
|
||||
|
||||
if (mob != null) {
|
||||
BanishInfo banishInfo = mob.getBanish();
|
||||
if (banishInfo != null) {
|
||||
chr.changeMapBanish(banishInfo.getMap(), banishInfo.getPortal(), banishInfo.getMsg());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1333,7 +1333,7 @@ public class World {
|
||||
activePetsLock.lock();
|
||||
try {
|
||||
petUpdate = Server.getInstance().getCurrentTime();
|
||||
deployedPets = Collections.unmodifiableMap(activePets);
|
||||
deployedPets = new HashMap<>(activePets); // exception here found thanks to MedicOP
|
||||
} finally {
|
||||
activePetsLock.unlock();
|
||||
}
|
||||
@@ -1391,7 +1391,7 @@ public class World {
|
||||
activeMountsLock.lock();
|
||||
try {
|
||||
mountUpdate = Server.getInstance().getCurrentTime();
|
||||
deployedMounts = Collections.unmodifiableMap(activeMounts);
|
||||
deployedMounts = new HashMap<>(activeMounts);
|
||||
} finally {
|
||||
activeMountsLock.unlock();
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class XMLWZFile implements MapleDataProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public MapleData getData(String path) {
|
||||
public synchronized MapleData getData(String path) {
|
||||
File dataFile = new File(root, path + ".xml");
|
||||
File imageDataDir = new File(root, path);
|
||||
if (!dataFile.exists()) {
|
||||
|
||||
@@ -531,6 +531,35 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean itemExists(int itemid) {
|
||||
return MapleItemInformationProvider.getInstance().getName(itemid) != null;
|
||||
}
|
||||
|
||||
public int getCosmeticItem(int itemid) {
|
||||
if (itemExists(itemid)) return itemid;
|
||||
|
||||
int baseid;
|
||||
if (itemid < 30000) {
|
||||
baseid = (itemid / 1000) * 1000 + (itemid % 100);
|
||||
} else {
|
||||
baseid = (itemid / 10) * 10;
|
||||
}
|
||||
|
||||
return itemid != baseid && itemExists(baseid) ? baseid : -1;
|
||||
}
|
||||
|
||||
private int getEquippedItemid(int itemid) {
|
||||
if (itemid < 30000) {
|
||||
return getPlayer().getFace();
|
||||
} else {
|
||||
return getPlayer().getHair();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isCosmeticEquipped(int itemid) {
|
||||
return getEquippedItemid(itemid) == itemid;
|
||||
}
|
||||
|
||||
public boolean isUsingOldPqNpcStyle() {
|
||||
return ServerConstants.USE_OLD_GMS_STYLED_PQ_NPCS && this.getPlayer().getParty() != null;
|
||||
}
|
||||
|
||||
@@ -110,7 +110,8 @@ public class MapleItemInformationProvider {
|
||||
protected Map<Integer, Boolean> pickupRestrictionCache = new HashMap<>();
|
||||
protected Map<Integer, Integer> getMesoCache = new HashMap<>();
|
||||
protected Map<Integer, Integer> monsterBookID = new HashMap<>();
|
||||
protected Map<Integer, Boolean> onEquipUntradableCache = new HashMap<>();
|
||||
protected Map<Integer, Boolean> untradeableCache = new HashMap<>();
|
||||
protected Map<Integer, Boolean> onEquipUntradeableCache = new HashMap<>();
|
||||
protected Map<Integer, scriptedItem> scriptedItemCache = new HashMap<>();
|
||||
protected Map<Integer, Boolean> karmaCache = new HashMap<>();
|
||||
protected Map<Integer, Integer> triggerItemCache = new HashMap<>();
|
||||
@@ -942,7 +943,7 @@ public class MapleItemInformationProvider {
|
||||
|
||||
public boolean canUseCleanSlate(Equip nEquip) {
|
||||
Map<String, Integer> eqstats = this.getEquipStats(nEquip.getItemId());
|
||||
return ServerConstants.USE_ENHANCED_CLNSLATE || nEquip.getLevel() + nEquip.getUpgradeSlots() < eqstats.get("tuc");
|
||||
return ServerConstants.USE_ENHANCED_CLNSLATE || nEquip.getUpgradeSlots() < eqstats.get("tuc"); // issue with clean slate found thanks to Masterrulax
|
||||
}
|
||||
|
||||
public Item scrollEquipWithId(Item equip, int scrollId, boolean usingWhiteScroll, int vegaItemId, boolean isGM) {
|
||||
@@ -1102,7 +1103,7 @@ public class MapleItemInformationProvider {
|
||||
nEquip.setMp((short) stat.getValue().intValue());
|
||||
} else if (stat.getKey().equals("tuc")) {
|
||||
nEquip.setUpgradeSlots((byte) stat.getValue().intValue());
|
||||
} else if (isDropRestricted(equipId)) {
|
||||
} else if (isUntradeableRestricted(equipId)) { // thanks Hyun & Thora for showing an issue with more than only "Untradeable" items being flagged as such here
|
||||
byte flag = nEquip.getFlag();
|
||||
flag |= ItemConstants.UNTRADEABLE;
|
||||
nEquip.setFlag(flag);
|
||||
@@ -1230,6 +1231,23 @@ public class MapleItemInformationProvider {
|
||||
return ret;
|
||||
}
|
||||
|
||||
public boolean isUntradeableRestricted(int itemId) {
|
||||
if (untradeableCache.containsKey(itemId)) {
|
||||
return untradeableCache.get(itemId);
|
||||
}
|
||||
|
||||
boolean bRestricted = false;
|
||||
if(itemId != 0) {
|
||||
MapleData data = getItemData(itemId);
|
||||
if (data != null) {
|
||||
bRestricted = MapleDataTool.getIntConvert("info/tradeBlock", data, 0) == 1;
|
||||
}
|
||||
}
|
||||
|
||||
untradeableCache.put(itemId, bRestricted);
|
||||
return bRestricted;
|
||||
}
|
||||
|
||||
public boolean isLootRestricted(int itemId) {
|
||||
if (dropRestrictionCache.containsKey(itemId)) {
|
||||
return dropRestrictionCache.get(itemId);
|
||||
@@ -1421,12 +1439,12 @@ public class MapleItemInformationProvider {
|
||||
}
|
||||
|
||||
public boolean isUntradeableOnEquip(int itemId) {
|
||||
if (onEquipUntradableCache.containsKey(itemId)) {
|
||||
return onEquipUntradableCache.get(itemId);
|
||||
if (onEquipUntradeableCache.containsKey(itemId)) {
|
||||
return onEquipUntradeableCache.get(itemId);
|
||||
}
|
||||
boolean untradableOnEquip = MapleDataTool.getIntConvert("info/equipTradeBlock", getItemData(itemId), 0) > 0;
|
||||
onEquipUntradableCache.put(itemId, untradableOnEquip);
|
||||
return untradableOnEquip;
|
||||
boolean untradeableOnEquip = MapleDataTool.getIntConvert("info/equipTradeBlock", getItemData(itemId), 0) > 0;
|
||||
onEquipUntradeableCache.put(itemId, untradeableOnEquip);
|
||||
return untradeableOnEquip;
|
||||
}
|
||||
|
||||
public scriptedItem getScriptedItemInfo(int itemId) {
|
||||
|
||||
@@ -257,6 +257,8 @@ public class MapleStatEffect {
|
||||
addBuffStatPairToListIfNotZero(statups, MapleBuffStat.COUPON_DRP3, 1);
|
||||
break;
|
||||
}
|
||||
} else if(isExpIncrease(sourceid)) {
|
||||
addBuffStatPairToListIfNotZero(statups, MapleBuffStat.EXP_INCREASE, MapleDataTool.getInt("expinc", source, 0));
|
||||
}
|
||||
} else {
|
||||
if(isMapChair(sourceid)) {
|
||||
@@ -1366,6 +1368,10 @@ public class MapleStatEffect {
|
||||
return itemType == 5211 || itemType == 5360;
|
||||
}
|
||||
|
||||
public static boolean isExpIncrease(int sourceid) {
|
||||
return sourceid >= 2022450 && sourceid <= 2022452;
|
||||
}
|
||||
|
||||
private boolean isDs() {
|
||||
return skill && (sourceid == Rogue.DARK_SIGHT || sourceid == NightWalker.DARK_SIGHT);
|
||||
}
|
||||
|
||||
@@ -544,8 +544,13 @@ public class MapleMonster extends AbstractLoadedMapleLife {
|
||||
int partyExp = 0;
|
||||
if (attacker.getHp() > 0) {
|
||||
exp *= attacker.getExpRate();
|
||||
|
||||
Integer expBonus = attacker.getBuffedValue(MapleBuffStat.EXP_INCREASE);
|
||||
if (expBonus != null) { // exp increase buff found thanks to HighKey21
|
||||
exp += expBonus;
|
||||
}
|
||||
|
||||
int personalExp = (int) exp;
|
||||
|
||||
if (exp <= Integer.MAX_VALUE) { // assuming no negative xp here
|
||||
if (partyModifier > 0.0f) {
|
||||
partyExp = (int) (personalExp * partyModifier * ServerConstants.PARTY_BONUS_EXP_RATE);
|
||||
|
||||
@@ -384,6 +384,8 @@ public class MapleMap {
|
||||
}
|
||||
|
||||
private void spawnAndAddRangedMapObject(MapleMapObject mapobject, DelayedPacketCreation packetbakery, SpawnCondition condition) {
|
||||
List<MapleCharacter> inRangeCharacters = new LinkedList<>();
|
||||
|
||||
chrRLock.lock();
|
||||
objectWLock.lock();
|
||||
try {
|
||||
@@ -393,7 +395,7 @@ public class MapleMap {
|
||||
for (MapleCharacter chr : characters) {
|
||||
if (condition == null || condition.canSpawn(chr)) {
|
||||
if (chr.getPosition().distanceSq(mapobject.getPosition()) <= getRangedDistance()) {
|
||||
packetbakery.sendPackets(chr.getClient());
|
||||
inRangeCharacters.add(chr);
|
||||
chr.addVisibleMapObject(mapobject);
|
||||
}
|
||||
}
|
||||
@@ -402,9 +404,15 @@ public class MapleMap {
|
||||
objectWLock.unlock();
|
||||
chrRLock.unlock();
|
||||
}
|
||||
|
||||
for (MapleCharacter chr : inRangeCharacters) {
|
||||
packetbakery.sendPackets(chr.getClient());
|
||||
}
|
||||
}
|
||||
|
||||
private void spawnRangedMapObject(MapleMapObject mapobject, DelayedPacketCreation packetbakery, SpawnCondition condition) {
|
||||
List<MapleCharacter> inRangeCharacters = new LinkedList<>();
|
||||
|
||||
chrRLock.lock();
|
||||
try {
|
||||
int curOID = getUsableOID();
|
||||
@@ -412,7 +420,7 @@ public class MapleMap {
|
||||
for (MapleCharacter chr : characters) {
|
||||
if (condition == null || condition.canSpawn(chr)) {
|
||||
if (chr.getPosition().distanceSq(mapobject.getPosition()) <= getRangedDistance()) {
|
||||
packetbakery.sendPackets(chr.getClient());
|
||||
inRangeCharacters.add(chr);
|
||||
chr.addVisibleMapObject(mapobject);
|
||||
}
|
||||
}
|
||||
@@ -420,6 +428,10 @@ public class MapleMap {
|
||||
} finally {
|
||||
chrRLock.unlock();
|
||||
}
|
||||
|
||||
for (MapleCharacter chr : inRangeCharacters) {
|
||||
packetbakery.sendPackets(chr.getClient());
|
||||
}
|
||||
}
|
||||
|
||||
private int getUsableOID() {
|
||||
|
||||
@@ -100,7 +100,7 @@ public class MapleMapFactory {
|
||||
}
|
||||
|
||||
String mapName = getMapName(mapid);
|
||||
MapleData mapData = source.getData(mapName);
|
||||
MapleData mapData = source.getData(mapName); // source.getData issue with giving nulls in rare ocasions found thanks to MedicOP
|
||||
MapleData infoData = mapData.getChildByPath("info");
|
||||
|
||||
String link = MapleDataTool.getString(infoData.getChildByPath("link"), "");
|
||||
|
||||
@@ -18,6 +18,7 @@ public class FilePrinter {
|
||||
MAPLE_MAP = "mapleMap.txt",
|
||||
ERROR38 = "error38.txt",
|
||||
PACKET_LOG = "log.txt",
|
||||
CASHITEM_BOUGHT = "cashlog.txt",
|
||||
EXCEPTION = "exceptions.txt",
|
||||
SQL_EXCEPTION = "sqlexceptions.txt",
|
||||
PACKET_HANDLER = "PacketHandler/",
|
||||
|
||||
Reference in New Issue
Block a user