2014年2月1日 星期六

【Java教學】龍騎士 死騎 鎖鏈劍 一格攻擊

龍騎士 死騎 鎖鏈劍 一格攻擊
一格攻擊是參考(3.8TW S_SkillIconGFX)

L1PolyMorph.java

尋找

if ((pc.getTempCharGfx() == 6034) || (pc.getTempCharGfx() == 6035) || !isMatchCause(polyId, cause)) {
if (cantPolyMessage) {
  pc.sendPackets(new S_ServerMessage(181)); // \f1無法變成你指定的怪物。
} else {
  pc.sendPackets(new S_ServerMessage(79));
}
return; 
}

下面新增:

if (polyId == 6142 || polyId == 6147 || polyId == 6152 || polyId == 6157
|| polyId == 9205 || polyId == 9206 || polyId == 6775 || polyId == 6137
|| polyId == 3784 || polyId == 11232 || polyId == 11234 || polyId == 11236
|| polyId == 11375 || polyId == 11623 || polyId == 11631 || polyId == 11653
|| polyId == 11735 || polyId == 12229 || polyId == 12230 || polyId == 12231
|| polyId == 12232){
if (pc.getInventory().getTypeEquipped(1, 18) == 1) {
  pc.setCurrentWeapon(83);
                pc.sendPackets(new S_SkillIconGFX(polyId, true));
}
}

尋找並新增:

// 解除變身
public static void undoPoly(L1Character cha) {
           if (cha instanceof L1PcInstance) {
   L1PcInstance pc = (L1PcInstance) cha;
   int classId = pc.getClassId();
   
   if (pc.getInventory().getTypeEquipped(1, 18) == 1) {   // <---新增
    pc.setCurrentWeapon(24);                       // <---新增
   }                                                      // <---新增
   
   pc.setTempCharGfx(classId);
   if (!pc.isDead()) {  
    pc.sendPackets(new S_ChangeShape(pc.getId(), classId, pc.getCurrentWeapon()));
    pc.broadcastPacket(new S_ChangeShape(pc.getId(), classId, pc.getCurrentWeapon()));
   }
                        pc.sendPackets(new S_SkillIconGFX(classId, false));    // <---新增



L1EquipmentSlot.java

新增宣告:

import l1j.server.server.serverpackets.S_SkillIconGFX;

尋找
          weapon.startEquipmentTimer(_owner);

整句修改成:

         int polyId = _owner.getTempCharGfx();
  if (polyId == 6142 || polyId == 6147 || polyId == 6152 || polyId == 6157
     || polyId == 9205 || polyId == 9206 || polyId == 6775 || polyId == 6137
     || polyId == 3784 || polyId == 11232 || polyId == 11234 || polyId == 11236
     || polyId == 11375 || polyId == 11623 || polyId == 11631 || polyId == 11653
     || polyId == 11735 || polyId == 12229 || polyId == 12230 || polyId == 12231
     || polyId == 12232){
   if (weapon.getItem().getType1() == 24){
    _owner.setCurrentWeapon(83);
    _owner.sendPackets(new S_SkillIconGFX(polyId, true));
   }else {
       _owner.setCurrentWeapon(weapon.getItem().getType1());
   }
  }else {
      _owner.setCurrentWeapon(weapon.getItem().getType1());
  }
  weapon.startEquipmentTimer(_owner);     

尋找並新增:

         private void removeWeapon(L1ItemInstance weapon) {
  int itemId = weapon.getItem().getItemId();
  _owner.setWeapon(null);
  _owner.setCurrentWeapon(0);
  int polyId = _owner.getTempCharGfx();                    // <---新增
  _owner.sendPackets(new S_SkillIconGFX(polyId, false));   // <---新增


S_SkillIconGFX.java

新增:

        public S_SkillIconGFX(int i, boolean changeWeapon) {
  writeC(Opcodes.S_OPCODE_SKILLICONGFX);
  writeC(0xa0);
  if (changeWeapon == true) {
   writeC(1);
  }else{
   writeC(0);
  }
  writeH(0);
  writeC(2);
  writeH(i);
}


DB 部分:

polymorphs 

尋找

polyid == 6142 || polyid == 6147 || polyid == 6152 || polyid == 6157
|| polyid == 9205 || polyid == 9206 || polyid == 6775 || polyid == 6137
|| polyid == 3784 || polyid == 11232 || polyid == 11234 || polyid == 11236
|| polyid == 11375 || polyid == 11623 || polyid == 11631 || polyid == 11653
|| polyid == 11735 || polyid == 12229 || polyid == 12230 || polyid == 12231
|| polyid == 12232




weaponequip 

751

改成

1791




OVER
文章出處 浪漫物語網路社區

沒有留言:

張貼留言