[11117] Allow for non-instancable maps have InstanceData and instance scripts.

* New table added for non-instanced maps (except BG/arena):
    - `mangos`.`world_template` (script mapping to non instanced data)
    - `characters`.`world` (saved script data string storage)

* InstancedData created for any map types including BGs/arenas, that allow have scripts
  state for any maps, but BG/arena instance data not saved.

Note: Possible structures will renamed later for clarify apply to any type maps,
but avoid for now for simplify changes and hard affect to script library sources.
This commit is contained in:
VladimirMangos 2011-02-08 03:54:45 +03:00
parent 332c4174d2
commit f73868a703
23 changed files with 244 additions and 101 deletions

View file

@ -6339,21 +6339,16 @@ bool ChatHandler::HandleInstanceSaveDataCommand(char* /*args*/)
Player* pl = m_session->GetPlayer();
Map* map = pl->GetMap();
if (!map->IsDungeon())
{
PSendSysMessage("Map is not a dungeon.");
SetSentErrorMessage(true);
return false;
}
if (!((InstanceMap*)map)->GetInstanceData())
InstanceData* iData = map->GetInstanceData();
if (!iData)
{
PSendSysMessage("Map has no instance data.");
SetSentErrorMessage(true);
return false;
}
((InstanceMap*)map)->GetInstanceData()->SaveToDB();
iData->SaveToDB();
return true;
}