Jump to content

Recommended Posts

Posted

Well,hi someone from here asked this.Its already at Gracia Epilogue but i did it for Gracia Final if someone need it.Let's see

Index: java/config/NPC.properties
===================================================================
--- java/config/NPC.properties	(revision 4129)
+++ java/config/NPC.properties	(working copy)
@@ -46,6 +46,10 @@
# Default: False 
ShowNpcLevel = False

+# Show clan, alliance crests for territory NPCs without quests
+# Default: False
+ShowCrestWithoutQuest = False
+
# Do you want mobs to drop Vitality resplenishing herbs?
# Notes:
#	Works only if EnableVitality = True
Index: java/net/sf/l2j/gameserver/network/serverpackets/AbstractNpcInfo.java
===================================================================
--- java/net/sf/l2j/gameserver/network/serverpackets/AbstractNpcInfo.java	(revision 4129)
+++ java/net/sf/l2j/gameserver/network/serverpackets/AbstractNpcInfo.java	(working copy)
@@ -15,7 +15,10 @@
package net.sf.l2j.gameserver.network.serverpackets;

import net.sf.l2j.Config;
+import net.sf.l2j.gameserver.datatables.ClanTable;
import net.sf.l2j.gameserver.instancemanager.CursedWeaponsManager;
+import net.sf.l2j.gameserver.instancemanager.TownManager;
+import net.sf.l2j.gameserver.model.L2Clan;
import net.sf.l2j.gameserver.model.L2Transformation;
import net.sf.l2j.gameserver.model.actor.L2Character;
import net.sf.l2j.gameserver.model.actor.L2Decoy;
@@ -86,6 +89,10 @@
    public static class NpcInfo extends AbstractNpcInfo
    {
    	private L2Npc _npc;
+    	private int _clanCrest = 0;
+		private int _allyCrest = 0;
+		private int _allyId = 0;
+		private int _clanId = 0;
    	
    	public NpcInfo(L2Npc cha, L2Character attacker)
    	{
@@ -108,15 +115,29 @@
        		_title = cha.getTitle(); // On every subclass

            if (Config.SHOW_NPC_LVL && _npc instanceof L2MonsterInstance)
-    	    {
-    			String t = "Lv " + cha.getLevel() + (cha.getAggroRange() > 0 ? "*" : "");
-    			if (_title != null)
-    				t += " " + _title;
-
-    			_title = t;
-    	    }
-    	}
+			{
+				String t = "Lv " + cha.getLevel() + (cha.getAggroRange() > 0 ? "*" : "");
+				if (_title != null)
+					t += " " + _title;
+				
+				_title = t;
+			}
    	
+    	// npc crest of owning clan/ally of castle
+		if (cha instanceof L2Npc && cha.isInsideZone(L2Character.ZONE_TOWN) && (Config.SHOW_CREST_WITHOUT_QUEST || cha.getCastle().getShowNpcCrest()) && cha.getCastle().getOwnerId() != 0)
+		{
+			int townId = TownManager.getTown(_x, _y, _z).getTownId();
+			if (townId != 33 && townId != 22)
+			{
+				L2Clan clan = ClanTable.getInstance().getClan(cha.getCastle().getOwnerId());
+				_clanCrest = clan.getCrestId();
+				_clanId = clan.getClanId();
+				_allyCrest = clan.getAllyCrestId();
+				_allyId = clan.getAllyId();
+			}
+		}
+	}
+    	
    	@Override
		protected void writeImpl()
		{
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java	(revision 4129)
+++ java/net/sf/l2j/Config.java	(working copy)
@@ -629,6 +629,7 @@
	public static boolean DEEPBLUE_DROP_RULES;
	public static boolean DEEPBLUE_DROP_RULES_RAID;
	public static boolean SHOW_NPC_LVL;
+	public static boolean SHOW_CREST_WITHOUT_QUEST;
	public static boolean GUARD_ATTACK_AGGRO_MOB;
	public static boolean ALLOW_WYVERN_UPGRADER;
	public static String PET_RENT_NPC;
@@ -1669,6 +1670,7 @@
					DEEPBLUE_DROP_RULES = Boolean.parseBoolean(NPC.getProperty("UseDeepBlueDropRules", "True"));
					DEEPBLUE_DROP_RULES_RAID = Boolean.parseBoolean(NPC.getProperty("UseDeepBlueDropRulesRaid", "True"));
					SHOW_NPC_LVL = Boolean.parseBoolean(NPC.getProperty("ShowNpcLevel", "False"));
+					SHOW_CREST_WITHOUT_QUEST = Boolean.parseBoolean(NPC.getProperty("ShowCrestWithoutQuest", "False"));
					ENABLE_DROP_VITALITY_HERBS = Boolean.parseBoolean(NPC.getProperty("EnableVitalityHerbs", "True"));
					GUARD_ATTACK_AGGRO_MOB = Boolean.parseBoolean(NPC.getProperty("GuardAttackAggroMob", "False"));
					ALLOW_WYVERN_UPGRADER = Boolean.parseBoolean(NPC.getProperty("AllowWyvernUpgrader", "False"));
@@ -2270,6 +2272,7 @@

		else if (pName.equalsIgnoreCase("ShowServerNews")) SERVER_NEWS = Boolean.parseBoolean(pValue);
		else if (pName.equalsIgnoreCase("ShowNpcLevel")) SHOW_NPC_LVL = Boolean.parseBoolean(pValue);
+		else if (pName.equalsIgnoreCase("ShowCrestWithoutQuest")) SHOW_CREST_WITHOUT_QUEST = Boolean.parseBoolean(pValue);

		else if (pName.equalsIgnoreCase("ForceInventoryUpdate")) FORCE_INVENTORY_UPDATE = Boolean.parseBoolean(pValue);

Index: java/net/sf/l2j/gameserver/model/entity/Castle.java
===================================================================
--- java/net/sf/l2j/gameserver/model/entity/Castle.java	(revision 4129)
+++ java/net/sf/l2j/gameserver/model/entity/Castle.java	(working copy)
@@ -85,6 +85,7 @@
	private int _taxPercent = 0;
	private double _taxRate = 0;
	private long _treasury = 0;
+	private boolean _showNpcCrest = false;
	private L2CastleZone _zone = null;
	private L2CastleTeleportZone _teleZone;
	private L2Clan _formerOwner = null;
@@ -531,6 +532,7 @@
		}

		updateOwnerInDB(clan); // Update in database
