Fail to set NPC tittle

Horyon

Пляшущий с бубном
Участник
Сообщения
220
Розыгрыши
0
Решения
4
Репутация
53
Реакции
77
Баллы
273
Хроники
  1. Shadow of the Kamael
Исходники
Присутствуют
Сборка
L2jMobius Master class ch2
Hello guys.

I'm using mobius source, and facing a problem with this part of script

Java:
final Npc _NPC = addSpawn(NPC, NPC_SPAWN, false, 30000, true);
NPCSave = _NPC;
_NPC.setSummoner(player);
_NPC.setTitle("teste de titulo 5");
player.setTitle("teste de titulo 5");
_NPC.broadcastStatusUpdate();
_NPC.broadcastInfo();
player.broadcastTitleInfo();
htmltext = "31284-complete.html";
break;

Its working for set Player tittle cause it have a refresh "player.broadcastTitleInfo();" but npc dont have this. i try both options "_NPC.broadcastStatusUpdate();" and "_NPC.broadcastInfo();", but are nothing work.

Any idea how to set tittle to spawned npc?

Ty for any tip!!
 

это делается в пакете npcinfo, по крайней мере я себе на птс делал в нем.
C++:
PWCHAR title  = va_arg(tag, PWCHAR);
        if(CNPC *pNpc = CNPC::GetNPCByServerId(&objectId))
        {
            if((pNpc->pSD->nClass == 1 || pNpc->pSD->nClass == 81 || pNpc->pSD->nClass == 82))
            {
                int level = pNpc->pSD->nLevel;
                std::wstringstream wss;
                wss << "*Level " << level << "*";
                wstring value = wss.str();
                const WCHAR * value2 = value.c_str();
                /*S*/ Packet.WriteS((PWCHAR)value2);
            }
            else
            {
                /*S*/ Packet.WriteS(title); 
            }
        }
        else
        {
            /*S*/ Packet.WriteS(title); 
        }
 
  • Мне нравится
Реакции: kick
Much different... maybe someone who at least use java can try give me a help.. But ty for help WmzBot
 
Hello guys.

I'm using mobius source, and facing a problem with this part of script

Java:
final Npc _NPC = addSpawn(NPC, NPC_SPAWN, false, 30000, true);
NPCSave = _NPC;
_NPC.setSummoner(player);
_NPC.setTitle("teste de titulo 5");
player.setTitle("teste de titulo 5");
_NPC.broadcastStatusUpdate();
_NPC.broadcastInfo();
player.broadcastTitleInfo();
htmltext = "31284-complete.html";
break;

Its working for set Player tittle cause it have a refresh "player.broadcastTitleInfo();" but npc dont have this. i try both options "_NPC.broadcastStatusUpdate();" and "_NPC.broadcastInfo();", but are nothing work.

Any idea how to set tittle to spawned npc?

Ty for any tip!!
Try to not broadcast, try send full packet after setting title.
 
  • Мне нравится
Реакции: kick
Java:
final Npc _NPC = addSpawn(NPC, NPC_SPAWN, false, 30000, true);
NPCSave = _NPC;
_NPC.setSummoner(player);
_NPC.setTitle("teste de titulo 5");
player.setTitle("teste de titulo 5");
_NPC.broadcastPacket(new NicknameChanged(NPCSave));
player.broadcastTitleInfo();
htmltext = "31284-complete.html";
break;

worked... ty MrKirill1232
 
Назад
Сверху Снизу