PDA

View Full Version : MW_057DR2_alpha_1 (to make last names work)


cabtiz
05-25-2004, 04:24 PM
Okay figured out how to make custom lastnames work so you can make your NPC's appear as Ex.

Dooly Jonkers
(Magician Guildmaster)



First off the latest CVS releases refer to a new AC field in the NPC_types table and refer to an mobacupdate.sql which i have not been able to locate in any of the CVS dumps.

SO... first step.. add a new row to your npc_types table called

ac make it an int and set allow nulls to yes.

this simple change will enable custom last names. why? well the zone server supports both an npc_types table with and without that AC field.. however the support for the old table without it does not read in the lastname fields, so they never get loaded. by adding the AC field it says oh your using the new format which then includes loading the lastname field.

now the defaults have to be dealt with if you want to use Custom last names for your trainers and such..

so

edit the following which starts at line 544 in mob.cpp

// Custom packet data
NewSpawn_Struct* ns2 = (NewSpawn_Struct*)app->pBuffer;
strcpy(ns2->spawn.name, ns->spawn.name);
if (ns->spawn.class_==MERCHANT)
strcpy(ns2->spawn.last_name, "EQEmu Shopkeeper");
else if (ns->spawn.class_==TRIBUTE_MASTER)
strcpy(ns2->spawn.last_name, "Tribute Master");
else if (ns->spawn.class_==BANKER)
strcpy(ns2->spawn.last_name, "EQEmu Banker");
else if (ns->spawn.class_==ADVENTUREMERCHANT)
#ifdef GUILDWARS
strcpy(ns->spawn.last_name,"GuildWars Merchant");
#else
strcpy(ns->spawn.last_name,"Adventure Merchant");
#endif
else
strcpy(ns2->spawn.last_name, ns->spawn.last_name);
}


to look like



// Custom packet data
NewSpawn_Struct* ns2 = (NewSpawn_Struct*)app->pBuffer;
strcpy(ns2->spawn.name, ns->spawn.name);

strcpy(ns2->spawn.last_name, ns->spawn.last_name);
}



or just comment out the missing lines.


Then starting at line 629 edit the following


if(IsNPC())
ns->spawn.aa_title = 0xFF;

if (ns->spawn.class_==MERCHANT)
strcpy(ns->spawn.last_name, "EQEmu Shopkeeper");
else if (ns->spawn.class_==BANKER)
strcpy(ns->spawn.last_name, "EQEmu Banker");
else if (ns->spawn.class_==ADVENTUREMERCHANT)
#ifdef GUILDWARS
strcpy(ns->spawn.last_name,"GuildWars Merchant");
#else
strcpy(ns->spawn.last_name,"Adventure Merchant");
#endif
else
strncpy(ns->spawn.last_name, lastname, 32);





to be



if(IsNPC())
ns->spawn.aa_title = 0xFF;
strncpy(ns->spawn.last_name, lastname, 32);




or again just comment out the lines in between.

used in conjunction with the SQL scripts in this post:

http://www.eqemulator.net/forums/viewtopic.php?t=15086

will make alot of guildmasters, spell vendors and various merchans appear with their fucntion in ()