1. 怪物血量 百分比显示错误,怪物都是脚本生成的,他的当前生命值和最大生命值可能是 1000000/1000 ,拍卖有个伤害测试打木桩,可以用这个调试,还有目前小怪不能1下打死的情况下都显示血量。。蜗牛也能显示。。 要么干脆搞成判定只显示BOSS,且不是一击必杀的情况下显示

2. 自动扣除道具金币给物品
    道具或者金币   数量     兑换道具或者金币   数量
    比如
    -1   2100000001  4002000  21
    21亿零1的金币  兑换成  21个  4002000
3. 给自己发装备,跳跃jump的属性自动变成段伤属性
4. 多倍 段伤  切割  全部只读背包1个数量   数量没有叠加算

修复
This commit is contained in:
雪风 2025-03-05 14:24:27 +08:00
parent 540c249396
commit 1a457f3bfa
5 changed files with 46 additions and 19 deletions

View File

@ -5679,6 +5679,21 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject implements Se
return possesed;
}
public final int getItemNum(final int itemid) {
final MapleInventoryType type = GameConstants.getInventoryType(itemid);
if (type == MapleInventoryType.EQUIP) {
return this.inventory[MapleInventoryType.EQUIPPED.ordinal()].countById(itemid);
}
final IItem findById = this.inventory[type.ordinal()].findById(itemid);
short quantity = findById.getQuantity();
return quantity;
}
public void dropNPC(final String message) {
this.client.sendPacket(MaplePacketCreator.getNPCTalk(9010000, (byte) 0, message, "00 00", (byte) 0));
}
@ -11812,7 +11827,8 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject implements Se
for (String string : strings) {
boolean b = this.haveItem(Integer.parseInt(string));
if (b) {
Magnification += dd.getInteger(string);
int itemNum = getItemNum(Integer.parseInt(string));
Magnification += (dd.getInteger(string))*itemNum;
}
}
}
@ -11835,27 +11851,28 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject implements Se
public int getDB() {
int re = 0;
JSONObject dd = Start.ConfigValuesJson.getJSONObject("dbbb");
JSONObject ddzb = Start.ConfigValuesJson.getJSONObject("dbzb");
JSONObject dbbb = Start.ConfigValuesJson.getJSONObject("dbbb");
JSONObject dbzb = Start.ConfigValuesJson.getJSONObject("dbzb");
if ((dd == null && ddzb == null) || Start.ConfigValuesJson.getInteger("isdb") == 0) return 0;
if ((dbbb == null && dbzb == null) || Start.ConfigValuesJson.getInteger("isdb") == 0) return 0;
if (dd != null) {
Set<String> strings = dd.keySet();
if (dbbb != null) {
Set<String> strings = dbbb.keySet();
for (String string : strings) {
boolean b = this.haveItem(Integer.parseInt(string));
if (b) {
re += dd.getInteger(string);
int itemNum = getItemNum(Integer.parseInt(string));
re += (dbbb.getInteger(string))*itemNum;
}
}
}
if (ddzb != null) {
Set<String> strings = ddzb.keySet();
if (dbzb != null) {
Set<String> strings = dbzb.keySet();
for (String string : strings) {
boolean b = this.hasEquipped(Integer.parseInt(string));
if (b) {
re += ddzb.getInteger(string);
re += dbzb.getInteger(string);
}
}
}
@ -11880,7 +11897,8 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject implements Se
for (String string : strings) {
boolean b = this.haveItem(Integer.parseInt(string));
if (b) {
re += qgbb.getInteger(string);
int itemNum = getItemNum(Integer.parseInt(string));
re += (qgbb.getInteger(string))*itemNum;
}
}
}

View File

@ -439,10 +439,9 @@ public class DamageParse {
if (monster.getHp() > 0) {
long hp = monster.getHp();
long mobMaxHp = monster.getMobMaxHp();
if (mobMaxHp >Integer.MAX_VALUE){
hp = hp/100;
mobMaxHp = mobMaxHp/100;
long mobMaxHp = monster.getMaxHP();
if (mobMaxHp == 0){
monster.getMobMaxHp();
}
double percentage = ((double) hp / mobMaxHp) * 100; // 显式转换为浮点数并计算百分比‌:ml-citation{ref="1,3" data="citationList"}

View File

@ -176,7 +176,7 @@ public class MapleInventoryManipulator {
if (integers != null) {
if (eItem.getQuantity() >= integers.get(0)) {
int i2 = eItem.getQuantity() / integers.get(0);
c.getPlayer().gainItem(integers.get(1), i2);
c.getPlayer().gainItem(integers.get(1), i2*integers.get(2));
short quantity1 = eItem.getQuantity();
eItem.setQuantity((short) (quantity1 - integers.get(0) * i2));
if (eItem.getQuantity() <= 0) {
@ -230,7 +230,7 @@ public class MapleInventoryManipulator {
if (integers != null) {
if (nItem.getQuantity() >= integers.get(0)) {
int i2 = nItem.getQuantity() / integers.get(0);
c.getPlayer().gainItem(integers.get(1), i2);
c.getPlayer().gainItem(integers.get(1), i2*integers.get(2));
short quantity1 = nItem.getQuantity();
nItem.setQuantity((short) (quantity1 - integers.get(0) * i2));
if (nItem.getQuantity() <= 0) {
@ -669,7 +669,7 @@ public class MapleInventoryManipulator {
if (integers != null) {
if (eItem.getQuantity() >= integers.get(0)) {
int i2 = eItem.getQuantity() / integers.get(0);
c.getPlayer().gainItem(integers.get(1), i2);
c.getPlayer().gainItem(integers.get(1), i2*integers.get(2));
short quantity1 = eItem.getQuantity();
eItem.setQuantity((short) (quantity1 - integers.get(0) * i2));
if (eItem.getQuantity() <= 0) {
@ -703,7 +703,7 @@ public class MapleInventoryManipulator {
if (integers != null) {
if (nItem.getQuantity() >= integers.get(0)) {
int i2 = nItem.getQuantity() / integers.get(0);
c.getPlayer().gainItem(integers.get(1), i2);
c.getPlayer().gainItem(integers.get(1), i2*integers.get(2));
short quantity1 = nItem.getQuantity();
nItem.setQuantity((short) (quantity1 - integers.get(0) * i2));
if (nItem.getQuantity() <= 0) {

View File

@ -65,6 +65,8 @@ public class MapleMonster extends AbstractLoadedMapleLife {
private MapleMonsterStats stats;
private OverrideMonsterStats ostats;
private long hp;
private long hpmax ;
private long nextKill;
private int mp;
private byte venom_counter;
@ -189,6 +191,13 @@ public class MapleMonster extends AbstractLoadedMapleLife {
public final void setHp(final long hp) {
this.hp = hp;
}
public final void setmaxHp(final long maxhp) {
this.hpmax = maxhp;
}
public final long getMaxHP() {
return this.hpmax;
}
public final long getHp() {
return this.hp;

View File

@ -1900,6 +1900,7 @@ public final class MapleMap {
final Point spos = this.calcPointBelow(new Point(pos.x, pos.y - 1));
mob.setPosition(spos);
mob.setHp(hp);
mob.setmaxHp(hp);
this.spawnMonster(mob, spawnType);
}