|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days. |
 |
|
 |

12-29-2002, 06:09 PM
|
Senior Member Former EQEmu Developer Current EQ2Emu Lead Developer
|
|
Join Date: Dec 2002
Posts: 1,065
|
|
Getting rid of the 0 in npc names
I made a separate function that gets rid of the 0 is an npcs name when it is needed. I made added this because I didnt really like the way it was displaying the npc's name. Useful for quests and such that you dont want the name to be Priest of Discord0 says. blah blah blah.... anyways here it is:
Add the following to entity.h:
Code:
void NPCMessage(Mob* sender, bool skipsender, float dist, int32 type, const char* message, ...);
Add this to entity.cpp:
Code:
void EntityList::NPCMessage(Mob* sender, bool skipsender, float dist, int32 type, const char* message, ...) {
va_list argptr;
char buffer[4096];
char *findzero;
int stripzero;
va_start(argptr, message);
vsnprintf(buffer, 4095, message, argptr);
va_end(argptr);
findzero = strstr( buffer, "0" );
stripzero = (int)(findzero - buffer + 2);
if (stripzero > 2) //Incase its not an npc, you dont want to crash the zone
strncpy(buffer + stripzero," ",1);
float dist2 = dist * dist; //pow(dist, 2);
LinkedListIterator<Entity*> iterator(list);
cout << "Message:" << buffer << endl;
if (dist2==0) { //If 0 then send to the whole zone
iterator.Reset();
while(iterator.MoreElements())
{
if (iterator.GetData()->IsClient())
{
Client* client = iterator.GetData()->CastToClient();
client->Message(type, buffer);
}
iterator.Advance();
}
}
else {
iterator.Reset();
while(iterator.MoreElements())
{
if (iterator.GetData()->IsClient() && iterator.GetData()->CastToClient()->DistNoRoot(sender) <= dist2 && (!skipsender || iterator.GetData() != sender)) {
iterator.GetData()->CastToClient()->Message(type, buffer);
}
iterator.Advance();
}
}
}
after you do that just call this function instead of MessageClose or Message. IE in Wesquest.cpp change:
Code:
else if (strstr(command,"SAY") != NULL) {
entity_list.MessageClose(this, false, 400, 0, "%s says, '%s'", other->GetName(), nmessage);
ps = true;
}
to:
Code:
else if (strstr(command,"SAY") != NULL) {
entity_list.NPCMessage(this, false, 400, 0, "%s says, '%s'", other->GetName(), nmessage);
ps = true;
}
This will cause strip the 0 from the end of the npcs name.
Another example, change:
Code:
else if (strstr(command,"SHOUT") != NULL) {
entity_list.Message(0, 0, "%s shouts, '%s'", other->GetName(), nmessage);
ps = true;
}
to:
Code:
else if (strstr(command,"SHOUT") != NULL) {
entity_list.NPCMessage(this,false,0,13, "%s shouts, '%s'", other->GetName(), nmessage);
ps = true;
}
The 0 in this is what makes this displayed to the whole zone. (Substitute a 0 in for the distance variable to send to the zone). Hope this helps someone. :P -LethalEncounter
|
 |
|
 |

12-29-2002, 10:16 PM
|
Discordant
|
|
Join Date: Jan 2002
Posts: 305
|
|
Does this revert it back to using just two digits for NPCs? Or just hide the third digit?
EQEmu is going non-standard, using 3 digits. It was stated in a previous thread that EQLive uses 3 now. However, it does not. It only uses 2 digits, even in Planes of Power.
|

12-30-2002, 01:27 AM
|
Sarnak
|
|
Join Date: Oct 2002
Posts: 50
|
|
I just came from EQLive in South Karana a couple hours ago.
I was in South Karana with my mage for the heck of it, putting the beat down on the gnolls and I've seen the gnolls go after my pet and seeing:
A Tesch Mas Gnoll00 says, 'I'll teach you to mess with, yada yada, Gerber00.'
I don't know why ever EQEmu uses or has 3 digits. What is the purpose other than having a bunch of mobs running around in a zone? I never in my life with EQEmuing, seen a server with more than maybe 70-95 of the same mob. Then again, I may have over lookd something somewhere.
Quote:
Originally Posted by steve
Does this revert it back to using just two digits for NPCs? Or just hide the third digit?
EQEmu is going non-standard, using 3 digits. It was stated in a previous thread that EQLive uses 3 now. However, it does not. It only uses 2 digits, even in Planes of Power.
|
|

12-30-2002, 06:04 AM
|
Senior Member Former EQEmu Developer Current EQ2Emu Lead Developer
|
|
Join Date: Dec 2002
Posts: 1,065
|
|
The above just hides the 0 so that it isnt displayed when an npc says something. Its still there but this just hides it from being displayed.
|

12-30-2002, 08:21 AM
|
Discordant
|
|
Join Date: Jan 2002
Posts: 305
|
|
Ok, thanks! Now what we need is a patch to get rid of the redundant 0.
Zafar, yep, I'm a mage too. I can verify with 200% certainty that EQLive only uses two digits. I'm sure we could have some ex-GM/Guides back this up as well.
Just as you said, there would NOT be over 99 NPCs of the exact same named NPC in a zone. Maybe 99 white bunnies and 99 brown bunnies. But not 200 black bunnies. And it makes sense too, no one wants to see that many hundreds of the exact same mob.
|

12-30-2002, 10:43 AM
|
 |
Dragon
|
|
Join Date: Jan 2002
Posts: 708
|
|
EQEMu supports 000.
|

01-02-2003, 04:30 AM
|
Fire Beetle
|
|
Join Date: Sep 2002
Posts: 0
|
|
Plz cry some more
|

01-02-2003, 06:08 AM
|
Senior Member Former EQEmu Developer Current EQ2Emu Lead Developer
|
|
Join Date: Dec 2002
Posts: 1,065
|
|
Wahhhh :*(
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 04:37 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |