Jump to content

Recommended Posts

Posted

To add a reward for Lord's Castle :

 

go java\com\l2jserver\gameserver\model\actor\instance\L2CastleChamberlainInstance.java

 

Go to line 1224, uou should see something like this

 

if (player.isClanLeader())
			{
				if (player.getInventory().getItemByItemId(6841) == null)
				{
					L2ItemInstance crown = player.getInventory().addItem("Castle Crown", 6841, 1, player, this);

					SystemMessage ms = new SystemMessage(SystemMessageId.EARNED_ITEM);
					ms.addItemName(crown);
					player.sendPacket(ms);

					html.setFile(player.getHtmlPrefix(), "data/html/chamberlain/chamberlain-gavecrown.htm");
					html.replace("%CharName%", String.valueOf(player.getName()));
					html.replace("%FeudName%", String.valueOf(getCastle().getName()));
				}						
				else
					html.setFile(player.getHtmlPrefix(), "data/html/chamberlain/chamberlain-hascrown.htm");
			}

 

After

						html.setFile(player.getHtmlPrefix(), "data/html/chamberlain/chamberlain-gavecrown.htm");
					html.replace("%CharName%", String.valueOf(player.getName()));
					html.replace("%FeudName%", String.valueOf(getCastle().getName()));
				}

 

Add :

					if (player.getInventory().getItemByItemId(item_id) == null)
				{
					L2ItemInstance crown = player.getInventory().addItem("Castle Crown", item_id, item_amount, player, this);

					SystemMessage ms = new SystemMessage(SystemMessageId.EARNED_ITEM);
					ms.addItemName(crown);
					player.sendPacket(ms);

					html.setFile(player.getHtmlPrefix(), "data/html/chamberlain/chamberlain-gavecrown.htm");
					html.replace("%CharName%", String.valueOf(player.getName()));
					html.replace("%FeudName%", String.valueOf(getCastle().getName()));
				}

 

After You should see something like this :

				if (player.isClanLeader())
			{
				if (player.getInventory().getItemByItemId(6841) == null)
				{
					L2ItemInstance crown = player.getInventory().addItem("Castle Crown", 6841, 1, player, this);

					SystemMessage ms = new SystemMessage(SystemMessageId.EARNED_ITEM);
					ms.addItemName(crown);
					player.sendPacket(ms);

					html.setFile(player.getHtmlPrefix(), "data/html/chamberlain/chamberlain-gavecrown.htm");
					html.replace("%CharName%", String.valueOf(player.getName()));
					html.replace("%FeudName%", String.valueOf(getCastle().getName()));
				}
				if (player.getInventory().getItemByItemId(item_id) == null)
				{
					L2ItemInstance crown = player.getInventory().addItem("Castle Crown", item_id, item_amount, player, this);

					SystemMessage ms = new SystemMessage(SystemMessageId.EARNED_ITEM);
					ms.addItemName(crown);
					player.sendPacket(ms);

					html.setFile(player.getHtmlPrefix(), "data/html/chamberlain/chamberlain-gavecrown.htm");
					html.replace("%CharName%", String.valueOf(player.getName()));
					html.replace("%FeudName%", String.valueOf(getCastle().getName()));
				}					
				else
					html.setFile(player.getHtmlPrefix(), "data/html/chamberlain/chamberlain-hascrown.htm");
			}

 

After go data\html\chamberlain\chamberlain-gavecrown.htm :

<html><body>
%CharName%, Castle Lord!<br>
The crown is %FeudName%, a symbol of the castle lord's authority.<br>
+And item_id, symbols of the power of a war lord's.<br>
Guard it with your life!<br>

</body></html>

 

Then data\html\chamberlain\chamberlain-hascrown.htm

<html><body>
The castle lord already has the crown or item_id.
</body></html>

 

Choose an item and replace item_id and item_amount. When the Lord's Castle will receive The Lord's Crown he will receive your item.

Have fun =)

Sorry for my bad english ;)

 

Posted

everything is much easier

Config:

OwnedItemId = 57
OwnedItemCount = 100

Config.java:

public static int Owned_Item_Id;
public static int Owned_Item_Count;
Owned_Item_Id         = Integer.parseInt(l2jfrozen.getProperty("OwnedItemId", "57"));
Owned_Item_Count      = Integer.parseInt(l2jfrozen.getProperty("OwnedItemCount", "100"));

Siege.java:

