EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Archive::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=621)
-   -   Making lastname work (https://www.eqemulator.org/forums/showthread.php?t=11362)

Scorpious2k 01-14-2004 04:32 AM

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::DBLoadNPCTypes 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.

Shawn319 01-14-2004 06:19 AM

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


Guard_Xama00

Scorpious2k 01-14-2004 06:51 AM

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)

mattmeck 01-14-2004 10:16 AM

!!!! :shock:

Scorpious2k 01-15-2004 04:15 AM

Quote:

Originally Posted by mattmeck
!!!! :shock:

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....


All times are GMT -4. The time now is 10:21 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.