I was informed about a packet that allows you to change the name of the npc. I was just wondering if anyone has got this packet or could assist me with it.
You honestly think sending a packet from the server to the client stating the name of the npc is a waste of time? Are you high? Dude, anytime you wanted to change the name of a npc you would have to patch it, how stupid is that.Quote:
Waste of time.
It's much more simpler to do it yourself via ini editing.
#include "StdAfx.h"
#include "NpcEntity.h"
#include "Helper.h"
extern char* szConquerPath;
CNpcEntity::CNpcEntity(BYTE* pMsg, int MsgLength)
{
PACKETREADER rdr;
CreatePacketReader(&rdr, pMsg, MsgLength);
StepPacket(&rdr, sizeof(WORD) * 2);
this->NpcID = ReadPacket<int>(&rdr);
this->X = ReadPacket<WORD>(&rdr);
this->Y = ReadPacket<WORD>(&rdr);
this->NpcType = ReadPacket<WORD>(&rdr);
this->Interaction = ReadPacket<WORD>(&rdr);
StepPacket(&rdr, sizeof(WORD));
if (ReadPacket<BYTE>(&rdr))
{
int len = ReadPacket<BYTE>(&rdr);
for (int i = 0; i < len; i++)
szName[i] = ReadPacket<char>(&rdr);
szName[len] = NULL;
}
else
{
char szNpc[MAX_PATH];
strcpy(szNpc, szConquerPath);
strcat(szNpc, "ini\\npc.ini");
char szLookFor[32];
sprintf(szLookFor, "NpcType%d", (int)(this->NpcType / 10));
GetPrivateProfileStringA(szLookFor, "Name", "NPC_ERROR", szName, sizeof(szName), szNpc);
}
}
CNpcEntity::~CNpcEntity(void)
{
}
Not trying to flame the OP or anything but seeing as the kind of help he asks for all the time, I don't think he will be able to figure it out based on this fine code.Quote:
If your smart enough and can figure it out based on the code below, grats;
Code:#include "StdAfx.h" #include "NpcEntity.h" #include "Helper.h" extern char* szConquerPath; CNpcEntity::CNpcEntity(BYTE* pMsg, int MsgLength) { PACKETREADER rdr; CreatePacketReader(&rdr, pMsg, MsgLength); StepPacket(&rdr, sizeof(WORD) * 2); this->NpcID = ReadPacket<int>(&rdr); this->X = ReadPacket<WORD>(&rdr); this->Y = ReadPacket<WORD>(&rdr); this->NpcType = ReadPacket<WORD>(&rdr); this->Interaction = ReadPacket<WORD>(&rdr); StepPacket(&rdr, sizeof(WORD)); if (ReadPacket<BYTE>(&rdr)) { int len = ReadPacket<BYTE>(&rdr); for (int i = 0; i < len; i++) szName[i] = ReadPacket<char>(&rdr); szName[len] = NULL; } else { char szNpc[MAX_PATH]; strcpy(szNpc, szConquerPath); strcat(szNpc, "ini\\npc.ini"); char szLookFor[32]; sprintf(szLookFor, "NpcType%d", (int)(this->NpcType / 10)); GetPrivateProfileStringA(szLookFor, "Name", "NPC_ERROR", szName, sizeof(szName), szNpc); } } CNpcEntity::~CNpcEntity(void) { }
Damn, so many things i want to say but i would rather not be banned.Quote:
Not trying to flame the OP or anything but seeing as the kind of help he asks for all the time, I don't think he will be able to figure it out based on this fine code.
I wasn't flaming you at all.Quote:
Damn, so many things i want to say but i would rather not be banned.
If your so smart Hep C, you figure out the freaking thing, and both of us know its easier to change the npc name via packet but you or anyone else can't figure it out so we all go with the old fashion way. The reason i ask so many questions is because i don't like doing stuff the same way as everyone, obviously. The few questions i have asked have been about a different npc system that i bet you couldn't do. So before you start criticizing people you need to look at what he/she is trying to accomplish, and if its the same shit as everyone else, call them stupid or w/e. But if they are actually trying to do something different don't be a fucking ass hole.
#Mods, none of those curse words were directed to anyone and were not intended to hurt anyone's feelings.
Quote:
Damn, so many things i want to say but i would rather not be banned.
If your so smart Hep C, you figure out the freaking thing, and both of us know its easier to change the npc name via packet but you or anyone else can't figure it out so we all go with the old fashion way. The reason i ask so many questions is because i don't like doing stuff the same way as everyone, obviously. The few questions i have asked have been about a different npc system that i bet you couldn't do. So before you start criticizing people you need to look at what he/she is trying to accomplish, and if its the same shit as everyone else, call them stupid or w/e. But if they are actually trying to do something different don't be a fucking ass hole.
#Mods, none of those curse words were directed to anyone and were not intended to hurt anyone's feelings.
I don't understand why you would think it would be simpler. If all you had to do was "NpcName = BallsLicker" to change the name, by god thats what i would do. If you had to do the autopatch it would get overwhelming.Quote:
I wasn't flaming you at all.
And yes I can configure it to fit the 5165.
But instead of doing something like this I actually spend time working on bugs and attempting to make the source better.
And like I said, its much more simpler just to change the npc name via ini editing. And only thing you would have to worry about ispatching, which is why an autopatcher would come in handy.
Like i had said before, i don't like doing shit the simple way, and everyone is to big of an asshole to help. Hybrid i don't mean you, i know your helping by letting me do it on my own :DQuote:
An autopatcher is essential to a private server. So why not just do it the simple way, and work up the ladder and learn while you are doing it.
Quote:
Originally Posted by InfamousNoone... just jumping in doesn't quite cut it, you usually just end up asking for help and usually annoying people. A crucial rule I've always lived by is never ask for help, unless you honestly need it. I usually try at the problem for a few days before I give up..