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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


  • Posts

    • I am selling the essence project which includes versions 388 and 439 that have been running for over 2 years or (447 as custom PVP like Pride). I have a test server for you to test them out. If you are really interested in it then contact my seller at discord: kiwi7106. Price: 4000 Euro P/s: This is a project that I have spent a lot of money and time developing, so if you are not interested in it, please get out of this topic, thank you. P/s 2: If you find the price too expensive, it's best to skip this article and find another project and don't comment negatively on my topic, thank you.
    • Someone ask me for this, it should work on any client that has Kamael race, preview:     Installation - there are two ways to install depending on how you want to use it:   Method 1: If you want to completely replace the original, do:   Copy all lines from your armorgrp to Notepad++, press Ctrl+H, check the "match whole word" option and replace:   kamael.Mkamael_m000_w_ad00   by:   AvengersKamaelWings.Avengers_MKamael_m001_w_ad00   Then replace:   MKamael.Mkamael_m000_t00_w   by:   AvengersKamaelWings.MKamael_m001_t00_w   Now repeat the same process with the female, replace:   kamael.Fkamael_m000_w_ad00   by:   AvengersKamaelWings.Avengers_FKamael_m001_w_ad00   Then replace:   FKamael.Fkamael_m000_t00_w   by:   AvengersKamaelWings.FKamael_m001_t00_w   You're done, paste everything back into File Edit and save!   Method 2: If you only want to replace in specific sets, execute the above process only on the armorgrp of those sets.   Repack by: AvengersTeamBr Password: LadrãoDeFrango      
    • 用于解密、加密和编辑 .u 文件的工具。
    • It's always awesome when you find someone who not only delivers great quality but also does it way ahead of schedule. Makes you feel like you hit the jackpot, right? I'm new around here, just stumbled upon this forum, and seeing posts like yours really gives me hope that there are some real pros hanging out in this community.
  • Topics

×
×
  • Create New...