Jump to content

Recommended Posts

Posted (edited)

Ok Guys I found This Code And Because I found Errors And A lot Of Peoples Can't Inside This Code I Share For Help The Peoples :

 

CREDITS IS BY L2JFROZEN PROJECT

 

REWORK BY ME  (TEST BY ME)

 

This is Java Code :

Index: head-src/com/l2jfrozen/Config.java
===================================================================
--- head-src/com/l2jfrozen/Config.java (wersja 669)
+++ head-src/com/l2jfrozen/Config.java (kopia robocza)
@@ -2239,6 +2239,7 @@
public static String FARM2_CUSTOM_MESSAGE;
public static String PVP1_CUSTOM_MESSAGE;
public static String PVP2_CUSTOM_MESSAGE;
+ public static boolean SHOW_NPC_CREST;

//============================================================
public static void loadL2JFrozenConfig()
@@ -2357,6 +2358,7 @@
FARM2_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("Farm2CustomMeesage", "You have been teleported to Farm Zone 2!");
PVP1_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("PvP1CustomMeesage", "You have been teleported to PvP Zone 1!");
PVP2_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("PvP2CustomMeesage", "You have been teleported to PvP Zone 2!");
+ SHOW_NPC_CREST = Boolean.parseBoolean(L2JFrozenSettings.getProperty("ShowNpcCrest", "False"));
}
catch(Exception e)
{
Index: config/functions/l2jfrozen.properties
===================================================================
--- config/functions/l2jfrozen.properties (wersja 669)
+++ config/functions/l2jfrozen.properties (kopia robocza)
@@ -275,4 +275,8 @@
# -----------------------------------------
# Protector System Config  -
# -----------------------------------------
# Protector activate when a player this PK
ProtectorPlayerPK = False
# Protector activate when a player is flaged
ProtectorPlayerPVP = False
# Radius of action
ProtectorRadiusAction = 5000
# Skill ID used for the npc
ProtectorSkillId = 1170
# Skill Level used for npc
ProtectorSkillLevel = 13
ProtectorSkillTime = 600
# Npc Protector Message
ProtectorMessage = Hey You!, Never Kill On This Area, Go Read The Rules!
+
+#-------------------------------------------------
+# Show clan, alliance crests for territory NPC's.
+#-------------------------------------------------
+# Default: False
+ShowNpcCrest = True
\ No newline at end of file
Index: head-src/com/l2jfrozen/gameserver/network/serverpackets/NpcInfo.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/serverpackets/NpcInfo.java   (wersja 669)
+++ head-src/com/l2jfrozen/gameserver/network/serverpackets/NpcInfo.java   (kopia robocza)
@@ -19,11 +19,15 @@
 package com.l2jfrozen.gameserver.network.serverpackets;

 import com.l2jfrozen.Config;
+import com.l2jfrozen.gameserver.datatables.sql.ClanTable;
+import com.l2jfrozen.gameserver.managers.TownManager;
 import com.l2jfrozen.gameserver.model.L2Character;
+import com.l2jfrozen.gameserver.model.L2Clan;
 import com.l2jfrozen.gameserver.model.L2Summon;
 import com.l2jfrozen.gameserver.model.actor.instance.L2MonsterInstance;
 import com.l2jfrozen.gameserver.model.actor.instance.L2NpcInstance;
 import com.l2jfrozen.gameserver.model.actor.instance.L2PetInstance;
+import com.l2jfrozen.gameserver.model.zone.type.L2TownZone;

 /**
  * This class ...
@@ -46,6 +50,10 @@
    private int _collisionHeight, _collisionRadius;
    private String _name = "";
    private String _title = "";
+   int _clanCrest = 0;
+   int _allyCrest = 0;
+   int _allyId = 0;
+   int _clanId = 0;

    /**
     * @param _characters
@@ -99,6 +107,32 @@
          _title = t;
       }

+      if(Config.SHOW_NPC_CREST)
+      {
+         if(cha instanceof L2NpcInstance && cha.isInsideZone(L2Character.ZONE_PEACE) && cha.getCastle().getOwnerId() != 0)
+         {
+            int _x,_y,_z;
+            _x = cha.getX();
+            _y = cha.getY();
+            _z = cha.getZ();
+            L2TownZone Town;
+            Town = TownManager.getInstance().getTown(_x, _y, _z);
+            if(Town != null)
+            {
+               int townId = Town.getTownId();
+               if(townId != 33 && townId != 22)
+               {
+                  L2Clan clan;
+                  clan = ClanTable.getInstance().getClan(cha.getCastle().getOwnerId());
+                  _clanCrest = clan.getCrestId();
+                  _clanId = clan.getClanId();
+                  _allyCrest = clan.getAllyCrestId();
+                  _allyId = clan.getAllyId();
+               }
+            }
+         }
+      }
+
       _x = _activeChar.getX();
       _y = _activeChar.getY();
       _z = _activeChar.getZ();
@@ -187,12 +221,23 @@
       writeD(0000); // hmm karma ??

       writeD(_activeChar.getAbnormalEffect()); // C2
-      writeD(0000); // C2
-      writeD(0000); // C2
-      writeD(0000); // C2
-      writeD(0000); // C2
-      writeC(0000); // C2

+      if(Config.SHOW_NPC_CREST)
+      {
+         writeD(_clanId);
+         writeD(_clanCrest);
+         writeD(_allyId);
+         writeD(_allyCrest);
+      }
+      else
+      {
+         writeD(0000);
+         writeD(0000);
+         writeD(0000);
+         writeD(0000);
+         writeC(0000);
+      }
+
       writeC(0x00); // C3  team circle 1-blue, 2-red
       writeF(_collisionRadius);
       writeF(_collisionHeight);
Index: head-src/com/l2jfrozen/gameserver/model/entity/siege/Castle.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/model/entity/siege/Castle.java   (wersja 669)
+++ head-src/com/l2jfrozen/gameserver/model/entity/siege/Castle.java   (kopia robocza)
@@ -90,6 +90,7 @@
    private int _taxPercent = 0;
    private double _taxRate = 0;
    private int _treasury = 0;
+   private boolean _showNpcCrest = false;
    private L2CastleZone _zone;
    private L2CastleTeleportZone _teleZone;
    private L2Clan _formerOwner = null;
@@ -364,6 +365,7 @@
       }

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

       if(getSiege().getIsInProgress())
       {
@@ -552,6 +554,7 @@

             _taxPercent = rs.getInt("taxPercent");
             _treasury = rs.getInt("treasury");
+            _showNpcCrest = rs.getBoolean("showNpcCrest");
          }

          rs.close();
@@ -854,6 +857,20 @@
       return _treasury;
    }

+   public final boolean getShowNpcCrest()
+   {
+      return _showNpcCrest;
+   }
+
+   public final void setShowNpcCrest(boolean showNpcCrest)
+   {
+      if(_showNpcCrest != showNpcCrest)
+      {
+         _showNpcCrest = showNpcCrest;
+         updateShowNpcCrest();
+      }
+   }
+
    public FastList<SeedProduction> getSeedProduction(int period)
    {
       return period == CastleManorManager.PERIOD_CURRENT ? _production : _productionNext;
@@ -1324,6 +1341,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 boolean isNextPeriodApproved()
    {
       return _isNextPeriodApproved;

And Execute This File :

ALTER TABLE castle ADD showNpcCrest enum('true','false') DEFAULT 'false' NOT NULL;

(Don't Spam Please I Hope To Help People With This Topic)

Edited by Cronia
  • Like 1
Posted

Not even adapted to latest revision, put right credits.

yea is not for last revision But Anyway Easy to inside...I give Credits...Is not my Code...I found Frozen Project...Because I found errors in my Console I fix for work...:)

  • 1 year later...
  • 9 months later...
  • 7 months later...
Posted (edited)

_log -> LOGGER

 

Also why you add this code? Frozen already have it implemented, I believe.

Edited by SweeTs
Posted

Your imports are probably wrong.

Press Ctrl+Shift+O for imports auto correct.

No.. It's syntax issue. He facked up the code totally. Also, who cares it's so damn old post.

  • 4 weeks later...

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

    • Sure. This is the AbnormalStatusWnd.uc file with ability of removing buff with ALT + click https://pastebin.com/iVWpYysq
    • Hello, I add this code here https://maxcheaters.com/topic/248730-agathions-acis-401-does-not-interfere-with-summons-or-pets/.     but i have problem with agathion movement, agathion does not move when the player moves. The player must stop moving for Agathion to come close him.   i think the problem is here at < _followTask = ThreadPool.scheduleAtFixedRate(new Follow(this), 1000, 1000); >>       public void followToOwner()     {                  if (_followTask == null)             _followTask = ThreadPool.scheduleAtFixedRate(new Follow(this), 1000, 1000);                                  int rnd = Rnd.get(-30, +30);         SpawnLocation loc = _owner.getPosition();                          if (!checkIfInRange(1000, this, _owner))             teleport(_owner, 30);                  if (_owner.isMoving())             getAI().tryToFollow(_owner, false);         else         {             if (!checkIfInRange(75, this, _owner))                 getAI().tryToMoveTo(new Location(loc.getX()+rnd, loc.getY()+rnd, loc.getZ()), null);             else if (checkIfInRange(30, this, _owner))                 getAI().tryToIdle();                              if (Config.AGATHION_HEAL_OWNER && !getCast().isCastingNow())             {                 if (_owner.isInOlympiadMode() || _owner.isInDuel() || _owner.getPvpFlag() != 0 || _owner.isInsideZone(ZoneId.PVP) || _owner.getKarma() != 0)                     return;                                  if ((_owner.getStatus().getHpRatio() < Config.AGATHION_PERCENT_TO_HEAL))                     getAI().tryToCast(_owner, 1011, 18);             }             else if (!Config.AGATHION_ONLY_FOLLOW && Config.AGATHION_ALLOW_SOCIAL && !isMoving() && !getCast().isCastingNow())                 broadcastPacket(new SocialAction(this, 1));         }  
    • 🌟 EMERLAND.PW — Open Beta Testing Has Begun! 🎉 Friends! We are excited to announce that the Open Beta Testing of our Lineage 2 Interlude server, based on the new Classic client, has officially started! 🚀 📌 Key Information Server Rates: x50 New client, new possibilities Numerous improvements for a more comfortable gameplay We invite everyone to join the OBT, test the game, and help us make the server even better before the official launch! Your feedback and active participation are very important to us. 🎁 Participation Bonus! After the OBT ends, all active participants will receive a special bonus on their Master Account! 📅 Join now at EMERLAND.PW and become part of our project's history! 🔥 Server Rates Exp/SP: x50 Raid Exp/SP: x50 Adena: x25 Seal Stones: x5 Drop/Spoil: x5 Quest/Quest Adena: x1 RB Drop Rate: x5 Quest Item Drop Rate: x5 Siege Guard Drop Rate: x5 Clan Reputation Rate: x5 Mob Spawn Rate: x2 Manor Rate: x5 ⚙ Server Settings Auto-loot (disabled for bosses) Players with karma cannot use NPC shops Auto skill learning Subclass addition without quest (max. 10 subclasses) Warsmith & Overlord can be added as subclasses Elf & Dark Elf subclasses available for all Heroic skills remain when switching to a subclass Alternative protection for characters after teleport (Celestial Shield for 15 sec) Clan warehouse item withdrawal rights can be given to members, not just CL Catacomb teleportation for Adena Buff limit: 60 (duration: 60 min) Dance/Song limit: 24 (duration: 60 min) Enchanted items can be traded and sold Max enchant level: 20 Multiple character login from one account is allowed Two types of champion mobs: x10, x50 (Drop: 0.5% Gold Einhasad, 5% Silver Shilen) 🛍 In-Game Shop Gear up to B-Grade included Mana Potion, Mana Drug available for Adena Accessories, Costumes, Mounts, Belts, Cloaks – for Silver Shilen & Gold Einhasad (cosmetic only, no P2W) 💰 Main Server Currencies Silver Shilen – earned through events, champion mob drops, voting Gold Einhasad – obtained through server support, events, voting, champion mob drops 🏆 Game Commands .cfg — Game settings .exp — XP to next level .time — Server date & time .clan — Clan panel .relog — Quick relog .ping — Check ping .rb — Raid boss statistics .topclan — Clan rankings .whoiam — Character stats .rcm — Clan recall (CL only) ⚔ In-Game Events The server features 3 events: TvT, DM, CTF. 🔹 Rewards for participation & victories 🕒 Event Schedule (server time .time😞 TvT: 03:00, 08:00, 13:00, 16:00, 19:00, 22:00 DM: 04:00, 10:00, 14:00, 17:00, 20:00, 23:00 CTF: 06:00, 12:00, 15:00, 18:00, 21:00, 00:00 🤖 Auto-Farm Cost: 2 Silver Shilen/hour Limit: 24 hours Activation: .autofarm 🎟 Premium Account Premium boosts all rates x2. 1 day — 1 Gold Einhasad 7 days — 4 Gold Einhasad 30 days — 10 Gold Einhasad ⭐ Server Features Chronicles: Interlude Game Client: Classic Updated Core/Orfen stats (upgraded to level 3) Core Ring 2 lvl: +3% M. Atk, +1 MEN Core Ring 3 lvl: +6% M. Atk, +1 MEN, +1 WIT Orfen Earring 2 lvl: +3% P. Atk, +1 CON Orfen Earring 3 lvl: +6% P. Atk, +1 CON, +1 DEX New Skills Added: Spoilers — Festive Sweeper (AoE sweep) PP, EE, SE, BP — Might of Heaven (PvP skill) Horse Tamers — Hydro Blast (weakened power, 1 Cursed Bone) Cat Tamers — Prominence (weakened power, 1 Cursed Bone) Shadow Tamers — Hurricane (weakened power, 1 Cursed Bone) 🎮 Join us now at EMERLAND.PW and start your adventure today! 🚀
    • Price reduction for Google accounts from 6-12 months after registration - only 0.3157$ each. Top up with Gmail accounts with activated 2FA - 0.3507$ each!
  • Topics

×
×
  • Create New...