All pastes #567830 Raw Edit

Alessio

public text v1 · immutable
·published 2007-06-15 04:09 UTC
rendered paste body
bool 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;
}