ЦВет ника у Npc
13 replies168 viewsCurrently viewing: 1
· 01/08/2010, 07:03 PM
Сборка: Scoria 3.1u9
Суть Проблемы: Хотелось бы узнать возможно ли такое!
Вопрос:Можно ли менять цвет ников у NPC допустим ГМ шопа.
Мои довады нету.
Вот пример на картинки привел:
0
· 01/08/2010, 07:15 PM
Сделать можно всё, но через ядро.
0
· 01/08/2010, 07:21 PM
парни давайте по делу меня не интересует, то что там через ядро у меня исходов нет 30 ВМз в час не хочется за это отдавать, должен быть другой выход!
0
· 01/08/2010, 07:23 PM
User2rwfe: Сборка: Scoria 3.1u9
Суть Проблемы: Хотелось бы узнать возможно ли такое!
Вопрос:Можно ли менять цвет ников у NPC допустим ГМ шопа.
Мои довады нету.
Вот пример на картинки привел:
в грации топаем в ядро в serverpackets в пакет AbstractNpcInfo
находим там строки
writeS(_name);
writeS(_title);
writeD(0x00); // Title color 0=client default
writeD(0x00);
последние 2 строчки скорее всего и дают цвет титула и имени
ПыСы по другому никак .. потому как самолеты без топлива не летают
0
· 01/08/2010, 07:25 PM
у меня интерлюд
0
· 01/08/2010, 07:30 PM
User2rwfe: у меня интерлюд
Можно это сделать патчем. сейчас точно не вспомню как, но можно. Причём в лёгкую. Но ники будут отображаться только с твоим патчем;).
P.S. А ядо тут не причем ( вернее можно проще);).
Если никто не выложит как сделать. Завтра поковыряюсь. В ЛС напиши что-бы не потерял тему.
Я раздолбай уже не первый год.
0
· 01/08/2010, 07:31 PM
User2rwfe: у меня интерлюд
тогда пакет называется просто NpcInfo
остальное так же
0
· 01/08/2010, 07:32 PM
жаль, но исходов нету
0
· 01/08/2010, 07:32 PM
Zveru: Можно это сделать патчем. сейчас точно не вспомню как, но можно. Причём в лёгкую. Но ники будут отображаться только с твоим патчем;).
P.S. А ядо тут не причем ( вернее можно проще);).
Если никто не выложит как сделать. Завтра поковыряюсь. В ЛС напиши что-бы не потерял тему.
мало кто из игроков ставит патчи с сервака и соответственно кто не поставит не увидит нужного цвета ...
0
· 01/08/2010, 07:45 PM
User2rwfe: жаль, но исходов нету
Вот тебе исходник данного класса
Раскрывающийся текст
Код
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* http://www.gnu.org/copyleft/gpl.html
*/
package com.l2scoria.gameserver.network.serverpackets;
import com.l2scoria.Config;
import com.l2scoria.gameserver.model.L2Character;
import com.l2scoria.gameserver.model.L2Summon;
import com.l2scoria.gameserver.model.actor.instance.L2MonsterInstance;
import com.l2scoria.gameserver.model.actor.instance.L2NpcInstance;
import com.l2scoria.gameserver.model.actor.instance.L2PetInstance;
/**
* This class ...
*
* @version $Revision: 1.7.2.4.2.9 $ $Date: 2005/04/11 10:05:54 $
*/
public class NpcInfo extends L2GameServerPacket
{
// ddddddddddddddddddffffdddcccccSSddd dddddc
// ddddddddddddddddddffffdddcccccSSddd dddddccffd
private static final String _S__22_NPCINFO = "[S] 16 NpcInfo";
private L2Character _activeChar;
private int _x, _y, _z, _heading;
private int _idTemplate;
private boolean _isAttackable, _isSummoned;
private int _mAtkSpd, _pAtkSpd;
private int _runSpd, _walkSpd, _swimRunSpd, _swimWalkSpd, _flRunSpd, _flWalkSpd, _flyRunSpd, _flyWalkSpd;
private int _rhand, _lhand;
private int _collisionHeight, _collisionRadius;
private String _name = "";
private String _title = "";
/**
* @param _characters
*/
public NpcInfo(L2NpcInstance cha, L2Character attacker)
{
if (cha.getCustomNpcInstance() != null)
{
attacker.sendPacket(new CustomNpcInfo(cha));
return;
}
_activeChar = cha;
_idTemplate = cha.getTemplate().idTemplate;
_isAttackable = cha.isAutoAttackable(attacker);
_rhand = cha.getRightHandItem();
_lhand = cha.getLeftHandItem();
_isSummoned = false;
_collisionHeight = cha.getCollisionHeight();
_collisionRadius = cha.getCollisionRadius();
if (cha.getTemplate().serverSideName)
_name = cha.getTemplate().name;
if(Config.L2JMOD_CHAMPION_ENABLE && cha.isChampion())
_title = (Config.L2JMOD_CHAMP_TITLE);
else if (cha.getTemplate().serverSideTitle)
_title = cha.getTemplate().title;
else
_title = cha.getTitle();
if (Config.SHOW_NPC_LVL && _activeChar instanceof L2MonsterInstance)
{
String t = "Lv " + cha.getLevel() + (cha.getAggroRange() > 0 ? "*" : "");
if (_title != null)
t += " " + _title;
_title = t;
}
_x = _activeChar.getX();
_y = _activeChar.getY();
_z = _activeChar.getZ();
_heading = _activeChar.getHeading();
_mAtkSpd = _activeChar.getMAtkSpd();
_pAtkSpd = _activeChar.getPAtkSpd();
_runSpd = _activeChar.getRunSpeed();
_walkSpd = _activeChar.getWalkSpeed();
_swimRunSpd = _flRunSpd = _flyRunSpd = _runSpd;
_swimWalkSpd = _flWalkSpd = _flyWalkSpd = _walkSpd;
}
public NpcInfo(L2Summon cha, L2Character attacker)
{
_activeChar = cha;
_idTemplate = cha.getTemplate().idTemplate;
_isAttackable = cha.isAutoAttackable(attacker); //(cha.getKarma() > 0);
_rhand = 0;
_lhand = 0;
_isSummoned = cha.isShowSummonAnimation();
_collisionHeight = _activeChar.getTemplate().collisionHeight;
_collisionRadius = _activeChar.getTemplate().collisionRadius;
if (cha.getTemplate().serverSideName || cha instanceof L2PetInstance)
{
_name = _activeChar.getName();
_title = cha.getTitle();
}
_x = _activeChar.getX();
_y = _activeChar.getY();
_z = _activeChar.getZ();
_heading = _activeChar.getHeading();
_mAtkSpd = _activeChar.getMAtkSpd();
_pAtkSpd = _activeChar.getPAtkSpd();
_runSpd = _activeChar.getRunSpeed();
_walkSpd = _activeChar.getWalkSpeed();
_swimRunSpd = _flRunSpd = _flyRunSpd = _runSpd;
_swimWalkSpd = _flWalkSpd = _flyWalkSpd = _walkSpd;
}
@Override
protected final void writeImpl()
{
if (_activeChar instanceof L2Summon)
if (((L2Summon)_activeChar).getOwner() != null
&& ((L2Summon)_activeChar).getOwner().getAppearance().getInvisible())
return;
writeC(0x16);
writeD(_activeChar.getObjectId());
writeD(_idTemplate+1000000); // npctype id
writeD(_isAttackable ? 1 : 0);
writeD(_x);
writeD(_y);
writeD(_z);
writeD(_heading);
writeD(0x00);
writeD(_mAtkSpd);
writeD(_pAtkSpd);
writeD(_runSpd);
writeD(_walkSpd);
writeD(_swimRunSpd/*0x32*/); // swimspeed
writeD(_swimWalkSpd/*0x32*/); // swimspeed
writeD(_flRunSpd);
writeD(_flWalkSpd);
writeD(_flyRunSpd);
writeD(_flyWalkSpd);
writeF(1.1/*_activeChar.getProperMultiplier()*/);
//writeF(1/*_activeChar.getAttackSpeedMultiplier()*/);
writeF(_pAtkSpd/277.478340719);
writeF(_collisionRadius);
writeF(_collisionHeight);
writeD(_rhand); // right hand weapon
writeD(0);
writeD(_lhand); // left hand weapon
writeC(1); // name above char 1=true ... ??
writeC(_activeChar.isRunning() ? 1 : 0);
writeC(_activeChar.isInCombat() ? 1 : 0);
writeC(_activeChar.isAlikeDead() ? 1 : 0);
writeC(_isSummoned ? 2 : 0); // invisible ?? 0=false 1=true 2=summoned (only works if model has a summon animation)
writeS(_name);
writeS(_title);
writeD(0);
writeD(0);
writeD(0000); // hmm karma ??
writeD(_activeChar.getAbnormalEffect()); // C2
writeD(0000); // C2
writeD(0000); // C2
writeD(0000); // C2
writeD(0000); // C2
writeC(0000); // C2
writeC(0x00); // C3 team circle 1-blue, 2-red
writeF(_collisionRadius);
writeF(_collisionHeight);
writeD(0x00); // C4
writeD(0x00); // C6
}
/* (non-Javadoc)
* @see com.l2scoria.gameserver.serverpackets.ServerBasePacket#getType()
*/
@Override
public String getType()
{
return _S__22_NPCINFO;
}
}
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* http://www.gnu.org/copyleft/gpl.html
*/
package com.l2scoria.gameserver.network.serverpackets;
import com.l2scoria.Config;
import com.l2scoria.gameserver.model.L2Character;
import com.l2scoria.gameserver.model.L2Summon;
import com.l2scoria.gameserver.model.actor.instance.L2MonsterInstance;
import com.l2scoria.gameserver.model.actor.instance.L2NpcInstance;
import com.l2scoria.gameserver.model.actor.instance.L2PetInstance;
/**
* This class ...
*
* @version $Revision: 1.7.2.4.2.9 $ $Date: 2005/04/11 10:05:54 $
*/
public class NpcInfo extends L2GameServerPacket
{
// ddddddddddddddddddffffdddcccccSSddd dddddc
// ddddddddddddddddddffffdddcccccSSddd dddddccffd
private static final String _S__22_NPCINFO = "[S] 16 NpcInfo";
private L2Character _activeChar;
private int _x, _y, _z, _heading;
private int _idTemplate;
private boolean _isAttackable, _isSummoned;
private int _mAtkSpd, _pAtkSpd;
private int _runSpd, _walkSpd, _swimRunSpd, _swimWalkSpd, _flRunSpd, _flWalkSpd, _flyRunSpd, _flyWalkSpd;
private int _rhand, _lhand;
private int _collisionHeight, _collisionRadius;
private String _name = "";
private String _title = "";
/**
* @param _characters
*/
public NpcInfo(L2NpcInstance cha, L2Character attacker)
{
if (cha.getCustomNpcInstance() != null)
{
attacker.sendPacket(new CustomNpcInfo(cha));
return;
}
_activeChar = cha;
_idTemplate = cha.getTemplate().idTemplate;
_isAttackable = cha.isAutoAttackable(attacker);
_rhand = cha.getRightHandItem();
_lhand = cha.getLeftHandItem();
_isSummoned = false;
_collisionHeight = cha.getCollisionHeight();
_collisionRadius = cha.getCollisionRadius();
if (cha.getTemplate().serverSideName)
_name = cha.getTemplate().name;
if(Config.L2JMOD_CHAMPION_ENABLE && cha.isChampion())
_title = (Config.L2JMOD_CHAMP_TITLE);
else if (cha.getTemplate().serverSideTitle)
_title = cha.getTemplate().title;
else
_title = cha.getTitle();
if (Config.SHOW_NPC_LVL && _activeChar instanceof L2MonsterInstance)
{
String t = "Lv " + cha.getLevel() + (cha.getAggroRange() > 0 ? "*" : "");
if (_title != null)
t += " " + _title;
_title = t;
}
_x = _activeChar.getX();
_y = _activeChar.getY();
_z = _activeChar.getZ();
_heading = _activeChar.getHeading();
_mAtkSpd = _activeChar.getMAtkSpd();
_pAtkSpd = _activeChar.getPAtkSpd();
_runSpd = _activeChar.getRunSpeed();
_walkSpd = _activeChar.getWalkSpeed();
_swimRunSpd = _flRunSpd = _flyRunSpd = _runSpd;
_swimWalkSpd = _flWalkSpd = _flyWalkSpd = _walkSpd;
}
public NpcInfo(L2Summon cha, L2Character attacker)
{
_activeChar = cha;
_idTemplate = cha.getTemplate().idTemplate;
_isAttackable = cha.isAutoAttackable(attacker); //(cha.getKarma() > 0);
_rhand = 0;
_lhand = 0;
_isSummoned = cha.isShowSummonAnimation();
_collisionHeight = _activeChar.getTemplate().collisionHeight;
_collisionRadius = _activeChar.getTemplate().collisionRadius;
if (cha.getTemplate().serverSideName || cha instanceof L2PetInstance)
{
_name = _activeChar.getName();
_title = cha.getTitle();
}
_x = _activeChar.getX();
_y = _activeChar.getY();
_z = _activeChar.getZ();
_heading = _activeChar.getHeading();
_mAtkSpd = _activeChar.getMAtkSpd();
_pAtkSpd = _activeChar.getPAtkSpd();
_runSpd = _activeChar.getRunSpeed();
_walkSpd = _activeChar.getWalkSpeed();
_swimRunSpd = _flRunSpd = _flyRunSpd = _runSpd;
_swimWalkSpd = _flWalkSpd = _flyWalkSpd = _walkSpd;
}
@Override
protected final void writeImpl()
{
if (_activeChar instanceof L2Summon)
if (((L2Summon)_activeChar).getOwner() != null
&& ((L2Summon)_activeChar).getOwner().getAppearance().getInvisible())
return;
writeC(0x16);
writeD(_activeChar.getObjectId());
writeD(_idTemplate+1000000); // npctype id
writeD(_isAttackable ? 1 : 0);
writeD(_x);
writeD(_y);
writeD(_z);
writeD(_heading);
writeD(0x00);
writeD(_mAtkSpd);
writeD(_pAtkSpd);
writeD(_runSpd);
writeD(_walkSpd);
writeD(_swimRunSpd/*0x32*/); // swimspeed
writeD(_swimWalkSpd/*0x32*/); // swimspeed
writeD(_flRunSpd);
writeD(_flWalkSpd);
writeD(_flyRunSpd);
writeD(_flyWalkSpd);
writeF(1.1/*_activeChar.getProperMultiplier()*/);
//writeF(1/*_activeChar.getAttackSpeedMultiplier()*/);
writeF(_pAtkSpd/277.478340719);
writeF(_collisionRadius);
writeF(_collisionHeight);
writeD(_rhand); // right hand weapon
writeD(0);
writeD(_lhand); // left hand weapon
writeC(1); // name above char 1=true ... ??
writeC(_activeChar.isRunning() ? 1 : 0);
writeC(_activeChar.isInCombat() ? 1 : 0);
writeC(_activeChar.isAlikeDead() ? 1 : 0);
writeC(_isSummoned ? 2 : 0); // invisible ?? 0=false 1=true 2=summoned (only works if model has a summon animation)
writeS(_name);
writeS(_title);
writeD(0);
writeD(0);
writeD(0000); // hmm karma ??
writeD(_activeChar.getAbnormalEffect()); // C2
writeD(0000); // C2
writeD(0000); // C2
writeD(0000); // C2
writeD(0000); // C2
writeC(0000); // C2
writeC(0x00); // C3 team circle 1-blue, 2-red
writeF(_collisionRadius);
writeF(_collisionHeight);
writeD(0x00); // C4
writeD(0x00); // C6
}
/* (non-Javadoc)
* @see com.l2scoria.gameserver.serverpackets.ServerBasePacket#getType()
*/
@Override
public String getType()
{
return _S__22_NPCINFO;
}
}
0
· 01/15/2010, 01:01 AM
segala: Вот тебе исходник данного классаРаскрывающийся текстКод/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* http://www.gnu.org/copyleft/gpl.html
*/
package com.l2scoria.gameserver.network.serverpackets;
import com.l2scoria.Config;
import com.l2scoria.gameserver.model.L2Character;
import com.l2scoria.gameserver.model.L2Summon;
import com.l2scoria.gameserver.model.actor.instance.L2MonsterInstance;
import com.l2scoria.gameserver.model.actor.instance.L2NpcInstance;
import com.l2scoria.gameserver.model.actor.instance.L2PetInstance;
/**
* This class ...
*
* @version $Revision: 1.7.2.4.2.9 $ $Date: 2005/04/11 10:05:54 $
*/
public class NpcInfo extends L2GameServerPacket
{
// ddddddddddddddddddffffdddcccccSSddd dddddc
// ddddddddddddddddddffffdddcccccSSddd dddddccffd
private static final String _S__22_NPCINFO = "[S] 16 NpcInfo";
private L2Character _activeChar;
private int _x, _y, _z, _heading;
private int _idTemplate;
private boolean _isAttackable, _isSummoned;
private int _mAtkSpd, _pAtkSpd;
private int _runSpd, _walkSpd, _swimRunSpd, _swimWalkSpd, _flRunSpd, _flWalkSpd, _flyRunSpd, _flyWalkSpd;
private int _rhand, _lhand;
private int _collisionHeight, _collisionRadius;
private String _name = "";
private String _title = "";
/**
* @param _characters
*/
public NpcInfo(L2NpcInstance cha, L2Character attacker)
{
if (cha.getCustomNpcInstance() != null)
{
attacker.sendPacket(new CustomNpcInfo(cha));
return;
}
_activeChar = cha;
_idTemplate = cha.getTemplate().idTemplate;
_isAttackable = cha.isAutoAttackable(attacker);
_rhand = cha.getRightHandItem();
_lhand = cha.getLeftHandItem();
_isSummoned = false;
_collisionHeight = cha.getCollisionHeight();
_collisionRadius = cha.getCollisionRadius();
if (cha.getTemplate().serverSideName)
_name = cha.getTemplate().name;
if(Config.L2JMOD_CHAMPION_ENABLE && cha.isChampion())
_title = (Config.L2JMOD_CHAMP_TITLE);
else if (cha.getTemplate().serverSideTitle)
_title = cha.getTemplate().title;
else
_title = cha.getTitle();
if (Config.SHOW_NPC_LVL && _activeChar instanceof L2MonsterInstance)
{
String t = "Lv " + cha.getLevel() + (cha.getAggroRange() > 0 ? "*" : "");
if (_title != null)
t += " " + _title;
_title = t;
}
_x = _activeChar.getX();
_y = _activeChar.getY();
_z = _activeChar.getZ();
_heading = _activeChar.getHeading();
_mAtkSpd = _activeChar.getMAtkSpd();
_pAtkSpd = _activeChar.getPAtkSpd();
_runSpd = _activeChar.getRunSpeed();
_walkSpd = _activeChar.getWalkSpeed();
_swimRunSpd = _flRunSpd = _flyRunSpd = _runSpd;
_swimWalkSpd = _flWalkSpd = _flyWalkSpd = _walkSpd;
}
public NpcInfo(L2Summon cha, L2Character attacker)
{
_activeChar = cha;
_idTemplate = cha.getTemplate().idTemplate;
_isAttackable = cha.isAutoAttackable(attacker); //(cha.getKarma() > 0);
_rhand = 0;
_lhand = 0;
_isSummoned = cha.isShowSummonAnimation();
_collisionHeight = _activeChar.getTemplate().collisionHeight;
_collisionRadius = _activeChar.getTemplate().collisionRadius;
if (cha.getTemplate().serverSideName || cha instanceof L2PetInstance)
{
_name = _activeChar.getName();
_title = cha.getTitle();
}
_x = _activeChar.getX();
_y = _activeChar.getY();
_z = _activeChar.getZ();
_heading = _activeChar.getHeading();
_mAtkSpd = _activeChar.getMAtkSpd();
_pAtkSpd = _activeChar.getPAtkSpd();
_runSpd = _activeChar.getRunSpeed();
_walkSpd = _activeChar.getWalkSpeed();
_swimRunSpd = _flRunSpd = _flyRunSpd = _runSpd;
_swimWalkSpd = _flWalkSpd = _flyWalkSpd = _walkSpd;
}
@Override
protected final void writeImpl()
{
if (_activeChar instanceof L2Summon)
if (((L2Summon)_activeChar).getOwner() != null
&& ((L2Summon)_activeChar).getOwner().getAppearance().getInvisible())
return;
writeC(0x16);
writeD(_activeChar.getObjectId());
writeD(_idTemplate+1000000); // npctype id
writeD(_isAttackable ? 1 : 0);
writeD(_x);
writeD(_y);
writeD(_z);
writeD(_heading);
writeD(0x00);
writeD(_mAtkSpd);
writeD(_pAtkSpd);
writeD(_runSpd);
writeD(_walkSpd);
writeD(_swimRunSpd/*0x32*/); // swimspeed
writeD(_swimWalkSpd/*0x32*/); // swimspeed
writeD(_flRunSpd);
writeD(_flWalkSpd);
writeD(_flyRunSpd);
writeD(_flyWalkSpd);
writeF(1.1/*_activeChar.getProperMultiplier()*/);
//writeF(1/*_activeChar.getAttackSpeedMultiplier()*/);
writeF(_pAtkSpd/277.478340719);
writeF(_collisionRadius);
writeF(_collisionHeight);
writeD(_rhand); // right hand weapon
writeD(0);
writeD(_lhand); // left hand weapon
writeC(1); // name above char 1=true ... ??
writeC(_activeChar.isRunning() ? 1 : 0);
writeC(_activeChar.isInCombat() ? 1 : 0);
writeC(_activeChar.isAlikeDead() ? 1 : 0);
writeC(_isSummoned ? 2 : 0); // invisible ?? 0=false 1=true 2=summoned (only works if model has a summon animation)
writeS(_name);
writeS(_title);
writeD(0);
writeD(0);
writeD(0000); // hmm karma ??
writeD(_activeChar.getAbnormalEffect()); // C2
writeD(0000); // C2
writeD(0000); // C2
writeD(0000); // C2
writeD(0000); // C2
writeC(0000); // C2
writeC(0x00); // C3 team circle 1-blue, 2-red
writeF(_collisionRadius);
writeF(_collisionHeight);
writeD(0x00); // C4
writeD(0x00); // C6
}
/* (non-Javadoc)
* @see com.l2scoria.gameserver.serverpackets.ServerBasePacket#getType()
*/
@Override
public String getType()
{
return _S__22_NPCINFO;
}
}
Ооо спасибо миня тоже заинтересовало
0
Topic is closed for replies






