Jump to content
  • 0

[HELP] Castle Control Announce During Siege


Question

Posted

Hello Devs of Maxcheaters,

 

I've came to this topic after a long-term period of trying to solve this problem.

I want when a Clan takes a Castle during siege,to be announced to all players.

Using the method that i've already used to announce when Siege starts,stops & when clan registers for Attack / Defend,i've tryed to use the same code.

 

This is the code:

Announcements.getInstance().announceToAll(""+player.getClan().getName()+" has taken "+getCastle().getName()+" Castle.");

 

This is the error:

errorck.jpg

 

But when using the same code for the other lines,it works perfect.

startg.jpg

endmu.jpg

registerzw.jpg

 

Any ideas?

 

Thanks in advance,

 

- Revo

Recommended Posts

  • 0
Posted

I am still at the first steps of Java...

Could you give me a hand? I don't know how to place a loop.

 

for (L2PcInstance player : L2World.getInstance().getAllPlayers().values())

{

your code aka the announcement

}

  • 0
Posted

Thanks for the code,but check this error out:

 

errorhy.jpg

 

Any help?

 

Thanks

 

import L2World check the quick fix menu on hover of the text

  • 0
Posted

Intrepid,

 

Thanks for all of your help.

I was trying to fix this here and 5 days but i couldn't.

This is the result of your help.

 

28643892.jpg

 

But why is it announced 3 times?

 

This is the code:

codej.jpg

 

Thanks very much,

 

- Rev

 

  • 0
Posted

Intrepid,

 

Thanks for all of your help.

I was trying to fix this here and 5 days but i couldn't.

This is the result of your help.

 

28643892.jpg

 

But why is it announced 3 times?

 

This is the code:

codej.jpg

 

Thanks very much,

 

- Rev

 

 

prolly its called 3 times in different methods but i dont know i dont use l2j i dont know their siege system :S

  • 0
Posted

I've moved the code to the bottom of this code and now it shows it twice.

 

78579787.jpg

 

The 1st announcement,is for the clan that takes the Castle.

The 2nd announcement,is for the clan that loses the Castle.

 

But there is only 1 line that triggers the announcement.

 

codesjpg.jpg

 

  • 0
Posted

When you did your tests there were 3 ppls online, then 2 in second test.

 

Spoiler of this awesome logic : Why I can say that ? Basically, for each online player, it sends an announce. You know the next...

 

-------

 

You didn't say you had error - well I didn't check well the image - but what I said was true :P.

 

