Merge branch 'master' of http://192.168.200.25:3000/Lenheart/MXD-Server
This commit is contained in:
commit
ddc2c68c55
|
|
@ -6961,6 +6961,10 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject implements Se
|
||||||
return this.stats.dropMod;
|
return this.stats.dropMod;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getcashMod() {
|
||||||
|
return this.stats.cashMod;
|
||||||
|
}
|
||||||
|
|
||||||
public int getBs() {
|
public int getBs() {
|
||||||
return this.stats.bs;
|
return this.stats.bs;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -597,30 +597,7 @@ public class PlayerStats implements Serializable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int bl = 0;
|
|
||||||
int jb = 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);
|
|
||||||
}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;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -647,6 +624,37 @@ public class PlayerStats implements Serializable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int bl = 0;
|
||||||
|
int jb = 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);
|
||||||
|
}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)) {
|
||||||
switch (item2.getItemId()) {
|
switch (item2.getItemId()) {
|
||||||
case 5062000: {
|
case 5062000: {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
package gui.tw;
|
||||||
|
|
||||||
|
public class Bwsql {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,527 @@
|
||||||
|
package gui.tw;
|
||||||
|
|
||||||
|
import database.DBConPool;
|
||||||
|
import server.MapleItemInformationProvider;
|
||||||
|
import server.life.MapleLifeFactory;
|
||||||
|
import server.life.MapleMonster;
|
||||||
|
import server.life.MapleMonsterInformationProvider;
|
||||||
|
import server.life.MonsterGlobalDropEntry;
|
||||||
|
import tools.FileoutputUtil;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import javax.swing.table.DefaultTableModel;
|
||||||
|
import java.sql.*;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
public class Drop {
|
||||||
|
|
||||||
|
int id;
|
||||||
|
|
||||||
|
int dropperid;
|
||||||
|
|
||||||
|
int itemId;
|
||||||
|
|
||||||
|
String itenName;
|
||||||
|
String dropName;
|
||||||
|
|
||||||
|
int chance;
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getDropperid() {
|
||||||
|
return dropperid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDropperid(int dropperid) {
|
||||||
|
this.dropperid = dropperid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getItemId() {
|
||||||
|
return itemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setItemId(int itemId) {
|
||||||
|
this.itemId = itemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getItenName() {
|
||||||
|
return itenName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setItenName(String itenName) {
|
||||||
|
this.itenName = itenName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDropName() {
|
||||||
|
return dropName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDropName(String dropName) {
|
||||||
|
this.dropName = dropName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getChance() {
|
||||||
|
return chance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChance(int chance) {
|
||||||
|
this.chance = chance;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static List<Drop> mobs =null;
|
||||||
|
public static List<Drop> QQS =null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得怪物爆率集合
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<Drop> getMobBLs() {
|
||||||
|
|
||||||
|
if (mobs != null) {
|
||||||
|
return mobs;
|
||||||
|
}
|
||||||
|
mobs = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
final Connection con = (Connection) DBConPool.getInstance().getDataSource().getConnection();
|
||||||
|
PreparedStatement ps = null;
|
||||||
|
ResultSet rs = null;
|
||||||
|
|
||||||
|
ps = con.prepareStatement("SELECT * FROM drop_data WHERE itemid !=0");
|
||||||
|
rs = ps.executeQuery();
|
||||||
|
while (rs.next()) {
|
||||||
|
Drop b = new Drop();
|
||||||
|
b.setId(rs.getInt("id"));
|
||||||
|
b.setDropperid(rs.getInt("dropperid"));
|
||||||
|
b.setItemId(rs.getInt("itemid"));
|
||||||
|
b.setItenName(MapleItemInformationProvider.getInstance().getName(rs.getInt("itemid")));
|
||||||
|
MapleMonster dropperid1 = MapleLifeFactory.getMonster(rs.getInt("dropperid"));
|
||||||
|
if (dropperid1 != null) {
|
||||||
|
b.setDropName(dropperid1.getStats().getName());
|
||||||
|
} else {
|
||||||
|
b.setDropName("未查询到怪物");
|
||||||
|
}
|
||||||
|
b.setChance(rs.getInt("chance"));
|
||||||
|
b.setChance(rs.getInt("chance"));
|
||||||
|
mobs.add(b);
|
||||||
|
}
|
||||||
|
rs.close();
|
||||||
|
ps.close();
|
||||||
|
con.close();
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
System.err.println("[" + FileoutputUtil.CurrentReadable_Time() + "]怪物暴率出错:" + ex.getMessage());
|
||||||
|
}
|
||||||
|
return mobs;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得卡片爆率集合
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<Drop> getKPS() {
|
||||||
|
List<Drop> mobBLs = getMobBLs();
|
||||||
|
List<Drop> collect = mobBLs.stream()
|
||||||
|
.filter(drop -> drop.getItemId() > 2380000 && drop.getItemId() < 2390000)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
return collect;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据序号 删除怪物爆率
|
||||||
|
* @param id 序号
|
||||||
|
* @param dropperid 怪物id
|
||||||
|
*/
|
||||||
|
public static void deleteGWId(int id,int dropperid) {
|
||||||
|
try {
|
||||||
|
final Connection con = (Connection) DBConPool.getInstance().getDataSource().getConnection();
|
||||||
|
PreparedStatement ps = null;
|
||||||
|
|
||||||
|
ps = con.prepareStatement("DELETE FROM drop_data where id = ?");
|
||||||
|
ps.setInt(1,id);
|
||||||
|
ps.execute();
|
||||||
|
ps.close();
|
||||||
|
con.close();
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
System.err.println("[" + FileoutputUtil.CurrentReadable_Time() + "]删除出错:" + ex.getMessage());
|
||||||
|
}
|
||||||
|
MapleMonsterInformationProvider.getInstance().removeById(dropperid);
|
||||||
|
mobs = mobs.stream().filter(drop -> drop.getId() != id)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据怪物id删除这个怪物的爆率
|
||||||
|
* @param dropperid 怪物id
|
||||||
|
*/
|
||||||
|
public static void deleteGWdropperid(int dropperid) {
|
||||||
|
try {
|
||||||
|
final Connection con = (Connection) DBConPool.getInstance().getDataSource().getConnection();
|
||||||
|
PreparedStatement ps = null;
|
||||||
|
|
||||||
|
ps = con.prepareStatement("DELETE FROM drop_data where dropperid = ?");
|
||||||
|
ps.setInt(1,dropperid);
|
||||||
|
ps.execute();
|
||||||
|
ps.close();
|
||||||
|
con.close();
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
System.err.println("[" + FileoutputUtil.CurrentReadable_Time() + "]删除出错:" + ex.getMessage());
|
||||||
|
}
|
||||||
|
MapleMonsterInformationProvider.getInstance().removeById(dropperid);
|
||||||
|
|
||||||
|
mobs = mobs.stream().filter(drop -> drop.getDropperid() != dropperid)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清空怪物爆率表
|
||||||
|
*/
|
||||||
|
public static void deleteGWAll() {
|
||||||
|
try {
|
||||||
|
final Connection con = (Connection) DBConPool.getInstance().getDataSource().getConnection();
|
||||||
|
PreparedStatement ps = null;
|
||||||
|
ps = con.prepareStatement("TRUNCATE TABLE drop_data ");
|
||||||
|
ps.execute();
|
||||||
|
ps.close();
|
||||||
|
con.close();
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
System.err.println("[" + FileoutputUtil.CurrentReadable_Time() + "]刷新出错:" + ex.getMessage());
|
||||||
|
}
|
||||||
|
MapleMonsterInformationProvider.getInstance().removeByAll();
|
||||||
|
mobs = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改怪物爆率
|
||||||
|
* @param dropperid 怪物id
|
||||||
|
* @param itemid 物品id
|
||||||
|
* @param chance 爆率
|
||||||
|
* @param id 序号
|
||||||
|
*/
|
||||||
|
public static void updateGWId(int dropperid, int itemid, int chance, int id) {
|
||||||
|
try {
|
||||||
|
final Connection con = (Connection) DBConPool.getInstance().getDataSource().getConnection();
|
||||||
|
PreparedStatement ps = null;
|
||||||
|
|
||||||
|
ps = con.prepareStatement("UPDATE drop_data set dropperid = ?,itemid = ?,chance = ? where id = ?");
|
||||||
|
ps.setInt(1, dropperid);
|
||||||
|
ps.setInt(2, itemid);
|
||||||
|
ps.setInt(3, chance);
|
||||||
|
ps.setInt(4, id);
|
||||||
|
ps.execute();
|
||||||
|
con.close();
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
System.err.println("[" + FileoutputUtil.CurrentReadable_Time() + "]刷新出错:" + ex.getMessage());
|
||||||
|
}
|
||||||
|
MapleMonsterInformationProvider.getInstance().removeById(dropperid);
|
||||||
|
mobs.forEach(drop -> {
|
||||||
|
if (drop.getId() == id) {
|
||||||
|
drop.setDropperid(dropperid);
|
||||||
|
drop.setItemId(itemid);
|
||||||
|
drop.setChance(chance);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加怪物爆率
|
||||||
|
* @param dropperid 怪物id
|
||||||
|
* @param itemid 物品id
|
||||||
|
* @param chance 爆率
|
||||||
|
*/
|
||||||
|
public static void insertGWId(int dropperid, int itemid, int chance) {
|
||||||
|
try {
|
||||||
|
final Connection con = (Connection) DBConPool.getInstance().getDataSource().getConnection();
|
||||||
|
PreparedStatement ps = null;
|
||||||
|
|
||||||
|
ps = con.prepareStatement("INSERT INTO drop_data (dropperid,itemid,minimum_quantity,maximum_quantity,chance) VALUES( ?,?,1,1,?)", Statement.RETURN_GENERATED_KEYS);
|
||||||
|
ps.setInt(1, dropperid);
|
||||||
|
ps.setInt(2, itemid);
|
||||||
|
ps.setInt(3, chance);
|
||||||
|
int id = ps.executeUpdate();
|
||||||
|
|
||||||
|
ps.close();
|
||||||
|
con.close();
|
||||||
|
|
||||||
|
Drop b = new Drop();
|
||||||
|
b.setId(id);
|
||||||
|
b.setDropperid(dropperid);
|
||||||
|
b.setItemId(itemid);
|
||||||
|
b.setItenName(MapleItemInformationProvider.getInstance().getName(itemid));
|
||||||
|
MapleMonster dropperid1 = MapleLifeFactory.getMonster(itemid);
|
||||||
|
if (dropperid1 != null) {
|
||||||
|
b.setDropName(dropperid1.getStats().getName());
|
||||||
|
} else {
|
||||||
|
b.setDropName("未查询到怪物");
|
||||||
|
}
|
||||||
|
b.setChance(chance);
|
||||||
|
QQS.add(b);
|
||||||
|
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
System.err.println("[" + FileoutputUtil.CurrentReadable_Time() + "]刷新出错:" + ex.getMessage());
|
||||||
|
}
|
||||||
|
MapleMonsterInformationProvider.getInstance().removeById(dropperid);
|
||||||
|
mobs =null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得全局爆率集合
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<Drop> getQQS() {
|
||||||
|
if (QQS!=null){
|
||||||
|
return QQS;
|
||||||
|
}
|
||||||
|
QQS = new ArrayList<>();
|
||||||
|
try {
|
||||||
|
final Connection con = (Connection) DBConPool.getInstance().getDataSource().getConnection();
|
||||||
|
PreparedStatement ps = null;
|
||||||
|
ResultSet rs = null;
|
||||||
|
|
||||||
|
ps = con.prepareStatement("SELECT * FROM drop_data_global WHERE itemid !=0");
|
||||||
|
rs = ps.executeQuery();
|
||||||
|
while (rs.next()) {
|
||||||
|
Drop b = new Drop();
|
||||||
|
b.setId(rs.getInt("id"));
|
||||||
|
b.setDropperid(rs.getInt("dropperid"));
|
||||||
|
b.setItemId(rs.getInt("itemid"));
|
||||||
|
b.setItenName(MapleItemInformationProvider.getInstance().getName(rs.getInt("itemid")));
|
||||||
|
MapleMonster dropperid1 = MapleLifeFactory.getMonster(rs.getInt("dropperid"));
|
||||||
|
if (dropperid1 != null) {
|
||||||
|
b.setDropName(dropperid1.getStats().getName());
|
||||||
|
} else {
|
||||||
|
b.setDropName("未查询到怪物");
|
||||||
|
}
|
||||||
|
b.setChance(rs.getInt("chance"));
|
||||||
|
QQS.add(b);
|
||||||
|
}
|
||||||
|
rs.close();
|
||||||
|
ps.close();
|
||||||
|
con.close();
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
System.err.println("[" + FileoutputUtil.CurrentReadable_Time() + "]怪物暴率出错:" + ex.getMessage());
|
||||||
|
}
|
||||||
|
return QQS;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改全局爆率
|
||||||
|
* @param itemid 物品id
|
||||||
|
* @param chance 爆率
|
||||||
|
* @param id 序号
|
||||||
|
*/
|
||||||
|
public static void updateQQId(int itemid, int chance, int id) {
|
||||||
|
try {
|
||||||
|
final Connection con = (Connection) DBConPool.getInstance().getDataSource().getConnection();
|
||||||
|
PreparedStatement ps = null;
|
||||||
|
|
||||||
|
ps = con.prepareStatement("UPDATE drop_data_global set itemid = ?,chance = ? where id = ?");
|
||||||
|
ps.setInt(1, itemid);
|
||||||
|
ps.setInt(2, chance);
|
||||||
|
ps.setInt(3, id);
|
||||||
|
ps.execute();
|
||||||
|
con.close();
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
System.err.println("[" + FileoutputUtil.CurrentReadable_Time() + "]刷新出错:" + ex.getMessage());
|
||||||
|
}
|
||||||
|
MapleMonsterInformationProvider.getInstance().getGlobalDrop().clear();
|
||||||
|
MapleMonsterInformationProvider.getInstance().retrieveGlobal();
|
||||||
|
|
||||||
|
QQS.forEach(drop -> {
|
||||||
|
if (drop.getId() == id) {
|
||||||
|
drop.setItemId(itemid);
|
||||||
|
drop.setChance(chance);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 增加全局爆率
|
||||||
|
* @param itemid 物品id
|
||||||
|
* @param chance 爆率
|
||||||
|
*/
|
||||||
|
public static void insertQQ(int itemid, int chance ) {
|
||||||
|
try {
|
||||||
|
final Connection con = (Connection) DBConPool.getInstance().getDataSource().getConnection();
|
||||||
|
PreparedStatement ps = null;
|
||||||
|
|
||||||
|
ps = con.prepareStatement("INSERT INTO drop_data_global (continent,droptype,itemid,minimum_quantity,maximum_quantity,chance) VALUES(1,1,?,1,1,?)", Statement.RETURN_GENERATED_KEYS);
|
||||||
|
ps.setInt(1, itemid);
|
||||||
|
ps.setInt(2, chance);
|
||||||
|
int id = ps.executeUpdate();
|
||||||
|
ps.close();
|
||||||
|
con.close();
|
||||||
|
|
||||||
|
Drop b = new Drop();
|
||||||
|
b.setId(id);
|
||||||
|
b.setItemId(itemid);
|
||||||
|
b.setItenName(MapleItemInformationProvider.getInstance().getName(itemid));
|
||||||
|
b.setChance(chance);
|
||||||
|
QQS.add(b);
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
System.err.println("[" + FileoutputUtil.CurrentReadable_Time() + "]刷新出错:" + ex.getMessage());
|
||||||
|
}
|
||||||
|
MapleMonsterInformationProvider.getInstance().getGlobalDrop().clear();
|
||||||
|
MapleMonsterInformationProvider.getInstance().retrieveGlobal();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除全局爆率集合
|
||||||
|
*/
|
||||||
|
public static void deleteQJAll() {
|
||||||
|
try {
|
||||||
|
final Connection con = (Connection) DBConPool.getInstance().getDataSource().getConnection();
|
||||||
|
PreparedStatement ps = null;
|
||||||
|
ps = con.prepareStatement("TRUNCATE TABLE drop_data_global ");
|
||||||
|
ps.execute();
|
||||||
|
ps.close();
|
||||||
|
con.close();
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
System.err.println("[" + FileoutputUtil.CurrentReadable_Time() + "]刷新出错:" + ex.getMessage());
|
||||||
|
}
|
||||||
|
MapleMonsterInformationProvider.getInstance().getGlobalDrop().clear();
|
||||||
|
MapleMonsterInformationProvider.getInstance().retrieveGlobal();
|
||||||
|
QQS = null;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 清理道具id爆率
|
||||||
|
*/
|
||||||
|
public static void deleteItemId(int itemId) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
final Connection con = (Connection) DBConPool.getInstance().getDataSource().getConnection();
|
||||||
|
PreparedStatement ps = null;
|
||||||
|
|
||||||
|
ps = con.prepareStatement("DELETE FROM drop_data where itemid = ?");
|
||||||
|
ps.setInt(1,itemId);
|
||||||
|
ps.execute();
|
||||||
|
ps.close();
|
||||||
|
con.close();
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
System.err.println("[" + FileoutputUtil.CurrentReadable_Time() + "]删除出错:" + ex.getMessage());
|
||||||
|
}
|
||||||
|
MapleMonsterInformationProvider.getInstance().removeByAll();
|
||||||
|
|
||||||
|
mobs = mobs.stream().filter(drop -> drop.getItemId() != itemId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
try {
|
||||||
|
final Connection con = (Connection) DBConPool.getInstance().getDataSource().getConnection();
|
||||||
|
PreparedStatement ps = null;
|
||||||
|
|
||||||
|
ps = con.prepareStatement("DELETE FROM drop_data_global where itemid = ?");
|
||||||
|
ps.setInt(1,itemId);
|
||||||
|
ps.execute();
|
||||||
|
ps.close();
|
||||||
|
} catch (SQLException ex) {
|
||||||
|
System.err.println("[" + FileoutputUtil.CurrentReadable_Time() + "]删除出错:" + ex.getMessage());
|
||||||
|
}
|
||||||
|
MapleMonsterInformationProvider.getInstance().getGlobalDrop().clear();
|
||||||
|
MapleMonsterInformationProvider.getInstance().retrieveGlobal();
|
||||||
|
|
||||||
|
QQS = QQS.stream().filter(drop -> drop.getItemId() != itemId)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据道具id查询掉落
|
||||||
|
*/
|
||||||
|
public static List<Drop> getItemIdsMob(String itemId) {
|
||||||
|
List<Drop> mobBLs = getMobBLs();
|
||||||
|
return mobBLs.stream().filter(drop -> String.valueOf(drop.getItemId()).contains(itemId))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据物品名称查询掉落
|
||||||
|
*/
|
||||||
|
public static List<Drop> getItemNamesMob(String itemName) {
|
||||||
|
List<Drop> mobBLs = getMobBLs();
|
||||||
|
return mobBLs.stream().filter(drop -> String.valueOf(drop.getItenName()).contains(itemName))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据道具id查询全局掉落
|
||||||
|
*/
|
||||||
|
public static List<Drop> getItemIdsQQ(String itemId) {
|
||||||
|
List<Drop> qqs = getQQS();
|
||||||
|
return qqs.stream().filter(drop -> String.valueOf(drop.getItemId()).contains(itemId))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据物品名称查询全局掉落
|
||||||
|
*/
|
||||||
|
public static List<Drop> getItemNamesQQ(String itemName) {
|
||||||
|
List<Drop> qqs = getQQS();
|
||||||
|
return qqs.stream().filter(drop -> String.valueOf(drop.getItenName()).contains(itemName))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据怪物id查询掉落
|
||||||
|
*/
|
||||||
|
public static List<Drop> getMobIdsMob(String MobId) {
|
||||||
|
List<Drop> mobBLs = getMobBLs();
|
||||||
|
return mobBLs.stream().filter(drop -> String.valueOf(drop.getDropperid()).contains(MobId))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据物品名称查询掉落
|
||||||
|
*/
|
||||||
|
public static List<Drop> getMobNames(String MobName) {
|
||||||
|
List<Drop> mobBLs = getMobBLs();
|
||||||
|
return mobBLs.stream().filter(drop -> String.valueOf(drop.getDropName()).contains(MobName))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
* @param drops 原始集合
|
||||||
|
* @param type 1按序号排序 2道具id 3道具名字 4怪物id 5怪物名字 6爆率
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<Drop> sort(final List<Drop> drops,int type) {
|
||||||
|
switch (type){
|
||||||
|
case 1:
|
||||||
|
drops.sort(Comparator.comparingInt(Drop::getId));
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
drops.sort(Comparator.comparingInt(Drop::getItemId));
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
drops.sort(Comparator.comparing(Drop::getItenName));
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
drops.sort(Comparator.comparingInt(Drop::getDropperid));
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
drops.sort(Comparator.comparing(Drop::getDropName));
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
drops.sort(Comparator.comparingInt(Drop::getChance));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return drops;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -102,12 +102,12 @@ public class InventoryHandler {
|
||||||
final short dst = slea.readShort();
|
final short dst = slea.readShort();
|
||||||
final short quantity = slea.readShort();
|
final short quantity = slea.readShort();
|
||||||
if (src < 0 && dst > 0) {
|
if (src < 0 && dst > 0) {
|
||||||
MapleInventoryManipulator.unequip(c, src, dst);//脱装备时
|
MapleInventoryManipulator.unequip(c, src, dst);
|
||||||
c.getSession().write(MaplePacketCreator.fuckGuildInfo(c.getPlayer()));//自定义的显示名字
|
c.getSession().write(MaplePacketCreator.fuckGuildInfo(c.getPlayer()));
|
||||||
c.sendPacket(FamilyPacket.getFamilyInfo(c.getPlayer()));
|
c.sendPacket(FamilyPacket.getFamilyInfo(c.getPlayer()));
|
||||||
} else if (dst < 0) {
|
} else if (dst < 0) {
|
||||||
MapleInventoryManipulator.equip(c, src, dst);//穿装备时
|
MapleInventoryManipulator.equip(c, src, dst);
|
||||||
c.getSession().write(MaplePacketCreator.fuckGuildInfo(c.getPlayer()));//自定义的显示名字
|
c.getSession().write(MaplePacketCreator.fuckGuildInfo(c.getPlayer()));
|
||||||
c.sendPacket(FamilyPacket.getFamilyInfo(c.getPlayer()));
|
c.sendPacket(FamilyPacket.getFamilyInfo(c.getPlayer()));
|
||||||
} else if (dst == 0) {
|
} else if (dst == 0) {
|
||||||
MapleInventoryManipulator.drop(c, type, src, quantity);
|
MapleInventoryManipulator.drop(c, type, src, quantity);
|
||||||
|
|
@ -115,9 +115,6 @@ public class InventoryHandler {
|
||||||
MapleInventoryManipulator.move(c, type, src, dst);
|
MapleInventoryManipulator.move(c, type, src, dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
System.out.println(1);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final void ItemSort(final LittleEndianAccessor slea, final MapleClient c) {
|
public static final void ItemSort(final LittleEndianAccessor slea, final MapleClient c) {
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,13 @@ public class MapleMonsterInformationProvider {
|
||||||
this.retrieveGlobal();
|
this.retrieveGlobal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void removeById(Integer id) {
|
||||||
|
drops.remove(id);
|
||||||
|
}
|
||||||
|
public void removeByAll( ) {
|
||||||
|
drops.clear();
|
||||||
|
}
|
||||||
|
|
||||||
public static final MapleMonsterInformationProvider getInstance() {
|
public static final MapleMonsterInformationProvider getInstance() {
|
||||||
return MapleMonsterInformationProvider.instance;
|
return MapleMonsterInformationProvider.instance;
|
||||||
}
|
}
|
||||||
|
|
@ -54,7 +61,7 @@ public class MapleMonsterInformationProvider {
|
||||||
return this.mobCache;
|
return this.mobCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void retrieveGlobal() {
|
public void retrieveGlobal() {
|
||||||
PreparedStatement ps = null;
|
PreparedStatement ps = null;
|
||||||
ResultSet rs = null;
|
ResultSet rs = null;
|
||||||
try (final Connection con = (Connection) DBConPool.getInstance().getDataSource().getConnection()) {
|
try (final Connection con = (Connection) DBConPool.getInstance().getDataSource().getConnection()) {
|
||||||
|
|
|
||||||
|
|
@ -659,7 +659,7 @@ public final class MapleMap {
|
||||||
}
|
}
|
||||||
if (de2.itemId == 0) {
|
if (de2.itemId == 0) {
|
||||||
final int mesos = Randomizer.nextInt(1 + Math.abs(de2.Maximum - de2.Minimum)) + de2.Minimum;
|
final int mesos = Randomizer.nextInt(1 + Math.abs(de2.Maximum - de2.Minimum)) + de2.Minimum;
|
||||||
int mmeos = (int) ((double) mesos * (chr.getStat().mesoBuff / 100.0) * (double) chr.getDropMod());
|
int mmeos = (int) ((double) mesos * (chr.getStat().mesoBuff / 100.0) * (double) chr.getcashMod());
|
||||||
if (((Integer) Start.ConfigValuesMap.get("金币重置")).intValue() < 1 && mmeos > 0) {
|
if (((Integer) Start.ConfigValuesMap.get("金币重置")).intValue() < 1 && mmeos > 0) {
|
||||||
if (((Integer) Start.ConfigValuesMap.get("金币全局砍数量")).intValue() > 0) {
|
if (((Integer) Start.ConfigValuesMap.get("金币全局砍数量")).intValue() > 0) {
|
||||||
mmeos /= ((Integer) Start.ConfigValuesMap.get("金币砍全局倍率")).intValue();
|
mmeos /= ((Integer) Start.ConfigValuesMap.get("金币砍全局倍率")).intValue();
|
||||||
|
|
@ -667,6 +667,7 @@ public final class MapleMap {
|
||||||
if (mmeos < 1) {
|
if (mmeos < 1) {
|
||||||
mmeos = 1;
|
mmeos = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.spawnMobMesoDrop(mmeos, this.calcDropPos(pos, mob.getTruePosition()), (MapleMapObject) mob, chr, false, droptype);
|
this.spawnMobMesoDrop(mmeos, this.calcDropPos(pos, mob.getTruePosition()), (MapleMapObject) mob, chr, false, droptype);
|
||||||
mesoDropped = true;
|
mesoDropped = true;
|
||||||
}
|
}
|
||||||
|
|
@ -732,7 +733,8 @@ public final class MapleMap {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.spawnMobMesoDrop((int) ((double) mesos2 * (lastMeso / 100.0) * ((double) (chr.getVipExpRate() / 100) + 1.0) * (double) chr.getDropMod() * chr.getDropm() * (double) cmServerrate), this.calcDropPos(pos, mob.getTruePosition()), (MapleMapObject) mob, chr, false, droptype);
|
double a = (double) mesos2 * (lastMeso / 100.0) * ((double) (chr.getVipExpRate() / 100) + 1.0) * (double) chr.getDropMod() * chr.getDropm() * (double) cmServerrate;
|
||||||
|
this.spawnMobMesoDrop((int) (a), this.calcDropPos(pos, mob.getTruePosition()), (MapleMapObject) mob, chr, false, droptype);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (chr.getEventInstance() == null) {
|
if (chr.getEventInstance() == null) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue