Search in sources :

Example 36 with MapleData

use of provider.MapleData in project HeavenMS by ronancpl.

the class MapleItemInformationProvider method isConsumeOnPickup.

public boolean isConsumeOnPickup(int itemId) {
    if (consumeOnPickupCache.containsKey(itemId)) {
        return consumeOnPickupCache.get(itemId);
    }
    MapleData data = getItemData(itemId);
    boolean consume = MapleDataTool.getIntConvert("spec/consumeOnPickup", data, 0) == 1 || MapleDataTool.getIntConvert("specEx/consumeOnPickup", data, 0) == 1;
    consumeOnPickupCache.put(itemId, consume);
    return consume;
}
Also used : MapleData(provider.MapleData)

Example 37 with MapleData

use of provider.MapleData in project HeavenMS by ronancpl.

the class MapleItemInformationProvider method getWholePrice.

public int getWholePrice(int itemId) {
    if (wholePriceCache.containsKey(itemId)) {
        return wholePriceCache.get(itemId);
    }
    MapleData item = getItemData(itemId);
    if (item == null) {
        return -1;
    }
    int pEntry;
    MapleData pData = item.getChildByPath("info/price");
    if (pData == null) {
        return -1;
    }
    pEntry = MapleDataTool.getInt(pData);
    wholePriceCache.put(itemId, pEntry);
    return pEntry;
}
Also used : MapleData(provider.MapleData)

Example 38 with MapleData

use of provider.MapleData in project HeavenMS by ronancpl.

the class MapleItemInformationProvider method getEquipmentSlot.

protected String getEquipmentSlot(int itemId) {
    if (equipmentSlotCache.containsKey(itemId)) {
        return equipmentSlotCache.get(itemId);
    }
    String ret = "";
    MapleData item = getItemData(itemId);
    if (item == null) {
        return null;
    }
    MapleData info = item.getChildByPath("info");
    if (info == null) {
        return null;
    }
    ret = MapleDataTool.getString("islot", info, "");
    equipmentSlotCache.put(itemId, ret);
    return ret;
}
Also used : MapleData(provider.MapleData)

Example 39 with MapleData

use of provider.MapleData in project HeavenMS by ronancpl.

the class MapleItemInformationProvider method getQuestIdFromItem.

public int getQuestIdFromItem(int itemId) {
    MapleData data = getItemData(itemId);
    int questItem = MapleDataTool.getIntConvert("info/quest", data, 0);
    return questItem;
}
Also used : MapleData(provider.MapleData)

Example 40 with MapleData

use of provider.MapleData in project HeavenMS by ronancpl.

the class MapleItemInformationProvider method getMsg.

public String getMsg(int itemId) {
    if (msgCache.containsKey(itemId)) {
        return msgCache.get(itemId);
    }
    MapleData strings = getStringData(itemId);
    if (strings == null) {
        return null;
    }
    String ret = MapleDataTool.getString("msg", strings, null);
    msgCache.put(itemId, ret);
    return ret;
}
Also used : MapleData(provider.MapleData)

Aggregations

MapleData (provider.MapleData)90 ArrayList (java.util.ArrayList)19 Pair (tools.Pair)11 File (java.io.File)8 Point (java.awt.Point)7 LinkedList (java.util.LinkedList)6 MapleDataDirectoryEntry (provider.MapleDataDirectoryEntry)6 MapleDataFileEntry (provider.MapleDataFileEntry)6 LinkedHashMap (java.util.LinkedHashMap)5 SQLException (java.sql.SQLException)4 MapleDataProvider (provider.MapleDataProvider)4 Skill (client.Skill)2 IOException (java.io.IOException)2 Node (org.w3c.dom.Node)2 NodeList (org.w3c.dom.NodeList)2 AbstractLoadedMapleLife (server.life.AbstractLoadedMapleLife)2 MapleCharacter (client.MapleCharacter)1 Item (client.inventory.Item)1 MonsterStatus (client.status.MonsterStatus)1 Rectangle (java.awt.Rectangle)1