Jump to content
  • 0

[Interlude] Changing NPC Title color


Dreigons

Question

Hello,

 

I have one question. Is any way to change NPC title color without editing client side (npcname-e.dat)? i mean from server side. (Client Interlude). 

 

Or maybe someone already have edited npcname-e.dat with NPC levels and different colors for aggro monsters?

 

Here is my NpcInfo packet

 

protected final void writeImpl()
    {
        if (_activeChar == null)
        {
            return;
        }
        
        if (_activeChar instanceof L2Summon)
        {
            if (((L2Summon) _activeChar).getOwner() != null && ((L2Summon) _activeChar).getOwner().getAppearance().getInvisible())
            {
                return;
            }
        }
        
        writeC(0x16);
        writeD(_activeChar.getObjectId());
        writeD(_idTemplate + 1000000);
        writeD(_isAttackable ? 1 : 0);
        writeD(_x);
        writeD(_y);
        writeD(_z);
        writeD(_heading);
        writeD(0x00);
        writeD(_mAtkSpd);
        writeD(_pAtkSpd);
        writeD(_runSpd);
        writeD(_walkSpd);
        writeD(_swimRunSpd);
        writeD(_swimWalkSpd);
        writeD(_flRunSpd);
        writeD(_flWalkSpd);
        writeD(_flyRunSpd);
        writeD(_flyWalkSpd);
        writeF(1.1);
        writeF(_pAtkSpd / 277.478340719);
        writeF(_collisionRadius);
        writeF(_collisionHeight);
        writeD(_rhand);
        writeD(0);
        writeD(_lhand);
        writeC(1);
        writeC(_activeChar.isRunning() ? 1 : 0);
        writeC(_activeChar.isInCombat() ? 1 : 0);
        writeC(_activeChar.isAlikeDead() ? 1 : 0);
        writeC(_isSummoned ? 2 : 0);
        writeS(_name);
        writeS(_title);
        
        if (_activeChar instanceof L2Summon)
        {
            writeD(0x01);
            writeD(((L2Summon) _activeChar).getPvpFlag());
            writeD(((L2Summon) _activeChar).getKarma());
        }
        else
        {
            writeD(0);
            writeD(0);
            writeD(0);
        }
        
        writeD(_activeChar.getAbnormalEffect());
        
        if (Config.SHOW_NPC_CREST)
        {
            writeD(_clanId);
            writeD(_clanCrest);
            writeD(_allyId);
            writeD(_allyCrest);
        }
        else
        {
            writeD(0);
            writeD(0);
            writeD(0);
            writeD(0);
        }
        
        writeC(0000); // C2
        
        if (Config.L2JMOD_CHAMPION_ENABLE)
        {
            writeC(_activeChar.isChampion() ? Config.L2JMOD_CHAMP_AURA : 0);
        }
        else
        {
            writeC(0);
        }
        
        writeF(_collisionRadius);
        writeF(_collisionHeight);
        
        writeD(0x00); // C4
        writeD(0x00); // C6
    }

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hey Mr Dreigons, may i can quickly help you out, you can dm me via DC. By the way, there is no way to do such thing othet than modifying the client dats, not a hard task, but quite booring. GL.

Link to comment
Share on other sites

  • 0

Easy peasy 😄

i have one simple PHP script. 

<?php
$acis = glob("acis/*xml"); // npc folder acis.
$npcs = array();
function one($string,$one,$two){
	$s = @explode($one,$string);
	$s = @explode($two,$s[1]);
	return @$s[0];
}
if (is_array($acis)) {
     foreach($acis as $filename) {
     $file = file_get_contents($filename);
	$file = explode("<npc",$file);
	 unset($file[0]);
	 foreach ($file as &$value) {
	$value = "<npc".$value;
	$id = one($value,'id="','"');
	$type = one($value,'name="type" val="','"');
	$level = one($value,'name="level" val="','"');
	$aggro = one($value,'aggro="','"');
	$npcs[$id] = array("type"=>$type,"level"=>$level,'aggro'=>$aggro);
		 }
	 }
}
$file = file_get_contents("npcnames.txt");
$file = explode("\r\n",$file);
$client = array();
foreach($file as $npc) {
	$ex = explode("	",$npc);
	$client[$ex[0]] = $ex;
}
// 0 - id
// 1 - name
// 2 - title
// 3 - r
// 4 - g
// 5 - b
// 6 - reserved

foreach($npcs as $id => &$npc){
	
if($npc['type'] == "Monster"){
	$client[$id][2] = $npc['level']." Level";
	if($npc['aggro']>0){
	$client[$id][3] = "FF";
	$client[$id][4] = "FF";
	$client[$id][5] = "FF";
	}
}

}

// print npcnames.... CTRL+U in browser.
foreach($client as &$val){
echo implode("	",$val)."\r\n";
}
?>

you can adapt for any pack.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...