L2JMobius

C6 Clan Crest npcs

caioconc · 4 · 5143

Offline caioconc

  • Heir
  • **
    • Posts: 33
this is my contribution..

https://imgur.com/q5LOgVH

Code: [Select]
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java
@@ -17,12 +17,14 @@
 package org.l2jmobius.gameserver.network.serverpackets;
 
 import org.l2jmobius.Config;
+import org.l2jmobius.gameserver.datatables.sql.ClanTable;
 import org.l2jmobius.gameserver.model.actor.Creature;
 import org.l2jmobius.gameserver.model.actor.Summon;
 import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
 import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
 import org.l2jmobius.gameserver.model.actor.instance.PetInstance;
 import org.l2jmobius.gameserver.model.actor.instance.SummonInstance;
+import org.l2jmobius.gameserver.model.clan.Clan;
 
 /**
  * @version $Revision: 1.7.2.4.2.9 $ $Date: 2005/04/11 10:05:54 $
@@ -53,6 +55,7 @@
  private int _collisionRadius;
  private String _name = "";
  private String _title = "";
+ protected int _clanCrest, _allyCrest, _allyId, _clanId;
 
  /**
  * Instantiates a new npc info.
@@ -114,7 +117,7 @@
  final MonsterInstance monster = (MonsterInstance) cha;
  if (monster.isAggressive())
  {
t2 += "[A]"; // Aggressive.

  }
  }
  t1 += t2;
@@ -125,6 +128,15 @@
  _title = cha.isChampion() ? Config.CHAMP_TITLE + " " + t1 : t1;
  }
 
+ if ((cha.getCastle() != null) && (cha.getCastle().getOwnerId() != 0))
+ {
+ Clan clan = ClanTable.getInstance().getClan(cha.getCastle().getOwnerId());
+ _clanCrest = clan.getCrestId();
+ _clanId = clan.getClanId();
+ _allyCrest = clan.getAllyCrestId();
+ _allyId = clan.getAllyId();
+ }
+
  _x = _creature.getX();
  _y = _creature.getY();
  _z = _creature.getZ();
@@ -236,11 +248,11 @@
  }
 
  writeD(_creature.getAbnormalEffect()); // C2
- writeD(0000); // C2
- writeD(0000); // C2
- writeD(0000); // C2
- writeD(0000); // C2
- writeC(0000); // C2
+
+ writeD(_clanId);
+ writeD(_clanCrest);
+ writeD(_allyId);
+ writeD(_allyCrest);// C2
 
  writeC(0x00); // C3 team circle 1-blue, 2-red
  writeF(_collisionRadius);


Online Mobius

  • Distinguished King
  • *****
    • Posts: 16050
this is my contribution..

https://imgur.com/q5LOgVH

Code: [Select]
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java
@@ -17,12 +17,14 @@
 package org.l2jmobius.gameserver.network.serverpackets;
 
 import org.l2jmobius.Config;
+import org.l2jmobius.gameserver.datatables.sql.ClanTable;
 import org.l2jmobius.gameserver.model.actor.Creature;
 import org.l2jmobius.gameserver.model.actor.Summon;
 import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance;
 import org.l2jmobius.gameserver.model.actor.instance.NpcInstance;
 import org.l2jmobius.gameserver.model.actor.instance.PetInstance;
 import org.l2jmobius.gameserver.model.actor.instance.SummonInstance;
+import org.l2jmobius.gameserver.model.clan.Clan;
 
 /**
  * @version $Revision: 1.7.2.4.2.9 $ $Date: 2005/04/11 10:05:54 $
@@ -53,6 +55,7 @@
  private int _collisionRadius;
  private String _name = "";
  private String _title = "";
+ protected int _clanCrest, _allyCrest, _allyId, _clanId;
 
  /**
  * Instantiates a new npc info.
@@ -114,7 +117,7 @@
  final MonsterInstance monster = (MonsterInstance) cha;
  if (monster.isAggressive())
  {
t2 += "[A]"; // Aggressive.

  }
  }
  t1 += t2;
@@ -125,6 +128,15 @@
  _title = cha.isChampion() ? Config.CHAMP_TITLE + " " + t1 : t1;
  }
 
+ if ((cha.getCastle() != null) && (cha.getCastle().getOwnerId() != 0))
+ {
+ Clan clan = ClanTable.getInstance().getClan(cha.getCastle().getOwnerId());
+ _clanCrest = clan.getCrestId();
+ _clanId = clan.getClanId();
+ _allyCrest = clan.getAllyCrestId();
+ _allyId = clan.getAllyId();
+ }
+
  _x = _creature.getX();
  _y = _creature.getY();
  _z = _creature.getZ();
@@ -236,11 +248,11 @@
  }
 
  writeD(_creature.getAbnormalEffect()); // C2
- writeD(0000); // C2
- writeD(0000); // C2
- writeD(0000); // C2
- writeD(0000); // C2
- writeC(0000); // C2
+
+ writeD(_clanId);
+ writeD(_clanCrest);
+ writeD(_allyId);
+ writeD(_allyCrest);// C2
 
  writeC(0x00); // C3 team circle 1-blue, 2-red
  writeF(_collisionRadius);

You removed 4x writeD and 1x writeC and added only 4x writeD.