/** * 道具物件执行 * * @param data 参数 * @param pc 执行者 * @param item 物件 */ @Override public void execute(final int[] data, final L1PcInstance pc, final L1ItemInstance item) { // 不能变身的状态 // 取回觉醒技能ID final int awakeSkillId = pc.getAwakeSkillId(); if ((awakeSkillId == AWAKEN_ANTHARAS) || (awakeSkillId == AWAKEN_FAFURION) || (awakeSkillId == AWAKEN_VALAKAS)) { pc.sendPackets(new S_ServerMessage(1384)); // 目前状态中无法变身。 return; } // 变身时间 (秒)与变身编号 final short time = 900; final short polyId = 3888; // 小巴 (巴风特) L1PolyMorph.doPoly(pc, polyId, time, L1PolyMorph.MORPH_BY_ITEMMAGIC); // 删除道具 pc.getInventory().removeItem(item, 1); }
@Override public void stopSkill(final L1Character cha, final int skillId) { switch (skillId) { case LIGHT: // 法师魔法 (日光术) if (cha instanceof L1PcInstance) { if (!cha.isInvisble()) { final L1PcInstance pc = (L1PcInstance) cha; pc.turnOnOffLight(); } } break; case SHIELD: // 法师魔法 (防护罩) cha.addAc(2); if (cha instanceof L1PcInstance) { final L1PcInstance pc = (L1PcInstance) cha; pc.sendPackets(new S_SkillIconShield(5, 0)); } break; case ENCHANT_WEAPON: // 法师魔法 (拟似魔法武器) cha.addDmgup(-2); break; case CURSE_BLIND: // 法师魔法 (暗盲咒术) case DARKNESS: // 法师魔法 (黑暗之影) if (cha instanceof L1PcInstance) { final L1PcInstance pc = (L1PcInstance) cha; pc.sendPackets(new S_CurseBlind(0)); } break; case BLESSED_ARMOR: // 法师魔法 (铠甲护持) cha.addAc(3); break; case PHYSICAL_ENCHANT_DEX: // 法师魔法 (通畅气脉术):DEX cha.addDex((byte) -5); if (cha instanceof L1PcInstance) { final L1PcInstance pc = (L1PcInstance) cha; pc.sendPackets(new S_Dexup(pc, 5, 0)); } break; case SLOW: // 法师魔法 (缓速) case MASS_SLOW: // 法师魔法 (集体缓速术) if (cha instanceof L1PcInstance) { final L1PcInstance pc = (L1PcInstance) cha; pc.sendPackets(new S_SkillHaste(pc.getId(), 0, 0)); pc.broadcastPacket(new S_SkillHaste(pc.getId(), 0, 0)); } cha.setMoveSpeed(0); break; case MEDITATION: // 法师魔法 (冥想术) if (cha instanceof L1PcInstance) { final L1PcInstance pc = (L1PcInstance) cha; pc.addMpr(-5); } break; case CURSE_PARALYZE: // 法师魔法 (木乃伊的诅咒 if (cha instanceof L1PcInstance) { final L1PcInstance pc = (L1PcInstance) cha; pc.sendPackets(new S_Poison(pc.getId(), 0)); pc.broadcastPacket(new S_Poison(pc.getId(), 0)); pc.sendPackets(new S_Paralysis(S_Paralysis.TYPE_PARALYSIS, false)); } break; case PHYSICAL_ENCHANT_STR: // 法师魔法 (体魄强健术):STR cha.addStr((byte) -5); if (cha instanceof L1PcInstance) { final L1PcInstance pc = (L1PcInstance) cha; pc.sendPackets(new S_Strup(pc, 5, 0)); } break; case HASTE: // 法师魔法 (加速术)(强力加速术) case GREATER_HASTE: cha.setMoveSpeed(0); if (cha instanceof L1PcInstance) { final L1PcInstance pc = (L1PcInstance) cha; pc.sendPackets(new S_SkillHaste(pc.getId(), 0, 0)); pc.broadcastPacket(new S_SkillHaste(pc.getId(), 0, 0)); } break; case WEAKNESS: // 法师魔法 (弱化术) cha.addDmgup(5); cha.addHitup(1); break; case BLESS_WEAPON: // 法师魔法 (祝福魔法武器) cha.addDmgup(-2); cha.addHitup(-2); cha.addBowHitup(-2); break; case ICE_LANCE: // 法师魔法 (冰矛围篱) case FREEZING_BLIZZARD: // 法师魔法 (冰雪飓风) if (cha instanceof L1PcInstance) { final L1PcInstance pc = (L1PcInstance) cha; pc.sendPackets(new S_Poison(pc.getId(), 0)); pc.broadcastPacket(new S_Poison(pc.getId(), 0)); pc.sendPackets(new S_Paralysis(S_Paralysis.TYPE_FREEZE, false)); } else if ((cha instanceof L1MonsterInstance) || (cha instanceof L1SummonInstance) || (cha instanceof L1PetInstance)) { final L1NpcInstance npc = (L1NpcInstance) cha; npc.broadcastPacket(new S_Poison(npc.getId(), 0)); npc.setParalyzed(false); } break; case HOLY_WALK: // 神圣疾走 cha.setBraveSpeed(0); if (cha instanceof L1PcInstance) { final L1PcInstance pc = (L1PcInstance) cha; pc.sendPackets(new S_SkillBrave(pc.getId(), 0, 0)); pc.broadcastPacket(new S_SkillBrave(pc.getId(), 0, 0)); } break; case BERSERKERS: // 法师魔法 (狂暴术) cha.addAc(-10); cha.addDmgup(-5); cha.addHitup(-2); break; case DISEASE: // 法师魔法 (疾病术) cha.addDmgup(6); cha.addAc(-12); break; case FOG_OF_SLEEPING: // 法师魔法 (沉睡之雾) cha.setSleeped(false); if (cha instanceof L1PcInstance) { final L1PcInstance pc = (L1PcInstance) cha; pc.sendPackets(new S_Paralysis(S_Paralysis.TYPE_SLEEP, false)); pc.sendPackets(new S_OwnCharStatus(pc)); } break; case SHAPE_CHANGE: // 法师魔法 (变形术) L1PolyMorph.undoPoly(cha); break; case ABSOLUTE_BARRIER: // 法师魔法 (绝对屏障) if (cha instanceof L1PcInstance) { final L1PcInstance pc = (L1PcInstance) cha; pc.startHpRegeneration(); pc.startMpRegeneration(); pc.startHpRegenerationByDoll(); pc.startMpRegenerationByDoll(); } break; case ADVANCE_SPIRIT: // 法师魔法 (灵魂升华) if (cha instanceof L1PcInstance) { final L1PcInstance pc = (L1PcInstance) cha; pc.addMaxHp(-pc.getAdvenHp()); pc.addMaxMp(-pc.getAdvenMp()); pc.setAdvenHp(0); pc.setAdvenMp(0); pc.sendPackets(new S_HPUpdate(pc.getCurrentHp(), pc.getMaxHp())); if (pc.isInParty()) { // 组队中 pc.getParty().updateMiniHP(pc); } pc.sendPackets(new S_MPUpdate(pc.getCurrentMp(), pc.getMaxMp())); } break; } }