Jump to content

Question

Posted (edited)

Βρήκα αυτόν τον κώδικα 

### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
===================================================================
--- java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java	(revision 173)
+++ java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java	(working copy)
@@ -27,6 +27,7 @@
 import net.sf.l2j.gameserver.datatables.AdminCommandAccessRights;
 import net.sf.l2j.gameserver.datatables.MapRegionTable;
 import net.sf.l2j.gameserver.datatables.SkillTable;
+import net.sf.l2j.gameserver.instancemanager.CastleManager;
 import net.sf.l2j.gameserver.instancemanager.ClanHallManager;
 import net.sf.l2j.gameserver.instancemanager.CoupleManager;
 import net.sf.l2j.gameserver.instancemanager.DimensionalRiftManager;
@@ -38,6 +39,7 @@
 import net.sf.l2j.gameserver.model.L2World;
 import net.sf.l2j.gameserver.model.actor.L2Character;
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
+import net.sf.l2j.gameserver.model.entity.Castle;
 import net.sf.l2j.gameserver.model.entity.ClanHall;
 import net.sf.l2j.gameserver.model.entity.Couple;
 import net.sf.l2j.gameserver.model.entity.Siege;
@@ -223,6 +225,11 @@
 			if (serverNews != null)
 				sendPacket(new NpcHtmlMessage(1, serverNews));
 		}
+		
+		if (Config.ANNOUNCE_CASTLE_LORDS)
+		{
+			notifyCastleOwner(activeChar);
+		}
 
 		PetitionManager.getInstance().checkPetitionMessages(activeChar);
 
@@ -321,4 +328,18 @@
 	{
 		return "[C] 03 EnterWorld";
 	}
+	private void notifyCastleOwner(L2PcInstance activeChar)
+	{
+		L2Clan clan = activeChar.getClan();
+		
+		if (clan != null)
+		{
+			if (clan.getHasCastle() > 0)
+			{
+				Castle castle = CastleManager.getInstance().getCastleById(clan.getHasCastle());
+				if ((castle != null) && (activeChar.getObjectId() == clan.getLeaderId()))
+					Announcements.getInstance().announceToAll("Lord " + activeChar.getName() + " Of " + castle.getName() + " Castle is now online!");
+			}
+		}
+	}
 }
\ No newline at end of file
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java	(revision 173)
+++ java/net/sf/l2j/Config.java	(working copy)
@@ -80,6 +80,7 @@
     public static boolean ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE;
     public static boolean ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH;
 	public static boolean REMOVE_CASTLE_CIRCLETS;
+	public static boolean ANNOUNCE_CASTLE_LORDS;
 	
     /** Manor */
     public static int ALT_MANOR_REFRESH_TIME;
@@ -717,6 +718,7 @@
                 ALT_GAME_NEW_CHAR_ALWAYS_IS_NEWBIE = Boolean.parseBoolean(clans.getProperty("AltNewCharAlwaysIsNewbie", "False"));
                 ALT_MEMBERS_CAN_WITHDRAW_FROM_CLANWH = Boolean.parseBoolean(clans.getProperty("AltMembersCanWithdrawFromClanWH", "False"));
                 REMOVE_CASTLE_CIRCLETS = Boolean.parseBoolean(clans.getProperty("RemoveCastleCirclets", "True"));
+                ANNOUNCE_CASTLE_LORDS = Boolean.parseBoolean(clans.getProperty("AnnounceCastleLords", "false"));
 
                 ALT_MANOR_REFRESH_TIME = Integer.parseInt(clans.getProperty("AltManorRefreshTime", "20"));
     	        ALT_MANOR_REFRESH_MIN = Integer.parseInt(clans.getProperty("AltManorRefreshMin", "00"));
Index: config/clans.properties
===================================================================
--- config/clans.properties	(revision 173)
+++ config/clans.properties	(working copy)
@@ -37,6 +37,9 @@
 #Remove Castle circlets after a clan lose its castle or a player leaves a clan? - default true
 RemoveCastleCirclets = True
 
+# Announce castle lords on enter game? - default false 
+AnnounceCastleLords = False
+
 #=============================================================
 #                         Manor Config
 #=============================================================

Και καθώς προσπαθούσα να τον περάσω στο  acis 367 μου έβγαζε έρρορ σε αυτά τα σημεία  

 

 clan.getHasCastle 

 εδώ

 Announcements.getInstance

και εδώ  ... 

Sorry αλλά είμαι λίγο newbie σαυτά ... 

Έχω αλλάξει το l2pcinstance σε player παρεπιπτόντως  

Αν κάποιος μπορεί να με βοηθήσει ! 

 

Here is the code at pastebin https://pastebin.com/TKzBDwk6 made by sweets Ο κώδικας στο πάστεμπιν από τον sweets

Edited by TEOGR_hItMaKeR

Recommended Posts

  • 0
Posted (edited)

It's hasCastle(), and announceToAll broadcast type has been moved on Broadcast.java under announceToOnlinePlayers.

Edited by Tryskell
  • 0
Posted (edited)
It's hasCastle(), and announceToAll broadcast type has been moved on Broadcast.java under announceToOnlinePlayers.

(EN) EDIT I cant use image for some reason  

 

 

 

stile mou team na se help

EDIT 2 Δες τα μηνύματα σου 

see here if you can
http://imgient.com/image/RDLz
Edited by TEOGR_hItMaKeR
  • 0
Posted (edited)

  1. Στο 367 η μέθοδος clan.hasCastle() ειναι τύπου Boolean. Οπότε το check σου ειναι -> if (clan.hasCastle())

Δες τι όρισμα πρέπει να βάλεις εδω CastleManager.getInstance().getCastleById(Integer (δηλαδη το ID της clan))

Announcements...


if (clan != null)

{

if (clan.hasCastle())

{

Castle castle = CastleManager.getInstance().getCastleById(clan.getClanId());

if ((castle != null) && (activeChar.getObjectId() == clan.getLeaderId()))

Broadcast.announceToOnlinePlayers("Lord " + activeChar.getName() + " Of " + castle.getName() + " Castle is now online!");

}

}

 

Edited by melron
  • 0
Posted (edited)

  1. Στο 367 η μέθοδος clan.hasCastle() ειναι τύπου Boolean. Οπότε το check σου ειναι -> if (clan.hasCastle())
  2. Δες τι όρισμα πρέπει να βάλεις εδω CastleManager.getInstance().getCastleById(Integer (δηλαδη το ID της clan))
  3. Announcements...

λοιπόν τώρα τα 2 πάνω διορθώθηκαν ωστόσο συνεχίζει το 3 το οποίο άλλαξα έτσι όπως το έχεις συγκεκριμένα το Broadcast ... Edit 2 το έκανα import από το l2j.gameserver.util το Broadcast και διορθώθηκε    

private void notifyCastleOwner(Player activeChar)       {
               L2Clan clan = activeChar.getClan();
              
               if (clan != null)
               {
                       if (clan.hasCastle())
                       {
                               Castle castle = CastleManager.getInstance().getCastleById(clan.getClanId());
                               if ((castle != null) && (activeChar.getObjectId() == clan.getLeaderId()))
                                Broadcast.announceToOnlinePlayers("Lord " + activeChar.getName() + " Of " + castle.getName() + " Castle is now online!");
                       }
               }
       }
παραπάνω είναι ο κώδικας έτσι όπως τον έχω κάνει τώρα 
Edited by TEOGR_hItMaKeR
  • 0
Posted (edited)
Τι πρόβλημα έχεις με το Broadcast?

 

Τιποτα το έφτιαξα θέλω να βάλω επίσης να κάνει και τους hero επομένως το έχω κάνει έτσι

 

 private void notifyCastleOwner(Player activeChar)       {
if (activeChar.isHero())
{
Broadcast.announceToOnlinePlayers("Hero "+activeChar.getName()+" has been logged in.");
}
               L2Clan clan = activeChar.getClan();
              
               if (clan != null)
               {
                       if (clan.hasCastle())
                       {
                               Castle castle = CastleManager.getInstance().getCastleById(clan.getClanId());
                               if ((castle != null) && (activeChar.getObjectId() == clan.getLeaderId()))
                                Broadcast.announceToOnlinePlayers("Lord " + activeChar.getName() + " Of " + castle.getName() + " Castle is now online!");
                       }
               }
       }  
 
 
αλλά για να βάλω και τους hero στα config τι πρέπει να βάλω εδώ  

                        

