Search in sources :

Example 61 with MapleData

use of provider.MapleData in project HeavenMS by ronancpl.

the class PetDataFactory method getPetCommand.

public static PetCommand getPetCommand(int petId, int skillId) {
    PetCommand ret = petCommands.get(Integer.valueOf(petId) + "" + skillId);
    if (ret != null) {
        return ret;
    }
    synchronized (petCommands) {
        ret = petCommands.get(petId + "" + skillId);
        if (ret == null) {
            MapleData skillData = dataRoot.getData("Pet/" + petId + ".img");
            int prob = 0;
            int inc = 0;
            if (skillData != null) {
                prob = MapleDataTool.getInt("interact/" + skillId + "/prob", skillData, 0);
                inc = MapleDataTool.getInt("interact/" + skillId + "/inc", skillData, 0);
            }
            ret = new PetCommand(petId, skillId, prob, inc);
            petCommands.put(petId + "" + skillId, ret);
        }
        return ret;
    }
}
Also used : MapleData(provider.MapleData)

Example 62 with MapleData

use of provider.MapleData in project HeavenMS by ronancpl.

the class MCSkillFactory method getMCGuardian.

public static MCGuardian getMCGuardian(int id) {
    guardianLock.readLock().lock();
    try {
        MCGuardian ret = mcGuardians.get(id);
        if (ret != null) {
            return ret;
        }
    } finally {
        guardianLock.readLock().unlock();
    }
    guardianLock.writeLock().lock();
    try {
        MCGuardian ret;
        ret = mcGuardians.get(id);
        if (ret == null) {
            MapleData skillData = mcGuardianRoot.getChildByPath(String.valueOf(id));
            if (skillData != null) {
                int type = MapleDataTool.getInt("type", skillData, 0);
                int spendCP = MapleDataTool.getInt("spendCP", skillData, 0);
                int mobSkillID = MapleDataTool.getInt("mobSkillID", skillData, 0);
                int level = MapleDataTool.getInt("level", skillData, 0);
                ret = new MCGuardian(type, spendCP, mobSkillID, level);
                if (MonsterCarnival.DEBUG) {
                    String name = MapleDataTool.getString("name", skillData, "");
                    String desc = MapleDataTool.getString("desc", skillData, "");
                    ret.setName(name);
                    ret.setDesc(desc);
                }
                mcGuardians.put(type, ret);
            }
        }
        return ret;
    } finally {
        guardianLock.writeLock().unlock();
    }
}
Also used : MapleData(provider.MapleData)

Example 63 with MapleData

use of provider.MapleData in project HeavenMS by ronancpl.

the class MCWZData method populateSkills.

private void populateSkills(MapleData src) {
    for (MapleData n : src) {
        int key = Integer.parseInt(n.getName());
        int val = MapleDataTool.getInt(n);
        skills.put(key, val);
    }
}
Also used : MapleData(provider.MapleData)

Example 64 with MapleData

use of provider.MapleData in project HeavenMS by ronancpl.

the class MCWZData method populateMobGenPos.

private void populateMobGenPos(MapleData src) {
    for (MapleData n : src) {
        MCMobGenPos nn = new MCMobGenPos(MapleDataTool.getInt("x", n, 0), MapleDataTool.getInt("y", n, 0), MapleDataTool.getInt("fh", n, 0), MapleDataTool.getInt("cy", n, 0), MapleDataTool.getInt("team", n, -1));
        mobGenPosList.add(nn);
    }
}
Also used : MapleData(provider.MapleData)

Example 65 with MapleData

use of provider.MapleData in project HeavenMS by ronancpl.

the class MCWZData method populateSummonMobs.

private void populateSummonMobs(MapleData src) {
    for (MapleData n : src) {
        int id = Integer.parseInt(n.getName());
        MCSummonMob mcs = new MCSummonMob(MapleDataTool.getInt("id", n, 0), MapleDataTool.getInt("spendCP", n, 0), MapleDataTool.getInt("mobTime", n, 0));
        this.summons.put(id, mcs);
    }
}
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