Jump to content
  • 0

Java Code Addaption To Acis Request.


Question

Posted (edited)

Hello guys i want this feature so bad and if someone could adapt it for acis i will be glad take a look at the code below.

package handlers.voice;

import javolution.text.TextBuilder;
import ru.la2bygaga.gameserver.datatables.NpcTable;
import ru.la2bygaga.gameserver.handler.IVoicedCommandHandler;
import ru.la2bygaga.gameserver.handler.VoicedCommandHandler;
import ru.la2bygaga.gameserver.instancemanager.GrandBossManager;
import ru.la2bygaga.gameserver.model.actor.instance.L2PcInstance;
import ru.la2bygaga.gameserver.model.entity.GrandBossState;
import ru.la2bygaga.gameserver.network.serverpackets.NpcHtmlMessage;

public class GrandBossSpawn implements IVoicedCommandHandler {

    private static final int[] BOSSES = {29001, 29006, 29014, 29019, 29020, 29022, 29028, 29045};
                                  // QueenAnt, Core, Orfen, Antharas, Baium, Zaken, Valakas, Frintezza
    private static final String [] VOICED_COMMANDS = {"epic"};

    @Override
    public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target) {
        if (activeChar == null) {
            return false;
        }
        if (command.startsWith("epic")) {
            NpcHtmlMessage epic = new NpcHtmlMessage(5);
            TextBuilder html = new TextBuilder("<html><body><br>");
            html.append("<html><title>Grand Boss Info By Dleogr</title><body><br><center>");
            html.append("<img src=\"legen.logogo\" width=231 height=76><br><br>");

            for (int bossid : BOSSES) {
                String name = NpcTable.getInstance().getTemplate(bossid).getName();
                
                long delay = GrandBossManager.getInstance().getGrandBossRespawnDate(bossid);
                GrandBossState.StateEnum state = GrandBossManager.getInstance().getGrandBossSpawnState(bossid);
                html.append("<font color=\"00C3FF\">" + name + "</font>: <font color=\"");
                switch (state) {
                    case NOTSPAWN:
                        html.append("FFFFFF\">Sleep/Not spawn</font>" + "<br1>"); //Спит или не заспавнен
                        break;
                    case ALIVE:
                        html.append("9CC300\">Is Alive</font>" + "<br1>"); //Живой
                        break;
                    case DEAD:
                        html.append("FFFFFF\">Is Dead </font>" + "<br1>"); //Вот-вот умер
                        break;
                    case INTERVAL:
                        if (System.currentTimeMillis() < delay) { // Мертв
                            int hours = (int) ((delay - System.currentTimeMillis()) / 1000 / 60 / 60);
                            if (hours < 10) {
                                int mins = (int) (((delay - (hours * 60 * 60 * 1000)) - System.currentTimeMillis()) / 1000 / 60);
                                html.append("FFFFFF\">Respawn in:</font><font color=\"32C332\"> " + hours + " ч. " + mins + " мин.</font><br1>");
                            } else {
                                html.append("FFFFFF\">Is Dead</font><br1>"); //Еще мертв
                            }
                        } else {
                            html.append("9CC300\">Is Now Alive</font><br1>"); // Ожил (delay = currentUnixTime) 
                        }                                                           // либо delay < currentUnixTime но флаг INTERVAL еще не снят
                        break;                                                      // TODO: Проверить, возможно ли такое вообще
                    case SLEEP:
                        html.append("FFFFFF\">Sleep</font>" + "<br1>"); // Точно спит
                        break;
                    case UNKNOWN:
                        html.append("FFFFFF\">Unknown</font>" + "<br1>"); // Хз как так - проверь БД grandboss_intervallist
                        break;
                }
            }

            html.append("<br><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>");
            html.append("</center></body></html>");

            epic.setHtml(html.toString());
            activeChar.sendPacket(epic);
            return true;
        }
        return false;
    }
    
    @Override
    public String getDescription(String command) {
        if (command.equals("epic")) {
            return "Показать статус Эпик Босов";
        }
        return null;
    }
    
    @Override
    public String[] getVoicedCommandList() {
        return VOICED_COMMANDS;
    }
    
    public static void main(String[] args) {
        VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new GrandBossSpawn());
    }
}
Edited by Sawadee

8 answers to this question

Recommended Posts

  • 0
Posted

3 lines to addapt :p

One method to remove

 

public static void main(String[] args) {

VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new GrandBossSpawn());

And register file in voicedcommandhandler.java

  • 0
Posted

i doubt you want a code that every player can easily spam this command and fuck your srv...

 

OnTopic:

 

Isnt that hard to adapted. if i have time i will do it 

  • 0
Posted

I think its need other part of code, because l2jacis don't have  GrandBossState

It haven't boss state as enum state but there is getBossStatus as integer... The only thing you have to do is define status like alive =1 etc and adapt the other part

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

    • <dailyReward days="28" autoOpen="true" minimumOnlineTimeSeconds="30" oneRewardPerIP="true" resetIfMissDay="true">   For now, I have these settings in the XML—this is the V1 version I created, though I plan to make further improvements over time. Of course, I’ll also add more protections—MAC, HWID, and perhaps others like account-based restrictions—to make it more secure. We can also implement non-tradable items to further enhance the system's security. I’ll keep posting updates and refining both the system and the interface. I might make a video tomorrow; if you look at the top, you'll see the "auto-open" feature can be toggled on or off, allowing users to rely solely on the `.daily` command. Cheers! Note: If I sell it in this state, I’ll provide support and roll out updates to users. I’m not forcing anyone to buy anything; I’d even provide the patch files so that anyone with the necessary skills can add features, modify it, or improve it further.
    • If the problem is that the target is lost, the action of aiming at another character, upon losing collision, does not allow aiming.   This one works as it should, allowing you to target characters
    • MICROTEXT AND WATERMARKS BREAK MOST RENDERINGS Microtext and watermarks aren’t just small decorative details. They are one of the most common reasons a document fails verification, even when it looks decent at first glance. The issue is that these elements are almost impossible to reproduce “by eye.” Microtext requires precise geometry and legibility at a very small size, while a watermark needs the correct density, transparency, and accurate placement relative to other security features. Any deviation becomes obvious during detailed inspection. ▪ What’s most often done wrong: - microtext is drawn too thick or blurry - the watermark is made either too visible or almost invisible - the positioning between microtext and watermark is ignored - the original printing technology isn’t taken into account when choosing density and shape - The stronger the document’s security features, the less room there is for approximation. What matters here isn’t visual similarity, but accurate reproduction of the original technical characteristics. If your document contains microtext and watermarks, this is always an area that requires extra attention. Write to us in DMs. We’ll review your case and point out exactly which details need the highest precision during rendering. › TG: @mustang_service_ms ( https:// t.me/ mustang_service_ms ) › Channel: Mustang Service ( https:// t.me/ +JPpJCETg-xM1NjNl ) #drawing #microtext #photoshop #editing #watermarks
    • GoldRush launches tomorrow! July 18 16:00 GMT+3 Europe / International Register your account in the website, connect wallet and be ready to dominate!
  • 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..