Core/Races: Added missing races.

This commit is contained in:
hondacrx
2021-01-19 11:43:23 -05:00
parent c37a8a57b7
commit 3153f1daed
7 changed files with 27 additions and 21 deletions
+15 -10
View File
@@ -558,24 +558,29 @@ namespace Framework.Constants
HighmountainTauren = 28,
VoidElf = 29,
LightforgedDraenei = 30,
//RACE_ZANDALARI_TROLL = 31,
//RACE_KUL_TIRAN = 32,
ZandalariTroll = 31,
KulTiran = 32,
//RACE_THIN_HUMAN = 33,
DarkIronDwarf = 34,
//RACE_VULPERA = 35,
Vulpera = 35,
MagharOrc = 36,
MechaGnome = 37,
Max,
}
RaceMaskAllPlayable = ((1 << (Human - 1)) | (1 << (Orc - 1)) | (1 << (Dwarf - 1)) | (1 << (NightElf - 1)) | (1 << (Undead - 1))
| (1 << (Tauren - 1)) | (1 << (Gnome - 1)) | (1 << (Troll - 1)) | (1 << (BloodElf - 1)) | (1 << (Draenei - 1))
| (1 << (Goblin - 1)) | (1 << (Worgen - 1)) | (1 << (PandarenNeutral - 1)) | (1 << (PandarenAlliance - 1)) | (1 << (PandarenHorde - 1))
| (1 << (Nightborne - 1)) | (1 << (HighmountainTauren - 1)) | (1 << (VoidElf - 1)) | (1 << (LightforgedDraenei - 1)) | (1 << (DarkIronDwarf - 1)) | (1 << (MagharOrc - 1)) | (1 << (MechaGnome - 1))),
public enum RaceMask : ulong
{
AllPlayable = ((1 << (Race.Human - 1)) | (1 << (Race.Orc - 1)) | (1 << (Race.Dwarf - 1)) | (1 << (Race.NightElf - 1)) | (1 << (Race.Undead - 1))
| (1 << (Race.Tauren - 1)) | (1 << (Race.Gnome - 1)) | (1 << (Race.Troll - 1)) | (1 << (Race.BloodElf - 1)) | (1 << (Race.Draenei - 1))
| (1 << (Race.Goblin - 1)) | (1 << (Race.Worgen - 1)) | (1 << (Race.PandarenNeutral - 1)) | (1 << (Race.PandarenAlliance - 1)) | (1 << (Race.PandarenHorde - 1))
| (1 << (Race.Nightborne - 1)) | (1 << (Race.HighmountainTauren - 1)) | (1 << (Race.VoidElf - 1)) | (1 << (Race.LightforgedDraenei - 1)) | (1 << (Race.ZandalariTroll - 1))
| (1ul << (Race.KulTiran - 1)) | (1 << (Race.DarkIronDwarf - 1)) | (1 << (Race.Vulpera - 1)) | (1 << (Race.MagharOrc - 1)) | (1 << (Race.MechaGnome - 1))),
RaceMaskAlliance = ((1 << (Human - 1)) | (1 << (Dwarf - 1)) | (1 << (NightElf - 1)) | (1 << (Gnome - 1))
| (1 << (Draenei - 1)) | (1 << (Worgen - 1)) | (1 << (PandarenAlliance - 1)) | (1 << (VoidElf - 1)) | (1 << (LightforgedDraenei - 1)) | (1 << (DarkIronDwarf - 1)) | (1 << (MechaGnome - 1))),
Alliance = ((1 << (Race.Human - 1)) | (1 << (Race.Dwarf - 1)) | (1 << (Race.NightElf - 1)) | (1 << (Race.Gnome - 1))
| (1 << (Race.Draenei - 1)) | (1 << (Race.Worgen - 1)) | (1 << (Race.PandarenAlliance - 1)) | (1 << (Race.VoidElf - 1)) | (1 << (Race.LightforgedDraenei - 1))
| (1ul << (Race.KulTiran - 1)) | (1 << (Race.DarkIronDwarf - 1)) | (1 << (Race.MechaGnome - 1))),
RaceMaskHorde = RaceMaskAllPlayable & ~RaceMaskAlliance
Horde = AllPlayable & ~Alliance
}
public enum Expansion
{
+2 -2
View File
@@ -3146,7 +3146,7 @@ namespace Game.Achievements
criteria.Id, criteria.Entry.Type, DataType, ClassRace.ClassId);
return false;
}
if (ClassRace.RaceId != 0 && ((1ul << (int)(ClassRace.RaceId - 1)) & (ulong)Race.RaceMaskAllPlayable) == 0)
if (ClassRace.RaceId != 0 && ((1ul << (int)(ClassRace.RaceId - 1)) & (ulong)RaceMask.AllPlayable) == 0)
{
Log.outError(LogFilter.Sql, "Table `criteria_data` (Entry: {0} Type: {1}) for data type CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE ({2}) has non-existing race in value2 ({3}), ignored.",
criteria.Id, criteria.Entry.Type, DataType, ClassRace.RaceId);
@@ -3291,7 +3291,7 @@ namespace Game.Achievements
criteria.Id, criteria.Entry.Type, DataType, ClassRace.ClassId);
return false;
}
if (ClassRace.RaceId != 0 && ((1ul << (int)(ClassRace.RaceId - 1)) & (ulong)Race.RaceMaskAllPlayable) == 0)
if (ClassRace.RaceId != 0 && ((1ul << (int)(ClassRace.RaceId - 1)) & (ulong)RaceMask.AllPlayable) == 0)
{
Log.outError(LogFilter.Sql, "Table `criteria_data` (Entry: {0} Type: {1}) for data type CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE ({2}) has non-existing race in value2 ({3}), ignored.",
criteria.Id, criteria.Entry.Type, DataType, ClassRace.RaceId);
+2 -2
View File
@@ -1242,9 +1242,9 @@ namespace Game
}
case ConditionTypes.Race:
{
if (Convert.ToBoolean(cond.ConditionValue1 & ~(uint)Race.RaceMaskAllPlayable))
if (Convert.ToBoolean(cond.ConditionValue1 & ~(ulong)RaceMask.AllPlayable))
{
Log.outError(LogFilter.Sql, "{0} has non existing racemask ({1}), skipped.", cond.ToString(true), cond.ConditionValue1 & ~(uint)Race.RaceMaskAllPlayable);
Log.outError(LogFilter.Sql, "{0} has non existing racemask ({1}), skipped.", cond.ToString(true), cond.ConditionValue1 & ~(ulong)RaceMask.AllPlayable);
return false;
}
break;
+1 -1
View File
@@ -3902,7 +3902,7 @@ namespace Game.Entities
public static bool IsValidGender(Gender _gender) { return _gender <= Gender.Female; }
public static bool IsValidClass(Class _class) { return Convert.ToBoolean((1 << ((int)_class - 1)) & (int)Class.ClassMaskAllPlayable); }
public static bool IsValidRace(Race _race) { return Convert.ToBoolean((1 << ((int)_race - 1)) & (int)Race.RaceMaskAllPlayable); }
public static bool IsValidRace(Race _race) { return Convert.ToBoolean((1ul << ((int)_race - 1)) & (ulong)RaceMask.AllPlayable); }
public void OnCombatExit()
{
+4 -4
View File
@@ -5766,7 +5766,7 @@ namespace Game
uint classMask = result.Read<uint>(1);
uint spellId = result.Read<uint>(2);
if (raceMask != 0 && !Convert.ToBoolean(raceMask & (int)Race.RaceMaskAllPlayable))
if (raceMask != 0 && !Convert.ToBoolean(raceMask & (ulong)RaceMask.AllPlayable))
{
Log.outError(LogFilter.Sql, "Wrong race mask {0} in `playercreateinfo_spell_custom` table, ignoring.", raceMask);
continue;
@@ -5824,7 +5824,7 @@ namespace Game
uint classMask = result.Read<uint>(1);
uint spellId = result.Read<uint>(2);
if (raceMask != 0 && !raceMask.HasAnyFlag((ulong)Race.RaceMaskAllPlayable))
if (raceMask != 0 && !raceMask.HasAnyFlag((ulong)RaceMask.AllPlayable))
{
Log.outError(LogFilter.Sql, "Wrong race mask {0} in `playercreateinfo_cast_spell` table, ignoring.", raceMask);
continue;
@@ -6960,7 +6960,7 @@ namespace Game
// AllowableRaces, can be -1/RACEMASK_ALL_PLAYABLE to allow any race
if (qinfo.AllowableRaces != -1)
{
if (qinfo.AllowableRaces > 0 && !Convert.ToBoolean(qinfo.AllowableRaces & (long)Race.RaceMaskAllPlayable))
if (qinfo.AllowableRaces > 0 && !Convert.ToBoolean(qinfo.AllowableRaces & (long)RaceMask.AllPlayable))
{
Log.outError(LogFilter.Sql, "Quest {0} does not contain any playable races in `RequiredRaces` ({1}), value set to 0 (all races).", qinfo.Id, qinfo.AllowableRaces);
qinfo.AllowableRaces = -1;
@@ -8860,7 +8860,7 @@ namespace Game
continue;
}
if (!Convert.ToBoolean(raceMask & (uint)Race.RaceMaskAllPlayable))
if (!Convert.ToBoolean(raceMask & (ulong)RaceMask.AllPlayable))
{
Log.outError(LogFilter.Sql, "Table `mail_level_reward` have raceMask ({0}) for level {1} that not include any player races, ignoring.", raceMask, level);
continue;
+2 -1
View File
@@ -129,6 +129,7 @@ namespace Game
EnumCharactersResult.RaceUnlock raceUnlock = new EnumCharactersResult.RaceUnlock();
raceUnlock.RaceID = requirement.Key;
raceUnlock.HasExpansion = (byte)GetAccountExpansion() >= requirement.Value.Expansion;
raceUnlock.HasAchievement = requirement.Value.AchievementId != 0 /*|| HasAchievement(requirement.Value.AchievementId)*/;
charResult.RaceUnlockData.Add(raceUnlock);
}
@@ -2013,7 +2014,7 @@ namespace Game
var questTemplates = Global.ObjectMgr.GetQuestTemplates();
foreach (Quest quest in questTemplates.Values)
{
long newRaceMask = (long)(newTeamId == TeamId.Alliance ? Race.RaceMaskAlliance : Race.RaceMaskHorde);
long newRaceMask = (long)(newTeamId == TeamId.Alliance ? RaceMask.Alliance : RaceMask.Horde);
if (quest.AllowableRaces != -1 && !Convert.ToBoolean(quest.AllowableRaces & newRaceMask))
{
stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_CHAR_QUESTSTATUS_REWARDED_ACTIVE_BY_QUEST);
+1 -1
View File
@@ -2100,7 +2100,7 @@ namespace Game.Entities
}
}
if (spellArea.raceMask != 0 && (spellArea.raceMask & (uint)Race.RaceMaskAllPlayable) == 0)
if (spellArea.raceMask != 0 && (spellArea.raceMask & (ulong)RaceMask.AllPlayable) == 0)
{
Log.outError(LogFilter.Sql, "Spell {0} listed in `spell_area` have wrong race mask ({1}) requirement", spell, spellArea.raceMask);
continue;