当前位置: 首页>>代码示例>>Java>>正文


Java PhantomPacket类代码示例

本文整理汇总了Java中tools.packet.JobPacket.PhantomPacket的典型用法代码示例。如果您正苦于以下问题:Java PhantomPacket类的具体用法?Java PhantomPacket怎么用?Java PhantomPacket使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PhantomPacket类属于tools.packet.JobPacket包,在下文中一共展示了PhantomPacket类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: unchooseStolenSkill

import tools.packet.JobPacket.PhantomPacket; //导入依赖的package包/类
public void unchooseStolenSkill(int skillID) { //base skill
    if (skillisCooling(20031208) || stolenSkills == null) {
        dropMessage(-6, "[Loadout] The skill is under cooldown. Please wait.");
        return;
    }
    final int stolenjob = GameConstants.getJobNumber(skillID / 10000);
    boolean changed = false;
    for (Pair<Integer, Boolean> sk : stolenSkills) {
        if (sk.right && GameConstants.getJobNumber(sk.left / 10000) == stolenjob) {
            cancelStolenSkill(sk.left);
            sk.right = false;
            changed = true;
        }
    }
    if (changed) {
        final Skill skil = SkillFactory.getSkill(skillID);
        changeSkillLevel_Skip(skil, getSkillLevel(skil), (byte) 0);
        client.getSession().write(PhantomPacket.replaceStolenSkill(GameConstants.getStealSkill(stolenjob), 0));
    }
}
 
开发者ID:ergothvs,项目名称:Lucid2.0,代码行数:21,代码来源:MapleCharacter.java

示例2: chooseStolenSkill

import tools.packet.JobPacket.PhantomPacket; //导入依赖的package包/类
public void chooseStolenSkill(int skillID) {
    if (skillisCooling(20031208) || stolenSkills == null) {
        dropMessage(-6, "[Loadout] The skill is under cooldown. Please wait.");
        return;
    }
    final Pair<Integer, Boolean> dummy = new Pair<>(skillID, false);
    if (stolenSkills.contains(dummy)) {
        unchooseStolenSkill(skillID);
        stolenSkills.get(stolenSkills.indexOf(dummy)).right = true;

        client.getSession().write(PhantomPacket.replaceStolenSkill(GameConstants.getStealSkill(GameConstants.getJobNumber(skillID / 10000)), skillID));
        //if (ServerConstants.CUSTOM_SKILL) {
        //    client.getSession().write(MaplePacketCreator.skillCooldown(20031208, 5));
        //    addCooldown(20031208, System.currentTimeMillis(), 5000);
        //}
    }
}
 
开发者ID:ergothvs,项目名称:Lucid2.0,代码行数:18,代码来源:MapleCharacter.java

示例3: attackCarte

import tools.packet.JobPacket.PhantomPacket; //导入依赖的package包/类
public void attackCarte(final MapleStatEffect eff, final int oid, final int x) {
    if (x > 0) {
        lastBerserkTime += x; //lol unused variable.
        map.broadcastMessage(PhantomPacket.getCarteAnimation(id, oid, job, (int) lastBerserkTime, x));
        client.getSession().write(PhantomPacket.updateCardStack(currentBattleshipHP()));
    }
}
 
开发者ID:ergothvs,项目名称:Lucid2.0,代码行数:8,代码来源:MapleCharacter.java

示例4: handleCardStack

import tools.packet.JobPacket.PhantomPacket; //导入依赖的package包/类
public void handleCardStack() {
    Skill noir = SkillFactory.getSkill(24120002);
    Skill blanc = SkillFactory.getSkill(24100003);
    MapleStatEffect ceffect = null;
    int advSkillLevel = getTotalSkillLevel(noir);
    boolean isAdv = false;
if (advSkillLevel > 0) {
    ceffect = noir.getEffect(advSkillLevel);
    isAdv = true;
} else if (getSkillLevel(blanc) > 0) {
    ceffect = blanc.getEffect(getTotalSkillLevel(blanc));
} else {
    return;
}
if (getJob() == 2412 && getCardStack() == 40){
    this.runningStack = 0;
    this.cardStack = (byte)(40);
}
if (getJob() == 2400 && getCardStack() == 20 || getJob() == 2410 && getCardStack() == 20 || getJob() == 2411 && getCardStack() == 20){
    this.runningStack = 0;
    this.cardStack = (byte)(20);
}
if (ceffect.makeChanceResult()) {
        if (this.cardStack < (getJob() == 2412 ? 40 : 20)) {
    this.cardStack = (byte)(this.cardStack + 1);
    }
        this.runningStack += 1;
        this.client.getSession().write(PhantomPacket.gainCardStack(getId(), this.runningStack, isAdv ? 2 : 1, ceffect.getSourceId(), Randomizer.rand(100000, 500000), 1));
        this.client.getSession().write(PhantomPacket.updateCardStack(this.cardStack));
    }
}
 
开发者ID:ergothvs,项目名称:Lucid2.0,代码行数:32,代码来源:MapleCharacter.java

示例5: addStolenSkill

