Jump to content

Recommended Posts

Posted

Since the release of my source code for Warcraft 3: Expansion, I've gotten a lot of praise from people saying things like "wow that's the cleanest code I have ever seen!", and "where did you learn to code like that?", and my favorite, "that must have taken you forever to get your code that neat", etc etc...

 

...but this is simply not the case.. If you adapt to good programing habits at the start of a project, your code will look clean and professional at the very end as well. And that's what I'm here to help everyone with today.

 

Now let me start by saying that I've looked at the source code to lots of plugins, and overall they are very sloppy. This is not to say they were not coded well, more that they could have been layed out better. This is helpful when admins try to alter bits and pieces for their server(s), or if someone is looking to revamp or convert a script over to another platform.

 

-- (BEGIN BABBLING) --

 

I'll let you all in on a secret.. I used to play War3mod (by spacedude) and i LOVED it, however, crit nades, teleportation, and levitation really hurt the server(s) I played on because (especially with levitation and teleport) these skills were used and abused by the players, and there were not many admins available at peak times. My intention was simply to modify these skills so that they re-balanced the game while keeping it fun, but I took one look at the source code and decided I NEEDED to write it from scratch. So I did. And so WAR3X was born.

 

-- (END BABBLING) --

 

So let's get down to it. Below is a list of things that can be done to improve your programing habits, which will make them easier for you and others to edit in the long run.

Meaningful Variable Names (MODIFIED)

Many people have a problem with variable names. I've seen variables hit with such a bad case of shorthand that by looking at them, it is a mystery where they came from and what they do. Don't be afraid to use more than 10 characters in your variable names! The key is READABILITY!

 

One good habit to get into is using Hungarian Notation (HN) where applicable. For example, all global variables should start with "g_". This will let anyone know that looks at your code that "hey, this is a global variable!", without needing to see where and how it was initialized.

 

It is also helpful to prefix any variable that will be used in mathematical equasions with HN, ie- integers with "i", floats with "f", etc, etc. Even though Small is different from other languages in that every variable, no matter the "label", is actually an integer (even floats!), by using a little bit of HN you're almost guaranteed never to get a tag mismatch warning on your compile.

 

Don't overdo it, though!!! The key once again is READABILITY. If you don't know which HN to prefix with, then don't bother. Come up with your own naming convention. A good example is player indexes. using "id" is great. but if you're using 2 or more different player indexes in a bit of your code, differenciate them a bit, like "attackerId" and "victimId" or "killerId", etc.

 

Remember the phrase KISS - Keep it simple, stupid!

Naming Schemes

Good naming schemes are always a sight for sore eyes. Prefixing similar functions/variables with a common word makes for easy reading and editing of source code.

 

For example, If you have in your script events for damage and death, avoid naming them Damage_Event() and Death_Event(). Instead, name them Event_Damage(), and Event_Death(). For text editors that have function lists (Ultraedit32 is what I use), these will appear right on top of each other, adding to the organization of the plugin.

 

The same goes for variables. If you are trying to store a player's current health and armor as global variables, try naming them something like g_iPlayerHealth and g_iPlayerArmor.

Multiple Files

Multiple files will help you keep your plugin(s) very organized. This is not necessary for small scripts, however, when your script begins to grow very large, this is definately a good idea. You'd be amazed at how much throwing all of your events into their own file really cleans up your code.

 

There is one minor problem with combining files, though, and that is the inaccurate display of runtime errors (if they exist). If your script is made up of 5 files, and in the 5th file there is a runtime on line 10, AMXX will report your error on line 10, even if there are 500 lines of code in file 4 alone.

 

To fix this problem for war3x, Willyumyum came up with an INLINE FILE COMBINER, which combines all of our inline files into one large file, which we then compile. This program will be made public, complete with a nice looking GUI frontend, within the next month or so

Use constants

Another thing you want to avoid while programing, is hard-coding things into your scripts. Use constants, and #defines instead. Even if something is used only once in your plugin, it might be worth making a constant for it. Why? because constants take normal things, like numbers, and make them into something named, which are far easier to remember. They also make changing an aspect of your plugin as easy as changing one constant, instead of having to change EVERY occurance of the number '3' in your code, for example.

 

Here's another example... You want to write a plugin that acts like an RPG, and will have 4 races, with 3 classes per race. You want to save a couple of constants like so:

 

#define TOTAL_RACES   4
#define TOTAL_CLASSES 3 

 

This will make performing loops much easier, and if you decide to add an additional race in the future, All you'd need to do is change TOTAL_RACES to 5.

Make extensive use of comments!

Even though you may know every inch of your plugin, a foreign set of eyes may not, and as your script gets bigger, you may forget about things yourself.

 

If there is ever something you can not finish, or don't quite know how to implement, a comment can be a useful tool. Putting one in your code may catch a fellow coder's attention that has a solution to a problem you may be having, etc etc. For example..

 

/* for some reason, this sequence screws up if this
    variable is not initialized to 0 */
new iVariable = 0;

 

This could prevent another programer from looking at your plugin and removing this seemingly redundant initialization, in turn causing untraceable problems in the plugin down the road. So do yourself a favor, and add the comments in. You will thank yourself in the long run.

Close with semicolons (MODIFIED)

I want to emphasise that this is NOT REQUIRED by the Small language, but a good habit to get into is closing out your lines with semicolons. This is because if you have any intentions of learning any other language, you're almost guaranteed that you will need to close out your lines with them. So again, not required, but overall a good habit.

 

/* For people that want to force the compiler to look for closing semi's,
    you can force them with the following: */
#pragma semicolon 1 

 

 

Conformity (NEW)

If you pick a style, stick with it. Don't make multiple coding standards in one document. (From: BAILOPAN)

Indentation, PLEASE!

I've seen a LOT of scripts that do not do a single bit of indentation. This is NIGHTMARE to debug!!! Every time you open a brace "{" INDENT! this means at the start of functions, the start of if/then conditionals, switches, etc, etc, etc, etc, etc, etc, etc, etc, etc! Please no more of this!...

 

public some_function(id){
new szVariable[10]
format(szVariable,9,"hello!!!!")
if(id==0){
server_print(szVariable)
}else{
client_print(id,print_chat,szVariable)
}
return PLUGIN_HANDLED
}

 

Take the time to make it READABLE! Like so..

 

public some_function( id ) {

    new szVariable[10];
    format( szVariable, 9, "hello!!!!" );

    if ( id == 0 )
    {
        server_print( szVariable );
    }

    else
    {
        client_print( id, print_chat, szVariable );
    }

    return PLUGIN_HANDLED;
}

 

 

Whitespace, Whitespace, Whitespace!!!

This I saved for last because it is the MOST IMPORTANT!!! whitespace does not add to the size of your compiled code (because it is overlooked by the compiler), but adds a whole new dimension of readability to your plugin. Avoid clumping things together. Use common sense and separate things from each other. This means adding spaces after every function argument, indents after every conditional statement, and linefeeds to separate unrelated actions. Also use comments, and be sure to space out all arguments inside of parenthesis ()'s. (see example above).

 

I'm going to use a function right out of one of the default .sma files that come with both AMX and AMXMODX, originally written by OLO.

 

Original Code

 

 

public cmdSlay(id,level,cid) {
  if (!cmd_access(id,level,cid,2))
    return PLUGIN_HANDLED
  new arg[32]
  read_argv(1,arg,31)
  new player = cmd_target(id,arg,5)
  if (!player) return PLUGIN_HANDLED
  user_kill(player)
  new authid[32],name2[32],authid2[32],name[32]
  get_user_authid(id,authid,31)
  get_user_name(id,name,31)
  get_user_authid(player,authid2,31)
  get_user_name(player,name2,31)
  log_amx("Cmd: ^"%s<%d><%s><>^" slay ^"%s<%d><%s><>^"",
    name,get_user_userid(id),authid, name2,get_user_userid(player),authid2 )
    
  switch (get_cvar_num("amx_show_activity")) {
    case 2: client_print(0,print_chat,"%L",LANG_PLAYER,"ADMIN_SLAY_2",name,name2)
    case 1: client_print(0,print_chat,"%L",LANG_PLAYER,"ADMIN_SLAY_1",name2)
  }   
    
  console_print(id,"[AMXX] %L",id,"CLIENT_SLAYED",name2)
  return PLUGIN_HANDLED
}

 

Polished Code

 

public cmdSlay( id, level, cid ) {

  if ( !cmd_access( id, level, cid, 2 ) )
    return PLUGIN_HANDLED;

  new szArg[32];
  read_argv( 1, szArg, 31 );

  // Get ID of player to be slayed

  new targetId = cmd_target( id, szArg, 5 );

  if ( !targetId )
    return PLUGIN_HANDLED;

  user_kill( targetId );

  // Grab admin/target names/authids

  new szAuthid[32], szName[32], szAuthid2[32], szName2[32];

  get_user_authid( id, szAuthid, 31 );
  get_user_name( id, szName, 31 );
  get_user_authid( targetId, szAuthid2, 31 );
  get_user_name( targetId, szName2, 31 );

  // Log command

  log_amx( "Cmd: ^"%s<%d><%s><>^" slay ^"%s<%d><%s><>^"", 
    szName, get_user_userid( id ), szAuthid, szName2, get_user_userid( targetId ), azAuthid2 );
    
  // Display slay to all other players

  switch ( get_cvar_num( "amx_show_activity" ) )
  {
    case 2: client_print( 0, print_chat, "%L", LANG_PLAYER, "ADMIN_SLAY_2", szName, szName2 );
    case 1: client_print( 0, print_chat, "%L", LANG_PLAYER, "ADMIN_SLAY_1", szName2 );
  }   

  // Confirm slay to admin
    
  console_print( id, "[AMXX] %L", id, "CLIENT_SLAYED", szName2 );

  return PLUGIN_HANDLED;
}

 

 

I hope this information is helpful to everyone that wants to clean up their code a little bit! (or a lot)

 

Take care

 

By: Ryan

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

    • General Trackers :   IPTorrents invite IPTorrents account 1 tb TorrentLeech invite Torrentleech account 1 tb buffer  InTheShaDow ( ITS ) account Acid-lounge invite Torrentday invite Crnaberza account Abn.Lol account Limit-of-eden account Norbits account Xspeeds account Xspeeds invite Bemaniso invite Wigornot account Bithumen invite Filelist account Funfile invite AvistaZ invite Potuk.net invite ResurrectThe.Net invite GrabThe.Info invite Greek-Team invite LinkoManija invite Fano.in account tracker.czech-server.com Speed.cd invite Arab-torrents.net account Arabscene.me account Scenetime account 4thd.xyz invite Btarg.com.ar account Dedbit invite Estone.cc account Speedapp invite Finvip invite Fluxzone account GigaTorrents account Gimmepeers account Haidan.video invite Mojblink account Mycarpathians invite Newinsane.info account Oscarworld.xyz account Peers.FM invite Pt.msg.vg account Ransackedcrew account Redemption invite Scene-rush account Seedfile.io invite Teracod invite Torrent.ai account Torrentmasters invite Ttsweb invite X-files invite X-ite invite Ncore account TorrentHR account Rptorrents account BwTorrents account Superbits invite Krazyzone account Immortalseed account Tntracker invite Pt.eastgame.org account Bitturk account Rstorrent account Tracker.btnext invite Torrent-turk.de account BeiTai.PT account Pt.keepfrds account 52pt.site account Pthome account Torrentseeds account Aystorrent account Blues-brothers.biz invite Divteam account Thesceneplace invite CinemaMovies.pl account Brasiltracker account Patiodebutacas account Newheaven.nl account  Swarmazon.club invite Bc-reloaded account Crazyspirits account Silentground invite Omg.wtftrackr invite Milkie.cc invite Breathetheword invite Madsrevolution account Chilebt account Yubraca account Uniongang.tv account Frboard account Exvagos account Diablotorrent account Microbit account Carp-hunter.hu account Majomparade.eu account Theshinning.me account Youiv.info account Dragonworld-reloaded account Sharewood.tv account Partis.si account Digitalcore.club invite Fuzer.me account R3vuk.wtf invite Ztracker account 1 tb buffer 3changtrai account Best-core.info account Bitsite.us account Eliteunitedcrew invite Exitorrent.org account Tophos invite Torrent.lt account Sktorrent.eu account Oshen account Blackhattorrent account Pirata.digital account Esharenet account Ohmenarikgi.la Pirate-share account Immortuos account Kiesbits account Cliente.amigos-share.club account Broadcity invite Ilovetorzz account Torrentbytes account Polishsource account Portugas invite Shareisland account ArabaFenice account Hudbt.hust.edu.cn account Audiences account Nanyangpt account Pt.sjtu.edu.cn account Pt.zhixing.bjtu.edu.cn account Byr.pt invite Ptfiles invite Red-bits account Pt.hdpost.top account Irrenhaus.dyndns.dk (NewPropaganda) account Mnvv2.info (MaxNewVision V2) account 1ptba.com account Spidertk.top account Film-paleis account Generation-free account Aftershock-tracker account Twilightsdreams account Back-ups.me invite Sor-next.tk ( Spirit Of Revolution ) account Tfa.tf ( The Falling Angels ) account Hdmayi account S-f-p.dyndns.dk ( Share Friends Projekt ) account Unlimitz.biz account Pttime account St-tracker.eu account New-retro.eu account Zbbit account Tigers-dl.net account Jptvts.us account Lat-team account Club.hares.top account Falkonvision-team account Concen account Drugari account T.ceskeforum account Peeratiko.org account Zamunda.se account Central-torrent.eu account h-o-d.org account Torrentleech.pl account Demonoid invite Lst.gg account Fakedoor.store account LaidBackManor account Vrbsharezone.co.uk invite Torrenteros account Arenaelite account Datascene account Tracker.0day.community Tapochek.net invite Ptchina invite Lesaloon account Exyusubs account Therebels.tv account Ubits.club invite Zmpt.cc account Turktorrent.us account Dasunerwarte account Hawke.uno account Monikadesign account Fearnopeer account Alpharatio account Wukongwendao.top account Chinapyg account Azusa.wiki account Yggtorrent.top account Torrentdd account Cyanbug.net invite Hhanclub.top account Wintersakura.net account Xthor account Tctg.pm account Finelite invite Agsvpt.com account Pt.0ff.cc invite Qingwapt.com account Xingtan.one account Ptcafe.club invite Theoldschool.cc account W-o-t.pro account Coastal-crew.bounceme.net account Darkpeers.org account Pianyuan.org account Seedpool.org  account Tempelbox account Pt.itzmx.com account Capybarabr.com account Itatorrents.xyz  account Letseed.org account The-new-fun.com  account Malayabits.cc account Trellas.me account Yu-scene.net account Futuretorrent.org account Bitpt.cn account Tocashare.biz  account Videoteka.org  account White-angel.hu account Xbytesv2.li account   Movies Trackers :   Anthelion account Pixelhd account Cinemageddon account DVDSeed account Cinemageddon account Cinemaz account Retroflix account Classix-unlimited - invite Movie-Torrentz (m2g.link) invite Punck-tracker.net account Tmghub account Tb-asian account Cathode-ray.tube account Greatposterwall account Telly account Arabicsource.net account Upload.cx account Crabpt.vip invite Onlyencodes.cc account Exyusubs account Hellashut.net invite Nordichd.sytes.net invite Locadora.cc account   HD Trackers :   Blutopia buffered account Hd-olimpo buffered account Hdf.world account Torrentland.li account HdSky account Hdchina account Chdbits account Totheglory account Hdroute account Hdhome account TorrentCCF aka et8.org account 3DTorrents invite HD-Torrents account Bit-HDTV account HDME.eu invite Hdarea.co account Asiancinema.me account JoyHD invite HDSpace invite CrazyHD invite Bluebird-hd invite Htpt.cc account Hdtime invite Ourbits.club account Hd4fans account Siambit account Privatehd account Springsunday account Tjupt account Hdcity.leniter invite Ccfbits account Discfan account Pt.btschool.club account Ptsbao.club invite Hdzone.me invite Danishbytes account Zonaq.pw account Tracker.tekno3d account Arabp2p account Hd-united account Reelflix.xyz account Hdatmos.club account Anasch.cc invite Tigris-t account Nethd.org account Hd.ai invite Hitpt.com account Hdmonkey account Dragonhd.xyz account Hdclub.eu account Forum.bluraycd.com account Carpt account Hdfun.me invite Pt.hdupt invite Puntotorrent account Ultrahd account Rousi.zip account Bearbit account Hdturk.club account Asiandvdclub account Star-space.net account Nordicq.org account Hdkyl.in account Utp.to account Music Trackers : Dicmusic account Music-Vid account Open.cd account LzTr account ProAudioTorrents invite Jpopsuki invite TranceTraffic invite Audionews invite Kraytracker invite Libble.me invite Losslessclub invite Indietorrents.com invite Dimeadozen account Funkytorrents invite Karaokedl account zombtracker.the-zomb account Concertos account Sugoimusic account Satclubbing.club invite Metal.iplay invite Psyreactor invite Panda.cd account Adamsfile account Freehardmusic account Tracker.hqmusic.vn accouunt Twilightzoom account 3 tb buffer Hiresmusic account Metalguru account Musictorrents.org account Musebootlegs.com invite Zappateers.com account Jungleland.dnsalias.com account Naftamusic account   E-Learning Trackers :   Thevault account BitSpyder invite Brsociety account Learnbits invite Myanonamouse account Libranet account 420Project account Learnflakes account Pt.soulvoice.club account P2pelite account Aaaaarg.fail invite Ebooks-shares.org account Abtorrents account Pt.tu88.men invite Docspedia.world invite   TV-Trackers :   Skipthecommericals Cryptichaven account TV-Vault invite Shazbat.TV account Myspleen account Tasmanit.es invite Tvstore.me account Tvchaosuk account Jptv.club account Tvroad.info   XXX - Porn Trackers :   FemdomCult account Pornbay account Pussytorrents account Adult-cinema-network account Bootytape account 1 Tb buffer Exoticaz account Bitporn account Kufirc account Gaytorrent.ru invite Nicept account Gay-torrents.org invite Ourgtn account Pt.hdbd.us account BitSexy account Happyfappy.org account Kamept.com account Lesbians4u.org account   Gaming Trackers :   Mteam.fr account BitGamer invite Retrowithin invite Gamegamept account   Cartoon/Anime/Comic Trackers :   Animeworld account Oldtoons.world account U2.dmhy account CartoonChaos invite Animetorrents account Mononoke account Totallykids.tv account Bakabt.me invite Revanime account Ansktracker account Tracker.shakaw.com.br invite Bt.mdan.org account Skyey2.com account Animetracker.cc Adbt.it.cx invite Tracker.uniotaku.com account Mousebits.com account   Sports Trackers :   MMA-Tracker invite T3nnis.tv invite AcrossTheTasman account RacingForMe invite Sportscult invite Ultimatewrestlingtorrents account Worldboxingvideoarchive invite CyclingTorrents account Xtremewrestlingtorrents account Tc-boxing invite Mma-torrents account Aussierul invite Xwt-classics account Racing4everyone account Talk.tenyardtracker account Stalker.societyglitch invite Extremebits invite Rgfootball.net account F1carreras.xyz account   Software/Apps Trackers :   Brokenstones account Appzuniverse invite Teamos.xyz account Macbb.org account   Graphics Trackers:   Forum.Cgpersia account Gfxpeers account Forum.gfxdomain account   Documentary Trackers:   Forums.mvgroup account   Others   Fora.snahp.eu account Board4all.biz account Filewarez.tv account Makingoff.org/forum account Xrel.to account Undergunz.su account Corebay account Endoftheinter.net ( EOTI ) account Thismight.be invite Skull.facefromouter.space account Avxhm.se (AvaxHome) account Ssdforum account Notfake.vip account Intotheinter.net account Tildes.net invite Thetoonz account Usinavirtual account Hdclasico invite HispaShare account Valentine.wtf account Adit-hd account Forum-andr.net account Warezforums account Justanothermusic.site account Forbiddenlibrary.moe account Senturion.to account Movieparadise account Militaryzone account Dcdnet.ru account Sftdevils.net account Heavy-r.com account New-team.org account Ddl.tv account Filewarez.club account Hispamula.org account Hubwarez.tv account   NZB :   Ninjacentral.co.za account Tabula-rasa.pw account Drunkenslug account Drunkenslug invite Usenet-4all account Brothers-of-Usenet account Dognzb.cr invite Kleverig account Nzb.cat account Nzbplanet.net invite Ng4you.com account Nzbsa.co.za account Bd25.eu account NZB.to account Samuraiplace account Abhdtv.net account Abook.link account Comix.pw account House-of-usenet Secretbinaries.net account Vnext.to account Stockboxx.top account Sky-of-use.net account   Prices start from 3 $ to 100 $   Payment methods: Crypto, Neteller, Webmoney, Revolut   If you want to buy something send me a pm or contact me on:   Email: morrison2102@gmail.com   Discord: LFC4LIFE#4173   Telegram: https://t.me/LFC4LIFE4173   Skype: morrison2102@hotmail.com
    • these are all my interfaces)
    • Updates:    Revision 568: 2020-10-28 Fix: -Mp potions thanks to RuLLezZ for report. -Archangels(Baium) attack. -geonegine doors npe. -geoengine layer correction. -boats are now properly working. -max enchant protection ,thanks to RuLLezZ-Fortitude for report. -character selection enchant effect,thanks to RuLLezZ-Fortitude for report. -multisell exploit. -SevenSigns leak-optimize. -pledge visual packet. -Party match room unhardcoded newid. -party match room auto join l2off like. Skills fix: -Force Meditation. -skill type: TARGET_MULTIFACE properly working. Rework: -sql connection pt2. -community board ClanList.java (from 120 lines to 65) -community board CastleStatus.java -community board RaidList.java optimize: -sql: player item restore. -Cboard HeroList update every 4 hours(avoid to execute sql connection on click.) Remove: -top players from cboard(and kept the one from rank system, in order to work you must enable the rank system) -   Revision 569: 2020-12-14 Fix: -npe onMagicFinalizer. -FrequentSkill npe. -Cyrillic characters support in cboard ,thanks to Fortitude for report. -255 tutorial message,thanks to Fortitude for report. -cboard switch typo,thanks to Fortitude for report. -multiply statement , thanks to Fortitude for report. -allow to interact with dead monsters to use "sweep" correctly. -potions are now visible under buffs(l2off like). -hp-mp negative value. -optimize-fix updateAbnormalEffect unnecessary packet broadcast. now it will send the update only if abnormal effects are in use or effected by somone,which is lead to a huge broadcast optimize. Monster behavior: -onAggression remove minion assist(l2 off like), -onAggression minions are following master and attacking only when we attack master-minion.tested on advext. Skills fix: -lure(skill) behavior on monster,thanks nijota for report. Rework: CharEffectList.java optimize: (Custom)EventEgnine: "asynchronize" teleport to avoid massive lag. -   Revision 570: 2021-04-11 Fix: -client-server desync(jump backward ,weird effect) while pressing attack and try to move away. -npe on player protection. -npe on summon magic skill use. -npe on use item. -on duel: you can attack summons properly.(with same duel id) -on duel finish: summons are now stop attacking and return to their owner. -soulshot properly usage after finish casting. -party member position. thanks Cibo for report. -combat-chase movement system. -Antharas-Valakas Shock skill effect l2off like. -properly remove cubics on restart-logout. -status update avoid sending unnecessary packets. -On equip-unequip item avoid sending unnecessary packets. -Revert L2GamePacketHandler.java to switch method. -shortcut doubling(properly update). thanks to ragef for report. -Event engine teleport , thanks to daffynash for report. Quest fix: -Q115_TheOtherSideOfTruth: Misa Spawn at night. thanks Cibo for report. -Q648_AnIceMerchantsDream: Steward on talk html. thanks Cibo for report. Skills fix: -augment stack. Rework: -Friend system (client-server packets l2off like). -   Revision 571: 2021-09-11 Bug fix: -avoid following target after restart-logout , thanks to EXCLUS1VE for report. -pick up stuck , thanks to EXCLUS1VE for report. -summon patk/matk speed visual animation. -summon attack request , thanks to EXCLUS1VE for report. -effect relax , thanks to EXCLUS1VE for report. -formulas hitmiss , thanks to EXCLUS1VE for report. -Social action request , thanks to EXCLUS1VE for report. -cubic attack , thanks to EXCLUS1VE for report. -Party match room chat, thanks to EXCLUS1VE for report. -pick up issue , thanks to EXCLUS1VE for report. -pet npe, thanks to EXCLUS1VE for report. Rework: -player template. -skilltreedata. -RequestAquireSkill. -RequestAquireSkillInfo. -RequestExEnchantSkill. -RequestExEnchantSkillInfo. -AcquireSkillList. -ExEnchantSkillList. Optimize: -players got their own getMoveSpeed getter , and triggers when speed change by user(walk/run commands) or buff-debuff, that way we avoid unnecessary speed calculation by updateposition task that literaly spam the calculators. -castle traps are optimized and enabled. damage calculation formula: -blow damage position bonus. -when you make a magic critical hit, the magic damage is now tripled. -melee normal attack Damage position bonus. Implement: -new vote api system.(npc-> //spawn 61) Organization: FenceManager moved in -> datatables/xml and rename to FenceData. Remove: -old antibot system and kept only one as main. -old vote system. -   Revision 572: 2022-01-08 fix -Elroki , ToIVortex , Pagan , Oracle teleporters. -shop distance(sell-buy) bug, thanks to exclusive for report. -Monster Derby Track teleport. thanks to lorka for report. -MissQueen multisell coupon. thanks to lorka for report. -Olympiad spectator error thanks to magister for report. -Quest ShowResult replace objId instead name. -html over 200++ corrections typo - bypass. -(Custom config) DAGGERS-ARCHERS wear HEAVY-LIGHT on use item unequip equipped item if config is false , to avoid stuck , thanks to exclusive for report. -Npe on connection close , thanks to exclusive for report. -Herbs auto destroy , thanks to exclusive for report. Spawn: -Implement L2off spawn data and territory system. -xml spawn list added inside datapack data/xml/spawn. -Sql spawn list has been merged with new spawn system and manage only the custom admin //spawn. -Territory Monsters randomly spawn in their territory. -Shift click on monters -> "visual" will allow you to check their territory. Skill fix: -fixed all chance skills. Optimize: -NpcData.java -PetNameTable -Siege(tasks - sql connection) Implement: -Server-Player Variable -ClientSetTime packet. -AttackDeadTarget packet. -AttackinCoolTime packet. -AttackOutOfRange packet. Rework: -L2BossSpawnInstance Clean up - Delete: -remove L2ProtectorInstance. -remove unused configs. -remove AdminUnblockIp. -remove VipTeleportCmd. -AdminCommands.xml clean up. Organization: -AutoSpawnHandler,L2Spawn,SpawnData,SpawnTerritory moved inside gameserver.model.spawn . Dont forget: to update your databse and use geodata!!! is important for the new spawn system! -   Revision 573-574: 2022-02-04 fix -Herbs auto destroy time (14 seconds) -Clan skills learn npe , thanks to Ziklis for report. -potions visual bug , thanks to Ziklis for report. Optimize: -Quest engine. -Hero engine. -SevenSigns. -Event engine. Implement: -Siegable Clan Halls (from l2j thanks to Zoey76) you can use //siege ingame for test. -Spawn data spawn_bydefault field. -CustomSpawnManager (holds npc spawn data by field "spawn_bydefault" that equals false) Clean up - Delete: -delete:EventStats.java -delete:pmoff - tradeoff handlers and merge in one (.menu voiced) -spawnlist old sql file. -   Revision 575: 2022-05-14 Fix: -Clan Skills , thanks to shush for report. -Olympiad doDie error , thanks to shush and Elliot for report. -backstub 100 % succes if attacker is behind of target. -player siege state status update. -CrownManager unhardcoded checkCrowns. -   Revision 576: 2022-07-21 Fix: -Elven Fortress teleport. thanks to JMD for report. -Traders when geodata enabled. thanks to JMD for report. -Summon Cp Potion(skills store-restore has been fixed) thanks to Noone4 for report. -Elixir reuse time , to Noone4 for report.   - Revision 577: 2022-09-25 Fix: -Drop item location.(items cannot be dropped inside wall etc, geodata must be enabled) -Hero count. Npc -Dark Choir Lancer heigh correction -Dark Choir Captain heigh correction Misc Ai: -Implement NpcWalkerTaskManager(handle npc walker ai). Misc: -isNewBie delete config-sql-getters and now depends on level. -TopRankManager is now available(merged with community board) holding stats for top players pvp-pk etc. -   Revision 578: 2022-11-07 Misc: Sql typo , thanks to noone4. Rework: -Balancer.(also save button added at the bottom) - Revision 579: 2023-03-28 Fix: -Multisell ingredient for clan points, thanks to noone4 for report. -Raid respawn time, thanks to noone4 for report. -Quest delay , thanks to noone4 for report. -Minion respawn task, thanks to noone4 for report. Rework: -Achievement Engine.(rework and optimize). -Couple - Wedding Manager.(rework and optimize). Delete: -WeddingCmd (voiced command) , wedding is now available only on npc manager. Dont forget to update your sql tables and config files.    -   Revision 580: Fix: -Start creatures AI only when they are in active region. -Subclass : In order to change the base class you can only manage it by using the master with the same type, thanks  to noone4 for report. -olympiad check item restriction and unharcoded. -monster properly delete by admin command , thanks to noone4 for report. -Zaken properly attack. thanks to l2valhalla for report. -QueenAnt nurse heal. thanks to l2valhalla for report. -Door region check to avoid stuck while wallking through.thanks to l2valhalla for report. -Rain of Fire (1296) skill radius , thanks to millerose for report. -Frost Wall (1174) skill radius , thanks to millerose for report. -RaidBossSpawnManager calendar replaced with system current time millis. -VIPTvT npe on selectNewVipOfTeam , .thanks to l2valhalla for report. -onActionShift spawn-territory npe. -L2Party properly change party leader. -AutoAttackable class cast exeption. -RequestMagicSkilluse AIOB. -L2StaticObjectInstance npe. Rework: -Project update to java 17.(you can download latest jdk version here: https://adoptium.net/temurin/releases/ ) -Remove MysqlConnector and implement MariaDb. -GeoEngine.(currently working only with l2j type , download the new geodata here: https://www.mediafire.com/file/c2tvxwt5bz086jh/geodata.rar/file ) -DoorData. -Geometry algorithm. -SQL account manager. -CustomSpawnManager(Handle npcs-monsters that are not spawned by default via xml spawn.) -L2Skill.java getTargetList rework and cleanup : case TARGET_AURA , case TARGET_AREA , case TARGET_MULTIFACE , case TARGET_PARTY ,  avoid unnecessary - heavy tasks(optimized). -Impement: -Support api for https://l2rankzone.com/ . -Admin Bookmark. -FakePlayer Chat. Organise: -CustomSpawnManager moved inside -> gameserver.model.spawn Delete: -Unused libs.   Revision 581: Fix -Fishing skill list properly show, thanks to ByDenisko for report. -Multisell enchanted items , thanks to ByDenisko for report. -Drop range between mercenary tickets. -Break Duress skill(461) , thanks to DevilMStar for report. -Interact-pickup tickets , thanks to DevilMStar for report. Rework: -refreshExpertisePenalty to avoid unnecessary calculation. -Mercenary tickets. -ClanGate skill handler.   -   Revision 582: Fix: -Siege guard aggro due to the last rework , thanks to ByDenisko for report. -Siege zone , thanks to ByDenisko for report. -Trade npe , thanks to ByDenisko for report. -Olympiad port player back position. -Antharas CCE , thanks to ByDenisko for report. -Interact exception , thanks to ByDenisko for report. -interact-pick up: action denied if the player is dead-fakedeath. (players can still interact with NPCs, but they must be within the designated interaction distance.) Rework: -Skills Array to ConcurrentSkipListMap. -L2AttackableAI think to avoid unnecessary - heavy tasks. Implement: -AutoSaveTaskManager. -AiThinkTaskManager wich handle attackable think. -Check for Event engine to activate-deactivate. -Admin zone cretion. Organization: -Rename gameserver.scrips -> gameserver.scripts   -   Revision:583 Java 21 ,DropItem-protection,ThreadPoolManager,Geongine,AdminTeleport,TopRankmanager Java 21: -The project has transitioned to Java (JDK) 21 for improved performance and features. Fix: -TopRankManager added snap list to avoid empty list while updating. -TopRankManager npe. -BookMark Teleport. -Siege: Allow pray only on the artifact spot. -Olympiad hp npe -Olympiad ip check npe -Olympiad teleport back npe Rework: -Reworked the whole Drop Protection concept and eliminated the need for synchronized methods and multiple tasks for each item.  The process is now centralized under a single manager: DropProtectionManager which centrally manages all items by one task for optimal efficiency. GeoEngine: -Maxiterations are now depends on mapsize and limit them to 13500. ThreadPoolManager: -ThreadPoolManager is now using java virtual pools.   -   Revision:584(latest 24/8/2025) RespawnTaskManager,TradeController,MerchantTaskManager,StatusListenerManager,FollowTaskManager,ItemAutoSaveTaskManager Rework: -Refactored inventory save system for improved efficiency The entire inventory save system has been restructured to eliminate redundancy and enhance performance. Previously, each item triggered its own database save Connection task (e.g., on equip, unequip, drop, add, etc.), resulting in overhead and complexity. Now, a centralized ItemAutoSaveTaskManager handles all pending item saves through a single, unified SQL connection task. -The entire creature respawn system has been restructured to eliminate redundant tasks and improve efficiency. Previously, each creature had its own separate respawn task, leading to potential overhead and complexity. Now, a centralized RespawnTaskManager handles all pending creature respawns through a single task. -TradeController has been restructured to eliminate redundant tasks by using MerchantTaskManager(same optimization as creature spawn) -StatusListenerManager now handles broadcast of statusUpdate(hp) -FollowTaskManager handles all following creatures through a single task. Fix: -clan hall buff support. thanks to Almaz. -Valakas Teleport. thanks to Almaz.  SQL Connection: Update MariaDB connector to 3.5.4          
    • isnt his i also find it on l2ketrawars  https://imgur.com/a/4BMldRQ someone lock the topic ,solved!
  • 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..

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock