Jump to content

Recommended Posts

Posted

You could, indeed, get this done simply by giving characters a passive skill and applying the bonuses depending on the character class, as Kelrzher said. But you're not really going to balance anything that way.

 

Lineage II always have had its very own meaning of balance.

well... at least it's something.. :P

Posted

Create a table, array or whatever container to hold the values you want to edit, and then simply call it.

 

Example Map<Integer, int[]> : first int would be clas id, and then the array holds the value. Eventually imbricated Maps if you want to put weapon types : Map<Integer, Map<WeaponType, int[]>>.

 

Your code is barely readable, and hard to maintain.

Posted

Create a table, array or whatever container to hold the values you want to edit, and then simply call it.

 

Example Map<Integer, int[]> : first int would be clas id, and then the array holds the value. Eventually imbricated Maps if you want to put weapon types : Map<Integer, Map<WeaponType, int[]>>.

 

Your code is barely readable, and hard to maintain.

Finally a real feedback.

Thank you for your answer but i think you are kinda wrong...

I can't hold 2 Map values with the same key, can I?

I mean... to do that i must put

Map.put("Class 96", Map2.get("SWORD",
{
     1.2,
     1.1,
     1.3
};)

and then

Map.put("Class 96", Map2.get("DUAL_SWORD",
{
     1.0,
     1.2,
     1.3
};)

Can i actually do that?

Posted (edited)

I did a similar approach for aCis schemes buffer : schemes are ordered by player and by scheme name. So you have first to retrieve player id, then scheme name and only at this moment you refer to scheme (which itself holds a list of buffs)

 

You, you want to retrieve player classid, then retrieve weapon type, then only you refer to array of values.

 

From what I understand, it fits.

 

https://xp-dev.com/svn/aCis_community/aCis_gameserver/java/net/sf/l2j/gameserver/datatables/BufferTable.java

 

See _schemesTable implementation.

 

PS : you are right, you can't put twice the same key, otherwise it replaces. So you have to feed entirely map2, then only when map2 is fed you place on correct classid. Then you clear() map2, refeed it with correct info, and put it on another classid. Do the same for all classes.

 

Your Map would probably be Map<Integer, HashMap<L2WeaponType, List<Integer>>>. If you dont like List, use regular int array (maybe easier to refer to it : index[0] for heavy, index[1] for light and index[2] for robe).

 

AVOID STRINGS. It's fat to stock and you will have extra operations to retrieve infos.

 

You can also decide to hold info on xml or properties file, and feed the Map that way. A //reload config and the whole crap could be reloaded.

Edited by Tryskell
Posted (edited)

I did a similar approach for aCis schemes buffer : schemes are ordered by player and by scheme name. So you have first to retrieve player id, then scheme name and only at this moment you refer to scheme (which itself holds a list of buffs)

 

You, you want to retrieve player classid, then retrieve weapon type, then only you refer to array of values.

 

From what I understand, it fits.

 

https://xp-dev.com/svn/aCis_community/aCis_gameserver/java/net/sf/l2j/gameserver/datatables/BufferTable.java

 

See _schemesTable implementation.

 

PS : you are right, you can't put twice the same key, otherwise it replaces. So you have to feed entirely map2, then only when map2 is fed you place on correct classid. Then you clear() map2, refeed it with correct info, and put it on another classid. Do the same for all classes.

 

Your Map would probably be Map<Integer, HashMap<L2WeaponType, List<Integer>>>. If you dont like List, use regular int array (maybe easier to refer to it : index[0] for heavy, index[1] for light and index[2] for robe).

 

AVOID STRINGS. It's fat to stock and you will have extra operations to retrieve infos.

 

You can also decide to hold info on xml or properties file, and feed the Map that way. A //reload config and the whole crap could be reloaded.

hmmm bad idea... to much Map calculations...

The code gets the final outcome from Formula.java and it gets calculated with the code (%) and gives the final damage...

I think your thought could cause performance issues.. Imagine all these Map calculations in each hit or skill.. On a server with more than 20 people pvp'ing, the server would lag really badly i guess, wouldn't it?

 

Edit: I'm not using string.. It doesn't need too actually... I think xml would be better than properties... too much values...

Edited by xXObanXx
Posted
Your code is barely readable, and hard to maintain.

If you read and understand the first class, then you know the rest of the code... It's not hardcoded at all but i wanted to keep the performance part, that's why i didn't use any Map.

And I steel don't know what this code's performance would be in a live server, that's why i asked for a feedback, to tell me your thoughts :)

Posted (edited)

The cost of 2 maps .get() is neglictable compared to the gain of readability.

 

I don't even speak of my last point, which is the possibility to load from a config file, and so you can edit your crap externally, without the needs to recompile and replace your .jar. In any case, if you want to edit using an external way, you will have to use my method or a derivated (container).

 

If you state about performance issue, that means you got no clue what is REALLY happening during a server session. If we speak about spawns, that's 60k concurrent map, updated every second, according L2WorldRegion which are 88*128 = 10k. That's right you got 10k region, each holding 2 maps = 20k maps and a task to activate/desactivate it = 10k tasks.

 

As you can see, babbling about 2 .get() and a static map holding infos is kinda nonsense, while knownlist system is basically said 80k Maps and 10k tasks.

 

Finally if you want to edit, one day, the main formula used xxx times you have to edit it xxx times. I will have only a single line to edit.

Edited by Tryskell
Posted

I did a similar approach for aCis schemes buffer : schemes are ordered by player and by scheme name. So you have first to retrieve player id, then scheme name and only at this moment you refer to scheme (which itself holds a list of buffs)

 

HashhMap<L2WeaponType, List<Integer>>>. If you dont like List, use regular int array (maybe easier to refer to it : index[0] for heavy, index[1] for light and index[2] for robe).

 

AVOID STRINGS. It's fat to stock and you will have extra operations to retrieve infos.

 

You can also decide to hold info on xml or properties file, and feed the Map that way. A //reload config and the whole crap could be reloaded.

 

And the benchmarks:

 

LOAD:

 

gsDhXDI.png

 

SAVE IN DB:

 

YguonDy.png

 

 

Ofc all ingame operation are done in the RAM and there's no DB connections. The schemes are loaded once in db, then truncated and saved in DB using myISAM ofc.a

Posted

Finally a real feedback.

Thank you for your answer but i think you are kinda wrong...

I can't hold 2 Map values with the same key, can I?

I mean... to do that i must put

Map.put("Class 96", Map2.get("SWORD",
{
     1.2,
     1.1,
     1.3
};)

and then

Map.put("Class 96", Map2.get("DUAL_SWORD",
{
     1.0,
     1.2,
     1.3
};)

Can i actually do that?

Well why don't you create support class?

Example

 

public class classBalance
{
    int values[];
    string name;

    public classBalance(String nm,int vl)
    {
        name = nm;
        values = vl;
    }

    //create your own get and set methods
}


So you could use something like that:

Map<Integer,classBalance>;

 

Dunno if this is gonna be "heavy" for your system or generally if it is heavy but for sure it will be more readable and easy to work on it. ( I guess)

Posted (edited)

private HashMap<Integer, HashMap<String, ArrayList<Integer>>> schemeCache = new HashMap<>();

 

L2AEPvP scheme buffer !

 

I have written it from zero, based on DrHouse scheme buffer (shared on L2J).

 

I don't have a clue what is L2AEPvP. If you or another guy made a similar implementation, that only means it was the most obvious implementation. The saving process is also made on server shutdown.

Edited by Tryskell
Posted (edited)

I have written it from zero, based on DrHouse scheme buffer (shared on L2J).

 

I don't have a clue what is L2AEPvP. If you or another guy made a similar implementation, that only means it was the most obvious implementation. The saving process is also made on server shutdown.

 

 

L2AEPvP its aCis 260 rev still online today, I've coded it's scheme buffers based on that HashMap

Edited by xxdem
Posted (edited)

I'm sorry boys but I don't get it..

It doesn't need to store all these informations into Maps.

Each player has a different class and weapon.. but I don't get it why I should do all this...

It's like a duplicate of the whole class/weapon system because all these weapons and classes are stored in enums and i call them directly from their classes...

My current code is probably barely readable but it's simple and easy to understand..

 

Edit: Btw I'm currently opening the server from eclipse debugging so I don't need to recompile and change .jar files to change the value... i just change it from eclipse/save it and boum... the value has change and gets immediate effect... I will think about placing in properties or an xml later..

Edited by xXObanXx
Posted (edited)

I'm sorry boys but I don't get it..

It doesn't need to store all these informations into Maps.

Each player has a different class and weapon.. but I don't get it why I should do all this...

 

Readability, easy code maintenance, easy to edit values (no need to recompile) externalizing configs. Basically said, whatever a developer seek coding.

 

Your code works that's not the problem, but if L2J was coded like your custom... Well it would give L2JFrozen.

 

:happyforever:

Edited by Tryskell

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

    • How interesting that you keep making corrections, Mr. Perfect  
    • ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🔥 𝐆𝐗-𝐄𝐗𝐓 𝐒𝐕𝐍 𝐔𝐩𝐝𝐚𝐭𝐞𝐝 𝐍𝐞𝐰 𝐑𝐞𝐯𝐢𝐬𝐢𝐨𝐧 𝐀𝐯𝐚𝐢𝐥𝐚𝐛𝐥𝐞 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Hello everyone, A new 𝐆𝐗-𝐄𝐗𝐓 update is now available in the SVN. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ⚙️ 𝐔𝐩𝐝𝐚𝐭𝐞 𝐇𝐢𝐠𝐡𝐥𝐢𝐠𝐡𝐭𝐬 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🔹 𝐓𝐫𝐚𝐢𝐭𝐒𝐲𝐬𝐭𝐞𝐦 An important fix has been made in the TraitSystem. 🔹 𝐒𝐤𝐢𝐥𝐥𝐬 New skill-related functions have been added. 🔹 𝐡𝐀𝐮𝐭𝐡𝐃 Several important changes have been made in hAuthD. 🔹 𝐀𝐧𝐭𝐢-𝐅𝐥𝐨𝐨𝐝 𝐏𝐫𝐨𝐭𝐞𝐜𝐭𝐢𝐨𝐧 A unique anti-flood system has been implemented to prevent massive connection floods. 🔹 𝐀𝐮𝐭𝐡 / 𝐆𝐚𝐦𝐞𝐒𝐞𝐫𝐯𝐞𝐫 𝐏𝐫𝐨𝐭𝐞𝐜𝐭𝐢𝐨𝐧 The GameServer port 7777 now only allows access to clients that have been correctly authenticated through Auth. 🔹 𝐂𝐨𝐦𝐩𝐥𝐞𝐭𝐞 𝐇𝟓 𝐏𝐫𝐨𝐭𝐨𝐜𝐨𝐥 𝐓𝐞𝐦𝐩𝐥𝐚𝐭𝐞 A complete H5 protocol template has been added. This is a very useful addition because the full H5 protocol can be uploaded to an AI together with, for example, any L2J pack from any chronicle. With this, it becomes much easier and faster to convert, adapt, and make different Lineage II protocols compatible. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ There are also several additional source code changes that can be reviewed by comparing this revision with the previous one. Thank you to everyone who continues to trust 𝐆𝐗-𝐄𝐗𝐓.   Best regards, 𝐆𝐮𝐲𝐭𝐢𝐬
    • Selling a heavily customized Lineage II Interlude C++ extender project, built for classic Interlude private server development. This is not a simple pack with a few edits. The project includes many custom systems, PvP features, event managers, security modules, HTML boards, configuration files, and stability/exploit-related improvements. The source is written in old-style C++ / pre-C++11 style, suitable for older Visual Studio extender environments. Project Overview Chronicle: Interlude Language: C++ Type: L2Ext / extender source project Style: Pre-C++11 compatible Focus: PvP, clan content, automation, protection, HTML systems, configurable gameplay Included: Source files, configs, HTML templates, custom managers, event systems, utility systems, and fixes This project is ideal for someone who wants to build a custom Interlude server with more unique systems than a standard pack. Main Custom Systems Included Newspaper System A custom in-game HTML newspaper / server chronicle system. Features: HTML-based newspaper interface Compact 260px layout for Interlude client windows No database required Rolling text-file storage Auto-limits old news entries Boss kill news Castle siege news Hero news PvP milestone news Enchant milestone news Bounty-related news Uses proper client/display boss names Excludes unwanted/custom bosses such as minions Configurable news limit and page size This makes the server feel alive by showing important server events in a newspaper-style board. Combat Contribution / DPS Meter System Advanced damage and contribution tracking system. Features: DPS meter Damage tracking by player Damage tracking by skill Skill icon support Compact HTML display Optional auto-refresh Raid boss tracking Grand boss tracking Clan dungeon tracking Clan Civil War tracking Manual session tracking Contribution tracking for PvE/PvP situations Also includes support-class contribution logic, making healers and support players more valuable. Support PvP Count System A custom system that can reward support classes for helping in real PvP. Features: Healers/support classes can receive PvP credit Configurable support class list Heal contribution checks Debuff contribution checks Minimum support score Distance check Alive support requirement Same victim reuse protection Max support credits per kill Same IP / HWID / clan / ally protections This is very useful for bishops, EE, SE, OL, WC, and other support classes. Clan Civil War Event A custom clan-vs-clan controlled PvP event. Features: Clan registration Leader start option Min/max player settings Registration phase Preparation phase Fight phase Finish phase Respawn support Weekly cooldown Arena empty check Optional blocked items Team visuals / client team types Optional aura skills Tournament-style buff support Winner reward Loser reward Draw reward Top killer reward Anti-AFK participation requirement Safer HTML/bypass handling patches included Designed for controlled clan PvP outside normal siege content. Clan Dungeon Raid System Custom clan PvE dungeon/raid system. Features: Clan-only dungeon registration Optional clan leader requirement Only clan members option Min/max players Multiple dungeon rooms Boss spawn configuration Boss spawn delay Event time limit Fail if all dead option Revive on exit Restore on enter Kick outsiders option Weekly cooldown Success reward Fail reward Per-boss reward configuration Server announcements for start/success/fail Good for giving clans weekly PvE objectives. Bounty Hunter System Custom PvP bounty/streak system. Features: Tournament Tournament Rank Auto Simon Says (can be started with GM command too) Auto Russian Roullete ( can be started with GM command too) Player bounty tracking Kill streak logic Bounty claim rewards Configurable reward item Base reward and scaling reward Minimum level Minimum streak PK inclusion option Battle zone inclusion option Top bounty ranking Announce streaks Announce bounty claims Anti-feed protections include: Same party block Same clan block Same alliance block Same IP block Same HWID block Repeat victim window Kill reuse protection Great for making open-world PvP more active. Contract Board System Custom HTML-based player contract board. Features: Players can create kill contracts File-backed storage No heavy DB dependency for the board itself Configurable reward item Open contract limit Contract expiration Refund percentage on cancel/expire My contracts page Online target listing Contract info page Anti-abuse protections include: IP check HWID check Same clan block Same alliance block Same party block Repeat kill cooldown Level difference checks Olympiad/event/town restrictions A unique PvP board system that gives players extra reasons to hunt each other. AutoFarm System Custom in-game autofarm module. Features: HTML menu Attack skill setup Chance skill setup Self skill setup Buff skill setup Radius configuration HP/MP stop conditions Session time limit Consumable cost option Peace zone restriction Boss restriction Z-range search Mage/range handling Geo checking Target blacklist Stuck recovery Temporarily blacklists unreachable mobs Includes a geodata/stuck recovery patch to prevent the autofarm from looping forever on impossible targets. Smart Captcha / Anti-Bot Systems Includes anti-bot and captcha-related systems. Features: Captcha module Smart visual captcha logic Icon-group captcha support Trap token protection Bypass validation HWID fail counters Two-step captcha flow AntiBot module Active Anticheat module Client extension security integration Useful for reducing basic bot abuse. Client Security / HWID / Box Limit Client and account protection systems are included. Features: CliExt version check Outdated client HTML MD5 checksum option HWID ban support HWID unban support Account lock by HWID Character lock by HWID Allowed HWID list Box limit by hardware ID Optional autoban on illegal app detection Character PIN system Character lock system Good base for servers that want stricter client/account control. Olympiad Improvements Custom Olympiad configuration and protections. Features: Winner reward Loser reward Fixed fight point option Hero chat delay Relogin fix Overweight fix Forbidden items Forbidden item grades Max weapon enchant check Max armor enchant check HWID check option Custom Olympiad schedule windows Stop action on fight start Class/free entry control Same-opponent anti-feed logic Auto-tie logic after repeated same opponent matches Cooldown-style protection for repeated feeding attempts Good for reducing Olympiad feeding and abuse. Raid Boss Systems Includes multiple raid boss utilities. Features: Raid boss status board Alive/dead coloring Refresh timeout Static respawn boss support Boss respawn announcements Boss HP announcement system Predicted incoming-hit HP threshold check Handles cases where boss jumps from above threshold directly to dead Raid boss include option Grand boss include option Excluded NPC list Additional custom boss ID support Personal boss notify support through config/sample mini-event files Useful for both PvE players and server activity. PvP / Ranking / Status Systems Included PvP-related systems: PvP announce system Kill streak announcements Daily PvP system Kill/death stat system PK/PvP status board Clan PvP status board Clan reputation rank Top PvP statue PvP title/name customization options Siege stat/report system Tournament system TvT system Faction/Fraction systems Bounty system Contract board system This gives the server several PvP progression and visibility systems. Economy / Donation / Utility Systems The project includes many server economy and service systems: Auction system Donate system Donate augment system Vote reward system L2Network vote reward system VIP system Item delivery system Gold bar exchange Offline shop Offline shop restore Offline buffer Offline socket DB support Private store restrictions Auto loot Drop list viewer Drop viewer Multisell stat support Item reuse manager Skill reuse manager Custom enchant system Stackable enchant scroll option Custom enchant scroll rates Augmentation configuration Blocked augmentation items/glows/options Character / Gameplay Systems Other gameplay systems included: Rebirth system SubStack system Class manager Auto learn AIO system Wedding system Visual armor Visual weapon Hair accessory / 2-slot hair systems Player customizer Armor penalty Grade penalty Death penalty Spawn protection Scheme buffer Infinity shots/arrows Champion NPC Mining system Fortune Cards Fortune Workshop Reputation NPC talk system Cursed weapon systems Era system Spirit system Hero reward system Party/duel/MPCC related extensions Recent Fixes / Improvements Included The source includes several fixes and patch files related to stability, HTML safety, event handling, boss systems, and gameplay issues. Examples: L2Exalta Newspaper added Newspaper enchant hook fixed for stackable scroll enchant path Newspaper boss names fixed to use client/display names Newspaper boss filter added for unwanted custom bosses Newspaper HTML resized for 260px client width DPS meter visual improvements DPS meter skill icon support DPS meter auto-refresh logic Combat contribution fixes Support PvP contribution checks Civil War safe HTML handling Civil War visual/buff patches Civil War preparation/tournament buff fixes Civil War prize patch Clan Dungeon Raid patch AutoFarm geodata/stuck recovery patch Boss HP announce threshold/predamage fix Boss client name packet fix Reputation NPC talk safe hook Removed unsafe generic HTML-send NPC reputation hook style Safer private NPC chat handling HTML cache/filter systems HTML filename/path validation style protections Socket limiter options Remote statistic packet block/safe list options Anti-DDoS module Log control system Call stack/error logging support Stat limiter options Item/skill reuse persistence support Inventory validation options Acquired skill validation options Stackable item validation options Offline shop restore support       I will not say the project is bug free or whatever but if you support me i will support you! You buy licence, i fix and add your requests Source will not be sold And monthly is 120 euro as a subscription That includes 24/7 support ( of course respect resting hours or health issues) In the price the setup is included. After payment you can delay the next monthly payment for 5-10 days, then your server becomes unaccessible! Soon i will provide a public discord! Right now i can say its the lightest extender and crash free!  My files arent the best as many claim for their files , but whatever you find i am capable of fixing it!   In case of interest!   Discord: banshee1019     
    • Lo vendes? necesito todo eso, esta super hermoso tu trabajo.
    • New discord: https://discord.gg/HttMqBBD4F
  • 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..