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

    • GoldRush launches tomorrow! July 18 16:00 GMT+3 Europe / International Register your account in the website, connect wallet and be ready to dominate!
    • 🏰 L2EXALTA LEGACY — Interlude x45 📅 Grand Opening: 31/07/2026 — 21:30 (GMT+3) 🌐 Website: https://l2exalta.org/ 💬 Discord: https://discord.gg/zNTCZD4AcT 📌 Wiki: https://l2exalta.org/en/wiki.html#progression   ⚙️ MAIN INFO Chronicle : Interlude Rates : x45 Adena : x50 Spoil : x1 Drop : x5 Safe Enchant : +3 Files : L2OFF   💰 ECONOMY EX Coin : dynamic market currency, mined from monsters, Raid Bosses and Grand Bosses value fluctuates over time Exalta Vouchers : premium currency used for store, donations and EX Coin exchange Exchange : convert EX Coin into Exalta Vouchers Investment options : choose safer or riskier market strategies with EX Coin   ⚔️ PROGRESSION & GEAR Exalta Armors : signature top-tier gear line Forge System : upgrade weapons, armor and jewels with risk/reward mechanics Raid Boss progression tied to materials and prestige   🤖 AUTOFARM Access : Auto Hunting button, bottom-right UI Duration : controlled via tickets or in-game currency Route Mode : record custom farm routes Support Mode : healer/support builds auto-follow, heal and assist party Smart targeting logic with class-specific behavior (mage/archer/melee/support) Captcha designed not to interrupt legitimate AutoFarm sessions   🧪 BUFFER Exalta Buffer NPC/interface Scheme Buffer : save multiple buff loadouts Class presets for mage, fighter, support, PvP   🛠️ SMART GADGETS / QOL Autoloot filter Drop value tracker Boss timer tools Farm stats tracker Auto-consume system In-game server assistant   🗺️ DUNGEON FINDER / PVE Party matching with roles (Tank / Healer / DPS) Ready-check before teleport Monastery of Silence custom PvE zone Party-based reward structure   🎟️ DAILY PROGRESS / EXALTA PASS Daily and weekly tasks (farm, PvP, boss, check-in) Premium Pass track with extra rewards Monastery Daily Quest Reward boards for claiming progress   🏠 HOUSING & EXPEDITIONS Player residences with service NPCs Exalta Spirit Expeditions to themed territories Rewards vary by territory Owner-only access   🏆 PVP / TOURNAMENT Scheduled Tournament system Ranking points from wins/participation Spectator Mode for watching live matches PvP Statues for top-ranked players Anti-feed protections   🛡️ CLAN CONTENT Clan Civil War battlefield event Clan Dungeon Raid content DPS Meter for contribution tracking Support Credit system Classic siege/clan politics preserved   🏪 AUCTION / SHOPS Auction House with seller fee Black Market Dealer (limited-time special offers) Custom shops and multisells Confirmation prompts on purchases/sales   💳 DONATIONS / VIP Donation rewards linked to Exalta Vouchers VIP tiers with comfort/cosmetic bonuses Premium store Gift/promo codes for events   🎥 STREAMER / COMMUNITY Streamer Panel with visible stream links Viewer rewards system Streamer Points for cosmetics/vouchers In-game voice chat (global/party/clan/alliance/command)   🔒 FAIR PLAY Strong Anti-Bot protection Reward protection tied to valid client state Captcha on suspicious activity Staff investigation tools No bots, packet tools or modified clients allowed   👑 GRANDBOSS SPAWNS Orfen : 1 day + 1h random Core : 1 day + 1h random Queen Ant : 1 day 6h + 1h random Zaken : 2 days 12h + 1h random Baium : 5 days + 1h random Antharas : 8 days + 1h random Valakas : 11 days + 1h random   🏅 OLYMPIAD Runs Thursday, Friday, Saturday Heroes change monthly Balanced and fair matchmaking
    • yup basically another one just in case https://drive.google.com/file/d/1UtccbD9e50x3WEnQBab2PTZnBHwpcGYM/view?usp=sharing LineageWarrior.FMagic (CollideActors = True; > False) LineageWarrior.FOrc (CollideActors = True; > False) LineageWarrior.FShaman (CollideActors = True; > False) LineageWarrior.MDarkElf (CollideActors = True; > False) LineageWarrior.MDwarf (CollideActors = True; > False) LineageWarrior.MElf (CollideActors = True; > False) LineageWarrior.MFighter (CollideActors = True; > False) LineageWarrior.MMagic (CollideActors = True; > False) LineageWarrior.MOrc (CollideActors = True; > False) LineageWarrior.MShaman (CollideActors = True; > False) LineageWarrior.FDwarf (CollideActors = True; > False) LineageWarrior.FElf (CollideActors = True; > False) LineageWarrior.FFighter (CollideActors = True; > False)
    • @l2naylondev Requiring a player to log in just for the sake of logging  seems exploitable. Someone could log in only to claim the reward and immediately leave, or repeatedly change their ip. So i guess  are there are additional protections in place ? such as locking the reward by account, character , and ip. It would also be useful to add a playtime requirement. For example, after logging in, the player would need to remain active for at least x playtime  before getting the reward or other parameters configurable by the xml.  I suggest improving the system before selling it. 
  • 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..