Core/Maps: Replaced spawnmask with difficulty list

This commit is contained in:
hondacrx
2018-09-17 12:08:48 -04:00
parent bc977cf274
commit 468b053946
29 changed files with 285 additions and 229 deletions
+5 -5
View File
@@ -158,7 +158,7 @@ namespace Game.Entities
// get difficulty 1 mode entry
CreatureTemplate cinfo = null;
DifficultyRecord difficultyEntry = CliDB.DifficultyStorage.LookupByKey(GetMap().GetSpawnMode());
DifficultyRecord difficultyEntry = CliDB.DifficultyStorage.LookupByKey(GetMap().GetDifficultyID());
while (cinfo == null && difficultyEntry != null)
{
int idx = CreatureTemplate.DifficultyIDToDifficultyEntryIndex(difficultyEntry.Id);
@@ -992,10 +992,10 @@ namespace Game.Entities
}
uint mapId = GetTransport() ? (uint)GetTransport().GetGoInfo().MoTransport.SpawnMap : GetMapId();
SaveToDB(mapId, data.spawnMask);
SaveToDB(mapId, data.spawnDifficulties);
}
public virtual void SaveToDB(uint mapid, ulong spawnMask)
public virtual void SaveToDB(uint mapid, List<Difficulty> spawnDifficulties)
{
// update in loaded data
if (m_spawnId == 0)
@@ -1052,7 +1052,7 @@ namespace Game.Entities
// prevent add data integrity problems
data.movementType = (byte)(m_respawnradius == 0 && GetDefaultMovementType() == MovementGeneratorType.Random
? MovementGeneratorType.Idle : GetDefaultMovementType());
data.spawnMask = spawnMask;
data.spawnDifficulties = spawnDifficulties;
data.npcflag = npcflag;
data.unit_flags = unitFlags;
data.unit_flags2 = unitFlags2;
@@ -1075,7 +1075,7 @@ namespace Game.Entities
stmt.AddValue(index++, m_spawnId);
stmt.AddValue(index++, GetEntry());
stmt.AddValue(index++, mapid);
stmt.AddValue(index++, spawnMask);
stmt.AddValue(index++, string.Join(",", data.spawnDifficulties));
stmt.AddValue(index++, data.phaseId);
stmt.AddValue(index++, data.phaseGroup);
stmt.AddValue(index++, displayId);