mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +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
|
|
@ -331,21 +331,11 @@ bool AchievementCriteriaRequirement::Meets(uint32 criteria_id, Player const* sou
|
|||
{
|
||||
if (!source->IsInWorld())
|
||||
return false;
|
||||
Map* map = source->GetMap();
|
||||
// BattleGroundMap-class is instanceable, but no InstanceMap-class
|
||||
if (map->IsBattleGroundOrArena())
|
||||
return false;
|
||||
if (!map->Instanceable())
|
||||
{
|
||||
sLog.outErrorDb("Achievement system call ACHIEVEMENT_CRITERIA_REQUIRE_INSTANCE_SCRIPT (%u) for achievement criteria %u for non-instance map %u",
|
||||
ACHIEVEMENT_CRITERIA_REQUIRE_INSTANCE_SCRIPT, criteria_id, map->GetId());
|
||||
return false;
|
||||
}
|
||||
InstanceData* data = ((InstanceMap*)map)->GetInstanceData();
|
||||
InstanceData* data = source->GetInstanceData();
|
||||
if (!data)
|
||||
{
|
||||
sLog.outErrorDb("Achievement system call ACHIEVEMENT_CRITERIA_REQUIRE_INSTANCE_SCRIPT (%u) for achievement criteria %u for map %u but map not have instance script",
|
||||
ACHIEVEMENT_CRITERIA_REQUIRE_INSTANCE_SCRIPT, criteria_id, map->GetId());
|
||||
ACHIEVEMENT_CRITERIA_REQUIRE_INSTANCE_SCRIPT, criteria_id, source->GetMapId());
|
||||
return false;
|
||||
}
|
||||
return data->CheckAchievementCriteriaMeet(criteria_id, source, target, miscvalue1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue