Jump to content

Recommended Posts

Posted (edited)

there a lot of posts like this but anyway ;D

u use .castle command and it shows up a html with all the castles so u can join in a siege

 

gameserver/handler/voicedcommandhandlers

 

create this

package com.l2jfrozen.gameserver.handler.voicedcommandhandlers;

import javolution.text.TextBuilder;

import com.l2jfrozen.gameserver.handler.IVoicedCommandHandler;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage;

/**
 * @author te0x
 */
public class CastleManagersVCmd implements IVoicedCommandHandler
{
       private static final String[] VOICED_COMMANDS =
       {
               "castle",
       };
      
       @Override
       public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
       {
               if (command.startsWith("castle")) {
                       sendHtml(activeChar);
               }
               return true;
       }
      
       private void sendHtml(L2PcInstance activeChar)
       {
TextBuilder tb = new TextBuilder();
NpcHtmlMessage html = new NpcHtmlMessage(1);

tb.append("<html><head><title>Castle Manager</title></head>");
tb.append("<body>");      
tb.append("<center>");
tb.append("<table width=\"250\" cellpadding=\"5\" bgcolor=\"999999\">");
tb.append("<tr>");
tb.append("<td align=\"center\"><font color=\"FF4400\">Castles Panel</font>");
tb.append("<br1><font color=\"333333\">An easy way to participate in a castle siege</font>");
tb.append("<br1><font color=\"333333\">Be the Ruler!</font></td>");
tb.append("</tr>");
tb.append("</table>");
tb.append("</center>");
tb.append("<br>");
tb.append("<img src=\"l2ui.squaregray\" width=\"300\" height=\"1\">");
tb.append("<br>");
tb.append("<center>");
tb.append("<button value=\"Giran\" action=\"bypass -h giran\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\">");
tb.append("<table>");
tb.append("<tr><td><button value=\"Aden\" action=\"bypass -h aden\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td><td><button value=\"Rune\" action=\"bypass -h rune\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td></tr>");
tb.append("<tr><td><button value=\"Goddard\" action=\"bypass -h goddard\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td><td><button value=\"Schuttgart\" action=\"bypass -h schuttgart\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td></tr>");
tb.append("<tr><td><button value=\"Oren\" action=\"bypass -h oren\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td><td><button value=\"Innadril\" action=\"bypass -h innadril\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td></tr>");
tb.append("<tr><td><button value=\"Dion\" action=\"bypass -h dion\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td><td><button value=\"Gludio\" action=\"bypass -h gludio\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td></tr>");
tb.append("</table>");
tb.append("</center>");
tb.append("<br>");
tb.append("<center>");
tb.append("<img src=\"l2ui_ch3.herotower_deco\" width=256 height=32><br>");
tb.append("</center>");
tb.append("<center>");
tb.append("</center>");
tb.append("</body></html>");

html.setHtml(tb.toString());
activeChar.sendPacket(html);
       }
      
       @Override
       public String[] getVoicedCommandList()
       {
               return VOICED_COMMANDS;
       }
} 

now network/clientpackets/RequestBypassToServer.java

put the import 


import com.l2jfrozen.gameserver.network.serverpackets.SiegeInfo;

import com.l2jfrozen.gameserver.managers.CastleManager;

import com.l2jfrozen.gameserver.model.entity.siege.Castle;

 

find this

			else if (_command.startsWith("OlympiadArenaChange"))
			{
				Olympiad.bypassChangeArena(_command, activeChar);
			}

