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!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • in conclusion when somebody who has a project for 10+ years still on development writes an e-say to try until you succeed and then advertises his project, one of the reasons is he needs money, so l2j has once more become pure expensive hobby, you wont make money out of it.   You can still use L2jFrozen and get better results for this, i know some people that done it    keep in mind that C in aCis stands for Crappy, and after all these years its not a cool wordplay anymore, its a fact, prove me wrong.
    • First, don't really follow the "main voice", moreover if you consider it an hobby. Simply do what you want, you got only one life so use it as you want. If you make it an hobby, it's exactly like piano, or velo - only practice makes you better.   Secondly, how do you learn things ? It's actually a really important question, since some can simply be scholar, read books (theory) then practice ; and some simply can't read books. I'm the second type, I hated school, I find it boring - my knowledge in Java comes from try-and-fail. You improve your coding style every year or so, I can myself rewrite my own code (which I already considered top-notched) after a while. You always learn something new - even if Java barely evolves. L2J is a fun way to learn programming, it's a giant sandbox where you can edit anything, and I believe it should be taken as it.   My own way of learning was as follow : Add existing customs, no matter what they are : the point is to know main classes used by L2J / customs. L2J is barely Java knowledge ; the true knowledge is to know WHAT to search in WHICH location (what I call, organization). You have to understand than EVERYTHING you think already exists, in a form on another, in the source code. A custom is only the association of the different mechanisms you found "here and there", glued together in a proper goal. Once you know main classes to edit, and the customs you added are compiling fine, the main point is to know WHAT exactly you DID. Try to understand WHY and WHERE you actually copied the code. Third point would be to MANIPULATE the customs you added in order to fit your wish. First edit little values, then logic conditions ; eventually add a new Config, or a new functionality to the custom. Fourth point would be to begin to craft your own ideas. Once again, EVERYTHING already exists, in a form or another. You want a cycled event ? You got Seven Signs main task as exemple. Npc ? Search any type of Npc and figure out what it does. Fifth point would be to understand Java - mostly containers (WHAT and WHERE to use them), variables types and main Java mechanisms (inheritance, static modifier, etc). You should also begin to cut your code into maintainable classes or methods. Java can actually run without optimization, but bigger your ideas, more optimized and well-thought it should be. It's direct saved time in the future, and you would thank yourself doing so. Main tips : ALWAYS use any type of versioning system - GIT or SVN. It allows to save your work, step by step and eventually revert back anytime you want if you terribly messed up. L2J is 80% organization knowledge, and 20% Java knowledge. Basically, if you know WHAT and WHERE to search, if you aren't dumb, it's easy to replicate and re-use things. Cherry on top is to use a already good coded pack to avoid copy-paste crap and get bad habits. Avoid any type of russian or brazilian packs, for exemple - their best ability is to leak someone's else code. Obviously you need some default sense of logic, but Java and programming in general help you to improve it.   Finally, most of your questions could be solved joining related Discord (at least for aCis, I can't speak for others) - from the moment your question was correctly asked (and you seemed to search for the answer). My community (and myself) welcomes newbies, but got some issues with noobies.   The simpliest is to try, fail and repeat until you succeed - it sounds stupid, but that's basically how life works.   PS : about Java ressources, before ChatGPT, it was mostly about stackoverflow website, and site like Baeldung's one. With ChatGPT and alike, you generally double-cross AI output to avoid fucked up answers. Also, care about AI, they are often hallucinating really hard, even today. They can give you complete wrong answer, you tell them they are wrong, and they say "indeed, I suck, sorry - here's a new fucked up answer". You shouldn't 100% rely over AI answer, even if that can give sometimes legit answers, full code or just skeletons of ideas.   PPS : I don't think there are reliable ressources regarding L2J itself, also most of the proposed code decays pretty fast if the source code is actually maintained (at least for aCis). Still, old coded customs for old aCis sources are actually a good beginner challenge to apply on latest source.
    • WTS: - AQ - Baium - Zaken  - Frintezza - Vesper Fighter Focus Fire Element   pm for detalis
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock