2016年9月7日 星期三

血魔突破32767[成功!]
















C_CommonClick


// ↓ 最大血量修改
if (currenthp < 1) {
currenthp = 1;
} else if (currenthp > 2147483647) {
currenthp = 2147483647;
}

int currentmp = rs.getInt("CurMp");

if (currentmp < 1) {
currentmp = 1;
} else if (currentmp > 2147483647) {
currentmp = 2147483647;
}
// end


C_Attr


  case 322: // 是否要復活? (Y/N) c = readC(); L1PcInstance resusepc2 = (L1PcInstance) L1World.getInstance().findObject(pc.getTempID()); pc.setTempID(0); if (resusepc2 != null) { // 祝福された 復活スクロール、リザレクション、グレーター リザレクション if (c == 0) { // No } else if (c == 1) { // Yes resurrection( pc, resusepc2, (short) pc.getMaxHp()); // EXPロストしている、G-RESを掛けられた、EXPロストした死亡 // 全てを満たす場合のみEXP復旧 if (pc.getExpRes() == 1 && pc.isGres() && pc.isGresValid()) { pc.resExp(); pc.setExpRes(0); pc.setGres(false); } } } break;

L1Character


private short _maxHp = 0; // ● MAXHP(1~32767)

private int _trueMaxHp = 0; // ● 本当のMAXHP

public short getMaxHp() {
return _maxHp;
}

public void setMaxHp(int hp) {
_trueMaxHp = hp;
_maxHp = (short) IntRange.ensure(_trueMaxHp, 1, 32767);
_currentHp = Math.min(_currentHp, _maxHp);
}

public void addMaxHp(int i) {
setMaxHp(_trueMaxHp + i);
}

private short _maxMp = 0; // ● MAXMP(0~32767)

private int _trueMaxMp = 0; // ● 本当のMAXMP

public short getMaxMp() {
return _maxMp;
}

public void setMaxMp(int mp) {
_trueMaxMp = mp;
_maxMp = (short) IntRange.ensure(_trueMaxMp, 0, 32767);
_currentMp = Math.min(_currentMp, _maxMp);
}

public void addMaxMp(int i) {
setMaxMp(_trueMaxMp + i);
}

改成

// 血魔破萬修改
private int _maxHp = 0; // ● MAXHP(1~32767)
private int _trueMaxHp = 0; // ● 本当のMAXHP

public int getMaxHp() {
return _maxHp;
}

public void setMaxHp(int hp) {
_trueMaxHp = hp;
_maxHp = (int) IntRange.ensure(_trueMaxHp, 1, 2147483647);
_currentHp = Math.min(_currentHp, _maxHp);
}

public void addMaxHp(int i) {
setMaxHp(_trueMaxHp + i);
}

private int _maxMp = 0; // ● MAXMP(0~32767)
private int _trueMaxMp = 0; // ● 本当のMAXMP

public int getMaxMp() {
return _maxMp;
}

public void setMaxMp(int mp) {
_trueMaxMp = mp;
_maxMp = (int ) IntRange.ensure(_trueMaxMp, 0, 2147483647);
_currentMp = Math.min(_currentMp, _maxMp);
}

public void addMaxMp(int i) {
setMaxMp(_trueMaxMp + i);
}

L1PcInstance


private short _baseMaxHp = 0; // ● MAXHPベース(1~32767)

public short getBaseMaxHp() {
return _baseMaxHp;
}

public void addBaseMaxHp(short i) {
i += _baseMaxHp;
if (i >= 32767) {
i = 32767;
}
else if (i < 1) {
i = 1;
}
addMaxHp(i - _baseMaxHp);
_baseMaxHp = i;
}

private short _baseMaxMp = 0; // ● MAXMPベース(0~32767)

public short getBaseMaxMp() {
return _baseMaxMp;
}

public void addBaseMaxMp(short i) {
i += _baseMaxMp;
if (i >= 32767) {
i = 32767;
}
else if (i < 0) {
i = 0;
}
addMaxMp(i - _baseMaxMp);
_baseMaxMp = i;
}

改成

 /* HP.MP上限直達2147483647 by dens */ private int _baseMaxHp = 0; // ● MAXHPベース(1~32767) public int getBaseMaxHp() { return _baseMaxHp; } public void addBaseMaxHp(int i) { i += _baseMaxHp; if (i >= 2147483647) { i = 2147483647; } else if (i < 1) { i = 1; } addMaxHp(i - _baseMaxHp); _baseMaxHp = i; } private int _baseMaxMp = 0; // ● MAXMPベース(0~32767) public int getBaseMaxMp() { return _baseMaxMp; } public void addBaseMaxMp(int i) { i += _baseMaxMp; if (i >= 2147483647) { i = 2147483647; } else if (i < 0) { i = 0; } addMaxMp(i - _baseMaxMp); _baseMaxMp = i; } /* end */


S_HPUpdate

整個改成

/**
 *                            License
 * THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS
 * CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE").
 * THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW.
 * ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR
 * COPYRIGHT LAW IS PROHIBITED.
 *
 * BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND
 * AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE
 * MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED
 * HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
 *
 */
package l1j.server.server.serverpackets;

import l1j.server.server.Opcodes;
import l1j.server.server.model.Instance.L1PcInstance;
import l1j.server.server.utils.IntRange;

public class S_HPUpdate extends ServerBasePacket {

private static final IntRange hpRange = new IntRange(1, 2147483647); // 血魔破萬修改

public S_HPUpdate(int currentHp, int maxHp) {
buildPacket(currentHp, maxHp);
}

public S_HPUpdate(L1PcInstance pc) {
buildPacket(pc.getCurrentHp(), pc.getMaxHp());
}

public void buildPacket(int currentHp, int maxHp) {
writeC(Opcodes.S_OPCODE_HPUPDATE);
writeH(hpRange.ensure(currentHp));
writeH(hpRange.ensure(maxHp));
// writeC(0);
// writeD(GameTimeController.getInstance().getGameTime());
}

@Override
public byte[] getContent() {
return getBytes();
}
}


S_MPUpdate

整個改成

/**
 *                            License
 * THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS
 * CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE").
 * THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW.
 * ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR
 * COPYRIGHT LAW IS PROHIBITED.
 *
 * BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND
 * AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE
 * MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED
 * HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
 *
 */
package l1j.server.server.serverpackets;

import l1j.server.server.Opcodes;

public class S_MPUpdate extends ServerBasePacket {
public S_MPUpdate(int currentmp, int maxmp) {
writeC(Opcodes.S_OPCODE_MPUPDATE);

// 血魔破萬修改
if (currentmp < 0) {
writeH(0);
} else if (currentmp > 2147483647) {
writeH(2147483647);
} else {
writeH(currentmp);
}

if (maxmp < 1) {
writeH(1);
} else if (maxmp > 2147483647) {
writeH(2147483647);
} else {
writeH(maxmp);
}
// end

// writeH(currentmp);
// writeH(maxmp);
// writeC(0);
// writeD(GameTimeController.getInstance().getGameTime());
}

@Override
public byte[] getContent() {
return getBytes();
}
}









沒有留言:

張貼留言