- Added all referenced libraries for eclipse to perform as it should.
- Renamed AuctionManager into ClanHallAuctionManager. - Created Comission (Auction house) system. - Reworked vitality system from account based to subclass based.
This commit is contained in:
@ -30,7 +30,7 @@ import javolution.util.FastMap;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.enums.InstanceType;
|
||||
import com.l2jserver.gameserver.instancemanager.AuctionManager;
|
||||
import com.l2jserver.gameserver.instancemanager.ClanHallAuctionManager;
|
||||
import com.l2jserver.gameserver.instancemanager.ClanHallManager;
|
||||
import com.l2jserver.gameserver.instancemanager.MapRegionManager;
|
||||
import com.l2jserver.gameserver.model.ClanPrivilege;
|
||||
@ -172,7 +172,7 @@ public final class L2AuctioneerInstance extends L2Npc
|
||||
}
|
||||
|
||||
String filename = "data/html/auction/AgitAuctionInfo.htm";
|
||||
Auction a = AuctionManager.getInstance().getAuction(auctionId);
|
||||
Auction a = ClanHallAuctionManager.getInstance().getAuction(auctionId);
|
||||
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
|
||||
html.setFile(player.getHtmlPrefix(), filename);
|
||||
@ -224,7 +224,7 @@ public final class L2AuctioneerInstance extends L2Npc
|
||||
bid = Math.min(Long.parseLong(st.nextToken()), MAX_ADENA);
|
||||
}
|
||||
|
||||
AuctionManager.getInstance().getAuction(auctionId).setBid(player, bid);
|
||||
ClanHallAuctionManager.getInstance().getAuction(auctionId).setBid(player, bid);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@ -260,10 +260,10 @@ public final class L2AuctioneerInstance extends L2Npc
|
||||
{
|
||||
String filename = "data/html/auction/AgitBid1.htm";
|
||||
|
||||
long minimumBid = AuctionManager.getInstance().getAuction(Integer.parseInt(val)).getHighestBidderMaxBid();
|
||||
long minimumBid = ClanHallAuctionManager.getInstance().getAuction(Integer.parseInt(val)).getHighestBidderMaxBid();
|
||||
if (minimumBid == 0)
|
||||
{
|
||||
minimumBid = AuctionManager.getInstance().getAuction(Integer.parseInt(val)).getStartingBid();
|
||||
minimumBid = ClanHallAuctionManager.getInstance().getAuction(Integer.parseInt(val)).getStartingBid();
|
||||
}
|
||||
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
|
||||
@ -283,7 +283,7 @@ public final class L2AuctioneerInstance extends L2Npc
|
||||
}
|
||||
else if (actualCommand.equalsIgnoreCase("list"))
|
||||
{
|
||||
List<Auction> auctions = AuctionManager.getInstance().getAuctions();
|
||||
List<Auction> auctions = ClanHallAuctionManager.getInstance().getAuctions();
|
||||
SimpleDateFormat format = new SimpleDateFormat("yy/MM/dd");
|
||||
/** Limit for make new page, prevent client crash **/
|
||||
int limit = 15;
|
||||
@ -394,7 +394,7 @@ public final class L2AuctioneerInstance extends L2Npc
|
||||
}
|
||||
|
||||
String biders = "";
|
||||
Map<Integer, Bidder> bidders = AuctionManager.getInstance().getAuction(auctionId).getBidders();
|
||||
Map<Integer, Bidder> bidders = ClanHallAuctionManager.getInstance().getAuction(auctionId).getBidders();
|
||||
for (Bidder b : bidders.values())
|
||||
{
|
||||
biders += "<tr>" + "<td>" + b.getClanName() + "</td><td>" + b.getName() + "</td><td>" + b.getTimeBid().get(Calendar.YEAR) + "/" + (b.getTimeBid().get(Calendar.MONTH) + 1) + "/" + b.getTimeBid().get(Calendar.DATE) + "</td><td>" + b.getBid() + "</td>" + "</tr>";
|
||||
@ -418,7 +418,7 @@ public final class L2AuctioneerInstance extends L2Npc
|
||||
String filename = "data/html/auction/AgitBidInfo.htm";
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
|
||||
html.setFile(player.getHtmlPrefix(), filename);
|
||||
Auction a = AuctionManager.getInstance().getAuction(player.getClan().getAuctionBiddedAt());
|
||||
Auction a = ClanHallAuctionManager.getInstance().getAuction(player.getClan().getAuctionBiddedAt());
|
||||
if (a != null)
|
||||
{
|
||||
html.replace("%AGIT_NAME%", a.getItemName());
|
||||
@ -443,13 +443,13 @@ public final class L2AuctioneerInstance extends L2Npc
|
||||
player.sendPacket(html);
|
||||
return;
|
||||
}
|
||||
else if ((player.getClan() != null) && (AuctionManager.getInstance().getAuction(player.getClan().getHideoutId()) != null))
|
||||
else if ((player.getClan() != null) && (ClanHallAuctionManager.getInstance().getAuction(player.getClan().getHideoutId()) != null))
|
||||
{
|
||||
SimpleDateFormat format = new SimpleDateFormat("dd/MM/yyyy HH:mm");
|
||||
String filename = "data/html/auction/AgitSaleInfo.htm";
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
|
||||
html.setFile(player.getHtmlPrefix(), filename);
|
||||
Auction a = AuctionManager.getInstance().getAuction(player.getClan().getHideoutId());
|
||||
Auction a = ClanHallAuctionManager.getInstance().getAuction(player.getClan().getHideoutId());
|
||||
if (a != null)
|
||||
{
|
||||
html.replace("%AGIT_NAME%", a.getItemName());
|
||||
@ -513,7 +513,7 @@ public final class L2AuctioneerInstance extends L2Npc
|
||||
}
|
||||
else if (actualCommand.equalsIgnoreCase("cancelBid"))
|
||||
{
|
||||
long bid = AuctionManager.getInstance().getAuction(player.getClan().getAuctionBiddedAt()).getBidders().get(player.getClanId()).getBid();
|
||||
long bid = ClanHallAuctionManager.getInstance().getAuction(player.getClan().getAuctionBiddedAt()).getBidders().get(player.getClanId()).getBid();
|
||||
String filename = "data/html/auction/AgitBidCancel.htm";
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
|
||||
html.setFile(player.getHtmlPrefix(), filename);
|
||||
@ -526,9 +526,9 @@ public final class L2AuctioneerInstance extends L2Npc
|
||||
}
|
||||
else if (actualCommand.equalsIgnoreCase("doCancelBid"))
|
||||
{
|
||||
if (AuctionManager.getInstance().getAuction(player.getClan().getAuctionBiddedAt()) != null)
|
||||
if (ClanHallAuctionManager.getInstance().getAuction(player.getClan().getAuctionBiddedAt()) != null)
|
||||
{
|
||||
AuctionManager.getInstance().getAuction(player.getClan().getAuctionBiddedAt()).cancelBid(player.getClanId());
|
||||
ClanHallAuctionManager.getInstance().getAuction(player.getClan().getAuctionBiddedAt()).cancelBid(player.getClanId());
|
||||
player.sendPacket(SystemMessageId.YOU_HAVE_CANCELED_YOUR_BID);
|
||||
}
|
||||
return;
|
||||
@ -555,9 +555,9 @@ public final class L2AuctioneerInstance extends L2Npc
|
||||
}
|
||||
else if (actualCommand.equalsIgnoreCase("doCancelAuction"))
|
||||
{
|
||||
if (AuctionManager.getInstance().getAuction(player.getClan().getHideoutId()) != null)
|
||||
if (ClanHallAuctionManager.getInstance().getAuction(player.getClan().getHideoutId()) != null)
|
||||
{
|
||||
AuctionManager.getInstance().getAuction(player.getClan().getHideoutId()).cancelAuction();
|
||||
ClanHallAuctionManager.getInstance().getAuction(player.getClan().getHideoutId()).cancelAuction();
|
||||
player.sendMessage("Your auction has been canceled");
|
||||
}
|
||||
return;
|
||||
@ -611,7 +611,7 @@ public final class L2AuctioneerInstance extends L2Npc
|
||||
String filename = "data/html/auction/AgitBid2.htm";
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
|
||||
html.setFile(player.getHtmlPrefix(), filename);
|
||||
Auction a = AuctionManager.getInstance().getAuction(player.getClan().getAuctionBiddedAt());
|
||||
Auction a = ClanHallAuctionManager.getInstance().getAuction(player.getClan().getAuctionBiddedAt());
|
||||
if (a != null)
|
||||
{
|
||||
html.replace("%AGIT_AUCTION_BID%", String.valueOf(a.getBidders().get(player.getClanId()).getBid()));
|
||||
|
@ -218,6 +218,7 @@ import com.l2jserver.gameserver.model.interfaces.IEventListener;
|
||||
import com.l2jserver.gameserver.model.interfaces.ILocational;
|
||||
import com.l2jserver.gameserver.model.itemcontainer.Inventory;
|
||||
import com.l2jserver.gameserver.model.itemcontainer.ItemContainer;
|
||||
import com.l2jserver.gameserver.model.itemcontainer.PcAuction;
|
||||
import com.l2jserver.gameserver.model.itemcontainer.PcFreight;
|
||||
import com.l2jserver.gameserver.model.itemcontainer.PcInventory;
|
||||
import com.l2jserver.gameserver.model.itemcontainer.PcRefund;
|
||||
@ -375,9 +376,9 @@ public final class L2PcInstance extends L2Playable
|
||||
private static final String DELETE_TP_BOOKMARK = "DELETE FROM character_tpbookmark WHERE charId=? AND Id=?";
|
||||
|
||||
// Character Subclass SQL String Definitions:
|
||||
private static final String RESTORE_CHAR_SUBCLASSES = "SELECT class_id,exp,sp,level,class_index,dual_class FROM character_subclasses WHERE charId=? ORDER BY class_index ASC";
|
||||
private static final String RESTORE_CHAR_SUBCLASSES = "SELECT class_id,exp,sp,vitality_points,level,class_index,dual_class FROM character_subclasses WHERE charId=? ORDER BY class_index ASC";
|
||||
private static final String ADD_CHAR_SUBCLASS = "INSERT INTO character_subclasses (charId,class_id,exp,sp,level,class_index,dual_class) VALUES (?,?,?,?,?,?,?)";
|
||||
private static final String UPDATE_CHAR_SUBCLASS = "UPDATE character_subclasses SET exp=?,sp=?,level=?,class_id=?,dual_class=? WHERE charId=? AND class_index =?";
|
||||
private static final String UPDATE_CHAR_SUBCLASS = "UPDATE character_subclasses SET exp=?,sp=?,vitality_points=?,level=?,class_id=?,dual_class=? WHERE charId=? AND class_index =?";
|
||||
private static final String DELETE_CHAR_SUBCLASS = "DELETE FROM character_subclasses WHERE charId=? AND class_index=?";
|
||||
|
||||
// Character Henna SQL String Definitions:
|
||||
@ -583,6 +584,7 @@ public final class L2PcInstance extends L2Playable
|
||||
protected boolean _recoTwoHoursGiven = false;
|
||||
|
||||
private final PcInventory _inventory = new PcInventory(this);
|
||||
private final PcAuction _auctionInventory = new PcAuction(this);
|
||||
private final PcFreight _freight = new PcFreight(this);
|
||||
private PcWarehouse _warehouse;
|
||||
private PcRefund _refund;
|
||||
@ -2886,6 +2888,11 @@ public final class L2PcInstance extends L2Playable
|
||||
return _inventory;
|
||||
}
|
||||
|
||||
public PcAuction getAuctionInventory()
|
||||
{
|
||||
return _auctionInventory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a ShortCut of the L2PcInstance _shortCuts.
|
||||
* @param objectId
|
||||
@ -7195,6 +7202,8 @@ public final class L2PcInstance extends L2Playable
|
||||
// Set Teleport Bookmark Slot
|
||||
player.setBookMarkSlot(rset.getInt("BookmarkSlot"));
|
||||
|
||||
player._vitPoints = rset.getInt("vitality_points");
|
||||
|
||||
// character creation Time
|
||||
player.getCreateDate().setTime(rset.getDate("createDate"));
|
||||
|
||||
@ -7378,6 +7387,7 @@ public final class L2PcInstance extends L2Playable
|
||||
subClass.setLevel(rset.getByte("level"));
|
||||
subClass.setExp(rset.getLong("exp"));
|
||||
subClass.setSp(rset.getLong("sp"));
|
||||
subClass.setVitalityPoints(rset.getInt("vitality_points"));
|
||||
subClass.setClassIndex(rset.getInt("class_index"));
|
||||
|
||||
// Enforce the correct indexing of _subClasses against their class indexes.
|
||||
@ -7653,7 +7663,7 @@ public final class L2PcInstance extends L2Playable
|
||||
statement.setString(45, getName());
|
||||
statement.setLong(46, 0); // unset
|
||||
statement.setInt(47, getBookMarkSlot());
|
||||
statement.setInt(48, 0); // unset
|
||||
statement.setInt(48, _vitPoints); // unset
|
||||
statement.setString(49, getLang());
|
||||
|
||||
int factionId = 0;
|
||||
@ -7691,11 +7701,12 @@ public final class L2PcInstance extends L2Playable
|
||||
{
|
||||
statement.setLong(1, subClass.getExp());
|
||||
statement.setLong(2, subClass.getSp());
|
||||
statement.setInt(3, subClass.getLevel());
|
||||
statement.setInt(4, subClass.getClassId());
|
||||
statement.setBoolean(5, subClass.isDualClass());
|
||||
statement.setInt(6, getObjectId());
|
||||
statement.setInt(7, subClass.getClassIndex());
|
||||
statement.setInt(3, subClass.getVitalityPoints());
|
||||
statement.setInt(4, subClass.getLevel());
|
||||
statement.setInt(5, subClass.getClassId());
|
||||
statement.setBoolean(6, subClass.isDualClass());
|
||||
statement.setInt(7, getObjectId());
|
||||
statement.setInt(8, subClass.getClassIndex());
|
||||
statement.execute();
|
||||
statement.clearParameters();
|
||||
}
|
||||
@ -12861,11 +12872,6 @@ public final class L2PcInstance extends L2Playable
|
||||
return _agathionId;
|
||||
}
|
||||
|
||||
public int getVitalityPoints()
|
||||
{
|
||||
return getStat().getVitalityPoints();
|
||||
}
|
||||
|
||||
public void setVitalityPoints(int points, boolean quiet)
|
||||
{
|
||||
getStat().setVitalityPoints(points, quiet);
|
||||
@ -14858,4 +14864,29 @@ public final class L2PcInstance extends L2Playable
|
||||
{
|
||||
return getServitors().values().stream().mapToInt(L2Summon::getSummonPoints).sum();
|
||||
}
|
||||
|
||||
int _vitPoints = 140000;
|
||||
|
||||
/*
|
||||
* Return current vitality points in integer format
|
||||
*/
|
||||
public int getVitalityPoints()
|
||||
{
|
||||
if (getClassId().getId() == getBaseClass())
|
||||
{
|
||||
return _vitPoints;
|
||||
}
|
||||
return getSubClasses().get(getClassIndex()).getVitalityPoints();
|
||||
}
|
||||
|
||||
public void setVitalityPoints(int points)
|
||||
{
|
||||
if (getClassId().getId() == getBaseClass())
|
||||
{
|
||||
_vitPoints = points;
|
||||
return;
|
||||
}
|
||||
getSubClasses().get(getClassIndex()).setVitalityPoints(points);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -655,31 +655,18 @@ public class PcStat extends PlayableStat
|
||||
return val;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return current vitality points in integer format
|
||||
*/
|
||||
public int getVitalityPoints()
|
||||
{
|
||||
return getActiveChar().getAccountVariables().getInt(VITALITY_VARIABLE, Config.STARTING_VITALITY_POINTS);
|
||||
}
|
||||
|
||||
public void setVitalityPoints(int points)
|
||||
{
|
||||
getActiveChar().getAccountVariables().set(VITALITY_VARIABLE, points);
|
||||
}
|
||||
|
||||
/*
|
||||
* Set current vitality points to this value if quiet = true - does not send system messages
|
||||
*/
|
||||
public void setVitalityPoints(int points, boolean quiet)
|
||||
{
|
||||
points = Math.min(Math.max(points, MIN_VITALITY_POINTS), MAX_VITALITY_POINTS);
|
||||
if (points == getVitalityPoints())
|
||||
if (points == getActiveChar().getVitalityPoints())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (points < getVitalityPoints())
|
||||
if (points < getActiveChar().getVitalityPoints())
|
||||
{
|
||||
getActiveChar().sendPacket(SystemMessageId.YOUR_VITALITY_HAS_DECREASED);
|
||||
}
|
||||
@ -688,7 +675,7 @@ public class PcStat extends PlayableStat
|
||||
getActiveChar().sendPacket(SystemMessageId.YOUR_VITALITY_HAS_INCREASED);
|
||||
}
|
||||
|
||||
setVitalityPoints(points);
|
||||
getActiveChar().setVitalityPoints(points);
|
||||
|
||||
if (points == 0)
|
||||
{
|
||||
@ -700,7 +687,7 @@ public class PcStat extends PlayableStat
|
||||
}
|
||||
|
||||
final L2PcInstance player = getActiveChar();
|
||||
player.sendPacket(new ExVitalityPointInfo(getVitalityPoints()));
|
||||
player.sendPacket(new ExVitalityPointInfo(getActiveChar().getVitalityPoints()));
|
||||
if (player.isInParty())
|
||||
{
|
||||
final PartySmallWindowUpdate partyWindow = new PartySmallWindowUpdate(player, false);
|
||||
@ -751,19 +738,19 @@ public class PcStat extends PlayableStat
|
||||
|
||||
if (points > 0)
|
||||
{
|
||||
points = Math.min(getVitalityPoints() + points, MAX_VITALITY_POINTS);
|
||||
points = Math.min(getActiveChar().getVitalityPoints() + points, MAX_VITALITY_POINTS);
|
||||
}
|
||||
else
|
||||
{
|
||||
points = Math.max(getVitalityPoints() + points, MIN_VITALITY_POINTS);
|
||||
points = Math.max(getActiveChar().getVitalityPoints() + points, MIN_VITALITY_POINTS);
|
||||
}
|
||||
|
||||
if (Math.abs(points - getVitalityPoints()) <= 1e-6)
|
||||
if (Math.abs(points - getActiveChar().getVitalityPoints()) <= 1e-6)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
setVitalityPoints(points);
|
||||
getActiveChar().setVitalityPoints(points);
|
||||
}
|
||||
|
||||
public double getVitalityMultiplier()
|
||||
|
@ -35,6 +35,8 @@ public final class SubClass
|
||||
private long _sp = 0;
|
||||
private byte _level = Config.BASE_SUBCLASS_LEVEL;
|
||||
private int _classIndex = 1;
|
||||
|
||||
private int _vitalityPoints = 140000;
|
||||
private boolean _dualClass = false;
|
||||
|
||||
public SubClass()
|
||||
@ -68,6 +70,11 @@ public final class SubClass
|
||||
return _level;
|
||||
}
|
||||
|
||||
public int getVitalityPoints()
|
||||
{
|
||||
return _vitalityPoints;
|
||||
}
|
||||
|
||||
/**
|
||||
* First Sub-Class is index 1.
|
||||
* @return int _classIndex
|
||||
@ -126,6 +133,11 @@ public final class SubClass
|
||||
_level = levelValue;
|
||||
}
|
||||
|
||||
public void setVitalityPoints(int vit)
|
||||
{
|
||||
_vitalityPoints = vit;
|
||||
}
|
||||
|
||||
public void incLevel()
|
||||
{
|
||||
if (!_dualClass && (getLevel() == _maxLevel))
|
||||
|
@ -36,7 +36,7 @@ import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.data.sql.impl.ClanTable;
|
||||
import com.l2jserver.gameserver.enums.AuctionItemType;
|
||||
import com.l2jserver.gameserver.idfactory.IdFactory;
|
||||
import com.l2jserver.gameserver.instancemanager.AuctionManager;
|
||||
import com.l2jserver.gameserver.instancemanager.ClanHallAuctionManager;
|
||||
import com.l2jserver.gameserver.instancemanager.ClanHallManager;
|
||||
import com.l2jserver.gameserver.model.L2Clan;
|
||||
import com.l2jserver.gameserver.model.L2World;
|
||||
@ -421,7 +421,7 @@ public class Auction
|
||||
/** Remove auctions */
|
||||
public void deleteAuctionFromDB()
|
||||
{
|
||||
AuctionManager.getInstance().getAuctions().remove(this);
|
||||
ClanHallAuctionManager.getInstance().getAuctions().remove(this);
|
||||
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement statement = con.prepareStatement("DELETE FROM auction WHERE itemId=?"))
|
||||
{
|
||||
@ -449,8 +449,8 @@ public class Auction
|
||||
/**
|
||||
* If seller haven't sell ClanHall, auction removed, THIS MUST BE CONFIRMED
|
||||
*/
|
||||
int aucId = AuctionManager.getInstance().getAuctionIndex(_id);
|
||||
AuctionManager.getInstance().getAuctions().remove(aucId);
|
||||
int aucId = ClanHallAuctionManager.getInstance().getAuctionIndex(_id);
|
||||
ClanHallAuctionManager.getInstance().getAuctions().remove(aucId);
|
||||
return;
|
||||
}
|
||||
if (_sellerId > 0)
|
||||
@ -506,7 +506,7 @@ public class Auction
|
||||
/** Confirm an auction */
|
||||
public void confirmAuction()
|
||||
{
|
||||
AuctionManager.getInstance().getAuctions().add(this);
|
||||
ClanHallAuctionManager.getInstance().getAuctions().add(this);
|
||||
try (Connection con = L2DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement statement = con.prepareStatement("INSERT INTO auction (id, sellerId, sellerName, sellerClanName, itemType, itemId, itemObjectId, itemName, itemQuantity, startingBid, currentBid, endDate) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)"))
|
||||
{
|
||||
|
@ -61,6 +61,8 @@ public class Message
|
||||
private boolean _hasAttachments;
|
||||
private Mail _attachments = null;
|
||||
private ScheduledFuture<?> _unloadTask = null;
|
||||
private int _systemMessage1 = 0;
|
||||
private int _systemMessage2 = 0;
|
||||
|
||||
private int _itemId;
|
||||
private int _enchantLvl;
|
||||
@ -95,6 +97,8 @@ public class Message
|
||||
_elementals[i] = Integer.parseInt(elemDef[i]);
|
||||
}
|
||||
}
|
||||
_systemMessage1 = rset.getInt("systemMessage1");
|
||||
_systemMessage2 = rset.getInt("systemMessage2");
|
||||
}
|
||||
|
||||
/*
|
||||
@ -115,6 +119,28 @@ public class Message
|
||||
_reqAdena = reqAdena;
|
||||
}
|
||||
|
||||
/*
|
||||
* This constructor used for System Mails
|
||||
*/
|
||||
public Message(int receiverId, String subject, String content, int systemMessage1, int systemMessage2, MailType sendBySystem)
|
||||
{
|
||||
_messageId = IdFactory.getInstance().getNextId();
|
||||
_senderId = -1;
|
||||
_receiverId = receiverId;
|
||||
_subject = subject;
|
||||
_content = content;
|
||||
_expiration = System.currentTimeMillis() + (EXPIRATION * 3600000);
|
||||
_reqAdena = 0;
|
||||
_hasAttachments = false;
|
||||
_unread = true;
|
||||
_deletedBySender = true;
|
||||
_deletedByReceiver = false;
|
||||
_messageType = sendBySystem;
|
||||
_returned = false;
|
||||
_systemMessage1 = systemMessage1;
|
||||
_systemMessage2 = systemMessage2;
|
||||
}
|
||||
|
||||
/*
|
||||
* This constructor used for System Mails
|
||||
*/
|
||||
@ -209,7 +235,7 @@ public class Message
|
||||
_elementals[item.getAttackElementType()] = item.getAttackElementPower();
|
||||
}
|
||||
}
|
||||
else if (mailType == MailType.COMMISSION_ITEM_RETURNED)
|
||||
else if (mailType == MailType.SYSTEM)
|
||||
{
|
||||
final Mail attachement = createAttachments();
|
||||
attachement.addItem("CommissionReturnItem", item, null, null);
|
||||
@ -218,7 +244,7 @@ public class Message
|
||||
|
||||
public static final PreparedStatement getStatement(Message msg, Connection con) throws SQLException
|
||||
{
|
||||
PreparedStatement stmt = con.prepareStatement("INSERT INTO messages (messageId, senderId, receiverId, subject, content, expiration, reqAdena, hasAttachments, isUnread, isDeletedBySender, isDeletedByReceiver, sendBySystem, isReturned, itemId, enchantLvl, elementals) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
||||
PreparedStatement stmt = con.prepareStatement("INSERT INTO messages (messageId, senderId, receiverId, subject, content, expiration, reqAdena, hasAttachments, isUnread, isDeletedBySender, isDeletedByReceiver, sendBySystem, isReturned, itemId, enchantLvl, elementals, systemMessage1, systemMessage2) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
||||
|
||||
stmt.setInt(1, msg._messageId);
|
||||
stmt.setInt(2, msg._senderId);
|
||||
@ -236,6 +262,8 @@ public class Message
|
||||
stmt.setInt(14, msg._itemId);
|
||||
stmt.setInt(15, msg._enchantLvl);
|
||||
stmt.setString(16, msg._elementals[0] + ";" + msg._elementals[1] + ";" + msg._elementals[2] + ";" + msg._elementals[3] + ";" + msg._elementals[4] + ";" + msg._elementals[5]);
|
||||
stmt.setInt(17, msg._systemMessage1);
|
||||
stmt.setInt(18, msg._systemMessage2);
|
||||
|
||||
return stmt;
|
||||
}
|
||||
@ -272,7 +300,7 @@ public class Message
|
||||
case NPC: // Handled by NpcName in client
|
||||
case BIRTHDAY: // Handled by Sysstring in client
|
||||
case COMMISSION_ITEM_SOLD: // Handled by Sysstring in client
|
||||
case COMMISSION_ITEM_RETURNED: // Handled by Sysstring in client
|
||||
case SYSTEM: // Handled by Sysstring in client
|
||||
case MENTOR_NPC: // Handled in client
|
||||
default:
|
||||
{
|
||||
@ -325,6 +353,16 @@ public class Message
|
||||
return _unread;
|
||||
}
|
||||
|
||||
public final int getSystemMessage1()
|
||||
{
|
||||
return _systemMessage1;
|
||||
}
|
||||
|
||||
public final int getSystemMessage2()
|
||||
{
|
||||
return _systemMessage2;
|
||||
}
|
||||
|
||||
public final void markAsRead()
|
||||
{
|
||||
if (_unread)
|
||||
|
@ -26,7 +26,7 @@ import java.util.logging.Logger;
|
||||
import com.l2jserver.L2DatabaseFactory;
|
||||
import com.l2jserver.gameserver.ThreadPoolManager;
|
||||
import com.l2jserver.gameserver.data.sql.impl.ClanTable;
|
||||
import com.l2jserver.gameserver.instancemanager.AuctionManager;
|
||||
import com.l2jserver.gameserver.instancemanager.ClanHallAuctionManager;
|
||||
import com.l2jserver.gameserver.instancemanager.ClanHallManager;
|
||||
import com.l2jserver.gameserver.model.L2Clan;
|
||||
import com.l2jserver.gameserver.model.StatsSet;
|
||||
@ -181,7 +181,7 @@ public final class AuctionableHall extends ClanHall
|
||||
{
|
||||
if (ClanHallManager.getInstance().loaded())
|
||||
{
|
||||
AuctionManager.getInstance().initNPC(getId());
|
||||
ClanHallAuctionManager.getInstance().initNPC(getId());
|
||||
ClanHallManager.getInstance().setFree(getId());
|
||||
Clan.broadcastToOnlineMembers(SystemMessage.getSystemMessage(SystemMessageId.THE_CLAN_HALL_FEE_IS_ONE_WEEK_OVERDUE_THEREFORE_THE_CLAN_HALL_OWNERSHIP_HAS_BEEN_REVOKED));
|
||||
}
|
||||
|
@ -0,0 +1,55 @@
|
||||
/*
|
||||
* This program is free software: you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License as published by the Free Software
|
||||
* Foundation, either version 3 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.l2jserver.gameserver.model.itemcontainer;
|
||||
|
||||
import com.l2jserver.gameserver.enums.ItemLocation;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
|
||||
/**
|
||||
* @author Erlandys
|
||||
*/
|
||||
public class PcAuction extends ItemContainer
|
||||
{
|
||||
private final L2PcInstance _owner;
|
||||
|
||||
public PcAuction(L2PcInstance owner)
|
||||
{
|
||||
_owner = owner;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return "Auction";
|
||||
}
|
||||
|
||||
@Override
|
||||
public L2PcInstance getOwner()
|
||||
{
|
||||
return _owner;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemLocation getBaseLocation()
|
||||
{
|
||||
return ItemLocation.AUCTION;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean validateCapacity(long slots)
|
||||
{
|
||||
return ((_items.size() + slots) <= 10);
|
||||
}
|
||||
}
|
@ -125,6 +125,7 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
private final int _time;
|
||||
private final int _autoDestroyTime;
|
||||
private final int _bodyPart;
|
||||
private final String _bodyPartName;
|
||||
private final int _referencePrice;
|
||||
private final int _crystalCount;
|
||||
private final boolean _sellable;
|
||||
@ -177,6 +178,7 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
_time = set.getInt("time", -1);
|
||||
_autoDestroyTime = set.getInt("auto_destroy_time", -1) * 1000;
|
||||
_bodyPart = ItemTable._slots.get(set.getString("bodypart", "none"));
|
||||
_bodyPartName = set.getString("bodypart", "none");
|
||||
_referencePrice = set.getInt("price", 0);
|
||||
_crystalType = set.getEnum("crystal_type", CrystalType.class, CrystalType.NONE);
|
||||
_crystalCount = set.getInt("crystal_count", 0);
|
||||
@ -939,6 +941,14 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
return _icon;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return body part name
|
||||
*/
|
||||
public String getBodyPartName()
|
||||
{
|
||||
return _bodyPartName;
|
||||
}
|
||||
|
||||
public int getDefaultEnchantLevel()
|
||||
{
|
||||
return _defaultEnchantLevel;
|
||||
|
Reference in New Issue
Block a user