Jump to content
  • 0

Applying A Code Error Πέρασμα Κώδικα ...


TEOGR_hItMaKeR

Question

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

### 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
Link to comment
Share on other sites

Recommended Posts

  • 0

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

:P

 

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

Κάνε αυτό που σου λέει ο Merlon. 

if (Config.ANNOUNCE_CASTLE_LORDS)
notifyCastleOwner(activeChar);

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

και στο τέλος βάλε την μέθοδο notifyCastleOwner.

Link to comment
Share on other sites

  • 0

Που ακριβώς εννοείς;

Όπου θέλεις ρίξε το.. Απλά όχι μέσα σε άλλη υπάρχων μέθοδο ή κάπου που να κόβει κάποιον κώδικα..

Βάλτο κάτω από εκεί που κάνει load το welcome html. 

Θα είναι οκ.

Edited by 'Baggos'
Link to comment
Share on other sites

  • 0

Αυτό εδώ έχω στο τέλος

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!");

}

}

}

Όπου θέλεις ρίξε το.. Απλά όχι μέσα σε άλλη υπάρχων μέθοδο ή κάπου που να κόβει κάποιον κώδικα..

Βάλτο κάτω από εκεί που κάνει load το welcome html.

Θα είναι οκ.

και δεν δουλεύει... Edited by TEOGR_hItMaKeR
Link to comment
Share on other sites

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.



×
×
  • Create New...