Jump to content
  • 0

Add pages to droplist.


Question

Posted

l2jfrozen 1004 interlude.

So I added this code:

 

But when drops are too many I get the usual error Html is too long try using DB for this action.

So I want to add pages for it but I dont have a clue what I am doing.

These are the codes Im trying to follow:
https://pastebin.com/pCEGRBLR

https://pastebin.com/6hdGbztm

 

I dont know if I even add the lines to the correct java .
This is what I have done in the RequestBypassToServer.java.

 

https://pastebin.com/23quwrAC

 

 

 

Recommended Posts

  • 0
Posted

try this maybe it will work:

else if (_command.startsWith("DropListNpc"))
            {              
                private static void showItemsPage(Player activeChar, int page)
                {
                final L2Object object = activeChar.getTarget();
               
                int MaxItemsPerPage = 10;
                int MaxPages = _itemssize / maxItemsPerPage;
                if (_itemssize > MaxItemsPerPage * MaxPages)
                    MaxPages++;
               
           
                if (page > MaxPages)
                    page = MaxPages;
               
                int ItemsStart = MaxItemsPerPage * page;
                int ItemsEnd = _itemssize();
                if (ItemsEnd - ItemsStart > MaxItemsPerPage)
                    ItemsEnd = ItemsStart + MaxItemsPerPage;
               
                if (object instanceof L2NpcInstance)
                {
                    NpcHtmlMessage html = new NpcHtmlMessage(0);
                    StringBuilder html1 = new StringBuilder("<html>");
                   
                    html1.append("<title>Npc Name: " + object.getName() + "</title>");
                    html1.append("<body>");
                    html1.append("<br>");
                    html1.append("<table cellspacing=2 cellpadding=1 width=\"280\">");
                   
                    if (((L2NpcInstance) object).getTemplate().getDropData() != null)
                    {
						int myPage = 1;
						int i = 0;
						int shown = 0;
						boolean hasMore = false;

                        for (L2DropCategory cat : ((L2NpcInstance) object).getTemplate().getDropData())
                        {
							if (shown == MaxItemsPerPage)
							{
							hasMore = true;
							break;
							}
                            for (L2DropData drop : cat.getAllDrops())
                            {
                                final L2Item item = ItemTable.getInstance().getTemplate(drop.getItemId());
                               
                                if (item == null)
                                    continue;
								
								if (myPage != page)
								{
								i++;
								if (i == MaxItemsPerPage)
								{
								myPage++;
								i = 0;
								}
								continue;
								}
					
								if (shown == MaxItemsPerPage)
								{
								hasMore = true;
								break;
								}
								
                                int mind = 0, maxd = 0;
                                String smind = null, smaxd = null;
                                String name = item.getName();
                                if (cat.isSweep())
                                {
                                    mind = (int) (Config.RATE_DROP_SPOIL * drop.getMinDrop());
                                    maxd = (int) (Config.RATE_DROP_SPOIL * drop.getMaxDrop());
                                }
                                else if (drop.getItemId() == 57)
                                {
                                    mind = 300 * drop.getMinDrop();
                                    maxd = 300 * drop.getMaxDrop();
                                }
                                else
                                {
                                    mind = (int) (Config.RATE_DROP_ITEMS * drop.getMinDrop());
                                    maxd = (int) (Config.RATE_DROP_ITEMS * drop.getMaxDrop());
                                }
                                if (mind > 999999)
                                {
                                    DecimalFormat df = new DecimalFormat("###.#");
                                    smind = df.format(((double) (mind)) / 1000000) + " KK";
                                    smaxd = df.format(((double) (maxd)) / 1000000) + " KK";
                                }
                                else if (mind > 999)
                                {
                                    smind = ((mind / 1000)) + " K";
                                    smaxd = ((maxd / 1000)) + " K";
                                }
                               
                                else
                                {
                                    smind = Integer.toString(mind);
                                    smaxd = Integer.toString(maxd);
                                }
                                if (name.startsWith("Common Item - "))
                                {
                                    name = "(CI)" + name.substring(14);
                                }
                                if (name.length() >= 34)
                                {
                                    name = name.substring(0, 30) + "...";
                                }
                                html1.append("<tr>");
                                html1.append("<td valign=top align=center height=38 width=40><img src=\"" + getIcon(item.getItemId()) + "\" height=32 width=32></td>");
                                html1.append("<td>");
                                html1.append("<table cellpadding=0 cellspacing=1 width=237>");
                                html1.append("<tr>");
                                html1.append("<td>" + (drop.getChance() >= 10000 ? (double) drop.getChance() / 10000 : drop.getChance() < 10000 ? (double) drop.getChance() / 10000 : "N/A") + "% is " + (drop.isQuestDrop() ? "<font color=\"00b3b3\">[Quest]</font>" : (cat.isSweep() ? "<font color=\"009900\">[Spoil]</font> " : "[Drop]")) + "</td>");
                                html1.append("</tr>");
                                html1.append("<tr>");
                                html1.append("<td>Name: <font color=fff600>" + name + "</font> " + (maxd == 1 ? "[1]" : "[" + smind + " - " + smaxd + "]") + "</td>");
                                html1.append("</tr>");
                                html1.append("</table>");
                                html1.append("</td>");
								shown++;
                            }
                        }
                    }
                    for (int x = 0; x < MaxPages; x++)
                    {
                        int pagenr = x + 1;
                        if (page == x)
                        {
                            pages += "<td>Page " + pagenr + "</td>";
                        }
                        else
                        {
                            pages += "<td>something " + something() + " " + x + "\">Page " + pagenr + "</a></td>";
                        }
                    }
                    }
                   
                    html1.append("</tr></table>");
                    html1.append("</body>");
                    html1.append("</html>");
                   
                    html.setHtml(html1.toString());
                    activeChar.sendPacket(html);
                   
                    html1 = null;
                    html = null;
                }
               
            }

 

  • 0
