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(""); Any help would be awesome, thank you! |
Haven't looked at the code, but considering NPCs are not clients, that looks pretty iffy to me.
|
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. |
Temporary last names so he can dynamically change their last names without having to actually edit the NPC's last name to be 'permanent'.
|
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)); |
Thanks Tabasco I think I can work with that.
|
All times are GMT -4. The time now is 04:32 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.