below add these

			else if (_command.startsWith("gludio"))
			{
				int castleId = 1;
                Castle castle = CastleManager.getInstance().getCastleById(castleId);
                activeChar.sendPacket(new SiegeInfo(castle));
			}
			else if (_command.startsWith("dion"))
			{
				int castleId = 2;
                Castle castle = CastleManager.getInstance().getCastleById(castleId);
                activeChar.sendPacket(new SiegeInfo(castle));
			}
			else if (_command.startsWith("giran"))
			{
				int castleId = 3;
                Castle castle = CastleManager.getInstance().getCastleById(castleId);
                activeChar.sendPacket(new SiegeInfo(castle));
			}
			else if (_command.startsWith("oren"))
			{
				int castleId = 4;
                Castle castle = CastleManager.getInstance().getCastleById(castleId);
                activeChar.sendPacket(new SiegeInfo(castle));
			}
			else if (_command.startsWith("aden"))
			{
				int castleId = 5;
                Castle castle = CastleManager.getInstance().getCastleById(castleId);
                activeChar.sendPacket(new SiegeInfo(castle));
			}
			else if (_command.startsWith("innadril"))
			{
				int castleId = 6;
                Castle castle = CastleManager.getInstance().getCastleById(castleId);
                activeChar.sendPacket(new SiegeInfo(castle));
			}
			else if (_command.startsWith("goddard"))
			{
				int castleId = 7;
                Castle castle = CastleManager.getInstance().getCastleById(castleId);
                activeChar.sendPacket(new SiegeInfo(castle));
			}
			else if (_command.startsWith("rune"))
			{
				int castleId = 8;
                Castle castle = CastleManager.getInstance().getCastleById(castleId);
                activeChar.sendPacket(new SiegeInfo(castle));
			}
			else if (_command.startsWith("schuttgart"))
			{
				int castleId = 9;
                Castle castle = CastleManager.getInstance().getCastleById(castleId);
                activeChar.sendPacket(new SiegeInfo(castle));
			}

propably there is a better way to do this but this works also ^^

 

dont forget to register the voicedcommand. thats all ;D

Edited by te0x
Posted (edited)

here gave the error would not have to create a method in pcinstance?

int castleId = 9;
                Castle castle = CastleManager.getInstance().getCastleById(castleId);
                activeChar.sendPacket(new SiegeInfo(castle));
Edited by Wallisteer
Posted

 

here gave the error would not have to create a method in pcinstance?

int castleId = 9;
                Castle castle = CastleManager.getInstance().getCastleById(castleId);
                activeChar.sendPacket(new SiegeInfo(castle));

show our error here

Posted (edited)
the import error is thus lacking 
bele has created the most import error in this line here 
 
getCastleById 
 
 
 
unable to fix the error, with the help of eclipse 
 
compiled usual but then when I the command opens the window html 
 
al when I click the error in the console looks
 
eeefe.png

 

 

idiomta'm sorry the brasilheiro

Edited by Wallisteer
Posted

You do not need 10 times Castle castle = CastleManager.getInstance().getCastleById(castleId); .. only one line is enough..

Posted (edited)

well i forgot the imports

 

import com.l2jfrozen.gameserver.network.serverpackets.SiegeInfo;

import com.l2jfrozen.gameserver.managers.CastleManager;

import com.l2jfrozen.gameserver.model.entity.siege.Castle;

 

well try it and tell me

Edited by te0x
Posted (edited)

You do not need 10 times Castle castle = CastleManager.getInstance().getCastleById(castleId); .. only one line is enough..

actually now i am learning.. thats why they are badly coded ;D

thanks btw

Edited by te0x
Posted

 

did not quite understand ... 
 

I got this error

 

eeefe.png

 

try to use the imports 

import com.l2jfrozen.gameserver.network.serverpackets.SiegeInfo;

import com.l2jfrozen.gameserver.managers.CastleManager;

import com.l2jfrozen.gameserver.model.entity.siege.Castle;

  • 2 weeks later...
Posted

1. convert the method to static
2. WTF is this?

tb.append("</center>");
tb.append("<center>");
tb.append("</center>");
tb.append("</body></html>");