You have to make the player/clan variable "fly" from one method to another.

 

 

   public void midVictory(String clanName)
   {
       if (getIsInProgress()) // Siege still in progress
       {
           // Announce
           Announcements.getInstance().announceToAll(clanName+" has taken "+getCastle().getName()+" Castle.");

           if (getCastle().getOwnerId() > 0) 
           	_siegeGuardManager.removeMercs(); // Remove all merc entry from db

           // If defender doesn't exist (Pc vs Npc) and only 1 attacker

 

And considering the use of this method (only 2) :

 

getSiege().midVictory(clan.getName());

 

Dunno if it's the best solution, but it's the easiest for sure, considering what you want to do.

  • 0
Posted

I have no problem to work, but as i said i am really newbie with Java.

Here and a few weeks i am studying with a teacher Java,i am testing things with Eclipse but i'm not there yet.

Could you please help me a bit with coding?

 

Thanks in advance

- Rev

  • 0
Posted

I have no problem to work, but as i said i am really newbie with Java.

Here and a few weeks i am studying with a teacher Java,i am testing things with Eclipse but i'm not there yet.

Could you please help me a bit with coding?

 

Thanks in advance

- Rev

 

I gave you the whole solution, the only thing I was talking about being lazy was the diff patch.As I like to say, giving you a fish won't help you, when a fishrod could stop your hungry :).

 

All is supposed to work, just use CTRL+H (search function) in order to find good places. You know already 1 place, you have to search for the 2 last (must be siegemanager, siege and castle).

 

You can c/p the code I make, it works whatever is your chronicle/pack normally.

 

I removed sentence in last post which could make think it wasn't complete code.

 

Regards, Tk.

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

    • Use our premium virtual numbers for fast and convenient account verification on popular services worldwide. Suitable both for mass verification and for one-time registration — reliable, convenient, and without unnecessary complications. Active links: Virtual numbers service: Go to Other services and products: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. We would like to present to you the current list of promotions and special offers for purchasing products and services of our service: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 on your store balance or a 10–20% discount — just write your username after registering on our website using the following template: "SEND ME BONUS, MY USERNAME IS..." — you need to post this in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel: just open a ticket with the subject “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Special offer until 31 December, each server only 100 euros.
    • 🔥 L2NeverPain – Opening this Friday! 🔥 The gates open 12 December 2025 – 20:00 (GMT+2). Prepare your squads, set your macros, and get ready for true StuckSub PvP.   Main +2 Sub. Balanced fights. Fresh start. Be there from the first minute.   🛡️Clan Leaders: You can register your clan on discord clan-register channel   🌐https://l2neverpain.com/ 🌐https://discord.gg/kNP3UXgkmN
    • Dear partners! At the moment we are in great need of the following positions: — Snapchat old and new accounts | With snapscores | Geo: Europe/USA | Full access via email/phone number — Reddit old (brute or hacked origin, self-registered) accounts with post and comment karma from 100 to 100,000+ | Full email access included — LinkedIn old accounts with real connections | Geo: Europe/USA | Full email access + active 2FA password — Instagram old accounts (2010–2023) | Full email access (possibly with active 2FA password) — Facebook old accounts (2010–2023) | Full email access (possibly with active 2FA password) | With friends or without friends | Geo: Europe/USA/Asia — Threads accounts | Full email access (possibly with active 2FA password) — TikTok/Facebook/Google ADS Agency advertising accounts — Email accounts: mail.ru, yahoo.com, gazeta.pl, gmx.ch / gmx.de / gmx.net (BUT NOT gmx.com) — Google ADS Manual Farm accounts (verified via email and phone number) | GEO: USA/Europe, mostly USA. — WhatsApp OLD Accounts — Twitter accounts with followers and posts (old accounts) Contact us via the details below. We will be glad to cooperate! We are also ready to consider other partnership and collaboration options. Active links to our projects: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Dear partners! At the moment we are in great need of the following positions: — Snapchat old and new accounts | With snapscores | Geo: Europe/USA | Full access via email/phone number — Reddit old (brute or hacked origin, self-registered) accounts with post and comment karma from 100 to 100,000+ | Full email access included — LinkedIn old accounts with real connections | Geo: Europe/USA | Full email access + active 2FA password — Instagram old accounts (2010–2023) | Full email access (possibly with active 2FA password) — Facebook old accounts (2010–2023) | Full email access (possibly with active 2FA password) | With friends or without friends | Geo: Europe/USA/Asia — Threads accounts | Full email access (possibly with active 2FA password) — TikTok/Facebook/Google ADS Agency advertising accounts — Email accounts: mail.ru, yahoo.com, gazeta.pl, gmx.ch / gmx.de / gmx.net (BUT NOT gmx.com) — Google ADS Manual Farm accounts (verified via email and phone number) | GEO: USA/Europe, mostly USA. — WhatsApp OLD Accounts — Twitter accounts with followers and posts (old accounts) Contact us via the details below. We will be glad to cooperate! We are also ready to consider other partnership and collaboration options. Active links to our projects: Digital goods store (Website): Go to Store Telegram bot: Go to – convenient access to the store via the Telegram messenger. Virtual numbers service: Go to Telegram bot for purchasing Telegram Stars: Go to – fast and profitable purchase of Stars in Telegram. SMM Panel: Go to – promotion of your social media accounts. Contacts and support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: 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