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.

(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

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
Answer this question...

×   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

    • Let’s make MaxCheaters great again. I’m always listening, never ignoring. Yeah, I’ve been busy real life and the gym hit hard these days but let’s be real, every Lineage2 server right now is total garbage. Same clowns running them, just rebranding every month for a quick cash grab. Same cycle, different name. Don’t even get me started on the so called “big” Pay2Play servers. The L2 scene is turbo dead because players are clueless they love hopping from one week servers to the next. It’s like dating a woman and immediately wanting to try the next one. No loyalty, no purpose. It’s time to move on. Lineage2 is a dead game. Lets talk about Essence chronicle Dominates because you literally do nothing just task spam, let your bot farm 24/7, and repeat. I’m into other games now because there’s just no point playing L2 when the community itself is absolute trash.  
    • I do agree that 90 if not 99% of all servers exist due to crash grab / quick dolla holla. Hope you show them different 🙂  
    • Thank you for the info!
    • Dead do speak indeed. A "flex" you say? Come on.. on a dead forum? A flex? Mate are you alright? And what money? A few euros from ads? Naah, Maxtor is just bussy sucking dicks for a rent. Now, about your concerns. You’re right, we all know every L2 server these days is trash. That’s why we’re here. We’ve got the files, we’ve got the devs and we’ve got the balls to do something about it. No recycled garbage, no cash-grab bullshit - just servers built the way they should be. We all love L2, the real L2. As I mentioned earlier, the website for the entire project will be made available soon. Things like websites and social media have a low priority - all the focus is on the core work: files, quests, balance, and every possible modification that could be implemented if that’s what the players want. Expect a shitload of polls about every damn thing. As soon as the website is live, we’ll announce player recruitment for closed testing. For now, I can give you a little sneak peek: One of the servers currently in development will run on the Interlude chronicle, with low rates between 1-25 (exact rates depends on player's choice) and a 1+1 stack subclass system featuring strict passive restrictions and overall balance.   Server doesn’t need good files? Well, mate, with that attitude, it’s no wonder your “server” sucks dicks. “Good” files, aka “precompiled Java garbage,” might be fine for your trash-tier setups, but we actually care about our files. Security, stability, performance, balance - that’s what we’re focused on. Maybe one day, you’ll stumble across one of those principles and realize why you’ve been stuck running clown servers all this time.
  • Topics

×
×
  • Create New...