3. you're supposed to use StringBuilder instead of TextBuilder

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • Yes i found it later its weird that l2off works that way level 9 it should be the top level. Is anybody who has problem with the boss Core? Because it is moving and i try to fix it
    • New arrivals: Reddit accounts Reddit SelfReg Karma Account | 20-100 POST AND COMMENT KARMA | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS: 4$ Reddit Karma Old Brute Account | 1+ KARMA | Full access with login: password:cookies: 2$ Reddit SelfReg Old Account | 1+ KARMA | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS: 3$ Ready Reddit accounts with karma and age for fast promotion of posts and comments! Our store’s Reddit account range includes: ➡ Reddit Karma Brute Account | 1 KARMA | Cookies access only (password may be not working) | The cheapest account | Price from: 1$ ➡ Reddit SelfReg Karma Account | 20-100 POST AND COMMENT KARMA | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS: 4$ ➡ Reddit Karma Old Brute Account | 1+ KARMA | Full access with login: password:cookies: 2$ ➡ Reddit SelfReg Old Account | 1+ KARMA | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS: 3$ ➡ Reddit Karma Brute Account | 20-100 POST AND COMMENT KARMA | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS | Price from: 5$ ➡ Reddit Karma Brute Account | 500-1000 POST AND COMMENT KARMA | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS | Price from: 9$ ➡ Reddit Karma Brute Account | 1000 Post Karma and 100 comment karma | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS | Price from: 15$ ➡ Reddit Karma Brute Account | 2000 Post Karma and 100 comment karma | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS | Price from: 20$ ➡ Reddit Karma Brute Account | 3000 Post Karma and 100 comment karma | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS | Price from: 25$ ➡ Reddit Karma Brute Account | 5000 Post Karma and 100 comment karma | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS | Price from: 35$ ➡ Reddit Karma Brute Account | 10000+ KARMA | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS (email is included and working) | Price from: 45$ ➡ Reddit Karma Brute Account | 20000 KARMA | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS (email is included and working) | Price from: 60$ ➡ Reddit Karma Brute Account | 50000+ KARMA | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS (email is included and working) | Price from: 90$ ➡ Reddit Karma Brute Account | 100000+ KARMA | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS (email is included and working) | Price from: 149$ Relevant links: Digital goods store (Website): Go Telegram bot for buying Telegram Stars: Go SMM Panel: Go – promotion of your social media accounts. Store Telegram bot: Go Promotions and special offers: 1. Promo code SEPTEMBER2025 (10% discount) for purchases in our store (Website, bot) in September! You can also use promo code for first purchase: SOCNET (15% discount) 2. Get $1 to store balance or 10-20% discount, just write your username after registration on our website in the following format: "SEND ME BONUS, MY USERNAME IS..." – you need to post it in our forum thread! 3. Get $1 for the first trial launch of SMM Panel: just open a ticket with subject “Get Trial Bonus” on our website (Support). 4. Weekly giveaways of Telegram Stars in our Telegram channel and in our star-purchase bot! News resources: ➡ Telegram channel: https://t.me/accsforyou_shop✅ ➡ WhatsApp channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n✅ ➡ Discord server: https://discord.gg/y9AStFFsrh✅ We are actively looking for suppliers for the following product positions: — Snapchat old and new accounts | With snapscores | Geo: Europe/USA | Full access via email/phone number — Reddit old accounts with post and comment karma from 100 to 100,000+ | Full access via email — LinkedIn old accounts with real connections | Geo: Europe/USA | Full access via email + active 2FA password — Instagram old accounts (2010-2023 years) | Full access via email (possibly with active 2FA password) — Facebook old accounts (2010-2023 years) | Full access via email (possibly with active 2FA password) | With or without friends | Geo: Europe/USA/Asia — Threads accounts | Full access via email (possibly with active 2FA password) — TikTok/Facebook/Google ADS Agency advertising accounts Contact us below — let’s discuss terms! We are always open to other partnership offers as well. Contacts and support: ➡ Telegram: https://t.me/socnet_support✅ ➡ WhatsApp: https://wa.me/79051904467✅ ➡ Discord: socnet_support ✅ ➡ ✉ Email: solomonbog@socnet.store ✅ Also via these contacts you can: — get consultation on bulk purchases — establish partnership (current partners: https://socnet.bgng.io/partners) — become our supplier SocNet — store of digital goods and premium subscriptions ✅
    • New arrivals: Reddit accounts Reddit SelfReg Karma Account | 20-100 POST AND COMMENT KARMA | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS: 4$ Reddit Karma Old Brute Account | 1+ KARMA | Full access with login: password:cookies: 2$ Reddit SelfReg Old Account | 1+ KARMA | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS: 3$ Ready Reddit accounts with karma and age for fast promotion of posts and comments! Our store’s Reddit account range includes: ➡ Reddit Karma Brute Account | 1 KARMA | Cookies access only (password may be not working) | The cheapest account | Price from: 1$ ➡ Reddit SelfReg Karma Account | 20-100 POST AND COMMENT KARMA | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS: 4$ ➡ Reddit Karma Old Brute Account | 1+ KARMA | Full access with login: password:cookies: 2$ ➡ Reddit SelfReg Old Account | 1+ KARMA | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS: 3$ ➡ Reddit Karma Brute Account | 20-100 POST AND COMMENT KARMA | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS | Price from: 5$ ➡ Reddit Karma Brute Account | 500-1000 POST AND COMMENT KARMA | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS | Price from: 9$ ➡ Reddit Karma Brute Account | 1000 Post Karma and 100 comment karma | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS | Price from: 15$ ➡ Reddit Karma Brute Account | 2000 Post Karma and 100 comment karma | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS | Price from: 20$ ➡ Reddit Karma Brute Account | 3000 Post Karma and 100 comment karma | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS | Price from: 25$ ➡ Reddit Karma Brute Account | 5000 Post Karma and 100 comment karma | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS | Price from: 35$ ➡ Reddit Karma Brute Account | 10000+ KARMA | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS (email is included and working) | Price from: 45$ ➡ Reddit Karma Brute Account | 20000 KARMA | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS (email is included and working) | Price from: 60$ ➡ Reddit Karma Brute Account | 50000+ KARMA | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS (email is included and working) | Price from: 90$ ➡ Reddit Karma Brute Account | 100000+ KARMA | MIX IP Registered | FORMAT: USERNAME: PASSWORD:EMAIL:MAILPASS (email is included and working) | Price from: 149$ Relevant links: Digital goods store (Website): Go Telegram bot for buying Telegram Stars: Go SMM Panel: Go – promotion of your social media accounts. Store Telegram bot: Go Promotions and special offers: 1. Promo code SEPTEMBER2025 (10% discount) for purchases in our store (Website, bot) in September! You can also use promo code for first purchase: SOCNET (15% discount) 2. Get $1 to store balance or 10-20% discount, just write your username after registration on our website in the following format: "SEND ME BONUS, MY USERNAME IS..." – you need to post it in our forum thread! 3. Get $1 for the first trial launch of SMM Panel: just open a ticket with subject “Get Trial Bonus” on our website (Support). 4. Weekly giveaways of Telegram Stars in our Telegram channel and in our star-purchase bot! News resources: ➡ Telegram channel: https://t.me/accsforyou_shop✅ ➡ WhatsApp channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n✅ ➡ Discord server: https://discord.gg/y9AStFFsrh✅ We are actively looking for suppliers for the following product positions: — Snapchat old and new accounts | With snapscores | Geo: Europe/USA | Full access via email/phone number — Reddit old accounts with post and comment karma from 100 to 100,000+ | Full access via email — LinkedIn old accounts with real connections | Geo: Europe/USA | Full access via email + active 2FA password — Instagram old accounts (2010-2023 years) | Full access via email (possibly with active 2FA password) — Facebook old accounts (2010-2023 years) | Full access via email (possibly with active 2FA password) | With or without friends | Geo: Europe/USA/Asia — Threads accounts | Full access via email (possibly with active 2FA password) — TikTok/Facebook/Google ADS Agency advertising accounts Contact us below — let’s discuss terms! We are always open to other partnership offers as well. Contacts and support: ➡ Telegram: https://t.me/socnet_support✅ ➡ WhatsApp: https://wa.me/79051904467✅ ➡ Discord: socnet_support ✅ ➡ ✉ Email: solomonbog@socnet.store ✅ Also via these contacts you can: — get consultation on bulk purchases — establish partnership (current partners: https://socnet.bgng.io/partners) — become our supplier SocNet — store of digital goods and premium subscriptions ✅
    • Vibe SMS simple and user-friendly We’re building a service where it’s important not only that everything works, but also that it’s convenient and stress-free for you. With Vibe SMS, there’s no unnecessary fuss or complicated rules — just a reliable platform and support when you need it. Here, you’re not just a user; you’re part of a team that values honesty, trust, and convenience for everyone Our website: https://vibe-sms.net/ Our Telegram channel: https://t.me/vibe_sms        
    • Same account Shillien Knight lvl 57 , AVADON HEAVY SET , JEWLERY B. Prophet lvl 57 , C grade armor. I sell both because on same email , different subaccounts   190E  
  • 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