I use the code scriptdev2_projectdev to reset the instance.
you can get the source with the command:
git pull git://github.com/wzl7222504/mangos.git scriptdev2_projectdev
and this Implementation mechanism is:
void WorldSession::ResetInstances( uint64 guid )
{
sLog.outDebug( "WORLD: reset character_instance" );
CharacterDatabase.PExecute("DELETE FROM character_instance WHERE guid = '%u'", GUID_LOPART(guid));
}
then you can use the code in the \\src\\bindings\\scriptdev2\\scripts\\customsd2p_item_teleport.cpp or sd2p_npc_teleport.cpp
pPlayer->GetSession()->ResetInstances(pPlayer->GetGUID());
when you in the game you can select with the npc or item for reset the instance.
I'm so sorry my English is bad and I come from China so hard to translate Chinese into English.