Alessio
public text v1 · immutablebool ChatHandler::HandleNpcExport(const char * args, WorldSession * m_session)
{
Creature* target = m_session->GetPlayer()->GetMapMgr()->GetCreature(m_session->GetPlayer()->GetSelection());
if (!target)
return false;
std::stringstream name;
if (*args)
{
name << "NPC_" << args << ".sql";
}
else
{
name << "NPC_" << target->GetEntry() << ".sql";
}
target->SaveToFile(name);
BlueSystemMessage(m_session, "Creature/npc saved to: %s", name.str().c_str());
return true;
}