Core/PacketIO: 9.1.0 opcodes and packet structures
Port From (https://github.com/TrinityCore/TrinityCore/commit/cd5357dc185f95c6ef78089c5ab8bd2b885dd89f)
This commit is contained in:
@@ -1334,16 +1334,20 @@ namespace Game.Entities
|
||||
CreatureTemplate cInfo = GetCreatureTemplate();
|
||||
|
||||
// level
|
||||
var levels = cInfo.GetMinMaxLevel();
|
||||
int minlevel = Math.Min(levels[0], levels[1]);
|
||||
int maxlevel = Math.Max(levels[0], levels[1]);
|
||||
var minMaxLevels = cInfo.GetMinMaxLevel();
|
||||
int minlevel = Math.Min(minMaxLevels[0], minMaxLevels[1]);
|
||||
int maxlevel = Math.Max(minMaxLevels[0], minMaxLevels[1]);
|
||||
int level = (minlevel == maxlevel ? minlevel : RandomHelper.IRand(minlevel, maxlevel));
|
||||
SetLevel((uint)level);
|
||||
|
||||
CreatureLevelScaling scaling = cInfo.GetLevelScaling(GetMap().GetDifficultyID());
|
||||
|
||||
SetUpdateFieldValue(m_values.ModifyValue(m_unitData).ModifyValue(m_unitData.ScalingLevelMin), scaling.MinLevel);
|
||||
SetUpdateFieldValue(m_values.ModifyValue(m_unitData).ModifyValue(m_unitData.ScalingLevelMax), scaling.MaxLevel);
|
||||
var levels = Global.DB2Mgr.GetContentTuningData(scaling.ContentTuningID, 0);
|
||||
if (levels != null)
|
||||
{
|
||||
SetUpdateFieldValue(m_values.ModifyValue(m_unitData).ModifyValue(m_unitData.ScalingLevelMin), levels.Value.MinLevel);
|
||||
SetUpdateFieldValue(m_values.ModifyValue(m_unitData).ModifyValue(m_unitData.ScalingLevelMax), levels.Value.MaxLevel);
|
||||
}
|
||||
|
||||
int mindelta = Math.Min(scaling.DeltaLevelMax, scaling.DeltaLevelMin);
|
||||
int maxdelta = Math.Max(scaling.DeltaLevelMax, scaling.DeltaLevelMin);
|
||||
@@ -2483,7 +2487,7 @@ namespace Game.Entities
|
||||
CreatureTemplate cinfo = GetCreatureTemplate();
|
||||
CreatureLevelScaling scaling = cinfo.GetLevelScaling(GetMap().GetDifficultyID());
|
||||
|
||||
return (scaling.MinLevel != 0 && scaling.MaxLevel != 0);
|
||||
return scaling.ContentTuningID != 0;
|
||||
}
|
||||
|
||||
ulong GetMaxHealthByLevel(uint level)
|
||||
|
||||
@@ -85,6 +85,7 @@ namespace Game.Entities
|
||||
public float ModExperience;
|
||||
public bool RacialLeader;
|
||||
public uint MovementId;
|
||||
public int CreatureDifficultyID;
|
||||
public int WidgetSetID;
|
||||
public int WidgetSetUnitConditionID;
|
||||
public bool RegenHealth;
|
||||
@@ -266,6 +267,7 @@ namespace Game.Entities
|
||||
stats.HealthScalingExpansion = HealthScalingExpansion;
|
||||
stats.VignetteID = VignetteID;
|
||||
stats.Class = (int)UnitClass;
|
||||
stats.CreatureDifficultyID = CreatureDifficultyID;
|
||||
stats.WidgetSetID = WidgetSetID;
|
||||
stats.WidgetSetUnitConditionID = WidgetSetUnitConditionID;
|
||||
|
||||
@@ -454,8 +456,6 @@ namespace Game.Entities
|
||||
|
||||
public class CreatureLevelScaling
|
||||
{
|
||||
public ushort MinLevel;
|
||||
public ushort MaxLevel;
|
||||
public short DeltaLevelMin;
|
||||
public short DeltaLevelMax;
|
||||
public uint ContentTuningID;
|
||||
|
||||
@@ -431,6 +431,7 @@ namespace Game.Misc
|
||||
packet.QuestID = quest.Id;
|
||||
packet.PortraitGiver = quest.QuestGiverPortrait;
|
||||
packet.PortraitGiverMount = quest.QuestGiverPortraitMount;
|
||||
packet.PortraitGiverModelSceneID = quest.QuestGiverPortraitModelSceneId;
|
||||
packet.PortraitTurnIn = quest.QuestTurnInPortrait;
|
||||
packet.QuestSessionBonus = 0; //quest.GetQuestSessionBonus(); // this is only sent while quest session is active
|
||||
packet.AutoLaunched = autoLaunched;
|
||||
@@ -558,6 +559,7 @@ namespace Game.Misc
|
||||
packet.PortraitTurnIn = quest.QuestTurnInPortrait;
|
||||
packet.PortraitGiver = quest.QuestGiverPortrait;
|
||||
packet.PortraitGiverMount = quest.QuestGiverPortraitMount;
|
||||
packet.PortraitGiverModelSceneID = quest.QuestGiverPortraitModelSceneId;
|
||||
packet.QuestPackageID = quest.PackageID;
|
||||
|
||||
packet.QuestData = offer;
|
||||
@@ -768,7 +770,7 @@ namespace Game.Misc
|
||||
public class PointOfInterest
|
||||
{
|
||||
public uint Id;
|
||||
public Vector2 Pos;
|
||||
public Vector3 Pos;
|
||||
public uint Icon;
|
||||
public uint Flags;
|
||||
public uint Importance;
|
||||
|
||||
Reference in New Issue
Block a user