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;
}
}
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();
}
}
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);
}
}
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);
}
}
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);
}
}
Aggregations