Posted
34 minutes ago, wongerlt said:

else if (_command.startsWith("DropListNpc"))

{

     private static void showItemsPage(Player activeChar, int page)

     {

:dat:

  • 0
Posted (edited)

You are doing it wrong guys.

 

First of all you have to create an interface in the MMOCore and implement it's functions in the drop list system. In short: when an NPC happen to have bad drop, the MMOCore should stop the packet communication for all players.

 

Additionally you can include System.exit(-1); to grand boss drops.

Edited by lord_rex
  • Haha 1
  • 0
Posted
30 minutes ago, lord_rex said:

You are doing it wrong guys.

 

First of all you have to create an interface in the MMOCore and implement it's functions in the drop list system. In short: when an NPC happen to have bad drop, the MMOCore should stop the packet communication for all players.

 

Additionally you can include System.exit(-1); to grand boss drops.

 

wnv7r.jpg

  • Haha 1
  • Upvote 2
  • 0
Posted (edited)
On 2/10/2019 at 7:34 PM, wongerlt said:

try this maybe it will work:

 

What did you change?

On 2/10/2019 at 8:08 PM, SweeTs said:

:dat:

 

On 2/10/2019 at 11:32 PM, melron said:

https://pastebin.com/XahC0b9d

 

Take a look there. im using acis bookmarks code as a base to generate pages

 

I can see my mistake in the first line , I guess I have to add them like this:

 


			private static void showItemsPage(Player activeChar, int page)
			{				
				if (_command.startsWith("DropListNpc"))
				{

 

On 2/10/2019 at 11:54 PM, lord_rex said:

You are doing it wrong guys.

 

First of all you have to create an interface in the MMOCore and implement it's functions in the drop list system. In short: when an NPC happen to have bad drop, the MMOCore should stop the packet communication for all players.

 

Additionally you can include System.exit(-1); to grand boss drops.

I dont understand you.

 

 

I really need some help here, can someone help me via  anydesk/tv?

Edited by sotid
  • 0
Posted

if it was to guess this

  1. else if (_command.startsWith("DropListNpc"))
  2.             {

is to go in the command handler and the rest of the method to be called inside.

 

  • 0
Posted
17 hours ago, DenArt Designs said:

if it was to guess this

  1. else if (_command.startsWith("DropListNpc"))
  2.             {

is to go in the command handler and the rest of the method to be called inside.

 

the code added doesnt seem to have any changes to any handler.

where exactly do you mean?

  • 0
Posted

Bcs all is already said. Admin bookmark has code rdy code. All you have to change is the htm display.. Which you already have from original code. So.. Put puzzles together.

  • 0
Posted (edited)
5 hours ago, SweeTs said:

Bcs all is already said. Admin bookmark has code rdy code. All you have to change is the htm display.. Which you already have from original code. So.. Put puzzles together.

So am I adding the code to the right place? lets start from that..

 

If yes then one more Question .

This:

if (_command.startsWith("DropListNpc"))


I think is inside this:

 

 

protected void runImpl()
    {
        L2PcInstance activeChar = getClient().getActiveChar();

        if(activeChar == null)
            return;

        if (!getClient().getFloodProtectors().getServerBypass().tryPerformAction(_command))
            return;
        

        try
        {
          			
                    .
                    .
                    .
               if (_command.startsWith("DropListNpc"))

 

To start something like this :

private static void showItemsPage(Player activeChar, int page)

or

public boolean useAdminCommand(String command, Player activeChar)

I have to start in a new line outside the {} of the code?
Also what admincommands have anything to do with it , this code will be for players.

Edited by sotid
  • 0
Posted

What the heck man...

 

RequestBypassToServer.java

 


        else if (_command.startsWith("dropinfo"))
        {
            final StringTokenizer st = new StringTokenizer(_command, " ");
            st.nextToken();
            
            try
            {
                int npcId = Integer.parseInt(st.nextToken());
                int page = (st.hasMoreTokens()) ? Integer.parseInt(st.nextToken()) : 1;
                
                showNpcDropList(player, npcId, page);
            }
            catch (Exception e)
            {
                LOGGER.warn("Failed on dropinfo: {}", e);
            }
        }

 

I let you code the showNpcDropList. Hint, it's c/p of original method from admin command to show drop.. Once again, the code for pages you can find HERE. If you have latest aCis, use it as it's slighty modified.

 

Once again, you have ready solution. If you still fail additing it. Then well.. I would suggest to try harder or simply skip it and get back to it later. With clean head. Sometimes you need time to understand things.

  • 0
Posted

@baksteen are you serious? I just gave him a ready code.. Admin show drop view is all he ask for ++ icons. All he have to do now, is to edit the drop display? The text / htm display? Which is shared in initial topic he took the code?

 

Bcs I prefer to force him to learn a thing? You really think when I first time created my own code with pages, I asked for ready code? Hell no. I opened admin bookmark and simply copy the code. I am still doing it when I need pages... It's called logic.

 

He's about to open a server and he can't copy a ready code from other file. Ok, he don't have to, as I don't have to give him fully working code, why should I.

 

Can't find a solution? Ask to a friend to help you (@Kara`).

Don't have a friend to ask for help?

Well, pay someone for rdy code. I don't feel like to provide ready codes, I already gave him 90%.

 

No offense.

 

2 hours ago, baksteen said:

God damn, people nowadays monkaEyes

EXACTLY, you expect ready things, for free. When someone give you hints, give you almost ready code, you whine "OMG noob, give me full code".

 

Sounds legit.

 

lol_meme_postcard-ra61a3bd39cca4033872ab

  • 0
Posted (edited)

@baksteen Because the community is tragic, they don't want to learn either take help. 

They want to grab and open server and if they can use you, they will. You can't imagine how many times i've got tricked by idiots who spend 5 hours of my life telling that they wanted services and close a deal for tomorrow and in the end of conversation they just say they want help setup e.t.c and after the next day they don't respond.

 

Maxcheaters is not a forum that provide free codes, even stackoverflow don't do that. Maxcheaters offer either paid content or help. Now giving help does not mean give them full code cause 1.full code won't help 2. they will keep asking for more and its never ending 3.they just want to use you and no learn just take as i said. 

They don't even respect you at all. From my side just by today i have 2 people who added me, gave their codes and asked for fix - or ask for setup server and when i said i don't do anything free they obviously responded but why should i pay? 

So conslusion? majority are spoiled useless idiots behind a cheap PC who want to open frozen server and make money. Why should we help those? Whoever want to learn he just ask for advice or suggestion, no ask for full code.

 

SweeT's is right and in my opinion he shouldn't even respond, he should drop the topic. This is HELP section no REQUEST full code until i make my server for free

 

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


  • Posts

    • Hi everyone,   I'm looking for someone to create a website for me with a pale, whitish design, inspired by Talking Island. I also need an auto-updater and a Discord logo included.   I already have the domain and hosting set up on OVH, with PHP ready to go. However, I'm new to website development, so you may need to guide me through the installation process.   Please do not contact me if you're charging unreasonable prices like $800 for "VIP" packages — I'm looking for fair and realistic offers. Payment will be made once the job is completed.   If you have previous work to show, that's definitely a plus. The website, auto-updater, and Discord elements should all be in English.   Thanks!
    • Make your own topic. Don’t be so rude and post in mine just to sell your stuff 😉   @Celestine
    • Server Client: Server is running on custom Classic Interlude Client. Enjoy the innovations that classic offers to players while maintaining the stability of Interlude features that we all loved.   Birth of a new character A new character spawns in the basement of Ivory Tower. There, you can buff yourself  via AIO buffer and then teleport to a low level zone for xp. A new character starts  with full no grade gear and a newbie supply box. AIO npc Buffer There are AIO npc Buffers spawned in every town. The buffs’ duration is 1hour and  are free of charge. The only buffs that are not included in the list are summoner’s  buffs, third class dances, third class songs, and resists.    Class transfer When you hit level  20, 40 and 76, you can seek for the Class Changer Carola in Aden  or Castle Town  in order to perform your 1st , 2nd  and 3rd class change or simply use the .menu feature located in your character skills list. There are no further quests required. Boosted Buffers and Summoners In order to boost Prophets, Bladedancers and Swordsingers for PvP action and  Olympiad games, they have been given special self-buffs. All of these classes are  gifted with higher level buffs which they can be casted on themselves only. Also,  summoner classes are boosted since they can buff their pets with more than usual  servitor’s buffs  There are 4 main custom shops in the server where you can buy the following items: 1) Harvana (Misc Shop): Consumables 2) Albert (Weapon Shop): D, C, B and A grade weapons 3) Meredion (Armor Shop): D, C and B grade armor and jewels 4) Wilbrand (Mantra Manager): A/S armor, S grade weapons and more  Event Shop Event Shop Dianne can either be found in Aden Castle Town or Giran. You  can buy several useful items in exchange for Vote Coins or Event Medals.  Via  Event Shop Dianne you can have access to the following items: 1) Blessed Enchants 2) Books of Giants 3) Common and Custom Accessories 4)Raidbombs  and many more  Weapons’ Special Abilities The Special Abilities (SA) for every C, B and A grade weapons can be bestowed by  Mantra Manager Wilbrand in exchange for some animal bones, water mantras or wind  mantras respectively.    Rebirth System When you reach level 76, you can perform your first rebirth via Rebirth Manager.  Once you perform a rebirth, your character will be deleveled to level 40 and you will  obtain a book of rebirth. You can exchange the book of rebirth for a unique accesories  via Rebirth Manager. A character can have 3 rebirths maximum. Remember once  you have chosen your  rebirth skills, you can anytime change your mind and choose  your rebirths once again.  Noblesse system Once you have performed 3 rebirths, you need to collect a set of four crowns from the  following Raid Bosses: 1) Death Lord Hallate (Black Crown) 2) Kernon (Gold Crown) 3) Longhorn Golkonda (Red Crown) 4) Shilen’s Messenger Cabrio (Silver Crown)  Once you’ve collected all the crowns and your character is at level 76, you can talk to  the Noblesse Manager Eddy Wally, located in Aden Castle Town and become a Noblesse. Crown Raids Bosses’ respawn time is every 12 (±2) hours and have 1 spot Spawn spot: Giants Cave Unique L2Halcyon weapons and shields L2Halcyon weapons are S grade weapons with a unique SA. There are also three unique  L2Halcyon shields. Both of them can be dropped only by Raid Bosses. Remember you  can check the possible drops of any Raid Boss by pressing Shift+left click. Find  bellow more details regarding L2Halcyon items. Duals Crokian blade*Crokian blade: Increases Critical Attack by 95 and Accuracy by 6 Doll knife*Doll knife <-Daggers: Increases Atk. speed by 7% and Accuracy by 6 Swords Crokian Blade: Increases Atk. speed by 7% and Accuracy by 6 Sword of Apostle: Increases Accuracy by 6 and maximum HP by 25% Mage weapons Lady’s Fan: Increases Casting Spd. by 17.5% Dusk Staff: Increases Casting Spd. by 17.5% Dusk Sword: Increases M. Atk. by 15% Polearms Dreadbane: 360° hit rate, increases hit number from 4 to 8 and Accuracy by 6 Axe of Ketra: Increases Accuracy by 6 and P. Atk. by 265 during a critical attack Daggers Doll Knife: Increases Critical Attack by 95 and P. Atk. by 265 during a critical attack Giant Trident: Increases Evasion by 3 and P. Atk. by 265 during a critical attack 2-Handed Sword Sword of Vampire: Increases Critical Attack by 95 and maximum HP by 25% Blunt Cudgel: Increases Critical Attack by 95 and Atk. speed by 7% Bow Bow of Halisha: Increases Critical Attack by 95 and Accuracy by 6 Shields Shield of Reflect: Reflect magic debuffs and shield damage reflect Shield of Evasion: No evasion penalty and Speed +7 Dusk Shield: Bow resistance  Ancient L2Halcyon weapons Ancient L2Halcyon weapons can be obtained through refining the normal ones.  Unique L2Halcyon Jewels L2Halcyon Jewels are S grade Jewels which provide unique bonuses. They can be  dropped by specific Raid Bosses. Remember you can check the possible drops of any  Raid Boss by pressing Shift+left click. Find bellow the bonuses of L2Halcyon Jewels: -Earring of Garacsia: MP +31, +10% bow resistance and +7 speed -Earring of Ipos: MP +31, +10% dagger resistance and +7 speed -Earring of Kandra: MP +31, +20% wind resistance and +7 speed -Earring of Von Helman: MP +31, +20% dark resistance and +7 speed -Earring of Vermilion: MP +31, +20% fire resistance and +7 speed -Earring of Falston: MP +31, +20% water resistance and +7 speed -Ring of Horuth: MP +21 and +10% P.Def. -Ring of Mos: MP +21 and +10% M.Def. -Ring of Shadith: MP +21 and 500% HP regen -Ring of Tayr: MP +21 and +100 Bow Range -Necklace of Hekaton: MP +42 and +15% max CP -Necklace of Brakki: MP +42 and +60% resistance to most of the debuffs -Necklace of Naga: MP +42 and +15% max HP   Refining S grade armors/jewels Any S grade armor can be refined via Mantra Manager Wilbrand. S grade armors and  Tateossian jewels start at 55% and they can both be upgraded all the way up to 100%  in order to gain extra P.def or M.def. Once your armor reach 100%, you can transform  it into Apella and gain extra stats (Jewels cannot be further refined). In addition,  Apella armors start at 55% and can be upgraded up to 100% too. Then, you can  transform your Apella into Dynasty Armor or Ancient Apella depends on your preference (which can also be refined up to 100%).  Refining Epic Jewels (Core and Orfen) There is an option to refine Ring of Core and Earring of Orfen via Mantra Manager Wilbert. If you have two  Rings of Core, you can combine them and receive an  Enchanted Ring of Core. Then, you can combine two  Enchanted Rings of Core in order to create a Refined  Ring of Core (4 Rings of Core in total). The same  procedure can be applied to Earring of Orfen, in order  to create Enchanted Earring of Orfen or Refined  Earring of Orfen. In this case, the enchantment of the ring/earring will be reset, so do not enchant those epic jewels before refining.    Events: Korean TvT Squash Event Watermelon Event Raidboss Event Highrate    Features List is not the final and changes/additions can be made! Join us and say your ideas! WEBSITE: L2Halcyon Join our discord server for more information about the server development and also join access early to test features, and get a glimpse on what we are working on. Discord Server 
    • https://l2halcyon.com join discord server , you can actually get access to test. Classic Interlude.
    • Dear friends, right now we are holding a grand competition with a prize fund of more than $ 1000 in our stores https://socnet.store , telegram store: https://socnet.shop and SMM panel: https://socnet.pro There are more than 50 prize places in our competition, each lucky person can take one of the places. Important condition: you must make a purchase at any time before June 1, 2025. The more purchases you make - the more chances you have to win the main prize in the community of $ 300! ➡ Our Online Shop: socnet.store ✅ ➡ Our SMM-Boosting Panel: socnet.pro ✅ ➡ Telegram Shop Bot: socnet.shop ✅ ➡ Telegram Support: https://t.me/solomon_bog ✅ ➡ Telegram Channel: https://t.me/accsforyou_shop ✅ ➡ Discord Support: @AllSocialNetworksShop ✅ ➡ Discord Server: https://discord.gg/y9AStFFsrh ✅ ➡ WhatsApp Support: 79051904467✅ ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n ✅ ➡ Email Support: solomonbog@socnet.store ✅
  • 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