void ObjectController::_handleNPCConversationStart(uint64 targetId,Message* message,ObjectControllerCmdProperties* cmdProperties)
{
	PlayerObject*	player	= dynamic_cast<PlayerObject*>(mObject);
	NPCObject*		npc		= dynamic_cast<NPCObject*>(gWorldManager->getObjectById(targetId));

	if(!npc)
	{
		DLOG(info) << "ObjController::_handleNPCConversationStart: Couldn't find object " << targetId;
		return;
	}

	// in range check
	uint64 playerParentId	= player->getParentId();
	uint64 npcParentId		= npc->getParentId();
	bool   inRange			= true;

	uint64 playerBuildingId = 0;
	uint64 npcBuildingId = 0;

	//get building Ids if they are in buildings
	if(playerParentId)
	{
		playerBuildingId = gWorldManager->getObjectById(playerParentId)->getParentId();
	}
		
	if(npcParentId)
	{
		npcBuildingId	= gWorldManager->getObjectById(npcParentId)->getParentId();
	}

	// not inside same parent, or out of range
	float distance = glm::distance(player->getWorldPosition(), npc->getWorldPosition());
	if ((npcBuildingId != playerParentId) || distance > 10.0f)
	{
		inRange = false;
	}

	// we are out of range
    if(!inRange)
    {
        float distance = glm::distance(player->mPosition, npc->mPosition);
        char buffer[100];
        sprintf(buffer, "You are out of range (%f m).", distance);
        BString msg(buffer);
        msg.convert(BSTRType_Unicode16);
        gMessageLib->SendSystemMessage(msg.getUnicode16(), player);
        // gMessageLib->sendSystemMessage(player,L"","system_msg","out_of_range");
        return;
    }

    //check to see if he is part of a mission
    /*if(gMissionManager->checkDeliverMission(player,npc) ||
            gMissionManager->checkCraftingMission(player,npc)
        ) return;*/

    // we don't want him to talk
    if(npc->hasInternalAttribute("no_chat"))
        return;

    // initiate a conversation dialog
    if(npc->hasInternalAttribute("base_conversation"))
    {
        // Let the npc have your attention, and some npc-movement.
        npc->prepareConversation(player);
        gConversationManager->startConversation(npc,player);
    }

    // say some chatter
    else
    {
        // spam protection
        uint64 localTime = Anh_Utils::Clock::getSingleton()->getLocalTime();
        if(npc->getLastConversationTarget() == player->getId())
        {
            if(localTime - npc->getLastConversationRequest() < NPC_CHAT_SPAM_PROTECTION_TIME)
            {
                return;
            }
            else
            {
                npc->setLastConversationRequest(localTime);
            }
        }
        else
        {
            npc->setLastConversationRequest(localTime);
            npc->setLastConversationTarget(player->getId());
        }

        // Let the npc have your attention, and some npc-movement.
        // Nope... npc->prepareConversation(player);
        std::wstring npc_chat;
        uint32_t animation = 0;

        // say a specific preset sentence
        if(npc->hasInternalAttribute("npc_chat"))	{
            std::string tmp = npc->getInternalAttribute<std::string>("npc_chat");
            npc_chat = std::wstring(tmp.begin(), tmp.end());
        } else {
            std::pair<std::wstring,uint32> chat = gWorldManager->getRandNpcChatter();

            npc_chat  = chat.first;
            animation = chat.second;
        }

        if (!gWorldConfig->isInstance()) {
            gMessageLib->SendSpatialChat(npc, npc_chat, player);

            if (animation) gMessageLib->sendCreatureAnimation(npc,gWorldManager->getNpcConverseAnimation(animation));
        } else {
            gMessageLib->SendSpatialChat(npc, npc_chat, player);

            if (animation) gMessageLib->sendCreatureAnimation(npc,gWorldManager->getNpcConverseAnimation(animation), player);
        }
    }
    
    
        
}