Jump to content

Recommended Posts

Posted (edited)
Hello guys, yesterday I saw on a server that mod, and ended up going to some research on it and found it, and there are people there selling this mod, beware! it's FREE !
compatible system with frozen! 
 
what mod do?
you go on the npc, and "put your item for sale" the person who wants to buy go there on NPC, click on its entry and purchase the amount you put!
coreside
Index: com/l2jfrozen/gameserver/GameServer.java
===================================================================
--- com/l2jfrozen/gameserver/GameServer.java (revisÆo 5307)
+++ com/l2jfrozen/gameserver/GameServer.java (c¢pia de trabalho)
@@ -42,6 +42,7 @@
 import com.l2jfrozen.gameserver.datatables.sql.HennaTable;
 
 import com.l2jfrozen.gameserver.datatables.sql.HennaTreeTable;
 
 import com.l2jfrozen.gameserver.datatables.sql.HeroSkillTable;
 
+import com.l2jfrozen.gameserver.datatables.sql.ItemMarketTable;
 
 import com.l2jfrozen.gameserver.datatables.sql.ItemTable;
 
 import com.l2jfrozen.gameserver.datatables.sql.LevelUpData;
 
 import com.l2jfrozen.gameserver.datatables.sql.NobleSkillTable;
 
 
@@ -342,6 +343,7 @@
  
        CastleManorManager.getInstance();
  
        L2Manor.getInstance();
  
        AuctionManager.getInstance();
 
+       ItemMarketTable.getInstance();
 
 
  Util.printSection("Olympiad");
 
  Olympiad.getInstance();
 
  Util.printSection("Dungeons");
 
 
datapack
Index: data/html/marketer/all.htm
===================================================================
--- data/html/marketer/all.htm (revisÆo 0)
+++ data/html/marketer/all.htm (revisÆo 0)
@@ -0,0 +1,12 @@
+<html><body>
+Marketer:<br>
+What kind of item grade?<br>
+<a action="bypass -h npc_%objectId%_See 0">No Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 1">D Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 2">C Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 3">B Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 4">A Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 5">S Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 6">S80 Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 7">All Grades</a><br>
+</body></html>
Index: data/html/marketer/weapon.htm
===================================================================
--- data/html/marketer/weapon.htm (revisÆo 0)
+++ data/html/marketer/weapon.htm (revisÆo 0)
@@ -0,0 +1,12 @@
+<html><body>
+Marketer:<br>
+What kind of item grade?<br>
+<a action="bypass -h npc_%objectId%_See 8">No Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 9">D Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 10">C Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 11">B Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 12">A Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 13">S Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 14">S80 Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 15">All Grades</a><br>
+</body></html>
Index: data/html/marketer/info.htm
===================================================================
--- data/html/marketer/info.htm (revisÆo 0)
+++ data/html/marketer/info.htm (revisÆo 0)
@@ -0,0 +1,8 @@
+<html><body>
+Marketer:<br>
+Well, the service I offer is very simple, you give a certain amount of an item and a price.
+I will sell it for you in the entire world.
+And the most important thing, it's for <font color="00FF00">free</font>! Whether will we someday charge a tax? Only Einhasad knows!
+<br>
+<a action="bypass -h npc_%objectId%_Main">Back.</a>
+</body></html>
Index: data/html/marketer/comfirm.htm
===================================================================
--- data/html/marketer/comfirm.htm (revisÆo 0)
+++ data/html/marketer/comfirm.htm (revisÆo 0)
@@ -0,0 +1,13 @@
+<html><body>
+<table width=270><tr>
+<td valign=top width=35><img src="%itemIcon%" width=32 height=32 align=left></td>
+<td valign=top width=235>
+<table border=0 width=100%>
+<tr><td><font color="A2A0A2">Name:</font> <font color="B09878">%itemName%</font></td></tr>
+<tr><td><font color="A2A0A2">Count:</font> <font color="B09878">%count%</font></td></tr>
+<tr><td><font color="A2A0A2">Price:</font> <font color="B09878">%price%</font></td></tr>
+<tr><td><button value="Comfirm" action="bypass -h npc_%objectId%_AddItem %itemObjId% %count% %iprice%" width=66 height=16 back="L2UI.DefaultButton_click" fore="L2UI.DefaultButton"></td></tr>
+<tr><td><button value="Back" action="bypass -h npc_%objectId%_SelectItem %itemObjId%" width=66 height=16 back="L2UI.DefaultButton_click" fore="L2UI.DefaultButton"></td></tr>
+</table></td>
+</tr></table>
+</body></html>
\ No newline at end of file
Index: data/html/marketer/shot.htm
===================================================================
--- data/html/marketer/shot.htm (revisÆo 0)
+++ data/html/marketer/shot.htm (revisÆo 0)
@@ -0,0 +1,12 @@
+<html><body>
+Marketer:<br>
+What kind of item grade?<br>
+<a action="bypass -h npc_%objectId%_See 32">No Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 33">D Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 34">C Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 35">B Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 36">A Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 37">S Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 38">S80 Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 39">All Grades</a><br>
+</body></html>
Index: data/html/marketer/cash.htm
===================================================================
--- data/html/marketer/cash.htm (revisÆo 0)
+++ data/html/marketer/cash.htm (revisÆo 0)
@@ -0,0 +1,5 @@
+<html><body>
+You have got %money% of Adena.<br>
+<a action="bypass -h npc_%objectId%_Cash">Get the money.</a><br>
+<a action="bypass -h npc_%objectId%_Link marketer/deal.htm">Back.</a><br>
+</body></html>
Index: data/html/marketer/armor.htm
===================================================================
--- data/html/marketer/armor.htm (revisÆo 0)
+++ data/html/marketer/armor.htm (revisÆo 0)
@@ -0,0 +1,12 @@
+<html><body>
+Marketer:<br>
+What kind of item grade?<br>
+<a action="bypass -h npc_%objectId%_See 16">No Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 17">D Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 18">C Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 19">B Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 20">A Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 21">S Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 22">S80 Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 23">All Grades</a><br>
+</body></html>
Index: data/html/marketer/other.htm
===================================================================
--- data/html/marketer/other.htm (revisÆo 0)
+++ data/html/marketer/other.htm (revisÆo 0)
@@ -0,0 +1,12 @@
+<html><body>
+Marketer:<br>
+What kind of item grade?<br>
+<a action="bypass -h npc_%objectId%_See 48">No Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 49">D Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 50">C Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 51">B Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 52">A Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 53">S Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 54">S80 Grade</a><br>
+<a action="bypass -h npc_%objectId%_See 55">All Grades</a><br>
+</body></html>
Index: data/html/marketer/main.htm
===================================================================
--- data/html/marketer/main.htm (revisÆo 0)
+++ data/html/marketer/main.htm (revisÆo 0)
@@ -0,0 +1,8 @@
+<html><body>
+Marketer:<br>
+Welcome adventurer! I am a marketer, people from all the world give me various items to sell.<br>
+Are you interested?<br>
+<a action="bypass -h npc_%objectId%_Link marketer/info.htm">Tell me more.</a><br>
+<a action="bypass -h npc_%objectId%_Link marketer/search.htm">Show me your items.</a><br>
+<a action="bypass -h npc_%objectId%_Link marketer/deal.htm">My Market.</a><br>
+</body></html>
Index: data/html/marketer/deal.htm
===================================================================
--- data/html/marketer/deal.htm (revisÆo 0)
+++ data/html/marketer/deal.htm (revisÆo 0)
@@ -0,0 +1,7 @@
+<html><body>
+Marketer:<br>
+So, how can I help you?<br>
+<a action="bypass -h npc_%objectId%_ListInv">Add an item.</a><br>
+<a action="bypass -h npc_%objectId%_Private">See My Items.</a><br>
+<a action="bypass -h npc_%objectId%_SeeCash">My Cash.</a><br>
+</body></html>
Index: data/html/marketer/search.htm
===================================================================
--- data/html/marketer/search.htm (revisÆo 0)
+++ data/html/marketer/search.htm (revisÆo 0)
@@ -0,0 +1,12 @@
+<html><body>
+Marketer:<br>
+What kind of item would you like to see?<br>
+<a action="bypass -h npc_%objectId%_Link marketer/weapon.htm">Weapons</a><br>
+<a action="bypass -h npc_%objectId%_Link marketer/armor.htm">Armor</a><br>
+<a action="bypass -h npc_%objectId%_See 31">Recipe</a><br>
+<a action="bypass -h npc_%objectId%_Link marketer/shot.htm">Shots</a><br>
+<a action="bypass -h npc_%objectId%_See 47">Spellbooks</a><br>
+<a action="bypass -h npc_%objectId%_See 63">Material</a><br>
+<a action="bypass -h npc_%objectId%_Link marketer/other.htm">Other</a><br>
+<a action="bypass -h npc_%objectId%_Link marketer/all.htm">All Items</a>
+</body></html>
Index: data/html/marketer/addItem.htm
===================================================================
--- data/html/marketer/addItem.htm (revisÆo 0)
+++ data/html/marketer/addItem.htm (revisÆo 0)
@@ -0,0 +1,7 @@
+<html><body>Enter Quantity:<br>
+<edit var="count" width=110> Max of %aval%<br></td></tr>
+Enter Price (for each item):<br>
+<edit var="price" width=110><br></td></tr>
+<tr><td><button value="Enter" action="bypass -h npc_%objectId%_ComfirmAdd %itemObjId% $count $price" width=80 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_ct1.button_df"><br>
+<button value="Cancel" action="bypass -h npc_%objectId%_Link marketer/deal.htm" width=80 height=27 back="L2UI_CT1.Button_DF_Down" fore="L2UI_ct1.button_df">
+</body></html>
Add Item marketable Location:
com.l2jfrozen.gameserver.data tables.sql
 
/*
 * 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.l2jfrozen.gameserver.datatables.sql;
 
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.Map;
import java.util.List;
 
import javolution.util.FastMap;
import javolution.util.FastList;
import java.util.logging.Logger;
 
import com.l2jfrozen.util.database.L2DatabaseFactory;
import com.l2jfrozen.gameserver.thread.ThreadPoolManager;
import com.l2jfrozen.gameserver.model.L2ItemMarketModel;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
 
public class ItemMarketTable {
 
private static ItemMarketTable _instance = null;
private Map<Integer, String> _itemIcons = null;
private Map<Integer, List<L2ItemMarketModel>> _marketItems = null;
private Map<Integer, Integer> _sellers = null;
private static final Logger                             _log = Logger.getLogger(ItemMarketTable.class.getName());
private ItemMarketTable() {
}
 
public static ItemMarketTable getInstance() {
if (_instance == null) {
_instance = new ItemMarketTable();
_instance.load();
}
return _instance;
}
 
private void load() {
_marketItems = new FastMap<Integer, List<L2ItemMarketModel>>();
Connection con = null;
int mrktCount = 0;
try {
con = L2DatabaseFactory.getInstance().getConnection(false);
PreparedStatement statement = con.prepareStatement("Select * From item_market Order By ownerId");
ResultSet rset = statement.executeQuery();
 
while (rset.next()) { 
int ownerId = rset.getInt("ownerId");
String ownerName = rset.getString("ownerName");
int itemObjId = rset.getInt("itemObjId");
int itemId = rset.getInt("itemId");
String itemName = rset.getString("itemName");
String itemType = rset.getString("itemType");
String l2Type = rset.getString("l2Type");
int itemGrade = rset.getInt("itemGrade");
int enchLvl = rset.getInt("enchLvl");
int count = rset.getInt("_count");
int price = rset.getInt("price");
 
L2ItemMarketModel mrktItem = new L2ItemMarketModel();
mrktItem.setOwnerId(ownerId);
mrktItem.setOwnerName(ownerName);
mrktItem.setItemObjId(itemObjId);
mrktItem.setItemId(itemId);
mrktItem.setItemName(itemName);
mrktItem.setItemType(itemType);
mrktItem.setL2Type(l2Type);
mrktItem.setItemGrade(itemGrade);
mrktItem.setEnchLvl(enchLvl);
mrktItem.setCount(count);
mrktItem.setPrice(price);
if (_marketItems.containsKey(ownerId)) {
List<L2ItemMarketModel> list = _marketItems.get(ownerId);
list.add(mrktItem);
_marketItems.put(ownerId, list);
} else {
List<L2ItemMarketModel> list = new FastList<L2ItemMarketModel>();
list.add(mrktItem);
_marketItems.put(ownerId, list);
}
mrktCount++;
}
 
_log.finest("ItemMarketTable: Loaded "+mrktCount+" market items.");
 
rset.close();
statement.close();
} catch (Exception e) {
_log.warning("Error while loading market items " + e.getMessage());
} finally {
try {
if (con != null) {
con.close();
}
} catch (Exception e) {
}
}
loadSellers();
loadIcons();
}
 
private void loadSellers() {
_sellers = new FastMap<Integer, Integer>();
Connection con = null;
try {
con = L2DatabaseFactory.getInstance().getConnection(false);
PreparedStatement statement = con.prepareStatement("Select * From market_seller");
ResultSet rset = statement.executeQuery();
 
while(rset.next()) {
int sellerId = rset.getInt("sellerId");
int money = rset.getInt("money");
_sellers.put(sellerId, money);
}
 
rset.close();
statement.close();
} catch(Exception e) {
_log.warning("Error while loading market sellers " + e.getMessage());
} finally {
try {
if (con != null) {
con.close();
}
} catch (Exception e) {
}
}
}
 
private void loadIcons() {
_itemIcons = new FastMap<Integer, String>();
Connection con = null;
try {
con = L2DatabaseFactory.getInstance().getConnection(false);
PreparedStatement statement = con.prepareStatement("Select * From market_icons");
ResultSet rset = statement.executeQuery();
 
while(rset.next()) {
int itemId = rset.getInt("itemId");
String itemIcon = rset.getString("itemIcon");
_itemIcons.put(itemId, itemIcon);
}
 
rset.close();
statement.close();
} catch(Exception e) {
_log.warning("Error while loading market icons " + e.getMessage());
} finally {
try {
if (con != null) {
con.close();
}
} catch (Exception e) {
}
}
}
 
public void addItemToMarket(L2ItemMarketModel itemToMarket, L2PcInstance owner) {
synchronized(this) {
if (_marketItems != null && owner != null && itemToMarket != null) {
List<L2ItemMarketModel> list = _marketItems.get(owner.getObjectId());
if (list != null) {
list.add(itemToMarket);
_marketItems.put(owner.getObjectId(), list);
} else {
list = new FastList<L2ItemMarketModel>();
list.add(itemToMarket);
_marketItems.put(owner.getObjectId(), list);
}
ThreadPoolManager.getInstance().scheduleGeneral(new SaveTask(itemToMarket), 2000);
}
}
}
 
public void removeItemFromMarket(int ownerId, int itemObjId, int count) {
L2ItemMarketModel mrktItem = getItem(itemObjId);
List<L2ItemMarketModel> list = getItemsByOwnerId(ownerId);
synchronized (this) {
if (list != null && mrktItem != null && !list.isEmpty()) {
if (mrktItem.getCount() == count) {
list.remove(mrktItem);
_marketItems.put(ownerId, list);
ThreadPoolManager.getInstance().scheduleGeneral(new DeleteTask(mrktItem), 2000);
} else {
list.remove(mrktItem);
mrktItem.setCount(mrktItem.getCount() - count);
list.add(mrktItem);
_marketItems.put(ownerId, list);
ThreadPoolManager.getInstance().scheduleGeneral(new UpdateTask(mrktItem), 2000);
}
}
}
}
 
public void addMoney(int sellerId, int money) {
synchronized(this) {
if (_sellers != null) {
if (_sellers.containsKey(sellerId)) {
int oldMoney = _sellers.get(sellerId);
money += oldMoney;
_sellers.put(sellerId, money);
ThreadPoolManager.getInstance().scheduleGeneral(new AddMoneyTask(sellerId, money), 2000);
} else {
_sellers.put(sellerId, money);
ThreadPoolManager.getInstance().scheduleGeneral(new AddSellerTask(sellerId, money), 2000);
}
}
}
}
 
public int getMoney(int sellerId) {
synchronized(this) {
if (_sellers != null && !_sellers.isEmpty()) {
if (_sellers.containsKey(sellerId)) {
return _sellers.get(sellerId);
} else {
return 0;
}
}
}
return 0;
}
 
public void takeMoney(int sellerId, int amount) {
synchronized(this) {
if (_sellers != null && !_sellers.isEmpty()) {
if (_sellers.containsKey(sellerId)) {
int oldMoney = _sellers.get(sellerId);
if (oldMoney >= amount) {
oldMoney -= amount;
_sellers.put(sellerId, oldMoney);
ThreadPoolManager.getInstance().scheduleGeneral(new AddMoneyTask(sellerId, oldMoney), 2000);
}
}
}
}
}
 
public List<L2ItemMarketModel> getItemsByOwnerId(int ownerId) {
synchronized(this) {
if (_marketItems != null && !_marketItems.isEmpty()) {
return _marketItems.get(ownerId);
}
}
return null;
}
 
public L2ItemMarketModel getItem(int itemObjId) {
List<L2ItemMarketModel> list = getAllItems();
synchronized (this) {
for (L2ItemMarketModel model : list) {
if (model.getItemObjId() == itemObjId) {
return model;
}
}
}
return null;
}
 
public List<L2ItemMarketModel> getAllItems() {
synchronized(this) {
if (_marketItems != null && !_marketItems.isEmpty()) {
List<L2ItemMarketModel> list = new FastList<L2ItemMarketModel>();
for (List<L2ItemMarketModel> lst : _marketItems.values()) {
if (lst != null && !lst.isEmpty()) {
for (L2ItemMarketModel auctItem : lst) {
if (auctItem != null) {
list.add(auctItem);
}
}
}
}
return list;
}
}
return null;
}
 
public String getItemIcon(int itemId) {
if (_itemIcons != null && !_itemIcons.isEmpty()) {
return _itemIcons.get(itemId);
}
return null;
}
 
private static class SaveTask implements Runnable {
 
private final L2ItemMarketModel _marketItem;
// private final static Log _log = LogFactory.getLog(SaveTask.class.getName());
 
public SaveTask(L2ItemMarketModel marketItem) {
this._marketItem = marketItem;
}
 
public void run() {
Connection con = null;
try {
con = L2DatabaseFactory.getInstance().getConnection(false);
PreparedStatement statement = con.prepareStatement("Insert Into item_market Values (?,?,?,?,?,?,?,?,?,?,?)");
statement.setInt(1, _marketItem.getOwnerId());
statement.setString(2, _marketItem.getOwnerName());
statement.setString(3, _marketItem.getItemName());
statement.setInt(4, _marketItem.getEnchLvl());
statement.setInt(5, _marketItem.getItemGrade());
statement.setString(6, _marketItem.getL2Type());
statement.setString(7, _marketItem.getItemType());
statement.setInt(8, _marketItem.getItemId());
statement.setInt(9, _marketItem.getItemObjId());
statement.setInt(10, _marketItem.getCount());
statement.setInt(11, _marketItem.getPrice());
statement.execute();
statement.close();
} catch (Exception e) {
_log.warning("Error while saving market item into DB " + e.getMessage());
} finally {
try {
if (con != null) {
con.close();
}
} catch (Exception e) {
}
}
}
}
 
private static class DeleteTask implements Runnable {
 
private final L2ItemMarketModel _marketItem;
// private final static Log _log = LogFactory.getLog(DeleteTask.class.getName());
 
public DeleteTask(L2ItemMarketModel marketItem) {
this._marketItem = marketItem;
}
 
public void run() {
Connection con = null;
try {
con = L2DatabaseFactory.getInstance().getConnection(false);
PreparedStatement statement = con.prepareStatement("Delete From item_market Where ownerId = ? AND itemObjId = ?");
statement.setInt(1, _marketItem.getOwnerId());
statement.setInt(2, _marketItem.getItemObjId());
statement.execute();
statement.close();
} catch (Exception e) {
_log.warning("Error while deleting market item from DB " + e.getMessage());
} finally {
try {
if (con != null) {
con.close();
}
} catch (Exception e) {
}
}
}
}
 
private static class UpdateTask implements Runnable {
private final L2ItemMarketModel _marketItem;
// private final static Log _log = LogFactory.getLog(UpdateTask.class.getName());
 
public UpdateTask(L2ItemMarketModel marketItem) {
this._marketItem = marketItem;
}
 
public void run() {
Connection con = null;
try {
con = L2DatabaseFactory.getInstance().getConnection(false);
PreparedStatement statement = con.prepareStatement("Update item_market Set _count = ? Where itemObjId = ? AND ownerId = ?");
statement.setInt(1, _marketItem.getCount());
statement.setInt(2, _marketItem.getItemObjId());
statement.setInt(3, _marketItem.getOwnerId());
statement.executeUpdate();
statement.close();
} catch (Exception e) {
_log.warning("Error while updating market item in DB " + e.getMessage());
} finally {
try {
if (con != null) {
con.close();
}
} catch (Exception e) {
}
}
}
}
 
private static class AddMoneyTask implements Runnable {
private final int sellerId;
private final int money;
 
public AddMoneyTask(int sellerId, int money) {
this.sellerId = sellerId;
this.money = money;
}
 
public void run() {
Connection con = null;
try {
con = L2DatabaseFactory.getInstance().getConnection(false);
PreparedStatement statement = con.prepareStatement("Update market_seller Set money = ? Where sellerId = ?");
statement.setInt(1, money);
statement.setInt(2, sellerId);
statement.executeUpdate();
statement.close();
} catch (Exception e) {
_log.warning("Error while adding money in DB " + e.getMessage());
} finally {
try {
if (con != null) {
con.close();
}
} catch (Exception e) {
}
}
}
}
 
private static class AddSellerTask implements Runnable {
private final int sellerId;
private final int money;
 
public AddSellerTask(int sellerId, int money) {
this.sellerId = sellerId;
this.money = money;
}
 
public void run() {
Connection con = null;
try {
con = L2DatabaseFactory.getInstance().getConnection(false);
PreparedStatement statement = con.prepareStatement("Insert Into market_seller(sellerId, money) Values (?,?)");
statement.setInt(1, sellerId);
statement.setInt(2, money);
statement.executeUpdate();
statement.close();
} catch (Exception e) {
_log.warning("Error while adding seller in DB " + e.getMessage());
} finally {
try {
if (con != null) {
con.close();
}
} catch (Exception e) {
}
}
}
}
}
Add L2ItemMarketerInstance the settlement:
com.l2jfrozen.gameserver.model.actor.instance:
 
 
/*
 * 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.l2jfrozen.gameserver.model.actor.instance;
 
import java.util.List;
import java.util.StringTokenizer;
 
import javolution.text.TextBuilder;
import javolution.util.FastList;
 
import com.l2jfrozen.gameserver.ai.CtrlIntention;
import com.l2jfrozen.gameserver.datatables.sql.ItemMarketTable;
import com.l2jfrozen.gameserver.datatables.sql.ItemTable;
import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
import com.l2jfrozen.gameserver.model.L2ItemMarketModel;
import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;
import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed;
import com.l2jfrozen.gameserver.network.serverpackets.MyTargetSelected;
import com.l2jfrozen.gameserver.network.serverpackets.ValidateLocation;
import com.l2jfrozen.gameserver.templates.L2NpcTemplate;
import com.l2jfrozen.gameserver.templates.L2EtcItemType;
import com.l2jfrozen.gameserver.templates.L2WeaponType;
import com.l2jfrozen.gameserver.util.Util;
 
public class L2ItemMarketerInstance extends L2FolkInstance {
 
private final int ITEMS_PER_PAGE = 4;
 
//Pack Method : pack (L2_Type << 3) | Grade
//Item L2 Type
private final int ALL = 0x00;
private final int WEAPON = 0x01;
private final int ARMOR = 0x02;
private final int RECIPE  = 0x03;
private final int SHOTS  = 0x04;
private final int BOOK  = 0x05;
private final int OTHER  = 0x06;
private final int MATERIAL = 0x07;
 
//Item Grade
private final int NO_G  = 0x00;
    private final int D_G  = 0x01;
private final int C_G  = 0x02;
private final int B_G  = 0x03;
private final int A_G  = 0x04;
private final int S_G  = 0x05;
private final int S80_G = 0x06;
private final int ALL_G = 0x07;
 
public L2ItemMarketerInstance(int objectId, L2NpcTemplate template) {
        super(objectId, template);
    }
 
@Override
public void onAction(L2PcInstance player) {
if (!canTarget(player)) {
return;
}
// Check if the L2PcInstance already target the L2NpcInstance
if (this != player.getTarget()) {
// Set the target of the L2PcInstance player
player.setTarget(this);
 
// Send a Server->Client packet MyTargetSelected to the L2PcInstance player
MyTargetSelected my = new MyTargetSelected(getObjectId(), 0);
player.sendPacket(my);
 
// Send a Server->Client packet ValidateLocation to correct the L2NpcInstance position and heading on the client
player.sendPacket(new ValidateLocation(this));
} else {
// Calculate the distance between the L2PcInstance and the L2NpcInstance
if (!canInteract(player)) {
// Notify the L2PcInstance AI with AI_INTENTION_INTERACT
player.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, this);
} else {
showMsgWindow(player);
}
}
// Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet
player.sendPacket(ActionFailed.STATIC_PACKET);
}
 
@Override
    public void onBypassFeedback(L2PcInstance player, String command) {
List<L2ItemMarketModel> list = null;
        StringTokenizer st = new StringTokenizer(command, " ");
        String actualCommand = st.nextToken();
if ("Private".equalsIgnoreCase(actualCommand)) {
list = getItemList(player);
int pId = 0;
if (st.hasMoreTokens()) {
pId = new Integer(st.nextToken());
}
showPrivateItemList(list, pId, player);
} else if ("See".equalsIgnoreCase(actualCommand)) {
if (st.hasMoreTokens()) {
int bitmask = new Integer(st.nextToken());
int pgId = 0;
if (st.hasMoreTokens()) {
pgId = new Integer(st.nextToken());
}
list = ItemMarketTable.getInstance().getAllItems();
if (list != null) {
list = filterItemType(bitmask, list);
showItemList(list, pgId, player, bitmask);
} else {
sendMsg("There are no items for you", player);
return;
}
}
} else if ("BuyItem".equalsIgnoreCase(actualCommand)) {
if (st.hasMoreTokens()) {
int itemObjId = Integer.parseInt(st.nextToken());
if (st.hasMoreTokens()) {
int count = new Integer(st.nextToken());
buyItem(player, itemObjId, count);
}
}
} else if ("AddItem".equalsIgnoreCase(actualCommand)) {
if (st.hasMoreTokens()) {
int itemObjId = new Integer(st.nextToken());
if (st.hasMoreTokens()) {
int count = new Integer(st.nextToken());
if (st.hasMoreTokens()) {
int price = new Integer(st.nextToken());
if (price <=0) {
sendMsg("You can't sell an item for 0 or negative number.", player);
return;
}
L2ItemInstance item = player.getInventory().getItemByObjectId(itemObjId);
list = getItemList(player);
if (canAddItem(item, count, list, player)) {
player.destroyItem("Market Add", item.getObjectId(), count, null, true);
addItem(player, item, count, price);
} else {
sendMsg("Unable to add item or incorret item count.", player);
}
}
}
}
} else if ("ListInv".equalsIgnoreCase(actualCommand)) {
int pageId = 0;
if (st.hasMoreTokens()) {
pageId = new Integer(st.nextToken());
}
showInvList(player, pageId);
} else if ("ItemInfo".equalsIgnoreCase(actualCommand)) {
if (st.hasMoreTokens()) {
int pgId = new Integer(st.nextToken());
if (st.hasMoreTokens()) {
int bitmask = new Integer(st.nextToken());
if (st.hasMoreTokens()) {
int itemObjId = new Integer(st.nextToken());
L2ItemMarketModel mrktItem = ItemMarketTable.getInstance().getItem(itemObjId);
if (mrktItem != null) {
showItemInfo(mrktItem, bitmask, pgId, player);
}
}
}
}
} else if ("Main".equalsIgnoreCase(actualCommand)) {
showMsgWindow(player);
} else if ("SelectItem".equalsIgnoreCase(actualCommand)) {
if (st.hasMoreTokens()) {
int itemObjId = new Integer(st.nextToken());
player.sendPacket(ActionFailed.STATIC_PACKET);
String filename = "data/html/marketer/addItem.htm";
NpcHtmlMessage html = new NpcHtmlMessage(1);
html.setFile(filename);
html.replace("%objectId%", String.valueOf(getObjectId()));
L2ItemInstance item = player.getInventory().getItemByObjectId(itemObjId);
html.replace("%aval%", ""+item.getCount());
html.replace("%itemObjId%", String.valueOf(itemObjId));
player.sendPacket(html);
}
} else if ("ItemInfo2".equalsIgnoreCase(actualCommand)) {
if (st.hasMoreTokens()) {
int pgId = new Integer(st.nextToken());
if (st.hasMoreTokens()) {
int itemObjId = new Integer(st.nextToken());
L2ItemMarketModel mrktItem = ItemMarketTable.getInstance().getItem(itemObjId);
if (mrktItem != null) {
showItemInfo2(mrktItem, pgId, player);
}
}
}
} else if ("TakeItem".equalsIgnoreCase(actualCommand)) {
if (st.hasMoreTokens()) {
int itemObjId = new Integer(st.nextToken());
L2ItemMarketModel mrktItem = ItemMarketTable.getInstance().getItem(itemObjId);
if (mrktItem != null && player.getObjectId() == mrktItem.getOwnerId()) {
ItemMarketTable.getInstance().removeItemFromMarket(mrktItem.getOwnerId(), mrktItem.getItemObjId(), mrktItem.getCount());
L2ItemInstance item = ItemTable.getInstance().createItem("Market Remove", mrktItem.getItemId(), mrktItem.getCount(), player);
item.setEnchantLevel(mrktItem.getEnchLvl());
player.getInventory().addItem("Market Buy", item, player, null);
sendMsg(mrktItem.getItemName()+" removed succesfully.", player);
}
}
} else if ("SeeCash".equalsIgnoreCase(actualCommand)) {
player.sendPacket(ActionFailed.STATIC_PACKET);
String filename = "data/html/marketer/cash.htm";
NpcHtmlMessage html = new NpcHtmlMessage(1);
html.setFile(filename);
html.replace("%objectId%", String.valueOf(getObjectId()));
int money = ItemMarketTable.getInstance().getMoney(player.getObjectId());
html.replace("%money%", Util.formatAdena(money));
player.sendPacket(html);
} else if ("Cash".equalsIgnoreCase(actualCommand)) {
int amount = ItemMarketTable.getInstance().getMoney(player.getObjectId());
ItemMarketTable.getInstance().takeMoney(player.getObjectId(), amount);
player.getInventory().addAdena("Market Cash", amount, player, null);
sendMsg("You've earned "+Util.formatAdena(amount)+" Gold Bar", player);
} else if ("ComfirmAdd".equalsIgnoreCase(actualCommand)) {
if (st.hasMoreTokens()) {
int itemObjId = new Integer(st.nextToken());
L2ItemInstance item = player.getInventory().getItemByObjectId(itemObjId);
if (item == null) {
return;
}
 
if (st.hasMoreTokens()) {
int count = new Integer(st.nextToken());
if (count <= 0 || item.getCount() < count) {
sendMsg("Item count must be a valid value.", player);
return;
}
if (st.hasMoreTokens()) {
int price = new Integer(st.nextToken());
if (price <= 0) {
sendMsg("Price must be a valid value.", player);
return;
}
player.sendPacket(ActionFailed.STATIC_PACKET);
String filename = "data/html/marketer/comfirm.htm";
NpcHtmlMessage html = new NpcHtmlMessage(1);
html.setFile(filename);
html.replace("%objectId%", String.valueOf(getObjectId()));
html.replace("%count%", ""+count);
html.replace("%itemName%", item.getName()+" +"+item.getEnchantLevel());
html.replace("%itemIcon%", getItemIcon(item.getItemId()));
html.replace("%price%", Util.formatAdena(price));
html.replace("%iprice%", Util.formatAdena(price));
html.replace("%itemObjId%", ""+itemObjId);
player.sendPacket(html);
}
}
}
}
super.onBypassFeedback(player, command);
    }
 
private void showMsgWindow(L2PcInstance player) {
player.sendPacket(ActionFailed.STATIC_PACKET);
String filename = "data/html/marketer/main.htm";
NpcHtmlMessage html = new NpcHtmlMessage(1);
html.setFile(filename);
html.replace("%objectId%", String.valueOf(getObjectId()));
player.sendPacket(html);
}
 
private void addItem(L2PcInstance player, L2ItemInstance item, int count, int price) {
L2ItemMarketModel itemModel = new L2ItemMarketModel();
itemModel.setOwnerId(player.getObjectId());
itemModel.setOwnerName(player.getName());
itemModel.setItemObjId(item.getObjectId());
itemModel.setItemId(item.getItemId());
itemModel.setPrice(price);
itemModel.setCount(count);
itemModel.setItemType(item.getItem().getItemType().toString());
itemModel.setEnchLvl(item.getEnchantLevel());
if (itemModel.getEnchLvl() > 0) {
itemModel.setItemName(item.getItemName()+" +"+itemModel.getEnchLvl());
} else {
itemModel.setItemName(item.getItemName());
}
itemModel.setItemGrade(item.getItem().getCrystalType());
if (item.isEquipable()) {
if (item.getItemType() == L2WeaponType.NONE) {
itemModel.setL2Type("Armor");
} else {
itemModel.setL2Type("Weapon");
}
 
} else if (item.isEquipable()) {
itemModel.setL2Type("Armor");
} else {
if (item.getItemType() == L2EtcItemType.MATERIAL) {
itemModel.setL2Type("Material");
} else if (item.getItemType() == L2EtcItemType.RECEIPE) {
itemModel.setL2Type("Recipe");
} else if (item.getItemType() == L2EtcItemType.SPELLBOOK) {
itemModel.setL2Type("Spellbook");
} else if (item.getItemType() == L2EtcItemType.SHOT) {
itemModel.setL2Type("Shot");
} else {
itemModel.setL2Type("Other");
}
}
ItemMarketTable.getInstance().addItemToMarket(itemModel, player);
sendMsg("You added "+count+" <font color=\"LEVEL\">"+item.getItemName()+"</font>.", player);
}
 
private boolean canAddItem(L2ItemInstance item, int count, List<L2ItemMarketModel> list, L2PcInstance activeChar) {
if (activeChar != null && activeChar.getActiveTradeList() != null) {
return false;
}
if (activeChar != null && activeChar.isProcessingTransaction()) {
return false;
}
if (list != null && !list.isEmpty()) {
for (L2ItemMarketModel model : list) {
if (model != null) {
if (model.getItemId() == item.getItemId()) {
return false;
}
}
}
}
 
return (item.getItemType() != L2EtcItemType.HERB && item.getCount() >= count && item.getItem().getDuration() == -1 && item.getItemId() != 3470 && item.isTradeable() && !item.isEquipped() && !item.isAugmented());
}
 
private boolean canAddItem(L2ItemInstance item) {
return canAddItem(item, 0, null, null);
}
 
private String getItemIcon(int itemId) {
return "Icon." + ItemMarketTable.getInstance().getItemIcon(itemId);
}
 
private List<L2ItemMarketModel> getItemList(L2PcInstance player) {
return ItemMarketTable.getInstance().getItemsByOwnerId(player.getObjectId());
}
 
private void buyItem(L2PcInstance player, int itemObjId, int count) {
     L2ItemMarketModel mrktItem = ItemMarketTable.getInstance().getItem(itemObjId);
     if (mrktItem != null && mrktItem.getCount() >= count && (count > 0)) { 
L2ItemInstance adena = player.getInventory().getItemByItemId(3470);
if (adena.getCount() >= (mrktItem.getPrice() * count)) {
int itemId  = mrktItem.getItemId();
int price = mrktItem.getPrice() * count;
ItemMarketTable.getInstance().removeItemFromMarket(mrktItem.getOwnerId(), mrktItem.getItemObjId(), count);
player.destroyItem("Market Buy", adena.getObjectId(), price, null, true);
ItemMarketTable.getInstance().addMoney(mrktItem.getOwnerId(), price);
L2ItemInstance item = ItemTable.getInstance().createItem("Market Buy", itemId, count, player);
item.setEnchantLevel(mrktItem.getEnchLvl());
player.getInventory().addItem("Market Buy", item, player, null);
sendMsg("You bought "+count+" <font color=\"LEVEL\">"+mrktItem.getItemName()+"</font>.", player);
return;
}
sendMsg("You don't have enought Gold Bars.", player);
return;
}
sendMsg("Incorrect item count.", player);
}
 
private List<L2ItemMarketModel> filterItemType(int mask, List<L2ItemMarketModel> list) {
List<L2ItemMarketModel> mrktList = new FastList<L2ItemMarketModel>();
int itype = mask >> 3;
switch(itype) {
case ALL:
return filterItemGrade(mask, list);
case WEAPON:
for (L2ItemMarketModel model : list) {
if (model != null) {
if (model.getL2Type().equalsIgnoreCase("Weapon")) {
mrktList.add(model);
}
}
}
return filterItemGrade(mask, mrktList);
case ARMOR:
for (L2ItemMarketModel model : list) {
if (model != null) {
if (model.getL2Type().equalsIgnoreCase("Armor")) {
mrktList.add(model);
}
}
}
return filterItemGrade(mask, mrktList);
case RECIPE:
for (L2ItemMarketModel model : list) {
if (model != null) {
if (model.getL2Type().equalsIgnoreCase("Recipe")) {
mrktList.add(model);
}
}
}
return mrktList;
case BOOK:
for (L2ItemMarketModel model : list) {
if (model != null) {
if (model.getL2Type().equalsIgnoreCase("Spellbook")) {
mrktList.add(model);
}
}
}
return mrktList;
case SHOTS:
for (L2ItemMarketModel model : list) {
if (model != null) {
if (model.getL2Type().equalsIgnoreCase("Shot")) {
mrktList.add(model);
}
}
}
return filterItemGrade(mask, mrktList);
case OTHER:
for (L2ItemMarketModel model : list) {
if (model != null) {
if (model.getL2Type().equalsIgnoreCase("Other")) {
mrktList.add(model);
}
}
}
return filterItemGrade(mask, mrktList);
case MATERIAL:
for (L2ItemMarketModel model : list) {
if (model != null) {
if (model.getL2Type().equalsIgnoreCase("Material")) {
mrktList.add(model);
}
}
}
return mrktList;
}
 
return filterItemGrade(mask, list);
}
 
private List<L2ItemMarketModel> filterItemGrade(int mask, List<L2ItemMarketModel> list) {
List<L2ItemMarketModel> mrktList = new FastList<L2ItemMarketModel>();
int igrade = mask & 7;
switch(igrade) {
case ALL_G:
return list;
case NO_G:
for (L2ItemMarketModel model : list) {
if (model != null) {
if (model.getItemGrade() == NO_G) {
mrktList.add(model);
}
}
}
return mrktList;
case D_G:
for (L2ItemMarketModel model : list) {
if (model != null) {
if (model.getItemGrade() == D_G) {
mrktList.add(model);
}
}
}
return mrktList;
case C_G:
for (L2ItemMarketModel model : list) {
if (model != null) {
if (model.getItemGrade() == C_G) {
mrktList.add(model);
}
}
}
return mrktList;
case B_G:
for (L2ItemMarketModel model : list) {
if (model != null) {
if (model.getItemGrade() == B_G) {
mrktList.add(model);
}
}
}
return mrktList;
case A_G:
for (L2ItemMarketModel model : list) {
if (model != null) {
if (model.getItemGrade() == A_G) {
mrktList.add(model);
}
}
}
return mrktList;
case S_G:
for (L2ItemMarketModel model : list) {
if (model != null) {
if (model.getItemGrade() == S_G) {
mrktList.add(model);
}
}
}
return mrktList;
case S80_G:
for (L2ItemMarketModel model : list) {
if (model != null) {
if (model.getItemGrade() == S80_G) {
mrktList.add(model);
}
}
}
return mrktList;
}
return list;
}
 
private List<L2ItemInstance> filterInventory(L2ItemInstance[] inv) {
List<L2ItemInstance> filteredInventory = new FastList<L2ItemInstance>();
for(L2ItemInstance item : inv) {
if (canAddItem(item)) {
filteredInventory.add(item);
}
}
return filteredInventory;
}
 
private List<L2ItemMarketModel> filterList(List<L2ItemMarketModel> list, L2PcInstance player) {
List<L2ItemMarketModel> filteredList = new FastList<L2ItemMarketModel>();
if (!list.isEmpty()) {
for(L2ItemMarketModel model : list) {
if (model != null && model.getOwnerId() != player.getObjectId()) {
filteredList.add(model);
}
}
}
return filteredList;
}
 
private void showInvList(L2PcInstance player, int pageId) {
int itemsOnPage = ITEMS_PER_PAGE;
List<L2ItemInstance> list = filterInventory(player.getInventory().getItems());
int pages = list.size() / itemsOnPage;
if (list.isEmpty()) {
sendMsg("Your inventory is empty.", player);
return;
}
if (list.size() > pages * itemsOnPage) {
pages++;
}
if (pageId > pages) { 
pageId = pages;
}
int itemStart = pageId * itemsOnPage;
int itemEnd = list.size();
if (itemEnd - itemStart > itemsOnPage) {
itemEnd = itemStart + itemsOnPage;
}
NpcHtmlMessage npcReply = new NpcHtmlMessage(1);
TextBuilder reply = new TextBuilder("<html><body>");
reply.append("<center>Items in Inventory</center>");
reply.append("<img src=\"L2UI.SquareWhite\" width=270 height=1> <img src=\"L2UI.SquareBlank\" width=1 height=3>");
reply.append("<table width=270><tr>");
reply.append("<td width=66><button value=\"Back\" action=\"bypass -h npc_"+getObjectId()+((pageId==0)?"_Main ":"_ListInv ")+(pageId-1)+"\" width=66 height=16 back=\"L2UI.DefaultButton_click\" fore=\"L2UI.DefaultButton\"></td>");
reply.append("<td width=138></td>");
reply.append("<td width=66>"+((pageId+1<pages)?"<button value=\"Next\" action=\"bypass -h npc_"+getObjectId()+"_ListInv "+(pageId+1)+"\" width=66 height=16 back=\"L2UI.DefaultButton_click\" fore=\"L2UI.DefaultButton\">":"")+"</td>");
reply.append("</tr></table>");
reply.append("<br>");
for (int i = itemStart; i < itemEnd; i++) {
L2ItemInstance item = list.get(i);
if (item == null) {
continue;
}
 
String itemIcon = getItemIcon(item.getItemId());
reply.append("<br>");
reply.append("<table width=270><tr>");
reply.append("<td valign=top width=35><button value=\"\" action=\"bypass -h npc_"+getObjectId()+"_SelectItem "+item.getObjectId()+"\" width=32 height=32 back=\""+itemIcon +"\" fore=\""+itemIcon +"\"></td>");
reply.append("<td valign=top width=235>");
reply.append("<table border=0 width=100%>");
reply.append("<tr><td><font color=\"A2A0A2\">"+item.getItemName()+" +"+item.getEnchantLevel()+"</font></td></tr>");
reply.append("<tr><td><font color=\"A2A0A2\">Quantity:</font> <font color=\"B09878\">"+item.getCount()+"</font></td></tr></table></td>");
reply.append("</tr></table>");
reply.append("<br>");
}
reply.append("</body></html>");
npcReply.setHtml(reply.toString());
player.sendPacket(npcReply);
}
 
private void showItemList(List<L2ItemMarketModel> list, int pageId, L2PcInstance player, int mask) {
int itemsOnPage = ITEMS_PER_PAGE;
list = filterList(list, player);
if (list.isEmpty()) {
sendMsg("There are no items for you", player);
return;
}
int pages = list.size() / itemsOnPage;
if (list.size() > pages * itemsOnPage) {
pages++;
}
if (pageId > pages) { 
pageId = pages;
}
int itemStart = pageId * itemsOnPage;
int itemEnd = list.size();
if (itemEnd - itemStart > itemsOnPage) {
itemEnd = itemStart + itemsOnPage;
}
NpcHtmlMessage npcReply = new NpcHtmlMessage(1);
TextBuilder reply = new TextBuilder("<html><body>");
reply.append("<center>Market</center>");
reply.append("<img src=\"L2UI.SquareWhite\" width=270 height=1> <img src=\"L2UI.SquareBlank\" width=1 height=3>");
reply.append("<table width=270><tr>");
reply.append("<td width=66><button value=\"Back\" action=\"bypass -h npc_"+getObjectId()+((pageId==0)?"_Main ":"_See ")+mask+" "+(pageId-1)+"\" width=66 height=16 back=\"L2UI.DefaultButton_click\" fore=\"L2UI.DefaultButton\"></td>");
reply.append("<td width=138></td>");
reply.append("<td width=66>"+((pageId+1<pages)?"<button value=\"Next\" action=\"bypass -h npc_"+getObjectId()+"_See "+mask+" "+(pageId+1)+"\" width=66 height=16 back=\"L2UI.DefaultButton_click\" fore=\"L2UI.DefaultButton\">":"")+"</td>");
reply.append("</tr></table>");
reply.append("<br>");
 
for (int i = itemStart; i < itemEnd; i++) {
L2ItemMarketModel mrktItem = list.get(i);
if (mrktItem == null) {
continue;
}
 
if (mrktItem.getOwnerId() == player.getObjectId()) {
continue;
}
 
int _price = mrktItem.getPrice();
if (_price == 0) {
continue;
}
 
int _grade = mrktItem.getItemGrade();
String itemIcon = getItemIcon(mrktItem.getItemId());
reply.append("<br>");
reply.append("<table width=270><tr>");
reply.append("<td valign=top width=35><button value=\"\" action=\"bypass -h npc_"+getObjectId()+"_ItemInfo "+pageId+" "+mask+" "+mrktItem.getItemObjId()+"\" width=32 height=32 back=\""+itemIcon +"\" fore=\""+itemIcon +"\"></td>");
reply.append("<td valign=top width=235>");
reply.append("<table border=0 width=100%>");
reply.append("<tr><td><font color=\"A2A0A2\">"+mrktItem.getItemName()+"["+mrktItem.getCount()+"]"+"</font></td></tr>");
if ((mask & 7) == ALL_G) {
reply.append("<tr><td><font color=\"A2A0A2\">"+"Grade:"+getGrade(mrktItem.getItemGrade())+"</font></td></tr>");
}
reply.append("<tr><td><font color=\"A2A0A2\">Price:</font> <font color=\"B09878\">"+Util.formatAdena(mrktItem.getPrice())+"</font></td></tr></table></td>");
reply.append("</tr></table>");
reply.append("<br>");
}
 
reply.append("</body></html>");
npcReply.setHtml(reply.toString());
player.sendPacket(npcReply);
}
 
private void showItemInfo(L2ItemMarketModel mrktItem, int mask, int pageId, L2PcInstance player) {
NpcHtmlMessage npcReply = new NpcHtmlMessage(1);
TextBuilder reply = new TextBuilder("<html><body>");
reply.append("<center>Info</center>");
reply.append("<img src=\"L2UI.SquareWhite\" width=270 height=1> <img src=\"L2UI.SquareBlank\" width=1 height=3>");
reply.append("<table width=270><tr>");
reply.append("<td width=66><button value=\"Back\" action=\"bypass -h npc_"+getObjectId()+"_See "+mask+" "+pageId+"\" width=66 height=16 back=\"L2UI.DefaultButton_click\" fore=\"L2UI.DefaultButton\"></td>");
reply.append("<td width=138></td>");
reply.append("</tr></table>");
reply.append("<br>");
reply.append("<table width=270><tr>");
reply.append("<td valign=top width=35><img src="+getItemIcon(mrktItem.getItemId())+" width=32 height=32 align=left></td>");
reply.append("<td valign=top width=235>");
reply.append("<table border=0 width=100%>");
reply.append("<tr><td><font color=\"A2A0A2\">Name:</font> <font color=\"B09878\">"+mrktItem.getItemName()+"</font><font color=\"A2A0A2\">[<font color=\"B09878\">"+mrktItem.getCount()+"</font>]</td></tr>");
reply.append("<tr><td><font color=\"A2A0A2\">Price:</font> <font color=\"B09878\">"+Util.formatAdena(mrktItem.getPrice())+"</font><font color=\"A2A0A2\">     Seller:</font> <font color=\"B09878\">"+mrktItem.getOwnerName()+"</font></td></tr>");
reply.append("<tr><td><edit var=\"count\" width=110></td></tr>");
reply.append("<tr><td><button value=\"Buy\" action=\"bypass -h npc_"+getObjectId()+"_BuyItem "+mrktItem.getItemObjId()+" $count\" width=66 height=16 back=\"L2UI.DefaultButton_click\" fore=\"L2UI.DefaultButton\"></td></tr></table></td>");
reply.append("</tr></table>");
reply.append("</body></html>");
npcReply.setHtml(reply.toString());
player.sendPacket(npcReply);
}
 
private void showPrivateItemList(List<L2ItemMarketModel> list, int pageId, L2PcInstance player) {
int itemsOnPage = ITEMS_PER_PAGE;
if (list == null || list.isEmpty()) {
sendMsg("There are no items for you", player);
return;
}
int pages = list.size() / itemsOnPage;
if (list.size() > pages * itemsOnPage) {
pages++;
}
if (pageId > pages) { 
pageId = pages;
}
int itemStart = pageId * itemsOnPage;
int itemEnd = list.size();
if (itemEnd - itemStart > itemsOnPage) {
itemEnd = itemStart + itemsOnPage;
}
NpcHtmlMessage npcReply = new NpcHtmlMessage(1);
TextBuilder reply = new TextBuilder("<html><body>");
reply.append("<center>Private</center>");
reply.append("<img src=\"L2UI.SquareWhite\" width=270 height=1> <img src=\"L2UI.SquareBlank\" width=1 height=3>");
reply.append("<table width=270><tr>");
reply.append("<td width=66><button value=\"Back\" action=\"bypass -h npc_"+getObjectId()+((pageId==0)?"_Main ":"_Private ")+(pageId-1)+"\" width=66 height=16 back=\"L2UI.DefaultButton_click\" fore=\"L2UI.DefaultButton\"></td>");
reply.append("<td width=138></td>");
reply.append("<td width=66>"+((pageId+1<pages)?"<button value=\"Next\" action=\"bypass -h npc_"+getObjectId()+"_Private "+(pageId+1)+"\" width=66 height=16 back=\"L2UI.DefaultButton_click\" fore=\"L2UI.DefaultButton\">":"")+"</td>");
reply.append("</tr></table>");
reply.append("<br>");
 
for (int i = itemStart; i < itemEnd; i++) {
L2ItemMarketModel mrktItem = list.get(i);
if (mrktItem == null) {
continue;
}
 
int _price = mrktItem.getPrice();
if (_price == 0) {
continue;
}
 
String itemIcon = getItemIcon(mrktItem.getItemId());
reply.append("<br>");
reply.append("<table width=270><tr>");
reply.append("<td valign=top width=35><button value=\"\" action=\"bypass -h npc_"+getObjectId()+"_ItemInfo2 "+pageId+" "+mrktItem.getItemObjId()+"\" width=32 height=32 back=\""+itemIcon +"\" fore=\""+itemIcon +"\"></td>");
reply.append("<td valign=top width=235>");
reply.append("<table border=0 width=100%>");
reply.append("<tr><td><font color=\"A2A0A2\">"+mrktItem.getItemName()+"["+mrktItem.getCount()+"]"+"</font></td></tr>");
reply.append("<tr><td><font color=\"A2A0A2\">Price:</font> <font color=\"B09878\">"+Util.formatAdena(mrktItem.getPrice())+"</font></td></tr></table></td>");
reply.append("</tr></table>");
reply.append("<br>");
}
 
reply.append("</body></html>");
npcReply.setHtml(reply.toString());
player.sendPacket(npcReply);
}
 
private void sendMsg(String message, L2PcInstance player) {
player.sendPacket(ActionFailed.STATIC_PACKET);
NpcHtmlMessage npcReply = new NpcHtmlMessage(1);
TextBuilder reply = new TextBuilder("<html><body>");
reply.append(message);
reply.append("<br><a action=\"bypass -h npc_"+getObjectId()+"_Main\">Back</a>");
reply.append("</body></html>");
npcReply.setHtml(reply.toString());
player.sendPacket(npcReply);
}
 
private void showItemInfo2(L2ItemMarketModel mrktItem, int pageId, L2PcInstance player) {
NpcHtmlMessage npcReply = new NpcHtmlMessage(1);
TextBuilder reply = new TextBuilder("<html><body>");
reply.append("<center>Info</center>");
reply.append("<img src=\"L2UI.SquareWhite\" width=270 height=1> <img src=\"L2UI.SquareBlank\" width=1 height=3>");
reply.append("<table width=270><tr>");
reply.append("<td width=66><button value=\"Back\" action=\"bypass -h npc_"+getObjectId()+"_Private "+pageId+"\" width=66 height=16 back=\"L2UI.DefaultButton_click\" fore=\"L2UI.DefaultButton\"></td>");
reply.append("<td width=138></td>");
reply.append("</tr></table>");
reply.append("<br>");
reply.append("<table width=270><tr>");
reply.append("<td valign=top width=35><img src="+getItemIcon(mrktItem.getItemId())+" width=32 height=32 align=left></td>");
reply.append("<td valign=top width=235>");
reply.append("<table border=0 width=100%>");
reply.append("<tr><td><font color=\"A2A0A2\">Name:</font> <font color=\"B09878\">"+mrktItem.getItemName()+"</font><font color=\"A2A0A2\">[<font color=\"B09878\">"+mrktItem.getCount()+"</font>]</td></tr>");
reply.append("<tr><td><font color=\"A2A0A2\">Price:</font> <font color=\"B09878\">"+Util.formatAdena(mrktItem.getPrice())+"</font><font color=\"A2A0A2\"></td></tr>");
reply.append("<tr><td><button value=\"Remove\" action=\"bypass -h npc_"+getObjectId()+"_TakeItem "+mrktItem.getItemObjId()+"\" width=66 height=16 back=\"L2UI.DefaultButton_click\" fore=\"L2UI.DefaultButton\"></td></tr></table></td>");
reply.append("</tr></table>");
reply.append("</body></html>");
npcReply.setHtml(reply.toString());
player.sendPacket(npcReply);
}
 
private String getGrade(int grade) {
switch(grade) {
case D_G:
return "D Grade";
case C_G:
return "C Grade";
case B_G:
return "B Grade";
case A_G:
return "A Grade";
case S_G:
return "S Grade";
case S80_G:
return "S80 Grade";
default:
return "No Grade";
}
}
}
Add L2ItemMarketModel the settlement:
com.l2jfrozen.gameserver.model:
 
 
/*
 * 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.l2jfrozen.gameserver.model;
 
public class L2ItemMarketModel {
 
private int ownerId;
private int enchLvl;
private int itemId;
private int itemGrade;
private int itemObjId;
private int price;
private int count;
private String ownerName = null;
private String itemName = null;
private String itemType = null;
private String l2Type = null;
 
public void setOwnerId(int ownerId) {
this.ownerId = ownerId;
}
 
public void setOwnerName(String ownerName) {
this.ownerName = ownerName;
}
 
public void setItemId(int itemId) {
this.itemId = itemId;
}
 
public void setItemObjId(int itemObjId) {
this.itemObjId = itemObjId;
}
 
public void setItemName(String itemName) {
this.itemName = itemName;
}
 
public void setEnchLvl(int enchLvl) {
this.enchLvl = enchLvl;
}
 
public void setItemGrade(int itemGrade) {
this.itemGrade = itemGrade;
}
 
public void setItemType(String itemType) {
this.itemType = itemType;
}
 
public void setL2Type(String l2Type) {
this.l2Type = l2Type;
}
 
public void setPrice(int price) {
this.price = price;
}
 
public void setCount(int count) {
this.count = count;
}
 
public int getOwnerId() {
return ownerId;
}
 
public String getOwnerName() {
return ownerName;
}
 
public int getItemId() {
return itemId;
}
 
public int getItemObjId() {
return itemObjId;
}
 
public String getItemName() {
return itemName;
}
 
public int getEnchLvl() {
return enchLvl;
}
 
public int getItemGrade() {
return itemGrade;
}
 
public String getItemType() {
return itemType;
}
 
public String getL2Type() {
return l2Type;
}
 
public int getPrice() {
return price;
}
 
public int getCount() {
return count;
}
 
} 

Sql part:

 

http://www.mediafire.com/download/k57kshzbh2nxuk3/market.sql

 

 

let's not forget that when you create the npc with the type:

  ~ ~ L2ItemMarketer ok?
 
credits: U3 Games (. He was told by our friend the topics below thank have researched on it.)

 

Some pic:

 

 

 

 

http://www.mediafire.com/convkey/cc0e/vjt15wmdm88s8gozg.jpg?size_id=7

http://www.mediafire.com/convkey/6dab/s3sc6b314mjwimbzg.jpg?size_id=7

http://www.mediafire.com/convkey/06cd/6axbioj2lva74qrzg.jpg?size_id=7

http://www.mediafire.com/convkey/969c/nzntdetjtnmk6z1zg.jpg?size_id=7

Edited by Tachi
Posted (edited)

Very insteresting you can check out and this one http://www.4shared.com/rar/5T1hoBbD/Item_Market_frozen_edit__.html

 

Its pretty good give many options 

Search Weapons,armors,jewerls,etc,misc,accessories,grades,D,C,B,A,S,no grades

Allow player put item on sale,allow player to get the item from shop back when they want etc /// 

 

I paste this not to flame you must check it out and maybe new ideas will come up ..

 

BTW excelent code dude !! :)

 

PS.Here is the post on mxc click me

Edited by L2LostWard
Posted

Very insteresting you can check out and this one http://www.4shared.com/rar/5T1hoBbD/Item_Market_frozen_edit__.html

 

Its pretty good give many options 

Search Weapons,armors,jewerls,etc,misc,accessories,grades,D,C,B,A,S,no grades

Allow player put item on sale,allow player to get the item from shop back when they want etc /// 

 

I paste this not to flame you must check it out and maybe new ideas will come up ..

 

BTW excelent code dude !! :)

 

PS.Here is the post on mxc click me

ty man i know this mod' and i think is nice to be online in many server's

 

I think it's exciting that someone can change a weapon augmented for another augmented wepoan :)

Posted

Too much db connections, Java 6 writting style, and it would benefit from using CBoard.

 

The filter section can be shortcuted by 73784733 with correct use of Java 8 streams.

yes you're right, but I have given to share what I found and I thought it useful
 
people like you, who know Java can tell which variant is better :)
Posted

 

yes you're right, but I have given to share what I found and I thought it useful
 
people like you, who know Java can tell which variant is better :)

 

 

I don't blame you, or even code author, I simply point to possible optimizations. Do whatever you want from here.

Posted

I don't blame you, or even code author, I simply point to possible optimizations. Do whatever you want from here.

I know that I did not say that I've blamed myself but I shared what I found :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • L2JOne — Interlude C6 Level 86, S84 grade, clan level 11 — on an Interlude C6 core. 67 systems. Desktop Control Center. Edit the server while it runs. FULL SYSTEM CATALOGUE  ·  WEBSITE  ·  TELEGRAM Most Interlude packs give you a clean core and leave the interesting part to you. This one ships with the content already written — the economy systems, the event engine, the retention loop and the admin tooling a live server actually needs after week one. Everything is configurable from open files, and most of it is editable with the server running, from a Community Board panel or from the desktop Control Center. You should not need a new build to fix a broken skill or retune a drop rate on a Saturday night. QUICK FACTS Level cap 86, S80 and S84 grades, clan level 11 — High Five progression on an Interlude core 909 High Five items — Dynasty, Vesper and Icarus gear, Forgotten Scrolls, Dolls, Agathions 67 systems delivered ready — new, rebuilt, expanded or fixed 689 XML files — items, NPCs, skills, spawns, zones and every custom system, all open 343 quests implemented 147 GM commands, each with its own access level 95 database tables with install and versioned migration scripts 22 Community Board panels with open HTML 8 event modes that schedule themselves Java, JDK 22+, MariaDB / MySQL Desktop Control Center in English, Portuguese and Spanish HIGH FIVE CONTENT ON AN INTERLUDE CORE This is the part most Interlude packs do not have. The core is Interlude C6 — the chronicle your players know, with the combat and the pace they came for — but the progression ceiling is not the Interlude one. The end game was extended with High Five content, server side and client side. Level cap 86. The full experience table up to 86, with the rate brackets to match: five independent XP, SP and currency ranges covering 1-52, 52-61, 61-76, 76-78 and 78-86, so you shape the curve at the top instead of letting it flatten. S80 and S84 grades. Two grades above S, each with its own crystal, enchant bonus and gemstone cost — so the enchant and crystallization economy keeps working at the new ceiling instead of stopping at S. Clan level 11. Clan progression continues past the Interlude cap, with Blood Oath, Blood Alliance and Blood and Sand as the upgrade materials, and the clan skills that come with those levels. 909 High Five items. Dynasty, Vesper and Icarus weapons and armour with their augments and special abilities, 112 Forgotten Scrolls, Dolls and Agathions. High Five skill set. The skill ranges that come with the higher levels and the new gear are implemented, not stubbed — including the Doll and Agathion skills. Client tables included. The item name and grp tables for all of it ship with the pack, and the Control Center reads and repacks them. You are not left to reverse-engineer the client side of a Vesper set on your own. The practical effect: an Interlude server that does not run out of content at 80. Your players keep the chronicle they wanted and still have somewhere to go after the S set. DESKTOP CONTROL CENTER Start, restart and reload configuration Memory, GC, threads and CPU in real time Live log console and content search Database browser, scheduled backup, install and migration HWID bans and IP lookup Item editor with icon preview, plus multisell, NPC, class and config editors Item cloning, ID migration, item-pack import Reads and repacks the client itemgrp / npcgrp / skillgrp Automatic backup before every save Builds incremental updates, hash-verified per file WHAT IS INSIDE NEW = not in stock Interlude  ·  REBUILT = existed, rewritten from scratch  ·  EXPANDED = original kept, features added  ·  IMPROVED = original fixed and revised ECONOMY AND ITEMS — 11 systems Offline Shop — REBUILT. Keeps selling after the client closes, restores itself on restart, expires in a number of days you set. Own name colour and visual effect, no damage in peace zones, can be restricted to VIP only. Marketplace — NEW. Persistent market inside the Community Board. Listings stay up with the player offline, delivery is automatic, the listing fee is configurable, every sale logged. Enchant System — REBUILT. Rate per level and per scroll type in an open file. You choose what happens on failure: break, keep or drop one level. In-game editing panel, log of every attempt, automatic high-enchant announce. Custom currency — NEW. Any item as the private store currency: buy, sell and package sale, including the balance the client shows. Reward capsules — NEW. Boxes that draw items by weight, built in an open file. Event, donation and boss boxes with no code. Timed items and passes — NEW. Expire in real time, not play time, and keep counting offline. Noble, VIP, Kamaloka and auto farm passes ship ready. Equipment skins — NEW. Change the look of weapon and armour without touching a single stat. Accessory sets — NEW. The armour-set concept applied to rings, earrings and necklaces, with their own bonus. Deferred delivery — NEW. Items delivered at the player's next login, so donations, vote rewards and event prizes never get lost. Redeem coupons — NEW. GM generates a code, the player redeems it once. Campaigns, downtime compensation, streamer partnerships. Price and drop control — NEW. Single price across every merchant, all-free mode for test servers, gold bar conversion, drop block by grade on death. EVENTS AND PVP — 9 systems Event engine — NEW. Open-file catalogue: which events exist, when they open, how many players they need, what the prize is. Persistent ranking, level-balanced teams, rejoin after a disconnect. 8 event modes — NEW. Team vs Team, Deathmatch, Capture the Flag, Battle Royale with its own map, Hunting Grounds, Party, Spoil and Fight Boss. Each can run at a different time. Tournament — NEW. 1v1, 3v3, 5v5 and 9v9, solo and party registration. Per-format duration, run window, class composition limit and prize. Function zones — NEW. A whole PvP area from a single file: entry fee, auto-flag, anonymous mode, forbidden items and skills, temporary noblesse, restart lock, monster waves, a boss and automatic shutdown. Rotating siege — NEW. One castle drawn per cycle instead of nine independent schedules. The winner moves to the next castle an hour before the following siege, and no castle repeats until every other one has been fought over. Classic mode still available. Castle governor — NEW. The clan holding the active castle taxes merchants, board shop, gatekeepers and marketplace server-wide, and earns a drop, XP and skill bonus. Own vault and statue, wyvern rights for the leader. Every cap set by you. Olympiad — EXPANDED. Custom period and duration, battle limit, enchant cap in the arena, separate mage and fighter buffs, minimum PvP to enter, participant limit per IP, monthly winners. Event shop — NEW. Event currency buys prizes that exist nowhere else. Editable in-game. Anti-feed and dualbox control — NEW. XP and drop blocked on repeated same-IP kills, character limit per IP, whitelist per zone and instance, participant limit per IP with optional HWID check for events. PROGRESSION AND RETENTION — 13 systems VIP System — NEW. Tiers with their own XP/SP/drop rates, rewards and real-time duration. Benefits keep working in the offline shop, activation item configurable, status panel on the board. Daily missions — NEW. Objectives by action type, automatic scheduled reset, reward per mission, progress saved per character. Includes a daily login reward. Auto Farm — NEW. The player picks the skill list, monster priority and target type (mob, raid or grand boss), and can assist the summon or the party leader. Daily quota unlocked by a pass. You decide: everyone, VIP only, or off. Auto Potion (ACP) — NEW. Separate HP / MP / CP percentage triggers, configured in-game. Removes the incentive to run third-party software. Player-to-player buff selling — NEW. The human buffer gets its job back: advertise your own buffs, set the price, sell to whoever passes. Scheme Buffer — IMPROVED. Schemes saved per account, applied from the NPC and from the board, with a cost and skill list you control. AIO character — NEW. All-in-one character with its own buffs and saved macros, duration and type set by you. Level reward — NEW. Automatic prize on reaching each level, right where most new players give up. Rates per level bracket — NEW. Five independent brackets between 1 and 86 for XP, SP and currency, plus an exclusive rate inside instances. Subclass and skill stacking — EXPANDED. Configurable cap, switching anywhere, selective stacking across subclasses with a block list. Agathion — NEW. Companion pet that follows, talks and optionally heals by percentage. Restored at login. Pet and summon persistence — IMPROVED. Pet and servitor return after a reconnect with buffs and cooldown intact. A dropped connection stops costing ten minutes of rebuffing. Chat commands — NEW. A whole layer absent from stock Interlude: .menu .farm .acp .mission .vote .sell .register .instance .leader .crystal .recipe .aiomacro CONTENT AND WORLD — 8 systems Instanced territories — NEW. Private farm area per player or party, built from the map regions. Each region has its own monster list, respawn, entry policy and a trigger-released boss. No instance sees another, and the drop rate inside is exclusive. Spot fighting is over. Kamaloka — NEW. Instanced dungeon with its own scoring, a board ranking and an entry pass as an item. Simulated players — NEW. Server-controlled characters with combat, healing and potion AI, town walking routes and template clans. Visible in /who. A freshly opened server stops looking empty. Champion mobs — EXPANDED. Own HP, attack and speed, configurable aura, multiplied XP/SP/drop, exclusive drop list, optional guaranteed enchant. Boss info and reward — NEW. Schedule and status on the board, participation reward per raid, raid points to the clan, loot protection, grand boss death announce. Original Interlude content — IMPROVED. 343 quests, 9 castles with working sieges, 44 clan halls with auction and functions, Seven Signs, Festival of Darkness, manor, fishing. Grand boss AI revised — Antharas, Baium, Frintezza, Sailren. Polymorph — NEW. Visual transformation of players and NPCs from an open file. Seasonal events — NEW. Mammon Spawn and Master of Enchanting as calendar scripts. COMMUNITY BOARD — 22 panels Player panel — NEW. Board home with server info, rules, active promotions and a shortcut to every other panel. Server shop — NEW. A merchant inside the board, prices subject to the ruling clan's tax. Rankings — NEW. PvP, PK, level, clan raid points, Kamaloka score and event ranking — six lists updated live, with automatic weekly prizes. Donation panel — NEW. Balance, product and delivery on the character, integrated with the website system. Every delivery logged. Party matching — NEW. A party noticeboard by level, class and goal. Live information panels — NEW. Boss schedules, active events, open instances and territories, governor panel, channel videos with a watch reward, vote reward. All read from the real server state. Forum, mail and friends — IMPROVED. Internal forum, character mail, friend list, favourites and a personal memo. All panel HTML is open — change the visual identity with no recompile. ADMINISTRATION — 7 systems Operations panel — NEW. The desktop Control Center described above. Visual content editors — NEW. Items with icon preview, plus multisell, NPC, class and configuration editors. Item cloning, ID migration, item pack import, automatic backup before every save. Client file editor — NEW. itemgrp / npcgrp / skillgrp read, edit and repack, with ID migration synchronized between server and client. Adding a custom item stops being a manual process across three tools. In-game editors — NEW. Balance, event engine, function zones, territories and system config edited from a board panel, applied without restart, automatic backup of every changed file. GM commands — EXPANDED. 147 commands with per-command access level: zone creation by vertices in-game, spawns saved to the database, NPC route editor with preview, event / balance / enchant panels, HWID management. Persistent configuration — NEW. What the GM changes from the panel is stored and reapplied at next boot. Update package — NEW. The build ships only what changed, hash-verified per file, ready to publish to your players. SECURITY AND PROMOTION — 6 systems Guard and HWID — NEW. Validation at startup, machine identification, window limit per machine, configurable grace mode, access log per account, ban and lookup by GM command. Discord logging — NEW. 28 channels: enchant, drop, pickup, trade, warehouse, multisell, donation, Olympiad results, grand boss deaths, player and GM logins, suspicious IP alerts, chat keyword filter. When a player complains about a missing item, the answer is in the channel. Vote reward — NEW. 8 top lists, individual reward, per-site cooldown, global vote goal with a collective prize. YouTube integration — NEW. Turns your player base into your channel audience. Full section below. Announcements and promotions — NEW. Rotating in-game announces, time-boxed promotions with a board panel. Build protection — NEW. Obfuscation plus optional class encryption with its own loader. YOUTUBE — TURN YOUR PLAYERS INTO YOUR CHANNEL AUDIENCE Most packs call "YouTube integration" a button that opens a link. This one is a closed loop between your channel and the game, and the player never leaves the client. 1. Your channel, inside the game. The server queries the YouTube Data API and rewrites its own video list — title, description and publish date. You never maintain a list by hand: publish on YouTube and the panel updates itself. Players search it and pick what to watch. 2. The video plays inside the client. No alt-tab, no browser, nobody logs out to watch. The server reads the real duration of that video from YouTube and sets the timer to that exact length — the message on screen says how long is left. The player is held away for the duration, so watching is watching, not a tab left open in the background. 3. Watch time, not clicks. This is the part that matters for a channel. A click that bounces after three seconds does nothing for you. What reaches your channel here is a completed view, because the reward only exists if the video runs to the end. 4. The reward lands automatically. Items go straight to the character with an on-screen confirmation and a chat line naming the video. The reward items are yours to configure. Every upload reaches everyone online. A new video triggers an in-game announcement with a message you write. No ad spend, no posting the link in five Discords and hoping. It becomes a habit, not a one-off spike. The daily cap resets every day, so the same players come back tomorrow. Your back catalogue keeps earning views months after publication. Abuse controls built in. One reward per video per day, a configurable daily cap across all videos, one video in progress at a time, everything stored per character in the database — relogging resets nothing. Configurable: API key, channel, how many videos to pull, whether to announce, the announcement text, the reward items and the daily reward cap. A server with 300 players online is 300 completed views on every upload. That is the difference between a channel nobody sees and a channel that grows with the server. COMBAT AND BALANCE — 6 systems Balance per class — NEW. Damage dealt and taken per class, split by attack type, edited from the board, applied without restart, automatic backup so you can roll back. Balance per skill — NEW. Power, duration and behaviour per class, without touching the original skill XML. The broken skill of the month is fixed on the spot, not in the next release. Combat caps — NEW. Hard cap on attack and cast speed, no-cooldown skill list, skill duration overridden by ID, fixed cancel time, configurable expertise penalty. Extra effects and conditions — NEW. 9 effects from later chronicles ported to Interlude, 7 new skill conditions, weapon-swap skill, skill that teaches a skill, extra targets. Servitor share — NEW. The summoner passes a percentage of their stats to the servitor. Geoengine and movement — IMPROVED. Revised pathfinding with instance support. WHAT YOU GET The distribution, compiled and licensed for your project The complete datapack — 689 XML files and the Community Board HTML, open to edit Database scripts: install plus versioned migrations Desktop Control Center (EN / PT / ES) Continuous updates through the update system Direct support during setup Optional: the L2JOne Website System — player accounts, donations with automatic in-game delivery, admin dashboard, 4 payment methods, 4 languages. Sold separately, ask if you want both. HONEST NOTES Ships compiled and licensed per project. If you need full Java sources, ask up front — do not assume it is included. Guard/HWID and the build protection are real operational controls, not a promise of absolute protection. Anyone selling you "unhackable" is selling you a story. Two systems ship disabled and are still marked in-development in the config: Fake Farming and Timed Amulets. Everything else in this list is working. The game client itself is not distributed here. The item name and grp tables for the High Five content are included, and the Control Center edits itemgrp / npcgrp / skillgrp, but assembling and hosting the client is yours. CONTACT Full system catalogue: l2jone.com/fonte Website: l2jone.com Telegram: @Williams0ff E-mail: support@l2jone.com Pricing depends on the plan and on what you want bundled — message me and I will send the options. I am open to using the forum's middleman / escrow service. I have no reputation here yet, and I think asking for it is fair. Questions in the topic are welcome — I answer them here so the next person reading finds the answer too.    Scrolls Augments New Augment Acessories    
    • ⚡ Weekend special! Upgrade your personal Google account with 5TB storage and Gemini Pro in under 60 seconds.
    • Don't cry, it's a game. If it makes you cum on your monitor, of course, enjoy it. My business has been running for years and will continue to do so. No matter what happens here, the dogs bark, the caravan moves on. Start developing game engines - post them too - after all, I create them too) Salvation:Arena (MOBA) Unreal Engine RED-TEAM REVERSECODE Аліса займається розробкою ще з часів створення денді та сеги-діти які створюють шум для мене просто діти) За ці роки роботи я бачила багато різних людей у цій сфері все що я думаю про це не плачте та насолоджуйтесь життям слава ураїне - котись на свій бразильський форум)   If you'd simply asked me in a private message on the forum to be reinstated, you'd have been unblocked without a problem. I have no enemies—it's just business. I can make any product on the market, models and effects, copyrights—complex tools—at my age, people run large companies. I'm pleased that our beloved MXC* forum will now have a lot of free products. I earn a maximum of $200-$300 a year from this industry. If that excites you, well, have fun with us.       I moderate many gaming communities, here's one of them  if I hated you, you'd be out of here in a minute, brother  so don't get carried away with your wet dreams. On the topic of free work, start doing it yourself—the forum needs good free stuff. Someone will definitely like you here and throw a flower on your grave. Besides, you're forgetting that half the forum is involved in this interface development business and for many developers, it's a good income. So, you want to make life sweeter for them all, not just for me it's actually nice that you're such a noble young man.   Besides, I usually work from behind the scenes and don't move anywhere in the market but nothing stops me from doing what others do - working from the shadows  you won't even see that I'm doing it, it's so funny.   Start doing free work. You promised to do it well and post it to communities on time. Good luck! We'll have fun, that's great!🥰   завжди приємно поспілкуватися з веселими людьми              
    • Complete development packages for Lineage 2 UI development, across all chronicles and an automated tool to update and patch Interface.u & Interface.xdat What I Offer Clean Sources: 100% clean, retail-based interface source code with zero unwanted custom modifications. Interface.u Update Tool: A standalone tool designed to patch, rebuild, and update Interface.u efficiently. Custom Modifications: Custom UI features and tailoring can be implemented upon request. Turnaround Time: Most major versions and protocols are ready for immediate delivery; other versions take up to 1 week. How It Works Let me know the specific chronicle or protocol version you are targeting. I will provide the tool, which is HWID-bound to your machine, for your setup. Once satisfied with the results, we finalize the deal. Pricing & Notes Both products are priced separately based on the target protocol and requirements. Package deals are negotiable if purchasing both. DM for inquiries, demos, and pricing quotes.    
    • Well u need to change when sm1 press exit it keeps it in game..  
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..