Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 08-13-2013, 09:15 AM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default Changing NPC Name / Lastname

I can change a NPCs name with ...

Code:
$npc->TempName("Uber guy");

But is there a way to change the NPCs last name without crashing the zone?

Code:
$npc->CastToClient()->ChangeLastName("");
That works... but the next time I #repop it will always crash the zone.

Any help would be awesome, thank you!
Reply With Quote
  #2  
Old 08-13-2013, 10:07 AM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

Haven't looked at the code, but considering NPCs are not clients, that looks pretty iffy to me.
Reply With Quote
  #3  
Old 08-13-2013, 11:20 AM
wolfwalkereci
Discordant
 
Join Date: Dec 2005
Posts: 435
Default

Why not use the "#" command to do it?
Is there a reason you are using perl to handle something like this because I cant think of a reason why I would.
__________________

Reply With Quote
  #4  
Old 08-13-2013, 11:46 AM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,603
Default

Temporary last names so he can dynamically change their last names without having to actually edit the NPC's last name to be 'permanent'.
Reply With Quote
  #5  
Old 08-13-2013, 02:31 PM
Tabasco's Avatar
Tabasco
Discordant
 
Join Date: Sep 2009
Posts: 269
Default

This may or may not work for your purposes, but I ran into a similar issue when trying to dynamically set last names.
I knew what it needed to be at spawn time and it varied by spawn only so I'm not changing last names while the mob is alive and active.

If you look at mod_functions.cpp you can just put something in NPC::mod_prespawn and manipulate the NPC in a number of ways before it's actually spawned which, at the time, was the only place you could change the last name outside of the database.

I'm using it to throw random 'boss' mobs into spawns that have been killed 1 or more times and the last name represents a difficulty meter.

Code:
strn0cpy(lastname, bosstag.c_str(), sizeof(lastname));
TempName("DYNBOSS");
From there a perl script takes over.
__________________
http://dungeoncrawl.us.to
Reply With Quote
  #6  
Old 08-13-2013, 06:20 PM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

Thanks Tabasco I think I can work with that.
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 11:25 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3