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 01-14-2004, 04:32 AM
Scorpious2k's Avatar
Scorpious2k
Demi-God
 
Join Date: Mar 2003
Location: USA
Posts: 1,067
Default Making lastname work

NPC_types has a column called lastname. The lastname text goes under the NPC's name in parenthesis (like you see with the merchants and bankers). In current releases of EQEmu, it isn't implemented.

Here is how to make it work.

First, you will need to change the definition to the table. lastname needs to be changed so it can no longer be NULL. If you don't do this, your zone server will crash. Use the following mysql line to make the change:

Code:
alter table npc_types  modify lastname varchar(32) NOT NULL default '';
Once this is done, you are ready to change the code. In common/database.cpp Database:BLoadNPCTypes change the line that reads

Code:
MakeAnyLenString(&query, "SELECT id,name,level,race,class,hp,gender,texture,helmtexture,size,loottable_id, merchant_id, banish, mindmg, maxdmg, npcspecialattks, npc_spells_id, d_meele_texture1,d_meele_texture2, walkspeed, runspeed,fixedz,hp_regen_rate,mana_regen_rate,aggroradius,bodytype,npc_faction_id,face FROM npc_types");//WHERE zone='%s'", zone_name
to read

Code:
MakeAnyLenString(&query, "SELECT id,name,level,race,class,hp,gender,texture,helmtexture,size,loottable_id, merchant_id, banish, mindmg, maxdmg, npcspecialattks, npc_spells_id, d_meele_texture1,d_meele_texture2, walkspeed, runspeed,fixedz,hp_regen_rate,mana_regen_rate,aggroradius,bodytype,npc_faction_id,face,lastname FROM npc_types");//WHERE zone='%s'", zone_name
then a few lines below that you will find

Code:
					tmpNPCType.mana_regen = atoi(row[23]);
                			tmpNPCType.aggroradius = (sint32)atoi(row[24]);
                			if (row[25] && strlen(row[25]))
                			    tmpNPCType.bodytype = (int8)atoi(row[25]);
                			else
                    			    tmpNPCType.bodytype = 0;
					tmpNPCType.npc_faction_id = atoi(row[26]);
					tmpNPCType.luclinface=atoi(row[27]);
insert this line after that

Code:
strncpy(tmpNPCType.lastname, row[28], 32);
Now, in zone/mob.cpp Mob::FillSpawnStruct you will find the line

Code:
strcpy(ns->spawn.last_name, ns->spawn.last_name);
this should be changed to

Code:
strcpy(ns->spawn.last_name, lastname);
And that should do it.
__________________
Maybe I should try making one of these servers...
Reply With Quote
  #2  
Old 01-14-2004, 06:19 AM
Shawn319
Demi-God
 
Join Date: Jan 2002
Posts: 2,073
Default

but whats the purpose of lastname now? we use _'s to show more than one word names.


Guard_Xama00
__________________
Shawn319
Semi-Retired EQ Addict

(Retired)EQEmu Lead Tester
(Retired)EQEmu Tech Support

(Retired)Host/ServerOP - [LIVE] Official EQEmu Test Server
(Retired)Host/ServerOP - Shawn319's All-GM Dev Test Server
(Retired)ServerOP - EQEmu Beta Server
(Retired)ServerOP - GuildWars Server
(Retired)ServerOP - Raid Addicts
--------------------------
Reply With Quote
  #3  
Old 01-14-2004, 06:51 AM
Scorpious2k's Avatar
Scorpious2k
Demi-God
 
Join Date: Mar 2003
Location: USA
Posts: 1,067
Default

Quote:
Originally Posted by Shawn319
but whats the purpose of lastname now? we use _'s to show more than one word names.
True, this puts it in "()" under the name - for NPC's

Guard_Xama
(King's Guard)

Mattmeck
(Newbie Slayer)
__________________
Maybe I should try making one of these servers...
Reply With Quote
  #4  
Old 01-14-2004, 10:16 AM
mattmeck
Guest
 
Posts: n/a
Default

!!!!
Reply With Quote
  #5  
Old 01-15-2004, 04:15 AM
Scorpious2k's Avatar
Scorpious2k
Demi-God
 
Join Date: Mar 2003
Location: USA
Posts: 1,067
Default

Quote:
Originally Posted by mattmeck
!!!!
Sorry Matt... that was intended as an example only. I know you wouldn't hurt a hair on a newbie's head in real life....
__________________
Maybe I should try making one of these servers...
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 02:51 PM.


 

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