Jump to content

Recommended Posts

Posted

Hello guys. I made a clan manager for a guy. I decided to share it with you.


 


What that manager does? You can change your clan's level, your clan's reputation score and add clan skills.


 


Code is untested, I would be greatful if someone test it.


 


The code: http://pastebin.com/n4kY3kbJ


 


Thanks in advance. All credits are mine.


Posted (edited)
 




+       public int itemId = 57;
+       public int itemCountLevelUp = 10000;
+       public int itemCountReputationPoints = 100000;
+       public int itemCountClanSkills = 100000000;
+       public int clanLevel = 1;
+       public int clanReputationScore = 1000;
+       public int[] clanSkills = {
+       {
+               370,
+               371,


+               372,


+               373,
+               374,
+               375,
+               376,
+               377,
+               378,
+               379,
+               380,
+               381,
+               382,
+               383,
+               384,
+               385,
+               386,
+               387,
+               388,
+               389,
+               390,
+               391
+       


 

all these should be private static final

 




+                       if (player.getClan() != null)
+                       {
+                               player.sendMessage("You don't have a clan.");
+                               return;
+                       }



 

this is wrong



+                       for (int s : clanSkills)
+                       {
+                               L2Skill clanSkill = SkillTable.getInstance().getInfo(s, SkillTable.getInstance().getMaxLevel(s));
+                               player.getClan().addNewSkill(clanSkill);
+                               player.getClan().broadcastClanStatus();
+                               player.getInventory().destroyItemByItemId("Init.", itemId, itemCountClanSkills, player, player);
+                               player.sendMessage("Your clan has learned all clan skills.");
+                       }


 

this should be



+                       for (int s : clanSkills)
+                       {
+                               L2Skill clanSkill = SkillTable.getInstance().getInfo(s, SkillTable.getInstance().getMaxLevel(s));


+                               player.getClan().addNewSkill(clanSkill);
+                               //if clan already owns this skill; continue;

+                               if (!player.getInventory().destroyItemByItemId("ClanSkill", itemId, itemCountClanSkills, player, player))
+                               {
+                                       player.sendMessage("you dont have enough materials for this clan skill);
+                                       break;
+                               }
+                               player.sendMessage("Your clan has learned all clan skills.");
+                       }
+                      player.getClan().broadcastClanStatus();



Edited by xdem
Posted (edited)

Haha this one is the best :happyforever:  Surely you wanted to write == :P

    +                       if (player.getClan() != null)
    +                       {
    +                               player.sendMessage("You don't have a clan.");
    +                               return;
    +                       }
Edited by SweeTs
Posted

There's a lot of improvements to do :

* all commands use the same checks so you can reduce amount of produced code (using for example if (command.startsWith("clan"))

* the skills array is from 370 to 391 so you can use old school for loop to avoid to store anything (not needed to store stuff which can be easily guessed).

* as said SweeTs the clan check makes the whole code broken.

* as said xdem you should check if you can destroy the item before trying to "reward" for the given action, otherwise it's a big exploit. xdem code got also a problem btw.

Posted

There's a lot of improvements to do :

* all commands use the same checks so you can reduce amount of produced code (using for example if (command.startsWith("clan"))

* the skills array is from 370 to 391 so you can use old school for loop to avoid to store anything (not needed to store stuff which can be easily guessed).

* as said SweeTs the clan check makes the whole code broken.

* as said xdem you should check if you can destroy the item before trying to "reward" for the given action, otherwise it's a big exploit. xdem code got also a problem btw.

Yeah thanks for that suggestions. I was in hurry about posting the code so I didn't notice that kind of typos.

Posted

There's a lot of improvements to do :

* all commands use the same checks so you can reduce amount of produced code (using for example if (command.startsWith("clan"))

* the skills array is from 370 to 391 so you can use old school for loop to avoid to store anything (not needed to store stuff which can be easily guessed).

* as said SweeTs the clan check makes the whole code broken.

* as said xdem you should check if you can destroy the item before trying to "reward" for the given action, otherwise it's a big exploit. xdem code got also a problem btw.

 

yes, I made that mistake cause I used his code, I gave the skill and then I asked for the price, what a dumb

  • 2 months later...
Posted

327Rev>

 

not tested ( i just fix the build error about 

  1. -import net.sf.l2j.gameserver.templates.chars.L2NpcTemplate;

 

with that

  1. +import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;

 

and that 

  1. -       public L2ClanManagerInstance(int objectId, L2NpcTemplate template)

 

with that

  1. +       public L2ClanManagerInstance(int objectId, NpcTemplate template)

 

 

/*
 * 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 net.sf.l2j.gameserver.model.actor.instance;
 
import net.sf.l2j.gameserver.datatables.SkillTable;
import net.sf.l2j.gameserver.model.L2Skill;
import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
 
/**
 * @author Devlin
 *
 */
public class L2ClanManagerInstance extends L2NpcInstance
{
       public L2ClanManagerInstance(int objectId, NpcTemplate template)
       {
               super(objectId, template);
       }
      
    @Override
    public void showChatWindow(L2PcInstance player, int val)
    {
        player.sendPacket(ActionFailed.STATIC_PACKET);
        String filename = "data/html/mods/clanManager.htm";
        NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
        html.setFile(filename);
        html.replace("%objectId%", String.valueOf(getObjectId()));
        player.sendPacket(html);
    }
      
       public int itemId = 57;
       public int itemCountLevelUp = 15;
       public int itemCountReputationPoints = 15;
       public int itemCountClanSkills = 20;
       public int clanLevel = 8;
       public int clanReputationScore = 30000;
      
       public int[] clanSkills =
       {
               370,
               371,
               372,
               373,
               374,
               375,
               376,
               377,
               378,
               379,
               380,
               381,
               382,
               383,
               384,
               385,
               386,
               387,
               388,
               389,
               390,
               391
       };
      
       @Override
       public void onBypassFeedback(L2PcInstance player, String command)
       {
               if (command.equals("clanLevelUp"))
               {
                       if (player.getClan() != null)
                       {
                               player.sendMessage("You don't have a clan.");
                               return;
                       }
                      
                       if (!player.isClanLeader())
                       {
                               player.sendMessage("You aren't the leader of your clan.");
                               return;
                       }
                      
                       if (player.getInventory().getItemByItemId(itemId).getCount() > itemCountLevelUp)
                       {
                               player.sendMessage("You don't have enough items.");
                               return;
                       }
                      
                       player.getClan().changeLevel(player.getClan().getLevel() + clanLevel);
                       player.getClan().broadcastClanStatus();
                       player.getInventory().destroyItemByItemId("Init.", itemId, itemCountLevelUp, player, player);
                       player.sendMessage("Your clan's level has been changed to "+player.getClan().getLevel());
               }
              
               else if (command.equals("clanReputationPoints"))
               {
                       if (player.getClan() != null)
                       {
                               player.sendMessage("You don't have a clan.");
                               return;
                       }
                      
                       if (!player.isClanLeader())
                       {
                               player.sendMessage("You aren't the leader of your clan.");
                               return;
                       }
                      
                       if (player.getInventory().getItemByItemId(itemId).getCount() > itemCountReputationPoints)
                       {
                               player.sendMessage("You don't have enough items.");
                               return;
                       }
                      
                       player.getClan().addReputationScore(clanReputationScore);
                       player.getClan().broadcastClanStatus();
                       player.getInventory().destroyItemByItemId("Init.", itemId, itemCountReputationPoints, player, player);
                       player.sendMessage("Your clan's reputation score has been changed to "+player.getClan().getReputationScore());
               }
              
               else if (command.equals("clanSkills"))
               {
                       if (player.getClan() != null)
                       {
                               player.sendMessage("You don't have a clan.");
                               return;
                       }
                      
                       if (!player.isClanLeader())
                       {
                               player.sendMessage("You aren't the leader of your clan.");
                               return;
                       }
                      
                       if (player.getInventory().getItemByItemId(itemId).getCount() > itemCountClanSkills)
                       {
                               player.sendMessage("You don't have enough items.");
                               return;
                       }
                      
                       for (int s : clanSkills)
                       {
                               L2Skill clanSkill = SkillTable.getInstance().getInfo(s, SkillTable.getInstance().getMaxLevel(s));
                               player.getClan().addNewSkill(clanSkill);
                               player.getClan().broadcastClanStatus();
                               player.getInventory().destroyItemByItemId("Init.", itemId, itemCountClanSkills, player, player);
                               player.sendMessage("Your clan has learned all clan skills.");
                       }
               }
       }
}
Posted (edited)

 

Haha this one is the best :happyforever:  Surely you wanted to write == :P

    +                       if (player.getClan() != null)
    +                       {
    +                               player.sendMessage("You don't have a clan.");
    +                               return;
    +                       }

he want to say if clan is different than Nothing then you don't have a clan he is right <3 xD

Edited by WolfGiaS3na
Guest
This topic is now closed to further replies.


  • Posts

    • SPECIAL OFFER UNTIL 31 JUNE.   150euro, don't miss it.
    • OFFER UNTIL 31 JUNE   Complete Server Pack + Source Files:   C4 Scions Of Destiny: P656 Retail X1 L2OFF Server Pack + Source: Price: 100EUR   C4 Scions Of Destiny: P656 ESL2 Athena x45 L2OFF Server Pack + Source: Price: 100EUR Screenshots: https://imgur.com/a/eternal-sin-l2-athena-x45-c4-WYCpbjl   C6 Interlude: P746 ESL2 Athena x45 L2OFF Server Pack + Source: Price: 100EUR The same as C4 but in C6 Client so the Screenshots is the same: https://imgur.com/a/eternal-sin-l2-athena-x45-c4-WYCpbjl   C6 Interlude: P746 L2Gold L2OFF Server Pack + Source: Price: 100EUR Screenshots: https://imgur.com/a/9kB3oA9   C6 - Classic Interlude: P110 ESL2 Athena x45 L2OFF Server Pack + Source: Price: 200EUR Screenshots: https://imgur.com/a/Z2kZxuv   Contact me here via PM (only serious buyers).    Payments via: - Paypal (Friends and Family)
    • Hey everyone! I’m giving away 5 lifetime licenses for my newly developed pixel bot – perfect for Lineage 2 and similar games. The bot automates combat, buffing, and other in-game actions with an easy GUI and advanced Telegram-based license control.   NOTE: You’ll need an Arduino Leonardo (or compatible HID device) for this bot to work! This is what makes the keypresses undetectable and safe from game protection. ✅ Features: Fully external (no memory injection, no bans) Works with Arduino Leonardo as HID keyboard Easy step-by-step GUI (no coding needed) Buffs, attack, targeting automation Bypasses most modern kernel anticheats Lifetime license, Telegram-based anti-piracy 💡 How To Get A Free License? Just reply here or send me a PM with: Why you want to try the bot What server you’ll use it on First 5 users get a free lifetime license! 💬 Contact: Telegram: @LetoKanaleto Questions? Ask here or PM me. Setup help provided!   VirusTotal https://www.virustotal.com/gui/file/472510b9271a31908bd29a620988e74f67e1f1c783ac1cac80f89cc187c3793d/detection https://www.virustotal.com/gui/file/006a5a4b5c4fc369300ed44f250df5776f0b2a863de44242d2916c0b455772c5/detection   Mega: https://mega.nz/file/m8MzRbLR#VUZ21msDcwfk5o_5CtCBC7KL6iZkXAlUSPLb5kw3v0A Google: https://drive.google.com/file/d/11X0eISEFa63EhKcZwaVwDAMibAWbzaQv/view?usp=sharing
    • 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 TreZzoR account 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  Xthor 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 Bithorlo 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 Hellastz 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 Casa-Torrent (Teamctgame) 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 Megamixtracker account T.ceskeforum account Peeratiko.org account Zamunda.se account Central-torrent.eu account h-o-d.org account Hdturk.club 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 Jme-reunit3d account Ptchina invite Lesaloon account Exyusubs account Therebels.tv account Ubits.club invite Zmpt.cc account Turktorrent.us account Dasunerwarte account Funsharing account Hawke.uno account Monikadesign account Theoldschool.cc invite Fearnopeer account Alpharatio account Wukongwendao.top account Chinapyg account Azusa.wiki account Yggtorrent.top account Movies Trackers : 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 HD Trackers : 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 Blutopia 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 invite 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 E-Learning Trackers : 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 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 Gaming Trackers : Mteam.fr account BitGamer invite Retrowithin invite Gamegamept invite Cartoon/Anime/Comic Trackers : U2.dmhy account CartoonChaos invite Animetorrents account Nyaa.si 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 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 Software/Apps Trackers : Ianon account Brokenstones account Appzuniverse invite Teamos.xyz 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 NZB : 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 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
    • L2 AARON - ADVERTISTING BANNERS     L2 AMBROSIAL - ANIMATED BORDER Portfolio - protojahdesigns.com You can also join Protojah Designs Discord
  • Topics

×
×
  • Create New...

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