Core/Characters: Added allied race creation data, implemented intro scenes & added config option to disable achievement requirements for allied races
Port From (https://github.com/TrinityCore/TrinityCore/commit/71eb30f89dc5abeb33c7aa4a526073f769b5c7d1)
This commit is contained in:
@@ -1384,6 +1384,7 @@ namespace Framework.Constants
|
|||||||
CalculateCreatureZoneAreaData,
|
CalculateCreatureZoneAreaData,
|
||||||
CalculateGameobjectZoneAreaData,
|
CalculateGameobjectZoneAreaData,
|
||||||
CastUnstuck,
|
CastUnstuck,
|
||||||
|
CharacterCreatingDisableAlliedRaceAchievementRequirement,
|
||||||
CharacterCreatingDisabled,
|
CharacterCreatingDisabled,
|
||||||
CharacterCreatingDisabledClassmask,
|
CharacterCreatingDisabledClassmask,
|
||||||
CharacterCreatingDisabledRacemask,
|
CharacterCreatingDisabledRacemask,
|
||||||
|
|||||||
@@ -278,6 +278,10 @@ namespace Game.Entities
|
|||||||
public List<PlayerCreateInfoAction> action = new();
|
public List<PlayerCreateInfoAction> action = new();
|
||||||
public List<SkillRaceClassInfoRecord> skills = new();
|
public List<SkillRaceClassInfoRecord> skills = new();
|
||||||
|
|
||||||
|
public Optional<uint> introMovieId;
|
||||||
|
public Optional<uint> introSceneId;
|
||||||
|
public Optional<uint> introSceneIdNPE;
|
||||||
|
|
||||||
public PlayerLevelInfo[] levelInfo = new PlayerLevelInfo[WorldConfig.GetIntValue(WorldCfg.MaxPlayerLevel)];
|
public PlayerLevelInfo[] levelInfo = new PlayerLevelInfo[WorldConfig.GetIntValue(WorldCfg.MaxPlayerLevel)];
|
||||||
|
|
||||||
public struct CreatePosition
|
public struct CreatePosition
|
||||||
|
|||||||
@@ -6415,6 +6415,8 @@ namespace Game.Entities
|
|||||||
m_lastFallZ = z;
|
m_lastFallZ = z;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PlayerCreateMode GetCreateMode() { return m_createMode; }
|
||||||
|
|
||||||
public byte GetCinematic() { return m_cinematic; }
|
public byte GetCinematic() { return m_cinematic; }
|
||||||
public void SetCinematic(byte cine) { m_cinematic = cine; }
|
public void SetCinematic(byte cine) { m_cinematic = cine; }
|
||||||
|
|
||||||
|
|||||||
@@ -5598,9 +5598,8 @@ namespace Game
|
|||||||
var time = Time.GetMSTime();
|
var time = Time.GetMSTime();
|
||||||
// Load playercreate
|
// Load playercreate
|
||||||
{
|
{
|
||||||
// 0 1 2 3 4 5 6 7 8 9 10 11 12
|
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
||||||
SQLResult result = DB.World.Query("SELECT race, class, map, position_x, position_y, position_z, orientation, npe_map, npe_position_x, npe_position_y, npe_position_z, npe_orientation, npe_transport_guid FROM playercreateinfo");
|
SQLResult result = DB.World.Query("SELECT race, class, map, position_x, position_y, position_z, orientation, npe_map, npe_position_x, npe_position_y, npe_position_z, npe_orientation, npe_transport_guid, intro_movie_id, intro_scene_id, npe_intro_scene_id FROM playercreateinfo");
|
||||||
|
|
||||||
if (result.IsEmpty())
|
if (result.IsEmpty())
|
||||||
{
|
{
|
||||||
Log.outInfo(LogFilter.ServerLoading, "Loaded 0 player create definitions. DB table `playercreateinfo` is empty.");
|
Log.outInfo(LogFilter.ServerLoading, "Loaded 0 player create definitions. DB table `playercreateinfo` is empty.");
|
||||||
@@ -5659,7 +5658,7 @@ namespace Game
|
|||||||
info.createPosition.Loc = new WorldLocation(mapId, positionX, positionY, positionZ, orientation);
|
info.createPosition.Loc = new WorldLocation(mapId, positionX, positionY, positionZ, orientation);
|
||||||
|
|
||||||
if (!result.IsNull(7))
|
if (!result.IsNull(7))
|
||||||
{
|
{
|
||||||
info.createPositionNPE.HasValue = true;
|
info.createPositionNPE.HasValue = true;
|
||||||
|
|
||||||
info.createPositionNPE.Value.Loc = new WorldLocation(result.Read<uint>(7), result.Read<float>(8), result.Read<float>(9), result.Read<float>(10), result.Read<float>(11));
|
info.createPositionNPE.Value.Loc = new WorldLocation(result.Read<uint>(7), result.Read<float>(8), result.Read<float>(9), result.Read<float>(10), result.Read<float>(11));
|
||||||
@@ -5679,6 +5678,33 @@ namespace Game
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!result.IsNull(13))
|
||||||
|
{
|
||||||
|
uint introMovieId = result.Read<uint>(13);
|
||||||
|
if (CliDB.MovieStorage.ContainsKey(introMovieId))
|
||||||
|
info.introMovieId.Set(introMovieId);
|
||||||
|
else
|
||||||
|
Log.outError(LogFilter.Sql, $"Invalid intro movie id {introMovieId} for class {currentclass} race {currentrace} pair in `playercreateinfo` table, ignoring.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!result.IsNull(14))
|
||||||
|
{
|
||||||
|
uint introSceneId = result.Read<uint>(14);
|
||||||
|
if (GetSceneTemplate(introSceneId) != null)
|
||||||
|
info.introSceneId.Set(introSceneId);
|
||||||
|
else
|
||||||
|
Log.outError(LogFilter.Sql, $"Invalid intro scene id {introSceneId} for class {currentclass} race {currentrace} pair in `playercreateinfo` table, ignoring.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!result.IsNull(15))
|
||||||
|
{
|
||||||
|
uint introSceneId = result.Read<uint>(15);
|
||||||
|
if (GetSceneTemplate(introSceneId) != null)
|
||||||
|
info.introSceneIdNPE.Set(introSceneId);
|
||||||
|
else
|
||||||
|
Log.outError(LogFilter.Sql, $"Invalid NPE intro scene id {introSceneId} for class {currentclass} race {currentrace} pair in `playercreateinfo` table, ignoring.");
|
||||||
|
}
|
||||||
|
|
||||||
_playerInfo[currentrace][currentclass] = info;
|
_playerInfo[currentrace][currentclass] = info;
|
||||||
|
|
||||||
++count;
|
++count;
|
||||||
|
|||||||
@@ -130,7 +130,8 @@ namespace Game
|
|||||||
EnumCharactersResult.RaceUnlock raceUnlock = new();
|
EnumCharactersResult.RaceUnlock raceUnlock = new();
|
||||||
raceUnlock.RaceID = requirement.Key;
|
raceUnlock.RaceID = requirement.Key;
|
||||||
raceUnlock.HasExpansion = (byte)GetAccountExpansion() >= requirement.Value.Expansion;
|
raceUnlock.HasExpansion = (byte)GetAccountExpansion() >= requirement.Value.Expansion;
|
||||||
raceUnlock.HasAchievement = requirement.Value.AchievementId != 0 /*|| HasAchievement(requirement.Value.AchievementId)*/;
|
raceUnlock.HasAchievement = requirement.Value.AchievementId != 0 && (WorldConfig.GetBoolValue(WorldCfg.CharacterCreatingDisableAlliedRaceAchievementRequirement)
|
||||||
|
/* || HasAccountAchievement(requirement.second.AchievementId)*/);
|
||||||
charResult.RaceUnlockData.Add(raceUnlock);
|
charResult.RaceUnlockData.Add(raceUnlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -797,16 +798,28 @@ namespace Game
|
|||||||
if (pCurrChar.GetCinematic() == 0)
|
if (pCurrChar.GetCinematic() == 0)
|
||||||
{
|
{
|
||||||
pCurrChar.SetCinematic(1);
|
pCurrChar.SetCinematic(1);
|
||||||
ChrClassesRecord cEntry = CliDB.ChrClassesStorage.LookupByKey(pCurrChar.GetClass());
|
var playerInfo = Global.ObjectMgr.GetPlayerInfo(pCurrChar.GetRace(), pCurrChar.GetClass());
|
||||||
if (cEntry != null)
|
if (playerInfo != null)
|
||||||
{
|
{
|
||||||
ChrRacesRecord rEntry = CliDB.ChrRacesStorage.LookupByKey(pCurrChar.GetRace());
|
switch (pCurrChar.GetCreateMode())
|
||||||
if (pCurrChar.GetClass() == Class.DemonHunter) // @todo: find a more generic solution
|
{
|
||||||
pCurrChar.SendMovieStart(469);
|
case PlayerCreateMode.Normal:
|
||||||
else if (cEntry.CinematicSequenceID != 0)
|
if (playerInfo.introMovieId.HasValue)
|
||||||
pCurrChar.SendCinematicStart(cEntry.CinematicSequenceID);
|
pCurrChar.SendMovieStart(playerInfo.introMovieId.Value);
|
||||||
else if (rEntry != null)
|
else if (playerInfo.introSceneId.HasValue)
|
||||||
pCurrChar.SendCinematicStart(rEntry.CinematicSequenceID);
|
pCurrChar.GetSceneMgr().PlayScene(playerInfo.introSceneId.Value);
|
||||||
|
else if (CliDB.ChrClassesStorage.TryGetValue((uint)pCurrChar.GetClass(), out ChrClassesRecord chrClassesRecord) && chrClassesRecord.CinematicSequenceID != 0)
|
||||||
|
pCurrChar.SendCinematicStart(chrClassesRecord.CinematicSequenceID);
|
||||||
|
else if (CliDB.ChrRacesStorage.TryGetValue((uint)pCurrChar.GetRace(), out ChrRacesRecord chrRacesRecord) && chrRacesRecord.CinematicSequenceID != 0)
|
||||||
|
pCurrChar.SendCinematicStart(chrRacesRecord.CinematicSequenceID);
|
||||||
|
break;
|
||||||
|
case PlayerCreateMode.NPE:
|
||||||
|
if (playerInfo.introSceneIdNPE.HasValue)
|
||||||
|
pCurrChar.GetSceneMgr().PlayScene(playerInfo.introSceneIdNPE.Value);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -381,6 +381,7 @@ namespace Game
|
|||||||
}
|
}
|
||||||
|
|
||||||
Values[WorldCfg.CharacterCreatingMinLevelForDemonHunter] = GetDefaultValue("CharacterCreating.MinLevelForDemonHunter", 0);
|
Values[WorldCfg.CharacterCreatingMinLevelForDemonHunter] = GetDefaultValue("CharacterCreating.MinLevelForDemonHunter", 0);
|
||||||
|
Values[WorldCfg.CharacterCreatingDisableAlliedRaceAchievementRequirement] = GetDefaultValue("CharacterCreating.DisableAlliedRaceAchievementRequirement", false);
|
||||||
|
|
||||||
Values[WorldCfg.SkipCinematics] = GetDefaultValue("SkipCinematics", 0);
|
Values[WorldCfg.SkipCinematics] = GetDefaultValue("SkipCinematics", 0);
|
||||||
if ((int)Values[WorldCfg.SkipCinematics] < 0 || (int)Values[WorldCfg.SkipCinematics] > 2)
|
if ((int)Values[WorldCfg.SkipCinematics] < 0 || (int)Values[WorldCfg.SkipCinematics] > 2)
|
||||||
|
|||||||
@@ -724,6 +724,9 @@ namespace Game
|
|||||||
Log.outInfo(LogFilter.ServerLoading, "Loading linked spells...");
|
Log.outInfo(LogFilter.ServerLoading, "Loading linked spells...");
|
||||||
Global.SpellMgr.LoadSpellLinked();
|
Global.SpellMgr.LoadSpellLinked();
|
||||||
|
|
||||||
|
Log.outInfo(LogFilter.ServerLoading, "Loading Scenes Templates..."); // must be before LoadPlayerInfo
|
||||||
|
Global.ObjectMgr.LoadSceneTemplates();
|
||||||
|
|
||||||
Log.outInfo(LogFilter.ServerLoading, "Loading Player Create Data...");
|
Log.outInfo(LogFilter.ServerLoading, "Loading Player Create Data...");
|
||||||
Global.ObjectMgr.LoadPlayerInfo();
|
Global.ObjectMgr.LoadPlayerInfo();
|
||||||
|
|
||||||
@@ -742,9 +745,6 @@ namespace Game
|
|||||||
Log.outInfo(LogFilter.ServerLoading, "Loading Conversation Templates...");
|
Log.outInfo(LogFilter.ServerLoading, "Loading Conversation Templates...");
|
||||||
Global.ConversationDataStorage.LoadConversationTemplates();
|
Global.ConversationDataStorage.LoadConversationTemplates();
|
||||||
|
|
||||||
Log.outInfo(LogFilter.ServerLoading, "Loading Scenes Templates...");
|
|
||||||
Global.ObjectMgr.LoadSceneTemplates();
|
|
||||||
|
|
||||||
Log.outInfo(LogFilter.ServerLoading, "Loading Player Choices...");
|
Log.outInfo(LogFilter.ServerLoading, "Loading Player Choices...");
|
||||||
Global.ObjectMgr.LoadPlayerChoices();
|
Global.ObjectMgr.LoadPlayerChoices();
|
||||||
|
|
||||||
|
|||||||
@@ -795,6 +795,14 @@ CharactersPerRealm = 50
|
|||||||
|
|
||||||
CharacterCreating.MinLevelForDemonHunter = 0
|
CharacterCreating.MinLevelForDemonHunter = 0
|
||||||
|
|
||||||
|
#
|
||||||
|
# CharacterCreating.DisableAlliedRaceAchievementRequirement
|
||||||
|
# Description: Disable achievement requirements for allied race character creation
|
||||||
|
# Default: 0 (Keep requirements active)
|
||||||
|
# 1 (Disable requirements)
|
||||||
|
|
||||||
|
CharacterCreating.DisableAlliedRaceAchievementRequirement = 0
|
||||||
|
|
||||||
#
|
#
|
||||||
# SkipCinematics
|
# SkipCinematics
|
||||||
# Description: Disable cinematic intro at first login after character creation.
|
# Description: Disable cinematic intro at first login after character creation.
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user