if (Config.ANNOUNCE_CASTLE_LORDS)
               {
                       notifyCastleOwner(activeChar);
                
? ευχαριστώ πολύ για την βοήθεια παρεπιπτόντως εμένα μου φαίνονται λίγο κινέζικα προς το παρόν !
Edited by TEOGR_hItMaKeR
  • 0
Posted (edited)

για το announce των heroes θα πρεπει να το βαλεις στο αρχειο Enterworld.java σε ξεχωριστο if (αν εχεις config για heroes announce)

Edited by melron
  • 0
Posted (edited)
για το announce των heroes θα πρεπει να το βαλεις στο αρχειο Enterworld.java

 

 

στο enterworld.java είμαστε :P και έφτιαξα το κάτω (το έβαλα ) 

 

δες το 

private void notifyCastleOwner(Player activeChar)       {
if (activeChar.isHero())
{
Broadcast.announceToOnlinePlayers("Hero "+activeChar.getName()+" has been logged in.");
}
               L2Clan clan = activeChar.getClan();
              
               if (clan != null)
               {
                       if (clan.hasCastle())
                       {
                               Castle castle = CastleManager.getInstance().getCastleById(clan.getClanId());
                               if ((castle != null) && (activeChar.getObjectId() == clan.getLeaderId()))
                              Broadcast.announceToOnlinePlayers("Lord " + activeChar.getName() + " Of " + castle.getName() + " Castle is now online!");
                       }
               }
       }  
if (Config.ANNOUNCE_CASTLE_LORDS)
{
notifyCastleOwner(activeChar);

 απλά υποθέτω οτι πρέπει να βάλω και κάτι σε αυτό το σημείο   στο οποίο βάλαμε για τους castle lords  

Edited by TEOGR_hItMaKeR
  • 0
Posted
if (Config.ANNOUNCE_CASTLE_LORDS)
{

αν εχεις μεσα εκει το announce για τους heroes και το config αυτο το βαλεις false , τοτε δεν θα γινει announce... βαλτο εκτος αυτης της συνθηκης

  • 0
Posted

Μάλλον έχεις καταλάβει λάθος (δεν βοηθάει και το edit του forum ) ! 

 

Λοιπόν ο αρχικός κώδικας ήταν αυτός εδώ https://pastebin.com/TKzBDwk6 

πρόσεξε τις γραμμές από 27 έως 31 

είναι για το enterword.java έπειτα πιο κάτω τις γραμμές από 39 μέχρι 52 τις οποίες μου έδωσες ήδη το φιξ αλλά πρόσθεσα και αυτό  

 if (activeChar.isHero())
{
Broadcast.announceToOnlinePlayers("Hero "+activeChar.getName()+" has been logged in.");
}

οπότε έχει γίνει έτσι 

private void notifyCastleOwner(Player activeChar)       {
if (activeChar.isHero())
{
Broadcast.announceToOnlinePlayers("Hero "+activeChar.getName()+" has been logged in.");
}
               L2Clan clan = activeChar.getClan();
              
               if (clan != null)
               {
                       if (clan.hasCastle())
                       {
                               Castle castle = CastleManager.getInstance().getCastleById(clan.getClanId());
                               if ((castle != null) && (activeChar.getObjectId() == clan.getLeaderId()))
                              Broadcast.announceToOnlinePlayers("Lord " + activeChar.getName() + " Of " + castle.getName() + " Castle is now online!");
                       }
               }
       }  

ρωτάω επομένως για τους hero δεν χρειάζεται να προσθέσω τίποτα δίπλα στις γραμμές 27 έως 31 ; ώστε να τους βάλω και αυτούς στα config ? 

  • 0
Posted (edited)

Μαλον εσυ δεν εχεις καταλαβει :P Θελεις 2 features . announce clan lord kai announce hero on LOGIN

 

Οποτε Καλα εκανες και εβαλες ενα IF που βλεπει το Config.ANNOUNCE_CASTLE_LORDS αν ειναι true για να κανει announce τους lords.

 

Αν εσυ θελεις οι απλοι heroes να γινονται announce δεν θα πας να το βαλεις μεσα στο IF για τους castle lords... Το καταλαβες τι εννοω?

 

το :

private void notifyCastleOwner(Player activeChar) 

θα δουλεψει αν το Config.ANNOUNCE_CASTLE_LORDS ειναι true. Αν ειναι False και εσυ εχεις βαλει τους heroes τοτε τι?

Edited by melron
  • 0
Posted (edited)

αχαα 

τώρα 

public static void Announcements(Player activeChar)
       {
if (activeChar.isHero())
{
Broadcast.announceToOnlinePlayers("Hero "+activeChar.getName()+" has been logged in.");
}
               L2Clan clan = activeChar.getClan();
              
               if (clan != null)
               {
                       if (clan.hasCastle())
                       {
                               Castle castle = CastleManager.getInstance().getCastleById(clan.getClanId());
                               if ((castle != null) && (activeChar.getObjectId() == clan.getLeaderId()))
                                Broadcast.announceToOnlinePlayers("Lord " + activeChar.getName() + " Of " + castle.getName() + " Castle is now online!");
                       }
               }
       }

αλλά τι πρέπει να βάλω επάνω;  σε αυτό που είχα  

 if (Config.ANNOUNCE_CASTLE_LORDS)
               {
                       notifyCastleOwner(activeChar);
               }

Έτσι ;

            
   if (Config.ANNOUNCE_CASTLE_LORDS)
               {
                Announcements(activeChar);
               }
               
               if (Config.ANNOUNCE_HERO_PLAYERS)
               {
                Announcements(activeChar);
               }
Edited by TEOGR_hItMaKeR
  • 0
Posted (edited)

Θα στο κανω πιο αναλυτικα :P

 

βαλε ακριβως αυτα:

if (Config.ANNOUNCE_CASTLE_LORDS)
               {
                       notifyCastleOwner(activeChar);
               }
if (Config.ANNOUNCE_HEROES)
         if (activeChar.isHero())
               Broadcast.announceToOnlinePlayers("Hero "+activeChar.getName()+" has been logged in.");

μετα βαλε:

private void notifyCastleOwner(Player activeChar) 
      {
               L2Clan clan = activeChar.getClan();
               if (clan != null)
               {
                       if (clan.hasCastle())
                       {
                               Castle castle = CastleManager.getInstance().getCastleById(clan.getClanId());
                               if ((castle != null) && (activeChar.getObjectId() == clan.getLeaderId()))
                              Broadcast.announceToOnlinePlayers("Lord " + activeChar.getName() + " Of " + castle.getName() + " Castle is now online!");
                       }
               }
       }  

Και απλα φτιαξε ενα Config.ANNOUNCE_HEROES

Edited by melron
  • 0
Posted (edited)

μμ ναι ευχαριστώ πάρα πολύ :) Νομίζω όμως και το δικό μου σωστό είναι έτσι όπως το έχω κάνει 

:P

 

Βασικά το πρόβλημα με το δικό μου είναι να το βάλω στα config και τα 2 δεν ξέρω αν θα δουλέψει με το δικό σου όμως το πρόβλημα θα είναι αν πχ είναι και hero και castle lord θα τον γράφει 2 φορές 

Edited by TEOGR_hItMaKeR

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

    • https://discord.gg/k53SZ4DM5z   Interlude Client L2Old Pride is a L2 Pride Interlude Based All functional skills (Not archer/mage server)   L2Old Pride Helper (Works like Woundrous Cubic) https://imgur.com/iYqmHQY Farm Zones: Cave of Trials and Elven Ruins (Chaotic) Olympiads: Every 15 days Various Cosmetic Items https://imgur.com/uoeU6Jw https://imgur.com/oCS2Zed PvP Zone: Gludin Village (No-Parties, Disguised) More than 100 new Skills https://imgur.com/6RaPsQV Max Level: 90 https://imgur.com/z4QVJKZ Gaining Xp by PVP https://imgur.com/LRqI31T Purchasable S-grade items +10 or +20 with random chance to enchant +5 Purchasable Custom Items Depends on Tier Mysterious Merchants https://imgur.com/2ZwWyPH Auto Enchant Via PvPing (with low chance) Custom Raid Bosses Siege Every Weekend (Aden, Rune, Giran) Autofarm / Drop Tracker https://imgur.com/Vz3rha6   RATES: • Start Level 80 • Max level 90  • EXP: 5000x • SP: 5000x • ADENA 6000x   ENCHANT: • Maximum enchant S Grade Items: +35. • Maximum enchant Unique/Epic Items: +25. • Maximum enchant Legendary Items: +18. • Maximum enchant Relic Items: +14. •Descriptions for rate at scrolls!   EVENTS: • TEAMS vs TEAMS • CAPTURE THE FLAG • DOMINATION • DEATH MATCH • DICE OF DEATH • CHAOTIC ZONE   OTHERS: Assistance system in pvps. Where support classes are enabled to receive pvp with a low chance, for supporting a party member during pvp. •  /sit to regen HP/MP/CP • Custom Shots Glows https://imgur.com/FLK0DmR • Achievements System • Daily Tasks System • Monthly Tasks System   CUSTOM ARMORS SETS Dread Armor/Titanium Armor Pride Armor Rykros Armor https://imgur.com/SPxoQp1   CUSTOM WEAPONS SETS Unique Weapons Pride Weapons Legendary Weapons Relic Weapons https://imgur.com/kOHNXhS   CUSTOM ACCESSORIES Standard Superior Legendary https://imgur.com/zPqNiiX   CUSTOM JEWELS/TATTOO Legendary Nightmarish https://imgur.com/gcqS28P There are many more features that you will only understand by playing and following. Beta testing server is currently open. Follow us on our discord and join our server to test it.
    • You shouldn't use rev 382, not sure why everyone keep using that.   I don't make changesets for fun, I don't make new revisions for nothing.   Follow the revisions.
    • Your issue isn't related to geoengine at all (as always), rev 410 got improved water movement management.
    • Download Here: https://sitehunterus.blogspot.com/2025/12/custom-proxy-checker-check-proxies.html VirusTotal https://www.virustotal.com/gui/file/b74418850d82dbf0031e0549f20239b5bff5dbba7a59903fcf9ba55780002a4e Visit my Blogger list to download 100% free software https://www.freetoolss.com/ https://blackhat8.blogspot.com/ https://hack-crack9.blogspot.com/ https://hackernoons.blogspot.com/ https://sharetools99.blogspot.com/
  • 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