var mobName = cm.getPlayer().getMobNameById(8140500);根据怪物id获取名字

判断大小函数
var a = cm.getPlayer().compareToStrings("100","100");
var b = cm.getPlayer().compareToStrings("1","100");
var c = cm.getPlayer().compareToStrings("100","1");    
结果 a = 0 b=-1 c=1
返回值0 相等 返回值-1第一个小于第二个 返回值1 第一个大于第二个

对切割加深进行操作
addQgjs()
multiplyQgjs()
divideQgjs()

那个报错是没传入有效的字符串参数 要么字符串不是数值 要么字符串为空
This commit is contained in:
雪风 2025-04-09 16:16:12 +08:00
parent 44f242651a
commit 86bd4525af
3 changed files with 15 additions and 14 deletions

View File

@ -7,6 +7,7 @@ import gui.tw.diaoyu.DiaoyuItem;
import gui.tw.rw.XuanShangRenWu;
import gui.tw.rw.rwConfig;
import handling.channel.handler.DamageParse;
import provider.MapleData;
import provider.MapleDataTool;
import server.life.MapleLifeFactory;
import server.shops.MaplePlayerShopItem;
@ -26,7 +27,7 @@ import handling.login.LoginServer;
import handling.world.PlayerBuffStorage;
import handling.world.MapleMessengerCharacter;
import io.netty.channel.Channel;
import tools.MockIOSession;
import tools.*;
import client.inventory.MapleInventoryIdentifier;
import server.maps.MapleFoothold;
@ -74,8 +75,6 @@ import tools.packet.PetPacket;
import java.util.EnumMap;
import tools.HexTool;
import java.util.concurrent.RejectedExecutionException;
import server.FishingRewardFactory.FishingReward;
@ -88,13 +87,10 @@ import server.Timer.MapTimer;
import server.Timer.BuffTimer;
import server.MapleStatEffect;
import server.MapleItemInformationProvider;
import tools.MaplePacketCreator;
import tools.data.MaplePacketLittleEndianWriter;
import server.life.PlayerNPC;
import database.DatabaseException;
import tools.FilePrinter;
import client.inventory.IItem;
import tools.Pair;
import client.inventory.ItemLoader;
import java.util.Iterator;
@ -115,7 +111,6 @@ import java.sql.PreparedStatement;
import java.sql.Connection;
import java.sql.SQLException;
import tools.FileoutputUtil;
import database.DBConPool;
import server.maps.SavedLocationType;
@ -131,8 +126,6 @@ import constants.ServerConfig;
import java.util.ArrayList;
import tools.ConcurrentEnumMap;
import java.util.LinkedHashMap;
import server.maps.Event_PyramidSubway;
@ -12239,23 +12232,31 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject implements Se
}
//字符串相加方法
public static String addStrings(String str1, String str2) {
public String addStrings(String str1, String str2) {
BigInteger bigInteger = new BigInteger(str1);
BigInteger bigInteger1 = new BigInteger(str2);
return bigInteger.add(bigInteger1).toString();
}
//相乘
public static String multiplyStrings(String str1, String str2) {
public String multiplyStrings(String str1, String str2) {
BigInteger bigInteger = new BigInteger(str1);
BigInteger bigInteger1 = new BigInteger(str2);
return bigInteger.multiply(bigInteger1).toString();
}
//
public static String divideStrings(String str1, String str2) {
public String divideStrings(String str1, String str2) {
BigInteger bigInteger = new BigInteger(str1);
BigInteger bigInteger1 = new BigInteger(str2);
return bigInteger.divide(bigInteger1).toString();
}
public int compareToStrings(String str1, String str2) {
BigInteger bigInteger = new BigInteger(str1);
BigInteger bigInteger1 = new BigInteger(str2);
return bigInteger.compareTo(bigInteger1);
}
public String getMobNameById(int id){
return MapleDataTool.getString((id + "/name"), MapleLifeFactory.mobStringData, "未知怪物");
}
}

View File

@ -576,6 +576,7 @@ public class Equip extends Item implements IEquip, Serializable {
this.qgjs = quotient.toString();
}
public void setUpgradeSlots(final byte upgradeSlots) {
this.upgradeSlots = upgradeSlots;
}

View File

@ -549,8 +549,7 @@ public class Drop {
}
public static void main(String[] args) {
MapleData monsterData = MapleLifeFactory.data.getData(StringUtil.getLeftPaddedStr(100102 + ".img", '0', 11));
String string = MapleDataTool.getString((100101 + "/name"), MapleLifeFactory.mobStringData, "MISSINGNO");
String string = MapleDataTool.getString((8140500 + "/name"), MapleLifeFactory.mobStringData, "未知怪物");
System.out.println(string);