mirror of
https://github.com/mangosfour/server.git
synced 2025-12-26 07:37:02 +00:00
[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:
parent
332c4174d2
commit
f73868a703
23 changed files with 244 additions and 101 deletions
|
|
@ -23,10 +23,20 @@
|
|||
|
||||
void InstanceData::SaveToDB()
|
||||
{
|
||||
if(!Save()) return;
|
||||
// no reason to save BGs/Arenas
|
||||
if (instance->IsBattleArena())
|
||||
return;
|
||||
|
||||
if (!Save())
|
||||
return;
|
||||
|
||||
std::string data = Save();
|
||||
CharacterDatabase.escape_string(data);
|
||||
CharacterDatabase.PExecute("UPDATE instance SET data = '%s' WHERE id = '%u'", data.c_str(), instance->GetInstanceId());
|
||||
|
||||
if (instance->Instanceable())
|
||||
CharacterDatabase.PExecute("UPDATE instance SET data = '%s' WHERE id = '%u'", data.c_str(), instance->GetInstanceId());
|
||||
else
|
||||
CharacterDatabase.PExecute("UPDATE world SET data = '%s' WHERE map = '%u'", data.c_str(), instance->GetId());
|
||||
}
|
||||
|
||||
bool InstanceData::CheckAchievementCriteriaMeet( uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/ /*= NULL*/, uint32 /*miscvalue1*/ /*= 0*/ )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue