void ScriptSupport::npcSpawnGeneral(uint64 npcId, uint64 npcPrivateOwnerId, uint64 cellForSpawn, std::string firstname, std::string lastname, float dirY, float dirW, float posX, float posY, float posZ, uint64 respawnDelay) // , uint64 templateId)
{
    glm::quat direction;
    glm::vec3 position;

    direction.x = 0.0;
    direction.y = dirY;
    direction.z = 0.0;
    direction.w = dirW;

    position.x = posX;
    position.y = posY;
    position.z = posZ;

    NPCObject* npc = dynamic_cast<NPCObject*>(gWorldManager->getObjectById(npcId));
    assert(npc);
    if (!npc)
    {
        // Fallback for running in release mode.
        LOG(WARNING) << "ScriptSupport::npcSpawnGeneral: Failed to access NPC id " << npcId;
        return;
    }

    // npc->setId(npcId);
    npc->setParentId(cellForSpawn);	// The cell we will spawn in.
    npc->setCellIdForSpawn(cellForSpawn);



    // THESE TWO ARE NOT GENERALLY FIXED YET.
    npc->setFirstName((int8*)firstname.c_str());
    npc->setLastName((int8*)lastname.c_str());

    // THIS ONE IS NOT GENERALLY FIXED YET.
    // If used for re-spawning npc's, add this id as an internal attribute.
    npc->setPrivateOwner(npcPrivateOwnerId);


    npc->mPosition = position;
    npc->setSpawnPosition(position);

    npc->mDirection = direction;
    npc->setSpawnDirection(direction);
    npc->setRespawnDelay(respawnDelay);

    // Register object with WorldManager.
    // gWorldManager->addObject(npc, true);

    // Update the world about my presence.
    /*
    if (npc->getParentId())
    {
    	// insert into cell
    	npc->setSubZoneId(0);

    	if (CellObject* cell = dynamic_cast<CellObject*>(gWorldManager->getObjectById(npc->getParentId())))
    	{
    		cell->addChild(npc);
    	}
    	else
    	{
    	}
    }
    else
    {
    	if (QTRegion* region = gWorldManager->getSI()->getQTRegion(npc->mPosition.x,npc->mPosition.z))
    	{
    		npc->setSubZoneId((uint32)region->getId());
    		region->mTree->addObject(npc);
    	}
    }
    */

    //Inventory* inventory = dynamic_cast<Inventory*>(npc->getEquipManager()->getEquippedObject(CreatureEquipSlot_Inventory));

    // Register the NPC with the NPC AI-manager.
    if (npc->getTemplateId() == 0)
    {
        // Just to make sure we do not have any old scripts running.
        assert(false);
    }
    npc->respawn();

    // Now we can remove this object from our internal list. WorldManager will handle the destruction.
    // Except for the npc's used in tutorial, they are spawned-despawned with the player.
    if (!gWorldConfig->isTutorial())
    {
        this->eraseObject(npcId);
    }
    /*
    	// The dynamic spawned private owned npc MUST register with their owner.
    	// It's not always the case that the player have had time to track this newly spawned objects,

    	// Private owned objects are invisible to most players and using getKnownPlayers()->empty() to try and save the
    	// sendDataTransformWithParent
    	// and
    	// sendUpdateTransformMessageWithParent
    	// from being called is just ridicules, it's not like we going to spwan a npc from script every second or so.

    	// So please stop messing with this code!!!

    	// Add us to the world.
    	gMessageLib->broadcastContainmentMessage(npc->getId(),npc->getParentId(),-1,npc);

    	// send out position updates to known players
    	npc->setInMoveCount(npc->getInMoveCount() + 1);
    	if (gWorldConfig->isTutorial())
    	{
    		// We need to get the player object that is the owner of this npc.
    		if (npcPrivateOwnerId != 0)
    		{
    			PlayerObject* playerObject = dynamic_cast<PlayerObject*>(gWorldManager->getObjectById(npcPrivateOwnerId));
    			if (playerObject)
    			{

    				if (npc->getParentId())
    				{
    					// We are inside a cell.
    					gMessageLib->sendDataTransformWithParent(npc, playerObject);
    					gMessageLib->sendUpdateTransformMessageWithParent(npc, playerObject);
    				}
    				else
    				{
    					gMessageLib->sendDataTransform(npc, playerObject);
    					gMessageLib->sendUpdateTransformMessage(npc, playerObject);
    				}
    				return;
    			}
    		}
    	}
    	else
    	{
    		if (npc->getParentId())
    		{
    			// We are inside a cell.
    			gMessageLib->sendDataTransformWithParent(npc);
    			gMessageLib->sendUpdateTransformMessageWithParent(npc);
    		}
    		else
    		{
    			gMessageLib->sendDataTransform(npc);
    			gMessageLib->sendUpdateTransformMessage(npc);
    		}
    	}
    	*/
}