import tools.packet.JobPacket.PhantomPacket; //导入依赖的package包/类
public void addStolenSkill(int skillID, int skillLevel) {
    if (skillisCooling(20031208) || stolenSkills == null) {
        dropMessage(-6, "[Loadout] The skill is under cooldown. Please wait.");
        return;
    }
    final Pair<Integer, Boolean> dummy = new Pair<>(skillID, true);
    final Skill skil = SkillFactory.getSkill(skillID);
    if (!stolenSkills.contains(dummy) && GameConstants.canSteal(skil)) {
        dummy.right = false;
        skillLevel = Math.min(skil.getMaxLevel(), skillLevel);
        final int jobid = GameConstants.getJobNumber(skillID / 10000);
        if (!stolenSkills.contains(dummy) && getSkillLevel(GameConstants.getStealSkill(jobid)) > 0) {
            int count = 0;
            skillLevel = Math.min(getSkillLevel(GameConstants.getStealSkill(jobid)), skillLevel);
            for (Pair<Integer, Boolean> sk : stolenSkills) {
                if (GameConstants.getJobNumber(sk.left / 10000) == jobid) {
                    count++;
                }
            }
            if (count < GameConstants.getNumSteal(jobid)) {
                stolenSkills.add(dummy);
                changed_skills = true;
                changeSkillLevel_Skip(skil, skillLevel, (byte) skillLevel);
                client.getSession().write(PhantomPacket.addStolenSkill(jobid, count, skillID, skillLevel));
                //client.getSession().write(MaplePacketCreator.updateStolenSkills(this, jobid));
            }
        }
    }
}
 
开发者ID:ergothvs,项目名称:Lucid2.0,代码行数:30,代码来源:MapleCharacter.java

示例6: handleCardStack

import tools.packet.JobPacket.PhantomPacket; //导入依赖的package包/类
public void handleCardStack() {
    Skill noir = SkillFactory.getSkill(24120002);
    Skill blanc = SkillFactory.getSkill(24100003);
    MapleStatEffect ceffect;
    int advSkillLevel = getTotalSkillLevel(noir);
    boolean isAdv = false;
    if (advSkillLevel > 0) {
        ceffect = noir.getEffect(advSkillLevel);
        isAdv = true;
    } else if (getSkillLevel(blanc) > 0) {
        ceffect = blanc.getEffect(getTotalSkillLevel(blanc));
    } else {
        return;
    }
    if (getJob() == 2412 && getCardStack() == 40) {
        return;
    }
    if (getJob() == 2400 && getCardStack() == 20 || getJob() == 2410 && getCardStack() == 20 || getJob() == 2411 && getCardStack() == 20) {
        return;
    }
    if (ceffect.makeChanceResult()) {
        if (this.cardStack < (getJob() == 2412 ? 40 : 20)) {
            this.cardStack = (byte) (this.cardStack + 1);
        }
        this.runningStack += 1;
        this.client.getSession().write(PhantomPacket.gainCardStack(getId(), this.runningStack, isAdv ? 2 : 1, ceffect.getSourceId(), Randomizer.rand(100000, 500000), 1));
        this.client.getSession().write(PhantomPacket.updateCardStack(this.cardStack));
    }
}
 
开发者ID:skorch37,项目名称:Asteria,代码行数:30,代码来源:MapleCharacter.java

示例7: removeStolenSkill

import tools.packet.JobPacket.PhantomPacket; //导入依赖的package包/类
public void removeStolenSkill(int skillID) {
    if (skillisCooling(20031208) || stolenSkills == null) {
        dropMessage(-6, "[Loadout] The skill is under cooldown. Please wait.");
        return;
    }
    final int jobid = GameConstants.getJobNumber(skillID / 10000);
    final Pair<Integer, Boolean> dummy = new Pair<>(skillID, false);
    int count = -1, cc = 0;
    for (int i = 0; i < stolenSkills.size(); i++) {
        if (stolenSkills.get(i).left == skillID) {
            if (stolenSkills.get(i).right) {
                unchooseStolenSkill(skillID);
            }
            count = cc;
            break;
        } else if (GameConstants.getJobNumber(stolenSkills.get(i).left / 10000) == jobid) {
            cc++;
        }
    }
    if (count >= 0) {
        cancelStolenSkill(skillID);
        stolenSkills.remove(dummy);
        dummy.right = true;
        stolenSkills.remove(dummy);
        changed_skills = true;
        changeSkillLevel_Skip(SkillFactory.getSkill(skillID), 0, (byte) 0);
        //hacky process begins here
        client.getSession().write(PhantomPacket.replaceStolenSkill(GameConstants.getStealSkill(jobid), 0));
        for (int i = 0; i < GameConstants.getNumSteal(jobid); i++) {
            client.getSession().write(PhantomPacket.removeStolenSkill(jobid, i));
        }
        count = 0;
        for (Pair<Integer, Boolean> sk : stolenSkills) {
            if (GameConstants.getJobNumber(sk.left / 10000) == jobid) {
                client.getSession().write(PhantomPacket.addStolenSkill(jobid, count, sk.left, getSkillLevel(sk.left)));
                if (sk.right) {
                    client.getSession().write(PhantomPacket.replaceStolenSkill(GameConstants.getStealSkill(jobid), sk.left));
                }
                count++;
            }
        }
        client.getSession().write(PhantomPacket.removeStolenSkill(jobid, count));
        //client.getSession().write(MaplePacketCreator.updateStolenSkills(this, jobid));
    }
}
 
开发者ID:ergothvs,项目名称:Lucid2.0,代码行数:46,代码来源:MapleCharacter.java


注:本文中的tools.packet.JobPacket.PhantomPacket类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。