// Remove all spawned siege guard from this castle
		_siegeGuardManager.unspawnSiegeGuard();

           if(getCastle().getOwnerId() > 0)
           {
              
               L2PcInstance leader = null;
               try
               {
                   leader = ClanTable.getInstance().getClan(getCastle().getOwnerId()).getLeader().getPlayerInstance();
               }
               catch (ClanNotFoundException e)
               {
                   e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
               }
               leader.addItem("ItameName", Config.Owned_Item_Id, Config.Owned_Item_Count, leader, false);
 	        leader.getInventory().updateDatabase();
           _siegeGuardManager.removeMercs();
           }

		getCastle().spawnDoor();
		getCastle().getZone().updateZoneStatusForCharactersInside();

 

Posted

ever heard of .diff file? ? ?

(eclipse, team, create patch)

 

 

thanks, easy to do but since noone has done it before, thanks.

you can't do it.
Posted

you can't do it.

hah. you mean i don't know how to create diffs? just editing or creating .java files in eclipse and then team create patch, and save to desktop ass a .diff file is so difficult to do?

Posted

hah. you mean i don't know how to create diffs? just editing or creating .java files in eclipse and then team create patch, and save to desktop ass a .diff file is so difficult to do?

i mean to create the code.
Posted

i mean to create the code.

loled. i know how to add a simple code that will add an item to players inventory lol. anyway, i am not here to spam this guy's topic with everything that comes in your mind. :S

Posted

ever heard of .diff file? ? ?

(eclipse, team, create patch)

 

 

My share is very easy so i didn't create diff ^^ It's just for personns who want add an item for lord's castle, it's quickly and easy.

And if i use the Chamberlain, it's to use a better reward system. I prefer use the Chamberlain instead of spawn item in inventory ;)

Posted

you can't do it.

hah. you mean i don't know how to create diffs? just editing or creating .java files in eclipse and then team create patch, and save to desktop ass a .diff file is so difficult to do?

i mean to create the code.

loled. i know how to add a simple code that will add an item to players inventory lol. anyway, i am not here to spam this guy's topic with everything that comes in your mind. :S

 

loled...everyone whit minimal knowledge can create a 2 liner code to add smth to the inventory.

 

anyway i dont see it usefully in my oppinion

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
Reply to this topic...

×   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

    • L2JMobius C1 System C1 + bonus textures C3 for C1 https://www.mediafire.com/folder/6oh7l7hf34xr9/C1
    • https://prnt.sc/Bkkc0ShGXv9m https://prnt.sc/-JFLvZXsn27A
    • Hello guys want to sell adena in L2 Reborn Signature x1  Stock =14kk good price 
    • Hi guys, I have the following problem, I want to set up two servers on the same dedicated server and I can't.   L2jacis 409 Linux Server. The first gameserver has the following configuration: # ================================================================ # Gameserver setting # ================================================================ # This is transmitted to the clients, so it has to be an IP or resolvable hostname. If this ip is resolvable by Login just leave * Hostname = 190.25.103.103 # Bind ip of the gameserver, use * to bind on all available IPs. GameserverHostname = * GameserverPort = 7777 # The Loginserver host and port. LoginHost = 127.0.0.1 LoginPort = 9014 # This is the server id that the gameserver will request. RequestServerID = 1 # If set to true, the login will give an other id to the server (if the requested id is already reserved). AcceptAlternateID = True UseBlowfishCipher = True # ================================================================ # Database informations # ================================================================ URL = jdbc:mariadb://localhost/server1 Login = server1 Password = server1 I configured the second gameserver like this:   # ================================================================ # Gameserver setting # ================================================================ # This is transmitted to the clients, so it has to be an IP or resolvable hostname. If this ip is resolvable by Login just leave * Hostname = 0.0.0.0 # Bind ip of the gameserver, use * to bind on all available IPs. GameserverHostname = * GameserverPort = 7788 # The Loginserver host and port. LoginHost = 127.0.0.1 LoginPort = 9014 # This is the server id that the gameserver will request. RequestServerID = 2 # If set to true, the login will give an other id to the server (if the requested id is already reserved). AcceptAlternateID = True UseBlowfishCipher = True # ================================================================ # Database informations # ================================================================ URL = jdbc:mariadb://localhost/server2 Login = server2 Password = server2 apart from having tested 0.0.0.0 on the second gameserver I also tried 127.0.0.1 In both cases I see the two servers in the login when I log in, but I try to enter the one with the lowest ping and it kicks me out. The other server always appears with ping 9999 and I try to enter but it doesn't do anything and it freezes the login so I have to log in again. The hexids are in their respective folders. For server 1, it has its hexid inside the gameserver config folder, and I checked that the hexid id is the same id, for example id 1 in the gameserver is also id1 for server 1, and hexid 2 has its hexid 2 for server 2. The server ports are open and listening when I turn on both gameservers. I really don't know what could be wrong. If you could give me some help I would appreciate it. Excuse my English.
  • Topics

×
×
  • Create New...