- 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()
|
||||
|
Reference in New Issue
Block a user