[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

@ -115,6 +115,9 @@ Map* MapManager::CreateMap(uint32 id, const WorldObject* obj)
m = new Map(id, i_gridCleanUpDelay, 0, REGULAR_DIFFICULTY);
//add map into container
i_maps[MapID(id)] = m;
// non-instanceable maps always expected have saved state
m->CreateInstanceData(true);
}
}
@ -419,6 +422,7 @@ InstanceMap* MapManager::CreateInstanceMap(uint32 id, uint32 InstanceId, Difficu
InstanceMap *map = new InstanceMap(id, i_gridCleanUpDelay, InstanceId, difficulty);
MANGOS_ASSERT(map->IsDungeon());
// Dungeons can have saved instance data
bool load_data = save != NULL;
map->CreateInstanceData(load_data);
@ -441,6 +445,9 @@ BattleGroundMap* MapManager::CreateBattleGroundMap(uint32 id, uint32 InstanceId,
//add map into map container
i_maps[MapID(id, InstanceId)] = map;
// BGs/Arenas not have saved instance data
map->CreateInstanceData(false);
return map;
}