Search in sources :

Example 1 with Disease

use of client.player.buffs.Disease in project HeavenMS by ronancpl.

the class MCParty method applyMCSkill.

/**
 * Applies a MCSkill to the entire team. This is used on the team's own players
 * because it is called when the enemy team uses a debuff/cube of darkness.
 * [MENTION=2000183830]para[/MENTION]m skill Skill to apply.
 * [MENTION=850422]return[/MENTION] True if skill was applied, false otherwise.
 */
public boolean applyMCSkill(MCSkill skill) {
    MobSkill s = MobSkillFactory.getMobSkill(skill.getMobSkillID(), skill.getLevel());
    Disease disease = Disease.getType(skill.getMobSkillID());
    if (disease == null) {
        disease = Disease.DARKNESS;
        // HACK: darkness
        s = MobSkillFactory.getMobSkill(121, 6);
    } else if (disease == Disease.POISON) {
        return false;
    }
    // We only target players on the battlefield map.
    if (skill.getTarget() == 2) {
        for (Player chr : getMembers()) {
            if (MonsterCarnival.isBattlefieldMap(chr.getMapId())) {
                chr.giveDebuff(disease, s);
            }
        }
        return true;
    } else {
        if (getRandomMember() != null) {
            getRandomMember().giveDebuff(disease, 1, 30000L, disease.getDisease(), 1);
            return true;
        } else {
            return false;
        }
    }
}
Also used : Player(client.player.Player) Disease(client.player.buffs.Disease) MobSkill(server.life.MobSkill)

Aggregations

Player (client.player.Player)1 Disease (client.player.buffs.Disease)1 MobSkill (server.life.MobSkill)1