Rename and clean up MapleItemInformationProvider
This commit is contained in:
@@ -58,7 +58,7 @@ import scripting.AbstractPlayerInteraction;
|
||||
import scripting.event.EventInstanceManager;
|
||||
import scripting.item.ItemScriptManager;
|
||||
import server.*;
|
||||
import server.MapleItemInformationProvider.ScriptedItem;
|
||||
import server.ItemInformationProvider.ScriptedItem;
|
||||
import server.events.Events;
|
||||
import server.events.RescueGaga;
|
||||
import server.events.gm.Fitness;
|
||||
@@ -94,7 +94,7 @@ import java.util.concurrent.locks.Lock;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class Character extends AbstractCharacterObject {
|
||||
private static final MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
private static final ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
private static final String LEVEL_200 = "[Congrats] %s has reached Level %d! Congratulate %s on such an amazing achievement!";
|
||||
private static final String[] BLOCKED_NAMES = {"admin", "owner", "moderator", "intern", "donor", "administrator", "FREDRICK", "help", "helper", "alert", "notice", "maplestory", "fuck", "wizet", "fucking", "negro", "fuk", "fuc", "penis", "pussy", "asshole", "gay",
|
||||
"nigger", "homo", "suck", "cum", "shit", "shitty", "condom", "security", "official", "rape", "nigga", "sex", "tit", "boner", "orgy", "clit", "asshole", "fatass", "bitch", "support", "gamemaster", "cock", "gaay", "gm",
|
||||
@@ -902,7 +902,7 @@ public class Character extends AbstractCharacterObject {
|
||||
return;
|
||||
}
|
||||
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
for (InventoryType invType : InventoryType.values()) {
|
||||
Inventory inv = this.getInventory(invType);
|
||||
|
||||
@@ -2977,7 +2977,7 @@ public class Character extends AbstractCharacterObject {
|
||||
InventoryManipulator.removeFromSlot(client, inv.getType(), item.getPosition(), item.getQuantity(), true);
|
||||
}
|
||||
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
for (Item item : toberemove) {
|
||||
List<Integer> toadd = new ArrayList<>();
|
||||
Pair<Integer, String> replace = ii.getReplaceOnExpire(item.getItemId());
|
||||
@@ -3593,7 +3593,7 @@ public class Character extends AbstractCharacterObject {
|
||||
|
||||
System.out.println("IN ACTION:");
|
||||
for (Entry<BuffStat, MapleBuffStatValueHolder> bpl : effects.entrySet()) {
|
||||
System.out.println(bpl.getKey().name() + " -> " + MapleItemInformationProvider.getInstance().getName(bpl.getValue().effect.getSourceId()));
|
||||
System.out.println(bpl.getKey().name() + " -> " + ItemInformationProvider.getInstance().getName(bpl.getValue().effect.getSourceId()));
|
||||
}
|
||||
} finally {
|
||||
chrLock.unlock();
|
||||
@@ -9348,7 +9348,7 @@ public class Character extends AbstractCharacterObject {
|
||||
}
|
||||
}
|
||||
|
||||
public int sellAllItemsFromPosition(MapleItemInformationProvider ii, InventoryType type, short pos) {
|
||||
public int sellAllItemsFromPosition(ItemInformationProvider ii, InventoryType type, short pos) {
|
||||
int mesoGain = 0;
|
||||
|
||||
Inventory inv = getInventory(type);
|
||||
@@ -9367,7 +9367,7 @@ public class Character extends AbstractCharacterObject {
|
||||
return (mesoGain);
|
||||
}
|
||||
|
||||
private int standaloneSell(Client c, MapleItemInformationProvider ii, InventoryType type, short slot, short quantity) {
|
||||
private int standaloneSell(Client c, ItemInformationProvider ii, InventoryType type, short slot, short quantity) {
|
||||
if (quantity == 0xFFFF || quantity == 0) {
|
||||
quantity = 1;
|
||||
}
|
||||
@@ -9506,7 +9506,7 @@ public class Character extends AbstractCharacterObject {
|
||||
Equip eqp = eqpUpg.getKey();
|
||||
setMergeFlag(eqp);
|
||||
|
||||
String showStr = " '" + MapleItemInformationProvider.getInstance().getName(eqp.getItemId()) + "': ";
|
||||
String showStr = " '" + ItemInformationProvider.getInstance().getName(eqp.getItemId()) + "': ";
|
||||
String upgdStr = eqp.gainStats(eqpStatups).getLeft();
|
||||
|
||||
this.forceUpdateItem(eqp);
|
||||
|
||||
@@ -25,7 +25,7 @@ package client.command.commands.gm0;
|
||||
|
||||
import client.Client;
|
||||
import client.command.Command;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.ItemInformationProvider;
|
||||
import server.gachapon.MapleGachapon;
|
||||
|
||||
public class GachaCommand extends Command {
|
||||
@@ -56,7 +56,7 @@ public class GachaCommand extends Command {
|
||||
String talkStr = "The #b" + gachaName + "#k Gachapon contains the following items.\r\n\r\n";
|
||||
for (int i = 0; i < 2; i++){
|
||||
for (int id : gacha.getItems(i)){
|
||||
talkStr += "-" + MapleItemInformationProvider.getInstance().getName(id) + "\r\n";
|
||||
talkStr += "-" + ItemInformationProvider.getInstance().getName(id) + "\r\n";
|
||||
}
|
||||
}
|
||||
talkStr += "\r\nPlease keep in mind that there are items that are in all gachapons and are not listed here.";
|
||||
|
||||
@@ -26,7 +26,7 @@ package client.command.commands.gm1;
|
||||
import client.Character;
|
||||
import client.Client;
|
||||
import client.command.Command;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.ItemInformationProvider;
|
||||
import server.life.MonsterDropEntry;
|
||||
import server.life.MonsterInformationProvider;
|
||||
import tools.Pair;
|
||||
@@ -57,7 +57,7 @@ public class WhatDropsFromCommand extends Command {
|
||||
output += mobName + " drops the following items:\r\n\r\n";
|
||||
for (MonsterDropEntry drop : MonsterInformationProvider.getInstance().retrieveDrop(mobId)){
|
||||
try {
|
||||
String name = MapleItemInformationProvider.getInstance().getName(drop.itemId);
|
||||
String name = ItemInformationProvider.getInstance().getName(drop.itemId);
|
||||
if (name == null || name.equals("null") || drop.chance == 0){
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ package client.command.commands.gm1;
|
||||
import client.Character;
|
||||
import client.Client;
|
||||
import client.command.Command;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.ItemInformationProvider;
|
||||
import server.life.MonsterInformationProvider;
|
||||
import tools.DatabaseConnection;
|
||||
import tools.Pair;
|
||||
@@ -53,7 +53,7 @@ public class WhoDropsCommand extends Command {
|
||||
try {
|
||||
String searchString = player.getLastCommandMessage();
|
||||
String output = "";
|
||||
Iterator<Pair<Integer, String>> listIterator = MapleItemInformationProvider.getInstance().getItemDataByName(searchString).iterator();
|
||||
Iterator<Pair<Integer, String>> listIterator = ItemInformationProvider.getInstance().getItemDataByName(searchString).iterator();
|
||||
if (listIterator.hasNext()) {
|
||||
int count = 1;
|
||||
while (listIterator.hasNext() && count <= 3) {
|
||||
|
||||
@@ -30,7 +30,7 @@ import client.inventory.Pet;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import config.YamlConfig;
|
||||
import constants.inventory.ItemConstants;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.ItemInformationProvider;
|
||||
|
||||
public class ItemCommand extends Command {
|
||||
{
|
||||
@@ -47,7 +47,7 @@ public class ItemCommand extends Command {
|
||||
}
|
||||
|
||||
int itemId = Integer.parseInt(params[0]);
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
|
||||
if(ii.getName(itemId) == null) {
|
||||
player.yellowMessage("Item id '" + params[0] + "' does not exist.");
|
||||
|
||||
@@ -31,7 +31,7 @@ import client.inventory.Item;
|
||||
import client.inventory.Pet;
|
||||
import config.YamlConfig;
|
||||
import constants.inventory.ItemConstants;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.ItemInformationProvider;
|
||||
|
||||
public class ItemDropCommand extends Command {
|
||||
{
|
||||
@@ -48,7 +48,7 @@ public class ItemDropCommand extends Command {
|
||||
}
|
||||
|
||||
int itemId = Integer.parseInt(params[0]);
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
|
||||
if(ii.getName(itemId) == null) {
|
||||
player.yellowMessage("Item id '" + params[0] + "' does not exist.");
|
||||
|
||||
@@ -29,7 +29,7 @@ import client.command.Command;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import constants.inventory.ItemConstants;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.ItemInformationProvider;
|
||||
|
||||
public class RechargeCommand extends Command {
|
||||
{
|
||||
@@ -39,7 +39,7 @@ public class RechargeCommand extends Command {
|
||||
@Override
|
||||
public void execute(Client c, String[] params) {
|
||||
Character player = c.getPlayer();
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
for (Item torecharge : c.getPlayer().getInventory(InventoryType.USE).list()) {
|
||||
if (ItemConstants.isThrowingStar(torecharge.getItemId())){
|
||||
torecharge.setQuantity(ii.getSlotMax(c, torecharge.getItemId()));
|
||||
|
||||
@@ -31,7 +31,7 @@ import provider.DataProvider;
|
||||
import provider.DataProviderFactory;
|
||||
import provider.DataTool;
|
||||
import provider.wz.WZFiles;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.ItemInformationProvider;
|
||||
import server.quest.Quest;
|
||||
import tools.Pair;
|
||||
|
||||
@@ -117,7 +117,7 @@ public class SearchCommand extends Command {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (Pair<Integer, String> itemPair : MapleItemInformationProvider.getInstance().getAllItems()) {
|
||||
for (Pair<Integer, String> itemPair : ItemInformationProvider.getInstance().getAllItems()) {
|
||||
if (sb.length() < 32654) {//ohlol
|
||||
if (itemPair.getRight().toLowerCase().contains(search.toLowerCase())) {
|
||||
sb.append("#b").append(itemPair.getLeft()).append("#k - #r").append(itemPair.getRight()).append("\r\n");
|
||||
|
||||
@@ -28,7 +28,7 @@ import client.Client;
|
||||
import client.Stat;
|
||||
import client.command.Command;
|
||||
import constants.inventory.ItemConstants;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.ItemInformationProvider;
|
||||
|
||||
public class FaceCommand extends Command {
|
||||
{
|
||||
@@ -46,7 +46,7 @@ public class FaceCommand extends Command {
|
||||
try {
|
||||
if (params.length == 1) {
|
||||
int itemId = Integer.parseInt(params[0]);
|
||||
if (!ItemConstants.isFace(itemId) || MapleItemInformationProvider.getInstance().getName(itemId) == null) {
|
||||
if (!ItemConstants.isFace(itemId) || ItemInformationProvider.getInstance().getName(itemId) == null) {
|
||||
player.yellowMessage("Face id '" + params[0] + "' does not exist.");
|
||||
return;
|
||||
}
|
||||
@@ -56,7 +56,7 @@ public class FaceCommand extends Command {
|
||||
player.equipChanged();
|
||||
} else {
|
||||
int itemId = Integer.parseInt(params[1]);
|
||||
if (!ItemConstants.isFace(itemId) || MapleItemInformationProvider.getInstance().getName(itemId) == null) {
|
||||
if (!ItemConstants.isFace(itemId) || ItemInformationProvider.getInstance().getName(itemId) == null) {
|
||||
player.yellowMessage("Face id '" + params[1] + "' does not exist.");
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import client.Client;
|
||||
import client.Stat;
|
||||
import client.command.Command;
|
||||
import constants.inventory.ItemConstants;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.ItemInformationProvider;
|
||||
|
||||
public class HairCommand extends Command {
|
||||
{
|
||||
@@ -46,7 +46,7 @@ public class HairCommand extends Command {
|
||||
try {
|
||||
if (params.length == 1) {
|
||||
int itemId = Integer.parseInt(params[0]);
|
||||
if (!ItemConstants.isHair(itemId) || MapleItemInformationProvider.getInstance().getName(itemId) == null) {
|
||||
if (!ItemConstants.isHair(itemId) || ItemInformationProvider.getInstance().getName(itemId) == null) {
|
||||
player.yellowMessage("Hair id '" + params[0] + "' does not exist.");
|
||||
return;
|
||||
}
|
||||
@@ -56,7 +56,7 @@ public class HairCommand extends Command {
|
||||
player.equipChanged();
|
||||
} else {
|
||||
int itemId = Integer.parseInt(params[1]);
|
||||
if (!ItemConstants.isHair(itemId) || MapleItemInformationProvider.getInstance().getName(itemId) == null) {
|
||||
if (!ItemConstants.isHair(itemId) || ItemInformationProvider.getInstance().getName(itemId) == null) {
|
||||
player.yellowMessage("Hair id '" + params[1] + "' does not exist.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import constants.inventory.ItemConstants;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.ItemInformationProvider;
|
||||
|
||||
public class ProItemCommand extends Command {
|
||||
{
|
||||
@@ -46,7 +46,7 @@ public class ProItemCommand extends Command {
|
||||
return;
|
||||
}
|
||||
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
int itemid = Integer.parseInt(params[0]);
|
||||
|
||||
if(ii.getName(itemid) == null) {
|
||||
|
||||
@@ -27,7 +27,7 @@ import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import config.YamlConfig;
|
||||
import net.server.Server;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.ItemInformationProvider;
|
||||
import tools.FilePrinter;
|
||||
import tools.PacketCreator;
|
||||
|
||||
@@ -59,7 +59,7 @@ public abstract class CharacterFactory {
|
||||
newchar.setMapId(recipe.getMap());
|
||||
|
||||
Inventory equipped = newchar.getInventory(InventoryType.EQUIPPED);
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
|
||||
int top = recipe.getTop(), bottom = recipe.getBottom(), shoes = recipe.getShoes(), weapon = recipe.getWeapon();
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import client.creator.CharacterFactory;
|
||||
import client.creator.CharacterFactoryRecipe;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.ItemInformationProvider;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -38,7 +38,7 @@ public class BowmanCreator extends CharacterFactory {
|
||||
|
||||
private static CharacterFactoryRecipe createRecipe(Job job, int level, int map, int top, int bottom, int shoes, int weapon) {
|
||||
CharacterFactoryRecipe recipe = new CharacterFactoryRecipe(job, level, map, top, bottom, shoes, weapon);
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
|
||||
recipe.setDex(25);
|
||||
recipe.setRemainingAp(133);
|
||||
@@ -60,7 +60,7 @@ public class BowmanCreator extends CharacterFactory {
|
||||
return recipe;
|
||||
}
|
||||
|
||||
private static void giveEquipment(CharacterFactoryRecipe recipe, MapleItemInformationProvider ii, int equipid) {
|
||||
private static void giveEquipment(CharacterFactoryRecipe recipe, ItemInformationProvider ii, int equipid) {
|
||||
Item nEquip = ii.getEquipById(equipid);
|
||||
recipe.addStartingEquipment(nEquip);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import client.creator.CharacterFactoryRecipe;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import constants.skills.Magician;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.ItemInformationProvider;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -42,7 +42,7 @@ public class MagicianCreator extends CharacterFactory {
|
||||
|
||||
private static CharacterFactoryRecipe createRecipe(Job job, int level, int map, int top, int bottom, int shoes, int weapon, int gender, int improveSp) {
|
||||
CharacterFactoryRecipe recipe = new CharacterFactoryRecipe(job, level, map, top, bottom, shoes, weapon);
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
|
||||
recipe.setInt(20);
|
||||
recipe.setRemainingAp(138);
|
||||
@@ -83,7 +83,7 @@ public class MagicianCreator extends CharacterFactory {
|
||||
return recipe;
|
||||
}
|
||||
|
||||
private static void giveEquipment(CharacterFactoryRecipe recipe, MapleItemInformationProvider ii, int equipid) {
|
||||
private static void giveEquipment(CharacterFactoryRecipe recipe, ItemInformationProvider ii, int equipid) {
|
||||
Item nEquip = ii.getEquipById(equipid);
|
||||
recipe.addStartingEquipment(nEquip);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import client.creator.CharacterFactory;
|
||||
import client.creator.CharacterFactoryRecipe;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.ItemInformationProvider;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -38,7 +38,7 @@ public class PirateCreator extends CharacterFactory {
|
||||
|
||||
private static CharacterFactoryRecipe createRecipe(Job job, int level, int map, int top, int bottom, int shoes, int weapon) {
|
||||
CharacterFactoryRecipe recipe = new CharacterFactoryRecipe(job, level, map, top, bottom, shoes, weapon);
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
|
||||
recipe.setDex(20);
|
||||
recipe.setRemainingAp(138);
|
||||
@@ -64,7 +64,7 @@ public class PirateCreator extends CharacterFactory {
|
||||
return recipe;
|
||||
}
|
||||
|
||||
private static void giveEquipment(CharacterFactoryRecipe recipe, MapleItemInformationProvider ii, int equipid) {
|
||||
private static void giveEquipment(CharacterFactoryRecipe recipe, ItemInformationProvider ii, int equipid) {
|
||||
Item nEquip = ii.getEquipById(equipid);
|
||||
recipe.addStartingEquipment(nEquip);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import client.creator.CharacterFactory;
|
||||
import client.creator.CharacterFactoryRecipe;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.ItemInformationProvider;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -38,7 +38,7 @@ public class ThiefCreator extends CharacterFactory {
|
||||
|
||||
private static CharacterFactoryRecipe createRecipe(Job job, int level, int map, int top, int bottom, int shoes, int weapon) {
|
||||
CharacterFactoryRecipe recipe = new CharacterFactoryRecipe(job, level, map, top, bottom, shoes, weapon);
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
|
||||
recipe.setDex(25);
|
||||
recipe.setRemainingAp(133);
|
||||
@@ -62,7 +62,7 @@ public class ThiefCreator extends CharacterFactory {
|
||||
return recipe;
|
||||
}
|
||||
|
||||
private static void giveEquipment(CharacterFactoryRecipe recipe, MapleItemInformationProvider ii, int equipid) {
|
||||
private static void giveEquipment(CharacterFactoryRecipe recipe, ItemInformationProvider ii, int equipid) {
|
||||
Item nEquip = ii.getEquipById(equipid);
|
||||
recipe.addStartingEquipment(nEquip);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ import client.creator.CharacterFactoryRecipe;
|
||||
import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import constants.skills.Warrior;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.ItemInformationProvider;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -42,7 +42,7 @@ public class WarriorCreator extends CharacterFactory {
|
||||
|
||||
private static CharacterFactoryRecipe createRecipe(Job job, int level, int map, int top, int bottom, int shoes, int weapon, int gender, int improveSp) {
|
||||
CharacterFactoryRecipe recipe = new CharacterFactoryRecipe(job, level, map, top, bottom, shoes, weapon);
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
|
||||
recipe.setStr(35);
|
||||
recipe.setRemainingAp(123);
|
||||
@@ -83,7 +83,7 @@ public class WarriorCreator extends CharacterFactory {
|
||||
return recipe;
|
||||
}
|
||||
|
||||
private static void giveEquipment(CharacterFactoryRecipe recipe, MapleItemInformationProvider ii, int equipid) {
|
||||
private static void giveEquipment(CharacterFactoryRecipe recipe, ItemInformationProvider ii, int equipid) {
|
||||
Item nEquip = ii.getEquipById(equipid);
|
||||
recipe.addStartingEquipment(nEquip);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import client.Client;
|
||||
import config.YamlConfig;
|
||||
import constants.game.ExpTable;
|
||||
import constants.inventory.ItemConstants;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.ItemInformationProvider;
|
||||
import tools.PacketCreator;
|
||||
import tools.Pair;
|
||||
import tools.Randomizer;
|
||||
@@ -83,7 +83,7 @@ public class Equip extends Item {
|
||||
this.itemExp = 0;
|
||||
this.itemLevel = 1;
|
||||
|
||||
this.isElemental = (MapleItemInformationProvider.getInstance().getEquipLevel(id, false) > 1);
|
||||
this.isElemental = (ItemInformationProvider.getInstance().getEquipLevel(id, false) > 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -306,7 +306,7 @@ public class Equip extends Item {
|
||||
}
|
||||
|
||||
private static boolean isPhysicalWeapon(int itemid) {
|
||||
Equip eqp = (Equip) MapleItemInformationProvider.getInstance().getEquipById(itemid);
|
||||
Equip eqp = (Equip) ItemInformationProvider.getInstance().getEquipById(itemid);
|
||||
return eqp.getWatk() >= eqp.getMatk();
|
||||
}
|
||||
|
||||
@@ -476,7 +476,7 @@ public class Equip extends Item {
|
||||
List<Pair<StatUpgrade, Integer>> stats = new LinkedList<>();
|
||||
|
||||
if(isElemental) {
|
||||
List<Pair<String, Integer>> elementalStats = MapleItemInformationProvider.getInstance().getItemLevelupStats(getItemId(), itemLevel);
|
||||
List<Pair<String, Integer>> elementalStats = ItemInformationProvider.getInstance().getItemLevelupStats(getItemId(), itemLevel);
|
||||
|
||||
for(Pair<String, Integer> p: elementalStats) {
|
||||
if(p.getRight() > 0) stats.add(new Pair<>(StatUpgrade.valueOf(p.getLeft()), p.getRight()));
|
||||
@@ -510,8 +510,8 @@ public class Equip extends Item {
|
||||
|
||||
itemLevel++;
|
||||
|
||||
String lvupStr = "'" + MapleItemInformationProvider.getInstance().getName(this.getItemId()) + "' is now level " + itemLevel + "! ";
|
||||
String showStr = "#e'" + MapleItemInformationProvider.getInstance().getName(this.getItemId()) + "'#b is now #elevel #r" + itemLevel + "#k#b!";
|
||||
String lvupStr = "'" + ItemInformationProvider.getInstance().getName(this.getItemId()) + "' is now level " + itemLevel + "! ";
|
||||
String showStr = "#e'" + ItemInformationProvider.getInstance().getName(this.getItemId()) + "'#b is now #elevel #r" + itemLevel + "#k#b!";
|
||||
|
||||
Pair<String, Pair<Boolean, Boolean>> res = this.gainStats(stats);
|
||||
lvupStr += res.getLeft();
|
||||
@@ -519,11 +519,11 @@ public class Equip extends Item {
|
||||
boolean gotVicious = res.getRight().getRight();
|
||||
|
||||
if (gotVicious) {
|
||||
//c.getPlayer().dropMessage(6, "A new Vicious Hammer opportunity has been found on the '" + MapleItemInformationProvider.getInstance().getName(getItemId()) + "'!");
|
||||
//c.getPlayer().dropMessage(6, "A new Vicious Hammer opportunity has been found on the '" + ItemInformationProvider.getInstance().getName(getItemId()) + "'!");
|
||||
lvupStr += "+VICIOUS ";
|
||||
}
|
||||
if (gotSlot) {
|
||||
//c.getPlayer().dropMessage(6, "A new upgrade slot has been found on the '" + MapleItemInformationProvider.getInstance().getName(getItemId()) + "'!");
|
||||
//c.getPlayer().dropMessage(6, "A new upgrade slot has been found on the '" + ItemInformationProvider.getInstance().getName(getItemId()) + "'!");
|
||||
lvupStr += "+UPGSLOT ";
|
||||
}
|
||||
|
||||
@@ -559,7 +559,7 @@ public class Equip extends Item {
|
||||
}
|
||||
|
||||
public synchronized void gainItemExp(Client c, int gain) { // Ronan's Equip Exp gain method
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
if(!ii.isUpgradeable(this.getItemId())) {
|
||||
return;
|
||||
}
|
||||
@@ -601,7 +601,7 @@ public class Equip extends Item {
|
||||
|
||||
private boolean reachedMaxLevel() {
|
||||
if (isElemental) {
|
||||
if (itemLevel < MapleItemInformationProvider.getInstance().getEquipLevel(getItemId(), true)) {
|
||||
if (itemLevel < ItemInformationProvider.getInstance().getEquipLevel(getItemId(), true)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -610,7 +610,7 @@ public class Equip extends Item {
|
||||
}
|
||||
|
||||
public String showEquipFeatures(Client c) {
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
if(!ii.isUpgradeable(this.getItemId())) return "";
|
||||
|
||||
String eqpName = ii.getName(getItemId());
|
||||
|
||||
@@ -27,7 +27,7 @@ import client.inventory.manipulator.InventoryManipulator;
|
||||
import constants.inventory.ItemConstants;
|
||||
import net.server.audit.locks.MonitoredLockType;
|
||||
import net.server.audit.locks.factory.MonitoredReentrantLockFactory;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.ItemInformationProvider;
|
||||
import server.ThreadManager;
|
||||
import tools.FilePrinter;
|
||||
import tools.Pair;
|
||||
@@ -113,7 +113,7 @@ public class Inventory implements Iterable<Item> {
|
||||
}
|
||||
|
||||
public Item findByName(String name) {
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
for (Item item : list()) {
|
||||
String itemName = ii.getName(item.getItemId());
|
||||
if (itemName == null) {
|
||||
@@ -421,7 +421,7 @@ public class Inventory implements Iterable<Item> {
|
||||
}
|
||||
|
||||
private static boolean checkItemRestricted(List<Pair<Item, InventoryType>> items) {
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
|
||||
// thanks Shavit for noticing set creation that would be only effective in rare situations
|
||||
for (Pair<Item, InventoryType> p : items) {
|
||||
|
||||
@@ -23,7 +23,7 @@ package client.inventory;
|
||||
|
||||
import client.inventory.manipulator.KarmaManipulator;
|
||||
import constants.inventory.ItemConstants;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.ItemInformationProvider;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
@@ -152,7 +152,7 @@ public class Item implements Comparable<Item> {
|
||||
}
|
||||
|
||||
public void setFlag(short b) {
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
if (ii.isAccountRestricted(id)) {
|
||||
b |= ItemConstants.ACCOUNT_SHARING; // thanks Shinigami15 for noticing ACCOUNT_SHARING flag not being applied properly to items server-side
|
||||
}
|
||||
@@ -189,6 +189,6 @@ public class Item implements Comparable<Item> {
|
||||
}
|
||||
|
||||
public boolean isUntradeable() {
|
||||
return ((this.getFlag() & ItemConstants.UNTRADEABLE) == ItemConstants.UNTRADEABLE) || (MapleItemInformationProvider.getInstance().isDropRestricted(this.getItemId()) && !KarmaManipulator.hasKarmaFlag(this));
|
||||
return ((this.getFlag() & ItemConstants.UNTRADEABLE) == ItemConstants.UNTRADEABLE) || (ItemInformationProvider.getInstance().isDropRestricted(this.getItemId()) && !KarmaManipulator.hasKarmaFlag(this));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ package client.inventory;
|
||||
import client.Character;
|
||||
import client.inventory.manipulator.CashIdGenerator;
|
||||
import constants.game.ExpTable;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.ItemInformationProvider;
|
||||
import server.movement.AbsoluteLifeMovement;
|
||||
import server.movement.LifeMovement;
|
||||
import server.movement.LifeMovementFragment;
|
||||
@@ -130,7 +130,7 @@ public class Pet extends Item {
|
||||
PreparedStatement ps = con.prepareStatement("INSERT INTO pets (petid, name, level, closeness, fullness, summoned, flag) VALUES (?, ?, 1, 0, 100, 0, 0)")) {
|
||||
int ret = CashIdGenerator.generateCashId();
|
||||
ps.setInt(1, ret);
|
||||
ps.setString(2, MapleItemInformationProvider.getInstance().getName(itemid));
|
||||
ps.setString(2, ItemInformationProvider.getInstance().getName(itemid));
|
||||
ps.executeUpdate();
|
||||
return ret;
|
||||
} catch (SQLException e) {
|
||||
@@ -144,7 +144,7 @@ public class Pet extends Item {
|
||||
PreparedStatement ps = con.prepareStatement("INSERT INTO pets (petid, name, level, closeness, fullness, summoned, flag) VALUES (?, ?, ?, ?, ?, 0, 0)")) {
|
||||
int ret = CashIdGenerator.generateCashId();
|
||||
ps.setInt(1, ret);
|
||||
ps.setString(2, MapleItemInformationProvider.getInstance().getName(itemid));
|
||||
ps.setString(2, ItemInformationProvider.getInstance().getName(itemid));
|
||||
ps.setByte(3, level);
|
||||
ps.setInt(4, closeness);
|
||||
ps.setInt(5, fullness);
|
||||
@@ -307,7 +307,7 @@ public class Pet extends Item {
|
||||
}
|
||||
|
||||
public Pair<Integer, Boolean> canConsume(int itemId) {
|
||||
return MapleItemInformationProvider.getInstance().canPetConsume(this.getItemId(), itemId);
|
||||
return ItemInformationProvider.getInstance().canPetConsume(this.getItemId(), itemId);
|
||||
}
|
||||
|
||||
public void updatePosition(List<LifeMovementFragment> movement) {
|
||||
|
||||
@@ -28,7 +28,7 @@ import client.inventory.*;
|
||||
import client.newyear.NewYearCardRecord;
|
||||
import config.YamlConfig;
|
||||
import constants.inventory.ItemConstants;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.ItemInformationProvider;
|
||||
import server.maps.MapleMap;
|
||||
import tools.FilePrinter;
|
||||
import tools.PacketCreator;
|
||||
@@ -75,7 +75,7 @@ public class InventoryManipulator {
|
||||
}
|
||||
|
||||
private static boolean addByIdInternal(Client c, Character chr, InventoryType type, Inventory inv, int itemId, short quantity, String owner, int petid, short flag, long expiration) {
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
if (!type.equals(InventoryType.EQUIP)) {
|
||||
short slotMax = ii.getSlotMax(c, itemId);
|
||||
List<Item> existing = inv.listById(itemId);
|
||||
@@ -184,7 +184,7 @@ public class InventoryManipulator {
|
||||
}
|
||||
|
||||
private static boolean addFromDropInternal(Client c, Character chr, InventoryType type, Inventory inv, Item item, boolean show, int petId) {
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
int itemid = item.getItemId();
|
||||
if (ii.isPickupRestricted(itemid) && chr.haveItemWithId(itemid, true)) {
|
||||
c.sendPacket(PacketCreator.getInventoryFull());
|
||||
@@ -284,7 +284,7 @@ public class InventoryManipulator {
|
||||
}
|
||||
|
||||
public static boolean checkSpace(Client c, int itemid, int quantity, String owner) {
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
InventoryType type = ItemConstants.getInventoryType(itemid);
|
||||
Character chr = c.getPlayer();
|
||||
Inventory inv = chr.getInventory(type);
|
||||
@@ -339,7 +339,7 @@ public class InventoryManipulator {
|
||||
|
||||
int returnValue;
|
||||
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
InventoryType type = !useProofInv ? ItemConstants.getInventoryType(itemid) : InventoryType.CANHOLD;
|
||||
Character chr = c.getPlayer();
|
||||
Inventory inv = chr.getInventory(type);
|
||||
@@ -484,7 +484,7 @@ public class InventoryManipulator {
|
||||
if (dst > inv.getSlotLimit()) {
|
||||
return;
|
||||
}
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
Item source = inv.getItem(src);
|
||||
Item initialTarget = inv.getItem(dst);
|
||||
if (source == null) {
|
||||
@@ -513,7 +513,7 @@ public class InventoryManipulator {
|
||||
}
|
||||
|
||||
public static void equip(Client c, short src, short dst) {
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
|
||||
Character chr = c.getPlayer();
|
||||
Inventory eqpInv = chr.getInventory(InventoryType.EQUIP);
|
||||
@@ -672,7 +672,7 @@ public class InventoryManipulator {
|
||||
}
|
||||
|
||||
private static boolean isDisappearingItemDrop(Item it) {
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
if (ii.isDropRestricted(it.getItemId())) {
|
||||
return true;
|
||||
} else if (ii.isCash(it.getItemId())) {
|
||||
|
||||
@@ -29,9 +29,9 @@ import config.YamlConfig;
|
||||
import constants.game.GameConstants;
|
||||
import constants.inventory.ItemConstants;
|
||||
import net.packet.InPacket;
|
||||
import server.ItemInformationProvider;
|
||||
import server.MakerItemFactory;
|
||||
import server.MakerItemFactory.MakerItemCreateEntry;
|
||||
import server.MapleItemInformationProvider;
|
||||
import tools.FilePrinter;
|
||||
import tools.PacketCreator;
|
||||
import tools.Pair;
|
||||
@@ -47,7 +47,7 @@ import java.util.Map;
|
||||
*/
|
||||
public class MakerProcessor {
|
||||
|
||||
private static MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
private static ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
|
||||
public static void makerAction(InPacket p, Client c) {
|
||||
if (c.tryacquireClient()) {
|
||||
@@ -376,7 +376,7 @@ public class MakerProcessor {
|
||||
if(!(c.getPlayer().isGM() && YamlConfig.config.server.USE_PERFECT_GM_SCROLL)) {
|
||||
eqp.setUpgradeSlots((byte)(eqp.getUpgradeSlots() + 1));
|
||||
}
|
||||
item = MapleItemInformationProvider.getInstance().scrollEquipWithId(eqp, 2049100, true, 2049100, c.getPlayer().isGM());
|
||||
item = ItemInformationProvider.getInstance().scrollEquipWithId(eqp, 2049100, true, 2049100, c.getPlayer().isGM());
|
||||
}
|
||||
|
||||
if(!reagentids.isEmpty()) {
|
||||
|
||||
@@ -28,7 +28,7 @@ import client.inventory.InventoryType;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import config.YamlConfig;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.ItemInformationProvider;
|
||||
import server.MapleStatEffect;
|
||||
import tools.PacketCreator;
|
||||
|
||||
@@ -116,7 +116,7 @@ public class PetAutopotProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
stat = MapleItemInformationProvider.getInstance().getItemEffect(toUse.getItemId());
|
||||
stat = ItemInformationProvider.getInstance().getItemEffect(toUse.getItemId());
|
||||
hasHpGain = stat.getHp() > 0 || stat.getHpRate() > 0.0;
|
||||
hasMpGain = stat.getMp() > 0 || stat.getMpRate() > 0.0;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ import config.YamlConfig;
|
||||
import constants.inventory.ItemConstants;
|
||||
import net.server.channel.Channel;
|
||||
import server.DueyPackage;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.ItemInformationProvider;
|
||||
import server.MapleTrade;
|
||||
import tools.DatabaseConnection;
|
||||
import tools.FilePrinter;
|
||||
@@ -239,7 +239,7 @@ public class DueyProcessor {
|
||||
|
||||
private static int addPackageItemFromInventory(int packageId, Client c, byte invTypeId, short itemPos, short amount) {
|
||||
if (invTypeId > 0) {
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
|
||||
InventoryType invType = InventoryType.getByType(invTypeId);
|
||||
Inventory inv = c.getPlayer().getInventory(invType);
|
||||
@@ -411,7 +411,7 @@ public class DueyProcessor {
|
||||
|
||||
if (!InventoryManipulator.checkSpace(c, dpItem.getItemId(), dpItem.getQuantity(), dpItem.getOwner())) {
|
||||
int itemid = dpItem.getItemId();
|
||||
if (MapleItemInformationProvider.getInstance().isPickupRestricted(itemid) && c.getPlayer().getInventory(ItemConstants.getInventoryType(itemid)).findById(itemid) != null) {
|
||||
if (ItemInformationProvider.getInstance().isPickupRestricted(itemid) && c.getPlayer().getInventory(ItemConstants.getInventoryType(itemid)).findById(itemid) != null) {
|
||||
c.sendPacket(PacketCreator.sendDueyMSG(Actions.TOCLIENT_RECV_RECEIVER_WITH_UNIQUE.getCode()));
|
||||
} else {
|
||||
c.sendPacket(PacketCreator.sendDueyMSG(Actions.TOCLIENT_RECV_NO_FREE_SLOTS.getCode()));
|
||||
|
||||
@@ -32,7 +32,7 @@ import client.inventory.ItemFactory;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import net.server.Server;
|
||||
import net.server.world.World;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.ItemInformationProvider;
|
||||
import server.maps.HiredMerchant;
|
||||
import tools.DatabaseConnection;
|
||||
import tools.FilePrinter;
|
||||
@@ -290,7 +290,7 @@ public class FredrickProcessor {
|
||||
for (Pair<Item, InventoryType> it : items) {
|
||||
Item item = it.getLeft();
|
||||
InventoryManipulator.addFromDrop(chr.getClient(), item, false);
|
||||
String itemName = MapleItemInformationProvider.getInstance().getName(item.getItemId());
|
||||
String itemName = ItemInformationProvider.getInstance().getName(item.getItemId());
|
||||
FilePrinter.print(FilePrinter.FREDRICK + chr.getName() + ".txt", chr.getName() + " gained " + item.getQuantity() + " " + itemName + " (" + item.getItemId() + ")");
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ import client.inventory.manipulator.KarmaManipulator;
|
||||
import config.YamlConfig;
|
||||
import constants.inventory.ItemConstants;
|
||||
import net.packet.InPacket;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.ItemInformationProvider;
|
||||
import server.MapleStorage;
|
||||
import tools.FilePrinter;
|
||||
import tools.PacketCreator;
|
||||
@@ -45,7 +45,7 @@ import tools.PacketCreator;
|
||||
public class StorageProcessor {
|
||||
|
||||
public static void storageAction(InPacket p, Client c) {
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
ItemInformationProvider ii = ItemInformationProvider.getInstance();
|
||||
Character chr = c.getPlayer();
|
||||
MapleStorage storage = chr.getStorage();
|
||||
byte mode = p.readByte();
|
||||
|
||||
Reference in New Issue
Block a user