1234567 完成

This commit is contained in:
雪风 2025-03-27 16:23:20 +08:00
parent 9fd47e9e82
commit 6451e23396
27 changed files with 1295 additions and 95 deletions

View File

@ -1,6 +1,11 @@
package client; package client;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import gui.tw.diaoyu.BL;
import gui.tw.diaoyu.DiaoyuItem;
import gui.tw.rw.XuanShangRenWu;
import provider.MapleDataTool;
import server.life.MapleLifeFactory;
import server.shops.MaplePlayerShopItem; import server.shops.MaplePlayerShopItem;
import client.inventory.Equip; import client.inventory.Equip;
import gui.jyhss.jyhwpss; import gui.jyhss.jyhwpss;
@ -23,7 +28,6 @@ import client.inventory.MapleInventoryIdentifier;
import server.maps.MapleFoothold; import server.maps.MapleFoothold;
import java.math.BigInteger; import java.math.BigInteger;
import java.util.Comparator;
import client.inventory.MapleRing.RingComparator; import client.inventory.MapleRing.RingComparator;
import client.inventory.Item; import client.inventory.Item;
@ -370,6 +374,8 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject implements Se
private boolean 吸怪状态; private boolean 吸怪状态;
private List<LifeMovementFragment> lastres; private List<LifeMovementFragment> lastres;
private MapleCharacter(final boolean ChannelServer) { private MapleCharacter(final boolean ChannelServer) {
this.teleportname = ""; this.teleportname = "";
this.nowmacs = ""; this.nowmacs = "";
@ -1983,6 +1989,92 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject implements Se
} }
} }
int i = 0;
public void startFishingTask2(final boolean VIP) {
try {
final int time = Start.diaoyuConfig.getDyjg();
this.cancelFishingTask();
i = 0;
this.fishing = EtcTimer.getInstance().register((Runnable) new Runnable() {
@Override
public void run() {
//是否用的高级鱼饵
final boolean expMulti = MapleCharacter.this.haveItem(Start.diaoyuConfig.getGjye(), 1, false, true);
if (!expMulti && !MapleCharacter.this.haveItem(Start.diaoyuConfig.getPtye(), 1, false, true)) {
MapleCharacter.this.cancelFishingTask();
if (i >0){
MapleCharacter.this.getClient().sendPacket(MaplePacketCreator.cancelChair(-1));
}
return;
}
i++;
MapleInventoryManipulator.removeById(MapleCharacter.this.client, MapleInventoryType.USE, expMulti ? Start.diaoyuConfig.getGjye() : Start.diaoyuConfig.getPtye(), 1, false, false);
DiaoyuItem item1 = Start.diaoyuConfig.getItem(expMulti);
int num = item1.getnum();
List<BL> bls = Start.diaoyuConfig.getBls();
int bl = 0;
for (BL blobj : bls) {
// int itemNum = 1;
if (Start.diaoyuConfig.getBldj()== 1) {
// itemNum = MapleCharacter.this.getItemNum(blobj.getItemId());
bl += (blobj.getBl());
}else {
bl = Math.max(bl, (blobj.getBl()));
}
}
num = (num + (num*bl/100));
switch (item1.getItemId()) {
case 0:
MapleCharacter.this.gainMeso(num, true);
MapleCharacter.this.client.sendPacket(UIPacket.fishingUpdate((byte) 1, num));
break;
case -1:
MapleCharacter.this.gainExp(num, true, false, true);
MapleCharacter.this.client.sendPacket(UIPacket.fishingUpdate((byte) 2, num));
break;
case -2:
MapleCharacter.this.modifyCSPoints(2, num, true);
break;
case -3:
MapleCharacter.this.modifyCSPoints(1, num, true);
break;
default:
if (!MapleInventoryManipulator.checkSpace(MapleCharacter.this.client, item1.getItemId(), num, MapleCharacter.this.getName())) {
if (Start.diaoyuConfig.getKjbzdc()==1){
final IItem idrop = new Item(item1.getItemId(), (short) 0, (short)num , (byte) 0);
Point dropPos = new Point(MapleCharacter.this.getPosition());
MapleCharacter.this.getMap().spawnItemDrop((MapleMapObject) MapleCharacter.this, MapleCharacter.this, idrop, dropPos, true, true);
}else {
MapleCharacter.this.client.sendPacket(MaplePacketCreator.serverNotice(5, "你的背包已满"));
MapleCharacter.this.cancelFishingTask();
c.sendPacket(MaplePacketCreator.cancelChair(-1));
return;
}
}else {
MapleInventoryManipulator.addById(MapleCharacter.this.client, item1.getItemId(), (short) num, GameConstants.isChair(item1.getItemId()) ? MapleCharacter.this.getName() : null, null, 0l);
MapleCharacter.this.client.sendPacket(UIPacket.fishingUpdate((byte) 0, item1.getItemId()));
}
break;
}
if (Start.diaoyuConfig.getDytx()==1) {
MapleCharacter.this.map.broadcastMessage(UIPacket.fishingCaught(MapleCharacter.this.id));
}
if (item1.getNotice() == 1){
String s = MapleCharacter.this.getName();
String d =item1.getItemName() + " x " + num;
String replace = Start.diaoyuConfig.getNotice().replace("%s", s).replace("%d", d);
World.Broadcast.broadcastMessage(MaplePacketCreator.serverNotice(6, replace));
}
}
}, (long) time, (long) time);
} catch (RejectedExecutionException ex) {
}
}
public void cancelMapTimeLimitTask() { public void cancelMapTimeLimitTask() {
if (this.mapTimeLimitTask != null) { if (this.mapTimeLimitTask != null) {
this.mapTimeLimitTask.cancel(false); this.mapTimeLimitTask.cancel(false);
@ -12009,6 +12101,51 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject implements Se
return re; return re;
} }
public BigInteger getQGjs() {
BigInteger re = BigInteger.ZERO;
JSONObject qgbb = Start.ConfigValuesJson.getJSONObject("qgjsbb");
JSONObject qgzb = Start.ConfigValuesJson.getJSONObject("qgjszb");
if (Start.ConfigValuesJson.getInteger("isqgjs") == 0) {
return null;
}
if (qgbb != null) {
Set<String> strings = qgbb.keySet();
for (String string : strings) {
boolean b = this.haveItem(Integer.parseInt(string));
if (b) {
int itemNum = getItemNum(Integer.parseInt(string));
BigInteger qgbbValue = new BigInteger(qgbb.getString(string));
BigInteger itemNumBigInt = new BigInteger(Integer.toString(itemNum));
re = re.add(qgbbValue.multiply(itemNumBigInt));
}
}
}
if (qgzb != null) {
Set<String> strings = qgzb.keySet();
for (String string : strings) {
boolean b = this.hasEquipped(Integer.parseInt(string));
if (b) {
BigInteger qgzbValue = new BigInteger(qgzb.getString(string));
re = re.add(qgzbValue);
}
}
}
List<Equip> equList = this.getEquList();
for (Equip equip : equList) {
BigInteger equipQG = new BigInteger(equip.getqgjs());
re = re.add(equipQG);
}
if ( re.compareTo(BigInteger.ZERO)<=0) return null;
return re;
}
public int getBSJL() { public int getBSJL() {
int re = 0; int re = 0;
if (Start.bskg == 0) { if (Start.bskg == 0) {
@ -12021,4 +12158,50 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject implements Se
if (re >10000)re = 10000; if (re >10000)re = 10000;
return re; return re;
} }
public void jqxsrw() {
if (Start.xsRW.get(this.id) ==null){
XuanShangRenWu xsRW = new XuanShangRenWu();
xsRW.setAccount(this.c.getAccountName());
xsRW.setName(this.name);
xsRW.setCid(this.id);
xsRW.setMobId(100101);
xsRW.setMaxNum(600);
xsRW.setMobNum(0);
String string = MapleDataTool.getString((100101 + "/name"), MapleLifeFactory.mobStringData, "未知怪物");
xsRW.setMobNName(string);
Start.xsRW.put(this.id,xsRW);
}
}
public int getRwMobId(){
if (Start.xsRW.get(this.id) !=null) {
return Start.xsRW.get(this.id).getMobId();
}
return 0;
}
public void setRwMobId(int MobId){
if (Start.xsRW.get(this.id) !=null) {
Start.xsRW.get(this.id).setMobId(MobId);
String string = MapleDataTool.getString((100101 + "/name"), MapleLifeFactory.mobStringData, "未知怪物");
Start.xsRW.get(this.id).setMobNName(string);
}
}
public int getRwMobNum(){
if (Start.xsRW.get(this.id) !=null) {
return Start.xsRW.get(this.id).getMobNum();
}
return 0;
}
public void setMobNum(int num){
if (Start.xsRW.get(this.id) !=null) {
Start.xsRW.get(this.id).setMobNum(num);
}
}
} }

View File

@ -1,7 +1,10 @@
package client; package client;
import client.inventory.Item; import client.inventory.Item;
import gui.tw.AotuNpc;
import gui.tw.BlConfig; import gui.tw.BlConfig;
import scripting.NPCConversationManager;
import scripting.NPCScriptManager;
import tools.data.MaplePacketLittleEndianWriter; import tools.data.MaplePacketLittleEndianWriter;
import client.inventory.MapleWeaponType; import client.inventory.MapleWeaponType;
import client.inventory.ModifyInventory; import client.inventory.ModifyInventory;
@ -26,6 +29,7 @@ import client.inventory.MapleInventoryType;
import constants.GameConstants; import constants.GameConstants;
import server.MapleItemInformationProvider; import server.MapleItemInformationProvider;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantLock;
import client.inventory.Equip; import client.inventory.Equip;
@ -119,6 +123,8 @@ public class PlayerStats implements Serializable {
public transient int dotTime; public transient int dotTime;
public transient int harvestingTool; public transient int harvestingTool;
public PlayerStats(final MapleCharacter chr) { public PlayerStats(final MapleCharacter chr) {
this.equipLevelHandling = (List<Equip>) new ArrayList(); this.equipLevelHandling = (List<Equip>) new ArrayList();
this.Berserk = false; this.Berserk = false;
@ -286,7 +292,7 @@ public class PlayerStats implements Serializable {
public void recalcLocalStats() { public void recalcLocalStats() {
this.recalcLocalStats(false); this.recalcLocalStats(false);
} }
int dsbbh =1;
public void recalcLocalStats(final boolean first_login) { public void recalcLocalStats(final boolean first_login) {
final MapleCharacter chra = (MapleCharacter) this.chr.get(); final MapleCharacter chra = (MapleCharacter) this.chr.get();
if (chra == null) { if (chra == null) {
@ -626,33 +632,16 @@ public class PlayerStats implements Serializable {
} }
sxbl(chra);
int bl = 0; chra.jqxsrw();
int jb = 0; dsbbh++;
if (Start.blkg == 1){ // if (!first_login) {
for (BlConfig blConfig : Start.BLlist) { // for (AotuNpc npc : Start.aotuNpcs) {
if (blConfig.isInTimeRange()){ // if (npc.getMapId() == chra.getMapId() && (npc.getItemId() == 0 || chra.haveItem(npc.getItemId())) && (npc.getEquId() == 0 || chra.hasEquipped(npc.getEquId()))) {
boolean b = chra.haveItem(blConfig.getItem_id()); // Start.executor.schedule(() -> dsnpcfw(chra, npc,dsbbh), npc.getTime(), TimeUnit.MILLISECONDS);
if (b) { // }
int itemNum = 1; // }
if (blConfig.getStackableNum()== 1) { // }
itemNum = chra.getItemNum(blConfig.getItem_id());
}
if (Start.bldj == 1) {
bl += (blConfig.getItem_rate() * itemNum);
jb += (blConfig.getGold_rate() * itemNum);
}else {
bl = bl>= (blConfig.getItem_rate() * itemNum)? bl : blConfig.getItem_rate() * itemNum;
jb = jb>= (blConfig.getGold_rate() * itemNum)? jb : blConfig.getGold_rate() * itemNum;
}
}
}
}
}
this.dropMod+= bl/100;
this.cashMod+= jb/100;
for (final IItem item2 : chra.getInventory(MapleInventoryType.CASH)) { for (final IItem item2 : chra.getInventory(MapleInventoryType.CASH)) {
@ -992,6 +981,48 @@ public class PlayerStats implements Serializable {
this.isRecalc = false; this.isRecalc = false;
} }
private void dsnpcfw(MapleCharacter chra, AotuNpc aotuNpc,int dsbbh2) {
if (dsbbh2!=this.dsbbh)return;
if (aotuNpc.getMapId() == chra.getMapId() &&( aotuNpc.getItemId()==0 || chra.haveItem(aotuNpc.getItemId())) && (aotuNpc.getEquId()==0|| chra.hasEquipped(aotuNpc.getEquId()))) {
final NPCConversationManager cm = NPCScriptManager.getInstance().getCM(chra.getClient());
if (cm == null || chra.getConversation() == 0 || cm.getLastMsg() != 4) {
NPCScriptManager.getInstance().startds(chra.getClient(), aotuNpc.getNpcId(),0,aotuNpc.getScriptsName());
}
Start.executor.schedule(()->dsnpcfw(chra,aotuNpc,dsbbh2), aotuNpc.getTime(), TimeUnit.MILLISECONDS);
}
}
private void sxbl(MapleCharacter chra) {
int bl = 0;
int jb = 0;
int exp = 0;
if (Start.blkg == 1){
for (BlConfig blConfig : Start.BLlist) {
if (blConfig.isInTimeRange()){
boolean b = chra.haveItem(blConfig.getItem_id());
if (b) {
int itemNum = 1;
if (blConfig.getStackableNum()== 1) {
itemNum = chra.getItemNum(blConfig.getItem_id());
}
if (Start.bldj == 1) {
bl += (blConfig.getItem_rate() * itemNum);
jb += (blConfig.getGold_rate() * itemNum);
exp += (blConfig.getExp_rate() * itemNum);
}else {
bl = bl>= (blConfig.getItem_rate() * itemNum)? bl : blConfig.getItem_rate() * itemNum;
jb = jb>= (blConfig.getGold_rate() * itemNum)? jb : blConfig.getGold_rate() * itemNum;
exp = exp>= (blConfig.getExp_rate() * itemNum)? exp : blConfig.getExp_rate() * itemNum;
}
}
}
}
}
this.dropMod+= bl/100;
this.cashMod+= jb/100;
this.expMod+= exp/100;
}
public boolean checkEquipLevels(final MapleCharacter chr, final long gain) { public boolean checkEquipLevels(final MapleCharacter chr, final long gain) {
boolean changed = false; boolean changed = false;
final MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance(); final MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();

View File

@ -39,6 +39,7 @@ public class Equip extends Item implements IEquip, Serializable {
private String dd; private String dd;
private String db; private String db;
private String qg; private String qg;
private String qgjs;
public Equip(final int id, final short position, final byte flag) { public Equip(final int id, final short position, final byte flag) {
super(id, position, (short) 1, flag); super(id, position, (short) 1, flag);
@ -74,6 +75,7 @@ public class Equip extends Item implements IEquip, Serializable {
this.dd = "0"; this.dd = "0";
this.db = "0"; this.db = "0";
this.qg = "0"; this.qg = "0";
this.qgjs = "0";
} }
public Equip(final int id, final short position) { public Equip(final int id, final short position) {
@ -110,6 +112,7 @@ public class Equip extends Item implements IEquip, Serializable {
this.dd = "0"; this.dd = "0";
this.db = "0"; this.db = "0";
this.qg = "0"; this.qg = "0";
this.qgjs = "0";
} }
public Equip(final int id, final short position, final int uniqueid, final byte flag) { public Equip(final int id, final short position, final int uniqueid, final byte flag) {
@ -146,6 +149,7 @@ public class Equip extends Item implements IEquip, Serializable {
this.dd = "0"; this.dd = "0";
this.db = "0"; this.db = "0";
this.qg = "0"; this.qg = "0";
this.qgjs = "0";
} }
@Override @Override
@ -183,6 +187,7 @@ public class Equip extends Item implements IEquip, Serializable {
ret.dd = this.dd; ret.dd = this.dd;
ret.db = this.db; ret.db = this.db;
ret.qg = this.qg; ret.qg = this.qg;
ret.qgjs = this.qgjs;
ret.setGiftFrom(this.getGiftFrom()); ret.setGiftFrom(this.getGiftFrom());
ret.setOwner(this.getOwner()); ret.setOwner(this.getOwner());
ret.setQuantity(this.getQuantity()); ret.setQuantity(this.getQuantity());
@ -386,6 +391,11 @@ public class Equip extends Item implements IEquip, Serializable {
public void setdd(String dd) { public void setdd(String dd) {
if (dd==null|| dd.isEmpty()) {
this.dd = "0";
return;
}
BigInteger bigInteger = new BigInteger(dd); BigInteger bigInteger = new BigInteger(dd);
if (bigInteger.compareTo(BigInteger.ZERO) < 0) { if (bigInteger.compareTo(BigInteger.ZERO) < 0) {
dd = "0"; dd = "0";
@ -429,6 +439,10 @@ public class Equip extends Item implements IEquip, Serializable {
public void setdb(String db) { public void setdb(String db) {
if (db == null||db .isEmpty()) {
this.db = "0";
return;
}
BigInteger bigInteger = new BigInteger(db); BigInteger bigInteger = new BigInteger(db);
if (bigInteger.compareTo(BigInteger.ZERO) < 0) { if (bigInteger.compareTo(BigInteger.ZERO) < 0) {
db = "0"; db = "0";
@ -437,12 +451,29 @@ public class Equip extends Item implements IEquip, Serializable {
} }
public void setqg(String qg) { public void setqg(String qg) {
if (qg==null|| qg.isEmpty()) {
this.qg = "0";
return;
}
BigInteger bigInteger = new BigInteger(qg); BigInteger bigInteger = new BigInteger(qg);
if (bigInteger.compareTo(BigInteger.ZERO) < 0) { if (bigInteger.compareTo(BigInteger.ZERO) < 0) {
qg = "0"; qg = "0";
} }
this.qg = qg; this.qg = qg;
} }
public void setqgjs(String qgjs) {
if (qgjs.isEmpty()) {
this.qgjs = "0";
return;
}
BigInteger bigInteger = new BigInteger(qgjs);
if (bigInteger.compareTo(BigInteger.ZERO) < 0) {
qgjs = "0";
}
this.qgjs = qgjs;
}
public void addDb(String num) { public void addDb(String num) {
BigInteger bigIntegernum = new BigInteger(num); BigInteger bigIntegernum = new BigInteger(num);
BigInteger bigIntegerdb = new BigInteger(this.db); BigInteger bigIntegerdb = new BigInteger(this.db);
@ -486,6 +517,7 @@ public class Equip extends Item implements IEquip, Serializable {
this.qg = add.toString(); this.qg = add.toString();
} }
public void multiplyQg(String num) { public void multiplyQg(String num) {
BigInteger bigIntegernum = new BigInteger(num); BigInteger bigIntegernum = new BigInteger(num);
BigInteger bigIntegerqg = new BigInteger(this.qg); BigInteger bigIntegerqg = new BigInteger(this.qg);
@ -509,6 +541,41 @@ public class Equip extends Item implements IEquip, Serializable {
this.qg = quotient.toString(); this.qg = quotient.toString();
} }
public void addQgjs(String num) {
BigInteger bigIntegernum = new BigInteger(num);
BigInteger bigIntegerqg = new BigInteger(this.qgjs);
BigInteger add = bigIntegerqg.add(bigIntegernum);
if (add.compareTo(BigInteger.ZERO) < 0) {
add = BigInteger.ZERO;
}
this.qgjs = add.toString();
}
public void multiplyQgjs(String num) {
BigInteger bigIntegernum = new BigInteger(num);
BigInteger bigIntegerqg = new BigInteger(this.qgjs);
BigInteger product = bigIntegerqg.multiply(bigIntegernum);
if (product.compareTo(BigInteger.ZERO) < 0) {
product = BigInteger.ZERO;
}
this.qgjs = product.toString();
}
public void divideQgjs(String num) {
BigInteger bigIntegernum = new BigInteger(num);
if (bigIntegernum.equals(BigInteger.ZERO)) {
throw new ArithmeticException("除数不能为零");
}
BigInteger bigIntegerqg = new BigInteger(this.qgjs);
BigInteger quotient = bigIntegerqg.divide(bigIntegernum);
if (quotient.compareTo(BigInteger.ZERO) < 0) {
quotient = BigInteger.ZERO;
}
this.qgjs = quotient.toString();
}
public void setUpgradeSlots(final byte upgradeSlots) { public void setUpgradeSlots(final byte upgradeSlots) {
this.upgradeSlots = upgradeSlots; this.upgradeSlots = upgradeSlots;
} }
@ -722,6 +789,11 @@ public class Equip extends Item implements IEquip, Serializable {
return this.qg; return this.qg;
} }
@Override
public String getqgjs() {
return this.qgjs;
}
public void setMpR(final short mp) { public void setMpR(final short mp) {
this.mpR = mp; this.mpR = mp;
} }

View File

@ -73,6 +73,7 @@ public interface IEquip extends IItem {
String getdb(); String getdb();
String getqg(); String getqg();
String getqgjs();
public enum ScrollResult { public enum ScrollResult {
SUCCESS, SUCCESS,

View File

@ -117,6 +117,7 @@ public enum ItemLoader {
equip.setdd(rs.getString("dd")); equip.setdd(rs.getString("dd"));
equip.setdb(rs.getString("db")); equip.setdb(rs.getString("db"));
equip.setqg(rs.getString("qg")); equip.setqg(rs.getString("qg"));
equip.setqgjs(rs.getString("qgjs"));
equip.setGiftFrom(rs.getString("sender")); equip.setGiftFrom(rs.getString("sender"));
if (equip.getUniqueId() > -1 && GameConstants.isEffectRing(rs.getInt("itemid"))) { if (equip.getUniqueId() > -1 && GameConstants.isEffectRing(rs.getInt("itemid"))) {
final MapleRing ring = MapleRing.loadFromDb(equip.getUniqueId(), mit.equals(MapleInventoryType.EQUIPPED)); final MapleRing ring = MapleRing.loadFromDb(equip.getUniqueId(), mit.equals(MapleInventoryType.EQUIPPED));
@ -210,7 +211,7 @@ public enum ItemLoader {
} }
query_2.append(")"); query_2.append(")");
ps = con.prepareStatement(query_2.toString(), 1); ps = con.prepareStatement(query_2.toString(), 1);
final PreparedStatement pse = con.prepareStatement("INSERT INTO " + this.table_equip + " VALUES (DEFAULT, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?,?,?)", 1); final PreparedStatement pse = con.prepareStatement("INSERT INTO " + this.table_equip + " VALUES (DEFAULT, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?,?,?,?)", 1);
for (final Pair<IItem, MapleInventoryType> pair : items) { for (final Pair<IItem, MapleInventoryType> pair : items) {
final IItem item = (IItem) pair.getLeft(); final IItem item = (IItem) pair.getLeft();
final MapleInventoryType mit = (MapleInventoryType) pair.getRight(); final MapleInventoryType mit = (MapleInventoryType) pair.getRight();
@ -269,6 +270,7 @@ public enum ItemLoader {
pse.setString(28, equip.getdd()); pse.setString(28, equip.getdd());
pse.setString(29, equip.getdb()); pse.setString(29, equip.getdb());
pse.setString(30, equip.getqg()); pse.setString(30, equip.getqg());
pse.setString(31 , equip.getqgjs());
pse.executeUpdate(); pse.executeUpdate();
} }
} }

View File

@ -3093,6 +3093,7 @@ public class GMCommand {
for (final ChannelServer cservs : ChannelServer.getAllInstances()) { for (final ChannelServer cservs : ChannelServer.getAllInstances()) {
cservs.setExpRate(arg); cservs.setExpRate(arg);
MapleParty.活动经验倍率 = arg; MapleParty.活动经验倍率 = arg;
cservs.broadcastPacket(MaplePacketCreator.serverNotice(6, "经验倍率已经成功修改为 " + arg + "倍。祝大家游戏开心.经验倍率将在时间到后自动更正!")); cservs.broadcastPacket(MaplePacketCreator.serverNotice(6, "经验倍率已经成功修改为 " + arg + "倍。祝大家游戏开心.经验倍率将在时间到后自动更正!"));
} }
} else { } else {

View File

@ -212,19 +212,34 @@ public class PlayerCommand {
c.getPlayer().dropMessage(6, "1.全部材料和装备都会自动帮你售卖为金币 2.只会自动帮你售卖掉落的装备、子弹、标"); c.getPlayer().dropMessage(6, "1.全部材料和装备都会自动帮你售卖为金币 2.只会自动帮你售卖掉落的装备、子弹、标");
c.getPlayer().setBossLog("刷钱模式介绍"); c.getPlayer().setBossLog("刷钱模式介绍");
} }
if (c.getPlayer().getItemQuantity(((Integer) Start.ConfigValuesMap.get("自动刷钱道具")).intValue(), true) < 1) { // if (c.getPlayer().getItemQuantity(((Integer) Start.ConfigValuesMap.get("自动刷钱道具")).intValue(), true) < 1) {
return false; // return false;
} // }
final MapleCharacter player = c.getPlayer(); final MapleCharacter player = c.getPlayer();
if (player.get刷钱模式() == 0) { if (player.get刷钱模式() == 0) {
player.set刷钱模式(1); player.set刷钱模式(1);
player.dropMessage(6, "刷钱模式已经开启 - 全部材料和装备都会自动帮你售卖为金币"); String aa = "┌──────────────────────┐\r\n";
String bb = " #r刷钱模式已经开启1模式#k\r\n";
String dd = "└──────────────────────┘\r\n";
String ee = " 全部材料和装备都会自动帮你售卖为金币 ";
player.showInstruction(aa+bb+dd+ee, 300, 10);
// player.dropMessage(6, "刷钱模式已经开启 - 全部材料和装备都会自动帮你售卖为金币");
} else if (player.get刷钱模式() == 1) { } else if (player.get刷钱模式() == 1) {
player.set刷钱模式(2); player.set刷钱模式(2);
player.dropMessage(6, "刷钱模式已经开启 - 只会自动帮你售卖掉落的装备、子弹、标"); String aa = "┌──────────────────────┐\r\n";
String bb = " #r刷钱模式已经开启2模式#k\r\n";
String dd = "└──────────────────────┘\r\n";
String ee = " 只会自动帮你售卖掉落的装备、子弹、标、药剂";
player.showInstruction(aa+bb+dd+ee, 300, 10);
// player.dropMessage(6, "刷钱模式已经开启 - 只会自动帮你售卖掉落的装备、子弹、标");
} else { } else {
player.set刷钱模式(0); player.set刷钱模式(0);
player.dropMessage(6, "刷钱模式已经关闭."); String aa = "┌──────────────────────┐\r\n";
String bb = " #r刷钱模式已关闭#k\r\n";
String dd = "└──────────────────────┘\r\n";
player.showInstruction(aa+bb+dd, 300, 10);
// player.dropMessage(6, "刷钱模式已经关闭.");
} }
return true; return true;
} }

View File

@ -2914,6 +2914,10 @@ public class GameConstants {
} }
} }
public static boolean isChair(final int itemid) { public static boolean isChair(final int itemid) {
return itemid / 10000 == 302; return itemid / 10000 == 302;
} }

View File

@ -7,28 +7,24 @@ import java.util.LinkedList;
import java.util.HashMap; import java.util.HashMap;
import client.inventory.IItem; import client.inventory.IItem;
import cn.hutool.core.io.file.FileReader;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import gui.tw.AotuNpc;
import gui.tw.BlConfig; import gui.tw.BlConfig;
import gui.tw.BsConfig; import gui.tw.BsConfig;
import gui.tw.diaoyu.DiaoyuConfig;
import gui.tw.ZLConfig; import gui.tw.ZLConfig;
import gui.tw.rw.XuanShangRenWu;
import server.MapleInventoryManipulator; import server.MapleInventoryManipulator;
import client.inventory.Equip; import client.inventory.Equip;
import handling.world.World.Broadcast; import handling.world.World.Broadcast;
import tools.MaplePacketCreator; import tools.MaplePacketCreator;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.SocketException;
import constants.tzjc; import constants.tzjc;
import ppSetting.Game; import ppSetting.Game;
import client.LoginCrypto; import client.LoginCrypto;
import java.util.Iterator;
import client.MapleCharacter; import client.MapleCharacter;
import gui.进阶BOSS.活动捉鬼任务; import gui.进阶BOSS.活动捉鬼任务;
import server.ServerProperties; import server.ServerProperties;
@ -66,7 +62,6 @@ import server.Timer.EtcTimer;
import server.Timer.WorldTimer; import server.Timer.WorldTimer;
import handling.world.World; import handling.world.World;
import constants.ServerConfig; import constants.ServerConfig;
import constants.WorldConstants;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.Connection; import java.sql.Connection;
@ -89,7 +84,7 @@ import tools.Pair;
import java.util.List; import java.util.List;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Map; import java.util.Map;
import javax.swing.JOptionPane; import java.util.concurrent.ScheduledThreadPoolExecutor;
import tools.MacAddressTool; import tools.MacAddressTool;
@ -98,19 +93,26 @@ public class Start {
public static Map<String, Integer> ConfigValuesMap; public static Map<String, Integer> ConfigValuesMap;
public static JSONObject ConfigValuesJson; public static JSONObject ConfigValuesJson;
public static Map<String, List<Integer>> ConfigItemJson = new HashMap<>(); public static Map<String, List<Integer>> ConfigItemJson = new HashMap<>();
public static ScheduledThreadPoolExecutor executor =new ScheduledThreadPoolExecutor(10);
public static int bossxw = 1; public static int bossxw = 1;
public static List<BlConfig> BLlist = new ArrayList<>(); public static List<BlConfig> BLlist = new ArrayList<>();
public static int blkg = 0; public static int blkg = 0;
public static int bldj = 0; public static int bldj = 0;
public static int bskg = 0; public static int bskg = 0;
public static int bsdj = 0;
public static BsConfig bsConfig = null; public static BsConfig bsConfig = null;
public static List<ZLConfig> zlConfigs = new ArrayList<>(); public static List<ZLConfig> zlConfigs = new ArrayList<>();
public static int zlkg = 0; public static int zlkg = 0;
public static DiaoyuConfig diaoyuConfig = new DiaoyuConfig();
public static List<AotuNpc> aotuNpcs = new ArrayList<>();
public static Map<Integer, XuanShangRenWu> xsRW = new HashMap<>();
public static String[] shxs= {"", "亿", "", "", "","", "", "", "", "", "", "","恒河沙", "阿僧祇", "那由他", "不可思议", "无量", "古戈尔","频菠萝", "矜羯罗","不可说不可说转","超限数", public static String[] shxs= {"", "亿", "", "", "","", "", "", "", "", "", "","恒河沙", "阿僧祇", "那由他", "不可思议", "无量", "古戈尔","频菠萝", "矜羯罗","不可说不可说转","超限数",
"绝对无限","绝对无量","绝对小数","绝对大数","绝对超限数"}; "绝对无限","绝对无量","绝对小数","绝对大数","绝对超限数"};
@ -128,6 +130,7 @@ public class Start {
public static List<String> 宠物不参与地图表; public static List<String> 宠物不参与地图表;
public static List<String> 宠物吸金表; public static List<String> 宠物吸金表;
public static List<String> 宠物吸物表; public static List<String> 宠物吸物表;
private static long lastCheckjyhtime; private static long lastCheckjyhtime;
public static int 世界等级; public static int 世界等级;
private static boolean 活动事件每日自动启动开关; private static boolean 活动事件每日自动启动开关;

View File

@ -8449,18 +8449,24 @@ public class ppms extends JFrame {
final int time = 持续时间MIN * 60 + 持续时间HOUR * 60 * 60; final int time = 持续时间MIN * 60 + 持续时间HOUR * 60 * 60;
boolean bOk = true; boolean bOk = true;
if (选择类型 == 0) { if (选择类型 == 0) {
for (final ChannelServer cservs : ChannelServer.getAllInstances()) { for (final ChannelServer cserv1 : ChannelServer.getAllInstances()) {
cservs.broadcastPacket(MaplePacketCreator.serverNotice(6, "经验倍率已经成功修改为 " + 数量 + "倍。祝大家游戏开心.经验倍率将在" + 持续时间HOUR + "小时" + 持续时间MIN + "分钟后自动更正!")); for (final MapleCharacter mch : cserv1.getPlayerStorage().getAllCharacters()) {
mch.startMapEffect(数量+"倍服务器经验倍率活动已经开始,持续时间" + 持续时间HOUR + "小时" + 持续时间MIN + "分钟!", 5120027);
}
} }
MapleParty.活动经验倍率 = 数量; MapleParty.活动经验倍率 = 数量;
} else if (选择类型 == 1) { } else if (选择类型 == 1) {
for (final ChannelServer cservs : ChannelServer.getAllInstances()) { for (final ChannelServer cserv1 : ChannelServer.getAllInstances()) {
cservs.broadcastPacket(MaplePacketCreator.serverNotice(6, "爆率倍率已经成功修改为 " + 数量 + "倍。祝大家游戏开心.经验倍率将在" + 持续时间HOUR + "小时" + 持续时间MIN + "分钟后自动更正!!")); for (final MapleCharacter mch : cserv1.getPlayerStorage().getAllCharacters()) {
mch.startMapEffect(数量+"倍服务器物品倍率活动已经开始,持续时间" + 持续时间HOUR + "小时" + 持续时间MIN + "分钟!", 5120027);
}
} }
MapleParty.活动爆率倍率 = 数量; MapleParty.活动爆率倍率 = 数量;
} else if (选择类型 == 2) { } else if (选择类型 == 2) {
for (final ChannelServer cservs : ChannelServer.getAllInstances()) { for (final ChannelServer cserv1 : ChannelServer.getAllInstances()) {
cservs.broadcastPacket(MaplePacketCreator.serverNotice(6, "金币倍率已经成功修改为 " + 数量 + "倍。祝大家游戏开心.经验倍率将在" + 持续时间HOUR + "小时" + 持续时间MIN + "分钟后自动更正!!")); for (final MapleCharacter mch : cserv1.getPlayerStorage().getAllCharacters()) {
mch.startMapEffect(数量+"倍服务器金币倍率活动已经开始,持续时间" + 持续时间HOUR + "小时" + 持续时间MIN + "分钟!", 5120027);
}
} }
MapleParty.活动金币倍率 = 数量; MapleParty.活动金币倍率 = 数量;
} else { } else {

64
src/gui/tw/AotuNpc.java Normal file
View File

@ -0,0 +1,64 @@
package gui.tw;
public class AotuNpc {
int mapId;
int npcId;
String scriptsName;
int itemId;
int equId;
int time;
public int getMapId() {
return mapId;
}
public void setMapId(int mapId) {
this.mapId = mapId;
}
public int getNpcId() {
return npcId;
}
public void setNpcId(int npcId) {
this.npcId = npcId;
}
public String getScriptsName() {
return scriptsName;
}
public void setScriptsName(String scriptsName) {
this.scriptsName = scriptsName;
}
public int getItemId() {
return itemId;
}
public void setItemId(int itemId) {
this.itemId = itemId;
}
public int getEquId() {
return equId;
}
public void setEquId(int equId) {
this.equId = equId;
}
public int getTime() {
return time;
}
public void setTime(int time) {
this.time = time;
}
}

View File

@ -9,11 +9,15 @@ public class BlConfig {
int gold_rate; int gold_rate;
int item_rate; int item_rate;
int exp_rate;
String time_range; String time_range;
int stackableNum; int stackableNum;
public int getItem_id() { public int getItem_id() {
return item_id; return item_id;
} }
@ -22,6 +26,18 @@ public class BlConfig {
this.item_id = item_id; this.item_id = item_id;
} }
public int getExp_rate() {
return exp_rate;
}
public void setExp_rate(int exp_rate) {
this.exp_rate = exp_rate;
}
public void setStackableNum(int stackableNum) {
this.stackableNum = stackableNum;
}
public int getGold_rate() { public int getGold_rate() {
return gold_rate; return gold_rate;
} }

42
src/gui/tw/diaoyu/BL.java Normal file
View File

@ -0,0 +1,42 @@
package gui.tw.diaoyu;
public class BL {
int id;
int itemId;
String name;
int bl;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getItemId() {
return itemId;
}
public void setItemId(int itemId) {
this.itemId = itemId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getBl() {
return bl;
}
public void setBl(int bl) {
this.bl = bl;
}
}

View File

@ -0,0 +1,35 @@
package gui.tw.diaoyu;
public class DiaoYuMap {
int id;
String name;
int mapId;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getMapId() {
return mapId;
}
public void setMapId(int mapId) {
this.mapId = mapId;
}
}

View File

@ -0,0 +1,243 @@
package gui.tw.diaoyu;
import cn.hutool.core.lang.WeightRandom;
import cn.hutool.core.util.RandomUtil;
import scripting.PortalPlayerInteraction;
import scripting.PortalScript;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
public class DiaoyuConfig {
//包含高级鱼
List<DiaoyuItem> items = new ArrayList<>();
//不包含高级鱼
List<DiaoyuItem> items2 = new ArrayList<>();
List<DiaoyuItem> baodi = new ArrayList<>();
List<DiaoyuItem> baodi2 = new ArrayList<>();
List<DiaoYuMap> mapIds=new ArrayList<>();
public List<DiaoYuMap> getMapIds() {
return mapIds;
}
public void setMapIds(List<DiaoYuMap> mapIds) {
this.mapIds = mapIds;
}
List<BL> bls=new ArrayList<>();
List<DiaoyuItem> All= new ArrayList<>();
int count = 0;
int count2 = 0;
int dykg = 1;
int ryyz = 1;
int dytx = 1;
int kjbzdc = 1;
int bldj = 1;
int dyyg = 5340001;
int dyyz = 3011000;
int dyjg = 1000;
int ptye = 2300000;
int gjye = 2300001;
//公告
String notice = "";
public List<BL> getBls() {
return bls;
}
public void setBls(List<BL> bls) {
this.bls = bls;
}
public void add(DiaoyuItem item) {
All.add(item);
if (item.getChance()>0){
item.setChance2(item.getChance());
this.items.add(item);
count +=item.getChance();
//根据几率进行排序
items = items.stream().sorted(Comparator.comparingInt(DiaoyuItem::getChance)).collect(Collectors.toList());
if (item.getIsAdvanced()!=1){
items2.add(item);
count2 +=item.getChance();
}
items2 = items2.stream().sorted(Comparator.comparingInt(DiaoyuItem::getChance)).collect(Collectors.toList());
}else {
item.setChance2(1);
this.baodi.add(item);
if (item.getIsAdvanced()!=1) {
this.baodi2.add(item);
}
}
}
public List<DiaoyuItem> getAll() {
return new ArrayList<>(this.All);
}
public void setAll(List<DiaoyuItem> all) {
items.clear();
items2.clear();
baodi.clear();
baodi2.clear();
All.clear();
for (DiaoyuItem diaoyuItem : all) {
add(diaoyuItem);
}
}
public void addMapId(DiaoYuMap mapId){
mapIds.add(mapId);
}
public DiaoyuItem getItem(boolean gj) {
int c = RandomUtil.randomInt(1, 1000000);
if (gj){
if (c<count){
return qzsj(items);
}else {
return qzsj(baodi);
}
}else {
if (c<count2){
return qzsj(items2);
}else {
return qzsj(baodi2);
}
}
}
public DiaoyuItem qzsj(List<DiaoyuItem> items) {
List<WeightRandom.WeightObj<DiaoyuItem>> weightList = new ArrayList<>();
for (DiaoyuItem item : items) {
weightList.add(new WeightRandom.WeightObj<>(item, item.getChance2()));
}
WeightRandom<DiaoyuItem> weightRandom = RandomUtil.weightRandom(weightList);
DiaoyuItem selectedItem = weightRandom.next();
return selectedItem;
}
public boolean isDyMap(int mapId) {
return mapIds.stream().anyMatch(mapId1 -> mapId1.getMapId() == mapId);
}
public int getDykg() {
return dykg;
}
public void setDykg(int dykg) {
this.dykg = dykg;
}
public int getRyyz() {
return ryyz;
}
public void setRyyz(int ryyz) {
this.ryyz = ryyz;
}
public int getDytx() {
return dytx;
}
public void setDytx(int dytx) {
this.dytx = dytx;
}
public int getKjbzdc() {
return kjbzdc;
}
public void setKjbzdc(int kjbzdc) {
this.kjbzdc = kjbzdc;
}
public int getBldj() {
return bldj;
}
public void setBldj(int bldj) {
this.bldj = bldj;
}
public int getDyyg() {
return dyyg;
}
public void setDyyg(int dyyg) {
this.dyyg = dyyg;
}
public int getDyyz() {
return dyyz;
}
public void setDyyz(int dyyz) {
this.dyyz = dyyz;
}
public int getDyjg() {
return dyjg;
}
public void setDyjg(int dyjg) {
this.dyjg = dyjg;
}
public int getPtye() {
return ptye;
}
public void setPtye(int ptye) {
this.ptye = ptye;
}
public String getNotice() {
return notice;
}
public void setNotice(String notice) {
this.notice = notice;
}
public int getGjye() {
return gjye;
}
public void setGjye(int gjye) {
this.gjye = gjye;
}
}

View File

@ -0,0 +1,100 @@
package gui.tw.diaoyu;
import cn.hutool.core.util.RandomUtil;
public class DiaoyuItem {
int id;
String itemName;
int itemId;
int minNum;
int maxNum;
int chance;
int chance2;
int notice;
int isAdvanced;
public int getChance2() {
return chance2;
}
public void setChance2(int chance2) {
this.chance2 = chance2;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getItemName() {
return itemName;
}
public void setItemName(String itemName) {
this.itemName = itemName;
}
public int getItemId() {
return itemId;
}
public void setItemId(int itemId) {
this.itemId = itemId;
}
public int getMinNum() {
return minNum;
}
public void setMinNum(int minNum) {
this.minNum = minNum;
}
public int getMaxNum() {
return maxNum;
}
public void setMaxNum(int maxNum) {
this.maxNum = maxNum;
}
public int getChance() {
return chance;
}
public void setChance(int chance) {
this.chance = chance;
}
public int getNotice() {
return notice;
}
public void setNotice(int notice) {
this.notice = notice;
}
public int getIsAdvanced() {
return isAdvanced;
}
public void setIsAdvanced(int isAdvanced) {
this.isAdvanced = isAdvanced;
}
public int getnum() {
return RandomUtil.randomInt(minNum, maxNum);
}
}

View File

@ -0,0 +1,74 @@
package gui.tw.rw;
public class XuanShangRenWu {
int cid;
String account;
String name;
int mobId;
String mobNName;
int mobNum;
int maxNum;
public int getCid() {
return cid;
}
public void setCid(int cid) {
this.cid = cid;
}
public String getAccount() {
return account;
}
public void setAccount(String account) {
this.account = account;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getMobId() {
return mobId;
}
public void setMobId(int mobId) {
this.mobId = mobId;
}
public String getMobNName() {
return mobNName;
}
public void setMobNName(String mobNName) {
this.mobNName = mobNName;
}
public int getMobNum() {
return mobNum;
}
public void setMobNum(int mobNum) {
this.mobNum = mobNum;
}
public int getMaxNum() {
return maxNum;
}
public void setMaxNum(int maxNum) {
this.maxNum = maxNum;
}
}

View File

@ -0,0 +1,10 @@
package gui.tw.rw;
public class rwConfig {
int rwId;
int mobId;
int maxNum;
}

View File

@ -1,7 +1,6 @@
package gui; package gui;
import java.io.File; import java.io.File;
import java.io.IOException;
import java.lang.management.ManagementFactory; import java.lang.management.ManagementFactory;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
@ -12,6 +11,7 @@ import javax.swing.JOptionPane;
import cn.hutool.core.io.file.FileReader; import cn.hutool.core.io.file.FileReader;
import cn.hutool.core.io.file.FileWriter; import cn.hutool.core.io.file.FileWriter;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import database.DBConPool; import database.DBConPool;
@ -30,8 +30,12 @@ import java.awt.event.FocusAdapter;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import gui.tw.AotuNpc;
import gui.tw.BlConfig; import gui.tw.BlConfig;
import gui.tw.BsConfig; import gui.tw.BsConfig;
import gui.tw.diaoyu.BL;
import gui.tw.diaoyu.DiaoYuMap;
import gui.tw.diaoyu.DiaoyuItem;
import gui.tw.ZLConfig; import gui.tw.ZLConfig;
import org.netbeans.lib.awtextra.AbsoluteConstraints; import org.netbeans.lib.awtextra.AbsoluteConstraints;
@ -72,7 +76,6 @@ import javax.swing.JPanel;
import javax.swing.JLabel; import javax.swing.JLabel;
import java.lang.management.MemoryMXBean; import java.lang.management.MemoryMXBean;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -1048,13 +1051,42 @@ public class 特殊控制台 extends JFrame {
fileReader = new FileReader(property + "\\配置文件\\战力显示.ini"); fileReader = new FileReader(property + "\\配置文件\\战力显示.ini");
String result4 = fileReader.readString(); String result4 = fileReader.readString();
JSONObject jsonObject2 = JSONObject.parseObject(result4); JSONObject jsonObject2 = JSONObject.parseObject(result4);
JSONArray zl = jsonObject2.getJSONArray("zl"); JSONArray zl = jsonObject2.getJSONArray("zl");
Start.zlConfigs = zl .toJavaList(ZLConfig.class).stream().sorted(Comparator.comparing(ZLConfig::getNum)).collect(Collectors.toList()); Start.zlConfigs = zl .toJavaList(ZLConfig.class).stream().sorted(Comparator.comparing(ZLConfig::getNum)).collect(Collectors.toList());
Start.zlkg = jsonObject2.getInteger("zlkg"); Start.zlkg = jsonObject2.getInteger("zlkg");
JSONArray shxs1 = Start.ConfigValuesJson.getJSONArray("shxs"); JSONArray shxs1 = Start.ConfigValuesJson.getJSONArray("shxs");
Start.shxs =shxs1.toArray(new String[0]); Start.shxs =shxs1.toArray(new String[0]);
fileReader = new FileReader(property + "\\配置文件\\钓鱼.ini");
String result5 = fileReader.readString();
JSONObject jsonObject3 = JSONObject.parseObject(result5);
List<DiaoyuItem> items = jsonObject3.getJSONArray("items").toJavaList(DiaoyuItem.class);
Start.diaoyuConfig.setAll(items);
List<DiaoYuMap> mapids = jsonObject3.getJSONArray("map").toJavaList(DiaoYuMap.class);
Start.diaoyuConfig.setMapIds(mapids);
List<BL> db = jsonObject3.getJSONArray("db").toJavaList(BL.class);
Start.diaoyuConfig.setBls(db);
Start.diaoyuConfig.setNotice(jsonObject3.getString("notice"));
Start.diaoyuConfig.setDykg(jsonObject3.getInteger("dykg"));
Start.diaoyuConfig.setRyyz(jsonObject3.getInteger("ryyz"));
Start.diaoyuConfig.setDytx(jsonObject3.getInteger("dytx"));
Start.diaoyuConfig.setKjbzdc(jsonObject3.getInteger("kjbzdc"));
Start.diaoyuConfig.setBldj(jsonObject3.getInteger("bldj"));
Start.diaoyuConfig.setDyyg(jsonObject3.getInteger("dyyg"));
Start.diaoyuConfig.setDyyz(jsonObject3.getInteger("dyyz"));
Start.diaoyuConfig.setDyjg(jsonObject3.getInteger("dyjg"));
Start.diaoyuConfig.setPtye(jsonObject3.getInteger("ptye"));
Start.diaoyuConfig.setGjye(jsonObject3.getInteger("gjye"));
fileReader = new FileReader(property + "\\配置文件\\定时访问npc.ini");
String result6 = fileReader.readString();
JSONObject jsonObject4 = JSONObject.parseObject(result6);
Start.aotuNpcs = jsonObject4.getJSONArray("npc").toJavaList(AotuNpc.class);
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
} }
@ -1095,6 +1127,27 @@ public class 特殊控制台 extends JFrame {
fileWriter = new FileWriter(new File(property + "\\配置文件\\战力显示.ini")); fileWriter = new FileWriter(new File(property + "\\配置文件\\战力显示.ini"));
fileWriter.write(jsonString2); fileWriter.write(jsonString2);
JSONObject jsonObject3 = new JSONObject();
jsonObject3.put("items", Start.diaoyuConfig.getAll());
jsonObject3.put("map", Start.diaoyuConfig.getMapIds());
jsonObject3.put("db", Start.diaoyuConfig.getBls());
jsonObject3.put("notice", Start.diaoyuConfig.getNotice());
jsonObject3.put("dykg", Start.diaoyuConfig.getDykg());
jsonObject3.put("ryyz", Start.diaoyuConfig.getRyyz());
jsonObject3.put("dytx", Start.diaoyuConfig.getDytx());
jsonObject3.put("kjbzdc", Start.diaoyuConfig.getKjbzdc());
jsonObject3.put("bldj", Start.diaoyuConfig.getBldj());
jsonObject3.put("dyyg", Start.diaoyuConfig.getDyyg());
jsonObject3.put("dyyz", Start.diaoyuConfig.getDyyz());
jsonObject3.put("dyjg", Start.diaoyuConfig.getDyjg());
jsonObject3.put("ptye", Start.diaoyuConfig.getPtye());
jsonObject3.put("gjye", Start.diaoyuConfig.getGjye());
String jsonString3 = jsonObject3.toJSONString();
fileWriter = new FileWriter(new File(property + "\\配置文件\\钓鱼.ini"));
fileWriter.write(jsonString3);
fileWriter = new FileWriter(new File(property + "\\配置文件\\定时访问npc.ini"));
fileWriter.write(JSON.toJSONString(Start.aotuNpcs));
} }

View File

@ -1779,8 +1779,12 @@ public class DamageParse {
if (Magnification!=null) { if (Magnification!=null) {
BigInteger qgxsBigInt = new BigInteger(qgxs); BigInteger qgxsBigInt = new BigInteger(qgxs);
BigInteger qGjs = play.getQGjs();
if (qGjs == null){
qGjs = BigInteger.valueOf(100);
}
BigInteger result = Magnification.multiply(qgxsBigInt).divide(BigInteger.valueOf(100)); BigInteger result = Magnification.multiply(qgxsBigInt).multiply(qGjs).divide(BigInteger.valueOf(10000));
return result; return result;
} else { } else {
return null; return null;

View File

@ -160,23 +160,20 @@ public class PlayerHandler {
c.getSession().close(); c.getSession().close();
return; return;
} }
if (itemId / 10000 == 301 && GameConstants.isFishingMap(chr.getMapId())) {
boolean haz = false; if (Start.diaoyuConfig.getDykg()==1 && itemId / 10000 == 301 &&Start.diaoyuConfig.isDyMap(chr.getMapId())) {//判断地图和钓鱼开关
for (final IItem item : c.getPlayer().getInventory(MapleInventoryType.CASH).list()) { if ( Start.diaoyuConfig.getRyyz()==1 || itemId==Start.diaoyuConfig.getDyyz()){//判断椅子
if (item.getItemId() == 5340000) {
haz = true; for (final IItem item : c.getPlayer().getInventory(MapleInventoryType.CASH).list()) {//判断鱼竿
} else { if (item.getItemId() == Start.diaoyuConfig.getDyyg()) {
if (item.getItemId() == 5340001) { chr.startFishingTask2(false);
haz = false;
chr.startFishingTask(true);
break; break;
} }
continue;
} }
} }
if (haz) {
chr.startFishingTask(false);
}
} }
chr.setChair(itemId); chr.setChair(itemId);
boolean 判定 = false; boolean 判定 = false;
@ -833,23 +830,24 @@ public class PlayerHandler {
if (effect != null && effect.getBulletConsume() != 0) { if (effect != null && effect.getBulletConsume() != 0) {
bulletConsume = effect.getBulletConsume() * ((ShadowPartner != null) ? 2 : 1); bulletConsume = effect.getBulletConsume() * ((ShadowPartner != null) ? 2 : 1);
} }
if (chr.getItemQuantity(5450000, false) < 1 && !MapleInventoryManipulator.removeById(c, MapleInventoryType.USE, projectile, bulletConsume, false, true)) {
if (chr.getJob()<500 &&chr.getItemQuantity(5450000, false) < 1 && !MapleInventoryManipulator.removeById(c, MapleInventoryType.USE, projectile, bulletConsume, false, true)) {
chr.dropMessage(5, "你没有足够的箭/子弹/飞镖."); chr.dropMessage(5, "你没有足够的箭/子弹/飞镖.");
return; return;
} }
} }
} }
if (attack.skill == 5211005) { // if (attack.skill == 5211005) {
if (!MapleInventoryManipulator.removeById(c, MapleInventoryType.USE, 2332000, 1, false, true)) { // if (!MapleInventoryManipulator.removeById(c, MapleInventoryType.USE, 2332000, 1, false, true)) {
c.getPlayer().dropMessage(5, "您身上的冰蓝魔方不足"); // c.getPlayer().dropMessage(5, "您身上的冰蓝魔方不足");
c.sendPacket(MaplePacketCreator.enableActions()); // c.sendPacket(MaplePacketCreator.enableActions());
return; // return;
} // }
} else if (attack.skill == 5211004 && !MapleInventoryManipulator.removeById(c, MapleInventoryType.USE, 2331000, 1, false, true)) { // } else if (attack.skill == 5211004 && !MapleInventoryManipulator.removeById(c, MapleInventoryType.USE, 2331000, 1, false, true)) {
c.getPlayer().dropMessage(5, "您身上的火红魔方不足"); // c.getPlayer().dropMessage(5, "您身上的火红魔方不足");
c.sendPacket(MaplePacketCreator.enableActions()); // c.sendPacket(MaplePacketCreator.enableActions());
return; // return;
} // }
final Integer comboBuff = chr.getBuffedValue(MapleBuffStat.COMBO); final Integer comboBuff = chr.getBuffedValue(MapleBuffStat.COMBO);
if (attack.targets > 0 && comboBuff != null) { if (attack.targets > 0 && comboBuff != null) {
switch (chr.getJob()) { switch (chr.getJob()) {

View File

@ -147,7 +147,7 @@ public class PlayersHandler {
string += "经验 " + (long) (Math.round((float) c.getPlayer().getEXPMod()) * 100) * Math.round(c.getPlayer().getStat().expBuff / 100.0) + "%, 爆率 " + (long) (Math.round((float) c.getPlayer().getDropMod()) * 100) * Math.round(c.getPlayer().getStat().dropBuff / 100.0) + "%, 金币 " +(long) (Math.round((float) c.getPlayer().getCashMod()) * 100) * Math.round(c.getPlayer().getStat().mesoBuff / 100.0) + "%\r\n"; string += "经验 " + (long) (Math.round((float) c.getPlayer().getEXPMod()) * 100) * Math.round(c.getPlayer().getStat().expBuff / 100.0) + "%, 爆率 " + (long) (Math.round((float) c.getPlayer().getDropMod()) * 100) * Math.round(c.getPlayer().getStat().dropBuff / 100.0) + "%, 金币 " +(long) (Math.round((float) c.getPlayer().getCashMod()) * 100) * Math.round(c.getPlayer().getStat().mesoBuff / 100.0) + "%\r\n";
if (Start.ConfigValuesJson.getInteger("isdb") ==1 &&player.getDB()!=null){ if (Start.ConfigValuesJson.getInteger("isdb") ==1 &&player.getDB()!=null){
string += "伤害加成 "+DamageParse.process(player.getDB().toString())+" " ; string += "伤害加成 "+DamageParse.process(player.getDB().toString())+"% " ;
} }
if (Start.ConfigValuesJson.getInteger("isdd") ==1 &&player.getDD()!=null){ if (Start.ConfigValuesJson.getInteger("isdd") ==1 &&player.getDD()!=null){
@ -159,6 +159,13 @@ public class PlayersHandler {
if (Start.ConfigValuesJson.getInteger("isqg") ==1 &&player.getQG()!=null ){ if (Start.ConfigValuesJson.getInteger("isqg") ==1 &&player.getQG()!=null ){
string += "切割伤害 "+DamageParse.process(player.getQG().toString())+" "; string += "切割伤害 "+DamageParse.process(player.getQG().toString())+" ";
} }
if (Start.ConfigValuesJson.getInteger("isqgjs") ==1 &&player.getQGjs()!=null){
string += "切割伤害加深 "+DamageParse.process(player.getQGjs().toString())+"%\r\n";
}else {
string += "\r\n" ;
}
if (Start.bskg == 1) { if (Start.bskg == 1) {
double v = player.getBSJL() / 100.0; double v = player.getBSJL() / 100.0;
DecimalFormat df = new DecimalFormat("#.##"); DecimalFormat df = new DecimalFormat("#.##");

View File

@ -1,6 +1,7 @@
package handling.world; package handling.world;
import scripting.ReactorScriptManager; import scripting.ReactorScriptManager;
import server.BossInMap;
import server.life.MapleMonsterInformationProvider; import server.life.MapleMonsterInformationProvider;
import handling.world.family.MapleFamilyCharacter; import handling.world.family.MapleFamilyCharacter;
import handling.world.family.MapleFamily; import handling.world.family.MapleFamily;
@ -188,7 +189,16 @@ public class World {
} }
} }
} }
if (map.characterSize() > 0) { int id = map.getId();
boolean a =false;
for (BossInMap bossInMap : Start.野外boss刷新) {
if (id == bossInMap.getMap()) {
a = true;
break;
}
}
if (map.characterSize() > 0 ||a) {
if (map.canSpawn()) { if (map.canSpawn()) {
map.respawn(false); map.respawn(false);
} }

View File

@ -833,6 +833,83 @@ public abstract class AbstractPlayerInteraction {
this.gainItemS(id, str, dex, luk, Int, hp, mp, watk, matk, wdef, mdef, hb, mz, ty, yd, this.c, time); this.gainItemS(id, str, dex, luk, Int, hp, mp, watk, matk, wdef, mdef, hb, mz, ty, yd, this.c, time);
} }
public final void gainItemtw(final int id, final int str, final int dex, final int luk, final int Int, final int hp, final int mp, final int watk, final int matk, final int wdef, final int mdef, final int hb, final int mz, final int ty, final int yd, final int time,String dd,String db,String qg,String qgjs) {
this.gainItemS(id, str, dex, luk, Int, hp, mp, watk, matk, wdef, mdef, hb, mz, ty, yd, this.c, time, dd, db, qg, qgjs);
}
private void gainItemS(int id, int str, int dex, int luk, int anInt, int hp, int mp, int watk, int matk, int wdef, int mdef, int hb, int mz, int ty, int yd, MapleClient cg, int time, String dd, String db, String qg, String qgjs) {
final MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
final MapleInventoryType type = GameConstants.getInventoryType(id);
if (!MapleInventoryManipulator.checkSpace(cg, id, 1, "")) {
return;
}
if (type.equals(MapleInventoryType.EQUIP) && !GameConstants.isThrowingStar(id) && !GameConstants.isBullet(id)) {
final Equip item = (Equip) (Equip) ii.getEquipById(id);
final String name = ii.getName(id);
if (id / 10000 == 114 && name != null && name.length() > 0) {
final String msg = "你已获得称号 <" + name + ">";
cg.getPlayer().dropMessage(5, msg);
cg.getPlayer().dropMessage(5, msg);
}
if (time > 0) {
item.setExpiration(System.currentTimeMillis() + (long) (time * 60 * 60 * 1000));
}
if (str > 0) {
item.setStr((short) str);
}
if (dex > 0) {
item.setDex((short) dex);
}
if (luk > 0) {
item.setLuk((short) luk);
}
if (anInt > 0) {
item.setInt((short) anInt);
}
if (hp > 0) {
item.setHp((short) hp);
}
if (mp > 0) {
item.setMp((short) mp);
}
if (watk > 0) {
item.setWatk((short) watk);
}
if (matk > 0) {
item.setMatk((short) matk);
}
if (wdef > 0) {
item.setWdef((short) wdef);
}
if (mdef > 0) {
item.setMdef((short) mdef);
}
if (hb > 0) {
item.setAvoid((short) hb);
}
if (mz > 0) {
item.setAcc((short) mz);
}
if (ty > 0) {
item.setJump((short) ty);
}
if (yd > 0) {
item.setSpeed((short) yd);
}
item.setdd(dd);
item.setdb(db);
item.setqg(qg);
item.setqgjs(qgjs);
MapleInventoryManipulator.addbyItem(cg, item.copy());
} else {
MapleInventoryManipulator.addById(cg, id, (short) 1);
}
cg.getSession().write(MaplePacketCreator.getShowItemGain(id, (short) 1, true));
}
public final void gainItemTime(final int id, final short quantity, final long period) { public final void gainItemTime(final int id, final short quantity, final long period) {
if (MapleItemInformationProvider.getInstance().isCash(id)) { if (MapleItemInformationProvider.getInstance().isCash(id)) {
this.gainItem(id, quantity, false, period, -1, ""); this.gainItem(id, quantity, false, period, -1, "");

View File

@ -42,7 +42,7 @@ public class NPCScriptManager extends AbstractScriptManager {
this.start(c, npc, 0, script); this.start(c, npc, 0, script);
} }
public final void start(final MapleClient c, final int npc, final int mode, final String script) { public final void start(final MapleClient c, final int npc, final int mode, final String script) {
final Lock lock = c.getNPCLock(); final Lock lock = c.getNPCLock();
lock.lock(); lock.lock();
try { try {
@ -132,6 +132,95 @@ public class NPCScriptManager extends AbstractScriptManager {
} }
} }
public synchronized final void startds(final MapleClient c, final int npc, final int mode, final String script) {
final Lock lock = c.getNPCLock();
lock.lock();
try {
if (c.getPlayer().getMobVac() || c.getPlayer().getItemVac()) {
c.getPlayer().dropMessage(1, "开着挂机的时候不能操作");
return;
}
if (c.getPlayer().isGM()) {
c.getPlayer().dropMessage("[系统提示]您已经建立与NPC:" + npc + ((script == null) ? "" : ("(" + script + ")")) + ((mode == 0) ? "" : ("型号: " + mode)) + "的对话。");
}
if (!this.cms.containsKey(c) && c.canClickNPC()) {
if (c.getPlayer() != null && c.getPlayer().getDebugMessage()) {
c.getPlayer().dropMessage("start - !cms.containsKey(c) && c.canClickNPC()");
}
if (c.getPlayer() != null && c.getPlayer().getDebugMessage()) {
c.getPlayer().dropMessage("start - setInvocable");
}
Invocable iv;
if (script == null) {
if (mode != 0) {
iv = this.getInvocable("npc/" + npc + "_" + mode + ".js", c, true);
} else {
iv = this.getInvocable("npc/" + npc + ".js", c, true);
}
} else {
iv = this.getInvocable("special/" + script + ".js", c, true);
}
if (iv == null) {
iv = this.getInvocable("special/notcoded.js", c, true);
if (iv == null) {
this.dispose(c);
return;
}
}
final ScriptEngine scriptengine = (ScriptEngine) iv;
if (c.getPlayer() != null && c.getPlayer().getDebugMessage()) {
c.getPlayer().dropMessage("start - iv");
}
final NPCConversationManager cm = new NPCConversationManager(c, npc, -1, mode, script, (byte) (-1), iv);
if (c.getPlayer() != null && c.getPlayer().getDebugMessage()) {
c.getPlayer().dropMessage("start - cm");
}
if (getInstance() == null) {
if (c.getPlayer() != null && c.getPlayer().getDebugMessage()) {
c.getPlayer().dropMessage("start = null");
}
this.dispose(c);
return;
}
this.cms.put(c, cm);
if (c.getPlayer() != null && c.getPlayer().getDebugMessage()) {
c.getPlayer().dropMessage("start - cms");
}
scriptengine.put("cm", cm);
if (c.getPlayer() != null) {
c.getPlayer().setConversation(1);
}
if (c.getPlayer() != null && c.getPlayer().getDebugMessage()) {
c.getPlayer().dropMessage("start - setConversation");
}
c.setClickedNPC();
if (c.getPlayer() != null && c.getPlayer().getDebugMessage()) {
c.getPlayer().dropMessage("start - setClickNPC");
}
try {
iv.invokeFunction("start", new Object[0]);
if (c.getPlayer() != null && c.getPlayer().getDebugMessage()) {
c.getPlayer().dropMessage("start - cms");
}
} catch (NoSuchMethodException nsme) {
iv.invokeFunction("action", Byte.valueOf((byte) 1), Byte.valueOf((byte) 0), Integer.valueOf(0));
}
}
} catch (ScriptException ex) {
} catch (NoSuchMethodException e) {
System.err.println("NPC 脚本错误1, 它ID为 : " + npc + "_" + ((script == null) ? "" : ("(" + script + ")")) + ((mode == 0) ? "" : ("型号: " + mode)) + "." + e);
if (c.getPlayer() != null && c.getPlayer().isGM()) {
c.getPlayer().dropMessage("[系统提示] NPC " + npc + "_" + ((script == null) ? "" : ("(" + script + ")")) + ((mode == 0) ? "" : ("型号: " + mode)) + "脚本错误 " + e + "");
}
FilePrinter.printError("NPCScriptManager1.txt", "Error executing NPC script, NPC ID : " + npc + "." + e);
this.dispose(c);
} finally {
lock.unlock();
}
}
public final void action(final MapleClient c, final byte mode, final byte type, final int selection) { public final void action(final MapleClient c, final byte mode, final byte type, final int selection) {
int sl = selection; int sl = selection;
if (selection < 0) { if (selection < 0) {

View File

@ -1,5 +1,7 @@
package server.life; package server.life;
import cn.hutool.core.date.DateUtil;
import handling.world.World;
import tools.MaplePacketCreator; import tools.MaplePacketCreator;
import server.maps.MapleMap; import server.maps.MapleMap;
import server.Randomizer; import server.Randomizer;
@ -53,6 +55,7 @@ public class SpawnPointAreaBoss extends Spawns {
final int rand = Randomizer.nextInt(3); final int rand = Randomizer.nextInt(3);
return (rand == 0) ? this.pos1 : ((rand == 1) ? this.pos2 : this.pos3); return (rand == 0) ? this.pos1 : ((rand == 1) ? this.pos2 : this.pos3);
} }
int a = 1;
@Override @Override
public final MapleMonster spawnMonster(final MapleMap map) { public final MapleMonster spawnMonster(final MapleMap map) {
@ -69,9 +72,13 @@ public class SpawnPointAreaBoss extends Spawns {
} }
}); });
map.spawnMonster(this.monster, -2); map.spawnMonster(this.monster, -2);
if (this.msg != null) { if (this.msg != null&&a>1) {
map.broadcastMessage(MaplePacketCreator.serverNotice(6, this.msg)); String formatTime = DateUtil.formatTime(DateUtil.date());
String replace = this.msg.replace("{time}", formatTime);
World.Broadcast.broadcastMessage(MaplePacketCreator.serverNotice(6, replace));
// map.broadcastMessage(MaplePacketCreator.serverNotice(6, this.msg));
} }
a++;
return this.monster; return this.monster;
} }
@ -79,4 +86,9 @@ public class SpawnPointAreaBoss extends Spawns {
public final int getMobTime() { public final int getMobTime() {
return this.mobTime; return this.mobTime;
} }
public static void main(String[] args) {
String formatTime = DateUtil.formatTime(DateUtil.date());
System.out.println(formatTime);
}
} }

View File

@ -675,7 +675,7 @@ public final class MapleMap {
if (mob.getStats().isBoss()) { if (mob.getStats().isBoss()) {
if (Randomizer.nextInt(10000) <= ((Integer) Start.ConfigValuesMap.get("BOSS出装备概率")).intValue()) { if (Randomizer.nextInt(10000) <= ((Integer) Start.ConfigValuesMap.get("BOSS出装备概率")).intValue()) {
final IItem idrop = ii.randomizeStats((Equip) ii.getEquipById(de2.itemId)); final IItem idrop = ii.randomizeStats((Equip) ii.getEquipById(de2.itemId));
if ((chr.get刷钱模式() == 1 && idrop.getItemId() != 0) || (chr.get刷钱模式() == 2 && idrop.getItemId() / 1000000 == 1)) { if ((chr.get刷钱模式() == 1 && idrop.getItemId() != 0) || (chr.get刷钱模式() == 2 && (idrop.getItemId() / 1000000 == 1||(idrop.getItemId()>200000&&idrop.getItemId()<2100000)))) {
double price; double price;
if (GameConstants.isThrowingStar(idrop.getItemId()) || GameConstants.isBullet(idrop.getItemId())) { if (GameConstants.isThrowingStar(idrop.getItemId()) || GameConstants.isBullet(idrop.getItemId())) {
price = (double) ii.getWholePrice(idrop.getItemId()); price = (double) ii.getWholePrice(idrop.getItemId());
@ -695,7 +695,7 @@ public final class MapleMap {
} }
} else if (Randomizer.nextInt(10000) <= ((Integer) Start.ConfigValuesMap.get("出装备概率")).intValue()) { } else if (Randomizer.nextInt(10000) <= ((Integer) Start.ConfigValuesMap.get("出装备概率")).intValue()) {
final IItem idrop = ii.randomizeStats((Equip) ii.getEquipById(de2.itemId)); final IItem idrop = ii.randomizeStats((Equip) ii.getEquipById(de2.itemId));
if ((chr.get刷钱模式() == 1 && idrop.getItemId() != 0) || (chr.get刷钱模式() == 2 && idrop.getItemId() / 1000000 == 1)) { if ((chr.get刷钱模式() == 1 && idrop.getItemId() != 0) || (chr.get刷钱模式() == 2 && (idrop.getItemId() / 1000000 == 1||(idrop.getItemId()>200000&&idrop.getItemId()<2100000)))) {
double price; double price;
if (GameConstants.isThrowingStar(idrop.getItemId()) || GameConstants.isBullet(idrop.getItemId())) { if (GameConstants.isThrowingStar(idrop.getItemId()) || GameConstants.isBullet(idrop.getItemId())) {
price = (double) ii.getWholePrice(idrop.getItemId()); price = (double) ii.getWholePrice(idrop.getItemId());
@ -716,7 +716,25 @@ public final class MapleMap {
} else { } else {
final int range = Math.abs(de2.Maximum - de2.Minimum); final int range = Math.abs(de2.Maximum - de2.Minimum);
final IItem idrop = new Item(de2.itemId, (short) 0, (short) ((de2.Maximum != 1) ? (Randomizer.nextInt((range <= 0) ? 1 : range) + de2.Minimum) : 1), (byte) 0); final IItem idrop = new Item(de2.itemId, (short) 0, (short) ((de2.Maximum != 1) ? (Randomizer.nextInt((range <= 0) ? 1 : range) + de2.Minimum) : 1), (byte) 0);
this.spawnMobDrop(idrop, this.calcDropPos(pos, mob.getPosition()), mob, chr, droptype, de2.questid);
if ((chr.get刷钱模式() == 1 && idrop.getItemId() != 0) || (chr.get刷钱模式() == 2 && (idrop.getItemId() / 1000000 == 1||(idrop.getItemId()>200000&&idrop.getItemId()<2100000)))) {
double price;
if (GameConstants.isThrowingStar(idrop.getItemId()) || GameConstants.isBullet(idrop.getItemId())) {
price = (double) ii.getWholePrice(idrop.getItemId());
} else {
price = ii.getPrice(idrop.getItemId());
}
final int recvMesos = (int) Math.max(Math.ceil(price), 0.0);
if (price != -1.0 && recvMesos > 0) {
chr.gainMeso(recvMesos, true);
if (recvMesos >= 10000) {
chr.dropMessage(6, "掉落物品名称:" + MapleItemInformationProvider.getInstance().getName(idrop.getItemId()) + " 自动为你售卖掉获得:" + recvMesos + "金币");
}
}
} else {
this.spawnMobDrop(idrop, this.calcDropPos(pos, mob.getPosition()), mob, chr, droptype, de2.questid);
}
} }
++d; ++d;
} }
@ -762,7 +780,23 @@ public final class MapleMap {
idrop = new Item(de3.itemId, (short) 0, (short) ((de3.Maximum != 1) ? (Randomizer.nextInt(de3.Maximum - de3.Minimum) + de3.Minimum) : 1), (byte) 0); idrop = new Item(de3.itemId, (short) 0, (short) ((de3.Maximum != 1) ? (Randomizer.nextInt(de3.Maximum - de3.Minimum) + de3.Minimum) : 1), (byte) 0);
} }
if (mob.getId() != 9300175) { if (mob.getId() != 9300175) {
this.spawnMobDrop(idrop, this.calcDropPos(pos, mob.getPosition()), mob, chr, (byte) (de3.onlySelf ? 0 : droptype), de3.questid); if ((chr.get刷钱模式() == 1 && idrop.getItemId() != 0) || (chr.get刷钱模式() == 2 && (idrop.getItemId() / 1000000 == 1||(idrop.getItemId()>200000&&idrop.getItemId()<2100000)))) {
double price;
if (GameConstants.isThrowingStar(idrop.getItemId()) || GameConstants.isBullet(idrop.getItemId())) {
price = (double) ii.getWholePrice(idrop.getItemId());
} else {
price = ii.getPrice(idrop.getItemId());
}
final int recvMesos = (int) Math.max(Math.ceil(price), 0.0);
if (price != -1.0 && recvMesos > 0) {
chr.gainMeso(recvMesos, true);
if (recvMesos >= 10000) {
chr.dropMessage(6, "掉落物品名称:" + MapleItemInformationProvider.getInstance().getName(idrop.getItemId()) + " 自动为你售卖掉获得:" + recvMesos + "金币");
}
}
} else {
this.spawnMobDrop(idrop, this.calcDropPos(pos, mob.getPosition()), mob, chr, (byte) (de3.onlySelf ? 0 : droptype), de3.questid);
}
} }
++d; ++d;
} }
@ -3620,6 +3654,9 @@ public final class MapleMap {
} }
public void respawn(final boolean force) { public void respawn(final boolean force) {
this.lastSpawnTime = System.currentTimeMillis(); this.lastSpawnTime = System.currentTimeMillis();
final MapleMonster mobb = this.getMonsterById(9990026); final MapleMonster mobb = this.getMonsterById(9990026);
final int monmun = MapConstants.isMonsterSpawn(this); final int monmun = MapConstants.isMonsterSpawn(this);
@ -3632,6 +3669,17 @@ public final class MapleMap {
this.createMobInterval = newsh; this.createMobInterval = newsh;
numm = 1; numm = 1;
} }
for (int i = 0; i < this.monsterSpawn.size(); i++) {
Spawns spawns = this.monsterSpawn.get(i);
if (spawns instanceof SpawnPointAreaBoss){
SpawnPointAreaBoss spawnPoint2 = (SpawnPointAreaBoss) spawns;
if (spawnPoint2.shouldSpawn() || MapConstants.isForceRespawn(this.mapid)) {
spawnPoint2.spawnMonster(this);
}
}
}
if (force) { if (force) {
final int numShouldSpawn = this.monsterSpawn.size() * monmun * numm - this.spawnedMonstersOnMap.get(); final int numShouldSpawn = this.monsterSpawn.size() * monmun * numm - this.spawnedMonstersOnMap.get();
if (numShouldSpawn > 0) { if (numShouldSpawn > 0) {