mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-10 15:00:25 +00:00
[Titles] Cleanup titles, title suffix, and last name methods. (#2174)
* [Titles] Cleanup titles, title suffix, and last name methods. - Use strings instead of const chars*. - Add optional parameter to SetAATitle in Lua so you can save to the database similar to Perl. - Cleanup #lastname command. - Cleanup #title command. - Cleanup #titlesuffix command. * Update npc.cpp
This commit is contained in:
+15
-13
@@ -3231,27 +3231,29 @@ void NPC::DoQuestPause(Mob *other) {
|
||||
|
||||
}
|
||||
|
||||
void NPC::ChangeLastName(const char* in_lastname)
|
||||
void NPC::ChangeLastName(std::string last_name)
|
||||
{
|
||||
|
||||
auto outapp = new EQApplicationPacket(OP_GMLastName, sizeof(GMLastName_Struct));
|
||||
GMLastName_Struct* gmn = (GMLastName_Struct*)outapp->pBuffer;
|
||||
strcpy(gmn->name, GetName());
|
||||
strcpy(gmn->gmname, GetName());
|
||||
strcpy(gmn->lastname, in_lastname);
|
||||
gmn->unknown[0]=1;
|
||||
gmn->unknown[1]=1;
|
||||
gmn->unknown[2]=1;
|
||||
gmn->unknown[3]=1;
|
||||
auto gmn = (GMLastName_Struct*) outapp->pBuffer;
|
||||
|
||||
strn0cpy(gmn->name, GetName(), sizeof(gmn->name));
|
||||
strn0cpy(gmn->gmname, GetName(), sizeof(gmn->gmname));
|
||||
strn0cpy(gmn->lastname, last_name.c_str(), sizeof(gmn->lastname));
|
||||
|
||||
gmn->unknown[0] = 1;
|
||||
gmn->unknown[1] = 1;
|
||||
gmn->unknown[2] = 1;
|
||||
gmn->unknown[3] = 1;
|
||||
|
||||
entity_list.QueueClients(this, outapp, false);
|
||||
|
||||
safe_delete(outapp);
|
||||
}
|
||||
|
||||
void NPC::ClearLastName()
|
||||
{
|
||||
std::string WT;
|
||||
WT = '\0'; //Clear Last Name
|
||||
ChangeLastName( WT.c_str());
|
||||
std::string empty;
|
||||
ChangeLastName(empty);
|
||||
}
|
||||
|
||||
void NPC::DepopSwarmPets()
|
||||
|
||||
Reference in New Issue
Block a user