use of client.Skill in project HeavenMS by ronancpl.
the class MapleStatEffect method applyMonsterBuff.
private void applyMonsterBuff(MapleCharacter applyfrom) {
Rectangle bounds = calculateBoundingBox(applyfrom.getPosition(), applyfrom.isFacingLeft());
List<MapleMapObject> affected = applyfrom.getMap().getMapObjectsInRect(bounds, Arrays.asList(MapleMapObjectType.MONSTER));
Skill skill_ = SkillFactory.getSkill(sourceid);
int i = 0;
for (MapleMapObject mo : affected) {
MapleMonster monster = (MapleMonster) mo;
if (isDispel()) {
monster.debuffMob(skill_.getId());
} else {
if (makeChanceResult()) {
monster.applyStatus(applyfrom, new MonsterStatusEffect(getMonsterStati(), skill_, null, false), isPoison(), getDuration());
if (isCrash()) {
monster.debuffMob(skill_.getId());
}
}
}
i++;
if (i >= mobCount) {
break;
}
}
}
use of client.Skill in project HeavenMS by ronancpl.
the class NPCConversationManager method maxMastery.
public void maxMastery() {
for (MapleData skill_ : MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/" + "String.wz")).getData("Skill.img").getChildren()) {
try {
Skill skill = SkillFactory.getSkill(Integer.parseInt(skill_.getName()));
getPlayer().changeSkillLevel(skill, (byte) 0, skill.getMaxLevel(), -1);
} catch (NumberFormatException nfe) {
nfe.printStackTrace();
break;
} catch (NullPointerException npe) {
npe.printStackTrace();
continue;
}
}
}
use of client.Skill in project HeavenMS by ronancpl.
the class SkillAction method run.
@Override
public void run(MapleCharacter chr, Integer extSelection) {
for (SkillData skill : skillData.values()) {
Skill skillObject = SkillFactory.getSkill(skill.getId());
if (skillObject == null)
continue;
boolean shouldLearn = false;
if (skill.jobsContains(chr.getJob()) || skillObject.isBeginnerSkill())
shouldLearn = true;
byte skillLevel = (byte) Math.max(skill.getLevel(), chr.getSkillLevel(skillObject));
int masterLevel = Math.max(skill.getMasterLevel(), chr.getMasterLevel(skillObject));
if (shouldLearn) {
chr.changeSkillLevel(skillObject, skillLevel, masterLevel, -1);
}
}
}
use of client.Skill in project powerbot by powerbot.
the class Skills method experiences.
public int[] experiences() {
final Client client = ctx.client();
if (client == null) {
return new int[0];
}
final PlayerFacade info = client.getPlayerFacade();
final Skill[] skills;
if (info == null || (skills = info.getSkills()) == null) {
return new int[0];
}
final int[] levels = new int[skills.length];
for (int i = 0; i < skills.length; i++) {
final Skill s = skills[i];
if (!s.isNull()) {
levels[i] = s.getExperience();
}
}
return levels;
}
use of client.Skill in project HeavenMS by ronancpl.
the class MapleStatEffect method calcMPChange.
private int calcMPChange(MapleCharacter applyfrom, boolean primary) {
int mpchange = 0;
if (mp != 0) {
if (primary) {
mpchange += alchemistModifyVal(applyfrom, mp, true);
} else {
mpchange += mp;
}
}
if (mpR != 0) {
mpchange += (int) (applyfrom.getCurrentMaxMp() * mpR);
}
if (primary) {
if (mpCon != 0) {
double mod = 1.0;
boolean isAFpMage = applyfrom.getJob().isA(MapleJob.FP_MAGE);
boolean isCygnus = applyfrom.getJob().isA(MapleJob.BLAZEWIZARD2);
boolean isEvan = applyfrom.getJob().isA(MapleJob.EVAN7);
if (isAFpMage || isCygnus || isEvan || applyfrom.getJob().isA(MapleJob.IL_MAGE)) {
Skill amp = isAFpMage ? SkillFactory.getSkill(FPMage.ELEMENT_AMPLIFICATION) : (isCygnus ? SkillFactory.getSkill(BlazeWizard.ELEMENT_AMPLIFICATION) : (isEvan ? SkillFactory.getSkill(Evan.MAGIC_AMPLIFICATION) : SkillFactory.getSkill(ILMage.ELEMENT_AMPLIFICATION)));
int ampLevel = applyfrom.getSkillLevel(amp);
if (ampLevel > 0) {
mod = amp.getEffect(ampLevel).getX() / 100.0;
}
}
mpchange -= mpCon * mod;
if (applyfrom.getBuffedValue(MapleBuffStat.INFINITY) != null) {
mpchange = 0;
} else if (applyfrom.getBuffedValue(MapleBuffStat.CONCENTRATE) != null) {
mpchange -= (int) (mpchange * (applyfrom.getBuffedValue(MapleBuffStat.CONCENTRATE).doubleValue() / 100));
}
}
}
if (sourceid == SuperGM.HEAL_PLUS_DISPEL) {
mpchange += (applyfrom.getMaxMp() - applyfrom.getMp());
}
return mpchange;
}
Aggregations