+		setShowNpcCrest(false);

		// if clan have fortress, remove it
		if (clan.getHasFort() > 0)
@@ -707,6 +709,8 @@

				_taxPercent = rs.getInt("taxPercent");
				_treasury = rs.getLong("treasury");
+				
+				_showNpcCrest = rs.getBoolean("showNpcCrest");
			}
			rs.close();
			statement.close();
@@ -1129,6 +1133,20 @@
		return _treasury;
	}

+	public final boolean getShowNpcCrest()
+	{
+		return _showNpcCrest;
+	}
+	
+	public final void setShowNpcCrest(boolean showNpcCrest)
+	{
+		if (_showNpcCrest != showNpcCrest)
+		{
+			_showNpcCrest = showNpcCrest;
+			updateShowNpcCrest();
+		}
+	}
+	
	public List<SeedProduction> getSeedProduction(int period)
	{
		return (period == CastleManorManager.PERIOD_CURRENT ? _production : _productionNext);
@@ -1579,6 +1597,36 @@
		}
	}

+	public void updateShowNpcCrest()
+	{
+		Connection con = null;
+		PreparedStatement statement;
+		try
+		{
+			con = L2DatabaseFactory.getInstance().getConnection();
+			
+			statement = con.prepareStatement("UPDATE castle SET showNpcCrest = ? WHERE id = ?");
+			statement.setString(1, String.valueOf(getShowNpcCrest()));
+			statement.setInt(2, getCastleId());
+			statement.execute();
+			statement.close();
+		}
+		catch (Exception e)
+		{
+			_log.info("Error saving showNpcCrest for castle " + getName() + ": " + e.getMessage());
+		}
+		finally
+		{
+			try
+			{
+				con.close();
+			}
+			catch (Exception e)
+			{
+			}
+		}
+	}
+	
	public FastList<L2Skill> getResidentialSkills()
	{
		return _residentialSkills;

 

Also dont forget this:

Index: /trunk/Eclipse_Datapack/sql/castle.sql
===================================================================
--- /trunk/Eclipse_Datapack/sql/castle.sql (revision 202)
+++ /trunk/Eclipse_Datapack/sql/castle.sql (revision 206)
@@ -7,4 +7,5 @@
   `regTimeOver` enum('true','false') DEFAULT 'true' NOT NULL,
   `regTimeEnd` DECIMAL(20,0) NOT NULL default 0,
+  `showNpcCrest` enum('true','false') DEFAULT 'false' NOT NULL,
   PRIMARY KEY (`name`),
   KEY `id` (`id`)
@@ -12,11 +13,11 @@

INSERT IGNORE INTO `castle` VALUES
-(1,'Gludio',0,0,0,'true',0),
-(2,'Dion',0,0,0,'true',0),
-(3,'Giran',0,0,0,'true',0),
-(4,'Oren',0,0,0,'true',0),
-(5,'Aden',0,0,0,'true',0),
-(6,'Innadril',0,0,0,'true',0),
-(7,'Goddard',0,0,0,'true',0),
-(8,'Rune',0,0,0,'true',0),
-(9,'Schuttgart',0,0,0,'true',0);
+(1,'Gludio',0,0,0,'true',0,'false'),
+(2,'Dion',0,0,0,'true',0,'false'),
+(3,'Giran',0,0,0,'true',0,'false'),
+(4,'Oren',0,0,0,'true',0,'false'),
+(5,'Aden',0,0,0,'true',0,'false'),
+(6,'Innadril',0,0,0,'true',0,'false'),
+(7,'Goddard',0,0,0,'true',0,'false'),
+(8,'Rune',0,0,0,'true',0,'false'),
+(9,'Schuttgart',0,0,0,'true',0,'false');

 

 

Credits to L2JForum and Me For adapt it

Posted

/facepalm...

You sanded us links to this topic just to see a thing that a guy made on l2jserver forum?

Dude.. aamm no words.. ur pro! keep it up >.> and ull make smth of yourself.

Posted

/facepalm...

You sanded us links to this topic just to see a thing that a guy made on l2jserver forum?

Dude.. aamm no words.. ur pro! keep it up >.> and ull make smth of yourself.

yes what's your problem?

for someone will be useful but for you i know it isn't

Posted

do it and for interlude..

 

FACEPALM x2.

Anw, as I told you start making your own codes.

By adapting stuff you will not learn anything, just how to change the imports.

Posted

FACEPALM x2.

Anw, as I told you start making your own codes.

By adapting stuff you will not learn anything, just how to change the imports.

what its your problem??? i want and for interlude have any problem with my opinion???
Posted

what its your problem??? i want and for interlude have any problem with my opinion???

 

It's nonsense adding every single gracia string in shitlude, instead of using Gracia.

 

And btw Ventic don't add useless hides >_>

Posted

It's nonsense adding every single gracia string in shitlude, instead of using Gracia.

 

And btw Ventic don't add useless hides >_>

 

Why hide it?As he said it's from l2j forum...Anyone who go and search for it,he's gonna find it...so?

Anyways I like servers with this mode...Great job keep sharing...!

Posted

Why hide it?As he said it's from l2j forum...Anyone who go and search for it,he's gonna find it...so?

 

Read what I wrote.

I told him not to hide such posts.

He had hidden it for 50 posts, and I just removed it.

God.. >_>

Posted

Awesome!

I was searching for it!

I saw those crests on many servers and i didn't knew how the did it!

Thanks!

ITS COMMITTED ON L2JSERVER !

GOD!

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

    • Where I can buy a cheap domain .com? cheapest I found was on Godaddy for 12 euro and Hostinger for 10 euro.
    • Hello everyone, here's a simple and useful idea for any type of server.   This code applies a discount when a player makes a purchase inside a clan’s castle or clan hall, offering a benefit to clan members who own a castle or clan hall. Important: Merchant transactions must be handled through multisell, not buylist. The discount is directly applied within the multisell, so the price shown is already reduced.   "For example, if a scroll costs 1000 Adena and you set a 20% discount in the config, the final price when purchasing inside a castle or clan hall will be 800 Adena."   This code is developed on the public aCis 401 revision.   public static int CLAN_BASE_OWNERSHIP_MERCHANT_DISCOUNT; CLAN_BASE_OWNERSHIP_MERCHANT_DISCOUNT = clans.getProperty("ClanBaseOwnershipMechantDiscount", 20); # If clan owns a clan hall or castle, all members have a discount of X% at merchant transactions (multisell). # Discount applies only inside the base (castle or clan hall). ClanBaseOwnershipMechantDiscount = 20   /** diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/data/xml/MultisellData.java b/aCis_gameserver/java/net/sf/l2j/gameserver/data/xml/MultisellData.java index 556e111..bbf8e69 100644 --- a/aCis_gameserver/java/net/sf/l2j/gameserver/data/xml/MultisellData.java +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/data/xml/MultisellData.java @@ -101,7 +101,7 @@ do { // send list at least once even if size = 0 - player.sendPacket(new MultiSellList(list, index)); + player.sendPacket(new MultiSellList(list, index, player)); index += PAGE_SIZE; } while (index < list.getEntries().size()); diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/MultiSellChoose.java b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/MultiSellChoose.java index 7c82c5b..1654abc 100644 --- a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/MultiSellChoose.java +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/MultiSellChoose.java @@ -6,6 +6,7 @@ import net.sf.l2j.Config; import net.sf.l2j.gameserver.enums.FloodProtector; import net.sf.l2j.gameserver.enums.StatusType; +import net.sf.l2j.gameserver.enums.ZoneId; import net.sf.l2j.gameserver.enums.items.CrystalType; import net.sf.l2j.gameserver.model.Augmentation; import net.sf.l2j.gameserver.model.actor.Player; @@ -225,6 +226,20 @@ return; } + if (player.isInsideZone(ZoneId.CLAN_HALL) && player.getClan() != null && player.getClan().hasClanHall()) + { + e.setItemCount(e.getItemCount() * (100 - Config.CLAN_BASE_OWNERSHIP_MERCHANT_DISCOUNT) / 100); + if (e.getItemCount() == 0) + e.setItemCount(1); + } + + if (player.isInsideZone(ZoneId.CASTLE) && player.getClan() != null && player.getClan().hasCastle()) + { + e.setItemCount(e.getItemCount() * (100 - Config.CLAN_BASE_OWNERSHIP_MERCHANT_DISCOUNT) / 100); + if (e.getItemCount() == 0) + e.setItemCount(1); + } + if (Config.BLACKSMITH_USE_RECIPES || !e.getMaintainIngredient()) { // if it's a stackable item, just reduce the amount from the first (only) instance that is found in the inventory diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/MultiSellList.java b/aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/MultiSellList.java index 9269b06..c6102a0 100644 --- a/aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/MultiSellList.java +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/MultiSellList.java @@ -2,6 +2,9 @@ import static net.sf.l2j.gameserver.data.xml.MultisellData.PAGE_SIZE; +import net.sf.l2j.Config; +import net.sf.l2j.gameserver.enums.ZoneId; +import net.sf.l2j.gameserver.model.actor.Player; import net.sf.l2j.gameserver.model.multisell.Entry; import net.sf.l2j.gameserver.model.multisell.Ingredient; import net.sf.l2j.gameserver.model.multisell.ListContainer; @@ -15,7 +18,9 @@ private boolean _finished; - public MultiSellList(ListContainer list, int index) + private Player _player; + + public MultiSellList(ListContainer list, int index, Player player) { _list = list; _index = index; @@ -28,6 +33,8 @@ } else _finished = true; + + _player = player; } @Override @@ -74,7 +81,14 @@ { writeH(ing.getItemId()); writeH(ing.getTemplate() != null ? ing.getTemplate().getType2() : 65535); - writeD(ing.getItemCount()); + + if (_player.isInsideZone(ZoneId.CLAN_HALL) && _player.getClan() != null && _player.getClan().hasClanHall()) + writeD((ing.getItemCount() * (100 - Config.CLAN_BASE_OWNERSHIP_MERCHANT_DISCOUNT) / 100) < 1 ? 1 : ing.getItemCount() * 80 / 100); + else if (_player.isInsideZone(ZoneId.CASTLE) && _player.getClan() != null && _player.getClan().hasCastle()) + writeD((ing.getItemCount() * (100 - Config.CLAN_BASE_OWNERSHIP_MERCHANT_DISCOUNT) / 100) < 1 ? 1 : ing.getItemCount() * 80 / 100); + else + writeD(ing.getItemCount()); + writeH(ing.getEnchantLevel()); writeD(0x00); // TODO: i.getAugmentId() writeD(0x00); // TODO: i.getManaLeft()  
    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/uthciha-services https://campsite.bio/utchihaamkt
    • WTB EXP ETERNAL 10x new dm.
    • This project is based on the latest public aCis sources (revision 401) and supports a multi-client system (C4 & IL), making it suitable for custom usage but not for retail.   You can configure the SelectedClient option in server.properties and loginserver.properties to switch between C4 and IL.  Both clients are fully synchronized, including login, server selection, packets, and geodata.   Notable Features: - Completed the login and server selection phase for both clients. - Synchronized all packets to support both clients (including some specific features). - Reworked the datapack and SQL files (excluding HTML files) to work seamlessly with both clients. - Added geodata support for both clients. - Adapted nearly all AI, scripts, bosses, HTML, and MULTISELL files to match C4 functionality. - Reduced the maximum clan level from 8 to 5 (C4 feature). - Rewrote clan HTML to remove C5-C6 features.   Disabled the following C5 and C6 features: - Divine Inspiration (C6 feature). - Clan skills and clan reputation points (C5 feature). - Pledge class (C5 feature). - Hero skills (C5 feature). - Dueling system (C6 feature). - Augmentations (C6 feature). - Cursed weapons (C5-C6 feature).   General Improvements: - Performed a general HTML cleanup and optimized features based on the client version. - Added an option to display the remaining time of disabled skills. - Skill timestamps now update when using the skill list.   This flexibility allows you to create a unique progression system tailored to your needs. The price for the diff patch, which can be applied to aCis public sources, is €150. For inquiries, please contact me via PM or Discord (ID: @Luminous).
  • Topics

×
×
  • Create New...