Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

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

Reply
 
Thread Tools Display Modes
  #1  
Old 10-22-2002, 01:20 AM
Xarslik
Hill Giant
 
Join Date: Oct 2002
Location: System.Web
Posts: 107
Default WesQuests.cpp Utils, Changes, Etc

Going to edit this post as I add more changes etc.

I was bored, and I noticed when using the quest functions SAY, SHOUT, EMOTE etc... NPCs name's have 0 appended to them.
This is due to the fact that EQLive only uses 2 digits for their NPC numbering (eg. a_shadow_wolf01), while EQEmu uses 3 (a_shadow_wolf001). Therefore when processed, I'm assuming the EQClient automatically removes 2 digits from the end of the name. However, because of EQEmu's 3, you're left with "a shadow wolf0 says, "Hi there, Soandso!". Anyway, I added the following code snippets to WesQuests.cpp and client.h that effectively remove any 0's through 9's and replace them with a null character.

client.h
I added this after the "char * strreplace" line, in the public section of class Client.
Code:
char * stripNumFromStr( const char* strToStrip );
WesQuests.cpp
I added this after the method "Client::strreplace".
(Originally it was editing the NPC's actual Name, which is very very bad. Changed it to store it in a static char once I found out the max length for a name)
Code:
char* Client::stripNumFromStr ( const char* strToStrip )
{
	static char tempStr[30];
	strcpy(tempStr, strToStrip);
	int a;
	for(a=0;a<strlen(strToStrip);a++)
	{
		if(tempStr[a] >= 48 && tempStr[a] <= 57)
			tempStr[a] = '\0';
	}

	return tempStr;
}
WesQuests.cpp
Now simply wrap the "this->target->GetName()" call inside a call to stripNumFromStr.

Here is SAY (modified):
Code:
entity_list.Message(0, MT_Say, "%s says, %s", [b]stripNumFromStr( this->target->GetName() )[/b], nmessage);
Here is EMOTE (modified):
Code:
entity_list.Message(0, MT_Emote, "%s %s", stripNumFromStr( this->target->GetName() ), nmessage);
Here is SHOUT (modified):
Code:
entity_list.Message(0, MT_Shout, "%s shouts, %s", stripNumFromStr( this->target->GetName() ), nmessage);
(NOTE: I noticed that including the apostrophe's surrounding what the mob is saying\shouting, causes some kind of problem with the EntityList::Message function. The message will appear with a line break before the last apostrophe. To remedy this, I removed them and in my qst file added them manually. So instead of SAY:Hail, %CHARNAME%. I'd have SAY:'Hail, %CHARNAME%.')
__________________
~ Xarslik
[ Xarslik's Arena Challenge Server ]
Reply With Quote
  #2  
Old 11-28-2002, 03:49 AM
irageon
Sarnak
 
Join Date: Nov 2002
Posts: 35
Default

can you post here your version of wesquest.cpp ?
__________________
Irageon, n00b|3 to EQ and butcherer of the english language!
Reply With Quote
  #3  
Old 11-28-2002, 05:09 AM
quester
Hill Giant
 
Join Date: Oct 2002
Posts: 108
Default

The better solution here is to simply pull off the trailing character if indeed the emu uses 3 instead of 2 id digits.

The problem with your code is that if the npc's name has any digits in it, anywhere in the name, they get striped.

"Clockwork Model 8", "D7 Scavenger", "Obsolete Model 4", would be butchered.
Reply With Quote
  #4  
Old 11-28-2002, 04:46 PM
steve
Discordant
 
Join Date: Jan 2002
Posts: 305
Default

The real question is, why are we bothering to use three digits? Change it to only allow 2.

The devs are constantly complaining that we don't have as much CPU power as the real EQ servers use, so by no means will we be having 100+ of an NPC with the exact same name in a zone.
Reply With Quote
  #5  
Old 11-29-2002, 10:12 AM
devn00b's Avatar
devn00b
Demi-God
 
Join Date: Jan 2002
Posts: 15,658
Default

steve you are wrong. what if somone wants to have a special event where say orcs invade Gfay. there could easly be 100+ orc cents.
Quote:
The devs are constantly complaining that we don't have as much CPU power as the real EQ servers use
this is in regards to pathing. pathing would take 10x the ram. so say insted of a pc running 10 zones yer down to 1. as we all know that would just plain suck.
__________________
(Former)Senior EQEMu Developer
GuildWars Co-Founder / World Builder.
World Builder and Co-Founder Zek [PVP/Guild Wars/City Takeovers]
Member of the "I hate devn00b" Club
Most Senior EQEMu Member.

Current Work: EverQuest 2 Emulator. Zeklabs Server
Reply With Quote
  #6  
Old 11-29-2002, 11:57 AM
steve
Discordant
 
Join Date: Jan 2002
Posts: 305
Default

Quote:
Originally Posted by /dev/n00b
steve you are wrong. what if somone wants to have a special event where say orcs invade Gfay. there could easly be 100+ orc cents.
Tell them they're stupid? Use 99 cents and 99 legionnaires. 100+ of the same exact NPC is not only lame, but makes no sense.

Quote:
[b]this is in regards to pathing. pathing would take 10x the ram. so say insted of a pc running 10 zones yer down to 1. as we all know that would just plain suck.
So make the pathing an optional ./configure script parameter. That is, after it's woking. There are those of us with better computers than a 400mhz, 128mb ram.

I'm not sure what you expect from the EMU, but most people are looking forward towards pathing, and having the NPCs more lifelike. The farther along we get by adding more features, the less and less people that will be able to run their own server. I don't think this is a bad thing. You can always play on an emulated server instead of running your own.

Besides, if you don't have the CPU/RAM to be running a zone with pathing, the server will never amount to anything more than an interactive item creator/zone explorer. The best solution is to make the higher intensive CPU functions defineable in the makefile, so that if you can't support it, it doesn't try to use it.
Reply With Quote
  #7  
Old 12-10-2002, 08:59 AM
DeletedUser
Fire Beetle
 
Join Date: Sep 2002
Posts: 0
Default

There are enough NPCs in certain zones to exceed 99 of a unique mob. Esp. Luclin
Reply With Quote
  #8  
Old 12-10-2002, 12:29 PM
steve
Discordant
 
Join Date: Jan 2002
Posts: 305
Default

EQLive uses only two digits for mob names, even in PoP. Luclin zones would be fine. If it goes over 99, then that's the DB fault for having 20+ duplicates of the same NPC ;p

/shrug
Reply With Quote
  #9  
Old 12-10-2002, 12:53 PM
DeletedUser
Fire Beetle
 
Join Date: Sep 2002
Posts: 0
Default

Last I checked, they use three.
Reply With Quote
  #10  
Old 12-10-2002, 11:53 PM
Wiz
Dragon
 
Join Date: Feb 2002
Posts: 583
Default

Three digits, nowadays.

Used to be two.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 08:15 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3