Jump to content
  • 0

[Request] NPC Crests


Question

Posted

Hello ....i saw this but is for gracia ....someone to make it for interlude ? can?

 

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;

7 answers to this question

Recommended Posts

  • 0
Posted

On IL, the packet is named NpcInfo, and even if there is the right slots (4 missings infos), I don't think you can activate it, as this packet update came from C2 (from what I rem of remarks).

 

Still you can try.

 

1 - Create a clan with clan crest, note the clanID and crestID.

2 - Edit packet NpcInfo and put fixed infos where they supposed to be, writing in core directly the values.

3 - Then compile and test ingame if you focked it or no.

 

I can't really say it won't work if no one tested it before :).

  • 0
Posted

So you know the answer :P.

 

AbstractNpcInfo > NpcInfo, all other is fine.

 

In your diff patch, it misses the principal information in NpcInfo. Anyway on IL your patch can't work like that.

  • 0
Posted

so u can`t make it ....to help me ? :-? ....

 

Don't expect ready code :)

 

Put some own effort, and with our help, u will manage it.

  • 0
Posted

I got it in my interlude server. I had the same problem, but i fixed it. Well the code is 'fine' but its not completed. If you take a look at the code, there is no code that 'puts' the crest at NPC's name. That was my problem and i solved it.

  • 0
Posted

I got it in my interlude server. I had the same problem, but i fixed it. Well the code is 'fine' but its not completed. If you take a look at the code, there is no code that 'puts' the crest at NPC's name. That was my problem and i solved it.

 

Could you share how you did that?

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

    • You think you have good “l2j” files until you try running a low-rate server.   Saying “there’s not a single L2 server out there worth mentioning” just shows you probably only know the first 10 servers on voting sites, the same voting sites that owned by them. You call the forum dead, yet you’re here discussing your next projects… From my perspective, you don’t seem ready to run any L2 server in 2025. Around 70% of players are here for RMT or ask for payment just to bring their clan, and you really think the community cares about Premium or donations or files quality? The other 20% spend their time downloading and deleting servers all day, playing for one day, then quitting for whatever random reason. And finally, the last 10% are the only ones who actually play because they genuinely like your features, your server files, and your overall project. Good luck 🙂
    • I genuinely admire your bravery - in an age where AI can whip up something better in under a minute, you still stubbornly try to sell these "projects" of yours on a forum that’s been clinically dead for years. That’s no longer determination, that’s digital archaeology. I just can’t tell whether you’re actually trying to make money, or simply testing how much we can endure before we ask an AI to generate you some actual talent.   And ofc AI will make it for free, $220 saved.
    • I’m glad I’m not the only one who appreciates Maxthor’s involvement in group gay orgies, he can’t be bothered to reply to messages, but covering the entire forum in gay lights is absolutely no issue for him. As for the project - the forum is packed with feedback from the testers, the lads are spending every spare moment fixing even the tiniest typo in an NPC’s text. I’ll share the links as soon as I get the green light. Edit: I forgot to add that the GM recruitment will begin once the links are released. Three people will be accepted, and they’ll work in a three-shift rotation so that there’s always a GM available online.
    • Added: a brand-new default dashboard template. You can now add multiple game/login server builds. Full support for running both PTS & L2J servers simultaneously, with switching between them. Payment systems: added OmegaPay and Pally (new PayPal-style API). Account history now stores everything: donations, items delivered to characters, referrals, transfers between game accounts, and coin transfers to another master account. Personal Promo Code System: you can create a promo code and assign it to a user or promoter. When donating, a player can enter this promo code to receive bonus coins, and the promo code owner also receives a bonus — all fully configurable in the admin panel.     Look demo site: demo
    • One of best project i play last few years
  • 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