Jump to content

Recommended Posts

Posted (edited)

Hello.

 

This is an auction shop I made some time ago for aCis.

 

How it works: Players can add items for sale at the auction shop at the price they want. Then, even if they are offline other players can buy the items and they will get the rewards(the price they put). Enchant of items stays, augmented items are not sellable.

There is a searching system(case sensitive) and a paging system.

 

I have NOT tested this code on a live server (only local testing), but I remember adding a shittone of checks to avoid any exploits. I recommend you test it out well before using it.

 

You need to make an npc with id 65529 and type L2AuctionManager.

 

Code: http://pastebin.com/QqY6LGWV

Update - Replace AuctionTable and L2AuctionManagerInstance with these:

AuctionTable (update: the bug mentioned in the replies fixed): http://pastebin.com/vVPhiXKY

L2AuctionManagerInstance: http://pastebin.com/h8LFuesV

 

Some pictures:

 

(Please excuse my html designs..)

 

2ikpbbm.jpgk9c9bk.jpgsdfx4l.jpg2qsb5ab.jpg

 

24n35s2.jpg2cmniwg.jpgrqwuq1.jpg

Edited by An4rchy
Posted (edited)

- You will end with instant ConcurrentException on multiplayer scenario. items list should be stored on a concurrenthashmap (avoid copyonwritearraylist, terrible performance).

- string concat in a for loop is the devil (while regular concat is transformed into StringBuilder, in a for loop it doesn't), use StringUtil.append and a StringBuilder.

- all your paging systems can be replaced for existing and cleaner scenarios, such as Bookmark and SchemeBuffer (using MathUtil.countPagesNumber).

- Use try-with-ressources statement (jdk 7) to avoid to bother with ressource close (eliminate an eventual miss and drop the finally block).

- HTM on htm side, to make code more readable/maintainable.

- There could have a bid system, if price is 0 (or you add a checking case).

- Adena should be formatted using StringUtil.formatNumber

- If an item is listed for a very long time, it should be moved back on player inventory (to avoid the list being longer and longer) - One week default.

- server should take a fee, both to set an item (avoid to flood the market with single soulshots) and once the item is sold (to recycle some adena, economy lesson).

- Some items shouldn't be able to be sold, or at least not with low amount (I think about soulshots, arrows) to limit the number of objects (idiots can easily make your server a burden spamming 1 soulshot selling, making the whole system lag if they find a way to automatize it)

- Writting "Cost:" and "Item:" is a waste of space.

Edited by Tryskell
Posted

- You will end with instant ConcurrentException on multiplayer scenario. items list should be stored on a concurrenthashmap (avoid copyonwritearraylist, terrible performance).

- string concat in a for loop is the devil (while regular concat is transformed into StringBuilder, in a for loop it doesn't), use StringUtil.append and a StringBuilder.

- all your paging systems can be replaced for existing and cleaner scenarios, such as Bookmark and SchemeBuffer (using MathUtil.countPagesNumber).

- Use try-with-ressources statement (jdk 7) to avoid to bother with ressource close (eliminate an eventual miss and drop the finally block).

- HTM on htm side, to make code more readable/maintainable.

- There could have a bid system, if price is 0 (or you add a checking case).

- Adena should be formatted using StringUtil.formatNumber

- If an item is listed for a very long time, it should be moved back on player inventory (to avoid the list being longer and longer)

- server should take a fee, both to set an item (avoid to flood the market) and once the item is sold (to recycle some adena, economy lesson)

- I thought about that to be honest when I was uploading this share, but it's been 2+ years since I made it. Gonna update it.

- I don't see what could go wrong with that to be honest..

- The paging system was added after the original npc was created(since I ended with critical errors on many items) so it's really messy and to be honest I can't be bothered to update it.

- I know, idk why I did it that way when I was making it to be honest. Gonna be on next update.

- I always prefer htmls on htm side but in this case most of the htm is generated server-side so it would be pointless having 5 lines of htm code in htm side when the htm is way longer.

- Extra feature, can't be bothered to add it.

- Gonna be on next update, thanks.

- Extra feature, can't be bothered to add it.

- Extra feature, can't be bothered to add it.

 

Thanks for the feedback.

Posted (edited)

Just wait the update. To be honest was looking for something like this tho :D
Had an auction system before but no idea where it vanished.

+1 for your recent shares.

Edited by big man bill
Posted

update

  • L2AuctionManagerInstance.java
        ArrayList<ItemInstance> temp = new ArrayList<>();
        for (ItemInstance item : player.getInventory().getItems())
        {
-           if (item.getItemId() != 57 && item.isTradable())
+           if (item.getItemId() != 57 && item.isTradable() && !item.isEquipped())
Posted

Yeah this bug was caused because I changed from a list to a map, I forgot to change items.remove(item); to items.remove(item.getAuctionId()); on removeItem() method.

 

Thanks for the report, fixed and topic updated.

  • 2 months later...
  • 2 weeks later...
Posted (edited)

Its interesting because this code works perfectly but when im trying it in game everything working exclude method "showAuction" do not show any items but in block "My Items" or "Add Items" its working normally any suggestion? THX :)

 

// edit

 

I only delete Icons because i dont have table in DB with items icon that cant be a problem I'm sure :)

Edited by TheMark147

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

    • L2GOLD LEGACY x45 THE ORIGINAL GOLD-STYLE EXPERIENCE Official L2OFF PTS • Chronicle C4 / Interlude • Long-Term Server GRAND OPENING 28 AUGUST 2026 WEBSITE SERVER INFO DOWNLOAD DISCORD OLD GOLD ORIGINAL THE LEGEND RETURNS L2Gold Legacy brings back the authentic Gold-style x45 experience on official L2OFF PTS files with custom systems, balanced progression, competitive PvP and a carefully protected long-term economy. NO WIPES — KEEP YOUR PROGRESS FOREVER SERVER INFORMATION SERVER CHARACTERISTICS EXP / SP x45 ADENA x1 DROP x1 SPOIL x1 RAID BOSS DROP x1 PLATFORM L2OFF PTS Custom Drop & Spoil rates can be checked directly in-game with SHIFT + CLICK on NPCs. GAMEPLAY MAIN FEATURES GAMEPLAY • Auto-learn Skills • Automatic Monster Loot • Shift + Click Droplist • Unlimited Offline Shop • 80 Inventory Slots • Weight Limit Disabled • Maximum 3 Clients per PC • Manual Raid / Epic Loot • Official L2OFF PTS Files PLAYER FRIENDLY • NPC Buffer • 27 Buff Slots • 2 Hour Buff Duration • Mana Potion restores 500 MP • No Mana Potion Cooldown • FREE 1st Profession • FREE 2nd Profession • 3rd Profession: 500,000 Adena • Solo & Party Friendly CLANS • Maximum 45 Clan Members • Maximum 2 Clans per Alliance • Clan Penalty: 1 Hour • Clan Skills for All Members • Castle Sieges • 9 Available Clan Halls PROGRESSION • Rebirth System • Noblesse Progression • Custom Tattoos • Daily Missions • Mining System • Custom Gold Equipment • S-Grade Weapons • Long-Term Economy RAID CONTENT RAID BOSSES & EPIC BOSSES Progressive boss loot, PvP-oriented encounters and controlled progression designed to protect the economy. BAIUM ANTHARAS VALAKAS EPIC BOSS SCHEDULE SERVER TIME — GMT+3 DAY BOSS TIME Monday Core 20:00 Monday Orfen 22:30 Tuesday Zaken 22:30 Wednesday Queen Ant 22:30 Thursday Antharas 22:30 Friday Baium 22:30 Saturday Valakas 22:30 Sunday Frintezza 22:30 CUSTOM EQUIPMENT S-GRADE & L2GOLD GEAR Custom weapons, shields and jewelry are an important part of L2Gold's long-term progression. Draconic Bow Guidance / Focus Angel Slayer Critical Damage / Haste Arcana Mace Acumen / Mana Up Heaven's Divider Haste / Health / Focus S-GRADE WEAPON PRICE 300 Fire Mantras + 1,000,000 Adena Available from Wilbrand, Mantra Manager at Giran Harbor. COMPETITIVE PVP OLYMPIAD CYCLE 7 DAYS WEAPON ENCHANT MAX +21 ARMOR ENCHANT MAX +8 Wednesday 21:00–22:00   •   Friday 21:00–22:00   •   Sunday 21:00–22:00 S-GRADE EQUIPMENT IS FORBIDDEN DAILY & WEEKEND CONTENT EVENTS CAPTURE THE FLAG 50 vs 50 competitive CTF battles. HIGH RATE EVENT Weekend farming and progression event. MINING EVENT Collect Minerals and earn special rewards. Death Match • Bandit Stronghold • TvT • Gold Arena 1v1–9v9 Korean Event • CTF • High Rate • Mining • Piggy • Squash • Discord Events TRANSPARENCY REAL-TIME SERVER STATISTICS Players can verify clans, characters, bosses, items, Olympiad, castles, Gold Weapons and the server economy. NO HIDDEN DROPS • NO SHADOW EDITS • FULL TRANSPARENCY L2GOLD LEGACY x45 • L2OFF PTS • NO WIPES 28 AUGUST 2026 The Original Gold-Style Experience Returns.   PLAY L2GOLD JOIN DISCORD   Website: https://l2gold.co Server Info: https://l2gold.co/server-info.php Discord: discord.com/invite/CBSqxqkhy2
    • Hello my wanna be designer....I see that u are still the same dumb kid u were before some years,takeing some brushes adding soem letters and call it design..Sad that u body might have grown up but ur wanna be brain is still the same shit.... No hard feelings,happens.   Cheers
    • New Release Video demo:   Platforms & recording Fermata is now available as an experimental Android preview for ARM64 devices running Android 13 or newer with Vulkan support. Players can import their own Interlude client from a ZIP or folder, configure their server, and play without modifying the source files. Android now has a dedicated mobile control profile with: A floating movement joystick Direct camera orbit and pinch zoom Camera-focused smart targeting A rotating shortcut selector A mobile HUD and compact window controls An optional Classic control profile Built-in video recording has also arrived on Windows and macOS. Press Shift+Alt+R, or Shift+Option+R on macOS, to open the recorder. Recordings support H.264 and HEVC, Native to 720p resolution, 30 or 60 FPS, configurable quality, game audio, and music. Recording continues across login, character selection, teleports, and window resizing. The recorder controls are excluded from the finished video, while the Fermata watermark is added directly to the MP4. Friends, chat & private stores The complete Interlude friends system is now implemented, including: Online and offline status Friend invitations Adding and removing friends Direct conversations Incoming-message notifications /friendlist Alt/Option+Y access The original blocking commands now work, including /block, /unblock, /blocklist, /allblock, and /allunblock. Private stores are now fully supported. Players can create sell, package-sale, and buy stores, configure their listings and message, receive abnormal-price warnings, and trade through another player's store. Active stores display their original-style sign and message above the seated character. Find Private Store is available from the Actions tab or through /findprivatestore. Entering part of a store message highlights matching store signs in green without contacting the server. Inventory & paperdoll The inventory has been completely remastered into a wider framed-doll layout with a ten-by-eight item grid and separate All, Weapon, Armor, Jewelry, Etc, and Quest tabs. The paperdoll now displays your complete live 3D character with equipped armor, weapons, enchant shells, and weapon enchant effects. Drag to rotate, use the wheel to zoom, and double-click to reset the view. Inventory improvements Holding Alt or Option over an equipment slot opens a quick-swap list containing every compatible item in your inventory. Items are ordered by enchantment, grade, and name, and can be equipped with one click. Dropping inventory items onto the ground has been restored. Drag an item outside the window and confirm the drop, with quantity selection for stackable items. Ground items now use their correct fall, landing, and sparkle effects. World, atmosphere & materials Volumetric fog volumes have been added. Authored banks of mist can drift with the wind, react to weather and time of day, and receive illumination from nearby lamps, torches, and other lights. Half and Full quality modes are available. Water has received a major presentation remaster. Lakes, rivers, wet ground, and puddles now mirror the sky and display a long HDR sun reflection at low angles. Half and Full reflection modes also mirror nearby terrain, trees, buildings, and shorelines. Off mode retains the sky reflection. A new light-particle system supports fireflies, embers, and drifting motes. The brightest particles become small moving light sources that illuminate the ground and nearby fog. Fog volumes and light-particle swarms can be placed through the Shift+Alt+L light editor. Lighting & material improvements Normal-map support has been added for authored stone, wood, terrain, buildings, and other world materials. Supported surfaces gain light-reactive relief, with controls for enabling the effect and adjusting its strength. Enhanced lighting now has smoother transitions, more accurate flame illumination, and additional remastered emissive surfaces across Giran and manor structures. Movement, characters & polish Corrected Strider and Wyvern rider placement, mounted animations, camera height, and nameplate positioning. Fixed Strider transparency and depth rendering so body parts no longer appear hollow or visible through themselves. NPCs now turn smoothly towards the local player when opening a conversation. Improved snowfall with denser flakes, wind-driven descent, varied flake sizes, and flakes that briefly settle before melting. Sounds produced by your own character remain at a stable volume regardless of camera distance. The O key once again starts typing in chat like every other unbound letter. Additional bug fixes and stability improvements. Documentation Fermata now has complete documentation covering installation, controls, settings, rendering, weather, interfaces, supported gameplay, server configuration, and troubleshooting. Documentation is available in English, Greek, Brazilian Portuguese, Russian, and Ukrainian at https://fermata.gg/docs.   Download from the launcher you have installed, or at https://fermata.gg/ if you don't have the launcher.    
  • 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..