Search in sources :

Example 11 with Skill

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;
        }
    }
}
Also used : Skill(client.Skill) MonsterStatusEffect(client.status.MonsterStatusEffect) Rectangle(java.awt.Rectangle) MapleMapObject(server.maps.MapleMapObject) Point(java.awt.Point) MapleMonster(server.life.MapleMonster)

Example 12 with Skill

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;
        }
    }
}
Also used : Skill(client.Skill) MapleData(provider.MapleData) File(java.io.File)

Example 13 with Skill

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);
        }
    }
}
Also used : Skill(client.Skill)

Example 14 with Skill

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;
}
Also used : Skill(org.powerbot.bot.rt6.client.Skill) PlayerFacade(org.powerbot.bot.rt6.client.PlayerFacade) Client(org.powerbot.bot.rt6.client.Client)

Example 15 with Skill

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;
}
Also used : Skill(client.Skill) Point(java.awt.Point)

Aggregations

Skill (client.Skill)23 MapleCharacter (client.MapleCharacter)12 Point (java.awt.Point)9 MapleStatEffect (server.MapleStatEffect)9 Item (client.inventory.Item)6 ArrayList (java.util.ArrayList)6 MapleMonster (server.life.MapleMonster)6 MonsterStatusEffect (client.status.MonsterStatusEffect)5 MobSkill (server.life.MobSkill)4 MapleMap (server.maps.MapleMap)4 MapleItemInformationProvider (server.MapleItemInformationProvider)3 Equip (client.inventory.Equip)2 ScrollResult (client.inventory.Equip.ScrollResult)2 MapleInventory (client.inventory.MapleInventory)2 MapleInventoryType (client.inventory.MapleInventoryType)2 ModifyInventory (client.inventory.ModifyInventory)2 File (java.io.File)2 SQLException (java.sql.SQLException)2 List (java.util.List)2 Client (org.powerbot.bot.rt6.client.Client)2