Core/DataStores: Fixed db2 structures after 7.3.5

This commit is contained in:
hondacrx
2018-03-13 15:43:03 -04:00
parent 2199e07955
commit 0ab3b8e8cd
97 changed files with 3139 additions and 1707 deletions
+2 -2
View File
@@ -538,7 +538,7 @@ namespace Framework.Constants
MaxAccountExpansions MaxAccountExpansions
} }
public enum PowerType : byte public enum PowerType : sbyte
{ {
Mana = 0, Mana = 0,
Rage = 1, Rage = 1,
@@ -561,7 +561,7 @@ namespace Framework.Constants
Pain = 18, Pain = 18,
Max = 19, Max = 19,
All = 127, // default for class? All = 127, // default for class?
Health = 0xFE, // (-2 as signed value) Health = -2, // (-2 as signed value)
MaxPerClass = 6 MaxPerClass = 6
} }
File diff suppressed because it is too large Load Diff
@@ -69,7 +69,7 @@ namespace Game.Achievements
return false; return false;
} }
if (achievement.MapID != -1 && referencePlayer.GetMapId() != achievement.MapID) if (achievement.InstanceID != -1 && referencePlayer.GetMapId() != achievement.InstanceID)
{ {
Log.outTrace(LogFilter.Achievement, "CanUpdateCriteriaTree: (Id: {0} Type {1} Achievement {2}) Wrong map", Log.outTrace(LogFilter.Achievement, "CanUpdateCriteriaTree: (Id: {0} Type {1} Achievement {2}) Wrong map",
criteria.ID, criteria.Entry.Type, achievement.Id); criteria.ID, criteria.Entry.Type, achievement.Id);
@@ -157,14 +157,14 @@ namespace Game.Achievements
// Oddly, the target count is NOT contained in the achievement, but in each individual criteria // Oddly, the target count is NOT contained in the achievement, but in each individual criteria
if (entry.Flags.HasAnyFlag(AchievementFlags.Summ)) if (entry.Flags.HasAnyFlag(AchievementFlags.Summ))
{ {
ulong progress = 0; long progress = 0;
CriteriaManager.WalkCriteriaTree(tree, criteriaTree => CriteriaManager.WalkCriteriaTree(tree, criteriaTree =>
{ {
if (criteriaTree.Criteria != null) if (criteriaTree.Criteria != null)
{ {
CriteriaProgress criteriaProgress = this.GetCriteriaProgress(criteriaTree.Criteria); CriteriaProgress criteriaProgress = this.GetCriteriaProgress(criteriaTree.Criteria);
if (criteriaProgress != null) if (criteriaProgress != null)
progress += criteriaProgress.Counter; progress += (long)criteriaProgress.Counter;
} }
}); });
return progress >= tree.Entry.Amount; return progress >= tree.Entry.Amount;
@@ -1092,7 +1092,7 @@ namespace Game.Achievements
// Once Bitten, Twice Shy (10 player) - Icecrown Citadel // Once Bitten, Twice Shy (10 player) - Icecrown Citadel
AchievementRecord achievement1 = CliDB.AchievementStorage.LookupByKey(4539); AchievementRecord achievement1 = CliDB.AchievementStorage.LookupByKey(4539);
if (achievement1 != null) if (achievement1 != null)
achievement1.MapID = 631; // Correct map requirement (currently has Ulduar); 6.0.3 note - it STILL has ulduar requirement achievement1.InstanceID = 631; // Correct map requirement (currently has Ulduar); 6.0.3 note - it STILL has ulduar requirement
Log.outInfo(LogFilter.ServerLoading, "Loaded {0} achievement references in {1} ms.", count, Time.GetMSTimeDiffToNow(oldMSTime)); Log.outInfo(LogFilter.ServerLoading, "Loaded {0} achievement references in {1} ms.", count, Time.GetMSTimeDiffToNow(oldMSTime));
} }
+3 -3
View File
@@ -1181,7 +1181,7 @@ namespace Game.Achievements
if (reqType == 0) if (reqType == 0)
return true; return true;
uint reqValue = tree.Entry.Asset[0]; uint reqValue = tree.Entry.Asset;
switch ((CriteriaAdditionalCondition)reqType) switch ((CriteriaAdditionalCondition)reqType)
{ {
case CriteriaAdditionalCondition.ItemLevel: // 3 case CriteriaAdditionalCondition.ItemLevel: // 3
@@ -1485,8 +1485,8 @@ namespace Game.Achievements
Dictionary<uint, ScenarioStepRecord> scenarioCriteriaTreeIds = new Dictionary<uint, ScenarioStepRecord>(); Dictionary<uint, ScenarioStepRecord> scenarioCriteriaTreeIds = new Dictionary<uint, ScenarioStepRecord>();
foreach (ScenarioStepRecord scenarioStep in CliDB.ScenarioStepStorage.Values) foreach (ScenarioStepRecord scenarioStep in CliDB.ScenarioStepStorage.Values)
{ {
if (scenarioStep.CriteriaTreeID != 0) if (scenarioStep.CriteriaTreeId != 0)
scenarioCriteriaTreeIds[scenarioStep.CriteriaTreeID] = scenarioStep; scenarioCriteriaTreeIds[scenarioStep.CriteriaTreeId] = scenarioStep;
} }
Dictionary<uint /*criteriaTreeID*/, QuestObjective> questObjectiveCriteriaTreeIds = new Dictionary<uint, QuestObjective>(); Dictionary<uint /*criteriaTreeID*/, QuestObjective> questObjectiveCriteriaTreeIds = new Dictionary<uint, QuestObjective>();
+4 -4
View File
@@ -43,9 +43,9 @@ namespace Game
FactionTemplateRecord uEntry = CliDB.FactionTemplateStorage.LookupByKey(factionTemplateId); FactionTemplateRecord uEntry = CliDB.FactionTemplateStorage.LookupByKey(factionTemplateId);
if (uEntry == null) if (uEntry == null)
return mNeutralAuctions; return mNeutralAuctions;
else if ((uEntry.Mask & (int)FactionMasks.Alliance) != 0) else if ((uEntry.FactionGroup & (int)FactionMasks.Alliance) != 0)
return mAllianceAuctions; return mAllianceAuctions;
else if ((uEntry.Mask & (int)FactionMasks.Horde) != 0) else if ((uEntry.FactionGroup & (int)FactionMasks.Horde) != 0)
return mHordeAuctions; return mHordeAuctions;
else else
return mNeutralAuctions; return mNeutralAuctions;
@@ -387,9 +387,9 @@ namespace Game
FactionTemplateRecord u_entry = CliDB.FactionTemplateStorage.LookupByKey(factionTemplateId); FactionTemplateRecord u_entry = CliDB.FactionTemplateStorage.LookupByKey(factionTemplateId);
if (u_entry == null) if (u_entry == null)
houseid = 7; // goblin auction house houseid = 7; // goblin auction house
else if ((u_entry.Mask & (int)FactionMasks.Alliance) != 0) else if ((u_entry.FactionGroup & (int)FactionMasks.Alliance) != 0)
houseid = 1; // human auction house houseid = 1; // human auction house
else if ((u_entry.Mask & (int)FactionMasks.Horde) != 0) else if ((u_entry.FactionGroup & (int)FactionMasks.Horde) != 0)
houseid = 6; // orc auction house houseid = 6; // orc auction house
else else
houseid = 7; // goblin auction house houseid = 7; // goblin auction house
+13 -13
View File
@@ -45,20 +45,20 @@ namespace Game.BattlePets
if (!result.IsEmpty()) if (!result.IsEmpty())
Global.ObjectMgr.GetGenerator(HighGuid.BattlePet).Set(result.Read<ulong>(0) + 1); Global.ObjectMgr.GetGenerator(HighGuid.BattlePet).Set(result.Read<ulong>(0) + 1);
foreach (var breedState in CliDB.BattlePetBreedStateStorage.Values) foreach (var battlePetBreedState in CliDB.BattlePetBreedStateStorage.Values)
{ {
if (!_battlePetBreedStates.ContainsKey(breedState.BreedID)) if (!_battlePetBreedStates.ContainsKey(battlePetBreedState.BattlePetBreedID))
_battlePetBreedStates[breedState.BreedID] = new Dictionary<BattlePetState, int>(); _battlePetBreedStates[battlePetBreedState.BattlePetBreedID] = new Dictionary<BattlePetState, int>();
_battlePetBreedStates[breedState.BreedID][(BattlePetState)breedState.State] = breedState.Value; _battlePetBreedStates[battlePetBreedState.BattlePetBreedID][(BattlePetState)battlePetBreedState.BattlePetStateID] = battlePetBreedState.Value;
} }
foreach (var speciesState in CliDB.BattlePetSpeciesStateStorage.Values) foreach (var battlePetSpeciesState in CliDB.BattlePetSpeciesStateStorage.Values)
{ {
if (!_battlePetSpeciesStates.ContainsKey(speciesState.SpeciesID)) if (!_battlePetSpeciesStates.ContainsKey(battlePetSpeciesState.BattlePetSpeciesID))
_battlePetSpeciesStates[speciesState.SpeciesID] = new Dictionary<BattlePetState, int>(); _battlePetSpeciesStates[battlePetSpeciesState.BattlePetSpeciesID] = new Dictionary<BattlePetState, int>();
_battlePetSpeciesStates[speciesState.SpeciesID][(BattlePetState)speciesState.State] = speciesState.Value; _battlePetSpeciesStates[battlePetSpeciesState.BattlePetSpeciesID][(BattlePetState)battlePetSpeciesState.BattlePetStateID] = battlePetSpeciesState.Value;
} }
LoadAvailablePetBreeds(); LoadAvailablePetBreeds();
@@ -497,13 +497,13 @@ namespace Game.BattlePets
} }
// modify stats by quality // modify stats by quality
foreach (var breedQualityRecord in CliDB.BattlePetBreedQualityStorage.Values) foreach (var battlePetBreedQuality in CliDB.BattlePetBreedQualityStorage.Values)
{ {
if (breedQualityRecord.Quality == PacketInfo.Quality) if (battlePetBreedQuality.QualityEnum == PacketInfo.Quality)
{ {
health *= breedQualityRecord.Modifier; health *= battlePetBreedQuality.StateMultiplier;
power *= breedQualityRecord.Modifier; power *= battlePetBreedQuality.StateMultiplier;
speed *= breedQualityRecord.Modifier; speed *= battlePetBreedQuality.StateMultiplier;
break; break;
} }
// TOOD: add check if pet has existing quality // TOOD: add check if pet has existing quality
@@ -48,7 +48,7 @@ namespace Game.Chat
{ {
if (target.HasTitle(titleInfo)) if (target.HasTitle(titleInfo))
{ {
string name = (target.GetGender() == Gender.Male ? titleInfo.NameMale : titleInfo.NameFemale)[handler.GetSessionDbcLocale()]; string name = (target.GetGender() == Gender.Male ? titleInfo.Name : titleInfo.Name1)[handler.GetSessionDbcLocale()];
if (string.IsNullOrEmpty(name)) if (string.IsNullOrEmpty(name))
continue; continue;
+10 -10
View File
@@ -327,9 +327,9 @@ namespace Game.Chat.Commands
} }
if ((node.Pos.X == 0.0f && node.Pos.Y == 0.0f && node.Pos.Z == 0.0f) || if ((node.Pos.X == 0.0f && node.Pos.Y == 0.0f && node.Pos.Z == 0.0f) ||
!GridDefines.IsValidMapCoord(node.MapID, node.Pos.X, node.Pos.Y, node.Pos.Z)) !GridDefines.IsValidMapCoord(node.ContinentID, node.Pos.X, node.Pos.Y, node.Pos.Z))
{ {
handler.SendSysMessage(CypherStrings.InvalidTargetCoord, node.Pos.X, node.Pos.Y, node.MapID); handler.SendSysMessage(CypherStrings.InvalidTargetCoord, node.Pos.X, node.Pos.Y, node.ContinentID);
return false; return false;
} }
@@ -343,7 +343,7 @@ namespace Game.Chat.Commands
else else
player.SaveRecallPosition(); player.SaveRecallPosition();
player.TeleportTo(node.MapID, node.Pos.X, node.Pos.Y, node.Pos.Z, player.GetOrientation()); player.TeleportTo(node.ContinentID, node.Pos.X, node.Pos.Y, node.Pos.Z, player.GetOrientation());
return true; return true;
} }
@@ -366,9 +366,9 @@ namespace Game.Chat.Commands
return false; return false;
} }
if (!GridDefines.IsValidMapCoord(at.MapID, at.Pos.X, at.Pos.Y, at.Pos.Z)) if (!GridDefines.IsValidMapCoord(at.ContinentID, at.Pos.X, at.Pos.Y, at.Pos.Z))
{ {
handler.SendSysMessage(CypherStrings.InvalidTargetCoord, at.Pos.X, at.Pos.Y, at.MapID); handler.SendSysMessage(CypherStrings.InvalidTargetCoord, at.Pos.X, at.Pos.Y, at.ContinentID);
return false; return false;
} }
@@ -382,7 +382,7 @@ namespace Game.Chat.Commands
else else
player.SaveRecallPosition(); player.SaveRecallPosition();
player.TeleportTo(at.MapID, at.Pos.X, at.Pos.Y, at.Pos.Z, player.GetOrientation()); player.TeleportTo(at.ContinentID, at.Pos.X, at.Pos.Y, at.Pos.Z, player.GetOrientation());
return true; return true;
} }
@@ -420,7 +420,7 @@ namespace Game.Chat.Commands
AreaTableRecord zoneEntry = areaEntry.ParentAreaID != 0 ? CliDB.AreaTableStorage.LookupByKey(areaEntry.ParentAreaID) : areaEntry; AreaTableRecord zoneEntry = areaEntry.ParentAreaID != 0 ? CliDB.AreaTableStorage.LookupByKey(areaEntry.ParentAreaID) : areaEntry;
Contract.Assert(zoneEntry != null); Contract.Assert(zoneEntry != null);
Map map = Global.MapMgr.CreateBaseMap(zoneEntry.MapId); Map map = Global.MapMgr.CreateBaseMap(zoneEntry.ContinentID);
if (map.Instanceable()) if (map.Instanceable())
{ {
@@ -430,9 +430,9 @@ namespace Game.Chat.Commands
Global.DB2Mgr.Zone2MapCoordinates(areaEntry.ParentAreaID != 0 ? areaEntry.ParentAreaID : areaId, ref x, ref y); Global.DB2Mgr.Zone2MapCoordinates(areaEntry.ParentAreaID != 0 ? areaEntry.ParentAreaID : areaId, ref x, ref y);
if (!GridDefines.IsValidMapCoord(zoneEntry.MapId, x, y)) if (!GridDefines.IsValidMapCoord(zoneEntry.ContinentID, x, y))
{ {
handler.SendSysMessage(CypherStrings.InvalidTargetCoord, x, y, zoneEntry.MapId); handler.SendSysMessage(CypherStrings.InvalidTargetCoord, x, y, zoneEntry.ContinentID);
return false; return false;
} }
@@ -448,7 +448,7 @@ namespace Game.Chat.Commands
float z = Math.Max(map.GetHeight(x, y, MapConst.MaxHeight), map.GetWaterLevel(x, y)); float z = Math.Max(map.GetHeight(x, y, MapConst.MaxHeight), map.GetWaterLevel(x, y));
player.TeleportTo(zoneEntry.MapId, x, y, z, player.GetOrientation()); player.TeleportTo(zoneEntry.ContinentID, x, y, z, player.GetOrientation());
return true; return true;
} }
+3 -3
View File
@@ -228,11 +228,11 @@ namespace Game.Chat.Commands
if (skillLine.ClassMask != 0 && (skillLine.ClassMask & classmask) == 0) if (skillLine.ClassMask != 0 && (skillLine.ClassMask & classmask) == 0)
continue; continue;
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(skillLine.SpellID); SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(skillLine.Spell);
if (spellInfo == null || !Global.SpellMgr.IsSpellValid(spellInfo, player, false)) if (spellInfo == null || !Global.SpellMgr.IsSpellValid(spellInfo, player, false))
continue; continue;
player.LearnSpell(skillLine.SpellID, false); player.LearnSpell(skillLine.Spell, false);
} }
} }
@@ -257,7 +257,7 @@ namespace Game.Chat.Commands
foreach (var entry in CliDB.SkillLineAbilityStorage.Values) foreach (var entry in CliDB.SkillLineAbilityStorage.Values)
{ {
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(entry.SpellID); SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(entry.Spell);
if (spellInfo == null) if (spellInfo == null)
continue; continue;
+4 -4
View File
@@ -713,10 +713,10 @@ namespace Game.Chat
// send taxinode in "id - [name] (Map:m X:x Y:y Z:z)" format // send taxinode in "id - [name] (Map:m X:x Y:y Z:z)" format
if (handler.GetSession() != null) if (handler.GetSession() != null)
handler.SendSysMessage(CypherStrings.TaxinodeEntryListChat, nodeEntry.Id, nodeEntry.Id, name, "", handler.SendSysMessage(CypherStrings.TaxinodeEntryListChat, nodeEntry.Id, nodeEntry.Id, name, "",
nodeEntry.MapID, nodeEntry.Pos.X, nodeEntry.Pos.Y, nodeEntry.Pos.Z); nodeEntry.ContinentID, nodeEntry.Pos.X, nodeEntry.Pos.Y, nodeEntry.Pos.Z);
else else
handler.SendSysMessage(CypherStrings.TaxinodeEntryListConsole, nodeEntry.Id, name, "", handler.SendSysMessage(CypherStrings.TaxinodeEntryListConsole, nodeEntry.Id, name, "",
nodeEntry.MapID, nodeEntry.Pos.X, nodeEntry.Pos.Y, nodeEntry.Pos.Z); nodeEntry.ContinentID, nodeEntry.Pos.X, nodeEntry.Pos.Y, nodeEntry.Pos.Z);
if (!found) if (!found)
found = true; found = true;
@@ -795,7 +795,7 @@ namespace Game.Chat
continue; continue;
LocaleConstant locale = handler.GetSessionDbcLocale(); LocaleConstant locale = handler.GetSessionDbcLocale();
string name = gender == Gender.Male ? titleInfo.NameMale[locale]: titleInfo.NameFemale[locale]; string name = gender == Gender.Male ? titleInfo.Name[locale]: titleInfo.Name1[locale];
if (string.IsNullOrEmpty(name)) if (string.IsNullOrEmpty(name))
continue; continue;
@@ -807,7 +807,7 @@ namespace Game.Chat
if (locale == handler.GetSessionDbcLocale()) if (locale == handler.GetSessionDbcLocale())
continue; continue;
name = (gender == Gender.Male ? titleInfo.NameMale : titleInfo.NameFemale)[locale]; name = (gender == Gender.Male ? titleInfo.Name : titleInfo.Name1)[locale];
if (name.IsEmpty()) if (name.IsEmpty())
continue; continue;
+1 -1
View File
@@ -277,7 +277,7 @@ namespace Game.Chat
var record = CliDB.ItemSparseStorage.Values.FirstOrDefault(itemSparse => var record = CliDB.ItemSparseStorage.Values.FirstOrDefault(itemSparse =>
{ {
for (LocaleConstant i = 0; i < LocaleConstant.Max; ++i) for (LocaleConstant i = 0; i < LocaleConstant.Max; ++i)
if (itemName == itemSparse.Name[i]) if (itemName == itemSparse.Display[i])
return true; return true;
return false; return false;
}); });
+2 -2
View File
@@ -555,8 +555,8 @@ namespace Game.Chat
return false; return false;
} }
NotifyModification(handler, target, CypherStrings.YouChangePower, CypherStrings.YourPowerChanged, powerType.PowerTypeToken, powerAmount, powerAmount); NotifyModification(handler, target, CypherStrings.YouChangePower, CypherStrings.YourPowerChanged, powerType.NameGlobalStringTag, powerAmount, powerAmount);
powerAmount *= powerType.UIModifier; powerAmount *= powerType.DisplayModifier;
target.SetMaxPower(powerType.PowerTypeEnum, powerAmount); target.SetMaxPower(powerType.PowerTypeEnum, powerAmount);
target.SetPower(powerType.PowerTypeEnum, powerAmount); target.SetPower(powerType.PowerTypeEnum, powerAmount);
return true; return true;
+1 -1
View File
@@ -67,7 +67,7 @@ namespace Game.Chat
return false; return false;
} }
PowerType powerType = classEntry.PowerType; PowerType powerType = classEntry.DisplayPower;
// reset m_form if no aura // reset m_form if no aura
if (!player.HasAuraType(AuraType.ModShapeshift)) if (!player.HasAuraType(AuraType.ModShapeshift))
+3 -3
View File
@@ -64,7 +64,7 @@ namespace Game.Chat.Commands
target.SetTitle(titleInfo); // to be sure that title now known target.SetTitle(titleInfo); // to be sure that title now known
target.SetUInt32Value(PlayerFields.ChosenTitle, titleInfo.MaskID); target.SetUInt32Value(PlayerFields.ChosenTitle, titleInfo.MaskID);
handler.SendSysMessage(CypherStrings.TitleCurrentRes, id, (target.GetGender() == Gender.Male ? titleInfo.NameMale : titleInfo.NameFemale)[handler.GetSessionDbcLocale()], tNameLink); handler.SendSysMessage(CypherStrings.TitleCurrentRes, id, (target.GetGender() == Gender.Male ? titleInfo.Name : titleInfo.Name1)[handler.GetSessionDbcLocale()], tNameLink);
return true; return true;
} }
@@ -102,7 +102,7 @@ namespace Game.Chat.Commands
string tNameLink = handler.GetNameLink(target); string tNameLink = handler.GetNameLink(target);
string titleNameStr = string.Format((target.GetGender() == Gender.Male ? titleInfo.NameMale : titleInfo.NameFemale)[handler.GetSessionDbcLocale()].ConvertFormatSyntax(), target.GetName()); string titleNameStr = string.Format((target.GetGender() == Gender.Male ? titleInfo.Name : titleInfo.Name1)[handler.GetSessionDbcLocale()].ConvertFormatSyntax(), target.GetName());
target.SetTitle(titleInfo); target.SetTitle(titleInfo);
handler.SendSysMessage(CypherStrings.TitleAddRes, id, titleNameStr, tNameLink); handler.SendSysMessage(CypherStrings.TitleAddRes, id, titleNameStr, tNameLink);
@@ -146,7 +146,7 @@ namespace Game.Chat.Commands
string tNameLink = handler.GetNameLink(target); string tNameLink = handler.GetNameLink(target);
string titleNameStr = string.Format((target.GetGender() == Gender.Male ? titleInfo.NameMale : titleInfo.NameFemale)[handler.GetSessionDbcLocale()].ConvertFormatSyntax(), target.GetName()); string titleNameStr = string.Format((target.GetGender() == Gender.Male ? titleInfo.Name : titleInfo.Name1)[handler.GetSessionDbcLocale()].ConvertFormatSyntax(), target.GetName());
handler.SendSysMessage(CypherStrings.TitleRemoveRes, id, titleNameStr, tNameLink); handler.SendSysMessage(CypherStrings.TitleRemoveRes, id, titleNameStr, tNameLink);
+4 -4
View File
@@ -1792,10 +1792,10 @@ namespace Game
if (condition.MovementFlags[1] != 0 && !Convert.ToBoolean((uint)player.GetUnitMovementFlags2() & condition.MovementFlags[1])) if (condition.MovementFlags[1] != 0 && !Convert.ToBoolean((uint)player.GetUnitMovementFlags2() & condition.MovementFlags[1]))
return false; return false;
if (condition.MainHandItemSubclassMask != 0) if (condition.WeaponSubclassMask != 0)
{ {
Item mainHand = player.GetItemByPos(InventorySlots.Bag0, EquipmentSlot.MainHand); Item mainHand = player.GetItemByPos(InventorySlots.Bag0, EquipmentSlot.MainHand);
if (!mainHand || !Convert.ToBoolean((1 << (int)mainHand.GetTemplate().GetSubClass()) & condition.MainHandItemSubclassMask)) if (!mainHand || !Convert.ToBoolean((1 << (int)mainHand.GetTemplate().GetSubClass()) & condition.WeaponSubclassMask))
return false; return false;
} }
@@ -1927,8 +1927,8 @@ namespace Game
{ {
if (condition.AuraSpellID[i] != 0) if (condition.AuraSpellID[i] != 0)
{ {
if (condition.AuraCount[i] != 0) if (condition.AuraStacks[i] != 0)
results[i] = player.GetAuraCount(condition.AuraSpellID[i]) >= condition.AuraCount[i]; results[i] = player.GetAuraCount(condition.AuraSpellID[i]) >= condition.AuraStacks[i];
else else
results[i] = player.HasAura(condition.AuraSpellID[i]); results[i] = player.HasAura(condition.AuraSpellID[i]);
} }
+11 -12
View File
@@ -89,21 +89,21 @@ namespace Game.DataStorage
DurabilityCostsStorage = DBReader.Read<DurabilityCostsRecord>("DurabilityCosts.db2", HotfixStatements.SEL_DURABILITY_COSTS); DurabilityCostsStorage = DBReader.Read<DurabilityCostsRecord>("DurabilityCosts.db2", HotfixStatements.SEL_DURABILITY_COSTS);
DurabilityQualityStorage = DBReader.Read<DurabilityQualityRecord>("DurabilityQuality.db2", HotfixStatements.SEL_DURABILITY_QUALITY); DurabilityQualityStorage = DBReader.Read<DurabilityQualityRecord>("DurabilityQuality.db2", HotfixStatements.SEL_DURABILITY_QUALITY);
EmotesStorage = DBReader.Read<EmotesRecord>("Emotes.db2", HotfixStatements.SEL_EMOTES); EmotesStorage = DBReader.Read<EmotesRecord>("Emotes.db2", HotfixStatements.SEL_EMOTES);
EmotesTextStorage = DBReader.Read<EmotesTextRecord>("EmotesText.db2", HotfixStatements.SEL_EMOTES_TEXT, HotfixStatements.SEL_EMOTES_TEXT_LOCALE); EmotesTextStorage = DBReader.Read<EmotesTextRecord>("EmotesText.db2", HotfixStatements.SEL_EMOTES_TEXT);
EmotesTextSoundStorage = DBReader.Read<EmotesTextSoundRecord>("EmotesTextSound.db2", HotfixStatements.SEL_EMOTES_TEXT_SOUND); EmotesTextSoundStorage = DBReader.Read<EmotesTextSoundRecord>("EmotesTextSound.db2", HotfixStatements.SEL_EMOTES_TEXT_SOUND);
FactionStorage = DBReader.Read<FactionRecord>("Faction.db2", HotfixStatements.SEL_FACTION, HotfixStatements.SEL_FACTION_LOCALE); FactionStorage = DBReader.Read<FactionRecord>("Faction.db2", HotfixStatements.SEL_FACTION, HotfixStatements.SEL_FACTION_LOCALE);
FactionTemplateStorage = DBReader.Read<FactionTemplateRecord>("FactionTemplate.db2", HotfixStatements.SEL_FACTION_TEMPLATE); FactionTemplateStorage = DBReader.Read<FactionTemplateRecord>("FactionTemplate.db2", HotfixStatements.SEL_FACTION_TEMPLATE);
GameObjectsStorage = DBReader.Read<GameObjectsRecord>("GameObjects.db2", HotfixStatements.SEL_GAMEOBJECTS, HotfixStatements.SEL_GAMEOBJECTS_LOCALE);
GameObjectDisplayInfoStorage = DBReader.Read<GameObjectDisplayInfoRecord>("GameObjectDisplayInfo.db2", HotfixStatements.SEL_GAMEOBJECT_DISPLAY_INFO); GameObjectDisplayInfoStorage = DBReader.Read<GameObjectDisplayInfoRecord>("GameObjectDisplayInfo.db2", HotfixStatements.SEL_GAMEOBJECT_DISPLAY_INFO);
GameObjectsStorage = DBReader.Read<GameObjectsRecord>("GameObjects.db2", HotfixStatements.SEL_GAMEOBJECTS, HotfixStatements.SEL_GAMEOBJECTS_LOCALE);
GarrAbilityStorage = DBReader.Read<GarrAbilityRecord>("GarrAbility.db2", HotfixStatements.SEL_GARR_ABILITY, HotfixStatements.SEL_GARR_ABILITY_LOCALE); GarrAbilityStorage = DBReader.Read<GarrAbilityRecord>("GarrAbility.db2", HotfixStatements.SEL_GARR_ABILITY, HotfixStatements.SEL_GARR_ABILITY_LOCALE);
GarrBuildingStorage = DBReader.Read<GarrBuildingRecord>("GarrBuilding.db2", HotfixStatements.SEL_GARR_BUILDING, HotfixStatements.SEL_GARR_BUILDING_LOCALE); GarrBuildingStorage = DBReader.Read<GarrBuildingRecord>("GarrBuilding.db2", HotfixStatements.SEL_GARR_BUILDING, HotfixStatements.SEL_GARR_BUILDING_LOCALE);
GarrBuildingPlotInstStorage = DBReader.Read<GarrBuildingPlotInstRecord>("GarrBuildingPlotInst.db2", HotfixStatements.SEL_GARR_BUILDING_PLOT_INST); GarrBuildingPlotInstStorage = DBReader.Read<GarrBuildingPlotInstRecord>("GarrBuildingPlotInst.db2", HotfixStatements.SEL_GARR_BUILDING_PLOT_INST);
GarrClassSpecStorage = DBReader.Read<GarrClassSpecRecord>("GarrClassSpec.db2", HotfixStatements.SEL_GARR_CLASS_SPEC, HotfixStatements.SEL_GARR_CLASS_SPEC_LOCALE); GarrClassSpecStorage = DBReader.Read<GarrClassSpecRecord>("GarrClassSpec.db2", HotfixStatements.SEL_GARR_CLASS_SPEC, HotfixStatements.SEL_GARR_CLASS_SPEC_LOCALE);
GarrFollowerStorage = DBReader.Read<GarrFollowerRecord>("GarrFollower.db2", HotfixStatements.SEL_GARR_FOLLOWER, HotfixStatements.SEL_GARR_FOLLOWER_LOCALE); GarrFollowerStorage = DBReader.Read<GarrFollowerRecord>("GarrFollower.db2", HotfixStatements.SEL_GARR_FOLLOWER, HotfixStatements.SEL_GARR_FOLLOWER_LOCALE);
GarrFollowerXAbilityStorage = DBReader.Read<GarrFollowerXAbilityRecord>("GarrFollowerXAbility.db2", HotfixStatements.SEL_GARR_FOLLOWER_X_ABILITY); GarrFollowerXAbilityStorage = DBReader.Read<GarrFollowerXAbilityRecord>("GarrFollowerXAbility.db2", HotfixStatements.SEL_GARR_FOLLOWER_X_ABILITY);
GarrPlotBuildingStorage = DBReader.Read<GarrPlotBuildingRecord>("GarrPlotBuilding.db2", HotfixStatements.SEL_GARR_PLOT_BUILDING);
GarrPlotStorage = DBReader.Read<GarrPlotRecord>("GarrPlot.db2", HotfixStatements.SEL_GARR_PLOT, HotfixStatements.SEL_GARR_PLOT_LOCALE); GarrPlotStorage = DBReader.Read<GarrPlotRecord>("GarrPlot.db2", HotfixStatements.SEL_GARR_PLOT, HotfixStatements.SEL_GARR_PLOT_LOCALE);
GarrPlotInstanceStorage = DBReader.Read<GarrPlotInstanceRecord>("GarrPlotInstance.db2", HotfixStatements.SEL_GARR_PLOT_INSTANCE, HotfixStatements.SEL_GARR_PLOT_INSTANCE_LOCALE); GarrPlotBuildingStorage = DBReader.Read<GarrPlotBuildingRecord>("GarrPlotBuilding.db2", HotfixStatements.SEL_GARR_PLOT_BUILDING);
GarrPlotInstanceStorage = DBReader.Read<GarrPlotInstanceRecord>("GarrPlotInstance.db2", HotfixStatements.SEL_GARR_PLOT_INSTANCE);
GarrSiteLevelStorage = DBReader.Read<GarrSiteLevelRecord>("GarrSiteLevel.db2", HotfixStatements.SEL_GARR_SITE_LEVEL); GarrSiteLevelStorage = DBReader.Read<GarrSiteLevelRecord>("GarrSiteLevel.db2", HotfixStatements.SEL_GARR_SITE_LEVEL);
GarrSiteLevelPlotInstStorage = DBReader.Read<GarrSiteLevelPlotInstRecord>("GarrSiteLevelPlotInst.db2", HotfixStatements.SEL_GARR_SITE_LEVEL_PLOT_INST); GarrSiteLevelPlotInstStorage = DBReader.Read<GarrSiteLevelPlotInstRecord>("GarrSiteLevelPlotInst.db2", HotfixStatements.SEL_GARR_SITE_LEVEL_PLOT_INST);
GemPropertiesStorage = DBReader.Read<GemPropertiesRecord>("GemProperties.db2", HotfixStatements.SEL_GEM_PROPERTIES); GemPropertiesStorage = DBReader.Read<GemPropertiesRecord>("GemProperties.db2", HotfixStatements.SEL_GEM_PROPERTIES);
@@ -159,7 +159,7 @@ namespace Game.DataStorage
//KeyChainStorage = DBReader.Read<KeyChainRecord>("KeyChain.db2", HotfixStatements.SEL_KEYCHAIN); //KeyChainStorage = DBReader.Read<KeyChainRecord>("KeyChain.db2", HotfixStatements.SEL_KEYCHAIN);
LFGDungeonsStorage = DBReader.Read<LFGDungeonsRecord>("LFGDungeons.db2", HotfixStatements.SEL_LFG_DUNGEONS, HotfixStatements.SEL_LFG_DUNGEONS_LOCALE); LFGDungeonsStorage = DBReader.Read<LFGDungeonsRecord>("LFGDungeons.db2", HotfixStatements.SEL_LFG_DUNGEONS, HotfixStatements.SEL_LFG_DUNGEONS_LOCALE);
LightStorage = DBReader.Read<LightRecord>("Light.db2", HotfixStatements.SEL_LIGHT); LightStorage = DBReader.Read<LightRecord>("Light.db2", HotfixStatements.SEL_LIGHT);
LiquidTypeStorage = DBReader.Read<LiquidTypeRecord>("LiquidType.db2", HotfixStatements.SEL_LIQUID_TYPE, HotfixStatements.SEL_LIQUID_TYPE_LOCALE); LiquidTypeStorage = DBReader.Read<LiquidTypeRecord>("LiquidType.db2", HotfixStatements.SEL_LIQUID_TYPE);
LockStorage = DBReader.Read<LockRecord>("Lock.db2", HotfixStatements.SEL_LOCK); LockStorage = DBReader.Read<LockRecord>("Lock.db2", HotfixStatements.SEL_LOCK);
MailTemplateStorage = DBReader.Read<MailTemplateRecord>("MailTemplate.db2", HotfixStatements.SEL_MAIL_TEMPLATE, HotfixStatements.SEL_MAIL_TEMPLATE_LOCALE); MailTemplateStorage = DBReader.Read<MailTemplateRecord>("MailTemplate.db2", HotfixStatements.SEL_MAIL_TEMPLATE, HotfixStatements.SEL_MAIL_TEMPLATE_LOCALE);
MapStorage = DBReader.Read<MapRecord>("Map.db2", HotfixStatements.SEL_MAP, HotfixStatements.SEL_MAP_LOCALE); MapStorage = DBReader.Read<MapRecord>("Map.db2", HotfixStatements.SEL_MAP, HotfixStatements.SEL_MAP_LOCALE);
@@ -170,7 +170,7 @@ namespace Game.DataStorage
MountTypeXCapabilityStorage = DBReader.Read<MountTypeXCapabilityRecord>("MountTypeXCapability.db2", HotfixStatements.SEL_MOUNT_TYPE_X_CAPABILITY); MountTypeXCapabilityStorage = DBReader.Read<MountTypeXCapabilityRecord>("MountTypeXCapability.db2", HotfixStatements.SEL_MOUNT_TYPE_X_CAPABILITY);
MountXDisplayStorage = DBReader.Read<MountXDisplayRecord>("MountXDisplay.db2", HotfixStatements.SEL_MOUNT_X_DISPLAY); MountXDisplayStorage = DBReader.Read<MountXDisplayRecord>("MountXDisplay.db2", HotfixStatements.SEL_MOUNT_X_DISPLAY);
MovieStorage = DBReader.Read<MovieRecord>("Movie.db2", HotfixStatements.SEL_MOVIE); MovieStorage = DBReader.Read<MovieRecord>("Movie.db2", HotfixStatements.SEL_MOVIE);
NameGenStorage = DBReader.Read<NameGenRecord>("NameGen.db2", HotfixStatements.SEL_NAME_GEN, HotfixStatements.SEL_NAME_GEN_LOCALE); NameGenStorage = DBReader.Read<NameGenRecord>("NameGen.db2", HotfixStatements.SEL_NAME_GEN);
NamesProfanityStorage = DBReader.Read<NamesProfanityRecord>("NamesProfanity.db2", HotfixStatements.SEL_NAMES_PROFANITY); NamesProfanityStorage = DBReader.Read<NamesProfanityRecord>("NamesProfanity.db2", HotfixStatements.SEL_NAMES_PROFANITY);
NamesReservedStorage = DBReader.Read<NamesReservedRecord>("NamesReserved.db2", HotfixStatements.SEL_NAMES_RESERVED, HotfixStatements.SEL_NAMES_RESERVED_LOCALE); NamesReservedStorage = DBReader.Read<NamesReservedRecord>("NamesReserved.db2", HotfixStatements.SEL_NAMES_RESERVED, HotfixStatements.SEL_NAMES_RESERVED_LOCALE);
NamesReservedLocaleStorage = DBReader.Read<NamesReservedLocaleRecord>("NamesReservedLocale.db2", HotfixStatements.SEL_NAMES_RESERVED_LOCALE); NamesReservedLocaleStorage = DBReader.Read<NamesReservedLocaleRecord>("NamesReservedLocale.db2", HotfixStatements.SEL_NAMES_RESERVED_LOCALE);
@@ -265,19 +265,18 @@ namespace Game.DataStorage
WorldMapTransformsStorage = DBReader.Read<WorldMapTransformsRecord>("WorldMapTransforms.db2", HotfixStatements.SEL_WORLD_MAP_TRANSFORMS); WorldMapTransformsStorage = DBReader.Read<WorldMapTransformsRecord>("WorldMapTransforms.db2", HotfixStatements.SEL_WORLD_MAP_TRANSFORMS);
WorldSafeLocsStorage = DBReader.Read<WorldSafeLocsRecord>("WorldSafeLocs.db2", HotfixStatements.SEL_WORLD_SAFE_LOCS, HotfixStatements.SEL_WORLD_SAFE_LOCS_LOCALE); WorldSafeLocsStorage = DBReader.Read<WorldSafeLocsRecord>("WorldSafeLocs.db2", HotfixStatements.SEL_WORLD_SAFE_LOCS, HotfixStatements.SEL_WORLD_SAFE_LOCS_LOCALE);
foreach (var entry in TaxiPathStorage.Values) foreach (var entry in TaxiPathStorage.Values)
{ {
if (!TaxiPathSetBySource.ContainsKey(entry.From)) if (!TaxiPathSetBySource.ContainsKey(entry.FromTaxiNode))
TaxiPathSetBySource.Add(entry.From, new Dictionary<uint, TaxiPathBySourceAndDestination>()); TaxiPathSetBySource.Add(entry.FromTaxiNode, new Dictionary<uint, TaxiPathBySourceAndDestination>());
TaxiPathSetBySource[entry.From][entry.To] = new TaxiPathBySourceAndDestination(entry.Id, entry.Cost); TaxiPathSetBySource[entry.FromTaxiNode][entry.ToTaxiNode] = new TaxiPathBySourceAndDestination(entry.Id, entry.Cost);
} }
uint pathCount = TaxiPathStorage.Keys.Max() + 1; uint pathCount = TaxiPathStorage.Keys.Max() + 1;
// Calculate path nodes count // Calculate path nodes count
uint[] pathLength = new uint[pathCount]; // 0 and some other indexes not used uint[] pathLength = new uint[pathCount]; // 0 and some other indexes not used
foreach (TaxiPathNodeRecord entry in CliDB.TaxiPathNodeStorage.Values) foreach (TaxiPathNodeRecord entry in TaxiPathNodeStorage.Values)
if (pathLength[entry.PathID] < entry.NodeIndex + 1) if (pathLength[entry.PathID] < entry.NodeIndex + 1)
pathLength[entry.PathID] = entry.NodeIndex + 1u; pathLength[entry.PathID] = entry.NodeIndex + 1u;
@@ -305,7 +304,7 @@ namespace Game.DataStorage
AllianceTaxiNodesMask[field] |= submask; AllianceTaxiNodesMask[field] |= submask;
uint nodeMap; uint nodeMap;
Global.DB2Mgr.DeterminaAlternateMapPosition(node.MapID, node.Pos.X, node.Pos.Y, node.Pos.Z, out nodeMap); Global.DB2Mgr.DeterminaAlternateMapPosition(node.ContinentID, node.Pos.X, node.Pos.Y, node.Pos.Z, out nodeMap);
if (nodeMap < 2) if (nodeMap < 2)
OldContinentsNodesMask[field] |= submask; OldContinentsNodesMask[field] |= submask;
} }
@@ -480,16 +480,17 @@ namespace Game.DataStorage
static Dictionary<Type, int> bytecounts = new Dictionary<Type, int>() static Dictionary<Type, int> bytecounts = new Dictionary<Type, int>()
{ {
{ typeof(byte), 1 }, { typeof(byte), 1 },
{ typeof(sbyte), 1 },
{ typeof(short), 2 }, { typeof(short), 2 },
{ typeof(ushort), 2 }, { typeof(ushort), 2 },
}; };
static int GetPadding(Type type, int fieldIndex) static int GetPadding(Type type, int fieldIndex)
{ {
if (!bytecounts.ContainsKey(type)) if (ColumnMeta[fieldIndex].CompressionType < DB2ColumnCompression.CommonData)
return 0; return 0;
if (ColumnMeta[fieldIndex].CompressionType < DB2ColumnCompression.CommonData) if (!bytecounts.ContainsKey(type))
return 0; return 0;
return 4 - bytecounts[type]; return 4 - bytecounts[type];
@@ -186,10 +186,10 @@ namespace Game.DataStorage
else else
Log.outError(LogFilter.Sql, "Table `conversation_line_template` has missing template for line (ID: {0}) in Conversation {1}, skipped", currentConversationLine.Id, conversationTemplate.Id); Log.outError(LogFilter.Sql, "Table `conversation_line_template` has missing template for line (ID: {0}) in Conversation {1}, skipped", currentConversationLine.Id, conversationTemplate.Id);
if (currentConversationLine.NextLineID == 0) if (currentConversationLine.NextConversationLineID == 0)
break; break;
currentConversationLine = CliDB.ConversationLineStorage.LookupByKey(currentConversationLine.NextLineID); currentConversationLine = CliDB.ConversationLineStorage.LookupByKey(currentConversationLine.NextConversationLineID);
} }
_conversationTemplateStorage[conversationTemplate.Id] = conversationTemplate; _conversationTemplateStorage[conversationTemplate.Id] = conversationTemplate;
+105 -110
View File
@@ -54,14 +54,14 @@ namespace Game.DataStorage
foreach (ArtifactPowerLinkRecord artifactPowerLink in CliDB.ArtifactPowerLinkStorage.Values) foreach (ArtifactPowerLinkRecord artifactPowerLink in CliDB.ArtifactPowerLinkStorage.Values)
{ {
_artifactPowerLinks.Add(artifactPowerLink.FromArtifactPowerID, artifactPowerLink.ToArtifactPowerID); _artifactPowerLinks.Add(artifactPowerLink.PowerA, artifactPowerLink.PowerB);
_artifactPowerLinks.Add(artifactPowerLink.ToArtifactPowerID, artifactPowerLink.FromArtifactPowerID); _artifactPowerLinks.Add(artifactPowerLink.PowerB, artifactPowerLink.PowerA);
} }
CliDB.ArtifactPowerLinkStorage.Clear(); CliDB.ArtifactPowerLinkStorage.Clear();
foreach (ArtifactPowerRankRecord artifactPowerRank in CliDB.ArtifactPowerRankStorage.Values) foreach (ArtifactPowerRankRecord artifactPowerRank in CliDB.ArtifactPowerRankStorage.Values)
_artifactPowerRanks[Tuple.Create((uint)artifactPowerRank.ArtifactPowerID, artifactPowerRank.Rank)] = artifactPowerRank; _artifactPowerRanks[Tuple.Create((uint)artifactPowerRank.ArtifactPowerID, artifactPowerRank.RankIndex)] = artifactPowerRank;
CliDB.ArtifactPowerRankStorage.Clear(); CliDB.ArtifactPowerRankStorage.Clear();
@@ -73,10 +73,10 @@ namespace Game.DataStorage
CharBaseSectionVariation[] sectionToBase = new CharBaseSectionVariation[(int)CharSectionType.Max]; CharBaseSectionVariation[] sectionToBase = new CharBaseSectionVariation[(int)CharSectionType.Max];
foreach (CharBaseSectionRecord charBaseSection in CliDB.CharBaseSectionStorage.Values) foreach (CharBaseSectionRecord charBaseSection in CliDB.CharBaseSectionStorage.Values)
{ {
Contract.Assert(charBaseSection.ResolutionVariation < (byte)CharSectionType.Max, $"SECTION_TYPE_MAX ({(byte)CharSectionType.Max}) must be equal to or greater than {charBaseSection.ResolutionVariation + 1}"); Contract.Assert(charBaseSection.ResolutionVariationEnum < (byte)CharSectionType.Max, $"SECTION_TYPE_MAX ({(byte)CharSectionType.Max}) must be equal to or greater than {charBaseSection.ResolutionVariationEnum + 1}");
Contract.Assert(charBaseSection.Variation < CharBaseSectionVariation.Max, $"CharBaseSectionVariation.Max {(byte)CharBaseSectionVariation.Max} must be equal to or greater than {charBaseSection.Variation + 1}"); Contract.Assert(charBaseSection.VariationEnum < CharBaseSectionVariation.Max, $"CharBaseSectionVariation.Max {(byte)CharBaseSectionVariation.Max} must be equal to or greater than {charBaseSection.VariationEnum + 1}");
sectionToBase[charBaseSection.ResolutionVariation] = charBaseSection.Variation; sectionToBase[charBaseSection.ResolutionVariationEnum] = charBaseSection.VariationEnum;
} }
CliDB.CharBaseSectionStorage.Clear(); CliDB.CharBaseSectionStorage.Clear();
@@ -98,7 +98,7 @@ namespace Game.DataStorage
CliDB.CharSectionsStorage.Clear(); CliDB.CharSectionsStorage.Clear();
foreach (var outfit in CliDB.CharStartOutfitStorage.Values) foreach (var outfit in CliDB.CharStartOutfitStorage.Values)
_charStartOutfits[(uint)((byte)outfit.RaceID | (outfit.ClassID << 8) | (outfit.GenderID << 16))] = outfit; _charStartOutfits[(uint)((byte)outfit.RaceID | (outfit.ClassID << 8) | (outfit.SexID << 16))] = outfit;
var powers = new List<ChrClassesXPowerTypesRecord>(); var powers = new List<ChrClassesXPowerTypesRecord>();
foreach (var chrClasses in CliDB.ChrClassesXPowerTypesStorage.Values) foreach (var chrClasses in CliDB.ChrClassesXPowerTypesStorage.Values)
@@ -146,10 +146,10 @@ namespace Game.DataStorage
CliDB.CurvePointStorage.Clear(); CliDB.CurvePointStorage.Clear();
foreach (var key in _curvePoints.Keys.ToList()) foreach (var key in _curvePoints.Keys.ToList())
_curvePoints[key] = _curvePoints[key].OrderBy(point => point.Index).ToList(); _curvePoints[key] = _curvePoints[key].OrderBy(point => point.OrderIndex).ToList();
foreach (EmotesTextSoundRecord emoteTextSound in CliDB.EmotesTextSoundStorage.Values) foreach (EmotesTextSoundRecord emoteTextSound in CliDB.EmotesTextSoundStorage.Values)
_emoteTextSounds[Tuple.Create((uint)emoteTextSound.EmotesTextId, emoteTextSound.RaceId, emoteTextSound.SexId, emoteTextSound.ClassId)] = emoteTextSound; _emoteTextSounds[Tuple.Create(emoteTextSound.EmotesTextId, emoteTextSound.RaceId, emoteTextSound.SexId, emoteTextSound.ClassId)] = emoteTextSound;
CliDB.EmotesTextSoundStorage.Clear(); CliDB.EmotesTextSoundStorage.Clear();
@@ -183,23 +183,23 @@ namespace Game.DataStorage
CliDB.GlyphRequiredSpecStorage.Clear(); CliDB.GlyphRequiredSpecStorage.Clear();
foreach (var bonus in CliDB.ItemBonusStorage.Values) foreach (var bonus in CliDB.ItemBonusStorage.Values)
_itemBonusLists.Add(bonus.BonusListID, bonus); _itemBonusLists.Add(bonus.ParentItemBonusListID, bonus);
CliDB.ItemBonusStorage.Clear(); CliDB.ItemBonusStorage.Clear();
foreach (ItemBonusListLevelDeltaRecord itemBonusListLevelDelta in CliDB.ItemBonusListLevelDeltaStorage.Values) foreach (ItemBonusListLevelDeltaRecord itemBonusListLevelDelta in CliDB.ItemBonusListLevelDeltaStorage.Values)
_itemLevelDeltaToBonusListContainer[itemBonusListLevelDelta.Delta] = itemBonusListLevelDelta.Id; _itemLevelDeltaToBonusListContainer[itemBonusListLevelDelta.ItemLevelDelta] = itemBonusListLevelDelta.Id;
CliDB.ItemBonusListLevelDeltaStorage.Clear(); CliDB.ItemBonusListLevelDeltaStorage.Clear();
foreach (var key in CliDB.ItemBonusTreeNodeStorage.Keys) foreach (var key in CliDB.ItemBonusTreeNodeStorage.Keys)
{ {
ItemBonusTreeNodeRecord bonusTreeNode = CliDB.ItemBonusTreeNodeStorage[key]; ItemBonusTreeNodeRecord bonusTreeNode = CliDB.ItemBonusTreeNodeStorage[key];
uint bonusTreeId = bonusTreeNode.BonusTreeID; uint bonusTreeId = bonusTreeNode.ParentItemBonusTreeID;
while (bonusTreeNode != null) while (bonusTreeNode != null)
{ {
_itemBonusTrees.Add(bonusTreeId, bonusTreeNode); _itemBonusTrees.Add(bonusTreeId, bonusTreeNode);
bonusTreeNode = CliDB.ItemBonusTreeNodeStorage.LookupByKey(bonusTreeNode.SubTreeID); bonusTreeNode = CliDB.ItemBonusTreeNodeStorage.LookupByKey(bonusTreeNode.ChildItemBonusTreeID);
} }
} }
@@ -207,35 +207,35 @@ namespace Game.DataStorage
foreach (ItemChildEquipmentRecord itemChildEquipment in CliDB.ItemChildEquipmentStorage.Values) foreach (ItemChildEquipmentRecord itemChildEquipment in CliDB.ItemChildEquipmentStorage.Values)
{ {
//ASSERT(_itemChildEquipment.find(itemChildEquipment.ItemID) == _itemChildEquipment.end(), "Item must have max 1 child item."); //ASSERT(_itemChildEquipment.find(itemChildEquipment.ParentItemID) == _itemChildEquipment.end(), "Item must have max 1 child item.");
_itemChildEquipment[itemChildEquipment.ItemID] = itemChildEquipment; _itemChildEquipment[itemChildEquipment.ParentItemID] = itemChildEquipment;
} }
CliDB.ItemChildEquipmentStorage.Clear(); CliDB.ItemChildEquipmentStorage.Clear();
foreach (ItemClassRecord itemClass in CliDB.ItemClassStorage.Values) foreach (ItemClassRecord itemClass in CliDB.ItemClassStorage.Values)
{ {
//ASSERT(itemClass->OldEnumValue < _itemClassByOldEnum.size()); //ASSERT(itemClass->ClassID < _itemClassByOldEnum.size());
//ASSERT(!_itemClassByOldEnum[itemClass->OldEnumValue]); //ASSERT(!_itemClassByOldEnum[itemClass->ClassID]);
_itemClassByOldEnum[itemClass.OldEnumValue] = itemClass; _itemClassByOldEnum[itemClass.ClassID] = itemClass;
} }
CliDB.ItemClassStorage.Clear(); CliDB.ItemClassStorage.Clear();
foreach (ItemCurrencyCostRecord itemCurrencyCost in CliDB.ItemCurrencyCostStorage.Values) foreach (ItemCurrencyCostRecord itemCurrencyCost in CliDB.ItemCurrencyCostStorage.Values)
_itemsWithCurrencyCost.Add(itemCurrencyCost.ItemId); _itemsWithCurrencyCost.Add(itemCurrencyCost.ItemID);
CliDB.ItemCurrencyCostStorage.Clear(); CliDB.ItemCurrencyCostStorage.Clear();
foreach (ItemLevelSelectorQualityRecord itemLevelSelectorQuality in CliDB.ItemLevelSelectorQualityStorage.Values) foreach (ItemLevelSelectorQualityRecord itemLevelSelectorQuality in CliDB.ItemLevelSelectorQualityStorage.Values)
_itemLevelQualitySelectorQualities.Add(itemLevelSelectorQuality.ItemLevelSelectorQualitySetID, itemLevelSelectorQuality); _itemLevelQualitySelectorQualities.Add(itemLevelSelectorQuality.ParentILSQualitySetID, itemLevelSelectorQuality);
CliDB.ItemLevelSelectorQualityStorage.Clear(); CliDB.ItemLevelSelectorQualityStorage.Clear();
foreach (var appearanceMod in CliDB.ItemModifiedAppearanceStorage.Values) foreach (var appearanceMod in CliDB.ItemModifiedAppearanceStorage.Values)
{ {
//ASSERT(appearanceMod.ItemID <= 0xFFFFFF); //ASSERT(appearanceMod.ItemID <= 0xFFFFFF);
_itemModifiedAppearancesByItem[(uint)((int)appearanceMod.ItemID | (appearanceMod.AppearanceModID << 24))] = appearanceMod; _itemModifiedAppearancesByItem[(uint)((int)appearanceMod.ItemID | (appearanceMod.ItemAppearanceModifierID << 24))] = appearanceMod;
} }
foreach (ItemSetSpellRecord itemSetSpell in CliDB.ItemSetSpellStorage.Values) foreach (ItemSetSpellRecord itemSetSpell in CliDB.ItemSetSpellStorage.Values)
@@ -249,7 +249,7 @@ namespace Game.DataStorage
CliDB.ItemSpecOverrideStorage.Clear(); CliDB.ItemSpecOverrideStorage.Clear();
foreach (var itemBonusTreeAssignment in CliDB.ItemXBonusTreeStorage.Values) foreach (var itemBonusTreeAssignment in CliDB.ItemXBonusTreeStorage.Values)
_itemToBonusTree.Add(itemBonusTreeAssignment.ItemID, itemBonusTreeAssignment.BonusTreeID); _itemToBonusTree.Add(itemBonusTreeAssignment.ItemID, itemBonusTreeAssignment.ItemBonusTreeID);
CliDB.ItemXBonusTreeStorage.Clear(); CliDB.ItemXBonusTreeStorage.Clear();
@@ -265,7 +265,7 @@ namespace Game.DataStorage
CliDB.MapDifficultyStorage.Clear(); CliDB.MapDifficultyStorage.Clear();
foreach (var mount in CliDB.MountStorage.Values) foreach (var mount in CliDB.MountStorage.Values)
_mountsBySpellId[mount.SpellId] = mount; _mountsBySpellId[mount.SourceSpellID] = mount;
foreach (MountTypeXCapabilityRecord mountTypeCapability in CliDB.MountTypeXCapabilityStorage.Values) foreach (MountTypeXCapabilityRecord mountTypeCapability in CliDB.MountTypeXCapabilityStorage.Values)
_mountCapabilitiesByType.Add(mountTypeCapability.MountTypeID, mountTypeCapability); _mountCapabilitiesByType.Add(mountTypeCapability.MountTypeID, mountTypeCapability);
@@ -282,14 +282,14 @@ namespace Game.DataStorage
foreach (var entry in CliDB.NameGenStorage.Values) foreach (var entry in CliDB.NameGenStorage.Values)
{ {
if (!_nameGenData.ContainsKey(entry.Race)) if (!_nameGenData.ContainsKey(entry.RaceID))
{ {
_nameGenData[entry.Race] = new List<NameGenRecord>[2]; _nameGenData[entry.RaceID] = new List<NameGenRecord>[2];
for (var i = 0; i < 2; ++i) for (var i = 0; i < 2; ++i)
_nameGenData[entry.Race][i] = new List<NameGenRecord>(); _nameGenData[entry.RaceID][i] = new List<NameGenRecord>();
} }
_nameGenData[entry.Race][entry.Sex].Add(entry); _nameGenData[entry.RaceID][entry.Sex].Add(entry);
} }
CliDB.NameGenStorage.Clear(); CliDB.NameGenStorage.Clear();
@@ -346,10 +346,10 @@ namespace Game.DataStorage
} }
foreach (PvpItemRecord pvpItem in CliDB.PvpItemStorage.Values) foreach (PvpItemRecord pvpItem in CliDB.PvpItemStorage.Values)
_pvpItemBonus[pvpItem.ItemID] = pvpItem.ItemLevelBonus; _pvpItemBonus[pvpItem.ItemID] = pvpItem.ItemLevelDelta;
foreach (PvpRewardRecord pvpReward in CliDB.PvpRewardStorage.Values) foreach (PvpRewardRecord pvpReward in CliDB.PvpRewardStorage.Values)
_pvpRewardPack[Tuple.Create((uint)pvpReward.Prestige, (uint)pvpReward.HonorLevel)] = pvpReward.RewardPackID; _pvpRewardPack[Tuple.Create((uint)pvpReward.PrestigeLevel, (uint)pvpReward.HonorLevel)] = pvpReward.RewardPackID;
CliDB.PvpRewardStorage.Clear(); CliDB.PvpRewardStorage.Clear();
@@ -390,13 +390,13 @@ namespace Game.DataStorage
foreach (QuestPackageItemRecord questPackageItem in CliDB.QuestPackageItemStorage.Values) foreach (QuestPackageItemRecord questPackageItem in CliDB.QuestPackageItemStorage.Values)
{ {
if (!_questPackages.ContainsKey(questPackageItem.QuestPackageID)) if (!_questPackages.ContainsKey(questPackageItem.PackageID))
_questPackages[questPackageItem.QuestPackageID] = Tuple.Create(new List<QuestPackageItemRecord>(), new List<QuestPackageItemRecord>()); _questPackages[questPackageItem.PackageID] = Tuple.Create(new List<QuestPackageItemRecord>(), new List<QuestPackageItemRecord>());
if (questPackageItem.FilterType != QuestPackageFilter.Unmatched) if (questPackageItem.DisplayType != QuestPackageFilter.Unmatched)
_questPackages[questPackageItem.QuestPackageID].Item1.Add(questPackageItem); _questPackages[questPackageItem.PackageID].Item1.Add(questPackageItem);
else else
_questPackages[questPackageItem.QuestPackageID].Item2.Add(questPackageItem); _questPackages[questPackageItem.PackageID].Item2.Add(questPackageItem);
} }
CliDB.QuestPackageItemStorage.Clear(); CliDB.QuestPackageItemStorage.Clear();
@@ -436,14 +436,14 @@ namespace Game.DataStorage
if (!_spellPowerDifficulties[power.SpellID].ContainsKey(powerDifficulty.DifficultyID)) if (!_spellPowerDifficulties[power.SpellID].ContainsKey(powerDifficulty.DifficultyID))
_spellPowerDifficulties[power.SpellID][powerDifficulty.DifficultyID] = new List<SpellPowerRecord>(); _spellPowerDifficulties[power.SpellID][powerDifficulty.DifficultyID] = new List<SpellPowerRecord>();
_spellPowerDifficulties[power.SpellID][powerDifficulty.DifficultyID].Insert(powerDifficulty.PowerIndex, power); _spellPowerDifficulties[power.SpellID][powerDifficulty.DifficultyID].Insert(powerDifficulty.OrderIndex, power);
} }
else else
{ {
if (!_spellPowers.ContainsKey(power.SpellID)) if (!_spellPowers.ContainsKey(power.SpellID))
_spellPowers[power.SpellID] = new List<SpellPowerRecord>(); _spellPowers[power.SpellID] = new List<SpellPowerRecord>();
_spellPowers[power.SpellID].Insert(power.PowerIndex, power); _spellPowers[power.SpellID].Insert(power.OrderIndex, power);
} }
} }
@@ -492,7 +492,7 @@ namespace Game.DataStorage
CliDB.TransmogSetItemStorage.Clear(); CliDB.TransmogSetItemStorage.Clear();
foreach (WMOAreaTableRecord entry in CliDB.WMOAreaTableStorage.Values) foreach (WMOAreaTableRecord entry in CliDB.WMOAreaTableStorage.Values)
_wmoAreaTableLookup[Tuple.Create((short)entry.WMOID, entry.NameSet, entry.WMOGroupID)] = entry; _wmoAreaTableLookup[Tuple.Create((short)entry.WmoID, entry.NameSetID, entry.WmoGroupID)] = entry;
CliDB.WMOAreaTableStorage.Clear(); CliDB.WMOAreaTableStorage.Clear();
@@ -593,19 +593,18 @@ namespace Game.DataStorage
public string GetBroadcastTextValue(BroadcastTextRecord broadcastText, LocaleConstant locale = LocaleConstant.enUS, Gender gender = Gender.Male, bool forceGender = false) public string GetBroadcastTextValue(BroadcastTextRecord broadcastText, LocaleConstant locale = LocaleConstant.enUS, Gender gender = Gender.Male, bool forceGender = false)
{ {
if ((gender == Gender.Female || gender == Gender.None) && (forceGender || broadcastText.FemaleText.HasString(SharedConst.DefaultLocale))) if ((gender == Gender.Female || gender == Gender.None) && (forceGender || broadcastText.Text1.HasString(SharedConst.DefaultLocale)))
{ {
if (broadcastText.FemaleText.HasString(locale)) if (broadcastText.Text1.HasString(locale))
return broadcastText.FemaleText[locale]; return broadcastText.Text1[locale];
return broadcastText.FemaleText[SharedConst.DefaultLocale]; return broadcastText.Text1[SharedConst.DefaultLocale];
} }
if (broadcastText.Text.HasString(locale))
return broadcastText.Text[locale];
if (broadcastText.MaleText.HasString(locale)) return broadcastText.Text[SharedConst.DefaultLocale];
return broadcastText.MaleText[locale];
return broadcastText.MaleText[SharedConst.DefaultLocale];
} }
public bool HasCharacterFacialHairStyle(Race race, Gender gender, uint variationId) public bool HasCharacterFacialHairStyle(Race race, Gender gender, uint variationId)
@@ -728,82 +727,82 @@ namespace Game.DataStorage
case CurveInterpolationMode.Linear: case CurveInterpolationMode.Linear:
{ {
int pointIndex = 0; int pointIndex = 0;
while (pointIndex < points.Count && points[pointIndex].X <= x) while (pointIndex < points.Count && points[pointIndex].Pos.X <= x)
++pointIndex; ++pointIndex;
if (pointIndex == 0) if (pointIndex == 0)
return points[0].Y; return points[0].Pos.Y;
if (pointIndex >= points.Count) if (pointIndex >= points.Count)
return points.Last().Y; return points.Last().Pos.Y;
float xDiff = points[pointIndex].X - points[pointIndex - 1].X; float xDiff = points[pointIndex].Pos.X - points[pointIndex - 1].Pos.X;
if (xDiff == 0.0) if (xDiff == 0.0)
return points[pointIndex].Y; return points[pointIndex].Pos.Y;
return (((x - points[pointIndex - 1].X) / xDiff) * (points[pointIndex].Y - points[pointIndex - 1].Y)) + points[pointIndex - 1].Y; return (((x - points[pointIndex - 1].Pos.X) / xDiff) * (points[pointIndex].Pos.Y - points[pointIndex - 1].Pos.Y)) + points[pointIndex - 1].Pos.Y;
} }
case CurveInterpolationMode.Cosine: case CurveInterpolationMode.Cosine:
{ {
int pointIndex = 0; int pointIndex = 0;
while (pointIndex < points.Count && points[pointIndex].X <= x) while (pointIndex < points.Count && points[pointIndex].Pos.X <= x)
++pointIndex; ++pointIndex;
if (pointIndex == 0) if (pointIndex == 0)
return points[0].Y; return points[0].Pos.Y;
if (pointIndex >= points.Count) if (pointIndex >= points.Count)
return points.Last().Y; return points.Last().Pos.Y;
float xDiff = points[pointIndex].X - points[pointIndex - 1].X; float xDiff = points[pointIndex].Pos.X - points[pointIndex - 1].Pos.X;
if (xDiff == 0.0) if (xDiff == 0.0)
return points[pointIndex].Y; return points[pointIndex].Pos.Y;
return (float)((points[pointIndex].Y - points[pointIndex - 1].Y) * (1.0f - Math.Cos((x - points[pointIndex - 1].X) / xDiff * Math.PI)) * 0.5f) + points[pointIndex - 1].Y; return (float)((points[pointIndex].Pos.Y - points[pointIndex - 1].Pos.Y) * (1.0f - Math.Cos((x - points[pointIndex - 1].Pos.X) / xDiff * Math.PI)) * 0.5f) + points[pointIndex - 1].Pos.Y;
} }
case CurveInterpolationMode.CatmullRom: case CurveInterpolationMode.CatmullRom:
{ {
int pointIndex = 1; int pointIndex = 1;
while (pointIndex < points.Count && points[pointIndex].X <= x) while (pointIndex < points.Count && points[pointIndex].Pos.X <= x)
++pointIndex; ++pointIndex;
if (pointIndex == 1) if (pointIndex == 1)
return points[1].Y; return points[1].Pos.Y;
if (pointIndex >= points.Count - 1) if (pointIndex >= points.Count - 1)
return points[points.Count - 2].Y; return points[points.Count - 2].Pos.Y;
float xDiff = points[pointIndex].X - points[pointIndex - 1].X; float xDiff = points[pointIndex].Pos.X - points[pointIndex - 1].Pos.X;
if (xDiff == 0.0) if (xDiff == 0.0)
return points[pointIndex].Y; return points[pointIndex].Pos.Y;
float mu = (x - points[pointIndex - 1].X) / xDiff; float mu = (x - points[pointIndex - 1].Pos.X) / xDiff;
float a0 = -0.5f * points[pointIndex - 2].Y + 1.5f * points[pointIndex - 1].Y - 1.5f * points[pointIndex].Y + 0.5f * points[pointIndex + 1].Y; float a0 = -0.5f * points[pointIndex - 2].Pos.Y + 1.5f * points[pointIndex - 1].Pos.Y - 1.5f * points[pointIndex].Pos.Y + 0.5f * points[pointIndex + 1].Pos.Y;
float a1 = points[pointIndex - 2].Y - 2.5f * points[pointIndex - 1].Y + 2.0f * points[pointIndex].Y - 0.5f * points[pointIndex + 1].Y; float a1 = points[pointIndex - 2].Pos.Y - 2.5f * points[pointIndex - 1].Pos.Y + 2.0f * points[pointIndex].Pos.Y - 0.5f * points[pointIndex + 1].Pos.Y;
float a2 = -0.5f * points[pointIndex - 2].Y + 0.5f * points[pointIndex].Y; float a2 = -0.5f * points[pointIndex - 2].Pos.Y + 0.5f * points[pointIndex].Pos.Y;
float a3 = points[pointIndex - 1].Y; float a3 = points[pointIndex - 1].Pos.Y;
return a0 * mu * mu * mu + a1 * mu * mu + a2 * mu + a3; return a0 * mu * mu * mu + a1 * mu * mu + a2 * mu + a3;
} }
case CurveInterpolationMode.Bezier3: case CurveInterpolationMode.Bezier3:
{ {
float xDiff = points[2].X - points[0].X; float xDiff = points[2].Pos.X - points[0].Pos.X;
if (xDiff == 0.0) if (xDiff == 0.0)
return points[1].Y; return points[1].Pos.Y;
float mu = (x - points[0].X) / xDiff; float mu = (x - points[0].Pos.X) / xDiff;
return ((1.0f - mu) * (1.0f - mu) * points[0].Y) + (1.0f - mu) * 2.0f * mu * points[1].Y + mu * mu * points[2].Y; return ((1.0f - mu) * (1.0f - mu) * points[0].Pos.Y) + (1.0f - mu) * 2.0f * mu * points[1].Pos.Y + mu * mu * points[2].Pos.Y;
} }
case CurveInterpolationMode.Bezier4: case CurveInterpolationMode.Bezier4:
{ {
float xDiff = points[3].X - points[0].X; float xDiff = points[3].Pos.X - points[0].Pos.X;
if (xDiff == 0.0) if (xDiff == 0.0)
return points[1].Y; return points[1].Pos.Y;
float mu = (x - points[0].X) / xDiff; float mu = (x - points[0].Pos.X) / xDiff;
return (1.0f - mu) * (1.0f - mu) * (1.0f - mu) * points[0].Y return (1.0f - mu) * (1.0f - mu) * (1.0f - mu) * points[0].Pos.Y
+ 3.0f * mu * (1.0f - mu) * (1.0f - mu) * points[1].Y + 3.0f * mu * (1.0f - mu) * (1.0f - mu) * points[1].Pos.Y
+ 3.0f * mu * mu * (1.0f - mu) * points[2].Y + 3.0f * mu * mu * (1.0f - mu) * points[2].Pos.Y
+ mu * mu * mu * points[3].Y; + mu * mu * mu * points[3].Pos.Y;
} }
case CurveInterpolationMode.Bezier: case CurveInterpolationMode.Bezier:
{ {
float xDiff = points.Last().X - points[0].X; float xDiff = points.Last().Pos.X - points[0].Pos.X;
if (xDiff == 0.0f) if (xDiff == 0.0f)
return points.Last().Y; return points.Last().Pos.Y;
float[] tmp = new float[points.Count]; float[] tmp = new float[points.Count];
for (int c = 0; c < points.Count; ++c) for (int c = 0; c < points.Count; ++c)
tmp[c] = points[c].Y; tmp[c] = points[c].Pos.Y;
float mu = (x - points[0].X) / xDiff; float mu = (x - points[0].Pos.X) / xDiff;
int i = points.Count - 1; int i = points.Count - 1;
while (i > 0) while (i > 0)
{ {
@@ -817,7 +816,7 @@ namespace Game.DataStorage
return tmp[0]; return tmp[0];
} }
case CurveInterpolationMode.Constant: case CurveInterpolationMode.Constant:
return points[0].Y; return points[0].Pos.Y;
default: default:
break; break;
} }
@@ -868,7 +867,7 @@ namespace Game.DataStorage
return _itemLevelDeltaToBonusListContainer.LookupByKey(delta); return _itemLevelDeltaToBonusListContainer.LookupByKey(delta);
} }
public List<uint> GetItemBonusTree(uint itemId, uint itemBonusTreeMod) public List<uint> GetItemBonusTree(uint itemId, uint itemContext)
{ {
List<uint> bonusListIDs = new List<uint>(); List<uint> bonusListIDs = new List<uint>();
@@ -888,20 +887,20 @@ namespace Game.DataStorage
foreach (ItemBonusTreeNodeRecord bonusTreeNode in treeList) foreach (ItemBonusTreeNodeRecord bonusTreeNode in treeList)
{ {
if (bonusTreeNode.BonusTreeModID != itemBonusTreeMod) if (bonusTreeNode.ItemContext != itemContext)
continue; continue;
if (bonusTreeNode.BonusListID != 0) if (bonusTreeNode.ChildItemBonusListID != 0)
{ {
bonusListIDs.Add(bonusTreeNode.BonusListID); bonusListIDs.Add(bonusTreeNode.ChildItemBonusListID);
} }
else if (bonusTreeNode.ItemLevelSelectorID != 0) else if (bonusTreeNode.ChildItemLevelSelectorID != 0)
{ {
ItemLevelSelectorRecord selector = CliDB.ItemLevelSelectorStorage.LookupByKey(bonusTreeNode.ItemLevelSelectorID); ItemLevelSelectorRecord selector = CliDB.ItemLevelSelectorStorage.LookupByKey(bonusTreeNode.ChildItemLevelSelectorID);
if (selector == null) if (selector == null)
continue; continue;
short delta = (short)(selector.ItemLevel - proto.ItemLevel); short delta = (short)(selector.MinItemLevel - proto.ItemLevel);
uint bonus = GetItemBonusListForItemLevelDelta(delta); uint bonus = GetItemBonusListForItemLevelDelta(delta);
if (bonus != 0) if (bonus != 0)
@@ -914,15 +913,15 @@ namespace Game.DataStorage
if (itemSelectorQualities != null) if (itemSelectorQualities != null)
{ {
ItemQuality quality = ItemQuality.Uncommon; ItemQuality quality = ItemQuality.Uncommon;
if (selector.ItemLevel >= selectorQualitySet.ItemLevelMax) if (selector.MinItemLevel >= selectorQualitySet.IlvlEpic)
quality = ItemQuality.Epic; quality = ItemQuality.Epic;
else if (selector.ItemLevel >= selectorQualitySet.ItemLevelMin) else if (selector.MinItemLevel >= selectorQualitySet.IlvlRare)
quality = ItemQuality.Rare; quality = ItemQuality.Rare;
var itemSelectorQuality = itemSelectorQualities.FirstOrDefault(p => p.Quality < (byte)quality); var itemSelectorQuality = itemSelectorQualities.FirstOrDefault(p => p.Quality < (byte)quality);
if (itemSelectorQuality != null) if (itemSelectorQuality != null)
bonusListIDs.Add(itemSelectorQuality.ItemBonusListID); bonusListIDs.Add(itemSelectorQuality.QualityItemBonusListID);
} }
} }
} }
@@ -947,9 +946,9 @@ namespace Game.DataStorage
ItemModifiedAppearanceRecord modifiedAppearance = GetItemModifiedAppearance(itemId, appearanceModId); ItemModifiedAppearanceRecord modifiedAppearance = GetItemModifiedAppearance(itemId, appearanceModId);
if (modifiedAppearance != null) if (modifiedAppearance != null)
{ {
ItemAppearanceRecord itemAppearance = CliDB.ItemAppearanceStorage.LookupByKey(modifiedAppearance.AppearanceID); ItemAppearanceRecord itemAppearance = CliDB.ItemAppearanceStorage.LookupByKey(modifiedAppearance.ItemAppearanceID);
if (itemAppearance != null) if (itemAppearance != null)
return itemAppearance.DisplayID; return itemAppearance.ItemDisplayInfoID;
} }
return 0; return 0;
@@ -1000,7 +999,7 @@ namespace Game.DataStorage
{ {
foreach (var light in CliDB.LightStorage.Values.Reverse()) foreach (var light in CliDB.LightStorage.Values.Reverse())
{ {
if (light.MapID == mapId && light.Pos.X == 0.0f && light.Pos.Y == 0.0f && light.Pos.Z == 0.0f) if (light.ContinentID == mapId && light.GameCoords.X == 0.0f && light.GameCoords.Y == 0.0f && light.GameCoords.Z == 0.0f)
return light.Id; return light.Id;
} }
@@ -1011,7 +1010,7 @@ namespace Game.DataStorage
{ {
LiquidTypeRecord liq = CliDB.LiquidTypeStorage.LookupByKey(liquidType); LiquidTypeRecord liq = CliDB.LiquidTypeStorage.LookupByKey(liquidType);
if (liq != null) if (liq != null)
return 1u << liq.LiquidType; return 1u << liq.SoundBank;
return 0; return 0;
} }
@@ -1104,7 +1103,7 @@ namespace Game.DataStorage
return _mountDisplays.LookupByKey(mountId); return _mountDisplays.LookupByKey(mountId);
} }
public string GetNameGenEntry(uint race, uint gender, LocaleConstant locale, LocaleConstant defaultLocale) public string GetNameGenEntry(uint race, uint gender)
{ {
Contract.Assert(gender < (int)Gender.None); Contract.Assert(gender < (int)Gender.None);
var listNameGen = _nameGenData.LookupByKey(race); var listNameGen = _nameGenData.LookupByKey(race);
@@ -1114,11 +1113,7 @@ namespace Game.DataStorage
if (listNameGen[gender].Empty()) if (listNameGen[gender].Empty())
return ""; return "";
LocalizedString data = listNameGen[gender].SelectRandom().Name; return listNameGen[gender].SelectRandom().Name;
if (data.HasString(locale))
return data[locale];
return data[defaultLocale];
} }
public ResponseCodes ValidateName(string name, LocaleConstant locale) public ResponseCodes ValidateName(string name, LocaleConstant locale)
@@ -1234,7 +1229,7 @@ namespace Game.DataStorage
{ {
foreach (PowerTypeRecord powerType in CliDB.PowerTypeStorage.Values) foreach (PowerTypeRecord powerType in CliDB.PowerTypeStorage.Values)
{ {
string powerName = powerType.PowerTypeToken; string powerName = powerType.NameGlobalStringTag;
if (powerName.ToLower() == name) if (powerName.ToLower() == name)
return powerType; return powerType;
@@ -1313,8 +1308,8 @@ namespace Game.DataStorage
Array.Resize(ref powers, powerDifficultyList.Count); Array.Resize(ref powers, powerDifficultyList.Count);
foreach (SpellPowerRecord difficultyPower in powerDifficultyList) foreach (SpellPowerRecord difficultyPower in powerDifficultyList)
if (powers[difficultyPower.PowerIndex] == null) if (powers[difficultyPower.OrderIndex] == null)
powers[difficultyPower.PowerIndex] = difficultyPower; powers[difficultyPower.OrderIndex] = difficultyPower;
} }
difficultyEntry = CliDB.DifficultyStorage.LookupByKey(difficultyEntry.FallbackDifficultyID); difficultyEntry = CliDB.DifficultyStorage.LookupByKey(difficultyEntry.FallbackDifficultyID);
@@ -1328,8 +1323,8 @@ namespace Game.DataStorage
Array.Resize(ref powers, record.Count); Array.Resize(ref powers, record.Count);
foreach (SpellPowerRecord power in record) foreach (SpellPowerRecord power in record)
if (powers[power.PowerIndex] == null) if (powers[power.OrderIndex] == null)
powers[power.PowerIndex] = power; powers[power.OrderIndex] = power;
} }
return powers.ToList(); return powers.ToList();
@@ -1359,10 +1354,10 @@ namespace Game.DataStorage
if (reqEntry == null) if (reqEntry == null)
return false; return false;
if (itemEntry.CategoryType != reqEntry.CategoryType) if (itemEntry.TotemCategoryType != reqEntry.TotemCategoryType)
return false; return false;
return (itemEntry.CategoryMask & reqEntry.CategoryMask) == reqEntry.CategoryMask; return (itemEntry.TotemCategoryMask & reqEntry.TotemCategoryMask) == reqEntry.TotemCategoryMask;
} }
public bool IsToyItem(uint toy) public bool IsToyItem(uint toy)
+1 -1
View File
@@ -174,7 +174,7 @@ namespace Game.DataStorage
uint oldMSTime = Time.GetMSTime(); uint oldMSTime = Time.GetMSTime();
foreach (CinematicCameraRecord cameraEntry in CliDB.CinematicCameraStorage.Values) foreach (CinematicCameraRecord cameraEntry in CliDB.CinematicCameraStorage.Values)
{ {
string filename = dataPath + "/cameras/" + string.Format("FILE{0:x8}.xxx", cameraEntry.ModelFileDataID); string filename = dataPath + "/cameras/" + string.Format("FILE{0:x8}.xxx", cameraEntry.FileDataID);
try try
{ {
+42 -38
View File
@@ -27,7 +27,7 @@ namespace Game.DataStorage
public LocalizedString Description; public LocalizedString Description;
public LocalizedString Reward; public LocalizedString Reward;
public AchievementFlags Flags; public AchievementFlags Flags;
public short MapID; public short InstanceID;
public ushort Supercedes; public ushort Supercedes;
public ushort Category; public ushort Category;
public ushort UiOrder; public ushort UiOrder;
@@ -36,7 +36,7 @@ namespace Game.DataStorage
public byte Points; public byte Points;
public byte MinimumCriteria; public byte MinimumCriteria;
public uint Id; public uint Id;
public uint IconFileDataID; public uint IconFileID;
public ushort CriteriaTree; public ushort CriteriaTree;
} }
@@ -62,16 +62,16 @@ namespace Game.DataStorage
public LocalizedString AreaName; public LocalizedString AreaName;
public AreaFlags[] Flags = new AreaFlags[2]; public AreaFlags[] Flags = new AreaFlags[2];
public float AmbientMultiplier; public float AmbientMultiplier;
public ushort MapId; public ushort ContinentID;
public ushort ParentAreaID; public ushort ParentAreaID;
public short AreaBit; public short AreaBit;
public ushort AmbienceID; public ushort AmbienceID;
public ushort ZoneMusic; public ushort ZoneMusic;
public ushort IntroSound; public ushort IntroSound;
public ushort[] LiquidTypeID = new ushort[4]; public ushort[] LiquidTypeID = new ushort[4];
public ushort UWZoneMusic; public ushort UwZoneMusic;
public ushort UWAmbience; public ushort UwAmbience;
public ushort PvPCombastWorldStateID; public ushort PvpCombastWorldStateID;
public byte SoundProviderPref; public byte SoundProviderPref;
public byte SoundProviderPrefUnderwater; public byte SoundProviderPrefUnderwater;
public byte ExplorationLevel; public byte ExplorationLevel;
@@ -80,11 +80,11 @@ namespace Game.DataStorage
public byte WildBattlePetLevelMin; public byte WildBattlePetLevelMin;
public byte WildBattlePetLevelMax; public byte WildBattlePetLevelMax;
public byte WindSettingsID; public byte WindSettingsID;
public byte UWIntroSound; public byte UwIntroSound;
public bool IsSanctuary() public bool IsSanctuary()
{ {
if (MapId == 609) if (ContinentID == 609)
return true; return true;
return Flags[0].HasAnyFlag(AreaFlags.Sanctuary); return Flags[0].HasAnyFlag(AreaFlags.Sanctuary);
@@ -99,7 +99,7 @@ namespace Game.DataStorage
public float BoxWidth; public float BoxWidth;
public float BoxHeight; public float BoxHeight;
public float BoxYaw; public float BoxYaw;
public ushort MapID; public ushort ContinentID;
public ushort PhaseID; public ushort PhaseID;
public ushort PhaseGroupID; public ushort PhaseGroupID;
public ushort ShapeID; public ushort ShapeID;
@@ -113,18 +113,22 @@ namespace Game.DataStorage
public sealed class ArmorLocationRecord public sealed class ArmorLocationRecord
{ {
public uint Id; public uint Id;
public float[] Modifier = new float[5]; public float Clothmodifier;
public float Leathermodifier;
public float Chainmodifier;
public float Platemodifier;
public float Modifier;
} }
public sealed class ArtifactRecord public sealed class ArtifactRecord
{ {
public uint Id; public uint Id;
public LocalizedString Name; public LocalizedString Name;
public uint BarConnectedColor; public uint UiBarOverlayColor;
public uint BarDisconnectedColor; public uint UiBarBackgroundColor;
public uint TitleColor; public uint UiNameColor;
public ushort ClassUiTextureKitID; public ushort UiTextureKitID;
public ushort SpecID; public ushort ChrSpecializationID;
public byte ArtifactCategoryID; public byte ArtifactCategoryID;
public byte Flags; public byte Flags;
public byte UiModelSceneID; public byte UiModelSceneID;
@@ -134,30 +138,30 @@ namespace Game.DataStorage
public sealed class ArtifactAppearanceRecord public sealed class ArtifactAppearanceRecord
{ {
public LocalizedString Name; public LocalizedString Name;
public uint SwatchColor; public uint UiSwatchColor;
public float ModelDesaturation; public float UiModelSaturation;
public float ModelAlpha; public float UiModelOpacity;
public uint ShapeshiftDisplayID; public uint OverrideShapeshiftDisplayID;
public ushort ArtifactAppearanceSetID; public ushort ArtifactAppearanceSetID;
public ushort Unknown; public ushort UiCameraID;
public byte DisplayIndex; public byte DisplayIndex;
public byte AppearanceModID; public byte ItemAppearanceModifierID;
public byte Flags; public byte Flags;
public byte ModifiesShapeshiftFormDisplay; public byte OverrideShapeshiftFormID;
public uint Id; public uint Id;
public ushort PlayerConditionID; public ushort UnlockPlayerConditionID;
public byte ItemAppearanceID; public byte UiItemAppearanceID;
public byte AltItemAppearanceID; public byte UiAltItemAppearanceID;
} }
public sealed class ArtifactAppearanceSetRecord public sealed class ArtifactAppearanceSetRecord
{ {
public LocalizedString Name; public LocalizedString Name;
public LocalizedString Name2; public LocalizedString Description;
public ushort UiCameraID; public ushort UiCameraID;
public ushort AltHandUICameraID; public ushort AltHandUICameraID;
public byte DisplayIndex; public byte DisplayIndex;
public byte AttachmentPoint; public byte ForgeAttachmentOverride;
public byte Flags; public byte Flags;
public uint Id; public uint Id;
public uint ArtifactID; public uint ArtifactID;
@@ -166,8 +170,8 @@ namespace Game.DataStorage
public sealed class ArtifactCategoryRecord public sealed class ArtifactCategoryRecord
{ {
public uint Id; public uint Id;
public ushort ArtifactKnowledgeCurrencyID; public ushort XpMultCurrencyID;
public ushort ArtifactKnowledgeMultiplierCurveID; public ushort XpMultCurveID;
} }
public sealed class ArtifactPowerRecord public sealed class ArtifactPowerRecord
@@ -175,17 +179,17 @@ namespace Game.DataStorage
public Vector2 Pos; public Vector2 Pos;
public byte ArtifactID; public byte ArtifactID;
public ArtifactPowerFlag Flags; public ArtifactPowerFlag Flags;
public byte MaxRank; public byte MaxPurchasableRank;
public byte ArtifactTier; public byte Tier;
public uint Id; public uint Id;
public byte RelicType; public byte Label;
} }
public sealed class ArtifactPowerLinkRecord public sealed class ArtifactPowerLinkRecord
{ {
public uint Id; public uint Id;
public ushort FromArtifactPowerID; public ushort PowerA;
public ushort ToArtifactPowerID; public ushort PowerB;
} }
public sealed class ArtifactPowerPickerRecord public sealed class ArtifactPowerPickerRecord
@@ -198,16 +202,16 @@ namespace Game.DataStorage
{ {
public uint Id; public uint Id;
public uint SpellID; public uint SpellID;
public float Value; public float AuraPointsOverride;
public ushort Unknown; public ushort ItemBonusListID;
public byte Rank; public byte RankIndex;
public uint ArtifactPowerID; public uint ArtifactPowerID;
} }
public sealed class ArtifactQuestXPRecord public sealed class ArtifactQuestXPRecord
{ {
public uint Id; public uint Id;
public uint[] Exp = new uint[10]; public uint[] Difficulty = new uint[10];
} }
public sealed class AuctionHouseRecord public sealed class AuctionHouseRecord
+21 -21
View File
@@ -46,16 +46,16 @@ namespace Game.DataStorage
public sealed class BattlePetBreedQualityRecord public sealed class BattlePetBreedQualityRecord
{ {
public uint Id; public uint Id;
public float Modifier; public float StateMultiplier;
public byte Quality; public byte QualityEnum;
} }
public sealed class BattlePetBreedStateRecord public sealed class BattlePetBreedStateRecord
{ {
public uint Id; public uint Id;
public short Value; public ushort Value;
public byte State; public byte BattlePetStateID;
public uint BreedID; public uint BattlePetBreedID;
} }
public sealed class BattlePetSpeciesRecord public sealed class BattlePetSpeciesRecord
@@ -63,22 +63,22 @@ namespace Game.DataStorage
public LocalizedString SourceText; public LocalizedString SourceText;
public LocalizedString Description; public LocalizedString Description;
public uint CreatureID; public uint CreatureID;
public uint IconFileID; public uint IconFileDataID;
public uint SummonSpellID; public uint SummonSpellID;
public ushort Flags; public ushort Flags;
public byte PetType; public byte PetTypeEnum;
public sbyte Source; public sbyte SourceTypeEnum;
public uint Id; public uint Id;
public byte CardModelSceneID; public byte CardUIModelSceneID;
public byte LoadoutModelSceneID; public byte LoadoutUIModelSceneID;
} }
public sealed class BattlePetSpeciesStateRecord public sealed class BattlePetSpeciesStateRecord
{ {
public uint Id; public uint Id;
public int Value; public int Value;
public byte State; public byte BattlePetStateID;
public uint SpeciesID; public uint BattlePetSpeciesID;
} }
public sealed class BattlemasterListRecord public sealed class BattlemasterListRecord
@@ -88,10 +88,10 @@ namespace Game.DataStorage
public LocalizedString GameType; public LocalizedString GameType;
public LocalizedString ShortDescription; public LocalizedString ShortDescription;
public LocalizedString LongDescription; public LocalizedString LongDescription;
public uint IconFileDataID; public int IconFileDataID;
public short[] MapId = new short[16]; public short[] MapId = new short[16];
public ushort HolidayWorldState; public ushort HolidayWorldState;
public ushort PlayerConditionId; public ushort RequiredPlayerConditionID;
public byte InstanceType; public byte InstanceType;
public byte GroupsAllowed; public byte GroupsAllowed;
public byte MaxGroupSize; public byte MaxGroupSize;
@@ -106,14 +106,14 @@ namespace Game.DataStorage
public sealed class BroadcastTextRecord public sealed class BroadcastTextRecord
{ {
public uint Id; public uint Id;
public LocalizedString MaleText; public LocalizedString Text;
public LocalizedString FemaleText; public LocalizedString Text1;
public ushort[] EmoteID = new ushort[3]; public ushort[] EmoteID = new ushort[3];
public ushort[] EmoteDelay = new ushort[3]; public ushort[] EmoteDelay = new ushort[3];
public ushort UnkEmoteID; public ushort EmotesID;
public byte Language; public byte LanguageID;
public byte Type; public byte Flags;
public uint PlayerConditionID; public uint ConditionID;
public uint[] SoundID = new uint[2]; public uint[] SoundEntriesID = new uint[2];
} }
} }
+72 -74
View File
@@ -23,7 +23,7 @@ namespace Game.DataStorage
public sealed class CharacterFacialHairStylesRecord public sealed class CharacterFacialHairStylesRecord
{ {
public uint ID; public uint ID;
public uint[] Geoset = new uint[5]; public int[] Geoset = new int[5];
public byte RaceID; public byte RaceID;
public byte SexID; public byte SexID;
public byte VariationID; public byte VariationID;
@@ -32,16 +32,16 @@ namespace Game.DataStorage
public sealed class CharBaseSectionRecord public sealed class CharBaseSectionRecord
{ {
public uint ID; public uint ID;
public CharBaseSectionVariation Variation; public CharBaseSectionVariation VariationEnum;
public byte ResolutionVariation; public byte ResolutionVariationEnum;
public byte Resolution; public byte LayoutResType;
} }
public sealed class CharSectionsRecord public sealed class CharSectionsRecord
{ {
public uint Id; public uint Id;
public uint[] TextureFileDataID = new uint[3]; public uint[] MaterialResourcesID = new uint[3];
public ushort Flags; public short Flags;
public byte RaceID; public byte RaceID;
public byte SexID; public byte SexID;
public byte BaseSection; public byte BaseSection;
@@ -55,7 +55,7 @@ namespace Game.DataStorage
public int[] ItemID = new int[24]; public int[] ItemID = new int[24];
public uint PetDisplayID; public uint PetDisplayID;
public byte ClassID; public byte ClassID;
public byte GenderID; public byte SexID;
public byte OutfitID; public byte OutfitID;
public byte PetFamilyID; public byte PetFamilyID;
public uint RaceID; public uint RaceID;
@@ -64,10 +64,10 @@ namespace Game.DataStorage
public sealed class CharTitlesRecord public sealed class CharTitlesRecord
{ {
public uint Id; public uint Id;
public LocalizedString NameMale; public LocalizedString Name;
public LocalizedString NameFemale; public LocalizedString Name1;
public ushort MaskID; public ushort MaskID;
public byte Flags; public sbyte Flags;
} }
public sealed class ChatChannelsRecord public sealed class ChatChannelsRecord
@@ -76,7 +76,7 @@ namespace Game.DataStorage
public LocalizedString Name; public LocalizedString Name;
public LocalizedString Shortcut; public LocalizedString Shortcut;
public ChannelDBCFlags Flags; public ChannelDBCFlags Flags;
public byte FactionGroup; public sbyte FactionGroup;
} }
public sealed class ChrClassesRecord public sealed class ChrClassesRecord
@@ -88,18 +88,18 @@ namespace Game.DataStorage
public uint FileName; public uint FileName;
public uint CreateScreenFileDataID; public uint CreateScreenFileDataID;
public uint SelectScreenFileDataID; public uint SelectScreenFileDataID;
public uint IconFileDataID;
public uint LowResScreenFileDataID; public uint LowResScreenFileDataID;
public uint StartingLevel; public uint IconFileDataID;
public int StartingLevel;
public ushort Flags; public ushort Flags;
public ushort CinematicSequenceID; public ushort CinematicSequenceID;
public ushort DefaultSpec; public ushort DefaultSpec;
public PowerType PowerType; public PowerType DisplayPower;
public byte SpellClassSet; public byte SpellClassSet;
public byte AttackPowerPerStrength; public byte AttackPowerPerStrength;
public byte AttackPowerPerAgility; public byte AttackPowerPerAgility;
public byte RangedAttackPowerPerAgility; public byte RangedAttackPowerPerAgility;
public byte Unk1; public byte PrimaryStatPriority;
public uint Id; public uint Id;
} }
@@ -116,57 +116,57 @@ namespace Game.DataStorage
public uint ClientFileString; public uint ClientFileString;
public LocalizedString Name; public LocalizedString Name;
public string NameFemale; public string NameFemale;
public string LowercaseName; public string NameLowercase;
public string LowercaseNameFemale; public string NameFemaleLowercase;
public uint Flags; public int Flags;
public uint MaleDisplayID; public uint MaleDisplayId;
public uint FemaleDisplayID; public uint FemaleDisplayId;
public uint CreateScreenFileDataID; public int CreateScreenFileDataID;
public uint SelectScreenFileDataID; public int SelectScreenFileDataID;
public uint[] MaleCustomizeOffset = new uint[3]; public float[] MaleCustomizeOffset = new float[3];
public uint[] FemaleCustomizeOffset = new uint[3]; public float[] FemaleCustomizeOffset = new float[3];
public uint LowResScreenFileDataID; public int LowResScreenFileDataID;
public uint StartingLevel; public int StartingLevel;
public uint UIDisplayOrder; public int UiDisplayOrder;
public ushort FactionID; public ushort FactionID;
public ushort ResSicknessSpellID; public short ResSicknessSpellID;
public ushort SplashSoundID; public short SplashSoundID;
public ushort CinematicSequenceID; public ushort CinematicSequenceID;
public byte BaseLanguage; public sbyte BaseLanguage;
public byte CreatureType; public sbyte CreatureType;
public byte TeamID; public sbyte Alliance;
public byte RaceRelated; public sbyte RaceRelated;
public byte UnalteredVisualRaceID; public sbyte UnalteredVisualRaceID;
public byte CharComponentTextureLayoutID; public sbyte CharComponentTextureLayoutID;
public byte DefaultClassID; public sbyte DefaultClassID;
public byte NeutralRaceID; public sbyte NeutralRaceID;
public byte ItemAppearanceFrameRaceID; public sbyte DisplayRaceID;
public byte CharComponentTexLayoutHiResID; public sbyte CharComponentTexLayoutHiResID;
public uint Id; public uint Id;
public uint HighResMaleDisplayID; public uint HighResMaleDisplayId;
public uint HighResFemaleDisplayID; public uint HighResFemaleDisplayId;
public uint HeritageArmorAchievementID; public int HeritageArmorAchievementID;
public uint MaleCorpseBonesModelFileDataID; public int MaleSkeletonFileDataID;
public uint FemaleCorpseBonesModelFileDataID; public int FemaleSkeletonFileDataID;
public uint[] AlteredFormTransitionSpellVisualID = new uint[3]; public uint[] AlteredFormStartVisualKitID = new uint[3];
public uint[] AlteredFormTransitionSpellVisualKitID = new uint[3]; public uint[] AlteredFormFinishVisualKitID = new uint[3];
} }
public sealed class ChrSpecializationRecord public sealed class ChrSpecializationRecord
{ {
public string Name; public string Name;
public string Name2; public string FemaleName;
public string Description; public string Description;
public uint[] MasterySpellID = new uint[PlayerConst.MaxMasterySpells]; public uint[] MasterySpellID = new uint[PlayerConst.MaxMasterySpells];
public byte ClassID; public byte ClassID;
public byte OrderIndex; public byte OrderIndex;
public byte PetTalentType; public byte PetTalentType;
public byte Role; public byte Role;
public byte PrimaryStatOrder; public byte PrimaryStatPriority;
public uint Id; public uint Id;
public uint IconFileDataID; public int SpellIconFileID;
public ChrSpecializationFlag Flags; public ChrSpecializationFlag Flags;
public uint AnimReplacementSetID; public int AnimReplacements;
public bool IsPetSpecialization() public bool IsPetSpecialization()
{ {
@@ -180,7 +180,7 @@ namespace Game.DataStorage
public uint SoundID; public uint SoundID;
public Vector3 Origin; public Vector3 Origin;
public float OriginFacing; public float OriginFacing;
public uint ModelFileDataID; public uint FileDataID;
} }
public sealed class CinematicSequencesRecord public sealed class CinematicSequencesRecord
@@ -195,12 +195,12 @@ namespace Game.DataStorage
public uint Id; public uint Id;
public uint BroadcastTextID; public uint BroadcastTextID;
public uint SpellVisualKitID; public uint SpellVisualKitID;
public uint Duration; public int AdditionalDuration;
public ushort NextLineID; public ushort NextConversationLineID;
public ushort Unk1; public ushort AnimKitID;
public byte Yell; public byte SpeechType;
public byte Unk2; public byte StartAnimation;
public byte Unk3; public byte EndAnimation;
} }
public sealed class CreatureDisplayInfoRecord public sealed class CreatureDisplayInfoRecord
@@ -216,25 +216,25 @@ namespace Game.DataStorage
public uint PortraitTextureFileDataID; public uint PortraitTextureFileDataID;
public byte CreatureModelAlpha; public byte CreatureModelAlpha;
public ushort SoundID; public ushort SoundID;
public float PlayerModelScale; public float PlayerOverrideScale;
public uint PortraitCreatureDisplayInfoID; public uint PortraitCreatureDisplayInfoID;
public byte BloodID; public byte BloodID;
public ushort ParticleColorID; public ushort ParticleColorID;
public uint CreatureGeosetData; public uint CreatureGeosetData;
public ushort ObjectEffectPackageID; public ushort ObjectEffectPackageID;
public ushort AnimReplacementSetID; public ushort AnimReplacementSetID;
public sbyte UnarmedWeaponSubclass; public sbyte UnarmedWeaponType;
public uint StateSpellVisualKitID; public uint StateSpellVisualKitID;
public float InstanceOtherPlayerPetScale; // scale of not own player pets inside dungeons/raids/scenarios public float PetInstanceScale; // scale of not own player pets inside dungeons/raids/scenarios
public uint MountSpellVisualKitID; public uint MountPoofSpellVisualKitID;
public uint[] TextureVariation = new uint[3]; public uint[] TextureVariationFileDataID = new uint[3];
} }
public sealed class CreatureDisplayInfoExtraRecord public sealed class CreatureDisplayInfoExtraRecord
{ {
public uint Id; public uint Id;
public uint FileDataID; public uint BakeMaterialResourcesID;
public uint HDFileDataID; public uint HDBakeMaterialResourcesID;
public byte DisplayRaceID; public byte DisplayRaceID;
public byte DisplaySexID; public byte DisplaySexID;
public byte DisplayClassID; public byte DisplayClassID;
@@ -253,7 +253,7 @@ namespace Game.DataStorage
public LocalizedString Name; public LocalizedString Name;
public float MinScale; public float MinScale;
public float MaxScale; public float MaxScale;
public uint IconFileDataID; public uint IconFileID;
public ushort[] SkillLine = new ushort[2]; public ushort[] SkillLine = new ushort[2];
public ushort PetFoodMask; public ushort PetFoodMask;
public byte MinScaleLevel; public byte MinScaleLevel;
@@ -271,8 +271,7 @@ namespace Game.DataStorage
public float CollisionWidth; public float CollisionWidth;
public float CollisionHeight; public float CollisionHeight;
public float MountHeight; public float MountHeight;
public float[] GeoBoxMin = new float[3]; public float[] GeoBox = new float[6];
public float[] GeoBoxMax = new float[3];
public float WorldEffectScale; public float WorldEffectScale;
public float AttachedEffectScale; public float AttachedEffectScale;
public float MissileCollisionRadius; public float MissileCollisionRadius;
@@ -289,8 +288,8 @@ namespace Game.DataStorage
public uint BloodID; public uint BloodID;
public byte FootprintTextureID; public byte FootprintTextureID;
public byte FoleyMaterialID; public byte FoleyMaterialID;
public byte FootstepEffectID; public byte FootstepCameraEffectID;
public byte DeathThudEffectID; public byte DeathThudCameraEffectID;
public uint SoundID; public uint SoundID;
public uint CreatureGeosetDataID; public uint CreatureGeosetDataID;
} }
@@ -341,7 +340,7 @@ namespace Game.DataStorage
public byte CategoryID; public byte CategoryID;
public byte SpellCategory; public byte SpellCategory;
public byte Quality; public byte Quality;
public uint InventoryIconFileDataID; public uint InventoryIconFileID;
public uint SpellWeight; public uint SpellWeight;
} }
@@ -349,15 +348,14 @@ namespace Game.DataStorage
{ {
public uint ID; public uint ID;
public byte Type; public byte Type;
public byte Unused; public byte Flags;
} }
public sealed class CurvePointRecord public sealed class CurvePointRecord
{ {
public uint Id; public uint Id;
public float X; public Vector2 Pos;
public float Y;
public ushort CurveID; public ushort CurveID;
public byte Index; public byte OrderIndex;
} }
} }
+21 -21
View File
@@ -22,25 +22,25 @@ namespace Game.DataStorage
public sealed class DestructibleModelDataRecord public sealed class DestructibleModelDataRecord
{ {
public uint Id; public uint Id;
public ushort StateDamagedDisplayID; public ushort State0Wmo;
public ushort StateDestroyedDisplayID; public ushort State1Wmo;
public ushort StateRebuildingDisplayID; public ushort State2Wmo;
public ushort StateSmokeDisplayID; public ushort State3Wmo;
public ushort HealEffectSpeed; public ushort HealEffectSpeed;
public byte StateDamagedImpactEffectDoodadSet; public byte State0ImpactEffectDoodadSet;
public byte StateDamagedAmbientDoodadSet; public byte State0AmbientDoodadSet;
public byte StateDamagedNameSet; public byte State0NameSet;
public byte StateDestroyedDestructionDoodadSet; public byte State1DestructionDoodadSet;
public byte StateDestroyedImpactEffectDoodadSet; public byte State1ImpactEffectDoodadSet;
public byte StateDestroyedAmbientDoodadSet; public byte State1AmbientDoodadSet;
public byte StateDestroyedNameSet; public byte State1NameSet;
public byte StateRebuildingDestructionDoodadSet; public byte State2DestructionDoodadSet;
public byte StateRebuildingImpactEffectDoodadSet; public byte State2ImpactEffectDoodadSet;
public byte StateRebuildingAmbientDoodadSet; public byte State2AmbientDoodadSet;
public byte StateRebuildingNameSet; public byte State2NameSet;
public byte StateSmokeInitDoodadSet; public byte State3InitDoodadSet;
public byte StateSmokeAmbientDoodadSet; public byte State3AmbientDoodadSet;
public byte StateSmokeNameSet; public byte State3NameSet;
public byte EjectDirection; public byte EjectDirection;
public byte DoNotHighlight; public byte DoNotHighlight;
public byte HealEffect; public byte HealEffect;
@@ -60,7 +60,7 @@ namespace Game.DataStorage
public sbyte OldEnumValue; public sbyte OldEnumValue;
public DifficultyFlags Flags; public DifficultyFlags Flags;
public byte ToggleDifficultyID; public byte ToggleDifficultyID;
public byte ItemBonusTreeModID; public byte ItemContext;
public byte OrderIndex; public byte OrderIndex;
} }
@@ -74,7 +74,7 @@ namespace Game.DataStorage
public byte Flags; public byte Flags;
public uint Id; public uint Id;
public uint OrderIndex; public uint OrderIndex;
public uint TextureFileDataID; public uint SpellIconFileID;
} }
public sealed class DurabilityCostsRecord public sealed class DurabilityCostsRecord
@@ -87,6 +87,6 @@ namespace Game.DataStorage
public sealed class DurabilityQualityRecord public sealed class DurabilityQualityRecord
{ {
public uint Id; public uint Id;
public float QualityMod; public float Data;
} }
} }
+5 -5
View File
@@ -22,19 +22,19 @@ namespace Game.DataStorage
public uint Id; public uint Id;
public long RaceMask; public long RaceMask;
public uint EmoteSlashCommand; public uint EmoteSlashCommand;
public uint SpellVisualKitID;
public uint EmoteFlags; public uint EmoteFlags;
public uint SpellVisualKitID;
public ushort AnimID; public ushort AnimID;
public byte EmoteSpecProc; public byte EmoteSpecProc;
public uint EmoteSpecProcParam; public int ClassMask;
public byte EmoteSoundID; public byte EmoteSpecProcParam;
public short ClassMask; public ushort EmoteSoundID;
} }
public sealed class EmotesTextRecord public sealed class EmotesTextRecord
{ {
public uint Id; public uint Id;
public LocalizedString Name; public string Name;
public ushort EmoteID; public ushort EmoteID;
} }
+13 -15
View File
@@ -22,21 +22,19 @@ namespace Game.DataStorage
{ {
public sealed class FactionRecord public sealed class FactionRecord
{ {
public ulong[] ReputationRaceMask = new ulong[4]; public long[] ReputationRaceMask = new long[4];
public LocalizedString Name; public LocalizedString Name;
public string Description; public string Description;
public uint Id; public uint Id;
public int[] ReputationBase = new int[4]; public int[] ReputationBase = new int[4];
public float ParentFactionModIn; // Faction gains incoming rep * ParentFactionModIn public float[] ParentFactionMod = new float[2]; // Faction outputs rep * ParentFactionModOut as spillover reputation
public float ParentFactionModOut; // Faction outputs rep * ParentFactionModOut as spillover reputation
public uint[] ReputationMax = new uint[4]; public uint[] ReputationMax = new uint[4];
public short ReputationIndex; public short ReputationIndex;
public ushort[] ReputationClassMask = new ushort[4]; public ushort[] ReputationClassMask = new ushort[4];
public ushort[] ReputationFlags = new ushort[4]; public ushort[] ReputationFlags = new ushort[4];
public ushort ParentFactionID; public ushort ParentFactionID;
public ushort ParagonFactionID; public ushort ParagonFactionID;
public byte ParentFactionCapIn; // The highest rank the faction will profit from incoming spillover public byte[] ParentFactionCap = new byte[2]; // The highest rank the faction will profit from incoming spillover
public byte ParentFactionCapOut;
public byte Expansion; public byte Expansion;
public byte Flags; public byte Flags;
public byte FriendshipRepID; public byte FriendshipRepID;
@@ -53,10 +51,10 @@ namespace Game.DataStorage
public ushort Faction; public ushort Faction;
public ushort Flags; public ushort Flags;
public ushort[] Enemies = new ushort[4]; public ushort[] Enemies = new ushort[4];
public ushort[] Friends = new ushort[4]; public ushort[] Friend = new ushort[4];
public byte Mask; public byte FactionGroup;
public byte FriendMask; public byte FriendGroup;
public byte EnemyMask; public byte EnemyGroup;
public bool IsFriendlyTo(FactionTemplateRecord entry) public bool IsFriendlyTo(FactionTemplateRecord entry)
{ {
@@ -68,10 +66,10 @@ namespace Game.DataStorage
if (Enemies[i] == entry.Faction) if (Enemies[i] == entry.Faction)
return false; return false;
for (int i = 0; i < 4; ++i) for (int i = 0; i < 4; ++i)
if (Friends[i] == entry.Faction) if (Friend[i] == entry.Faction)
return true; return true;
} }
return Convert.ToBoolean(FriendMask & entry.Mask) || Convert.ToBoolean(Mask & entry.FriendMask); return Convert.ToBoolean(FriendGroup & entry.FactionGroup) || Convert.ToBoolean(FactionGroup & entry.FriendGroup);
} }
public bool IsHostileTo(FactionTemplateRecord entry) public bool IsHostileTo(FactionTemplateRecord entry)
{ {
@@ -83,19 +81,19 @@ namespace Game.DataStorage
if (Enemies[i] == entry.Faction) if (Enemies[i] == entry.Faction)
return true; return true;
for (int i = 0; i < 4; ++i) for (int i = 0; i < 4; ++i)
if (Friends[i] == entry.Faction) if (Friend[i] == entry.Faction)
return false; return false;
} }
return (EnemyMask & entry.Mask) != 0; return (EnemyGroup & entry.FactionGroup) != 0;
} }
public bool IsHostileToPlayers() { return (EnemyMask & (uint)FactionMasks.Player) != 0; } public bool IsHostileToPlayers() { return (EnemyGroup & (uint)FactionMasks.Player) != 0; }
public bool IsNeutralToAll() public bool IsNeutralToAll()
{ {
for (int i = 0; i < 4; ++i) for (int i = 0; i < 4; ++i)
if (Enemies[i] != 0) if (Enemies[i] != 0)
return false; return false;
return EnemyMask == 0 && FriendMask == 0; return EnemyGroup == 0 && FriendGroup == 0;
} }
public bool IsContestedGuardFaction() { return Flags.HasAnyFlag((ushort)FactionTemplateFlags.ContestedGuard); } public bool IsContestedGuardFaction() { return Flags.HasAnyFlag((ushort)FactionTemplateFlags.ContestedGuard); }
public bool ShouldSparAttack() { return Flags.HasAnyFlag((ushort)FactionTemplateFlags.EnemySpar); } public bool ShouldSparAttack() { return Flags.HasAnyFlag((ushort)FactionTemplateFlags.EnemySpar); }
+76 -79
View File
@@ -20,25 +20,6 @@ using Framework.GameMath;
namespace Game.DataStorage namespace Game.DataStorage
{ {
public sealed class GameObjectsRecord
{
public LocalizedString Name;
public Vector3 Position;
public float RotationX;
public float RotationY;
public float RotationZ;
public float RotationW;
public float Size;
public int[] Data = new int[8];
public ushort MapID;
public ushort DisplayID;
public ushort PhaseID;
public ushort PhaseGroupID;
public byte PhaseUseFlags;
public GameObjectTypes Type;
public uint Id;
}
public sealed class GameObjectDisplayInfoRecord public sealed class GameObjectDisplayInfoRecord
{ {
public uint Id; public uint Id;
@@ -50,50 +31,66 @@ namespace Game.DataStorage
public ushort ObjectEffectPackageID; public ushort ObjectEffectPackageID;
} }
public sealed class GameObjectsRecord
{
public LocalizedString Name;
public Vector3 Pos;
public float[] Rot = new float[4];
public float Scale;
public int[] PropValue = new int[8];
public ushort OwnerID;
public ushort DisplayID;
public ushort PhaseID;
public ushort PhaseGroupID;
public byte PhaseUseFlags;
public GameObjectTypes TypeID;
public uint Id;
}
public sealed class GarrAbilityRecord public sealed class GarrAbilityRecord
{ {
public LocalizedString Name; public LocalizedString Name;
public LocalizedString Description; public LocalizedString Description;
public uint IconFileDataID; public uint IconFileDataID;
public GarrisonAbilityFlags Flags; public GarrisonAbilityFlags Flags;
public ushort OtherFactionGarrAbilityID; public ushort FactionChangeGarrAbilityID;
public byte GarrAbilityCategoryID; public byte GarrAbilityCategoryID;
public byte FollowerTypeID; public byte GarrFollowerTypeID;
public uint Id; public uint Id;
} }
public sealed class GarrBuildingRecord public sealed class GarrBuildingRecord
{ {
public uint Id; public uint Id;
public string NameAlliance; public string AllianceName;
public string NameHorde; public string HordeName;
public string Description; public string Description;
public string Tooltip; public string Tooltip;
public uint HordeGameObjectID; public uint HordeGameObjectID;
public uint AllianceGameObjectID; public uint AllianceGameObjectID;
public uint IconFileDataID; public uint IconFileDataID;
public ushort CostCurrencyID; public ushort CurrencyTypeID;
public ushort HordeTexPrefixKitID; public ushort HordeUiTextureKitID;
public ushort AllianceTexPrefixKitID; public ushort AllianceUiTextureKitID;
public ushort AllianceActivationScenePackageID; public ushort AllianceSceneScriptPackageID;
public ushort HordeActivationScenePackageID; public ushort HordeSceneScriptPackageID;
public ushort FollowerRequiredGarrAbilityID; public ushort GarrAbilityID;
public ushort FollowerGarrAbilityEffectID; public ushort BonusGarrAbilityID;
public short CostMoney; public short GoldCost;
public byte Unknown; public byte GarrSiteID;
public byte Type; public byte BuildingType;
public byte Level; public byte UpgradeLevel;
public GarrisonBuildingFlags Flags; public GarrisonBuildingFlags Flags;
public byte MaxShipments; public byte ShipmentCapacity;
public byte GarrTypeID; public byte GarrTypeID;
public ushort BuildDuration; public ushort BuildSeconds;
public int CostCurrencyAmount; public int CurrencyQty;
public byte BonusAmount; public byte MaxAssignments;
} }
public sealed class GarrBuildingPlotInstRecord public sealed class GarrBuildingPlotInstRecord
{ {
public Vector2 LandmarkOffset; public Vector2 MapOffset;
public ushort UiTextureAtlasMemberID; public ushort UiTextureAtlasMemberID;
public ushort GarrSiteLevelPlotInstID; public ushort GarrSiteLevelPlotInstID;
public byte GarrBuildingID; public byte GarrBuildingID;
@@ -102,12 +99,12 @@ namespace Game.DataStorage
public sealed class GarrClassSpecRecord public sealed class GarrClassSpecRecord
{ {
public LocalizedString NameMale; public LocalizedString ClassSpec;
public LocalizedString NameFemale; public LocalizedString ClassSpecMale;
public LocalizedString NameGenderless; public LocalizedString ClassSpecFemale;
public ushort ClassAtlasID; // UiTextureAtlasMember.db2 ref public ushort UiTextureAtlasMemberID; // UiTextureAtlasMember.db2 ref
public ushort GarrFollItemSetID; public ushort GarrFollItemSetID;
public byte Limit; public byte FollowerClassLimit;
public byte Flags; public byte Flags;
public uint Id; public uint Id;
} }
@@ -116,35 +113,35 @@ namespace Game.DataStorage
{ {
public string HordeSourceText; public string HordeSourceText;
public string AllianceSourceText; public string AllianceSourceText;
public string Name; public string TitleName;
public uint HordeCreatureID; public uint HordeCreatureID;
public uint AllianceCreatureID; public uint AllianceCreatureID;
public uint HordePortraitIconID; public uint HordeIconFileDataID;
public uint AlliancePortraitIconID; public uint AllianceIconFileDataID;
public uint HordeAddedBroadcastTextID; public uint HordeSlottingBroadcastTextID;
public uint AllianceAddedBroadcastTextID; public uint AllySlottingBroadcastTextID;
public ushort HordeGarrFollItemSetID; public ushort HordeGarrFollItemSetID;
public ushort AllianceGarrFollItemSetID; public ushort AllianceGarrFollItemSetID;
public ushort ItemLevelWeapon; public ushort ItemLevelWeapon;
public ushort ItemLevelArmor; public ushort ItemLevelArmor;
public ushort HordeListPortraitTextureKitID; public ushort HordeUITextureKitID;
public ushort AllianceListPortraitTextureKitID; public ushort AllianceUITextureKitID;
public byte FollowerTypeID; public byte GarrFollowerTypeID;
public byte HordeUiAnimRaceInfoID; public byte HordeGarrFollRaceID;
public byte AllianceUiAnimRaceInfoID; public byte AllianceGarrFollRaceID;
public byte Quality; public byte Quality;
public byte HordeGarrClassSpecID; public byte HordeGarrClassSpecID;
public byte AllianceGarrClassSpecID; public byte AllianceGarrClassSpecID;
public byte Level; public byte FollowerLevel;
public byte Unknown1; public byte Gender;
public byte Flags; public byte Flags;
public sbyte Unknown2; public sbyte HordeSourceTypeEnum;
public sbyte Unknown3; public sbyte AllianceSourceTypeEnum;
public byte GarrTypeID; public byte GarrTypeID;
public byte MaxDurability; public byte Vitality;
public byte Class; public byte ChrClassID;
public byte HordeFlavorTextGarrStringID; public byte HordeFlavorGarrStringID;
public byte AllianceFlavorTextGarrStringID; public byte AllianceFlavorGarrStringID;
public uint Id; public uint Id;
} }
@@ -160,12 +157,12 @@ namespace Game.DataStorage
{ {
public uint Id; public uint Id;
public LocalizedString Name; public LocalizedString Name;
public uint AllianceConstructionGameObjectID; public uint AllianceConstructObjID;
public uint HordeConstructionGameObjectID; public uint HordeConstructObjID;
public byte GarrPlotUICategoryID; public byte UiCategoryID;
public byte PlotType; public byte PlotType;
public byte Flags; public byte Flags;
public uint[] Count = new uint[2]; public uint[] UpgradeRequirement = new uint[2];
} }
public sealed class GarrPlotBuildingRecord public sealed class GarrPlotBuildingRecord
@@ -178,38 +175,38 @@ namespace Game.DataStorage
public sealed class GarrPlotInstanceRecord public sealed class GarrPlotInstanceRecord
{ {
public uint Id; public uint Id;
public LocalizedString Name; public string Name;
public byte GarrPlotID; public byte GarrPlotID;
} }
public sealed class GarrSiteLevelRecord public sealed class GarrSiteLevelRecord
{ {
public uint Id; public uint Id;
public Vector2 TownHall; public Vector2 TownHallUiPos;
public ushort MapID; public ushort MapID;
public ushort SiteID; public ushort UiTextureKitID;
public ushort MovieID; public ushort UpgradeMovieID;
public ushort UpgradeResourceCost; public ushort UpgradeCost;
public ushort UpgradeMoneyCost; public ushort UpgradeGoldCost;
public byte Level; public byte GarrLevel;
public byte UITextureKitID; public byte GarrSiteID;
public byte Level2; public byte MaxBuildingLevel;
} }
public sealed class GarrSiteLevelPlotInstRecord public sealed class GarrSiteLevelPlotInstRecord
{ {
public uint Id; public uint Id;
public Vector2 Landmark; public Vector2 UiMarkerPos;
public ushort GarrSiteLevelID; public ushort GarrSiteLevelID;
public byte GarrPlotInstanceID; public byte GarrPlotInstanceID;
public byte Unknown; public byte UiMarkerSize;
} }
public sealed class GemPropertiesRecord public sealed class GemPropertiesRecord
{ {
public uint Id; public uint Id;
public SocketColor Type; public SocketColor Type;
public ushort EnchantID; public ushort EnchantId;
public ushort MinItemLevel; public ushort MinItemLevel;
} }
@@ -225,7 +222,7 @@ namespace Game.DataStorage
public uint Id; public uint Id;
public uint SpellID; public uint SpellID;
public ushort SpellIconID; public ushort SpellIconID;
public byte Type; public byte GlyphType;
public byte GlyphExclusiveCategoryID; public byte GlyphExclusiveCategoryID;
} }
+5 -4
View File
@@ -23,12 +23,13 @@ namespace Game.DataStorage
{ {
public string SourceText; public string SourceText;
public uint ItemID; public uint ItemID;
public uint[] OldItem = new uint[2]; public uint LegacyItemID;
public uint NextDifficultyItemID; public uint LegacyUpgradedItemID;
public uint StaticUpgradedItemID;
public uint[] UpgradeItemID = new uint[3]; public uint[] UpgradeItemID = new uint[3];
public ushort[] ItemBonusListID = new ushort[3]; public ushort[] UpgradeItemBonusListID = new ushort[3];
public byte Flags; public byte Flags;
public byte Source; public byte SourceTypeEnum;
public uint Id; public uint Id;
} }
+122 -119
View File
@@ -22,50 +22,50 @@ namespace Game.DataStorage
public sealed class ImportPriceArmorRecord public sealed class ImportPriceArmorRecord
{ {
public uint Id; public uint Id;
public float ClothFactor; public float ClothModifier;
public float LeatherFactor; public float LeatherModifier;
public float MailFactor; public float ChainModifier;
public float PlateFactor; public float PlateModifier;
} }
public sealed class ImportPriceQualityRecord public sealed class ImportPriceQualityRecord
{ {
public uint Id; public uint Id;
public float Factor; public float Data;
} }
public sealed class ImportPriceShieldRecord public sealed class ImportPriceShieldRecord
{ {
public uint Id; public uint Id;
public float Factor; public float Data;
} }
public sealed class ImportPriceWeaponRecord public sealed class ImportPriceWeaponRecord
{ {
public uint Id; public uint Id;
public float Factor; public float Data;
} }
public sealed class ItemRecord public sealed class ItemRecord
{ {
public uint Id; public uint Id;
public uint FileDataID; public uint IconFileDataID;
public ItemClass Class; public ItemClass ClassID;
public byte SubClass; public byte SubclassID;
public sbyte SoundOverrideSubclass; public sbyte SoundOverrideSubclassID;
public sbyte Material; public byte Material;
public InventoryType inventoryType; public InventoryType inventoryType;
public byte Sheath; public byte SheatheType;
public byte GroupSoundsID; public byte ItemGroupSoundsID;
} }
public sealed class ItemAppearanceRecord public sealed class ItemAppearanceRecord
{ {
public uint Id; public uint Id;
public uint DisplayID; public uint ItemDisplayInfoID;
public uint IconFileDataID; public uint DefaultIconFileDataID;
public uint UIOrder; public uint UIOrder;
public byte ObjectComponentSlot; public byte DisplayType;
} }
public sealed class ItemArmorQualityRecord public sealed class ItemArmorQualityRecord
@@ -85,7 +85,10 @@ namespace Game.DataStorage
public sealed class ItemArmorTotalRecord public sealed class ItemArmorTotalRecord
{ {
public uint Id; public uint Id;
public float[] Value = new float[4]; public float Cloth;
public float Leather;
public float Mail;
public float Plate;
public ushort ItemLevel; public ushort ItemLevel;
} }
@@ -99,48 +102,48 @@ namespace Game.DataStorage
{ {
public uint Id; public uint Id;
public int[] Value = new int[3]; public int[] Value = new int[3];
public ushort BonusListID; public ushort ParentItemBonusListID;
public ItemBonusType Type; public ItemBonusType Type;
public byte Index; public byte OrderIndex;
} }
public sealed class ItemBonusListLevelDeltaRecord public sealed class ItemBonusListLevelDeltaRecord
{ {
public short Delta; public short ItemLevelDelta;
public uint Id; public uint Id;
} }
public sealed class ItemBonusTreeNodeRecord public sealed class ItemBonusTreeNodeRecord
{ {
public uint Id; public uint Id;
public ushort SubTreeID; public ushort ChildItemBonusTreeID;
public ushort BonusListID; public ushort ChildItemBonusListID;
public ushort ItemLevelSelectorID; public ushort ChildItemLevelSelectorID;
public byte BonusTreeModID; public byte ItemContext;
public uint BonusTreeID; public uint ParentItemBonusTreeID;
} }
public sealed class ItemChildEquipmentRecord public sealed class ItemChildEquipmentRecord
{ {
public uint Id; public uint Id;
public uint AltItemID; public uint ChildItemID;
public byte AltEquipmentSlot; public byte ChildItemEquipSlot;
public uint ItemID; public uint ParentItemID;
} }
public sealed class ItemClassRecord public sealed class ItemClassRecord
{ {
public uint Id; public uint Id;
public string Name; public string ClassName;
public float PriceMod; public float PriceModifier;
public byte OldEnumValue; public byte ClassID;
public byte Flags; public byte Flags;
} }
public sealed class ItemCurrencyCostRecord public sealed class ItemCurrencyCostRecord
{ {
public uint Id; public uint Id;
public uint ItemId; public uint ItemID;
} }
// common struct for: // common struct for:
@@ -155,71 +158,71 @@ namespace Game.DataStorage
public sealed class ItemDamageRecord public sealed class ItemDamageRecord
{ {
public uint Id; public uint Id;
public float[] DPS = new float[7]; public float[] Quality = new float[7];
public ushort ItemLevel; public ushort ItemLevel;
} }
public sealed class ItemDisenchantLootRecord public sealed class ItemDisenchantLootRecord
{ {
public uint Id; public uint Id;
public ushort MinItemLevel; public ushort MinLevel;
public ushort MaxItemLevel; public ushort MaxLevel;
public ushort RequiredDisenchantSkill; public ushort SkillRequired;
public sbyte ItemSubClass; public sbyte Subclass;
public byte ItemQuality; public byte Quality;
public sbyte Expansion; public sbyte ExpansionID;
public uint ItemClass; public uint ClassID;
} }
public sealed class ItemEffectRecord public sealed class ItemEffectRecord
{ {
public uint Id; public uint Id;
public uint SpellID; public uint SpellID;
public int Cooldown; public int CoolDownMSec;
public int CategoryCooldown; public int CategoryCoolDownMSec;
public short Charges; public short Charges;
public ushort Category; public ushort SpellCategoryID;
public ushort ChrSpecializationID; public ushort ChrSpecializationID;
public byte OrderIndex; public byte LegacySlotIndex;
public ItemSpelltriggerType Trigger; public ItemSpelltriggerType TriggerType;
public uint ItemID; public uint ParentItemID;
} }
public sealed class ItemExtendedCostRecord public sealed class ItemExtendedCostRecord
{ {
public uint Id; public uint Id;
public uint[] RequiredItem = new uint[ItemConst.MaxItemExtCostItems]; // required item id public uint[] ItemID = new uint[ItemConst.MaxItemExtCostItems]; // required item id
public uint[] RequiredCurrencyCount = new uint[ItemConst.MaxItemExtCostCurrencies]; // required curency count public uint[] CurrencyCount = new uint[ItemConst.MaxItemExtCostCurrencies]; // required curency count
public ushort[] RequiredItemCount = new ushort[ItemConst.MaxItemExtCostItems]; // required count of 1st item public ushort[] ItemCount = new ushort[ItemConst.MaxItemExtCostItems]; // required count of 1st item
public ushort RequiredPersonalArenaRating; // required personal arena rating public ushort RequiredArenaRating; // required personal arena rating
public ushort[] RequiredCurrency = new ushort[ItemConst.MaxItemExtCostCurrencies]; // required curency id public ushort[] CurrencyID = new ushort[ItemConst.MaxItemExtCostCurrencies]; // required curency id
public byte RequiredArenaSlot; // arena slot restrictions (min slot value) public byte ArenaBracket; // arena slot restrictions (min slot value)
public byte RequiredFactionId; public byte MinFactionID;
public byte RequiredFactionStanding; public byte MinReputation;
public byte RequirementFlags; public byte Flags;
public byte RequiredAchievement; public byte RequiredAchievement;
} }
public sealed class ItemLevelSelectorRecord public sealed class ItemLevelSelectorRecord
{ {
public uint ID; public uint ID;
public ushort ItemLevel; public ushort MinItemLevel;
public ushort ItemLevelSelectorQualitySetID; public ushort ItemLevelSelectorQualitySetID;
} }
public sealed class ItemLevelSelectorQualityRecord public sealed class ItemLevelSelectorQualityRecord
{ {
public uint ID; public uint ID;
public uint ItemBonusListID; public uint QualityItemBonusListID;
public byte Quality; public byte Quality;
public uint ItemLevelSelectorQualitySetID; public uint ParentILSQualitySetID;
} }
public sealed class ItemLevelSelectorQualitySetRecord public sealed class ItemLevelSelectorQualitySetRecord
{ {
public uint ID; public uint ID;
public ushort ItemLevelMin; public ushort IlvlRare;
public ushort ItemLevelMax; public ushort IlvlEpic;
} }
public sealed class ItemLimitCategoryRecord public sealed class ItemLimitCategoryRecord
@@ -234,17 +237,17 @@ namespace Game.DataStorage
{ {
public uint ItemID; public uint ItemID;
public uint Id; public uint Id;
public byte AppearanceModID; public byte ItemAppearanceModifierID;
public ushort AppearanceID; public ushort ItemAppearanceID;
public byte Index; public byte OrderIndex;
public byte SourceType; public byte TransmogSourceTypeEnum;
} }
public sealed class ItemPriceBaseRecord public sealed class ItemPriceBaseRecord
{ {
public uint Id; public uint Id;
public float ArmorFactor; public float Armor;
public float WeaponFactor; public float Weapon;
public ushort ItemLevel; public ushort ItemLevel;
} }
@@ -266,19 +269,19 @@ namespace Game.DataStorage
public sealed class ItemSearchNameRecord public sealed class ItemSearchNameRecord
{ {
public ulong AllowableRace; public ulong AllowableRace;
public LocalizedString Name; public LocalizedString Display;
public uint Id; public uint Id;
public uint[] Flags = new uint[3]; public uint[] Flags = new uint[3];
public ushort ItemLevel; public ushort ItemLevel;
public byte Quality; public byte OverallQualityID;
public byte RequiredExpansion; public byte ExpansionID;
public byte RequiredLevel; public byte RequiredLevel;
public ushort RequiredReputationFaction; public ushort MinFactionID;
public byte RequiredReputationRank; public byte MinReputation;
public short AllowableClass; public short AllowableClass;
public ushort RequiredSkill; public ushort RequiredSkill;
public ushort RequiredSkillRank; public ushort RequiredSkillRank;
public uint RequiredSpell; public uint RequiredAbility;
} }
public sealed class ItemSetRecord public sealed class ItemSetRecord
@@ -288,7 +291,7 @@ namespace Game.DataStorage
public uint[] ItemID = new uint[17]; public uint[] ItemID = new uint[17];
public ushort RequiredSkillRank; public ushort RequiredSkillRank;
public byte RequiredSkill; public byte RequiredSkill;
public ItemSetFlags Flags; public ItemSetFlags SetFlags;
} }
public sealed class ItemSetSpellRecord public sealed class ItemSetSpellRecord
@@ -304,75 +307,75 @@ namespace Game.DataStorage
{ {
public uint Id; public uint Id;
public long AllowableRace; public long AllowableRace;
public LocalizedString Name; public LocalizedString Display;
public string Name2; public string Display2;
public string Name3; public string Display3;
public string Name4; public string Display4;
public string Description; public string Description;
public uint[] Flags = new uint[4]; public uint[] Flags = new uint[4];
public float Unk1; public float PriceRandomValue;
public float Unk2; public float PriceVariance;
public uint BuyCount; public uint VendorStackCount;
public uint BuyPrice; public uint BuyPrice;
public uint SellPrice; public uint SellPrice;
public uint RequiredSpell; public uint RequiredAbility;
public uint MaxCount; public uint MaxCount;
public uint Stackable; public uint Stackable;
public int[] ItemStatAllocation = new int[ItemConst.MaxStats]; public int[] StatPercentEditor = new int[ItemConst.MaxStats];
public float[] ItemStatSocketCostMultiplier = new float[ItemConst.MaxStats]; public float[] StatPercentageOfSocket = new float[ItemConst.MaxStats];
public float RangedModRange; public float ItemRange;
public uint BagFamily; public uint BagFamily;
public float ArmorDamageModifier;//wrong? public float QualityModifier;
public uint Duration; public uint DurationInInventory;
public float StatScalingFactor; public float DmgVariance;
public short AllowableClass; public short AllowableClass;
public ushort ItemLevel; public ushort ItemLevel;
public ushort RequiredSkill; public ushort RequiredSkill;
public ushort RequiredSkillRank; public ushort RequiredSkillRank;
public ushort RequiredReputationFaction; public ushort MinFactionID;
public short[] ItemStatValue = new short[ItemConst.MaxStats]; public short[] ItemStatValue = new short[ItemConst.MaxStats];
public ushort ScalingStatDistribution; public ushort ScalingStatDistributionID;
public ushort Delay; public ushort ItemDelay;
public ushort PageText; public ushort PageID;
public ushort StartQuest; public ushort StartQuestID;
public ushort LockID; public ushort LockID;
public ushort RandomProperty; public ushort RandomSelect;
public ushort RandomSuffix; public ushort ItemRandomSuffixGroupID;
public ushort ItemSet; public ushort ItemSet;
public ushort Area; public ushort ZoneBound;
public ushort Map; public ushort InstanceBound;
public ushort TotemCategory; public ushort TotemCategoryID;
public ushort SocketBonus; public ushort SocketMatchEnchantmentId;
public ushort GemProperties; public ushort GemProperties;
public ushort ItemLimitCategory; public ushort LimitCategory;
public ushort HolidayID; public ushort RequiredHoliday;
public ushort RequiredTransmogHolidayID; public ushort RequiredTransmogHoliday;
public ushort ItemNameDescriptionID; public ushort ItemNameDescriptionID;
public byte Quality; public byte OverallQualityID;
public InventoryType inventoryType; public InventoryType inventoryType;
public sbyte RequiredLevel; public sbyte RequiredLevel;
public byte RequiredHonorRank; public byte RequiredPVPRank;
public byte RequiredCityRank; public byte RequiredPVPMedal;
public byte RequiredReputationRank; public byte MinReputation;
public byte ContainerSlots; public byte ContainerSlots;
public sbyte[] ItemStatType = new sbyte[ItemConst.MaxStats]; public sbyte[] StatModifierBonusStat = new sbyte[ItemConst.MaxStats];
public byte DamageType; public byte DamageType;
public byte Bonding; public byte Bonding;
public byte LanguageID; public byte LanguageID;
public byte PageMaterial; public byte PageMaterialID;
public sbyte Material; public sbyte Material;
public byte Sheath; public byte SheatheType;
public byte[] SocketColor = new byte[ItemConst.MaxGemSockets]; public byte[] SocketType = new byte[ItemConst.MaxGemSockets];
public byte CurrencySubstitutionID; public byte SpellWeightCategory;
public byte CurrencySubstitutionCount; public byte SpellWeight;
public byte ArtifactID; public byte ArtifactID;
public byte RequiredExpansion; public byte ExpansionID;
} }
public sealed class ItemSpecRecord public sealed class ItemSpecRecord
{ {
public uint Id; public uint Id;
public ushort SpecID; public ushort SpecializationID;
public byte MinLevel; public byte MinLevel;
public byte MaxLevel; public byte MaxLevel;
public byte ItemType; public byte ItemType;
@@ -390,17 +393,17 @@ namespace Game.DataStorage
public sealed class ItemUpgradeRecord public sealed class ItemUpgradeRecord
{ {
public uint Id; public uint Id;
public uint CurrencyCost; public uint CurrencyAmount;
public ushort PrevItemUpgradeID; public ushort PrerequisiteID;
public ushort CurrencyID; public ushort CurrencyType;
public byte ItemUpgradePathID; public byte ItemUpgradePathID;
public byte ItemLevelBonus; public byte ItemLevelIncrement;
} }
public sealed class ItemXBonusTreeRecord public sealed class ItemXBonusTreeRecord
{ {
public uint Id; public uint Id;
public ushort BonusTreeID; public ushort ItemBonusTreeID;
public uint ItemID; public uint ItemID;
} }
} }
+17 -17
View File
@@ -26,23 +26,23 @@ namespace Game.DataStorage
public LocalizedString Name; public LocalizedString Name;
public string Description; public string Description;
public LfgFlags Flags; public LfgFlags Flags;
public float MinItemLevel; public float MinGear;
public ushort MaxLevel; public ushort MaxLevel;
public ushort TargetLevelMax; public ushort TargetLevelMax;
public short MapID; public short MapID;
public ushort RandomID; public ushort RandomID;
public ushort ScenarioID; public ushort ScenarioID;
public ushort LastBossJournalEncounterID; public ushort FinalEncounterID;
public ushort BonusReputationAmount; public ushort BonusReputationAmount;
public ushort MentorItemLevel; public ushort MentorItemLevel;
public ushort PlayerConditionID; public ushort RequiredPlayerConditionId;
public byte MinLevel; public byte MinLevel;
public byte TargetLevel; public byte TargetLevel;
public byte TargetLevelMin; public byte TargetLevelMin;
public Difficulty DifficultyID; public Difficulty DifficultyID;
public LfgType Type; public LfgType TypeID;
public byte Faction; public byte Faction;
public byte Expansion; public byte ExpansionLevel;
public byte OrderIndex; public byte OrderIndex;
public byte GroupID; public byte GroupID;
public byte CountTank; public byte CountTank;
@@ -51,30 +51,30 @@ namespace Game.DataStorage
public byte MinCountTank; public byte MinCountTank;
public byte MinCountHealer; public byte MinCountHealer;
public byte MinCountDamage; public byte MinCountDamage;
public byte SubType; public byte Subtype;
public byte MentorCharLevel; public byte MentorCharLevel;
public int TextureFileDataID; public int IconTextureFileID;
public int RewardIconFileDataID; public int RewardsBgTextureFileID;
public int ProposalTextureFileDataID; public int PopupBgTextureFileID;
// Helpers // Helpers
public uint Entry() { return (uint)(Id + ((int)Type << 24)); } public uint Entry() { return (uint)(Id + ((int)TypeID << 24)); }
} }
public sealed class LightRecord public sealed class LightRecord
{ {
public uint Id; public uint Id;
public Vector3 Pos; public Vector3 GameCoords;
public float FalloffStart; public float GameFalloffStart;
public float FalloffEnd; public float GameFalloffEnd;
public ushort MapID; public ushort ContinentID;
public ushort[] LightParamsID = new ushort[8]; public ushort[] LightParamsID = new ushort[8];
} }
public sealed class LiquidTypeRecord public sealed class LiquidTypeRecord
{ {
public uint Id; public uint Id;
public LocalizedString Name; public string Name;
public string[] Texture = new string[6]; public string[] Texture = new string[6];
public uint SpellID; public uint SpellID;
public float MaxDarkenDepth; public float MaxDarkenDepth;
@@ -87,11 +87,11 @@ namespace Game.DataStorage
public uint[] Int = new uint[4]; public uint[] Int = new uint[4];
public ushort Flags; public ushort Flags;
public ushort LightID; public ushort LightID;
public byte LiquidType; public byte SoundBank;
public byte ParticleMovement; public byte ParticleMovement;
public byte ParticleTexSlots; public byte ParticleTexSlots;
public byte MaterialID; public byte MaterialID;
public byte[] DepthTexCount = new byte[6]; public byte[] FrameCountTexture = new byte[6];
public ushort SoundID; public ushort SoundID;
} }
+28 -27
View File
@@ -33,11 +33,11 @@ namespace Game.DataStorage
public LocalizedString MapName; public LocalizedString MapName;
public string MapDescription0; // Horde public string MapDescription0; // Horde
public string MapDescription1; // Alliance public string MapDescription1; // Alliance
public string ShortDescription; public string PvpShortDescription;
public string LongDescription; public string PvpLongDescription;
public MapFlags[] Flags = new MapFlags[2]; public MapFlags[] Flags = new MapFlags[2];
public float MinimapIconScale; public float MinimapIconScale;
public Vector2 CorpsePos; // entrance coordinates in ghost mode (in most cases = normal entrance) public Vector2 Corpse; // entrance coordinates in ghost mode (in most cases = normal entrance)
public ushort AreaTableID; public ushort AreaTableID;
public ushort LoadingScreenID; public ushort LoadingScreenID;
public short CorpseMapID; // map_id of entrance map in ghost mode (continent always and in most cases = normal entrance) public short CorpseMapID; // map_id of entrance map in ghost mode (continent always and in most cases = normal entrance)
@@ -46,7 +46,7 @@ namespace Game.DataStorage
public short CosmeticParentMapID; public short CosmeticParentMapID;
public ushort WindSettingsID; public ushort WindSettingsID;
public MapTypes InstanceType; public MapTypes InstanceType;
public byte unk5; public byte MapType;
public byte ExpansionID; public byte ExpansionID;
public byte MaxPlayers; public byte MaxPlayers;
public byte TimeOffset; public byte TimeOffset;
@@ -76,8 +76,8 @@ namespace Game.DataStorage
if (CorpseMapID < 0) if (CorpseMapID < 0)
return false; return false;
mapid = (uint)CorpseMapID; mapid = (uint)CorpseMapID;
x = CorpsePos.X; x = Corpse.X;
y = CorpsePos.Y; y = Corpse.Y;
return true; return true;
} }
@@ -93,21 +93,21 @@ namespace Game.DataStorage
public sealed class MapDifficultyRecord public sealed class MapDifficultyRecord
{ {
public uint Id; public uint Id;
public LocalizedString Message_lang; // m_message_lang (text showed when transfer to map failed) public LocalizedString Message; // m_message_lang (text showed when transfer to map failed)
public byte DifficultyID; public byte DifficultyID;
public byte RaidDurationType; // 1 means daily reset, 2 means weekly public byte ResetInterval; // 1 means daily reset, 2 means weekly
public byte MaxPlayers; // m_maxPlayers some heroic versions have 0 when expected same amount as in normal version public byte MaxPlayers; // m_maxPlayers some heroic versions have 0 when expected same amount as in normal version
public byte LockID; public byte LockID;
public byte Flags; public byte Flags;
public byte ItemBonusTreeModID; public byte ItemContext;
public uint Context; public uint ItemContextPickerID;
public uint MapID; public uint MapID;
public uint GetRaidDuration() public uint GetRaidDuration()
{ {
if (RaidDurationType == 1) if (ResetInterval == 1)
return 86400; return 86400;
if (RaidDurationType == 2) if (ResetInterval == 2)
return 604800; return 604800;
return 0; return 0;
} }
@@ -116,10 +116,11 @@ namespace Game.DataStorage
public sealed class ModifierTreeRecord public sealed class ModifierTreeRecord
{ {
public uint Id; public uint Id;
public uint[] Asset = new uint[2]; public uint Asset;
public uint SecondaryAsset;
public uint Parent; public uint Parent;
public byte Type; public byte Type;
public byte Unk700; public byte TertiaryAsset;
public byte Operator; public byte Operator;
public byte Amount; public byte Amount;
} }
@@ -128,14 +129,14 @@ namespace Game.DataStorage
{ {
public string Name; public string Name;
public string Description; public string Description;
public string SourceDescription; public string SourceText;
public uint SpellId; public uint SourceSpellID;
public float CameraPivotMultiplier; public float MountFlyRideHeight;
public ushort MountTypeId; public ushort MountTypeID;
public ushort Flags; public ushort Flags;
public byte Source; public byte SourceTypeEnum;
public uint Id; public uint Id;
public uint PlayerConditionId; public uint PlayerConditionID;
public byte UiModelSceneID; public byte UiModelSceneID;
public bool IsSelfMount() { return (Flags & (ushort)MountFlags.SelfMount) != 0; } public bool IsSelfMount() { return (Flags & (ushort)MountFlags.SelfMount) != 0; }
@@ -143,14 +144,14 @@ namespace Game.DataStorage
public sealed class MountCapabilityRecord public sealed class MountCapabilityRecord
{ {
public uint RequiredSpell; public uint ReqSpellKnownID;
public uint SpeedModSpell; public uint ModSpellAuraID;
public ushort RequiredRidingSkill; public ushort ReqRidingSkill;
public ushort RequiredArea; public ushort ReqAreaID;
public short RequiredMap; public short ReqMapID;
public MountCapabilityFlags Flags; public MountCapabilityFlags Flags;
public uint Id; public uint Id;
public byte RequiredAura; public byte ReqSpellAuraID;
} }
public sealed class MountTypeXCapabilityRecord public sealed class MountTypeXCapabilityRecord
@@ -164,7 +165,7 @@ namespace Game.DataStorage
public sealed class MountXDisplayRecord public sealed class MountXDisplayRecord
{ {
public uint Id; public uint Id;
public uint DisplayID; public uint CreatureDisplayInfoID;
public uint PlayerConditionID; public uint PlayerConditionID;
public uint MountID; public uint MountID;
} }
+2 -2
View File
@@ -20,8 +20,8 @@ namespace Game.DataStorage
public sealed class NameGenRecord public sealed class NameGenRecord
{ {
public uint Id; public uint Id;
public LocalizedString Name; public string Name;
public byte Race; public byte RaceID;
public byte Sex; public byte Sex;
} }
+2 -2
View File
@@ -22,8 +22,8 @@ namespace Game.DataStorage
public sealed class OverrideSpellDataRecord public sealed class OverrideSpellDataRecord
{ {
public uint Id; public uint Id;
public uint[] SpellID = new uint[SharedConst.MaxOverrideSpell]; public uint[] Spells = new uint[SharedConst.MaxOverrideSpell];
public uint PlayerActionbarFileDataID; public uint PlayerActionBarFileDataID;
public byte Flags; public byte Flags;
} }
} }
+21 -21
View File
@@ -51,7 +51,7 @@ namespace Game.DataStorage
public ushort MaxFactionID; public ushort MaxFactionID;
public byte MaxReputation; public byte MaxReputation;
public uint ReputationLogic; public uint ReputationLogic;
public byte Unknown1; public byte CurrentPvpFaction;
public byte MinPVPRank; public byte MinPVPRank;
public byte MaxPVPRank; public byte MaxPVPRank;
public byte PvpMedal; public byte PvpMedal;
@@ -91,7 +91,7 @@ namespace Game.DataStorage
public byte PowerTypeComp; public byte PowerTypeComp;
public byte PowerTypeValue; public byte PowerTypeValue;
public uint ModifierTreeID; public uint ModifierTreeID;
public int MainHandItemSubclassMask; public int WeaponSubclassMask;
public ushort[] SkillID = new ushort[4]; public ushort[] SkillID = new ushort[4];
public short[] MinSkill = new short[4]; public short[] MinSkill = new short[4];
public short[] MaxSkill = new short[4]; public short[] MaxSkill = new short[4];
@@ -106,7 +106,7 @@ namespace Game.DataStorage
public ushort[] Explored = new ushort[2]; public ushort[] Explored = new ushort[2];
public uint[] Time = new uint[2]; public uint[] Time = new uint[2];
public uint[] AuraSpellID = new uint[4]; public uint[] AuraSpellID = new uint[4];
public byte[] AuraCount = new byte[4]; public byte[] AuraStacks = new byte[4];
public ushort[] Achievement = new ushort[4]; public ushort[] Achievement = new ushort[4];
public byte[] LfgStatus = new byte[4]; public byte[] LfgStatus = new byte[4];
public byte[] LfgCompare = new byte[4]; public byte[] LfgCompare = new byte[4];
@@ -122,7 +122,7 @@ namespace Game.DataStorage
{ {
public uint Id; public uint Id;
public uint GlobalStringBaseTag; public uint GlobalStringBaseTag;
public byte PowerType; public byte ActualType;
public byte Red; public byte Red;
public byte Green; public byte Green;
public byte Blue; public byte Blue;
@@ -131,25 +131,25 @@ namespace Game.DataStorage
public sealed class PowerTypeRecord public sealed class PowerTypeRecord
{ {
public uint Id; public uint Id;
public string PowerTypeToken; public string NameGlobalStringTag;
public string PowerCostToken; public string CostGlobalStringTag;
public float RegenerationPeace; public float RegenPeace;
public float RegenerationCombat; public float RegenCombat;
public short MaxPower; public short MaxBasePower;
public ushort RegenerationDelay; public ushort RegenInterruptTimeMS;
public ushort Flags; public ushort Flags;
public PowerType PowerTypeEnum; public PowerType PowerTypeEnum;
public sbyte RegenerationMin; public sbyte MinPower;
public sbyte RegenerationCenter; public sbyte CenterPower;
public sbyte RegenerationMax; public sbyte DefaultPower;
public byte UIModifier; public sbyte DisplayModifier;
} }
public sealed class PrestigeLevelInfoRecord public sealed class PrestigeLevelInfoRecord
{ {
public uint Id; public uint Id;
public string PrestigeText; public string Name;
public uint IconID; public uint BadgeTextureFileDataID;
public byte PrestigeLevel; public byte PrestigeLevel;
public PrestigeLevelInfoFlags Flags; public PrestigeLevelInfoFlags Flags;
@@ -159,27 +159,27 @@ namespace Game.DataStorage
public sealed class PvpDifficultyRecord public sealed class PvpDifficultyRecord
{ {
public uint Id; public uint Id;
public byte BracketID; public byte RangeIndex;
public byte MinLevel; public byte MinLevel;
public byte MaxLevel; public byte MaxLevel;
public uint MapID; public uint MapID;
// helpers // helpers
public BattlegroundBracketId GetBracketId() { return (BattlegroundBracketId)BracketID; } public BattlegroundBracketId GetBracketId() { return (BattlegroundBracketId)RangeIndex; }
} }
public sealed class PvpItemRecord public sealed class PvpItemRecord
{ {
public uint Id; public uint Id;
public uint ItemID; public uint ItemID;
public byte ItemLevelBonus; public byte ItemLevelDelta;
} }
public sealed class PvpRewardRecord public sealed class PvpRewardRecord
{ {
public uint Id; public uint Id;
public byte HonorLevel; public byte HonorLevel;
public byte Prestige; public byte PrestigeLevel;
public ushort RewardPackID; public ushort RewardPackID;
} }
@@ -189,7 +189,7 @@ namespace Game.DataStorage
public LocalizedString Description; public LocalizedString Description;
public uint SpellID; public uint SpellID;
public uint OverridesSpellID; public uint OverridesSpellID;
public int ExtraSpellID; public int ActionBarSpellID;
public int TierID; public int TierID;
public byte ColumnIndex; public byte ColumnIndex;
public byte Flags; public byte Flags;
+7 -7
View File
@@ -22,29 +22,29 @@ namespace Game.DataStorage
public sealed class QuestFactionRewardRecord public sealed class QuestFactionRewardRecord
{ {
public uint Id; public uint Id;
public short[] QuestRewFactionValue = new short[10]; public short[] Difficulty = new short[10];
} }
public sealed class QuestMoneyRewardRecord public sealed class QuestMoneyRewardRecord
{ {
public uint Id; public uint Id;
public uint[] Money = new uint[10]; public uint[] Difficulty = new uint[10];
} }
public sealed class QuestPackageItemRecord public sealed class QuestPackageItemRecord
{ {
public uint Id; public uint Id;
public uint ItemID; public uint ItemID;
public ushort QuestPackageID; public ushort PackageID;
public QuestPackageFilter FilterType; public QuestPackageFilter DisplayType;
public byte ItemCount; public byte ItemQuantity;
} }
public sealed class QuestSortRecord public sealed class QuestSortRecord
{ {
public uint Id; public uint Id;
public LocalizedString SortName; public LocalizedString SortName;
public byte SortOrder; public byte UiOrderIndex;
} }
public sealed class QuestV2Record public sealed class QuestV2Record
@@ -56,6 +56,6 @@ namespace Game.DataStorage
public sealed class QuestXPRecord public sealed class QuestXPRecord
{ {
public uint Id; public uint Id;
public ushort[] Exp = new ushort[10]; public ushort[] Difficulty = new ushort[10];
} }
} }
+7 -7
View File
@@ -20,9 +20,9 @@ namespace Game.DataStorage
public sealed class RandPropPointsRecord public sealed class RandPropPointsRecord
{ {
public uint Id; public uint Id;
public uint[] EpicPropertiesPoints = new uint[5]; public uint[] Epic = new uint[5];
public uint[] RarePropertiesPoints = new uint[5]; public uint[] Superior = new uint[5];
public uint[] UncommonPropertiesPoints = new uint[5]; public uint[] Good = new uint[5];
} }
public sealed class RewardPackRecord public sealed class RewardPackRecord
@@ -31,16 +31,16 @@ namespace Game.DataStorage
public uint Money; public uint Money;
public float ArtifactXPMultiplier; public float ArtifactXPMultiplier;
public byte ArtifactXPDifficulty; public byte ArtifactXPDifficulty;
public byte ArtifactCategoryID; public byte ArtifactXPCategoryID;
public ushort TitleID; public ushort CharTitleID;
public ushort Unused; public ushort TreasurePickerID;
} }
public sealed class RewardPackXItemRecord public sealed class RewardPackXItemRecord
{ {
public uint Id; public uint Id;
public uint ItemID; public uint ItemID;
public uint Amount; public uint ItemQuantity;
public uint RewardPackID; public uint RewardPackID;
} }
+60 -77
View File
@@ -32,7 +32,7 @@ namespace Game.DataStorage
public sealed class ScalingStatDistributionRecord public sealed class ScalingStatDistributionRecord
{ {
public uint Id; public uint Id;
public ushort ItemLevelCurveID; public ushort PlayerLevelToItemLevelCurveID;
public byte MinLevel; public byte MinLevel;
public uint MaxLevel; public uint MaxLevel;
} }
@@ -41,7 +41,7 @@ namespace Game.DataStorage
{ {
public uint Id; public uint Id;
public LocalizedString Name; public LocalizedString Name;
public ushort Data; // Seems to indicate different things, for zone invasions, this is the area id public ushort AreaTableID;
public byte Flags; public byte Flags;
public byte Type; public byte Type;
} }
@@ -50,14 +50,14 @@ namespace Game.DataStorage
{ {
public uint Id; public uint Id;
public LocalizedString Description; public LocalizedString Description;
public LocalizedString Name; public LocalizedString Title;
public ushort ScenarioID; public ushort ScenarioID;
public ushort PreviousStepID; // Used in conjunction with Proving Grounds scenarios, when sequencing steps (Not using step order?) public ushort Supersedes; // Used in conjunction with Proving Grounds scenarios, when sequencing steps (Not using step order?)
public ushort QuestRewardID; public ushort RewardQuestID;
public byte Step; public byte OrderIndex;
public ScenarioStepFlags Flags; public ScenarioStepFlags Flags;
public ushort CriteriaTreeID; public ushort CriteriaTreeId;
public byte BonusRequiredStepID; // Bonus step can only be completed if scenario is in the step specified in this field public byte RelatedStep; // Bonus step can only be completed if scenario is in the step specified in this field
// helpers // helpers
public bool IsBonusObjective() public bool IsBonusObjective()
@@ -69,8 +69,8 @@ namespace Game.DataStorage
public sealed class SceneScriptRecord public sealed class SceneScriptRecord
{ {
public uint Id; public uint Id;
public ushort PrevScriptId; public ushort FirstSceneScriptID;
public ushort NextScriptId; public ushort NextSceneScriptID;
} }
public sealed class SceneScriptGlobalTextRecord public sealed class SceneScriptGlobalTextRecord
@@ -102,15 +102,15 @@ namespace Game.DataStorage
public ushort Flags; public ushort Flags;
public SkillCategory CategoryID; public SkillCategory CategoryID;
public byte CanLink; public byte CanLink;
public uint IconFileDataID; public uint SpellIconFileID;
public byte ParentSkillLineID; public byte ParentSkillLineID;
} }
public sealed class SkillLineAbilityRecord public sealed class SkillLineAbilityRecord
{ {
public ulong RaceMask; public long RaceMask;
public uint Id; public uint Id;
public uint SpellID; public uint Spell;
public uint SupercedesSpell; public uint SupercedesSpell;
public ushort SkillLine; public ushort SkillLine;
public ushort TrivialSkillLineRankHigh; public ushort TrivialSkillLineRankHigh;
@@ -153,7 +153,7 @@ namespace Game.DataStorage
public float PitchVariationMinus; public float PitchVariationMinus;
public float PitchAdjust; public float PitchAdjust;
public ushort BusOverwriteID; public ushort BusOverwriteID;
public byte Unk700; public byte MaxInstances;
} }
public sealed class SpecializationSpellsRecord public sealed class SpecializationSpellsRecord
@@ -162,7 +162,7 @@ namespace Game.DataStorage
public uint SpellID; public uint SpellID;
public uint OverridesSpellID; public uint OverridesSpellID;
public ushort SpecID; public ushort SpecID;
public byte OrderIndex; public byte DisplayOrder;
public uint Id; public uint Id;
} }
@@ -206,9 +206,9 @@ namespace Game.DataStorage
public sealed class SpellCastTimesRecord public sealed class SpellCastTimesRecord
{ {
public uint Id; public uint Id;
public int CastTime; public int Base;
public int MinCastTime; public int Minimum;
public short CastTimePerLevel; public short PerLevel;
} }
public sealed class SpellCastingRequirementsRecord public sealed class SpellCastingRequirementsRecord
@@ -245,7 +245,7 @@ namespace Game.DataStorage
public SpellCategoryFlags Flags; public SpellCategoryFlags Flags;
public byte UsesPerWeek; public byte UsesPerWeek;
public byte MaxCharges; public byte MaxCharges;
public byte ChargeCategoryType; public byte TypeMask;
} }
public sealed class SpellClassOptionsRecord public sealed class SpellClassOptionsRecord
@@ -297,16 +297,14 @@ namespace Game.DataStorage
public float EffectPosFacing; public float EffectPosFacing;
public uint EffectAttributes; public uint EffectAttributes;
public float BonusCoefficientFromAP; public float BonusCoefficientFromAP;
public float PvPMultiplier; public float PvpMultiplier;
public float Coefficient; public float Coefficient;
public float Variance; public float Variance;
public float ResourceCoefficient; public float ResourceCoefficient;
public float GroupSizeCoefficient; public float GroupSizeBasePointsCoefficient;
public FlagArray128 EffectSpellClassMask; public FlagArray128 EffectSpellClassMask;
public int EffectMiscValue; public int[] EffectMiscValue = new int[2];
public int EffectMiscValueB; public uint[] EffectRadiusIndex = new uint[2];
public uint EffectRadiusIndex;
public uint EffectRadiusMaxIndex;
public uint[] ImplicitTarget = new uint[2]; public uint[] ImplicitTarget = new uint[2];
public uint SpellID; public uint SpellID;
} }
@@ -315,8 +313,8 @@ namespace Game.DataStorage
{ {
public uint Id; public uint Id;
public uint SpellID; public uint SpellID;
public int EquippedItemInventoryTypeMask; public int EquippedItemInvTypes;
public int EquippedItemSubClassMask; public int EquippedItemSubclass;
public sbyte EquippedItemClass; public sbyte EquippedItemClass;
} }
@@ -340,10 +338,10 @@ namespace Game.DataStorage
{ {
public uint Id; public uint Id;
public string Name; public string Name;
public uint[] EffectSpellID = new uint[ItemConst.MaxItemEnchantmentEffects]; public uint[] EffectArg = new uint[ItemConst.MaxItemEnchantmentEffects];
public float[] EffectScalingPoints = new float[ItemConst.MaxItemEnchantmentEffects]; public float[] EffectScalingPoints = new float[ItemConst.MaxItemEnchantmentEffects];
public uint TransmogCost; public uint TransmogCost;
public uint TextureFileDataID; public uint IconFileDataID;
public ushort[] EffectPointsMin = new ushort[ItemConst.MaxItemEnchantmentEffects]; public ushort[] EffectPointsMin = new ushort[ItemConst.MaxItemEnchantmentEffects];
public ushort ItemVisual; public ushort ItemVisual;
public EnchantmentSlotMask Flags; public EnchantmentSlotMask Flags;
@@ -357,25 +355,25 @@ namespace Game.DataStorage
public byte MaxLevel; public byte MaxLevel;
public sbyte ScalingClass; public sbyte ScalingClass;
public sbyte ScalingClassRestricted; public sbyte ScalingClassRestricted;
public ushort PlayerConditionID; public ushort TransmogPlayerConditionID;
} }
public sealed class SpellItemEnchantmentConditionRecord public sealed class SpellItemEnchantmentConditionRecord
{ {
public uint Id; public uint Id;
public uint[] LTOperand = new uint[5]; public uint[] LtOperand = new uint[5];
public byte[] LTOperandType = new byte[5]; public byte[] LtOperandType = new byte[5];
public byte[] Operator = new byte[5]; public byte[] Operator = new byte[5];
public byte[] RTOperandType = new byte[5]; public byte[] RtOperandType = new byte[5];
public byte[] RTOperand = new byte[5]; public byte[] RtOperand = new byte[5];
public byte[] Logic = new byte[5]; public byte[] Logic = new byte[5];
} }
public sealed class SpellLearnSpellRecord public sealed class SpellLearnSpellRecord
{ {
public uint Id; public uint Id;
public uint LearnSpellID;
public uint SpellID; public uint SpellID;
public uint LearnSpellID;
public uint OverridesSpellID; public uint OverridesSpellID;
} }
@@ -386,7 +384,7 @@ namespace Game.DataStorage
public ushort MaxLevel; public ushort MaxLevel;
public ushort SpellLevel; public ushort SpellLevel;
public byte DifficultyID; public byte DifficultyID;
public byte MaxUsableLevel; public byte MaxPassiveAuraLevel;
public uint SpellID; public uint SpellID;
} }
@@ -397,51 +395,38 @@ namespace Game.DataStorage
public ushort DurationIndex; public ushort DurationIndex;
public ushort RangeIndex; public ushort RangeIndex;
public byte SchoolMask; public byte SchoolMask;
public uint IconFileDataID; public uint SpellIconFileDataID;
public float Speed; public float Speed;
public uint ActiveIconFileDataID; public uint ActiveIconFileDataID;
public float MultistrikeSpeedMod; public float LaunchDelay;
public byte DifficultyID; public byte DifficultyID;
public uint Attributes; public uint[] Attributes = new uint[14];
public uint AttributesEx;
public uint AttributesExB;
public uint AttributesExC;
public uint AttributesExD;
public uint AttributesExE;
public uint AttributesExF;
public uint AttributesExG;
public uint AttributesExH;
public uint AttributesExI;
public uint AttributesExJ;
public uint AttributesExK;
public uint AttributesExL;
public uint AttributesExM;
public uint SpellID; public uint SpellID;
} }
public sealed class SpellPowerRecord public sealed class SpellPowerRecord
{ {
public int ManaCost; public int ManaCost;
public float ManaCostPercentage; public float PowerCostPct;
public float ManaCostPercentagePerSecond; public float PowerPctPerSecond;
public uint RequiredAura; public uint RequiredAuraSpellID;
public float HealthCostPercentage; public float PowerCostMaxPct;
public byte PowerIndex; public byte OrderIndex;
public PowerType PowerType; public PowerType PowerType;
public uint Id; public uint Id;
public byte ManaCostPerLevel; public byte ManaCostPerLevel;
public ushort ManaCostPerSecond; public ushort ManaPerSecond;
public int ManaCostAdditional; // Spell uses [ManaCost, ManaCost+ManaCostAdditional] power - affects tooltip parsing as multiplier on SpellEffectEntry::EffectPointsPerResource public int OptionalCost; // Spell uses [ManaCost, ManaCost+ManaCostAdditional] power - affects tooltip parsing as multiplier on SpellEffectEntry::EffectPointsPerResource
// only SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL, SPELL_EFFECT_WEAPON_PERCENT_DAMAGE, SPELL_EFFECT_WEAPON_DAMAGE, SPELL_EFFECT_NORMALIZED_WEAPON_DMG // only SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL, SPELL_EFFECT_WEAPON_PERCENT_DAMAGE, SPELL_EFFECT_WEAPON_DAMAGE, SPELL_EFFECT_NORMALIZED_WEAPON_DMG
public uint PowerDisplayID; public uint PowerDisplayID;
public uint UnitPowerBarID; public uint AltPowerBarID;
public uint SpellID; public uint SpellID;
} }
public sealed class SpellPowerDifficultyRecord public sealed class SpellPowerDifficultyRecord
{ {
public byte DifficultyID; public byte DifficultyID;
public byte PowerIndex; public byte OrderIndex;
public uint Id; public uint Id;
} }
@@ -475,10 +460,8 @@ namespace Game.DataStorage
public uint Id; public uint Id;
public string DisplayName; public string DisplayName;
public string DisplayNameShort; public string DisplayNameShort;
public float MinRangeHostile; public float[] RangeMin = new float[2];
public float MinRangeFriend; public float[] RangeMax = new float[2];
public float MaxRangeHostile;
public float MaxRangeFriend;
public SpellRangeFlag Flags; public SpellRangeFlag Flags;
} }
@@ -495,7 +478,7 @@ namespace Game.DataStorage
public uint Id; public uint Id;
public uint SpellID; public uint SpellID;
public ushort ScalesFromItemLevel; public ushort ScalesFromItemLevel;
public byte ScalingClass; public byte Class;
public byte MinScalingLevel; public byte MinScalingLevel;
public uint MaxScalingLevel; public uint MaxScalingLevel;
} }
@@ -513,13 +496,13 @@ namespace Game.DataStorage
{ {
public uint Id; public uint Id;
public LocalizedString Name; public LocalizedString Name;
public float WeaponDamageVariance; public float DamageVariance;
public SpellShapeshiftFormFlags Flags; public SpellShapeshiftFormFlags Flags;
public ushort CombatRoundTime; public ushort CombatRoundTime;
public ushort MountTypeID; public ushort MountTypeID;
public sbyte CreatureType; public sbyte CreatureType;
public byte BonusActionBar; public byte BonusActionBar;
public uint AttackIconFileDataID; public uint AttackIconFileID;
public ushort[] CreatureDisplayID = new ushort[4]; public ushort[] CreatureDisplayID = new ushort[4];
public ushort[] PresetSpellID = new ushort[SpellConst.MaxShapeshift]; public ushort[] PresetSpellID = new ushort[SpellConst.MaxShapeshift];
} }
@@ -527,12 +510,12 @@ namespace Game.DataStorage
public sealed class SpellTargetRestrictionsRecord public sealed class SpellTargetRestrictionsRecord
{ {
public uint Id; public uint Id;
public float ConeAngle; public float ConeDegrees;
public float Width; public float Width;
public uint Targets; public uint Targets;
public ushort TargetCreatureType; public ushort TargetCreatureType;
public byte DifficultyID; public byte DifficultyID;
public byte MaxAffectedTargets; public byte MaxTargets;
public uint MaxTargetLevel; public uint MaxTargetLevel;
public uint SpellID; public uint SpellID;
} }
@@ -549,13 +532,13 @@ namespace Game.DataStorage
{ {
public uint SpellVisualID; public uint SpellVisualID;
public uint Id; public uint Id;
public float Chance; public float Probability;
public ushort CasterPlayerConditionID; public ushort CasterPlayerConditionID;
public ushort CasterUnitConditionID; public ushort CasterUnitConditionID;
public ushort PlayerConditionID; public ushort ViewerPlayerConditionID;
public ushort UnitConditionID; public ushort ViewerUnitConditionID;
public uint IconFileDataID; public uint SpellIconFileID;
public uint ActiveIconFileDataID; public uint ActiveIconFileID;
public byte Flags; public byte Flags;
public byte DifficultyID; public byte DifficultyID;
public byte Priority; public byte Priority;
@@ -566,9 +549,9 @@ namespace Game.DataStorage
{ {
public uint Id; public uint Id;
public uint Flags; public uint Flags;
public SummonCategory Category; public SummonCategory Control;
public ushort Faction; public ushort Faction;
public SummonType Type; public SummonType Title;
public byte Slot; public byte Slot;
} }
} }
+18 -21
View File
@@ -47,20 +47,20 @@ namespace Game.DataStorage
public Vector3 Pos; public Vector3 Pos;
public uint[] MountCreatureID = new uint[2]; public uint[] MountCreatureID = new uint[2];
public Vector2 MapOffset; public Vector2 MapOffset;
public float Unk730; public float Facing;
public Vector2 FlightMapOffset; public Vector2 FlightMapOffset;
public ushort MapID; public ushort ContinentID;
public ushort ConditionID; public ushort ConditionID;
public ushort LearnableIndex; public ushort CharacterBitNumber;
public TaxiNodeFlags Flags; public TaxiNodeFlags Flags;
public int UiTextureKitPrefixID; public int UiTextureKitID;
public uint SpecialAtlasIconPlayerConditionID; public uint SpecialIconConditionID;
} }
public sealed class TaxiPathRecord public sealed class TaxiPathRecord
{ {
public ushort From; public ushort FromTaxiNode;
public ushort To; public ushort ToTaxiNode;
public uint Id; public uint Id;
public uint Cost; public uint Cost;
} }
@@ -69,7 +69,7 @@ namespace Game.DataStorage
{ {
public Vector3 Loc; public Vector3 Loc;
public ushort PathID; public ushort PathID;
public ushort MapID; public ushort ContinentID;
public byte NodeIndex; public byte NodeIndex;
public uint Id; public uint Id;
public TaxiPathNodeFlags Flags; public TaxiPathNodeFlags Flags;
@@ -82,34 +82,34 @@ namespace Game.DataStorage
{ {
public uint Id; public uint Id;
public LocalizedString Name; public LocalizedString Name;
public uint CategoryMask; public uint TotemCategoryMask;
public byte CategoryType; public byte TotemCategoryType;
} }
public sealed class ToyRecord public sealed class ToyRecord
{ {
public LocalizedString Description; public LocalizedString SourceText;
public uint ItemID; public uint ItemID;
public byte Flags; public byte Flags;
public byte CategoryFilter; public byte SourceTypeEnum;
public uint Id; public uint Id;
} }
public sealed class TransmogHolidayRecord public sealed class TransmogHolidayRecord
{ {
public uint Id; public uint Id;
public int HolidayID; public int RequiredTransmogHoliday;
} }
public sealed class TransmogSetRecord public sealed class TransmogSetRecord
{ {
public LocalizedString Name; public LocalizedString Name;
public ushort BaseSetID; public ushort ParentTransmogSetID;
public ushort UIOrder; public ushort UIOrder;
public byte ExpansionID; public byte ExpansionID;
public uint Id; public uint Id;
public byte Flags; public byte Flags;
public int QuestID; public int TrackingQuestID;
public int ClassMask; public int ClassMask;
public int ItemNameDescriptionID; public int ItemNameDescriptionID;
public byte TransmogSetGroupID; public byte TransmogSetGroupID;
@@ -117,7 +117,7 @@ namespace Game.DataStorage
public sealed class TransmogSetGroupRecord public sealed class TransmogSetGroupRecord
{ {
public LocalizedString Label; public LocalizedString Name;
public uint Id; public uint Id;
} }
@@ -142,10 +142,7 @@ namespace Game.DataStorage
{ {
public uint Id; public uint Id;
public uint TimeIndex; public uint TimeIndex;
public float X; public float[] Rot = new float[4];
public float Y; public uint GameObjectsID;
public float Z;
public float W;
public uint TransportID;
} }
} }
+12 -10
View File
@@ -40,14 +40,16 @@ namespace Game.DataStorage
public ushort VehicleUIIndicatorID; public ushort VehicleUIIndicatorID;
public ushort[] PowerDisplayID = new ushort[3]; public ushort[] PowerDisplayID = new ushort[3];
public byte FlagsB; public byte FlagsB;
public byte UILocomotionType; public byte UiLocomotionType;
public ushort MissileTargetingID; public ushort MissileTargetingID;
} }
public sealed class VehicleSeatRecord public sealed class VehicleSeatRecord
{ {
public uint Id; public uint Id;
public uint[] Flags = new uint[3]; public VehicleSeatFlags Flags;
public VehicleSeatFlagsB FlagsB;
public uint FlagsC;
public Vector3 AttachmentOffset; public Vector3 AttachmentOffset;
public float EnterPreDelay; public float EnterPreDelay;
public float EnterSpeed; public float EnterSpeed;
@@ -78,7 +80,7 @@ namespace Game.DataStorage
public float CameraEnteringZoom; public float CameraEnteringZoom;
public float CameraSeatZoomMin; public float CameraSeatZoomMin;
public float CameraSeatZoomMax; public float CameraSeatZoomMax;
public uint UISkinFileDataID; public uint UiSkinFileDataID;
public short EnterAnimStart; public short EnterAnimStart;
public short EnterAnimLoop; public short EnterAnimLoop;
public short RideAnimStart; public short RideAnimStart;
@@ -110,17 +112,17 @@ namespace Game.DataStorage
public bool CanEnterOrExit() public bool CanEnterOrExit()
{ {
return (Flags[0].HasAnyFlag((uint)VehicleSeatFlags.CanEnterOrExit) || return (Flags.HasAnyFlag(VehicleSeatFlags.CanEnterOrExit) ||
//If it has anmation for enter/ride, means it can be entered/exited by logic //If it has anmation for enter/ride, means it can be entered/exited by logic
Flags[0].HasAnyFlag((uint)VehicleSeatFlags.HasLowerAnimForEnter | (uint)VehicleSeatFlags.HasLowerAnimForRide)); Flags.HasAnyFlag(VehicleSeatFlags.HasLowerAnimForEnter | VehicleSeatFlags.HasLowerAnimForRide));
} }
public bool CanSwitchFromSeat() { return Flags[0].HasAnyFlag((uint)VehicleSeatFlags.CanSwitch); } public bool CanSwitchFromSeat() { return Flags.HasAnyFlag(VehicleSeatFlags.CanSwitch); }
public bool IsUsableByOverride() public bool IsUsableByOverride()
{ {
return Flags[0].HasAnyFlag((uint)VehicleSeatFlags.Uncontrolled | (uint)VehicleSeatFlags.Unk18) return Flags.HasAnyFlag(VehicleSeatFlags.Uncontrolled | VehicleSeatFlags.Unk18)
|| Flags[1].HasAnyFlag((uint)VehicleSeatFlagsB.UsableForced | (uint)VehicleSeatFlagsB.UsableForced2 | || FlagsB.HasAnyFlag(VehicleSeatFlagsB.UsableForced | VehicleSeatFlagsB.UsableForced2 |
(uint)VehicleSeatFlagsB.UsableForced3 | (uint)VehicleSeatFlagsB.UsableForced4); VehicleSeatFlagsB.UsableForced3 | VehicleSeatFlagsB.UsableForced4);
} }
public bool IsEjectable() { return Flags[1].HasAnyFlag((uint)VehicleSeatFlagsB.Ejectable); } public bool IsEjectable() { return FlagsB.HasAnyFlag(VehicleSeatFlagsB.Ejectable); }
} }
} }
+8 -8
View File
@@ -23,20 +23,20 @@ namespace Game.DataStorage
public sealed class WMOAreaTableRecord public sealed class WMOAreaTableRecord
{ {
public string AreaName; public string AreaName;
public int WMOGroupID; // used in group WMO public int WmoGroupID; // used in group WMO
public ushort AmbienceID; public ushort AmbienceID;
public ushort ZoneMusic; public ushort ZoneMusic;
public ushort IntroSound; public ushort IntroSound;
public ushort AreaTableID; public ushort AreaTableID;
public ushort UWIntroSound; public ushort UwIntroSound;
public ushort UWAmbience; public ushort UwAmbience;
public sbyte NameSet; // used in adt file public sbyte NameSetID; // used in adt file
public byte SoundProviderPref; public byte SoundProviderPref;
public byte SoundProviderPrefUnderwater; public byte SoundProviderPrefUnderwater;
public byte Flags; public byte Flags;
public uint Id; public uint Id;
public byte UWZoneMusic; public byte UwZoneMusic;
public uint WMOID; // used in root WMO public uint WmoID; // used in root WMO
} }
public sealed class WorldEffectRecord public sealed class WorldEffectRecord
@@ -66,9 +66,9 @@ namespace Game.DataStorage
public byte LevelRangeMin; public byte LevelRangeMin;
public byte LevelRangeMax; public byte LevelRangeMax;
public byte BountySetID; public byte BountySetID;
public byte BountyBoardLocation; public byte BountyDisplayLocation;
public uint Id; public uint Id;
public uint PlayerConditionID; public uint VisibilityPlayerConditionID;
} }
public sealed class WorldMapOverlayRecord public sealed class WorldMapOverlayRecord
+3 -3
View File
@@ -177,7 +177,7 @@ namespace Game.DungeonFinding
// Initialize Dungeon map with data from dbcs // Initialize Dungeon map with data from dbcs
foreach (var dungeon in CliDB.LFGDungeonsStorage.Values) foreach (var dungeon in CliDB.LFGDungeonsStorage.Values)
{ {
switch (dungeon.Type) switch (dungeon.TypeID)
{ {
case LfgType.Dungeon: case LfgType.Dungeon:
case LfgType.Raid: case LfgType.Raid:
@@ -2151,8 +2151,8 @@ namespace Game.DungeonFinding
id = dbc.Id; id = dbc.Id;
name = dbc.Name[Global.WorldMgr.GetDefaultDbcLocale()]; name = dbc.Name[Global.WorldMgr.GetDefaultDbcLocale()];
map = (uint)dbc.MapID; map = (uint)dbc.MapID;
type = dbc.Type; type = dbc.TypeID;
expansion = dbc.Expansion; expansion = dbc.ExpansionLevel;
group = dbc.GroupID; group = dbc.GroupID;
minlevel = dbc.MinLevel; minlevel = dbc.MinLevel;
maxlevel = dbc.MaxLevel; maxlevel = dbc.MaxLevel;
@@ -2164,8 +2164,8 @@ namespace Game.Entities
uint modelId = m_goInfo.displayId; uint modelId = m_goInfo.displayId;
DestructibleModelDataRecord modelData = CliDB.DestructibleModelDataStorage.LookupByKey(m_goInfo.DestructibleBuilding.DestructibleModelRec); DestructibleModelDataRecord modelData = CliDB.DestructibleModelDataStorage.LookupByKey(m_goInfo.DestructibleBuilding.DestructibleModelRec);
if (modelData != null) if (modelData != null)
if (modelData.StateDamagedDisplayID != 0) if (modelData.State0Wmo != 0)
modelId = modelData.StateDamagedDisplayID; modelId = modelData.State0Wmo;
SetDisplayId(modelId); SetDisplayId(modelId);
if (setHealth) if (setHealth)
@@ -2196,8 +2196,8 @@ namespace Game.Entities
uint modelId = m_goInfo.displayId; uint modelId = m_goInfo.displayId;
DestructibleModelDataRecord modelData = CliDB.DestructibleModelDataStorage.LookupByKey(m_goInfo.DestructibleBuilding.DestructibleModelRec); DestructibleModelDataRecord modelData = CliDB.DestructibleModelDataStorage.LookupByKey(m_goInfo.DestructibleBuilding.DestructibleModelRec);
if (modelData != null) if (modelData != null)
if (modelData.StateDestroyedDisplayID != 0) if (modelData.State1Wmo != 0)
modelId = modelData.StateDestroyedDisplayID; modelId = modelData.State1Wmo;
SetDisplayId(modelId); SetDisplayId(modelId);
if (setHealth) if (setHealth)
@@ -2216,8 +2216,8 @@ namespace Game.Entities
uint modelId = m_goInfo.displayId; uint modelId = m_goInfo.displayId;
DestructibleModelDataRecord modelData = CliDB.DestructibleModelDataStorage.LookupByKey(m_goInfo.DestructibleBuilding.DestructibleModelRec); DestructibleModelDataRecord modelData = CliDB.DestructibleModelDataStorage.LookupByKey(m_goInfo.DestructibleBuilding.DestructibleModelRec);
if (modelData != null) if (modelData != null)
if (modelData.StateRebuildingDisplayID != 0) if (modelData.State2Wmo != 0)
modelId = modelData.StateRebuildingDisplayID; modelId = modelData.State2Wmo;
SetDisplayId(modelId); SetDisplayId(modelId);
// restores to full health // restores to full health
+41 -41
View File
@@ -103,13 +103,13 @@ namespace Game.Entities
if (itemProto.GetArtifactID() != artifactAppearanceSet.ArtifactID) if (itemProto.GetArtifactID() != artifactAppearanceSet.ArtifactID)
continue; continue;
PlayerConditionRecord playerCondition = CliDB.PlayerConditionStorage.LookupByKey(artifactAppearance.PlayerConditionID); PlayerConditionRecord playerCondition = CliDB.PlayerConditionStorage.LookupByKey(artifactAppearance.UnlockPlayerConditionID);
if (playerCondition != null) if (playerCondition != null)
if (!owner || !ConditionManager.IsPlayerMeetingCondition(owner, playerCondition)) if (!owner || !ConditionManager.IsPlayerMeetingCondition(owner, playerCondition))
continue; continue;
SetModifier(ItemModifier.ArtifactAppearanceId, artifactAppearance.Id); SetModifier(ItemModifier.ArtifactAppearanceId, artifactAppearance.Id);
SetAppearanceModId(artifactAppearance.AppearanceModID); SetAppearanceModId(artifactAppearance.ItemAppearanceModifierID);
break; break;
} }
} }
@@ -546,7 +546,7 @@ namespace Game.Entities
SetModifier(ItemModifier.ArtifactAppearanceId, artifactAppearanceId); SetModifier(ItemModifier.ArtifactAppearanceId, artifactAppearanceId);
ArtifactAppearanceRecord artifactAppearance = CliDB.ArtifactAppearanceStorage.LookupByKey(artifactAppearanceId); ArtifactAppearanceRecord artifactAppearance = CliDB.ArtifactAppearanceStorage.LookupByKey(artifactAppearanceId);
if (artifactAppearance != null) if (artifactAppearance != null)
SetAppearanceModId(artifactAppearance.AppearanceModID); SetAppearanceModId(artifactAppearance.ItemAppearanceModifierID);
byte totalPurchasedRanks = 0; byte totalPurchasedRanks = 0;
foreach (ItemDynamicFieldArtifactPowers power in powers) foreach (ItemDynamicFieldArtifactPowers power in powers)
@@ -565,22 +565,22 @@ namespace Game.Entities
switch (enchant.Effect[i]) switch (enchant.Effect[i])
{ {
case ItemEnchantmentType.ArtifactPowerBonusRankByType: case ItemEnchantmentType.ArtifactPowerBonusRankByType:
if (artifactPower.RelicType == enchant.EffectSpellID[i]) if (artifactPower.Label == enchant.EffectArg[i])
power.CurrentRankWithBonus += (byte)enchant.EffectPointsMin[i]; power.CurrentRankWithBonus += (byte)enchant.EffectPointsMin[i];
break; break;
case ItemEnchantmentType.ArtifactPowerBonusRankByID: case ItemEnchantmentType.ArtifactPowerBonusRankByID:
if (artifactPower.Id == enchant.EffectSpellID[i]) if (artifactPower.Id == enchant.EffectArg[i])
power.CurrentRankWithBonus += (byte)enchant.EffectPointsMin[i]; power.CurrentRankWithBonus += (byte)enchant.EffectPointsMin[i];
break; break;
case ItemEnchantmentType.ArtifactPowerBonusRankPicker: case ItemEnchantmentType.ArtifactPowerBonusRankPicker:
if (_bonusData.GemRelicType[e - EnchantmentSlot.Sock1] != -1) if (_bonusData.GemRelicType[e - EnchantmentSlot.Sock1] != -1)
{ {
ArtifactPowerPickerRecord artifactPowerPicker = CliDB.ArtifactPowerPickerStorage.LookupByKey(enchant.EffectSpellID[i]); ArtifactPowerPickerRecord artifactPowerPicker = CliDB.ArtifactPowerPickerStorage.LookupByKey(enchant.EffectArg[i]);
if (artifactPowerPicker != null) if (artifactPowerPicker != null)
{ {
PlayerConditionRecord playerCondition = CliDB.PlayerConditionStorage.LookupByKey(artifactPowerPicker.PlayerConditionID); PlayerConditionRecord playerCondition = CliDB.PlayerConditionStorage.LookupByKey(artifactPowerPicker.PlayerConditionID);
if (playerCondition == null || ConditionManager.IsPlayerMeetingCondition(owner, playerCondition)) if (playerCondition == null || ConditionManager.IsPlayerMeetingCondition(owner, playerCondition))
if (artifactPower.RelicType == _bonusData.GemRelicType[e - EnchantmentSlot.Sock1]) if (artifactPower.Label == _bonusData.GemRelicType[e - EnchantmentSlot.Sock1])
power.CurrentRankWithBonus += (byte)enchant.EffectPointsMin[i]; power.CurrentRankWithBonus += (byte)enchant.EffectPointsMin[i];
} }
} }
@@ -1010,7 +1010,7 @@ namespace Game.Entities
GemPropertiesRecord gemProperties = CliDB.GemPropertiesStorage.LookupByKey(gemTemplate.GetGemProperties()); GemPropertiesRecord gemProperties = CliDB.GemPropertiesStorage.LookupByKey(gemTemplate.GetGemProperties());
if (gemProperties != null) if (gemProperties != null)
{ {
SpellItemEnchantmentRecord gemEnchant = CliDB.SpellItemEnchantmentStorage.LookupByKey(gemProperties.EnchantID); SpellItemEnchantmentRecord gemEnchant = CliDB.SpellItemEnchantmentStorage.LookupByKey(gemProperties.EnchantId);
if (gemEnchant != null) if (gemEnchant != null)
{ {
BonusData gemBonus = new BonusData(gemTemplate); BonusData gemBonus = new BonusData(gemTemplate);
@@ -1029,7 +1029,7 @@ namespace Game.Entities
ScalingStatDistributionRecord ssd = CliDB.ScalingStatDistributionStorage.LookupByKey(gemBonus.ScalingStatDistribution); ScalingStatDistributionRecord ssd = CliDB.ScalingStatDistributionStorage.LookupByKey(gemBonus.ScalingStatDistribution);
if (ssd != null) if (ssd != null)
{ {
uint scaledIlvl = (uint)Global.DB2Mgr.GetCurveValueAt(ssd.ItemLevelCurveID, gemScalingLevel); uint scaledIlvl = (uint)Global.DB2Mgr.GetCurveValueAt(ssd.PlayerLevelToItemLevelCurveID, gemScalingLevel);
if (scaledIlvl != 0) if (scaledIlvl != 0)
gemBaseItemLevel = scaledIlvl; gemBaseItemLevel = scaledIlvl;
} }
@@ -1042,7 +1042,7 @@ namespace Game.Entities
{ {
case ItemEnchantmentType.BonusListID: case ItemEnchantmentType.BonusListID:
{ {
var bonusesEffect = Global.DB2Mgr.GetItemBonusList(gemEnchant.EffectSpellID[i]); var bonusesEffect = Global.DB2Mgr.GetItemBonusList(gemEnchant.EffectArg[i]);
if (bonusesEffect != null) if (bonusesEffect != null)
{ {
foreach (ItemBonusRecord itemBonus in bonusesEffect) foreach (ItemBonusRecord itemBonus in bonusesEffect)
@@ -1600,7 +1600,7 @@ namespace Game.Entities
if (basePrice == null) if (basePrice == null)
return 0; return 0;
float qualityFactor = qualityPrice.Factor; float qualityFactor = qualityPrice.Data;
float baseFactor = 0.0f; float baseFactor = 0.0f;
var inventoryType = proto.GetInventoryType(); var inventoryType = proto.GetInventoryType();
@@ -1612,9 +1612,9 @@ namespace Game.Entities
inventoryType == InventoryType.Ranged || inventoryType == InventoryType.Ranged ||
inventoryType == InventoryType.Thrown || inventoryType == InventoryType.Thrown ||
inventoryType == InventoryType.RangedRight) inventoryType == InventoryType.RangedRight)
baseFactor = basePrice.WeaponFactor; baseFactor = basePrice.Weapon;
else else
baseFactor = basePrice.ArmorFactor; baseFactor = basePrice.Armor;
if (inventoryType == InventoryType.Robe) if (inventoryType == InventoryType.Robe)
inventoryType = InventoryType.Chest; inventoryType = InventoryType.Chest;
@@ -1622,7 +1622,7 @@ namespace Game.Entities
if (proto.GetClass() == ItemClass.Gem && (ItemSubClassGem)proto.GetSubClass() == ItemSubClassGem.ArtifactRelic) if (proto.GetClass() == ItemClass.Gem && (ItemSubClassGem)proto.GetSubClass() == ItemSubClassGem.ArtifactRelic)
{ {
inventoryType = InventoryType.Weapon; inventoryType = InventoryType.Weapon;
baseFactor = basePrice.WeaponFactor / 3.0f; baseFactor = basePrice.Weapon / 3.0f;
} }
@@ -1653,16 +1653,16 @@ namespace Game.Entities
{ {
case ItemSubClassArmor.Miscellaneous: case ItemSubClassArmor.Miscellaneous:
case ItemSubClassArmor.Cloth: case ItemSubClassArmor.Cloth:
typeFactor = armorPrice.ClothFactor; typeFactor = armorPrice.ClothModifier;
break; break;
case ItemSubClassArmor.Leather: case ItemSubClassArmor.Leather:
typeFactor = armorPrice.LeatherFactor; typeFactor = armorPrice.LeatherModifier;
break; break;
case ItemSubClassArmor.Mail: case ItemSubClassArmor.Mail:
typeFactor = armorPrice.MailFactor; typeFactor = armorPrice.ChainModifier;
break; break;
case ItemSubClassArmor.Plate: case ItemSubClassArmor.Plate:
typeFactor = armorPrice.PlateFactor; typeFactor = armorPrice.PlateModifier;
break; break;
default: default:
typeFactor = 1.0f; typeFactor = 1.0f;
@@ -1677,7 +1677,7 @@ namespace Game.Entities
if (shieldPrice == null) if (shieldPrice == null)
return 0; return 0;
typeFactor = shieldPrice.Factor; typeFactor = shieldPrice.Data;
break; break;
} }
case InventoryType.WeaponMainhand: case InventoryType.WeaponMainhand:
@@ -1707,11 +1707,11 @@ namespace Game.Entities
if (weaponPrice == null) if (weaponPrice == null)
return 0; return 0;
typeFactor = weaponPrice.Factor; typeFactor = weaponPrice.Data;
} }
standardPrice = false; standardPrice = false;
return (uint)(proto.GetUnk2() * typeFactor * baseFactor * qualityFactor * proto.GetUnk1()); return (uint)(proto.GetPriceVariance() * typeFactor * baseFactor * qualityFactor * proto.GetPriceRandomValue());
} }
public uint GetSellPrice(Player owner) public uint GetSellPrice(Player owner)
@@ -1733,7 +1733,7 @@ namespace Game.Entities
if (classEntry != null) if (classEntry != null)
{ {
uint buyCount = Math.Max(proto.GetBuyCount(), 1u); uint buyCount = Math.Max(proto.GetBuyCount(), 1u);
return (uint)(cost * classEntry.PriceMod / buyCount); return (uint)(cost * classEntry.PriceModifier / buyCount);
} }
return 0; return 0;
@@ -1764,7 +1764,7 @@ namespace Game.Entities
var enchant = CliDB.SpellItemEnchantmentStorage.LookupByKey(GetEnchantmentId(e)); var enchant = CliDB.SpellItemEnchantmentStorage.LookupByKey(GetEnchantmentId(e));
if (enchant != null) if (enchant != null)
for (uint f = 0; f < ItemConst.MaxItemEnchantmentEffects; ++f) for (uint f = 0; f < ItemConst.MaxItemEnchantmentEffects; ++f)
if (enchant.Effect[f] == ItemEnchantmentType.Stat && (ItemModType)enchant.EffectSpellID[f] == statType) if (enchant.Effect[f] == ItemEnchantmentType.Stat && (ItemModType)enchant.EffectArg[f] == statType)
for (int k = 0; k < 5; ++k) for (int k = 0; k < 5; ++k)
if (randomSuffix.Enchantment[k] == enchant.Id) if (randomSuffix.Enchantment[k] == enchant.Id)
return (int)((randomSuffix.AllocationPct[k] * GetItemSuffixFactor()) / 10000); return (int)((randomSuffix.AllocationPct[k] * GetItemSuffixFactor()) / 10000);
@@ -1781,7 +1781,7 @@ namespace Game.Entities
var enchant = CliDB.SpellItemEnchantmentStorage.LookupByKey(GetEnchantmentId(e)); var enchant = CliDB.SpellItemEnchantmentStorage.LookupByKey(GetEnchantmentId(e));
if (enchant != null) if (enchant != null)
for (uint f = 0; f < ItemConst.MaxItemEnchantmentEffects; ++f) for (uint f = 0; f < ItemConst.MaxItemEnchantmentEffects; ++f)
if (enchant.Effect[f] == ItemEnchantmentType.Stat && (ItemModType)enchant.EffectSpellID[f] == statType) if (enchant.Effect[f] == ItemEnchantmentType.Stat && (ItemModType)enchant.EffectArg[f] == statType)
for (int k = 0; k < ItemConst.MaxItemRandomProperties; ++k) for (int k = 0; k < ItemConst.MaxItemRandomProperties; ++k)
if (randomProp.Enchantment[k] == enchant.Id) if (randomProp.Enchantment[k] == enchant.Id)
return (int)(enchant.EffectPointsMin[k]); return (int)(enchant.EffectPointsMin[k]);
@@ -2003,7 +2003,7 @@ namespace Game.Entities
if ((Convert.ToBoolean(sandbox.Flags & 2) || sandbox.MinLevel != 0 || sandbox.MaxLevel != 0) && !Convert.ToBoolean(sandbox.Flags & 4)) if ((Convert.ToBoolean(sandbox.Flags & 2) || sandbox.MinLevel != 0 || sandbox.MaxLevel != 0) && !Convert.ToBoolean(sandbox.Flags & 4))
level = Math.Min(Math.Max(level, sandbox.MinLevel), sandbox.MaxLevel); level = Math.Min(Math.Max(level, sandbox.MinLevel), sandbox.MaxLevel);
uint heirloomIlvl = (uint)Global.DB2Mgr.GetCurveValueAt(ssd.ItemLevelCurveID, level); uint heirloomIlvl = (uint)Global.DB2Mgr.GetCurveValueAt(ssd.PlayerLevelToItemLevelCurveID, level);
if (heirloomIlvl != 0) if (heirloomIlvl != 0)
itemLevel = heirloomIlvl; itemLevel = heirloomIlvl;
} }
@@ -2016,7 +2016,7 @@ namespace Game.Entities
uint itemLevelBeforeUpgrades = itemLevel; uint itemLevelBeforeUpgrades = itemLevel;
ItemUpgradeRecord upgrade = CliDB.ItemUpgradeStorage.LookupByKey(upgradeId); ItemUpgradeRecord upgrade = CliDB.ItemUpgradeStorage.LookupByKey(upgradeId);
if (upgrade != null) if (upgrade != null)
itemLevel += upgrade.ItemLevelBonus; itemLevel += upgrade.ItemLevelIncrement;
if (pvpBonus) if (pvpBonus)
itemLevel += Global.DB2Mgr.GetPvpItemLevelBonus(itemTemplate.GetId()); itemLevel += Global.DB2Mgr.GetPvpItemLevelBonus(itemTemplate.GetId());
@@ -2072,19 +2072,19 @@ namespace Game.Entities
byte expansion = itemTemplate.GetRequiredExpansion(); byte expansion = itemTemplate.GetRequiredExpansion();
foreach (ItemDisenchantLootRecord disenchant in CliDB.ItemDisenchantLootStorage.Values) foreach (ItemDisenchantLootRecord disenchant in CliDB.ItemDisenchantLootStorage.Values)
{ {
if (disenchant.ItemClass != itemClass) if (disenchant.ClassID != itemClass)
continue; continue;
if (disenchant.ItemSubClass >= 0 && itemSubClass != 0) if (disenchant.Subclass >= 0 && itemSubClass != 0)
continue; continue;
if (disenchant.ItemQuality != quality) if (disenchant.Quality != quality)
continue; continue;
if (disenchant.MinItemLevel > itemLevel || disenchant.MaxItemLevel < itemLevel) if (disenchant.MinLevel > itemLevel || disenchant.MaxLevel < itemLevel)
continue; continue;
if (disenchant.Expansion != -2 && disenchant.Expansion != expansion) if (disenchant.ExpansionID != -2 && disenchant.ExpansionID != expansion)
continue; continue;
return disenchant; return disenchant;
@@ -2102,9 +2102,9 @@ namespace Game.Entities
ItemModifiedAppearanceRecord transmog = CliDB.ItemModifiedAppearanceStorage.LookupByKey(GetModifier(transmogModifier)); ItemModifiedAppearanceRecord transmog = CliDB.ItemModifiedAppearanceStorage.LookupByKey(GetModifier(transmogModifier));
if (transmog != null) if (transmog != null)
{ {
ItemAppearanceRecord itemAppearance = CliDB.ItemAppearanceStorage.LookupByKey(transmog.AppearanceID); ItemAppearanceRecord itemAppearance = CliDB.ItemAppearanceStorage.LookupByKey(transmog.ItemAppearanceID);
if (itemAppearance != null) if (itemAppearance != null)
return itemAppearance.DisplayID; return itemAppearance.ItemDisplayInfoID;
} }
return Global.DB2Mgr.GetItemDisplayId(GetEntry(), GetAppearanceModId()); return Global.DB2Mgr.GetItemDisplayId(GetEntry(), GetAppearanceModId());
@@ -2147,7 +2147,7 @@ namespace Game.Entities
ItemModifiedAppearanceRecord transmog = CliDB.ItemModifiedAppearanceStorage.LookupByKey(GetModifier(transmogModifier)); ItemModifiedAppearanceRecord transmog = CliDB.ItemModifiedAppearanceStorage.LookupByKey(GetModifier(transmogModifier));
if (transmog != null) if (transmog != null)
return transmog.AppearanceModID; return transmog.ItemAppearanceModifierID;
return (ushort)GetAppearanceModId(); return (ushort)GetAppearanceModId();
} }
@@ -2223,7 +2223,7 @@ namespace Game.Entities
{ {
foreach (ArtifactPowerRecord artifactPower in Global.DB2Mgr.GetArtifactPowers(artifactId)) foreach (ArtifactPowerRecord artifactPower in Global.DB2Mgr.GetArtifactPowers(artifactId))
{ {
if (artifactPower.ArtifactTier != artifactTier) if (artifactPower.Tier != artifactTier)
continue; continue;
if (m_artifactPowerIdToIndex.ContainsKey(artifactPower.Id)) if (m_artifactPowerIdToIndex.ContainsKey(artifactPower.Id))
@@ -2259,7 +2259,7 @@ namespace Game.Entities
{ {
foreach (ItemDynamicFieldArtifactPowers artifactPower in GetArtifactPowers()) foreach (ItemDynamicFieldArtifactPowers artifactPower in GetArtifactPowers())
{ {
if (CliDB.ArtifactPowerStorage.LookupByKey(artifactPower.ArtifactPowerId).RelicType == enchant.EffectSpellID[i]) if (CliDB.ArtifactPowerStorage.LookupByKey(artifactPower.ArtifactPowerId).Label == enchant.EffectArg[i])
{ {
ItemDynamicFieldArtifactPowers newPower = artifactPower; ItemDynamicFieldArtifactPowers newPower = artifactPower;
if (apply) if (apply)
@@ -2281,7 +2281,7 @@ namespace Game.Entities
break; break;
case ItemEnchantmentType.ArtifactPowerBonusRankByID: case ItemEnchantmentType.ArtifactPowerBonusRankByID:
{ {
ItemDynamicFieldArtifactPowers artifactPower = GetArtifactPower(enchant.EffectSpellID[i]); ItemDynamicFieldArtifactPowers artifactPower = GetArtifactPower(enchant.EffectArg[i]);
if (artifactPower != null) if (artifactPower != null)
{ {
ItemDynamicFieldArtifactPowers newPower = artifactPower; ItemDynamicFieldArtifactPowers newPower = artifactPower;
@@ -2304,7 +2304,7 @@ namespace Game.Entities
case ItemEnchantmentType.ArtifactPowerBonusRankPicker: case ItemEnchantmentType.ArtifactPowerBonusRankPicker:
if (slot >= EnchantmentSlot.Sock1 && slot <= EnchantmentSlot.Sock3 && _bonusData.GemRelicType[slot - EnchantmentSlot.Sock1] != -1) if (slot >= EnchantmentSlot.Sock1 && slot <= EnchantmentSlot.Sock3 && _bonusData.GemRelicType[slot - EnchantmentSlot.Sock1] != -1)
{ {
ArtifactPowerPickerRecord artifactPowerPicker = CliDB.ArtifactPowerPickerStorage.LookupByKey(enchant.EffectSpellID[i]); ArtifactPowerPickerRecord artifactPowerPicker = CliDB.ArtifactPowerPickerStorage.LookupByKey(enchant.EffectArg[i]);
if (artifactPowerPicker != null) if (artifactPowerPicker != null)
{ {
PlayerConditionRecord playerCondition = CliDB.PlayerConditionStorage.LookupByKey(artifactPowerPicker.PlayerConditionID); PlayerConditionRecord playerCondition = CliDB.PlayerConditionStorage.LookupByKey(artifactPowerPicker.PlayerConditionID);
@@ -2312,7 +2312,7 @@ namespace Game.Entities
{ {
foreach (ItemDynamicFieldArtifactPowers artifactPower in GetArtifactPowers()) foreach (ItemDynamicFieldArtifactPowers artifactPower in GetArtifactPowers())
{ {
if (CliDB.ArtifactPowerStorage.LookupByKey(artifactPower.ArtifactPowerId).RelicType == _bonusData.GemRelicType[slot - EnchantmentSlot.Sock1]) if (CliDB.ArtifactPowerStorage.LookupByKey(artifactPower.ArtifactPowerId).Label == _bonusData.GemRelicType[slot - EnchantmentSlot.Sock1])
{ {
ItemDynamicFieldArtifactPowers newPower = artifactPower; ItemDynamicFieldArtifactPowers newPower = artifactPower;
if (apply) if (apply)
@@ -2363,7 +2363,7 @@ namespace Game.Entities
if (sourceItem && sourceItem.GetModifier(ItemModifier.ArtifactKnowledgeLevel) != 0) if (sourceItem && sourceItem.GetModifier(ItemModifier.ArtifactKnowledgeLevel) != 0)
artifactKnowledgeLevel = sourceItem.GetModifier(ItemModifier.ArtifactKnowledgeLevel); artifactKnowledgeLevel = sourceItem.GetModifier(ItemModifier.ArtifactKnowledgeLevel);
else else
artifactKnowledgeLevel = owner.GetCurrency(artifactCategory.ArtifactKnowledgeCurrencyID) + 1; artifactKnowledgeLevel = owner.GetCurrency(artifactCategory.XpMultCurrencyID) + 1;
GtArtifactKnowledgeMultiplierRecord artifactKnowledge = CliDB.ArtifactKnowledgeMultiplierGameTable.GetRow(artifactKnowledgeLevel); GtArtifactKnowledgeMultiplierRecord artifactKnowledge = CliDB.ArtifactKnowledgeMultiplierGameTable.GetRow(artifactKnowledgeLevel);
if (artifactKnowledge != null) if (artifactKnowledge != null)
@@ -2403,7 +2403,7 @@ namespace Game.Entities
if (set.RequiredSkill != 0 && player.GetSkillValue((SkillType)set.RequiredSkill) < set.RequiredSkillRank) if (set.RequiredSkill != 0 && player.GetSkillValue((SkillType)set.RequiredSkill) < set.RequiredSkillRank)
return; return;
if (set.Flags.HasAnyFlag(ItemSetFlags.LegacyInactive)) if (set.SetFlags.HasAnyFlag(ItemSetFlags.LegacyInactive))
return; return;
ItemSetEffect eff = null; ItemSetEffect eff = null;
+3 -3
View File
@@ -216,14 +216,14 @@ namespace Game.Entities
switch (quality) switch (quality)
{ {
case ItemQuality.Uncommon: case ItemQuality.Uncommon:
return randPropPointsEntry.UncommonPropertiesPoints[propIndex]; return randPropPointsEntry.Good[propIndex];
case ItemQuality.Rare: case ItemQuality.Rare:
case ItemQuality.Heirloom: case ItemQuality.Heirloom:
return randPropPointsEntry.RarePropertiesPoints[propIndex]; return randPropPointsEntry.Superior[propIndex];
case ItemQuality.Epic: case ItemQuality.Epic:
case ItemQuality.Legendary: case ItemQuality.Legendary:
case ItemQuality.Artifact: case ItemQuality.Artifact:
return randPropPointsEntry.EpicPropertiesPoints[propIndex]; return randPropPointsEntry.Epic[propIndex];
} }
return 0; return 0;
} }
+66 -42
View File
@@ -38,7 +38,7 @@ namespace Game.Entities
public string GetName(LocaleConstant locale = SharedConst.DefaultLocale) public string GetName(LocaleConstant locale = SharedConst.DefaultLocale)
{ {
return ExtendedData.Name[locale]; return ExtendedData.Display[locale];
} }
public bool CanChangeEquipStateInCombat() public bool CanChangeEquipStateInCombat()
@@ -124,7 +124,31 @@ namespace Game.Entities
if (GetSubClass() < (uint)ItemSubClassArmor.Cloth || GetSubClass() > (uint)ItemSubClassArmor.Plate) if (GetSubClass() < (uint)ItemSubClassArmor.Cloth || GetSubClass() > (uint)ItemSubClassArmor.Plate)
return 0; return 0;
return (uint)(armorQuality.QualityMod[(int)quality] * armorTotal.Value[GetSubClass() - 1] * location.Modifier[GetSubClass() - 1] + 0.5f); float total = 1.0f;
float locationModifier = 1.0f;
switch ((ItemSubClassArmor)GetSubClass())
{
case ItemSubClassArmor.Cloth:
total = armorTotal.Cloth;
locationModifier = location.Clothmodifier;
break;
case ItemSubClassArmor.Leather:
total = armorTotal.Leather;
locationModifier = location.Leathermodifier;
break;
case ItemSubClassArmor.Mail:
total = armorTotal.Mail;
locationModifier = location.Chainmodifier;
break;
case ItemSubClassArmor.Plate:
total = armorTotal.Plate;
locationModifier = location.Platemodifier;
break;
default:
break;
}
return (uint)(armorQuality.QualityMod[(int)quality] * total * locationModifier + 0.5f);
} }
// shields // shields
@@ -150,13 +174,13 @@ namespace Game.Entities
switch (GetInventoryType()) switch (GetInventoryType())
{ {
case InventoryType.Ammo: case InventoryType.Ammo:
dps = CliDB.ItemDamageAmmoStorage.LookupByKey(itemLevel).DPS[(int)quality]; dps = CliDB.ItemDamageAmmoStorage.LookupByKey(itemLevel).Quality[(int)quality];
break; break;
case InventoryType.Weapon2Hand: case InventoryType.Weapon2Hand:
if (GetFlags2().HasAnyFlag(ItemFlags2.CasterWeapon)) if (GetFlags2().HasAnyFlag(ItemFlags2.CasterWeapon))
dps = CliDB.ItemDamageTwoHandCasterStorage.LookupByKey(itemLevel).DPS[(int)quality]; dps = CliDB.ItemDamageTwoHandCasterStorage.LookupByKey(itemLevel).Quality[(int)quality];
else else
dps = CliDB.ItemDamageTwoHandStorage.LookupByKey(itemLevel).DPS[(int)quality]; dps = CliDB.ItemDamageTwoHandStorage.LookupByKey(itemLevel).Quality[(int)quality];
break; break;
case InventoryType.Ranged: case InventoryType.Ranged:
case InventoryType.Thrown: case InventoryType.Thrown:
@@ -164,15 +188,15 @@ namespace Game.Entities
switch ((ItemSubClassWeapon)GetSubClass()) switch ((ItemSubClassWeapon)GetSubClass())
{ {
case ItemSubClassWeapon.Wand: case ItemSubClassWeapon.Wand:
dps = CliDB.ItemDamageOneHandCasterStorage.LookupByKey(itemLevel).DPS[(int)quality]; dps = CliDB.ItemDamageOneHandCasterStorage.LookupByKey(itemLevel).Quality[(int)quality];
break; break;
case ItemSubClassWeapon.Bow: case ItemSubClassWeapon.Bow:
case ItemSubClassWeapon.Gun: case ItemSubClassWeapon.Gun:
case ItemSubClassWeapon.Crossbow: case ItemSubClassWeapon.Crossbow:
if (GetFlags2().HasAnyFlag(ItemFlags2.CasterWeapon)) if (GetFlags2().HasAnyFlag(ItemFlags2.CasterWeapon))
dps = CliDB.ItemDamageTwoHandCasterStorage.LookupByKey(itemLevel).DPS[(int)quality]; dps = CliDB.ItemDamageTwoHandCasterStorage.LookupByKey(itemLevel).Quality[(int)quality];
else else
dps = CliDB.ItemDamageTwoHandStorage.LookupByKey(itemLevel).DPS[(int)quality]; dps = CliDB.ItemDamageTwoHandStorage.LookupByKey(itemLevel).Quality[(int)quality];
break; break;
default: default:
return; return;
@@ -182,17 +206,17 @@ namespace Game.Entities
case InventoryType.WeaponMainhand: case InventoryType.WeaponMainhand:
case InventoryType.WeaponOffhand: case InventoryType.WeaponOffhand:
if (GetFlags2().HasAnyFlag(ItemFlags2.CasterWeapon)) if (GetFlags2().HasAnyFlag(ItemFlags2.CasterWeapon))
dps = CliDB.ItemDamageOneHandCasterStorage.LookupByKey(itemLevel).DPS[(int)quality]; dps = CliDB.ItemDamageOneHandCasterStorage.LookupByKey(itemLevel).Quality[(int)quality];
else else
dps = CliDB.ItemDamageOneHandStorage.LookupByKey(itemLevel).DPS[(int)quality]; dps = CliDB.ItemDamageOneHandStorage.LookupByKey(itemLevel).Quality[(int)quality];
break; break;
default: default:
return; return;
} }
float avgDamage = dps * GetDelay() * 0.001f; float avgDamage = dps * GetDelay() * 0.001f;
minDamage = (GetStatScalingFactor() * -0.5f + 1.0f) * avgDamage; minDamage = (GetDmgVariance() * -0.5f + 1.0f) * avgDamage;
maxDamage = (float)Math.Floor(avgDamage * (GetStatScalingFactor() * 0.5f + 1.0f) + 0.5f); maxDamage = (float)Math.Floor(avgDamage * (GetDmgVariance() * 0.5f + 1.0f) + 0.5f);
} }
public bool IsUsableByLootSpecialization(Player player, bool alwaysAllowBoundToAccount) public bool IsUsableByLootSpecialization(Player player, bool alwaysAllowBoundToAccount)
@@ -225,16 +249,16 @@ namespace Game.Entities
} }
public uint GetId() { return BasicData.Id; } public uint GetId() { return BasicData.Id; }
public ItemClass GetClass() { return (ItemClass)BasicData.Class; } public ItemClass GetClass() { return (ItemClass)BasicData.ClassID; }
public uint GetSubClass() { return BasicData.SubClass; } public uint GetSubClass() { return BasicData.SubclassID; }
public ItemQuality GetQuality() { return (ItemQuality)ExtendedData.Quality; } public ItemQuality GetQuality() { return (ItemQuality)ExtendedData.OverallQualityID; }
public ItemFlags GetFlags() { return (ItemFlags)ExtendedData.Flags[0]; } public ItemFlags GetFlags() { return (ItemFlags)ExtendedData.Flags[0]; }
public ItemFlags2 GetFlags2() { return (ItemFlags2)ExtendedData.Flags[1]; } public ItemFlags2 GetFlags2() { return (ItemFlags2)ExtendedData.Flags[1]; }
public ItemFlags3 GetFlags3() { return (ItemFlags3)ExtendedData.Flags[2]; } public ItemFlags3 GetFlags3() { return (ItemFlags3)ExtendedData.Flags[2]; }
public uint GetFlags4() { return ExtendedData.Flags[3]; } public uint GetFlags4() { return ExtendedData.Flags[3]; }
public float GetUnk1() { return ExtendedData.Unk1; } public float GetPriceRandomValue() { return ExtendedData.PriceRandomValue; }
public float GetUnk2() { return ExtendedData.Unk2; } public float GetPriceVariance() { return ExtendedData.PriceVariance; }
public uint GetBuyCount() { return Math.Max(ExtendedData.BuyCount, 1u); } public uint GetBuyCount() { return Math.Max(ExtendedData.VendorStackCount, 1u); }
public uint GetBuyPrice() { return ExtendedData.BuyPrice; } public uint GetBuyPrice() { return ExtendedData.BuyPrice; }
public uint GetSellPrice() { return ExtendedData.SellPrice; } public uint GetSellPrice() { return ExtendedData.SellPrice; }
public InventoryType GetInventoryType() { return ExtendedData.inventoryType; } public InventoryType GetInventoryType() { return ExtendedData.inventoryType; }
@@ -244,15 +268,15 @@ namespace Game.Entities
public int GetBaseRequiredLevel() { return ExtendedData.RequiredLevel; } public int GetBaseRequiredLevel() { return ExtendedData.RequiredLevel; }
public uint GetRequiredSkill() { return ExtendedData.RequiredSkill; } public uint GetRequiredSkill() { return ExtendedData.RequiredSkill; }
public uint GetRequiredSkillRank() { return ExtendedData.RequiredSkillRank; } public uint GetRequiredSkillRank() { return ExtendedData.RequiredSkillRank; }
public uint GetRequiredSpell() { return ExtendedData.RequiredSpell; } public uint GetRequiredSpell() { return ExtendedData.RequiredAbility; }
public uint GetRequiredReputationFaction() { return ExtendedData.RequiredReputationFaction; } public uint GetRequiredReputationFaction() { return ExtendedData.MinFactionID; }
public uint GetRequiredReputationRank() { return ExtendedData.RequiredReputationRank; } public uint GetRequiredReputationRank() { return ExtendedData.MinReputation; }
public uint GetMaxCount() { return ExtendedData.MaxCount; } public uint GetMaxCount() { return ExtendedData.MaxCount; }
public uint GetContainerSlots() { return ExtendedData.ContainerSlots; } public uint GetContainerSlots() { return ExtendedData.ContainerSlots; }
public int GetItemStatType(uint index) public int GetItemStatType(uint index)
{ {
Contract.Assert(index < ItemConst.MaxStats); Contract.Assert(index < ItemConst.MaxStats);
return ExtendedData.ItemStatType[index]; return ExtendedData.StatModifierBonusStat[index];
} }
public int GetItemStatValue(uint index) public int GetItemStatValue(uint index)
{ {
@@ -262,42 +286,42 @@ namespace Game.Entities
public int GetItemStatAllocation(uint index) public int GetItemStatAllocation(uint index)
{ {
Contract.Assert(index < ItemConst.MaxStats); Contract.Assert(index < ItemConst.MaxStats);
return ExtendedData.ItemStatAllocation[index]; return ExtendedData.StatPercentEditor[index];
} }
public float GetItemStatSocketCostMultiplier(uint index) public float GetItemStatSocketCostMultiplier(uint index)
{ {
Contract.Assert(index < ItemConst.MaxStats); Contract.Assert(index < ItemConst.MaxStats);
return ExtendedData.ItemStatSocketCostMultiplier[index]; return ExtendedData.StatPercentageOfSocket[index];
} }
public uint GetScalingStatDistribution() { return ExtendedData.ScalingStatDistribution; } public uint GetScalingStatDistribution() { return ExtendedData.ScalingStatDistributionID; }
public uint GetDamageType() { return ExtendedData.DamageType; } public uint GetDamageType() { return ExtendedData.DamageType; }
public uint GetDelay() { return ExtendedData.Delay; } public uint GetDelay() { return ExtendedData.ItemDelay; }
public float GetRangedModRange() { return ExtendedData.RangedModRange; } public float GetRangedModRange() { return ExtendedData.ItemRange; }
public ItemBondingType GetBonding() { return (ItemBondingType)ExtendedData.Bonding; } public ItemBondingType GetBonding() { return (ItemBondingType)ExtendedData.Bonding; }
public uint GetPageText() { return ExtendedData.PageText; } public uint GetPageText() { return ExtendedData.PageID; }
public uint GetStartQuest() { return ExtendedData.StartQuest; } public uint GetStartQuest() { return ExtendedData.StartQuestID; }
public uint GetLockID() { return ExtendedData.LockID; } public uint GetLockID() { return ExtendedData.LockID; }
public uint GetRandomProperty() { return ExtendedData.RandomProperty; } public uint GetRandomProperty() { return ExtendedData.RandomSelect; }
public uint GetRandomSuffix() { return ExtendedData.RandomSuffix; } public uint GetRandomSuffix() { return ExtendedData.ItemRandomSuffixGroupID; }
public uint GetItemSet() { return ExtendedData.ItemSet; } public uint GetItemSet() { return ExtendedData.ItemSet; }
public uint GetArea() { return ExtendedData.Area; } public uint GetArea() { return ExtendedData.ZoneBound; }
public uint GetMap() { return ExtendedData.Map; } public uint GetMap() { return ExtendedData.InstanceBound; }
public BagFamilyMask GetBagFamily() { return (BagFamilyMask)ExtendedData.BagFamily; } public BagFamilyMask GetBagFamily() { return (BagFamilyMask)ExtendedData.BagFamily; }
public uint GetTotemCategory() { return ExtendedData.TotemCategory; } public uint GetTotemCategory() { return ExtendedData.TotemCategoryID; }
public SocketColor GetSocketColor(uint index) public SocketColor GetSocketColor(uint index)
{ {
Contract.Assert(index < ItemConst.MaxGemSockets); Contract.Assert(index < ItemConst.MaxGemSockets);
return (SocketColor)ExtendedData.SocketColor[index]; return (SocketColor)ExtendedData.SocketType[index];
} }
public uint GetSocketBonus() { return ExtendedData.SocketBonus; } public uint GetSocketBonus() { return ExtendedData.SocketMatchEnchantmentId; }
public uint GetGemProperties() { return ExtendedData.GemProperties; } public uint GetGemProperties() { return ExtendedData.GemProperties; }
public float GetArmorDamageModifier() { return ExtendedData.ArmorDamageModifier; } public float GetQualityModifier() { return ExtendedData.QualityModifier; }
public uint GetDuration() { return ExtendedData.Duration; } public uint GetDuration() { return ExtendedData.DurationInInventory; }
public uint GetItemLimitCategory() { return ExtendedData.ItemLimitCategory; } public uint GetItemLimitCategory() { return ExtendedData.LimitCategory; }
public HolidayIds GetHolidayID() { return (HolidayIds)ExtendedData.HolidayID; } public HolidayIds GetHolidayID() { return (HolidayIds)ExtendedData.RequiredHoliday; }
public float GetStatScalingFactor() { return ExtendedData.StatScalingFactor; } public float GetDmgVariance() { return ExtendedData.DmgVariance; }
public byte GetArtifactID() { return ExtendedData.ArtifactID; } public byte GetArtifactID() { return ExtendedData.ArtifactID; }
public byte GetRequiredExpansion() { return ExtendedData.RequiredExpansion; } public byte GetRequiredExpansion() { return ExtendedData.ExpansionID; }
public bool IsCurrencyToken() { return (GetBagFamily() & BagFamilyMask.CurrencyTokens) != 0; } public bool IsCurrencyToken() { return (GetBagFamily() & BagFamilyMask.CurrencyTokens) != 0; }
@@ -153,11 +153,11 @@ namespace Game.Entities
uint bonusId = 0; uint bonusId = 0;
if (flags.HasAnyFlag(HeirloomPlayerFlags.BonusLevel110)) if (flags.HasAnyFlag(HeirloomPlayerFlags.BonusLevel110))
bonusId = heirloom.ItemBonusListID[2]; bonusId = heirloom.UpgradeItemBonusListID[2];
else if (flags.HasAnyFlag(HeirloomPlayerFlags.BonusLevel100)) else if (flags.HasAnyFlag(HeirloomPlayerFlags.BonusLevel100))
bonusId = heirloom.ItemBonusListID[1]; bonusId = heirloom.UpgradeItemBonusListID[1];
else if (flags.HasAnyFlag(HeirloomPlayerFlags.BonusLevel90)) else if (flags.HasAnyFlag(HeirloomPlayerFlags.BonusLevel90))
bonusId = heirloom.ItemBonusListID[0]; bonusId = heirloom.UpgradeItemBonusListID[0];
_heirlooms[itemId] = new HeirloomData(flags, bonusId); _heirlooms[itemId] = new HeirloomData(flags, bonusId);
} while (result.NextRow()); } while (result.NextRow());
@@ -232,17 +232,17 @@ namespace Game.Entities
if (heirloom.UpgradeItemID[0] == castItem) if (heirloom.UpgradeItemID[0] == castItem)
{ {
flags |= HeirloomPlayerFlags.BonusLevel90; flags |= HeirloomPlayerFlags.BonusLevel90;
bonusId = heirloom.ItemBonusListID[0]; bonusId = heirloom.UpgradeItemBonusListID[0];
} }
if (heirloom.UpgradeItemID[1] == castItem) if (heirloom.UpgradeItemID[1] == castItem)
{ {
flags |= HeirloomPlayerFlags.BonusLevel100; flags |= HeirloomPlayerFlags.BonusLevel100;
bonusId = heirloom.ItemBonusListID[1]; bonusId = heirloom.UpgradeItemBonusListID[1];
} }
if (heirloom.UpgradeItemID[2] == castItem) if (heirloom.UpgradeItemID[2] == castItem)
{ {
flags |= HeirloomPlayerFlags.BonusLevel110; flags |= HeirloomPlayerFlags.BonusLevel110;
bonusId = heirloom.ItemBonusListID[2]; bonusId = heirloom.UpgradeItemBonusListID[2];
} }
foreach (Item item in player.GetItemListByEntry(itemId, true)) foreach (Item item in player.GetItemListByEntry(itemId, true))
@@ -272,7 +272,7 @@ namespace Game.Entities
return; return;
// Check for heirloom pairs (normal - heroic, heroic - mythic) // Check for heirloom pairs (normal - heroic, heroic - mythic)
uint heirloomItemId = heirloom.NextDifficultyItemID; uint heirloomItemId = heirloom.StaticUpgradedItemID;
uint newItemId = 0; uint newItemId = 0;
HeirloomRecord heirloomDiff; HeirloomRecord heirloomDiff;
while ((heirloomDiff = Global.DB2Mgr.GetHeirloomByItemId(heirloomItemId)) != null) while ((heirloomDiff = Global.DB2Mgr.GetHeirloomByItemId(heirloomItemId)) != null)
@@ -280,7 +280,7 @@ namespace Game.Entities
if (player.GetItemByEntry(heirloomDiff.ItemID)) if (player.GetItemByEntry(heirloomDiff.ItemID))
newItemId = heirloomDiff.ItemID; newItemId = heirloomDiff.ItemID;
HeirloomRecord heirloomSub = Global.DB2Mgr.GetHeirloomByItemId(heirloomDiff.NextDifficultyItemID); HeirloomRecord heirloomSub = Global.DB2Mgr.GetHeirloomByItemId(heirloomDiff.StaticUpgradedItemID);
if (heirloomSub != null) if (heirloomSub != null)
{ {
heirloomItemId = heirloomSub.ItemID; heirloomItemId = heirloomSub.ItemID;
@@ -385,10 +385,10 @@ namespace Game.Entities
_mounts[spellId] = flags; _mounts[spellId] = flags;
// Mount condition only applies to using it, should still learn it. // Mount condition only applies to using it, should still learn it.
if (mount.PlayerConditionId != 0) if (mount.PlayerConditionID != 0)
{ {
PlayerConditionRecord playerCondition = CliDB.PlayerConditionStorage.LookupByKey(mount.PlayerConditionId); PlayerConditionRecord playerCondition = CliDB.PlayerConditionStorage.LookupByKey(mount.PlayerConditionID);
if (!ConditionManager.IsPlayerMeetingCondition(player, playerCondition)) if (playerCondition != null && !ConditionManager.IsPlayerMeetingCondition(player, playerCondition))
return false; return false;
} }
@@ -578,7 +578,7 @@ namespace Game.Entities
if (itemModifiedAppearance == null) if (itemModifiedAppearance == null)
return false; return false;
if (itemModifiedAppearance.SourceType == 6 || itemModifiedAppearance.SourceType == 9) if (itemModifiedAppearance.TransmogSourceTypeEnum == 6 || itemModifiedAppearance.TransmogSourceTypeEnum == 9)
return false; return false;
if (!CliDB.ItemSearchNameStorage.ContainsKey(itemModifiedAppearance.ItemID)) if (!CliDB.ItemSearchNameStorage.ContainsKey(itemModifiedAppearance.ItemID))
+5 -5
View File
@@ -56,8 +56,8 @@ namespace Game.Entities
ArtifactPowerRecord artifactPower = CliDB.ArtifactPowerStorage.LookupByKey(artifactPowerData.ArtifactPowerId); ArtifactPowerRecord artifactPower = CliDB.ArtifactPowerStorage.LookupByKey(artifactPowerData.ArtifactPowerId);
if (artifactPower != null) if (artifactPower != null)
{ {
if (artifactPowerData.PurchasedRank > artifactPower.MaxRank) if (artifactPowerData.PurchasedRank > artifactPower.MaxPurchasableRank)
artifactPowerData.PurchasedRank = artifactPower.MaxRank; artifactPowerData.PurchasedRank = artifactPower.MaxPurchasableRank;
artifactPowerData.CurrentRankWithBonus = (byte)(artifactPower.Flags.HasAnyFlag(ArtifactPowerFlag.First) ? 1 : 0); artifactPowerData.CurrentRankWithBonus = (byte)(artifactPower.Flags.HasAnyFlag(ArtifactPowerFlag.First) ? 1 : 0);
@@ -2659,7 +2659,7 @@ namespace Game.Entities
else // have start node, to it else // have start node, to it
{ {
Log.outError(LogFilter.Player, "Character {0} have too short taxi destination list, teleport to original node.", GetGUID().ToString()); Log.outError(LogFilter.Player, "Character {0} have too short taxi destination list, teleport to original node.", GetGUID().ToString());
mapId = nodeEntry.MapID; mapId = nodeEntry.ContinentID;
Relocate(nodeEntry.Pos.X, nodeEntry.Pos.Y, nodeEntry.Pos.Z, 0.0f); Relocate(nodeEntry.Pos.X, nodeEntry.Pos.Y, nodeEntry.Pos.Z, 0.0f);
} }
m_taxi.ClearTaxiDestinations(); m_taxi.ClearTaxiDestinations();
@@ -2669,10 +2669,10 @@ namespace Game.Entities
{ {
// save source node as recall coord to prevent recall and fall from sky // save source node as recall coord to prevent recall and fall from sky
var nodeEntry = CliDB.TaxiNodesStorage.LookupByKey(nodeid); var nodeEntry = CliDB.TaxiNodesStorage.LookupByKey(nodeid);
if (nodeEntry != null && nodeEntry.MapID == GetMapId()) if (nodeEntry != null && nodeEntry.ContinentID == GetMapId())
{ {
Contract.Assert(nodeEntry != null); // checked in m_taxi.LoadTaxiDestinationsFromString Contract.Assert(nodeEntry != null); // checked in m_taxi.LoadTaxiDestinationsFromString
mapId = nodeEntry.MapID; mapId = nodeEntry.ContinentID;
Relocate(nodeEntry.Pos.X, nodeEntry.Pos.Y, nodeEntry.Pos.Z, 0.0f); Relocate(nodeEntry.Pos.X, nodeEntry.Pos.Y, nodeEntry.Pos.Z, 0.0f);
} }
+59 -59
View File
@@ -78,8 +78,8 @@ namespace Game.Entities
bool store_error = false; bool store_error = false;
for (byte i = 0; i < ItemConst.MaxItemExtCostItems; ++i) for (byte i = 0; i < ItemConst.MaxItemExtCostItems; ++i)
{ {
uint count = iece.RequiredItemCount[i]; uint count = iece.ItemCount[i];
uint itemid = iece.RequiredItem[i]; uint itemid = iece.ItemID[i];
if (count != 0 && itemid != 0) if (count != 0 && itemid != 0)
{ {
@@ -116,8 +116,8 @@ namespace Game.Entities
// Grant back extendedcost items // Grant back extendedcost items
for (byte i = 0; i < ItemConst.MaxItemExtCostItems; ++i) for (byte i = 0; i < ItemConst.MaxItemExtCostItems; ++i)
{ {
uint count = iece.RequiredItemCount[i]; uint count = iece.ItemCount[i];
uint itemid = iece.RequiredItem[i]; uint itemid = iece.ItemID[i];
if (count != 0 && itemid != 0) if (count != 0 && itemid != 0)
{ {
List<ItemPosCount> dest = new List<ItemPosCount>(); List<ItemPosCount> dest = new List<ItemPosCount>();
@@ -131,11 +131,11 @@ namespace Game.Entities
// Grant back currencies // Grant back currencies
for (byte i = 0; i < ItemConst.MaxItemExtCostCurrencies; ++i) for (byte i = 0; i < ItemConst.MaxItemExtCostCurrencies; ++i)
{ {
if (iece.RequirementFlags.HasAnyFlag((byte)((int)ItemExtendedCostFlags.RequireSeasonEarned1 << i))) if (iece.Flags.HasAnyFlag((byte)((int)ItemExtendedCostFlags.RequireSeasonEarned1 << i)))
continue; continue;
uint count = iece.RequiredCurrencyCount[i]; uint count = iece.CurrencyCount[i];
uint currencyid = iece.RequiredCurrency[i]; uint currencyid = iece.CurrencyID[i];
if (count != 0 && currencyid != 0) if (count != 0 && currencyid != 0)
ModifyCurrency((CurrencyTypes)currencyid, (int)count, true, true); ModifyCurrency((CurrencyTypes)currencyid, (int)count, true, true);
} }
@@ -179,17 +179,17 @@ namespace Game.Entities
for (byte i = 0; i < ItemConst.MaxItemExtCostItems; ++i) // item cost data for (byte i = 0; i < ItemConst.MaxItemExtCostItems; ++i) // item cost data
{ {
setItemPurchaseData.Contents.Items[i].ItemCount = iece.RequiredItemCount[i]; setItemPurchaseData.Contents.Items[i].ItemCount = iece.ItemCount[i];
setItemPurchaseData.Contents.Items[i].ItemID = iece.RequiredItem[i]; setItemPurchaseData.Contents.Items[i].ItemID = iece.ItemID[i];
} }
for (byte i = 0; i < ItemConst.MaxItemExtCostCurrencies; ++i) // currency cost data for (byte i = 0; i < ItemConst.MaxItemExtCostCurrencies; ++i) // currency cost data
{ {
if (iece.RequirementFlags.HasAnyFlag((byte)((int)ItemExtendedCostFlags.RequireSeasonEarned1 << i))) if (iece.Flags.HasAnyFlag((byte)((int)ItemExtendedCostFlags.RequireSeasonEarned1 << i)))
continue; continue;
setItemPurchaseData.Contents.Currencies[i].CurrencyCount = iece.RequiredCurrencyCount[i]; setItemPurchaseData.Contents.Currencies[i].CurrencyCount = iece.CurrencyCount[i];
setItemPurchaseData.Contents.Currencies[i].CurrencyID = iece.RequiredCurrency[i]; setItemPurchaseData.Contents.Currencies[i].CurrencyID = iece.CurrencyID[i];
} }
SendPacket(setItemPurchaseData); SendPacket(setItemPurchaseData);
@@ -205,17 +205,17 @@ namespace Game.Entities
itemPurchaseRefundResult.Contents.Value.Money = item.GetPaidMoney(); itemPurchaseRefundResult.Contents.Value.Money = item.GetPaidMoney();
for (byte i = 0; i < ItemConst.MaxItemExtCostItems; ++i) // item cost data for (byte i = 0; i < ItemConst.MaxItemExtCostItems; ++i) // item cost data
{ {
itemPurchaseRefundResult.Contents.Value.Items[i].ItemCount = iece.RequiredItemCount[i]; itemPurchaseRefundResult.Contents.Value.Items[i].ItemCount = iece.ItemCount[i];
itemPurchaseRefundResult.Contents.Value.Items[i].ItemID = iece.RequiredItem[i]; itemPurchaseRefundResult.Contents.Value.Items[i].ItemID = iece.ItemID[i];
} }
for (byte i = 0; i < ItemConst.MaxItemExtCostCurrencies; ++i) // currency cost data for (byte i = 0; i < ItemConst.MaxItemExtCostCurrencies; ++i) // currency cost data
{ {
if (iece.RequirementFlags.HasAnyFlag((byte)((uint)ItemExtendedCostFlags.RequireSeasonEarned1 << i))) if (iece.Flags.HasAnyFlag((byte)((uint)ItemExtendedCostFlags.RequireSeasonEarned1 << i)))
continue; continue;
itemPurchaseRefundResult.Contents.Value.Currencies[i].CurrencyCount = iece.RequiredCurrencyCount[i]; itemPurchaseRefundResult.Contents.Value.Currencies[i].CurrencyCount = iece.CurrencyCount[i];
itemPurchaseRefundResult.Contents.Value.Currencies[i].CurrencyID = iece.RequiredCurrency[i]; itemPurchaseRefundResult.Contents.Value.Currencies[i].CurrencyID = iece.CurrencyID[i];
} }
} }
@@ -442,7 +442,7 @@ namespace Game.Entities
else if (ditemProto.GetClass() == ItemClass.Armor) else if (ditemProto.GetClass() == ItemClass.Armor)
dmultiplier = dcost.ArmorSubClassCost[ditemProto.GetSubClass()]; dmultiplier = dcost.ArmorSubClassCost[ditemProto.GetSubClass()];
uint costs = (uint)(LostDurability * dmultiplier * (double)dQualitymodEntry.QualityMod * item.GetRepairCostMultiplier()); uint costs = (uint)(LostDurability * dmultiplier * (double)dQualitymodEntry.Data * item.GetRepairCostMultiplier());
costs = (uint)(costs * discountMod * WorldConfig.GetFloatValue(WorldCfg.RateRepaircost)); costs = (uint)(costs * discountMod * WorldConfig.GetFloatValue(WorldCfg.RateRepaircost));
if (costs == 0) //fix for ITEM_QUALITY_ARTIFACT if (costs == 0) //fix for ITEM_QUALITY_ARTIFACT
@@ -1159,7 +1159,7 @@ namespace Game.Entities
ItemTemplate proto = pItem.GetTemplate(); ItemTemplate proto = pItem.GetTemplate();
for (byte i = 0; i < proto.Effects.Count; ++i) for (byte i = 0; i < proto.Effects.Count; ++i)
if (proto.Effects[i].Trigger == ItemSpelltriggerType.OnObtain && proto.Effects[i].SpellID > 0) // On obtain trigger if (proto.Effects[i].TriggerType == ItemSpelltriggerType.OnObtain && proto.Effects[i].SpellID > 0) // On obtain trigger
if (bag == InventorySlots.Bag0 || (bag >= InventorySlots.BagStart && bag < InventorySlots.BagEnd)) if (bag == InventorySlots.Bag0 || (bag >= InventorySlots.BagStart && bag < InventorySlots.BagEnd))
if (!HasAura(proto.Effects[i].SpellID)) if (!HasAura(proto.Effects[i].SpellID))
CastSpell(this, proto.Effects[i].SpellID, true, pItem); CastSpell(this, proto.Effects[i].SpellID, true, pItem);
@@ -1202,7 +1202,7 @@ namespace Game.Entities
ItemTemplate proto = pItem2.GetTemplate(); ItemTemplate proto = pItem2.GetTemplate();
for (byte i = 0; i < proto.Effects.Count; ++i) for (byte i = 0; i < proto.Effects.Count; ++i)
if (proto.Effects[i].Trigger == ItemSpelltriggerType.OnObtain && proto.Effects[i].SpellID > 0) // On obtain trigger if (proto.Effects[i].TriggerType == ItemSpelltriggerType.OnObtain && proto.Effects[i].SpellID > 0) // On obtain trigger
if (bag == InventorySlots.Bag0 || (bag >= InventorySlots.BagStart && bag < InventorySlots.BagEnd)) if (bag == InventorySlots.Bag0 || (bag >= InventorySlots.BagStart && bag < InventorySlots.BagEnd))
if (!HasAura(proto.Effects[i].SpellID)) if (!HasAura(proto.Effects[i].SpellID))
CastSpell(this, proto.Effects[i].SpellID, true, pItem2); CastSpell(this, proto.Effects[i].SpellID, true, pItem2);
@@ -1321,7 +1321,7 @@ namespace Game.Entities
ItemChildEquipmentRecord childItemEntry = Global.DB2Mgr.GetItemChildEquipment(itemId); ItemChildEquipmentRecord childItemEntry = Global.DB2Mgr.GetItemChildEquipment(itemId);
if (childItemEntry != null) if (childItemEntry != null)
{ {
ItemTemplate childTemplate = Global.ObjectMgr.GetItemTemplate(childItemEntry.AltItemID); ItemTemplate childTemplate = Global.ObjectMgr.GetItemTemplate(childItemEntry.ChildItemID);
if (childTemplate != null) if (childTemplate != null)
{ {
List<ItemPosCount> childDest = new List<ItemPosCount>(); List<ItemPosCount> childDest = new List<ItemPosCount>();
@@ -1510,7 +1510,7 @@ namespace Game.Entities
ArtifactRecord artifact = CliDB.ArtifactStorage.LookupByKey(proto.GetArtifactID()); ArtifactRecord artifact = CliDB.ArtifactStorage.LookupByKey(proto.GetArtifactID());
if (artifact != null) if (artifact != null)
if (artifact.SpecID != GetUInt32Value(PlayerFields.CurrentSpecId)) if (artifact.ChrSpecializationID != GetUInt32Value(PlayerFields.CurrentSpecId))
return InventoryResult.CantUseItem; return InventoryResult.CantUseItem;
return InventoryResult.Ok; return InventoryResult.Ok;
@@ -1735,7 +1735,7 @@ namespace Game.Entities
Item childItem = GetChildItemByGuid(parentItem.GetChildItem()); Item childItem = GetChildItemByGuid(parentItem.GetChildItem());
if (childItem) if (childItem)
{ {
ushort childDest = (ushort)((InventorySlots.Bag0 << 8) | itemChildEquipment.AltEquipmentSlot); ushort childDest = (ushort)((InventorySlots.Bag0 << 8) | itemChildEquipment.ChildItemEquipSlot);
if (childItem.GetPos() != childDest) if (childItem.GetPos() != childDest)
{ {
Item dstItem = GetItemByPos(childDest); Item dstItem = GetItemByPos(childDest);
@@ -2521,17 +2521,17 @@ namespace Game.Entities
var iece = CliDB.ItemExtendedCostStorage.LookupByKey(crItem.ExtendedCost); var iece = CliDB.ItemExtendedCostStorage.LookupByKey(crItem.ExtendedCost);
for (int i = 0; i < ItemConst.MaxItemExtCostItems; ++i) for (int i = 0; i < ItemConst.MaxItemExtCostItems; ++i)
{ {
if (iece.RequiredItem[i] != 0) if (iece.ItemID[i] != 0)
DestroyItemCount(iece.RequiredItem[i], iece.RequiredItemCount[i] * stacks, true); DestroyItemCount(iece.ItemID[i], iece.ItemCount[i] * stacks, true);
} }
for (int i = 0; i < ItemConst.MaxItemExtCostCurrencies; ++i) for (int i = 0; i < ItemConst.MaxItemExtCostCurrencies; ++i)
{ {
if (iece.RequirementFlags.HasAnyFlag((byte)((int)ItemExtendedCostFlags.RequireSeasonEarned1 << i))) if (iece.Flags.HasAnyFlag((byte)((int)ItemExtendedCostFlags.RequireSeasonEarned1 << i)))
continue; continue;
if (iece.RequiredCurrency[i] != 0) if (iece.CurrencyID[i] != 0)
ModifyCurrency((CurrencyTypes)iece.RequiredCurrency[i], -(int)(iece.RequiredCurrencyCount[i] * stacks), true, true); ModifyCurrency((CurrencyTypes)iece.CurrencyID[i], -(int)(iece.CurrencyCount[i] * stacks), true, true);
} }
} }
@@ -3502,7 +3502,7 @@ namespace Game.Entities
for (byte i = 0; i < ItemConst.MaxItemExtCostItems; ++i) for (byte i = 0; i < ItemConst.MaxItemExtCostItems; ++i)
{ {
if (iece.RequiredItem[i] != 0 && !HasItemCount(iece.RequiredItem[i], (iece.RequiredItemCount[i] * stacks))) if (iece.ItemID[i] != 0 && !HasItemCount(iece.ItemID[i], (iece.ItemCount[i] * stacks)))
{ {
SendEquipError(InventoryResult.VendorMissingTurnins); SendEquipError(InventoryResult.VendorMissingTurnins);
return false; return false;
@@ -3511,23 +3511,23 @@ namespace Game.Entities
for (byte i = 0; i < ItemConst.MaxItemExtCostCurrencies; ++i) for (byte i = 0; i < ItemConst.MaxItemExtCostCurrencies; ++i)
{ {
if (iece.RequiredCurrency[i] == 0) if (iece.CurrencyID[i] == 0)
continue; continue;
CurrencyTypesRecord entry = CliDB.CurrencyTypesStorage.LookupByKey(iece.RequiredCurrency[i]); CurrencyTypesRecord entry = CliDB.CurrencyTypesStorage.LookupByKey(iece.CurrencyID[i]);
if (entry == null) if (entry == null)
{ {
SendBuyError(BuyResult.CantFindItem, creature, currency); // Find correct error SendBuyError(BuyResult.CantFindItem, creature, currency); // Find correct error
return false; return false;
} }
if (iece.RequirementFlags.HasAnyFlag((byte)((uint)ItemExtendedCostFlags.RequireSeasonEarned1 << i))) if (iece.Flags.HasAnyFlag((byte)((uint)ItemExtendedCostFlags.RequireSeasonEarned1 << i)))
{ {
// Not implemented // Not implemented
SendEquipError(InventoryResult.VendorMissingTurnins); // Find correct error SendEquipError(InventoryResult.VendorMissingTurnins); // Find correct error
return false; return false;
} }
else if (!HasCurrency(iece.RequiredCurrency[i], (iece.RequiredCurrencyCount[i] * stacks))) else if (!HasCurrency(iece.CurrencyID[i], (iece.CurrencyCount[i] * stacks)))
{ {
SendEquipError(InventoryResult.VendorMissingTurnins); // Find correct error SendEquipError(InventoryResult.VendorMissingTurnins); // Find correct error
return false; return false;
@@ -3535,20 +3535,20 @@ namespace Game.Entities
} }
// check for personal arena rating requirement // check for personal arena rating requirement
if (GetMaxPersonalArenaRatingRequirement(iece.RequiredArenaSlot) < iece.RequiredPersonalArenaRating) if (GetMaxPersonalArenaRatingRequirement(iece.ArenaBracket) < iece.RequiredArenaRating)
{ {
// probably not the proper equip err // probably not the proper equip err
SendEquipError(InventoryResult.CantEquipRank); SendEquipError(InventoryResult.CantEquipRank);
return false; return false;
} }
if (iece.RequiredFactionId != 0 && (uint)GetReputationRank(iece.RequiredFactionId) < iece.RequiredFactionStanding) if (iece.MinFactionID != 0 && (uint)GetReputationRank(iece.MinFactionID) < iece.RequiredAchievement)
{ {
SendBuyError(BuyResult.ReputationRequire, creature, currency); SendBuyError(BuyResult.ReputationRequire, creature, currency);
return false; return false;
} }
if (iece.RequirementFlags.HasAnyFlag((byte)ItemExtendedCostFlags.RequireGuild) && GetGuildId() == 0) if (iece.Flags.HasAnyFlag((byte)ItemExtendedCostFlags.RequireGuild) && GetGuildId() == 0)
{ {
SendEquipError(InventoryResult.VendorMissingTurnins); // Find correct error SendEquipError(InventoryResult.VendorMissingTurnins); // Find correct error
return false; return false;
@@ -3571,21 +3571,21 @@ namespace Game.Entities
{ {
for (byte i = 0; i < ItemConst.MaxItemExtCostItems; ++i) for (byte i = 0; i < ItemConst.MaxItemExtCostItems; ++i)
{ {
if (iece.RequiredItem[i] == 0) if (iece.ItemID[i] == 0)
continue; continue;
DestroyItemCount(iece.RequiredItem[i], iece.RequiredItemCount[i] * stacks, true); DestroyItemCount(iece.ItemID[i], iece.ItemCount[i] * stacks, true);
} }
for (byte i = 0; i < ItemConst.MaxItemExtCostCurrencies; ++i) for (byte i = 0; i < ItemConst.MaxItemExtCostCurrencies; ++i)
{ {
if (iece.RequiredCurrency[i] == 0) if (iece.CurrencyID[i] == 0)
continue; continue;
if (iece.RequirementFlags.HasAnyFlag((byte)((uint)ItemExtendedCostFlags.RequireSeasonEarned1 << i))) if (iece.Flags.HasAnyFlag((byte)((uint)ItemExtendedCostFlags.RequireSeasonEarned1 << i)))
continue; continue;
ModifyCurrency((CurrencyTypes)iece.RequiredCurrency[i], -(int)(iece.RequiredCurrencyCount[i] * stacks), false, true); ModifyCurrency((CurrencyTypes)iece.CurrencyID[i], -(int)(iece.CurrencyCount[i] * stacks), false, true);
} }
} }
@@ -3702,7 +3702,7 @@ namespace Game.Entities
for (byte i = 0; i < ItemConst.MaxItemExtCostItems; ++i) for (byte i = 0; i < ItemConst.MaxItemExtCostItems; ++i)
{ {
if (iece.RequiredItem[i] != 0 && !HasItemCount(iece.RequiredItem[i], iece.RequiredItemCount[i] * stacks)) if (iece.ItemID[i] != 0 && !HasItemCount(iece.ItemID[i], iece.ItemCount[i] * stacks))
{ {
SendEquipError(InventoryResult.VendorMissingTurnins); SendEquipError(InventoryResult.VendorMissingTurnins);
return false; return false;
@@ -3711,22 +3711,22 @@ namespace Game.Entities
for (byte i = 0; i < ItemConst.MaxItemExtCostCurrencies; ++i) for (byte i = 0; i < ItemConst.MaxItemExtCostCurrencies; ++i)
{ {
if (iece.RequiredCurrency[i] == 0) if (iece.CurrencyID[i] == 0)
continue; continue;
var entry = CliDB.CurrencyTypesStorage.LookupByKey(iece.RequiredCurrency[i]); var entry = CliDB.CurrencyTypesStorage.LookupByKey(iece.CurrencyID[i]);
if (entry == null) if (entry == null)
{ {
SendBuyError(BuyResult.CantFindItem, creature, item); SendBuyError(BuyResult.CantFindItem, creature, item);
return false; return false;
} }
if (iece.RequirementFlags.HasAnyFlag((byte)((uint)ItemExtendedCostFlags.RequireSeasonEarned1 << i))) if (iece.Flags.HasAnyFlag((byte)((uint)ItemExtendedCostFlags.RequireSeasonEarned1 << i)))
{ {
SendEquipError(InventoryResult.VendorMissingTurnins); // Find correct error SendEquipError(InventoryResult.VendorMissingTurnins); // Find correct error
return false; return false;
} }
else if (!HasCurrency(iece.RequiredCurrency[i], iece.RequiredCurrencyCount[i] * stacks)) else if (!HasCurrency(iece.CurrencyID[i], iece.CurrencyCount[i] * stacks))
{ {
SendEquipError(InventoryResult.VendorMissingTurnins); SendEquipError(InventoryResult.VendorMissingTurnins);
return false; return false;
@@ -3734,20 +3734,20 @@ namespace Game.Entities
} }
// check for personal arena rating requirement // check for personal arena rating requirement
if (GetMaxPersonalArenaRatingRequirement(iece.RequiredArenaSlot) < iece.RequiredPersonalArenaRating) if (GetMaxPersonalArenaRatingRequirement(iece.ArenaBracket) < iece.RequiredArenaRating)
{ {
// probably not the proper equip err // probably not the proper equip err
SendEquipError(InventoryResult.CantEquipRank); SendEquipError(InventoryResult.CantEquipRank);
return false; return false;
} }
if (iece.RequiredFactionId != 0 && (uint)GetReputationRank(iece.RequiredFactionId) < iece.RequiredFactionStanding) if (iece.MinFactionID != 0 && (uint)GetReputationRank(iece.MinFactionID) < iece.MinReputation)
{ {
SendBuyError(BuyResult.ReputationRequire, creature, item); SendBuyError(BuyResult.ReputationRequire, creature, item);
return false; return false;
} }
if (iece.RequirementFlags.HasAnyFlag((byte)ItemExtendedCostFlags.RequireGuild) && GetGuildId() == 0) if (iece.Flags.HasAnyFlag((byte)ItemExtendedCostFlags.RequireGuild) && GetGuildId() == 0)
{ {
SendEquipError(InventoryResult.VendorMissingTurnins); // Find correct error SendEquipError(InventoryResult.VendorMissingTurnins); // Find correct error
return false; return false;
@@ -4264,7 +4264,7 @@ namespace Game.Entities
continue; continue;
// wrong triggering type // wrong triggering type
if (apply && spellData.Trigger != ItemSpelltriggerType.OnEquip) if (apply && spellData.TriggerType != ItemSpelltriggerType.OnEquip)
continue; continue;
// check if it is valid spell // check if it is valid spell
@@ -4336,7 +4336,7 @@ namespace Game.Entities
var effectData = proto.Effects[i]; var effectData = proto.Effects[i];
// apply proc cooldown to equip auras if we have any // apply proc cooldown to equip auras if we have any
if (effectData.Trigger == ItemSpelltriggerType.OnEquip) if (effectData.TriggerType == ItemSpelltriggerType.OnEquip)
{ {
SpellProcEntry procEntry = Global.SpellMgr.GetSpellProcEntry(effectData.SpellID); SpellProcEntry procEntry = Global.SpellMgr.GetSpellProcEntry(effectData.SpellID);
if (procEntry == null) if (procEntry == null)
@@ -4353,7 +4353,7 @@ namespace Game.Entities
continue; continue;
// wrong triggering type // wrong triggering type
if (effectData.Trigger != ItemSpelltriggerType.OnUse) if (effectData.TriggerType != ItemSpelltriggerType.OnUse)
continue; continue;
// Don't replace longer cooldowns by equip cooldown if we have any. // Don't replace longer cooldowns by equip cooldown if we have any.
@@ -5277,11 +5277,11 @@ namespace Game.Entities
if (childEquipement == null) if (childEquipement == null)
return InventoryResult.Ok; return InventoryResult.Ok;
Item dstItem = GetItemByPos(InventorySlots.Bag0, childEquipement.AltEquipmentSlot); Item dstItem = GetItemByPos(InventorySlots.Bag0, childEquipement.ChildItemEquipSlot);
if (!dstItem) if (!dstItem)
return InventoryResult.Ok; return InventoryResult.Ok;
ushort childDest = (ushort)((InventorySlots.Bag0 << 8) | childEquipement.AltEquipmentSlot); ushort childDest = (ushort)((InventorySlots.Bag0 << 8) | childEquipement.ChildItemEquipSlot);
InventoryResult msg = CanUnequipItem(childDest, !childItem.IsBag()); InventoryResult msg = CanUnequipItem(childDest, !childItem.IsBag());
if (msg != InventoryResult.Ok) if (msg != InventoryResult.Ok)
return msg; return msg;
@@ -5428,7 +5428,7 @@ namespace Game.Entities
ArtifactAppearanceRecord artifactAppearance = CliDB.ArtifactAppearanceStorage.LookupByKey(item.GetModifier(ItemModifier.ArtifactAppearanceId)); ArtifactAppearanceRecord artifactAppearance = CliDB.ArtifactAppearanceStorage.LookupByKey(item.GetModifier(ItemModifier.ArtifactAppearanceId));
if (artifactAppearance != null) if (artifactAppearance != null)
if (artifactAppearance.ShapeshiftDisplayID != 0 && GetShapeshiftForm() == (ShapeShiftForm)artifactAppearance.ModifiesShapeshiftFormDisplay) if (artifactAppearance.OverrideShapeshiftDisplayID != 0 && GetShapeshiftForm() == (ShapeShiftForm)artifactAppearance.OverrideShapeshiftFormID)
RestoreDisplayId(); RestoreDisplayId();
} }
@@ -5451,7 +5451,7 @@ namespace Game.Entities
continue; continue;
if (powerAura.HasEffect(auraEffect.GetEffIndex())) if (powerAura.HasEffect(auraEffect.GetEffIndex()))
auraEffect.ChangeAmount((int)(artifactPowerRank.Value != 0 ? artifactPowerRank.Value : auraEffect.GetSpellEffectInfo().CalcValue())); auraEffect.ChangeAmount((int)(artifactPowerRank.AuraPointsOverride != 0 ? artifactPowerRank.AuraPointsOverride : auraEffect.GetSpellEffectInfo().CalcValue()));
} }
} }
else else
@@ -5460,10 +5460,10 @@ namespace Game.Entities
else if (apply) else if (apply)
{ {
Dictionary<SpellValueMod, int> csv = new Dictionary<SpellValueMod, int>(); Dictionary<SpellValueMod, int> csv = new Dictionary<SpellValueMod, int>();
if (artifactPowerRank.Value != 0) if (artifactPowerRank.AuraPointsOverride != 0)
for (int i = 0; i < SpellConst.MaxEffects; ++i) for (int i = 0; i < SpellConst.MaxEffects; ++i)
if (spellInfo.GetEffect((uint)i) != null) if (spellInfo.GetEffect((uint)i) != null)
csv.Add(SpellValueMod.BasePoint0 + i, (int)artifactPowerRank.Value); csv.Add(SpellValueMod.BasePoint0 + i, (int)artifactPowerRank.AuraPointsOverride);
CastCustomSpell(artifactPowerRank.SpellID, csv, this, TriggerCastFlags.FullMask, artifact); CastCustomSpell(artifactPowerRank.SpellID, csv, this, TriggerCastFlags.FullMask, artifact);
} }
@@ -5651,7 +5651,7 @@ namespace Game.Entities
ItemTemplate proto = pItem.GetTemplate(); ItemTemplate proto = pItem.GetTemplate();
for (byte i = 0; i < proto.Effects.Count; ++i) for (byte i = 0; i < proto.Effects.Count; ++i)
if (proto.Effects[i].Trigger == ItemSpelltriggerType.OnObtain && proto.Effects[i].SpellID > 0) // On obtain trigger if (proto.Effects[i].TriggerType == ItemSpelltriggerType.OnObtain && proto.Effects[i].SpellID > 0) // On obtain trigger
RemoveAurasDueToSpell(proto.Effects[i].SpellID); RemoveAurasDueToSpell(proto.Effects[i].SpellID);
ItemRemovedQuestCheck(pItem.GetEntry(), pItem.GetCount()); ItemRemovedQuestCheck(pItem.GetEntry(), pItem.GetCount());
+1 -1
View File
@@ -512,7 +512,7 @@ namespace Game.Entities
{ {
if (missingQuest != 0 && !string.IsNullOrEmpty(ar.questFailedText)) if (missingQuest != 0 && !string.IsNullOrEmpty(ar.questFailedText))
SendSysMessage("{0}", ar.questFailedText); SendSysMessage("{0}", ar.questFailedText);
else if (mapDiff.Message_lang.HasString(Global.WorldMgr.GetDefaultDbcLocale())) // if (missingAchievement) covered by this case else if (mapDiff.Message.HasString(Global.WorldMgr.GetDefaultDbcLocale())) // if (missingAchievement) covered by this case
SendTransferAborted(target_map, TransferAbortReason.Difficulty, (byte)target_difficulty); SendTransferAborted(target_map, TransferAbortReason.Difficulty, (byte)target_difficulty);
else if (missingItem != 0) else if (missingItem != 0)
GetSession().SendNotification(Global.ObjectMgr.GetCypherString(CypherStrings.LevelMinrequiredAndItem), LevelMin, Global.ObjectMgr.GetItemTemplate(missingItem).GetName()); GetSession().SendNotification(Global.ObjectMgr.GetCypherString(CypherStrings.LevelMinrequiredAndItem), LevelMin, Global.ObjectMgr.GetItemTemplate(missingItem).GetName());
+2 -2
View File
@@ -236,7 +236,7 @@ namespace Game.Entities
if (rewardPackEntry == null) if (rewardPackEntry == null)
return; return;
CharTitlesRecord charTitlesEntry = CliDB.CharTitlesStorage.LookupByKey(rewardPackEntry.TitleID); CharTitlesRecord charTitlesEntry = CliDB.CharTitlesStorage.LookupByKey(rewardPackEntry.CharTitleID);
if (charTitlesEntry != null) if (charTitlesEntry != null)
SetTitle(charTitlesEntry); SetTitle(charTitlesEntry);
@@ -245,7 +245,7 @@ namespace Game.Entities
if (rewardPackXItems != null) if (rewardPackXItems != null)
{ {
foreach (RewardPackXItemRecord rewardPackXItem in rewardPackXItems) foreach (RewardPackXItemRecord rewardPackXItem in rewardPackXItems)
AddItem(rewardPackXItem.ItemID, rewardPackXItem.Amount); AddItem(rewardPackXItem.ItemID, rewardPackXItem.ItemQuantity);
} }
} }
+7 -7
View File
@@ -652,7 +652,7 @@ namespace Game.Entities
if (CanSelectQuestPackageItem(questPackageItem)) if (CanSelectQuestPackageItem(questPackageItem))
{ {
hasFilteredQuestPackageReward = true; hasFilteredQuestPackageReward = true;
InventoryResult res = CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, questPackageItem.ItemID, questPackageItem.ItemCount); InventoryResult res = CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, questPackageItem.ItemID, questPackageItem.ItemQuantity);
if (res != InventoryResult.Ok) if (res != InventoryResult.Ok)
{ {
SendEquipError(res, null, null, questPackageItem.ItemID); SendEquipError(res, null, null, questPackageItem.ItemID);
@@ -672,7 +672,7 @@ namespace Game.Entities
if (questPackageItem.ItemID != reward) if (questPackageItem.ItemID != reward)
continue; continue;
InventoryResult res = CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, questPackageItem.ItemID, questPackageItem.ItemCount); InventoryResult res = CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, questPackageItem.ItemID, questPackageItem.ItemQuantity);
if (res != InventoryResult.Ok) if (res != InventoryResult.Ok)
{ {
SendEquipError(res, null, null, questPackageItem.ItemID); SendEquipError(res, null, null, questPackageItem.ItemID);
@@ -829,7 +829,7 @@ namespace Game.Entities
(rewardProto.GetFlags2().HasAnyFlag(ItemFlags2.FactionHorde) && GetTeam() != Team.Horde)) (rewardProto.GetFlags2().HasAnyFlag(ItemFlags2.FactionHorde) && GetTeam() != Team.Horde))
return false; return false;
switch (questPackageItem.FilterType) switch (questPackageItem.DisplayType)
{ {
case QuestPackageFilter.LootSpecialization: case QuestPackageFilter.LootSpecialization:
return rewardProto.IsUsableByLootSpecialization(this, true); return rewardProto.IsUsableByLootSpecialization(this, true);
@@ -859,10 +859,10 @@ namespace Game.Entities
{ {
hasFilteredQuestPackageReward = true; hasFilteredQuestPackageReward = true;
List<ItemPosCount> dest = new List<ItemPosCount>(); List<ItemPosCount> dest = new List<ItemPosCount>();
if (CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, questPackageItem.ItemID, questPackageItem.ItemCount) == InventoryResult.Ok) if (CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, questPackageItem.ItemID, questPackageItem.ItemQuantity) == InventoryResult.Ok)
{ {
Item item = StoreNewItem(dest, questPackageItem.ItemID, true, ItemEnchantment.GenerateItemRandomPropertyId(questPackageItem.ItemID)); Item item = StoreNewItem(dest, questPackageItem.ItemID, true, ItemEnchantment.GenerateItemRandomPropertyId(questPackageItem.ItemID));
SendNewItem(item, questPackageItem.ItemCount, true, false); SendNewItem(item, questPackageItem.ItemQuantity, true, false);
} }
} }
} }
@@ -879,10 +879,10 @@ namespace Game.Entities
continue; continue;
List<ItemPosCount> dest = new List<ItemPosCount>(); List<ItemPosCount> dest = new List<ItemPosCount>();
if (CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, questPackageItem.ItemID, questPackageItem.ItemCount) == InventoryResult.Ok) if (CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, questPackageItem.ItemID, questPackageItem.ItemQuantity) == InventoryResult.Ok)
{ {
Item item = StoreNewItem(dest, questPackageItem.ItemID, true, ItemEnchantment.GenerateItemRandomPropertyId(questPackageItem.ItemID)); Item item = StoreNewItem(dest, questPackageItem.ItemID, true, ItemEnchantment.GenerateItemRandomPropertyId(questPackageItem.ItemID));
SendNewItem(item, questPackageItem.ItemCount, true, false); SendNewItem(item, questPackageItem.ItemQuantity, true, false);
} }
} }
} }
+20 -20
View File
@@ -594,7 +594,7 @@ namespace Game.Entities
{ {
ItemEnchantmentType enchant_display_type = (ItemEnchantmentType)pEnchant.Effect[s]; ItemEnchantmentType enchant_display_type = (ItemEnchantmentType)pEnchant.Effect[s];
uint enchant_amount = pEnchant.EffectPointsMin[s]; uint enchant_amount = pEnchant.EffectPointsMin[s];
uint enchant_spell_id = pEnchant.EffectSpellID[s]; uint enchant_spell_id = pEnchant.EffectArg[s];
switch (enchant_display_type) switch (enchant_display_type)
{ {
@@ -1064,7 +1064,7 @@ namespace Game.Entities
if (proto != null) if (proto != null)
for (byte idx = 0; idx < proto.Effects.Count; ++idx) for (byte idx = 0; idx < proto.Effects.Count; ++idx)
{ {
if (proto.Effects[idx].SpellID != 0 && proto.Effects[idx].Trigger == ItemSpelltriggerType.OnUse) if (proto.Effects[idx].SpellID != 0 && proto.Effects[idx].TriggerType == ItemSpelltriggerType.OnUse)
{ {
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(proto.Effects[idx].SpellID); SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(proto.Effects[idx].SpellID);
if (spellInfo != null) if (spellInfo != null)
@@ -1158,7 +1158,7 @@ namespace Game.Entities
// remove all spells that related to this skill // remove all spells that related to this skill
foreach (var pAbility in CliDB.SkillLineAbilityStorage.Values) foreach (var pAbility in CliDB.SkillLineAbilityStorage.Values)
if (pAbility.SkillLine == id) if (pAbility.SkillLine == id)
RemoveSpell(Global.SpellMgr.GetFirstSpellInChain(pAbility.SpellID)); RemoveSpell(Global.SpellMgr.GetFirstSpellInChain(pAbility.Spell));
// Clear profession lines // Clear profession lines
if (GetUInt32Value(PlayerFields.ProfessionSkillLine1) == id) if (GetUInt32Value(PlayerFields.ProfessionSkillLine1) == id)
@@ -1396,13 +1396,13 @@ namespace Game.Entities
for (byte i = 0; i < 5; i++) for (byte i = 0; i < 5; i++)
{ {
if (Condition.LTOperandType[i] == 0) if (Condition.LtOperandType[i] == 0)
continue; continue;
uint _cur_gem = curcount[Condition.LTOperandType[i] - 1]; uint _cur_gem = curcount[Condition.LtOperandType[i] - 1];
// if have <CompareColor> use them as count, else use <value> from Condition // if have <CompareColor> use them as count, else use <value> from Condition
uint _cmp_gem = Condition.RTOperandType[i] != 0 ? curcount[Condition.RTOperandType[i] - 1] : Condition.RTOperand[i]; uint _cmp_gem = Condition.RtOperandType[i] != 0 ? curcount[Condition.RtOperandType[i] - 1] : Condition.RtOperand[i];
switch (Condition.Operator[i]) switch (Condition.Operator[i])
{ {
@@ -1507,7 +1507,7 @@ namespace Game.Entities
continue; continue;
// wrong triggering type // wrong triggering type
if (spellData.Trigger != ItemSpelltriggerType.OnUse) if (spellData.TriggerType != ItemSpelltriggerType.OnUse)
continue; continue;
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spellData.SpellID); SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spellData.SpellID);
@@ -1544,10 +1544,10 @@ namespace Game.Entities
if (pEnchant.Effect[s] != ItemEnchantmentType.UseSpell) if (pEnchant.Effect[s] != ItemEnchantmentType.UseSpell)
continue; continue;
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(pEnchant.EffectSpellID[s]); SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(pEnchant.EffectArg[s]);
if (spellInfo == null) if (spellInfo == null)
{ {
Log.outError(LogFilter.Player, "Player.CastItemUseSpell Enchant {0}, cast unknown spell {1}", enchant_id, pEnchant.EffectSpellID[s]); Log.outError(LogFilter.Player, "Player.CastItemUseSpell Enchant {0}, cast unknown spell {1}", enchant_id, pEnchant.EffectArg[s]);
continue; continue;
} }
@@ -1573,14 +1573,14 @@ namespace Game.Entities
void LearnSkillRewardedSpells(uint skillId, uint skillValue) void LearnSkillRewardedSpells(uint skillId, uint skillValue)
{ {
ulong raceMask = getRaceMask(); long raceMask = getRaceMask();
uint classMask = getClassMask(); uint classMask = getClassMask();
foreach (var ability in CliDB.SkillLineAbilityStorage.Values) foreach (var ability in CliDB.SkillLineAbilityStorage.Values)
{ {
if (ability.SkillLine != skillId) if (ability.SkillLine != skillId)
continue; continue;
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(ability.SpellID); SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(ability.Spell);
if (spellInfo == null) if (spellInfo == null)
continue; continue;
@@ -1605,12 +1605,12 @@ namespace Game.Entities
// need unlearn spell // need unlearn spell
if (skillValue < ability.MinSkillLineRank && ability.AcquireMethod == AbilytyLearnType.OnSkillValue) if (skillValue < ability.MinSkillLineRank && ability.AcquireMethod == AbilytyLearnType.OnSkillValue)
RemoveSpell(ability.SpellID); RemoveSpell(ability.Spell);
// need learn // need learn
else if (!IsInWorld) else if (!IsInWorld)
AddSpell(ability.SpellID, true, true, true, false, false, ability.SkillLine); AddSpell(ability.Spell, true, true, true, false, false, ability.SkillLine);
else else
LearnSpell(ability.SpellID, true, ability.SkillLine); LearnSpell(ability.Spell, true, ability.SkillLine);
} }
} }
@@ -2961,8 +2961,8 @@ namespace Game.Entities
PowerTypeRecord runeEntry = Global.DB2Mgr.GetPowerTypeEntry(PowerType.Runes); PowerTypeRecord runeEntry = Global.DB2Mgr.GetPowerTypeEntry(PowerType.Runes);
uint cooldown = GetRuneBaseCooldown(); uint cooldown = GetRuneBaseCooldown();
SetStatFloatValue(UnitFields.PowerRegenFlatModifier + runeIndex, (float)(1 * Time.InMilliseconds) / (float)cooldown - runeEntry.RegenerationPeace); SetStatFloatValue(UnitFields.PowerRegenFlatModifier + runeIndex, (float)(1 * Time.InMilliseconds) / (float)cooldown - runeEntry.RegenPeace);
SetStatFloatValue(UnitFields.PowerRegenInterruptedFlatModifier + runeIndex, (float)(1 * Time.InMilliseconds) / (float)cooldown - runeEntry.RegenerationCombat); SetStatFloatValue(UnitFields.PowerRegenInterruptedFlatModifier + runeIndex, (float)(1 * Time.InMilliseconds) / (float)cooldown - runeEntry.RegenCombat);
} }
public uint GetRuneCooldown(byte index) { return m_runes.Cooldown[index]; } public uint GetRuneCooldown(byte index) { return m_runes.Cooldown[index]; }
@@ -3052,7 +3052,7 @@ namespace Game.Entities
continue; continue;
// wrong triggering type // wrong triggering type
if (spellData.Trigger != ItemSpelltriggerType.ChanceOnHit) if (spellData.TriggerType != ItemSpelltriggerType.ChanceOnHit)
continue; continue;
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spellData.SpellID); SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spellData.SpellID);
@@ -3109,11 +3109,11 @@ namespace Game.Entities
continue; continue;
} }
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(pEnchant.EffectSpellID[s]); SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(pEnchant.EffectArg[s]);
if (spellInfo == null) if (spellInfo == null)
{ {
Log.outError(LogFilter.Player, "Player.CastItemCombatSpell(GUID: {0}, name: {1}, enchant: {2}): unknown spell {3} is casted, ignoring...", Log.outError(LogFilter.Player, "Player.CastItemCombatSpell(GUID: {0}, name: {1}, enchant: {2}): unknown spell {3} is casted, ignoring...",
GetGUID().ToString(), GetName(), enchant_id, pEnchant.EffectSpellID[s]); GetGUID().ToString(), GetName(), enchant_id, pEnchant.EffectArg[s]);
continue; continue;
} }
@@ -3128,7 +3128,7 @@ namespace Game.Entities
} }
// Apply spell mods // Apply spell mods
ApplySpellMod(pEnchant.EffectSpellID[s], SpellModOp.ChanceOfSuccess, ref chance); ApplySpellMod(pEnchant.EffectArg[s], SpellModOp.ChanceOfSuccess, ref chance);
// Shiv has 100% chance to apply the poison // Shiv has 100% chance to apply the poison
if (FindCurrentSpellBySpellId(5938) != null && e_slot == (byte)EnchantmentSlot.Temp) if (FindCurrentSpellBySpellId(5938) != null && e_slot == (byte)EnchantmentSlot.Temp)
+40 -40
View File
@@ -191,7 +191,7 @@ namespace Game.Entities
SetMap(Global.MapMgr.CreateMap(info.MapId, this)); SetMap(Global.MapMgr.CreateMap(info.MapId, this));
int powertype = (int)cEntry.PowerType; int powertype = (int)cEntry.DisplayPower;
SetObjectScale(1.0f); SetObjectScale(1.0f);
@@ -388,7 +388,7 @@ namespace Game.Entities
{ {
if (!iProto.Effects.Empty()) if (!iProto.Effects.Empty())
{ {
switch (iProto.Effects[0].Category) switch (iProto.Effects[0].SpellCategoryID)
{ {
case 11: // food case 11: // food
count = (uint)(GetClass() == Class.Deathknight ? 10 : 4); count = (uint)(GetClass() == Class.Deathknight ? 10 : 4);
@@ -1425,7 +1425,7 @@ namespace Game.Entities
return false; return false;
} }
if (!HasSpell(mount.SpellId)) if (!HasSpell(mount.SourceSpellID))
{ {
Log.outError(LogFilter.Player, "Mount action {0} not added into button {1} for player {2} ({3}): Player does not know this mount", action, button, GetName(), GetGUID().ToString()); Log.outError(LogFilter.Player, "Mount action {0} not added into button {1} for player {2} ({3}): Player does not know this mount", action, button, GetName(), GetGUID().ToString());
return false; return false;
@@ -1655,7 +1655,7 @@ namespace Game.Entities
if (questFactionRewEntry != null) if (questFactionRewEntry != null)
{ {
uint field = (uint)Math.Abs(quest.RewardFactionValue[i]); uint field = (uint)Math.Abs(quest.RewardFactionValue[i]);
rep = questFactionRewEntry.QuestRewFactionValue[field]; rep = questFactionRewEntry.Difficulty[field];
} }
} }
@@ -2117,7 +2117,7 @@ namespace Game.Entities
} }
public bool IsInAreaTriggerRadius(AreaTriggerRecord trigger) public bool IsInAreaTriggerRadius(AreaTriggerRecord trigger)
{ {
if (trigger == null || GetMapId() != trigger.MapID) if (trigger == null || GetMapId() != trigger.ContinentID)
return false; return false;
if (trigger.Radius > 0.0f) if (trigger.Radius > 0.0f)
@@ -3752,13 +3752,13 @@ namespace Game.Entities
if (!IsInCombat()) if (!IsInCombat())
{ {
if (powerType.RegenerationDelay != 0 && Time.GetMSTimeDiffToNow(m_combatExitTime) < powerType.RegenerationDelay) if (powerType.RegenInterruptTimeMS != 0 && Time.GetMSTimeDiffToNow(m_combatExitTime) < powerType.RegenInterruptTimeMS)
return; return;
addvalue = (powerType.RegenerationPeace + GetFloatValue(UnitFields.PowerRegenFlatModifier + (int)powerIndex)) * 0.001f * m_regenTimer; addvalue = (powerType.RegenPeace + GetFloatValue(UnitFields.PowerRegenFlatModifier + (int)powerIndex)) * 0.001f * m_regenTimer;
} }
else else
addvalue = (powerType.RegenerationCombat + GetFloatValue(UnitFields.PowerRegenInterruptedFlatModifier + (int)powerIndex)) * 0.001f * m_regenTimer; addvalue = (powerType.RegenCombat + GetFloatValue(UnitFields.PowerRegenInterruptedFlatModifier + (int)powerIndex)) * 0.001f * m_regenTimer;
WorldCfg[] RatesForPower = WorldCfg[] RatesForPower =
{ {
@@ -3793,7 +3793,7 @@ namespace Game.Entities
addvalue += GetTotalAuraModifierByMiscValue(AuraType.ModPowerRegen, (int)power) * ((power != PowerType.Energy) ? m_regenTimerCount : m_regenTimer) / (5 * Time.InMilliseconds); addvalue += GetTotalAuraModifierByMiscValue(AuraType.ModPowerRegen, (int)power) * ((power != PowerType.Energy) ? m_regenTimerCount : m_regenTimer) / (5 * Time.InMilliseconds);
} }
int minPower = powerType.RegenerationMin; int minPower = powerType.MinPower;
int maxPower = GetMaxPower(power); int maxPower = GetMaxPower(power);
if (addvalue < 0.0f) if (addvalue < 0.0f)
@@ -3812,17 +3812,17 @@ namespace Game.Entities
addvalue += m_powerFraction[powerIndex]; addvalue += m_powerFraction[powerIndex];
int integerValue = (int)Math.Abs(addvalue); int integerValue = (int)Math.Abs(addvalue);
if (powerType.RegenerationCenter != 0) if (powerType.CenterPower != 0)
{ {
if (curValue > powerType.RegenerationCenter) if (curValue > powerType.CenterPower)
{ {
addvalue = -Math.Abs(addvalue); addvalue = -Math.Abs(addvalue);
minPower = powerType.RegenerationCenter; minPower = powerType.CenterPower;
} }
else if (curValue < powerType.RegenerationCenter) else if (curValue < powerType.CenterPower)
{ {
addvalue = Math.Abs(addvalue); addvalue = Math.Abs(addvalue);
maxPower = powerType.RegenerationCenter; maxPower = powerType.CenterPower;
} }
else else
return; return;
@@ -3982,46 +3982,46 @@ namespace Game.Entities
switch (selection) switch (selection)
{ {
case 0: case 0:
if (!entry.Flags.HasAnyFlag((ushort)1)) if (!entry.Flags.HasAnyFlag((short)1))
return false; return false;
return !entry.Flags.HasAnyFlag((ushort)0x2C); return !entry.Flags.HasAnyFlag((short)0x2C);
case 1: case 1:
if (!entry.Flags.HasAnyFlag((ushort)1)) if (!entry.Flags.HasAnyFlag((short)1))
return false; return false;
if (!entry.Flags.HasAnyFlag((ushort)0x94)) if (!entry.Flags.HasAnyFlag((short)0x94))
return false; return false;
return !entry.Flags.HasAnyFlag((ushort)8); return !entry.Flags.HasAnyFlag((short)8);
case 2: case 2:
if (!entry.Flags.HasAnyFlag((ushort)1)) if (!entry.Flags.HasAnyFlag((short)1))
return false; return false;
if (!entry.Flags.HasAnyFlag((ushort)0x70)) if (!entry.Flags.HasAnyFlag((short)0x70))
return false; return false;
return !entry.Flags.HasAnyFlag((ushort)8); return !entry.Flags.HasAnyFlag((short)8);
case 3: case 3:
if (!entry.Flags.HasAnyFlag((ushort)1)) if (!entry.Flags.HasAnyFlag((short)1))
return false; return false;
if (!entry.Flags.HasAnyFlag((ushort)0x20)) if (!entry.Flags.HasAnyFlag((short)0x20))
return false; return false;
return !entry.Flags.HasAnyFlag((ushort)8); return !entry.Flags.HasAnyFlag((short)8);
case 4: case 4:
case 8: case 8:
if (!entry.Flags.HasAnyFlag((ushort)3)) if (!entry.Flags.HasAnyFlag((short)3))
return false; return false;
return !entry.Flags.HasAnyFlag((ushort)0x2C); return !entry.Flags.HasAnyFlag((short)0x2C);
case 5: case 5:
case 9: case 9:
if (!entry.Flags.HasAnyFlag((ushort)3)) if (!entry.Flags.HasAnyFlag((short)3))
return false; return false;
if (!entry.Flags.HasAnyFlag((ushort)0x94)) if (!entry.Flags.HasAnyFlag((short)0x94))
return false; return false;
return !entry.Flags.HasAnyFlag((ushort)8); return !entry.Flags.HasAnyFlag((short)8);
case 6: case 6:
case 10: case 10:
if (!entry.Flags.HasAnyFlag((ushort)3)) if (!entry.Flags.HasAnyFlag((short)3))
return false; return false;
if (!entry.Flags.HasAnyFlag((ushort)0x70)) if (!entry.Flags.HasAnyFlag((short)0x70))
return false; return false;
return !entry.Flags.HasAnyFlag((ushort)8); return !entry.Flags.HasAnyFlag((short)8);
case 7: case 7:
return true; return true;
default: default:
@@ -5143,7 +5143,7 @@ namespace Game.Entities
{ {
ChrRacesRecord rEntry = CliDB.ChrRacesStorage.LookupByKey((byte)race); ChrRacesRecord rEntry = CliDB.ChrRacesStorage.LookupByKey((byte)race);
if (rEntry != null) if (rEntry != null)
return rEntry.TeamID; return (uint)rEntry.Alliance;
Log.outError(LogFilter.Player, "Race ({0}) not found in DBC: wrong DBC files?", race); Log.outError(LogFilter.Player, "Race ({0}) not found in DBC: wrong DBC files?", race);
return TeamId.Neutral; return TeamId.Neutral;
@@ -6731,7 +6731,7 @@ namespace Game.Entities
// check node starting pos data set case if provided // check node starting pos data set case if provided
if (node.Pos.X != 0.0f || node.Pos.Y != 0.0f || node.Pos.Z != 0.0f) if (node.Pos.X != 0.0f || node.Pos.Y != 0.0f || node.Pos.Z != 0.0f)
{ {
if (node.MapID != GetMapId() || !IsInDist(node.Pos.X, node.Pos.Y, node.Pos.Z, 2 * SharedConst.InteractionDistance)) if (node.ContinentID != GetMapId() || !IsInDist(node.Pos.X, node.Pos.Y, node.Pos.Z, 2 * SharedConst.InteractionDistance))
{ {
GetSession().SendActivateTaxiReply(ActivateTaxiReply.TooFarAway); GetSession().SendActivateTaxiReply(ActivateTaxiReply.TooFarAway);
return false; return false;
@@ -6842,7 +6842,7 @@ namespace Game.Entities
m_taxi.ClearTaxiDestinations(); m_taxi.ClearTaxiDestinations();
ModifyMoney(-totalcost); ModifyMoney(-totalcost);
UpdateCriteria(CriteriaTypes.GoldSpentForTravelling, totalcost); UpdateCriteria(CriteriaTypes.GoldSpentForTravelling, totalcost);
TeleportTo(lastPathNode.MapID, lastPathNode.Pos.X, lastPathNode.Pos.Y, lastPathNode.Pos.Z, GetOrientation()); TeleportTo(lastPathNode.ContinentID, lastPathNode.Pos.X, lastPathNode.Pos.Y, lastPathNode.Pos.Z, GetOrientation());
return false; return false;
} }
else else
@@ -6863,8 +6863,8 @@ namespace Game.Entities
List<uint> nodes = new List<uint>(); List<uint> nodes = new List<uint>();
nodes.Add(entry.From); nodes.Add(entry.FromTaxiNode);
nodes.Add(entry.To); nodes.Add(entry.ToTaxiNode);
return ActivateTaxiPathTo(nodes, null, spellid); return ActivateTaxiPathTo(nodes, null, spellid);
} }
@@ -6905,7 +6905,7 @@ namespace Game.Entities
var prevNode = nodeList[i - 1]; var prevNode = nodeList[i - 1];
// skip nodes at another map // skip nodes at another map
if (node.MapID != GetMapId()) if (node.ContinentID != GetMapId())
continue; continue;
distPrev = distNext; distPrev = distNext;
@@ -7054,7 +7054,7 @@ namespace Game.Entities
} }
public bool IsSpellFitByClassAndRace(uint spell_id) public bool IsSpellFitByClassAndRace(uint spell_id)
{ {
ulong racemask = getRaceMask(); long racemask = getRaceMask();
uint classmask = getClassMask(); uint classmask = getClassMask();
var bounds = Global.SpellMgr.GetSkillLineAbilityMapBounds(spell_id); var bounds = Global.SpellMgr.GetSkillLineAbilityMapBounds(spell_id);
+1 -1
View File
@@ -538,7 +538,7 @@ namespace Game.Entities
PowerTypeRecord powerTypeEntry = Global.DB2Mgr.GetPowerTypeEntry(powerType); PowerTypeRecord powerTypeEntry = Global.DB2Mgr.GetPowerTypeEntry(powerType);
if (powerTypeEntry != null) if (powerTypeEntry != null)
return powerTypeEntry.MaxPower; return powerTypeEntry.MaxBasePower;
return 0; return 0;
} }
+9 -9
View File
@@ -37,8 +37,8 @@ namespace Game.Entities
// Initialize here // Initialize here
foreach (TaxiPathRecord path in CliDB.TaxiPathStorage.Values) foreach (TaxiPathRecord path in CliDB.TaxiPathStorage.Values)
{ {
TaxiNodesRecord from = CliDB.TaxiNodesStorage.LookupByKey(path.From); TaxiNodesRecord from = CliDB.TaxiNodesStorage.LookupByKey(path.FromTaxiNode);
TaxiNodesRecord to = CliDB.TaxiNodesStorage.LookupByKey(path.To); TaxiNodesRecord to = CliDB.TaxiNodesStorage.LookupByKey(path.ToTaxiNode);
if (from != null && to != null && from.Flags.HasAnyFlag(TaxiNodeFlags.Alliance | TaxiNodeFlags.Horde) && to.Flags.HasAnyFlag(TaxiNodeFlags.Alliance | TaxiNodeFlags.Horde)) if (from != null && to != null && from.Flags.HasAnyFlag(TaxiNodeFlags.Alliance | TaxiNodeFlags.Horde) && to.Flags.HasAnyFlag(TaxiNodeFlags.Alliance | TaxiNodeFlags.Horde))
AddVerticeAndEdgeFromNodeInfo(from, to, path.Id, edges); AddVerticeAndEdgeFromNodeInfo(from, to, path.Id, edges);
} }
@@ -62,7 +62,7 @@ namespace Game.Entities
uint GetVertexIDFromNodeID(TaxiNodesRecord node) uint GetVertexIDFromNodeID(TaxiNodesRecord node)
{ {
return node.LearnableIndex; return node.CharacterBitNumber;
} }
int GetVertexCount() int GetVertexCount()
@@ -105,8 +105,8 @@ namespace Game.Entities
uint map1, map2; uint map1, map2;
Vector2 pos1, pos2; Vector2 pos1, pos2;
Global.DB2Mgr.DeterminaAlternateMapPosition(nodes[i - 1].MapID, nodes[i - 1].Loc.X, nodes[i - 1].Loc.Y, nodes[i - 1].Loc.Z, out map1, out pos1); Global.DB2Mgr.DeterminaAlternateMapPosition(nodes[i - 1].ContinentID, nodes[i - 1].Loc.X, nodes[i - 1].Loc.Y, nodes[i - 1].Loc.Z, out map1, out pos1);
Global.DB2Mgr.DeterminaAlternateMapPosition(nodes[i].MapID, nodes[i].Loc.X, nodes[i].Loc.Y, nodes[i].Loc.Z, out map2, out pos2); Global.DB2Mgr.DeterminaAlternateMapPosition(nodes[i].ContinentID, nodes[i].Loc.X, nodes[i].Loc.Y, nodes[i].Loc.Z, out map2, out pos2);
if (map1 != map2) if (map1 != map2)
continue; continue;
@@ -172,11 +172,11 @@ namespace Game.Entities
uint CreateVertexFromFromNodeInfoIfNeeded(TaxiNodesRecord node) uint CreateVertexFromFromNodeInfoIfNeeded(TaxiNodesRecord node)
{ {
//Check if we need a new one or if it may be already created //Check if we need a new one or if it may be already created
if (m_vertices.Length <= node.LearnableIndex) if (m_vertices.Length <= node.CharacterBitNumber)
Array.Resize(ref m_vertices, (int)node.LearnableIndex + 1); Array.Resize(ref m_vertices, (int)node.CharacterBitNumber + 1);
m_vertices[node.LearnableIndex] = node; m_vertices[node.CharacterBitNumber] = node;
return node.LearnableIndex; return node.CharacterBitNumber;
} }
TaxiNodesRecord[] m_vertices = new TaxiNodesRecord[0]; TaxiNodesRecord[] m_vertices = new TaxiNodesRecord[0];
+2 -2
View File
@@ -337,7 +337,7 @@ namespace Game.Entities
public bool IsGuardianPet() public bool IsGuardianPet()
{ {
return IsPet() || (m_Properties != null && m_Properties.Category == SummonCategory.Pet); return IsPet() || (m_Properties != null && m_Properties.Control == SummonCategory.Pet);
} }
public override Unit GetOwner() { return m_owner; } public override Unit GetOwner() { return m_owner; }
@@ -373,7 +373,7 @@ namespace Game.Entities
m_bonusSpellDamage = 0; m_bonusSpellDamage = 0;
m_unitTypeMask |= UnitTypeMask.Guardian; m_unitTypeMask |= UnitTypeMask.Guardian;
if (properties != null && (properties.Type == SummonType.Pet || properties.Category == SummonCategory.Pet)) if (properties != null && (properties.Title == SummonType.Pet || properties.Control == SummonCategory.Pet))
{ {
m_unitTypeMask |= UnitTypeMask.ControlableGuardian; m_unitTypeMask |= UnitTypeMask.ControlableGuardian;
InitCharmInfo(); InitCharmInfo();
+7 -7
View File
@@ -213,15 +213,15 @@ namespace Game.Entities
MoveToNextWaypoint(); MoveToNextWaypoint();
Global.ScriptMgr.OnRelocate(this, _currentFrame.Node.NodeIndex, _currentFrame.Node.MapID, _currentFrame.Node.Loc.X, _currentFrame.Node.Loc.Y, _currentFrame.Node.Loc.Z); Global.ScriptMgr.OnRelocate(this, _currentFrame.Node.NodeIndex, _currentFrame.Node.ContinentID, _currentFrame.Node.Loc.X, _currentFrame.Node.Loc.Y, _currentFrame.Node.Loc.Z);
Log.outDebug(LogFilter.Transport, "Transport {0} ({1}) moved to node {2} {3} {4} {5} {6}", GetEntry(), GetName(), _currentFrame.Node.NodeIndex, _currentFrame.Node.MapID, Log.outDebug(LogFilter.Transport, "Transport {0} ({1}) moved to node {2} {3} {4} {5} {6}", GetEntry(), GetName(), _currentFrame.Node.NodeIndex, _currentFrame.Node.ContinentID,
_currentFrame.Node.Loc.X, _currentFrame.Node.Loc.Y, _currentFrame.Node.Loc.Z); _currentFrame.Node.Loc.X, _currentFrame.Node.Loc.Y, _currentFrame.Node.Loc.Z);
// Departure event // Departure event
var nextframe = GetKeyFrames()[_nextFrame]; var nextframe = GetKeyFrames()[_nextFrame];
if (_currentFrame.IsTeleportFrame()) if (_currentFrame.IsTeleportFrame())
if (TeleportTransport(nextframe.Node.MapID, nextframe.Node.Loc.X, nextframe.Node.Loc.Y, nextframe.Node.Loc.Z, nextframe.InitialOrientation)) if (TeleportTransport(nextframe.Node.ContinentID, nextframe.Node.Loc.X, nextframe.Node.Loc.Y, nextframe.Node.Loc.Z, nextframe.InitialOrientation))
return; return;
} }
@@ -399,7 +399,7 @@ namespace Game.Entities
UnitTypeMask mask = UnitTypeMask.Summon; UnitTypeMask mask = UnitTypeMask.Summon;
if (properties != null) if (properties != null)
{ {
switch (properties.Category) switch (properties.Control)
{ {
case SummonCategory.Pet: case SummonCategory.Pet:
mask = UnitTypeMask.Guardian; mask = UnitTypeMask.Guardian;
@@ -414,7 +414,7 @@ namespace Game.Entities
case SummonCategory.Ally: case SummonCategory.Ally:
case SummonCategory.Unk: case SummonCategory.Unk:
{ {
switch (properties.Type) switch (properties.Title)
{ {
case SummonType.Minion: case SummonType.Minion:
case SummonType.Guardian: case SummonType.Guardian:
@@ -664,7 +664,7 @@ namespace Game.Entities
var nextFrame = GetKeyFrames()[_nextFrame]; var nextFrame = GetKeyFrames()[_nextFrame];
_delayedTeleport = false; _delayedTeleport = false;
Map newMap = Global.MapMgr.CreateBaseMap(nextFrame.Node.MapID); Map newMap = Global.MapMgr.CreateBaseMap(nextFrame.Node.ContinentID);
GetMap().RemoveFromMap(this, false); GetMap().RemoveFromMap(this, false);
SetMap(newMap); SetMap(newMap);
@@ -684,7 +684,7 @@ namespace Game.Entities
switch (obj.GetTypeId()) switch (obj.GetTypeId())
{ {
case TypeId.Player: case TypeId.Player:
if (!obj.ToPlayer().TeleportTo(nextFrame.Node.MapID, destX, destY, destZ, destO, TeleportToOptions.NotLeaveTransport)) if (!obj.ToPlayer().TeleportTo(nextFrame.Node.ContinentID, destX, destY, destZ, destO, TeleportToOptions.NotLeaveTransport))
RemovePassenger(obj); RemovePassenger(obj);
break; break;
case TypeId.DynamicObject: case TypeId.DynamicObject:
+8 -8
View File
@@ -687,7 +687,7 @@ namespace Game.Entities
if (mountCapability == null) if (mountCapability == null)
continue; continue;
if (ridingSkill < mountCapability.RequiredRidingSkill) if (ridingSkill < mountCapability.ReqRidingSkill)
continue; continue;
if (!mountCapability.Flags.HasAnyFlag(MountCapabilityFlags.IgnoreRestrictions)) if (!mountCapability.Flags.HasAnyFlag(MountCapabilityFlags.IgnoreRestrictions))
@@ -721,19 +721,19 @@ namespace Game.Entities
else if (!mountCapability.Flags.HasAnyFlag(MountCapabilityFlags.Float)) else if (!mountCapability.Flags.HasAnyFlag(MountCapabilityFlags.Float))
continue; continue;
if (mountCapability.RequiredMap != -1 && if (mountCapability.ReqMapID != -1 &&
GetMapId() != mountCapability.RequiredMap && GetMapId() != mountCapability.ReqMapID &&
GetMap().GetEntry().CosmeticParentMapID != mountCapability.RequiredMap && GetMap().GetEntry().CosmeticParentMapID != mountCapability.ReqMapID &&
GetMap().GetEntry().ParentMapID != mountCapability.RequiredMap) GetMap().GetEntry().ParentMapID != mountCapability.ReqMapID)
continue; continue;
if (mountCapability.RequiredArea != 0 && !Global.DB2Mgr.IsInArea(areaId, mountCapability.RequiredArea)) if (mountCapability.ReqAreaID != 0 && !Global.DB2Mgr.IsInArea(areaId, mountCapability.ReqAreaID))
continue; continue;
if (mountCapability.RequiredAura != 0 && !HasAura(mountCapability.RequiredAura)) if (mountCapability.ReqSpellAuraID != 0 && !HasAura(mountCapability.ReqSpellAuraID))
continue; continue;
if (mountCapability.RequiredSpell != 0 && !HasSpell(mountCapability.RequiredSpell)) if (mountCapability.ReqSpellKnownID != 0 && !HasSpell(mountCapability.ReqSpellKnownID))
continue; continue;
return mountCapability; return mountCapability;
+2 -2
View File
@@ -198,7 +198,7 @@ namespace Game.Entities
if (minion.HasUnitTypeMask(UnitTypeMask.Guardian)) if (minion.HasUnitTypeMask(UnitTypeMask.Guardian))
AddGuidValue(UnitFields.Summon, minion.GetGUID()); AddGuidValue(UnitFields.Summon, minion.GetGUID());
if (minion.m_Properties != null && minion.m_Properties.Type == SummonType.Minipet) if (minion.m_Properties != null && minion.m_Properties.Title == SummonType.Minipet)
{ {
SetCritterGUID(minion.GetGUID()); SetCritterGUID(minion.GetGUID());
if (GetTypeId() == TypeId.Player) if (GetTypeId() == TypeId.Player)
@@ -228,7 +228,7 @@ namespace Game.Entities
m_Controlled.Remove(minion); m_Controlled.Remove(minion);
if (minion.m_Properties != null && minion.m_Properties.Type == SummonType.Minipet) if (minion.m_Properties != null && minion.m_Properties.Title == SummonType.Minipet)
{ {
if (GetCritterGUID() == minion.GetGUID()) if (GetCritterGUID() == minion.GetGUID())
SetCritterGUID(ObjectGuid.Empty); SetCritterGUID(ObjectGuid.Empty);
+2 -2
View File
@@ -2991,7 +2991,7 @@ namespace Game.Entities
{ {
if (spellInfo.RangeEntry == null) if (spellInfo.RangeEntry == null)
return 0; return 0;
if (spellInfo.RangeEntry.MaxRangeFriend == spellInfo.RangeEntry.MaxRangeHostile) if (spellInfo.RangeEntry.RangeMax[0] == spellInfo.RangeEntry.RangeMax[1])
return spellInfo.GetMaxRange(); return spellInfo.GetMaxRange();
if (!target) if (!target)
return spellInfo.GetMaxRange(true); return spellInfo.GetMaxRange(true);
@@ -3002,7 +3002,7 @@ namespace Game.Entities
{ {
if (spellInfo.RangeEntry == null) if (spellInfo.RangeEntry == null)
return 0; return 0;
if (spellInfo.RangeEntry.MinRangeFriend == spellInfo.RangeEntry.MinRangeHostile) if (spellInfo.RangeEntry.RangeMin[0] == spellInfo.RangeEntry.RangeMin[1])
return spellInfo.GetMinRange(); return spellInfo.GetMinRange();
if (!target) if (!target)
return spellInfo.GetMinRange(true); return spellInfo.GetMinRange(true);
+8 -8
View File
@@ -1175,8 +1175,8 @@ namespace Game.Entities
{ {
ArtifactAppearanceRecord artifactAppearance = CliDB.ArtifactAppearanceStorage.LookupByKey(artifact.GetModifier(ItemModifier.ArtifactAppearanceId)); ArtifactAppearanceRecord artifactAppearance = CliDB.ArtifactAppearanceStorage.LookupByKey(artifact.GetModifier(ItemModifier.ArtifactAppearanceId));
if (artifactAppearance != null) if (artifactAppearance != null)
if ((ShapeShiftForm)artifactAppearance.ModifiesShapeshiftFormDisplay == form) if ((ShapeShiftForm)artifactAppearance.OverrideShapeshiftFormID == form)
return artifactAppearance.ShapeshiftDisplayID; return artifactAppearance.OverrideShapeshiftDisplayID;
} }
} }
@@ -1892,17 +1892,17 @@ namespace Game.Entities
else if (GetTypeId() == TypeId.Player) else if (GetTypeId() == TypeId.Player)
{ {
ChrClassesRecord cEntry = CliDB.ChrClassesStorage.LookupByKey(GetClass()); ChrClassesRecord cEntry = CliDB.ChrClassesStorage.LookupByKey(GetClass());
if (cEntry != null && cEntry.PowerType < PowerType.Max) if (cEntry != null && cEntry.DisplayPower < PowerType.Max)
displayPower = cEntry.PowerType; displayPower = cEntry.DisplayPower;
} }
else if (GetTypeId() == TypeId.Unit) else if (GetTypeId() == TypeId.Unit)
{ {
Vehicle vehicle = GetVehicle(); Vehicle vehicle = GetVehicleKit();
if (vehicle) if (vehicle)
{ {
PowerDisplayRecord powerDisplay = CliDB.PowerDisplayStorage.LookupByKey(vehicle.GetVehicleInfo().PowerDisplayID[0]); PowerDisplayRecord powerDisplay = CliDB.PowerDisplayStorage.LookupByKey(vehicle.GetVehicleInfo().PowerDisplayID[0]);
if (powerDisplay != null) if (powerDisplay != null)
displayPower = (PowerType)powerDisplay.PowerType; displayPower = (PowerType)powerDisplay.ActualType;
else if (GetClass() == Class.Rogue) else if (GetClass() == Class.Rogue)
displayPower = PowerType.Energy; displayPower = PowerType.Energy;
} }
@@ -2097,9 +2097,9 @@ namespace Game.Entities
{ {
return (Race)GetByteValue(UnitFields.Bytes0, 0); return (Race)GetByteValue(UnitFields.Bytes0, 0);
} }
public ulong getRaceMask() public long getRaceMask()
{ {
return (1ul << ((int)GetRace() - 1)); return (1 << ((int)GetRace() - 1));
} }
public Class GetClass() public Class GetClass()
{ {
+6 -6
View File
@@ -75,7 +75,7 @@ namespace Game.Entities
{ {
PowerDisplayRecord powerDisplay = CliDB.PowerDisplayStorage.LookupByKey(_vehicleInfo.PowerDisplayID[0]); PowerDisplayRecord powerDisplay = CliDB.PowerDisplayStorage.LookupByKey(_vehicleInfo.PowerDisplayID[0]);
if (powerDisplay != null) if (powerDisplay != null)
_me.SetPowerType((PowerType)powerDisplay.PowerType); _me.SetPowerType((PowerType)powerDisplay.ActualType);
else if (_me.GetClass() == Class.Rogue) else if (_me.GetClass() == Class.Rogue)
_me.SetPowerType(PowerType.Energy); _me.SetPowerType(PowerType.Energy);
} }
@@ -343,12 +343,12 @@ namespace Game.Entities
_me.SetFlag64(UnitFields.NpcFlags, (_me.IsTypeId(TypeId.Player) ? NPCFlags.PlayerVehicle : NPCFlags.SpellClick)); _me.SetFlag64(UnitFields.NpcFlags, (_me.IsTypeId(TypeId.Player) ? NPCFlags.PlayerVehicle : NPCFlags.SpellClick));
// Remove UNIT_FLAG_NOT_SELECTABLE if passenger did not have it before entering vehicle // Remove UNIT_FLAG_NOT_SELECTABLE if passenger did not have it before entering vehicle
if (seat.Value.SeatInfo.Flags[0].HasAnyFlag((uint)VehicleSeatFlags.PassengerNotSelectable) && !seat.Value.Passenger.IsUnselectable) if (seat.Value.SeatInfo.Flags.HasAnyFlag(VehicleSeatFlags.PassengerNotSelectable) && !seat.Value.Passenger.IsUnselectable)
unit.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable); unit.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable);
seat.Value.Passenger.Reset(); seat.Value.Passenger.Reset();
if (_me.IsTypeId(TypeId.Unit) && unit.IsTypeId(TypeId.Player) && seat.Value.SeatInfo.Flags[0].HasAnyFlag((uint)VehicleSeatFlags.CanControl)) if (_me.IsTypeId(TypeId.Unit) && unit.IsTypeId(TypeId.Player) && seat.Value.SeatInfo.Flags.HasAnyFlag(VehicleSeatFlags.CanControl))
_me.RemoveCharmedBy(unit); _me.RemoveCharmedBy(unit);
if (_me.IsInWorld) if (_me.IsInWorld)
@@ -579,11 +579,11 @@ namespace Game.Entities
player.StopCastingCharm(); player.StopCastingCharm();
player.StopCastingBindSight(); player.StopCastingBindSight();
player.SendOnCancelExpectedVehicleRideAura(); player.SendOnCancelExpectedVehicleRideAura();
if (!veSeat.Flags[1].HasAnyFlag((uint)VehicleSeatFlagsB.KeepPet)) if (!veSeat.FlagsB.HasAnyFlag(VehicleSeatFlagsB.KeepPet))
player.UnsummonPetTemporaryIfAny(); player.UnsummonPetTemporaryIfAny();
} }
if (Seat.Value.SeatInfo.Flags[0].HasAnyFlag((uint)VehicleSeatFlags.PassengerNotSelectable)) if (Seat.Value.SeatInfo.Flags.HasAnyFlag(VehicleSeatFlags.PassengerNotSelectable))
Passenger.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable); Passenger.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable);
Passenger.m_movementInfo.transport.pos.Relocate(veSeat.AttachmentOffset.X, veSeat.AttachmentOffset.Y, veSeat.AttachmentOffset.Z); Passenger.m_movementInfo.transport.pos.Relocate(veSeat.AttachmentOffset.X, veSeat.AttachmentOffset.Y, veSeat.AttachmentOffset.Z);
@@ -592,7 +592,7 @@ namespace Game.Entities
Passenger.m_movementInfo.transport.guid = Target.GetBase().GetGUID(); Passenger.m_movementInfo.transport.guid = Target.GetBase().GetGUID();
if (Target.GetBase().IsTypeId(TypeId.Unit) && Passenger.IsTypeId(TypeId.Player) && if (Target.GetBase().IsTypeId(TypeId.Unit) && Passenger.IsTypeId(TypeId.Player) &&
Seat.Value.SeatInfo.Flags[0].HasAnyFlag((uint)VehicleSeatFlags.CanControl)) Seat.Value.SeatInfo.Flags.HasAnyFlag(VehicleSeatFlags.CanControl))
Contract.Assert(Target.GetBase().SetCharmedBy(Passenger, CharmType.Vehicle)); // SMSG_CLIENT_CONTROL Contract.Assert(Target.GetBase().SetCharmedBy(Passenger, CharmType.Vehicle)); // SMSG_CLIENT_CONTROL
Passenger.SendClearTarget(); // SMSG_BREAK_TARGET Passenger.SendClearTarget(); // SMSG_BREAK_TARGET
+8 -8
View File
@@ -37,12 +37,12 @@ namespace Game.Garrisons
foreach (GameObjectsRecord gameObject in CliDB.GameObjectsStorage.Values) foreach (GameObjectsRecord gameObject in CliDB.GameObjectsStorage.Values)
{ {
if (gameObject.Type == GameObjectTypes.GarrisonPlot) if (gameObject.TypeID == GameObjectTypes.GarrisonPlot)
{ {
if (!_garrisonPlots.ContainsKey(gameObject.MapID)) if (!_garrisonPlots.ContainsKey(gameObject.OwnerID))
_garrisonPlots[gameObject.MapID] = new Dictionary<uint, GameObjectsRecord>(); _garrisonPlots[gameObject.OwnerID] = new Dictionary<uint, GameObjectsRecord>();
_garrisonPlots[gameObject.MapID][(uint)gameObject.Data[0]] = gameObject; _garrisonPlots[gameObject.OwnerID][(uint)gameObject.PropValue[0]] = gameObject;
} }
} }
@@ -53,7 +53,7 @@ namespace Game.Garrisons
_garrisonBuildingPlotInstances[MathFunctions.MakePair64(buildingPlotInst.GarrBuildingID, buildingPlotInst.GarrSiteLevelPlotInstID)] = buildingPlotInst.Id; _garrisonBuildingPlotInstances[MathFunctions.MakePair64(buildingPlotInst.GarrBuildingID, buildingPlotInst.GarrSiteLevelPlotInstID)] = buildingPlotInst.Id;
foreach (GarrBuildingRecord building in CliDB.GarrBuildingStorage.Values) foreach (GarrBuildingRecord building in CliDB.GarrBuildingStorage.Values)
_garrisonBuildingsByType.Add(building.Type, building.Id); _garrisonBuildingsByType.Add(building.BuildingType, building.Id);
for (var i = 0; i < 2; ++i) for (var i = 0; i < 2; ++i)
_garrisonFollowerAbilities[i] = new Dictionary<uint, GarrAbilities>(); _garrisonFollowerAbilities[i] = new Dictionary<uint, GarrAbilities>();
@@ -63,7 +63,7 @@ namespace Game.Garrisons
GarrAbilityRecord ability = CliDB.GarrAbilityStorage.LookupByKey(followerAbility.GarrAbilityID); GarrAbilityRecord ability = CliDB.GarrAbilityStorage.LookupByKey(followerAbility.GarrAbilityID);
if (ability != null) if (ability != null)
{ {
if (ability.FollowerTypeID != (uint)GarrisonFollowerType.Garrison) if (ability.GarrFollowerTypeID != (uint)GarrisonFollowerType.Garrison)
continue; continue;
if (!ability.Flags.HasAnyFlag(GarrisonAbilityFlags.CannotRoll) && ability.Flags.HasAnyFlag(GarrisonAbilityFlags.Trait)) if (!ability.Flags.HasAnyFlag(GarrisonAbilityFlags.CannotRoll) && ability.Flags.HasAnyFlag(GarrisonAbilityFlags.Trait))
@@ -92,7 +92,7 @@ namespace Game.Garrisons
public GarrSiteLevelRecord GetGarrSiteLevelEntry(uint garrSiteId, uint level) public GarrSiteLevelRecord GetGarrSiteLevelEntry(uint garrSiteId, uint level)
{ {
foreach (GarrSiteLevelRecord siteLevel in CliDB.GarrSiteLevelStorage.Values) foreach (GarrSiteLevelRecord siteLevel in CliDB.GarrSiteLevelStorage.Values)
if (siteLevel.SiteID == garrSiteId && siteLevel.Level == level) if (siteLevel.GarrSiteID == garrSiteId && siteLevel.GarrLevel == level)
return siteLevel; return siteLevel;
return null; return null;
@@ -136,7 +136,7 @@ namespace Game.Garrisons
if (!list.Empty()) if (!list.Empty())
{ {
foreach (uint buildingId in list) foreach (uint buildingId in list)
if (CliDB.GarrBuildingStorage.LookupByKey(buildingId).Level == currentLevel - 1) if (CliDB.GarrBuildingStorage.LookupByKey(buildingId).UpgradeLevel == currentLevel - 1)
return buildingId; return buildingId;
} }
+18 -18
View File
@@ -245,7 +245,7 @@ namespace Game.Garrisons
GarrisonDeleteResult garrisonDelete = new GarrisonDeleteResult(); GarrisonDeleteResult garrisonDelete = new GarrisonDeleteResult();
garrisonDelete.Result = GarrisonError.Success; garrisonDelete.Result = GarrisonError.Success;
garrisonDelete.GarrSiteID = _siteLevel.SiteID; garrisonDelete.GarrSiteID = _siteLevel.GarrSiteID;
_owner.SendPacket(garrisonDelete); _owner.SendPacket(garrisonDelete);
} }
@@ -267,7 +267,7 @@ namespace Game.Garrisons
Plot plotInfo = _plots[garrPlotInstanceId]; Plot plotInfo = _plots[garrPlotInstanceId];
plotInfo.PacketInfo.GarrPlotInstanceID = garrPlotInstanceId; plotInfo.PacketInfo.GarrPlotInstanceID = garrPlotInstanceId;
plotInfo.PacketInfo.PlotPos.Relocate(gameObject.Position.X, gameObject.Position.Y, gameObject.Position.Z, 2 * (float)Math.Acos(gameObject.RotationW)); plotInfo.PacketInfo.PlotPos.Relocate(gameObject.Pos.X, gameObject.Pos.Y, gameObject.Pos.Z, 2 * (float)Math.Acos(gameObject.Rot[3]));
plotInfo.PacketInfo.PlotType = plot.PlotType; plotInfo.PacketInfo.PlotType = plot.PlotType;
plotInfo.EmptyGameObjectId = gameObject.Id; plotInfo.EmptyGameObjectId = gameObject.Id;
plotInfo.GarrSiteLevelPlotInstId = plots[i].Id; plotInfo.GarrSiteLevelPlotInstId = plots[i].Id;
@@ -366,7 +366,7 @@ namespace Game.Garrisons
if (plot.BuildingInfo.PacketInfo.HasValue) if (plot.BuildingInfo.PacketInfo.HasValue)
{ {
oldBuildingId = plot.BuildingInfo.PacketInfo.Value.GarrBuildingID; oldBuildingId = plot.BuildingInfo.PacketInfo.Value.GarrBuildingID;
if (CliDB.GarrBuildingStorage.LookupByKey(oldBuildingId).Type != building.Type) if (CliDB.GarrBuildingStorage.LookupByKey(oldBuildingId).BuildingType != building.BuildingType)
plot.ClearBuildingInfo(_owner); plot.ClearBuildingInfo(_owner);
} }
@@ -378,8 +378,8 @@ namespace Game.Garrisons
map.AddToMap(go); map.AddToMap(go);
} }
_owner.ModifyCurrency((CurrencyTypes)building.CostCurrencyID, -building.CostCurrencyAmount, false, true); _owner.ModifyCurrency((CurrencyTypes)building.CurrencyTypeID, -building.CurrencyQty, false, true);
_owner.ModifyMoney(-building.CostMoney * MoneyConstants.Gold, false); _owner.ModifyMoney(-building.GoldCost * MoneyConstants.Gold, false);
if (oldBuildingId != 0) if (oldBuildingId != 0)
{ {
@@ -418,13 +418,13 @@ namespace Game.Garrisons
GarrBuildingRecord constructing = CliDB.GarrBuildingStorage.LookupByKey(buildingRemoved.GarrBuildingID); GarrBuildingRecord constructing = CliDB.GarrBuildingStorage.LookupByKey(buildingRemoved.GarrBuildingID);
// Refund construction/upgrade cost // Refund construction/upgrade cost
_owner.ModifyCurrency((CurrencyTypes)constructing.CostCurrencyID, constructing.CostCurrencyAmount, false, true); _owner.ModifyCurrency((CurrencyTypes)constructing.CurrencyTypeID, constructing.CurrencyQty, false, true);
_owner.ModifyMoney(constructing.CostMoney * MoneyConstants.Gold, false); _owner.ModifyMoney(constructing.GoldCost * MoneyConstants.Gold, false);
if (constructing.Level > 1) if (constructing.UpgradeLevel > 1)
{ {
// Restore previous level building // Restore previous level building
uint restored = Global.GarrisonMgr.GetPreviousLevelBuilding(constructing.Type, constructing.Level); uint restored = Global.GarrisonMgr.GetPreviousLevelBuilding(constructing.BuildingType, constructing.UpgradeLevel);
Contract.Assert(restored != 0); Contract.Assert(restored != 0);
GarrisonPlaceBuildingResult placeBuildingResult = new GarrisonPlaceBuildingResult(); GarrisonPlaceBuildingResult placeBuildingResult = new GarrisonPlaceBuildingResult();
@@ -493,7 +493,7 @@ namespace Game.Garrisons
follower.PacketInfo.DbID = dbId; follower.PacketInfo.DbID = dbId;
follower.PacketInfo.GarrFollowerID = garrFollowerId; follower.PacketInfo.GarrFollowerID = garrFollowerId;
follower.PacketInfo.Quality = followerEntry.Quality; // TODO: handle magic upgrades follower.PacketInfo.Quality = followerEntry.Quality; // TODO: handle magic upgrades
follower.PacketInfo.FollowerLevel = followerEntry.Level; follower.PacketInfo.FollowerLevel = followerEntry.FollowerLevel;
follower.PacketInfo.ItemLevelWeapon = followerEntry.ItemLevelWeapon; follower.PacketInfo.ItemLevelWeapon = followerEntry.ItemLevelWeapon;
follower.PacketInfo.ItemLevelArmor = followerEntry.ItemLevelArmor; follower.PacketInfo.ItemLevelArmor = followerEntry.ItemLevelArmor;
follower.PacketInfo.Xp = 0; follower.PacketInfo.Xp = 0;
@@ -521,7 +521,7 @@ namespace Game.Garrisons
GarrisonInfo garrison = new GarrisonInfo(); GarrisonInfo garrison = new GarrisonInfo();
garrison.GarrTypeID = GarrisonType.Garrison; garrison.GarrTypeID = GarrisonType.Garrison;
garrison.GarrSiteID = _siteLevel.SiteID; garrison.GarrSiteID = _siteLevel.GarrSiteID;
garrison.GarrSiteLevelID = _siteLevel.Id; garrison.GarrSiteLevelID = _siteLevel.Id;
garrison.NumFollowerActivationsRemaining = _followerActivationsRemainingToday; garrison.NumFollowerActivationsRemaining = _followerActivationsRemainingToday;
foreach (var plot in _plots.Values) foreach (var plot in _plots.Values)
@@ -602,7 +602,7 @@ namespace Game.Garrisons
return GarrisonError.InvalidPlotBuilding; return GarrisonError.InvalidPlotBuilding;
// Cannot place buldings of higher level than garrison level // Cannot place buldings of higher level than garrison level
if (building.Level > _siteLevel.Level) if (building.UpgradeLevel > _siteLevel.MaxBuildingLevel)
return GarrisonError.InvalidBuildingId; return GarrisonError.InvalidBuildingId;
if (building.Flags.HasAnyFlag(GarrisonBuildingFlags.NeedsPlan)) if (building.Flags.HasAnyFlag(GarrisonBuildingFlags.NeedsPlan))
@@ -620,16 +620,16 @@ namespace Game.Garrisons
if (p.Value.BuildingInfo.PacketInfo.HasValue) if (p.Value.BuildingInfo.PacketInfo.HasValue)
{ {
existingBuilding = CliDB.GarrBuildingStorage.LookupByKey(p.Value.BuildingInfo.PacketInfo.Value.GarrBuildingID); existingBuilding = CliDB.GarrBuildingStorage.LookupByKey(p.Value.BuildingInfo.PacketInfo.Value.GarrBuildingID);
if (existingBuilding.Type == building.Type) if (existingBuilding.BuildingType == building.BuildingType)
if (p.Key != garrPlotInstanceId || existingBuilding.Level + 1 != building.Level) // check if its an upgrade in same plot if (p.Key != garrPlotInstanceId || existingBuilding.UpgradeLevel + 1 != building.UpgradeLevel) // check if its an upgrade in same plot
return GarrisonError.BuildingExists; return GarrisonError.BuildingExists;
} }
} }
if (!_owner.HasCurrency(building.CostCurrencyID, (uint)building.CostCurrencyAmount)) if (!_owner.HasCurrency(building.CurrencyTypeID, (uint)building.CurrencyQty))
return GarrisonError.NotEnoughCurrency; return GarrisonError.NotEnoughCurrency;
if (!_owner.HasEnoughMoney(building.CostMoney * MoneyConstants.Gold)) if (!_owner.HasEnoughMoney(building.GoldCost * MoneyConstants.Gold))
return GarrisonError.NotEnoughGold; return GarrisonError.NotEnoughGold;
// New building cannot replace another building currently under construction // New building cannot replace another building currently under construction
@@ -673,7 +673,7 @@ namespace Game.Garrisons
if (PacketInfo.HasValue) if (PacketInfo.HasValue)
{ {
GarrBuildingRecord building = CliDB.GarrBuildingStorage.LookupByKey(PacketInfo.Value.GarrBuildingID); GarrBuildingRecord building = CliDB.GarrBuildingStorage.LookupByKey(PacketInfo.Value.GarrBuildingID);
if (PacketInfo.Value.TimeBuilt + building.BuildDuration <= Time.UnixTime) if (PacketInfo.Value.TimeBuilt + building.BuildSeconds <= Time.UnixTime)
return true; return true;
} }
@@ -696,7 +696,7 @@ namespace Game.Garrisons
GarrPlotRecord plot = CliDB.GarrPlotStorage.LookupByKey(plotInstance.GarrPlotID); GarrPlotRecord plot = CliDB.GarrPlotStorage.LookupByKey(plotInstance.GarrPlotID);
GarrBuildingRecord building = CliDB.GarrBuildingStorage.LookupByKey(BuildingInfo.PacketInfo.Value.GarrBuildingID); GarrBuildingRecord building = CliDB.GarrBuildingStorage.LookupByKey(BuildingInfo.PacketInfo.Value.GarrBuildingID);
entry = faction == GarrisonFactionIndex.Horde ? plot.HordeConstructionGameObjectID : plot.AllianceConstructionGameObjectID; entry = faction == GarrisonFactionIndex.Horde ? plot.HordeConstructObjID : plot.AllianceConstructObjID;
if (BuildingInfo.PacketInfo.Value.Active || entry == 0) if (BuildingInfo.PacketInfo.Value.Active || entry == 0)
entry = faction == GarrisonFactionIndex.Horde ? building.HordeGameObjectID : building.AllianceGameObjectID; entry = faction == GarrisonFactionIndex.Horde ? building.HordeGameObjectID : building.AllianceGameObjectID;
} }
+24 -24
View File
@@ -900,7 +900,7 @@ namespace Game
if (mapEntry == null if (mapEntry == null
|| mapEntry.CorpseMapID < 0 || mapEntry.CorpseMapID < 0
|| mapEntry.CorpseMapID != entry.MapID || mapEntry.CorpseMapID != entry.MapID
|| (mapEntry.CorpsePos.X == 0 && mapEntry.CorpsePos.Y == 0)) || (mapEntry.Corpse.X == 0 && mapEntry.Corpse.Y == 0))
{ {
// not have any corrdinates for check distance anyway // not have any corrdinates for check distance anyway
entryFar = entry; entryFar = entry;
@@ -908,8 +908,8 @@ namespace Game
} }
// at entrance map calculate distance (2D); // at entrance map calculate distance (2D);
float dist2 = (entry.Loc.X - mapEntry.CorpsePos.X) * (entry.Loc.X - mapEntry.CorpsePos.X) float dist2 = (entry.Loc.X - mapEntry.Corpse.X) * (entry.Loc.X - mapEntry.Corpse.X)
+ (entry.Loc.Y - mapEntry.CorpsePos.Y) * (entry.Loc.Y - mapEntry.CorpsePos.Y); + (entry.Loc.Y - mapEntry.Corpse.Y) * (entry.Loc.Y - mapEntry.Corpse.Y);
if (foundEntr) if (foundEntr)
{ {
if (dist2 < distEntr) if (dist2 < distEntr)
@@ -2136,7 +2136,7 @@ namespace Game
equipmentInfo.Items[i].ItemId, equipmentInfo.Items[i].AppearanceModId, i + 1, i + 1, entry, id); equipmentInfo.Items[i].ItemId, equipmentInfo.Items[i].AppearanceModId, i + 1, i + 1, entry, id);
ItemModifiedAppearanceRecord defaultAppearance = Global.DB2Mgr.GetDefaultItemModifiedAppearance(equipmentInfo.Items[i].ItemId); ItemModifiedAppearanceRecord defaultAppearance = Global.DB2Mgr.GetDefaultItemModifiedAppearance(equipmentInfo.Items[i].ItemId);
if (defaultAppearance != null) if (defaultAppearance != null)
equipmentInfo.Items[i].AppearanceModId = defaultAppearance.AppearanceModID; equipmentInfo.Items[i].AppearanceModId = defaultAppearance.ItemAppearanceModifierID;
else else
equipmentInfo.Items[i].AppearanceModId = 0; equipmentInfo.Items[i].AppearanceModId = 0;
continue; continue;
@@ -3611,17 +3611,17 @@ namespace Game
{ {
GameObjectTemplate go = new GameObjectTemplate(); GameObjectTemplate go = new GameObjectTemplate();
go.entry = db2go.Id; go.entry = db2go.Id;
go.type = db2go.Type; go.type = db2go.TypeID;
go.displayId = db2go.DisplayID; go.displayId = db2go.DisplayID;
go.name = db2go.Name[Global.WorldMgr.GetDefaultDbcLocale()]; go.name = db2go.Name[Global.WorldMgr.GetDefaultDbcLocale()];
go.size = db2go.Size; go.size = db2go.Scale;
unsafe unsafe
{ {
fixed (int* b = go.Raw.data) fixed (int* b = go.Raw.data)
{ {
for (byte x = 0; x < db2go.Data.Length; ++x) for (byte x = 0; x < db2go.PropValue.Length; ++x)
b[x] = db2go.Data[x]; b[x] = db2go.PropValue[x];
} }
} }
@@ -4414,7 +4414,7 @@ namespace Game
continue; continue;
var itemTemplate = new ItemTemplate(db2Data, sparse); var itemTemplate = new ItemTemplate(db2Data, sparse);
itemTemplate.MaxDurability = FillMaxDurability(db2Data.Class, db2Data.SubClass, sparse.inventoryType, (ItemQuality)sparse.Quality, sparse.ItemLevel); itemTemplate.MaxDurability = FillMaxDurability(db2Data.ClassID, db2Data.SubclassID, sparse.inventoryType, (ItemQuality)sparse.OverallQualityID, sparse.ItemLevel);
var itemSpecOverrides = Global.DB2Mgr.GetItemSpecOverrides(sparse.Id); var itemSpecOverrides = Global.DB2Mgr.GetItemSpecOverrides(sparse.Id);
if (itemSpecOverrides != null) if (itemSpecOverrides != null)
@@ -4454,7 +4454,7 @@ namespace Game
if (!hasPrimary || !hasSecondary) if (!hasPrimary || !hasSecondary)
continue; continue;
ChrSpecializationRecord specialization = CliDB.ChrSpecializationStorage.LookupByKey(itemSpec.SpecID); ChrSpecializationRecord specialization = CliDB.ChrSpecializationStorage.LookupByKey(itemSpec.SpecializationID);
if (specialization != null) if (specialization != null)
{ {
if (Convert.ToBoolean((1 << (specialization.ClassID - 1)) & sparse.AllowableClass)) if (Convert.ToBoolean((1 << (specialization.ClassID - 1)) & sparse.AllowableClass))
@@ -4482,7 +4482,7 @@ namespace Game
foreach (var effectEntry in CliDB.ItemEffectStorage.Values) foreach (var effectEntry in CliDB.ItemEffectStorage.Values)
{ {
var itemTemplate = ItemTemplateStorage.LookupByKey(effectEntry.ItemID); var itemTemplate = ItemTemplateStorage.LookupByKey(effectEntry.ParentItemID);
if (itemTemplate == null) if (itemTemplate == null)
continue; continue;
@@ -5223,8 +5223,8 @@ namespace Game
pInfo.PositionZ = positionZ; pInfo.PositionZ = positionZ;
pInfo.Orientation = orientation; pInfo.Orientation = orientation;
pInfo.DisplayId_m = rEntry.MaleDisplayID; pInfo.DisplayId_m = rEntry.MaleDisplayId;
pInfo.DisplayId_f = rEntry.FemaleDisplayID; pInfo.DisplayId_f = rEntry.FemaleDisplayId;
_playerInfo[currentrace][currentclass] = pInfo; _playerInfo[currentrace][currentclass] = pInfo;
@@ -9153,7 +9153,7 @@ namespace Game
foreach (var node in CliDB.TaxiNodesStorage.Values) foreach (var node in CliDB.TaxiNodesStorage.Values)
{ {
var i = node.Id; var i = node.Id;
if (node.MapID != mapid || !node.Flags.HasAnyFlag(requireFlag)) if (node.ContinentID != mapid || !node.Flags.HasAnyFlag(requireFlag))
continue; continue;
byte field = (byte)((i - 1) / 8); byte field = (byte)((i - 1) / 8);
@@ -9280,7 +9280,7 @@ namespace Game
if ((!useParentDbValue && pair.Value.target_mapId == entrance_map) || (useParentDbValue && pair.Value.target_mapId == parentId)) if ((!useParentDbValue && pair.Value.target_mapId == entrance_map) || (useParentDbValue && pair.Value.target_mapId == parentId))
{ {
AreaTriggerRecord atEntry = CliDB.AreaTriggerStorage.LookupByKey(pair.Key); AreaTriggerRecord atEntry = CliDB.AreaTriggerStorage.LookupByKey(pair.Key);
if (atEntry != null && atEntry.MapID == Map) if (atEntry != null && atEntry.ContinentID == Map)
return pair.Value; return pair.Value;
} }
} }
@@ -10076,10 +10076,10 @@ namespace Game
{ {
public ItemSpecStats(ItemRecord item, ItemSparseRecord sparse) public ItemSpecStats(ItemRecord item, ItemSparseRecord sparse)
{ {
if (item.Class == ItemClass.Weapon) if (item.ClassID == ItemClass.Weapon)
{ {
ItemType = 5; ItemType = 5;
switch ((ItemSubClassWeapon)item.SubClass) switch ((ItemSubClassWeapon)item.SubclassID)
{ {
case ItemSubClassWeapon.Axe: case ItemSubClassWeapon.Axe:
AddStat(ItemSpecStat.OneHandedAxe); AddStat(ItemSpecStat.OneHandedAxe);
@@ -10133,9 +10133,9 @@ namespace Game
break; break;
} }
} }
else if (item.Class == ItemClass.Armor) else if (item.ClassID == ItemClass.Armor)
{ {
switch ((ItemSubClassArmor)item.SubClass) switch ((ItemSubClassArmor)item.SubclassID)
{ {
case ItemSubClassArmor.Cloth: case ItemSubClassArmor.Cloth:
if (sparse.inventoryType != InventoryType.Cloak) if (sparse.inventoryType != InventoryType.Cloak)
@@ -10157,12 +10157,12 @@ namespace Game
ItemType = 4; ItemType = 4;
break; break;
default: default:
if (item.SubClass == (int)ItemSubClassArmor.Shield) if (item.SubclassID == (int)ItemSubClassArmor.Shield)
{ {
ItemType = 6; ItemType = 6;
AddStat(ItemSpecStat.Shield); AddStat(ItemSpecStat.Shield);
} }
else if (item.SubClass > (int)ItemSubClassArmor.Shield && item.SubClass <= (int)ItemSubClassArmor.Relic) else if (item.SubclassID > (int)ItemSubClassArmor.Shield && item.SubclassID <= (int)ItemSubClassArmor.Relic)
{ {
ItemType = 6; ItemType = 6;
AddStat(ItemSpecStat.Relic); AddStat(ItemSpecStat.Relic);
@@ -10172,7 +10172,7 @@ namespace Game
break; break;
} }
} }
else if (item.Class == ItemClass.Gem) else if (item.ClassID == ItemClass.Gem)
{ {
ItemType = 7; ItemType = 7;
GemPropertiesRecord gem = CliDB.GemPropertiesStorage.LookupByKey(sparse.GemProperties); GemPropertiesRecord gem = CliDB.GemPropertiesStorage.LookupByKey(sparse.GemProperties);
@@ -10206,8 +10206,8 @@ namespace Game
ItemType = 0; ItemType = 0;
for (uint i = 0; i < ItemConst.MaxStats; ++i) for (uint i = 0; i < ItemConst.MaxStats; ++i)
if (sparse.ItemStatType[i] != -1) if (sparse.StatModifierBonusStat[i] != -1)
AddModStat(sparse.ItemStatType[i]); AddModStat(sparse.StatModifierBonusStat[i]);
} }
void AddStat(ItemSpecStat statType) void AddStat(ItemSpecStat statType)
+2 -2
View File
@@ -814,7 +814,7 @@ namespace Game.Groups
ItemDisenchantLootRecord disenchant = r.GetItemDisenchantLoot(p); ItemDisenchantLootRecord disenchant = r.GetItemDisenchantLoot(p);
if (disenchant != null) if (disenchant != null)
if (m_maxEnchantingLevel >= disenchant.RequiredDisenchantSkill) if (m_maxEnchantingLevel >= disenchant.SkillRequired)
startLootRoll.ValidRolls |= RollMask.Disenchant; startLootRoll.ValidRolls |= RollMask.Disenchant;
p.SendPacket(startLootRoll); p.SendPacket(startLootRoll);
@@ -1406,7 +1406,7 @@ namespace Game.Groups
{ {
LFGDungeonsRecord dungeon = CliDB.LFGDungeonsStorage.LookupByKey(selectedDungeons.First()); LFGDungeonsRecord dungeon = CliDB.LFGDungeonsStorage.LookupByKey(selectedDungeons.First());
if (dungeon != null) if (dungeon != null)
if (dungeon.Type == LfgType.RandomDungeon) if (dungeon.TypeID == LfgType.RandomDungeon)
randomSlot= dungeon.Id; randomSlot= dungeon.Id;
} }
+1 -1
View File
@@ -63,7 +63,7 @@ namespace Game.Guilds
uint guildTeam = TeamId.Alliance; uint guildTeam = TeamId.Alliance;
ChrRacesRecord raceEntry = CliDB.ChrRacesStorage.LookupByKey(result.Read<byte>(7)); ChrRacesRecord raceEntry = CliDB.ChrRacesStorage.LookupByKey(result.Read<byte>(7));
if (raceEntry != null) if (raceEntry != null)
if (raceEntry.TeamID == 1) if (raceEntry.Alliance == 1)
guildTeam = TeamId.Horde; guildTeam = TeamId.Horde;
LFGuildSettings settings = new LFGuildSettings(listed, guildTeam, guildId, classRoles, availability, interests, level, comment); LFGuildSettings settings = new LFGuildSettings(listed, guildTeam, guildId, classRoles, availability, interests, level, comment);
+6 -6
View File
@@ -57,7 +57,7 @@ namespace Game
return; return;
if (artifactAddPower.PowerChoices[0].Rank != artifactPower.PurchasedRank + 1 || if (artifactAddPower.PowerChoices[0].Rank != artifactPower.PurchasedRank + 1 ||
artifactAddPower.PowerChoices[0].Rank > artifactPowerEntry.MaxRank) artifactAddPower.PowerChoices[0].Rank > artifactPowerEntry.MaxPurchasableRank)
return; return;
var artifactPowerLinks = Global.DB2Mgr.GetArtifactPowerLinks(artifactPower.ArtifactPowerId); var artifactPowerLinks = Global.DB2Mgr.GetArtifactPowerLinks(artifactPower.ArtifactPowerId);
@@ -74,7 +74,7 @@ namespace Game
if (artifactPowerLinkLearned == null) if (artifactPowerLinkLearned == null)
continue; continue;
if (artifactPowerLinkLearned.PurchasedRank >= artifactPowerLink.MaxRank) if (artifactPowerLinkLearned.PurchasedRank >= artifactPowerLink.MaxPurchasableRank)
{ {
hasAnyLink = true; hasAnyLink = true;
break; break;
@@ -139,18 +139,18 @@ namespace Game
if (artifactAppearanceSet == null || artifactAppearanceSet.ArtifactID != artifact.GetTemplate().GetArtifactID()) if (artifactAppearanceSet == null || artifactAppearanceSet.ArtifactID != artifact.GetTemplate().GetArtifactID())
return; return;
PlayerConditionRecord playerCondition = CliDB.PlayerConditionStorage.LookupByKey(artifactAppearance.PlayerConditionID); PlayerConditionRecord playerCondition = CliDB.PlayerConditionStorage.LookupByKey(artifactAppearance.UnlockPlayerConditionID);
if (playerCondition != null) if (playerCondition != null)
if (!ConditionManager.IsPlayerMeetingCondition(_player, playerCondition)) if (!ConditionManager.IsPlayerMeetingCondition(_player, playerCondition))
return; return;
artifact.SetAppearanceModId(artifactAppearance.AppearanceModID); artifact.SetAppearanceModId(artifactAppearance.ItemAppearanceModifierID);
artifact.SetModifier(ItemModifier.ArtifactAppearanceId, artifactAppearance.Id); artifact.SetModifier(ItemModifier.ArtifactAppearanceId, artifactAppearance.Id);
artifact.SetState(ItemUpdateState.Changed, _player); artifact.SetState(ItemUpdateState.Changed, _player);
Item childItem = _player.GetChildItemByGuid(artifact.GetChildItem()); Item childItem = _player.GetChildItemByGuid(artifact.GetChildItem());
if (childItem) if (childItem)
{ {
childItem.SetAppearanceModId(artifactAppearance.AppearanceModID); childItem.SetAppearanceModId(artifactAppearance.ItemAppearanceModifierID);
childItem.SetState(ItemUpdateState.Changed, _player); childItem.SetState(ItemUpdateState.Changed, _player);
} }
@@ -162,7 +162,7 @@ namespace Game
_player.SetVisibleItemSlot(childItem.GetSlot(), childItem); _player.SetVisibleItemSlot(childItem.GetSlot(), childItem);
// change druid form appearance // change druid form appearance
if (artifactAppearance.ShapeshiftDisplayID != 0 && artifactAppearance.ModifiesShapeshiftFormDisplay != 0 && _player.GetShapeshiftForm() == (ShapeShiftForm)artifactAppearance.ModifiesShapeshiftFormDisplay) if (artifactAppearance.OverrideShapeshiftDisplayID != 0 && artifactAppearance.OverrideShapeshiftFormID != 0 && _player.GetShapeshiftForm() == (ShapeShiftForm)artifactAppearance.OverrideShapeshiftFormID)
_player.RestoreDisplayId(); _player.RestoreDisplayId();
} }
} }
+2 -2
View File
@@ -558,7 +558,7 @@ namespace Game
GenerateRandomCharacterNameResult result = new GenerateRandomCharacterNameResult(); GenerateRandomCharacterNameResult result = new GenerateRandomCharacterNameResult();
result.Success = true; result.Success = true;
result.Name = Global.DB2Mgr.GetNameGenEntry(packet.Race, packet.Sex, GetSessionDbcLocale(), Global.WorldMgr.GetDefaultDbcLocale()); result.Name = Global.DB2Mgr.GetNameGenEntry(packet.Race, packet.Sex);
SendPacket(result); SendPacket(result);
} }
@@ -1373,7 +1373,7 @@ namespace Game
if (illusion.ItemVisual == 0 || !illusion.Flags.HasAnyFlag(EnchantmentSlotMask.Collectable)) if (illusion.ItemVisual == 0 || !illusion.Flags.HasAnyFlag(EnchantmentSlotMask.Collectable))
return false; return false;
PlayerConditionRecord condition = CliDB.PlayerConditionStorage.LookupByKey(illusion.PlayerConditionID); PlayerConditionRecord condition = CliDB.PlayerConditionStorage.LookupByKey(illusion.TransmogPlayerConditionID);
if (condition != null) if (condition != null)
if (!ConditionManager.IsPlayerMeetingCondition(_player, condition)) if (!ConditionManager.IsPlayerMeetingCondition(_player, condition))
return false; return false;
+1 -1
View File
@@ -53,7 +53,7 @@ namespace Game
{ {
VehicleSeatRecord seat = vehicle.GetSeatForPassenger(GetPlayer()); VehicleSeatRecord seat = vehicle.GetSeatForPassenger(GetPlayer());
Contract.Assert(seat != null); Contract.Assert(seat != null);
if (!seat.Flags[0].HasAnyFlag((uint)VehicleSeatFlags.CanAttack)) if (!seat.Flags.HasAnyFlag(VehicleSeatFlags.CanAttack))
{ {
SendAttackStop(enemy); SendAttackStop(enemy);
return; return;
+6 -6
View File
@@ -938,8 +938,8 @@ namespace Game
itemTarget.SetGem(i, gemData[i], gemScalingLevel); itemTarget.SetGem(i, gemData[i], gemScalingLevel);
if (gemProperties[i] != null && gemProperties[i].EnchantID != 0) if (gemProperties[i] != null && gemProperties[i].EnchantId != 0)
itemTarget.SetEnchantment(EnchantmentSlot.Sock1 + i, gemProperties[i].EnchantID, 0, 0, GetPlayer().GetGUID()); itemTarget.SetEnchantment(EnchantmentSlot.Sock1 + i, gemProperties[i].EnchantId, 0, 0, GetPlayer().GetGUID());
uint gemCount = 1; uint gemCount = 1;
GetPlayer().DestroyItemCount(gems[i], ref gemCount, true); GetPlayer().DestroyItemCount(gems[i], ref gemCount, true);
@@ -1097,16 +1097,16 @@ namespace Game
} }
// Check if player has enough currency // Check if player has enough currency
if (!_player.HasCurrency(itemUpgradeEntry.CurrencyID, itemUpgradeEntry.CurrencyCost)) if (!_player.HasCurrency(itemUpgradeEntry.CurrencyType, itemUpgradeEntry.CurrencyAmount))
{ {
Log.outDebug(LogFilter.Network, "WORLD: HandleUpgradeItems - Player has not enougth currency (ID: {0}, Cost: {1}) not found.", itemUpgradeEntry.CurrencyID, itemUpgradeEntry.CurrencyCost); Log.outDebug(LogFilter.Network, "WORLD: HandleUpgradeItems - Player has not enougth currency (ID: {0}, Cost: {1}) not found.", itemUpgradeEntry.CurrencyType, itemUpgradeEntry.CurrencyAmount);
itemUpgradeResult.Success = false; itemUpgradeResult.Success = false;
SendPacket(itemUpgradeResult); SendPacket(itemUpgradeResult);
return; return;
} }
uint currentUpgradeId = item.GetModifier(ItemModifier.UpgradeId); uint currentUpgradeId = item.GetModifier(ItemModifier.UpgradeId);
if (currentUpgradeId != itemUpgradeEntry.PrevItemUpgradeID) if (currentUpgradeId != itemUpgradeEntry.PrerequisiteID)
{ {
Log.outDebug(LogFilter.Network, "WORLD: HandleUpgradeItems - ItemUpgradeEntry ({0}) is not related to this ItemUpgradePath ({1}).", itemUpgradeEntry.Id, currentUpgradeId); Log.outDebug(LogFilter.Network, "WORLD: HandleUpgradeItems - ItemUpgradeEntry ({0}) is not related to this ItemUpgradePath ({1}).", itemUpgradeEntry.Id, currentUpgradeId);
itemUpgradeResult.Success = false; itemUpgradeResult.Success = false;
@@ -1126,7 +1126,7 @@ namespace Game
_player._ApplyItemBonuses(item, item.GetSlot(), true); _player._ApplyItemBonuses(item, item.GetSlot(), true);
item.SetState(ItemUpdateState.Changed, _player); item.SetState(ItemUpdateState.Changed, _player);
_player.ModifyCurrency((CurrencyTypes)itemUpgradeEntry.CurrencyID, -(int)itemUpgradeEntry.CurrencyCost); _player.ModifyCurrency((CurrencyTypes)itemUpgradeEntry.CurrencyType, -(int)itemUpgradeEntry.CurrencyAmount);
} }
[WorldPacketHandler(ClientOpcodes.SortBags)] [WorldPacketHandler(ClientOpcodes.SortBags)]
+3 -3
View File
@@ -152,7 +152,7 @@ namespace Game
VehicleSeatRecord seat = vehicle.GetSeatForPassenger(mover); VehicleSeatRecord seat = vehicle.GetSeatForPassenger(mover);
if (seat != null) if (seat != null)
{ {
if (seat.Flags[0].HasAnyFlag((uint)VehicleSeatFlags.AllowTurning)) if (seat.Flags.HasAnyFlag(VehicleSeatFlags.AllowTurning))
{ {
if (movementInfo.Pos.GetOrientation() != mover.GetOrientation()) if (movementInfo.Pos.GetOrientation() != mover.GetOrientation())
{ {
@@ -620,7 +620,7 @@ namespace Game
TaxiNodesRecord curDestNode = CliDB.TaxiNodesStorage.LookupByKey(curDest); TaxiNodesRecord curDestNode = CliDB.TaxiNodesStorage.LookupByKey(curDest);
// far teleport case // far teleport case
if (curDestNode != null && curDestNode.MapID != GetPlayer().GetMapId()) if (curDestNode != null && curDestNode.ContinentID != GetPlayer().GetMapId())
{ {
if (GetPlayer().GetMotionMaster().GetCurrentMovementGeneratorType() == MovementGeneratorType.Flight) if (GetPlayer().GetMotionMaster().GetCurrentMovementGeneratorType() == MovementGeneratorType.Flight)
{ {
@@ -631,7 +631,7 @@ namespace Game
TaxiPathNodeRecord node = flight.GetPath()[(int)flight.GetCurrentNode()]; TaxiPathNodeRecord node = flight.GetPath()[(int)flight.GetCurrentNode()];
flight.SkipCurrentNode(); flight.SkipCurrentNode();
GetPlayer().TeleportTo(curDestNode.MapID, node.Loc.X, node.Loc.Y, node.Loc.Z, GetPlayer().GetOrientation()); GetPlayer().TeleportTo(curDestNode.ContinentID, node.Loc.X, node.Loc.Y, node.Loc.Z, GetPlayer().GetOrientation());
} }
} }
+2 -2
View File
@@ -281,8 +281,8 @@ namespace Game
if (entranceMap != null) if (entranceMap != null)
{ {
mapID = (uint)corpseMapEntry.CorpseMapID; mapID = (uint)corpseMapEntry.CorpseMapID;
x = corpseMapEntry.CorpsePos.X; x = corpseMapEntry.Corpse.X;
y = corpseMapEntry.CorpsePos.Y; y = corpseMapEntry.Corpse.Y;
z = entranceMap.GetHeight(player.GetPhases(), x, y, MapConst.MaxHeight); z = entranceMap.GetHeight(player.GetPhases(), x, y, MapConst.MaxHeight);
} }
} }
+2 -2
View File
@@ -189,7 +189,7 @@ namespace Game
MountRecord mount = CliDB.MountStorage.LookupByKey(activateTaxi.FlyingMountID); MountRecord mount = CliDB.MountStorage.LookupByKey(activateTaxi.FlyingMountID);
if (mount != null) if (mount != null)
{ {
if (GetPlayer().HasSpell(mount.SpellId)) if (GetPlayer().HasSpell(mount.SourceSpellID))
{ {
var mountDisplays = Global.DB2Mgr.GetMountDisplays(mount.Id); var mountDisplays = Global.DB2Mgr.GetMountDisplays(mount.Id);
if (mountDisplays != null) if (mountDisplays != null)
@@ -204,7 +204,7 @@ namespace Game
}).ToList(); }).ToList();
if (!usableDisplays.Empty()) if (!usableDisplays.Empty())
preferredMountDisplay = usableDisplays.SelectRandom().DisplayID; preferredMountDisplay = usableDisplays.SelectRandom().CreatureDisplayInfoID;
} }
} }
} }
@@ -124,7 +124,7 @@ namespace Game
return; return;
} }
PlayerConditionRecord condition = CliDB.PlayerConditionStorage.LookupByKey(illusion.PlayerConditionID); PlayerConditionRecord condition = CliDB.PlayerConditionStorage.LookupByKey(illusion.TransmogPlayerConditionID);
if (condition != null) if (condition != null)
{ {
if (!ConditionManager.IsPlayerMeetingCondition(player, condition)) if (!ConditionManager.IsPlayerMeetingCondition(player, condition))
+5 -5
View File
@@ -50,7 +50,7 @@ namespace Game
if (!seat.CanSwitchFromSeat()) if (!seat.CanSwitchFromSeat())
{ {
Log.outError(LogFilter.Network, "HandleRequestVehiclePrevSeat: {0} tried to switch seats but current seatflags {1} don't permit that.", Log.outError(LogFilter.Network, "HandleRequestVehiclePrevSeat: {0} tried to switch seats but current seatflags {1} don't permit that.",
GetPlayer().GetGUID().ToString(), seat.Flags[0]); GetPlayer().GetGUID().ToString(), seat.Flags);
return; return;
} }
@@ -68,7 +68,7 @@ namespace Game
if (!seat.CanSwitchFromSeat()) if (!seat.CanSwitchFromSeat())
{ {
Log.outError(LogFilter.Network, "HandleRequestVehicleNextSeat: {0} tried to switch seats but current seatflags {1} don't permit that.", Log.outError(LogFilter.Network, "HandleRequestVehicleNextSeat: {0} tried to switch seats but current seatflags {1} don't permit that.",
GetPlayer().GetGUID().ToString(), seat.Flags[0]); GetPlayer().GetGUID().ToString(), seat.Flags);
return; return;
} }
@@ -86,7 +86,7 @@ namespace Game
if (!seat.CanSwitchFromSeat()) if (!seat.CanSwitchFromSeat())
{ {
Log.outError(LogFilter.Network, "HandleMoveChangeVehicleSeats, {0} tried to switch seats but current seatflags {1} don't permit that.", Log.outError(LogFilter.Network, "HandleMoveChangeVehicleSeats, {0} tried to switch seats but current seatflags {1} don't permit that.",
GetPlayer().GetGUID().ToString(), seat.Flags[0]); GetPlayer().GetGUID().ToString(), seat.Flags);
return; return;
} }
@@ -120,7 +120,7 @@ namespace Game
if (!seat.CanSwitchFromSeat()) if (!seat.CanSwitchFromSeat())
{ {
Log.outError(LogFilter.Network, "HandleRequestVehicleSwitchSeat: {0} tried to switch seats but current seatflags {1} don't permit that.", Log.outError(LogFilter.Network, "HandleRequestVehicleSwitchSeat: {0} tried to switch seats but current seatflags {1} don't permit that.",
GetPlayer().GetGUID().ToString(), seat.Flags[0]); GetPlayer().GetGUID().ToString(), seat.Flags);
return; return;
} }
Unit vehUnit; Unit vehUnit;
@@ -202,7 +202,7 @@ namespace Game
GetPlayer().ExitVehicle(); GetPlayer().ExitVehicle();
else else
Log.outError(LogFilter.Network, "{0} tried to exit vehicle, but seatflags {1} (ID: {2}) don't permit that.", Log.outError(LogFilter.Network, "{0} tried to exit vehicle, but seatflags {1} (ID: {2}) don't permit that.",
GetPlayer().GetGUID().ToString(), seat.Id, seat.Flags[0]); GetPlayer().GetGUID().ToString(), seat.Id, seat.Flags);
} }
} }
} }
+6 -6
View File
@@ -175,11 +175,11 @@ namespace Game.Loots
for (uint i = 0; i < stacks && lootItems.Count < limit; ++i) for (uint i = 0; i < stacks && lootItems.Count < limit; ++i)
{ {
LootItem generatedLoot = new LootItem(item); LootItem generatedLoot = new LootItem(item);
generatedLoot.context = _difficultyBonusTreeMod; generatedLoot.context = _itemContext;
generatedLoot.count = (byte)Math.Min(count, proto.GetMaxStackSize()); generatedLoot.count = (byte)Math.Min(count, proto.GetMaxStackSize());
if (_difficultyBonusTreeMod != 0) if (_itemContext != 0)
{ {
List<uint> bonusListIDs = Global.DB2Mgr.GetItemBonusTree(generatedLoot.itemid, _difficultyBonusTreeMod); List<uint> bonusListIDs = Global.DB2Mgr.GetItemBonusTree(generatedLoot.itemid, _itemContext);
generatedLoot.BonusListIDs.AddRange(bonusListIDs); generatedLoot.BonusListIDs.AddRange(bonusListIDs);
} }
lootItems.Add(generatedLoot); lootItems.Add(generatedLoot);
@@ -220,7 +220,7 @@ namespace Game.Loots
return false; return false;
} }
_difficultyBonusTreeMod = lootOwner.GetMap().GetDifficultyLootBonusTreeMod(); _itemContext = lootOwner.GetMap().GetDifficultyLootItemContext();
tab.Process(this, store.IsRatesAllowed(), (byte)lootMode); // Processing is done there, callback via Loot.AddItem() tab.Process(this, store.IsRatesAllowed(), (byte)lootMode); // Processing is done there, callback via Loot.AddItem()
@@ -830,7 +830,7 @@ namespace Game.Loots
unlootedCount = 0; unlootedCount = 0;
roundRobinPlayer = ObjectGuid.Empty; roundRobinPlayer = ObjectGuid.Empty;
i_LootValidatorRefManager.clearReferences(); i_LootValidatorRefManager.clearReferences();
_difficultyBonusTreeMod = 0; _itemContext = 0;
} }
public bool empty() { return items.Empty() && gold == 0; } public bool empty() { return items.Empty() && gold == 0; }
@@ -866,7 +866,7 @@ namespace Game.Loots
// Loot GUID // Loot GUID
ObjectGuid _GUID; ObjectGuid _GUID;
byte _difficultyBonusTreeMod; byte _itemContext;
} }
public class AELootResult public class AELootResult
+4 -4
View File
@@ -521,24 +521,24 @@ namespace Game.Maps
{ {
entry = liquidEntry.Id; entry = liquidEntry.Id;
type &= MapConst.MapLiquidTypeDarkWater; type &= MapConst.MapLiquidTypeDarkWater;
uint liqTypeIdx = liquidEntry.LiquidType; uint liqTypeIdx = liquidEntry.SoundBank;
if (entry < 21) if (entry < 21)
{ {
var area = CliDB.AreaTableStorage.LookupByKey(getArea(x, y)); var area = CliDB.AreaTableStorage.LookupByKey(getArea(x, y));
if (area != null) if (area != null)
{ {
uint overrideLiquid = area.LiquidTypeID[liquidEntry.LiquidType]; uint overrideLiquid = area.LiquidTypeID[liquidEntry.SoundBank];
if (overrideLiquid == 0 && area.ParentAreaID == 0) if (overrideLiquid == 0 && area.ParentAreaID == 0)
{ {
area = CliDB.AreaTableStorage.LookupByKey(area.ParentAreaID); area = CliDB.AreaTableStorage.LookupByKey(area.ParentAreaID);
if (area != null) if (area != null)
overrideLiquid = area.LiquidTypeID[liquidEntry.LiquidType]; overrideLiquid = area.LiquidTypeID[liquidEntry.SoundBank];
} }
var liq = CliDB.LiquidTypeStorage.LookupByKey(overrideLiquid); var liq = CliDB.LiquidTypeStorage.LookupByKey(overrideLiquid);
if (liq != null) if (liq != null)
{ {
entry = overrideLiquid; entry = overrideLiquid;
liqTypeIdx = liq.LiquidType; liqTypeIdx = liq.SoundBank;
} }
} }
} }
+8 -8
View File
@@ -1883,7 +1883,7 @@ namespace Game.Maps
uint liquidFlagType = 0; uint liquidFlagType = 0;
LiquidTypeRecord liq = CliDB.LiquidTypeStorage.LookupByKey(liquid_type); LiquidTypeRecord liq = CliDB.LiquidTypeStorage.LookupByKey(liquid_type);
if (liq != null) if (liq != null)
liquidFlagType = liq.LiquidType; liquidFlagType = liq.SoundBank;
if (liquid_type != 0 && liquid_type < 21) if (liquid_type != 0 && liquid_type < 21)
{ {
@@ -1902,7 +1902,7 @@ namespace Game.Maps
if (liq != null) if (liq != null)
{ {
liquid_type = overrideLiquid; liquid_type = overrideLiquid;
liquidFlagType = liq.LiquidType; liquidFlagType = liq.SoundBank;
} }
} }
} }
@@ -2869,15 +2869,15 @@ namespace Game.Maps
return Global.DB2Mgr.GetMapDifficultyData(GetId(), GetDifficultyID()); return Global.DB2Mgr.GetMapDifficultyData(GetId(), GetDifficultyID());
} }
public byte GetDifficultyLootBonusTreeMod() public byte GetDifficultyLootItemContext()
{ {
MapDifficultyRecord mapDifficulty = GetMapDifficulty(); MapDifficultyRecord mapDifficulty = GetMapDifficulty();
if (mapDifficulty != null && mapDifficulty.ItemBonusTreeModID != 0) if (mapDifficulty != null && mapDifficulty.ItemContext != 0)
return mapDifficulty.ItemBonusTreeModID; return mapDifficulty.ItemContext;
DifficultyRecord difficulty = CliDB.DifficultyStorage.LookupByKey(GetDifficultyID()); DifficultyRecord difficulty = CliDB.DifficultyStorage.LookupByKey(GetDifficultyID());
if (difficulty != null) if (difficulty != null)
return difficulty.ItemBonusTreeModID; return difficulty.ItemContext;
return 0; return 0;
} }
@@ -3154,7 +3154,7 @@ namespace Game.Maps
var mask = UnitTypeMask.Summon; var mask = UnitTypeMask.Summon;
if (properties != null) if (properties != null)
{ {
switch (properties.Category) switch (properties.Control)
{ {
case SummonCategory.Pet: case SummonCategory.Pet:
mask = UnitTypeMask.Guardian; mask = UnitTypeMask.Guardian;
@@ -3169,7 +3169,7 @@ namespace Game.Maps
case SummonCategory.Ally: case SummonCategory.Ally:
case SummonCategory.Unk: case SummonCategory.Unk:
{ {
switch (properties.Type) switch (properties.Title)
{ {
case SummonType.Minion: case SummonType.Minion:
case SummonType.Guardian: case SummonType.Guardian:
+7 -20
View File
@@ -94,7 +94,7 @@ namespace Game.Maps
AddPathNodeToTransport(anim.TransportID, anim.TimeIndex, anim); AddPathNodeToTransport(anim.TransportID, anim.TimeIndex, anim);
foreach (TransportRotationRecord rot in CliDB.TransportRotationStorage.Values) foreach (TransportRotationRecord rot in CliDB.TransportRotationStorage.Values)
AddPathRotationToTransport(rot.TransportID, rot.TimeIndex, rot); AddPathRotationToTransport(rot.GameObjectsID, rot.TimeIndex, rot);
} }
void GeneratePath(GameObjectTemplate goInfo, TransportTemplate transport) void GeneratePath(GameObjectTemplate goInfo, TransportTemplate transport)
@@ -124,7 +124,7 @@ namespace Game.Maps
if (!mapChange) if (!mapChange)
{ {
var node_i = path[i]; var node_i = path[i];
if (i != path.Length - 1 && (node_i.Flags.HasAnyFlag(TaxiPathNodeFlags.Teleport) || node_i.MapID != path[i + 1].MapID)) if (i != path.Length - 1 && (node_i.Flags.HasAnyFlag(TaxiPathNodeFlags.Teleport) || node_i.ContinentID != path[i + 1].ContinentID))
{ {
keyFrames.Last().Teleport = true; keyFrames.Last().Teleport = true;
mapChange = true; mapChange = true;
@@ -138,8 +138,8 @@ namespace Game.Maps
keyFrames.Add(k); keyFrames.Add(k);
splinePath.Add(new Vector3(node_i.Loc.X, node_i.Loc.Y, node_i.Loc.Z)); splinePath.Add(new Vector3(node_i.Loc.X, node_i.Loc.Y, node_i.Loc.Z));
if (!transport.mapsUsed.Contains(k.Node.MapID)) if (!transport.mapsUsed.Contains(k.Node.ContinentID))
transport.mapsUsed.Add(k.Node.MapID); transport.mapsUsed.Add(k.Node.ContinentID);
} }
} }
else else
@@ -377,7 +377,7 @@ namespace Game.Maps
// ...at first waypoint // ...at first waypoint
TaxiPathNodeRecord startNode = tInfo.keyFrames.First().Node; TaxiPathNodeRecord startNode = tInfo.keyFrames.First().Node;
uint mapId = startNode.MapID; uint mapId = startNode.ContinentID;
float x = startNode.Loc.X; float x = startNode.Loc.X;
float y = startNode.Loc.Y; float y = startNode.Loc.Y;
float z = startNode.Loc.Z; float z = startNode.Loc.Z;
@@ -578,22 +578,9 @@ namespace Game.Maps
return Path.First().Value; return Path.First().Value;
} }
Quaternion GetAnimRotation(uint time) TransportRotationRecord GetAnimRotation(uint time)
{ {
if (Rotations.Empty()) return Rotations.LookupByKey(time);
return new Quaternion(0.0f, 0.0f, 0.0f, 1.0f);
TransportRotationRecord rot = Rotations.First().Value;
foreach (var pair in Rotations)
{
if (time >= pair.Key)
{
rot = pair.Value;
break;
}
}
return new Quaternion(rot.X, rot.Y, rot.Z, rot.W);
} }
public Dictionary<uint, TransportAnimationRecord> Path = new Dictionary<uint, TransportAnimationRecord>(); public Dictionary<uint, TransportAnimationRecord> Path = new Dictionary<uint, TransportAnimationRecord>();
@@ -503,10 +503,10 @@ namespace Game.Movement
if (i_path.Empty() || i_currentNode >= i_path.Count) if (i_path.Empty() || i_currentNode >= i_path.Count)
return; return;
uint map0 = i_path[i_currentNode].MapID; uint map0 = i_path[i_currentNode].ContinentID;
for (int i = i_currentNode + 1; i < i_path.Count; ++i) for (int i = i_currentNode + 1; i < i_path.Count; ++i)
{ {
if (i_path[i].MapID != map0) if (i_path[i].ContinentID != map0)
{ {
i_currentNode = i; i_currentNode = i;
return; return;
@@ -537,7 +537,7 @@ namespace Game.Movement
void InitEndGridInfo() void InitEndGridInfo()
{ {
int nodeCount = i_path.Count; //! Number of nodes in path. int nodeCount = i_path.Count; //! Number of nodes in path.
_endMapId = i_path[nodeCount - 1].MapID; //! MapId of last node _endMapId = i_path[nodeCount - 1].ContinentID; //! MapId of last node
_preloadTargetNode = (uint)nodeCount - 3; _preloadTargetNode = (uint)nodeCount - 3;
_endGridX = i_path[nodeCount - 1].Loc.X; _endGridX = i_path[nodeCount - 1].Loc.X;
_endGridY = i_path[nodeCount - 1].Loc.Y; _endGridY = i_path[nodeCount - 1].Loc.Y;
@@ -563,10 +563,10 @@ namespace Game.Movement
if (i_currentNode >= i_path.Count) if (i_currentNode >= i_path.Count)
return (uint)i_path.Count; return (uint)i_path.Count;
uint curMapId = i_path[i_currentNode].MapID; uint curMapId = i_path[i_currentNode].ContinentID;
for (int i = i_currentNode; i < i_path.Count; ++i) for (int i = i_currentNode; i < i_path.Count; ++i)
{ {
if (i_path[i].MapID != curMapId) if (i_path[i].ContinentID != curMapId)
return (uint)i; return (uint)i;
} }
@@ -575,7 +575,7 @@ namespace Game.Movement
bool IsNodeIncludedInShortenedPath(TaxiPathNodeRecord p1, TaxiPathNodeRecord p2) bool IsNodeIncludedInShortenedPath(TaxiPathNodeRecord p1, TaxiPathNodeRecord p2)
{ {
return p1.MapID != p2.MapID || Math.Pow(p1.Loc.X - p2.Loc.X, 2) + Math.Pow(p1.Loc.Y - p2.Loc.Y, 2) > (40.0f * 40.0f); return p1.ContinentID != p2.ContinentID || Math.Pow(p1.Loc.X - p2.Loc.X, 2) + Math.Pow(p1.Loc.Y - p2.Loc.Y, 2) > (40.0f * 40.0f);
} }
public override MovementGeneratorType GetMovementGeneratorType() { return MovementGeneratorType.Flight; } public override MovementGeneratorType GetMovementGeneratorType() { return MovementGeneratorType.Flight; }
+1 -1
View File
@@ -298,7 +298,7 @@ namespace Game.PvP
{ {
AreaTableRecord areaTable = CliDB.AreaTableStorage.LookupByKey(zone); AreaTableRecord areaTable = CliDB.AreaTableStorage.LookupByKey(zone);
Contract.Assert(areaTable != null); Contract.Assert(areaTable != null);
Map map = Global.MapMgr.CreateBaseMap(areaTable.MapId); Map map = Global.MapMgr.CreateBaseMap(areaTable.ContinentID);
Contract.Assert(!map.Instanceable()); Contract.Assert(!map.Instanceable());
m_map = map; m_map = map;
} }
+2 -2
View File
@@ -266,7 +266,7 @@ namespace Game
else if (diffFactor > 10) else if (diffFactor > 10)
diffFactor = 10; diffFactor = 10;
uint xp = (uint)(diffFactor * questXp.Exp[RewardXPDifficulty] * RewardXPMultiplier / 10 * multiplier); uint xp = (uint)(diffFactor * questXp.Difficulty[RewardXPDifficulty] * RewardXPMultiplier / 10 * multiplier);
if (xp <= 100) if (xp <= 100)
xp = 5 * ((xp + 2) / 5); xp = 5 * ((xp + 2) / 5);
else if (xp <= 500) else if (xp <= 500)
@@ -288,7 +288,7 @@ namespace Game
QuestMoneyRewardRecord money = CliDB.QuestMoneyRewardStorage.LookupByKey(level); QuestMoneyRewardRecord money = CliDB.QuestMoneyRewardStorage.LookupByKey(level);
if (money != null) if (money != null)
return (uint)(money.Money[RewardMoneyDifficulty] * RewardMoneyMultiplier); return (uint)(money.Difficulty[RewardMoneyDifficulty] * RewardMoneyMultiplier);
else else
return 0; return 0;
} }
+6 -6
View File
@@ -91,7 +91,7 @@ namespace Game
if (factionEntry == null) if (factionEntry == null)
return 0; return 0;
ulong raceMask = _player.getRaceMask(); long raceMask = _player.getRaceMask();
uint classMask = _player.getClassMask(); uint classMask = _player.getClassMask();
for (var i = 0; i < 4; i++) for (var i = 0; i < 4; i++)
{ {
@@ -149,7 +149,7 @@ namespace Game
if (factionEntry == null) if (factionEntry == null)
return 0; return 0;
ulong raceMask = _player.getRaceMask(); long raceMask = _player.getRaceMask();
uint classMask = _player.getClassMask(); uint classMask = _player.getClassMask();
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
{ {
@@ -297,9 +297,9 @@ namespace Game
// check for sub-factions that receive spillover // check for sub-factions that receive spillover
var flist = Global.DB2Mgr.GetFactionTeamList(factionEntry.Id); var flist = Global.DB2Mgr.GetFactionTeamList(factionEntry.Id);
// if has no sub-factions, check for factions with same parent // if has no sub-factions, check for factions with same parent
if (flist == null && factionEntry.ParentFactionID != 0 && factionEntry.ParentFactionModOut != 0.0f) if (flist == null && factionEntry.ParentFactionID != 0 && factionEntry.ParentFactionMod[1] != 0.0f)
{ {
spillOverRepOut *= factionEntry.ParentFactionModOut; spillOverRepOut *= factionEntry.ParentFactionMod[1];
FactionRecord parent = CliDB.FactionStorage.LookupByKey(factionEntry.ParentFactionID); FactionRecord parent = CliDB.FactionStorage.LookupByKey(factionEntry.ParentFactionID);
if (parent != null) if (parent != null)
{ {
@@ -323,9 +323,9 @@ namespace Game
FactionRecord factionEntryCalc = CliDB.FactionStorage.LookupByKey(id); FactionRecord factionEntryCalc = CliDB.FactionStorage.LookupByKey(id);
if (factionEntryCalc != null) if (factionEntryCalc != null)
{ {
if (factionEntryCalc == factionEntry || GetRank(factionEntryCalc) > (ReputationRank)factionEntryCalc.ParentFactionCapIn) if (factionEntryCalc == factionEntry || GetRank(factionEntryCalc) > (ReputationRank)factionEntryCalc.ParentFactionMod[0])
continue; continue;
int spilloverRep = (int)(spillOverRepOut * factionEntryCalc.ParentFactionModIn); int spilloverRep = (int)(spillOverRepOut * factionEntryCalc.ParentFactionMod[0]);
if (spilloverRep != 0 || !incremental) if (spilloverRep != 0 || !incremental)
res = SetOneFactionReputation(factionEntryCalc, spilloverRep, incremental); res = SetOneFactionReputation(factionEntryCalc, spilloverRep, incremental);
} }
+4 -4
View File
@@ -64,7 +64,7 @@ namespace Game.Scenarios
public virtual void CompleteStep(ScenarioStepRecord step) public virtual void CompleteStep(ScenarioStepRecord step)
{ {
Quest quest = Global.ObjectMgr.GetQuestTemplate(step.QuestRewardID); Quest quest = Global.ObjectMgr.GetQuestTemplate(step.RewardQuestID);
if (quest != null) if (quest != null)
{ {
foreach (ObjectGuid guid in _players) foreach (ObjectGuid guid in _players)
@@ -87,7 +87,7 @@ namespace Game.Scenarios
if (GetStepState(_step) == ScenarioStepState.Done) if (GetStepState(_step) == ScenarioStepState.Done)
continue; continue;
if (newStep == null || _step.Step < newStep.Step) if (newStep == null || _step.OrderIndex < newStep.OrderIndex)
newStep = _step; newStep = _step;
} }
@@ -265,7 +265,7 @@ namespace Game.Scenarios
if (scenarioStep.IsBonusObjective()) if (scenarioStep.IsBonusObjective())
continue; continue;
if (firstStep == null || scenarioStep.Step < firstStep.Step) if (firstStep == null || scenarioStep.OrderIndex < firstStep.OrderIndex)
firstStep = scenarioStep; firstStep = scenarioStep;
} }
@@ -287,7 +287,7 @@ namespace Game.Scenarios
if (!step.IsBonusObjective()) if (!step.IsBonusObjective())
continue; continue;
if (Global.CriteriaMgr.GetCriteriaTree(step.CriteriaTreeID) != null) if (Global.CriteriaMgr.GetCriteriaTree(step.CriteriaTreeId) != null)
{ {
BonusObjectiveData bonusObjectiveData; BonusObjectiveData bonusObjectiveData;
bonusObjectiveData.BonusObjectiveID = (int)step.Id; bonusObjectiveData.BonusObjectiveID = (int)step.Id;
+2 -2
View File
@@ -119,8 +119,8 @@ namespace Game.Scenarios
if (!scenarioSteps.ContainsKey(step.ScenarioID)) if (!scenarioSteps.ContainsKey(step.ScenarioID))
scenarioSteps[step.ScenarioID] = new Dictionary<byte, ScenarioStepRecord>(); scenarioSteps[step.ScenarioID] = new Dictionary<byte, ScenarioStepRecord>();
scenarioSteps[step.ScenarioID][step.Step] = step; scenarioSteps[step.ScenarioID][step.OrderIndex] = step;
CriteriaTree tree = Global.CriteriaMgr.GetCriteriaTree(step.CriteriaTreeID); CriteriaTree tree = Global.CriteriaMgr.GetCriteriaTree(step.CriteriaTreeId);
if (tree != null) if (tree != null)
{ {
uint criteriaTreeSize = 0; uint criteriaTreeSize = 0;
+5 -5
View File
@@ -305,7 +305,7 @@ namespace Game.Spells
var powers = Global.DB2Mgr.GetSpellPowers(GetId(), caster ? caster.GetMap().GetDifficultyID() : Difficulty.None); var powers = Global.DB2Mgr.GetSpellPowers(GetId(), caster ? caster.GetMap().GetDifficultyID() : Difficulty.None);
foreach (var power in powers) foreach (var power in powers)
if (power.ManaCostPerSecond != 0 || power.ManaCostPercentagePerSecond > 0.0f) if (power.ManaPerSecond != 0 || power.PowerPctPerSecond > 0.0f)
m_periodicCosts.Add(power); m_periodicCosts.Add(power);
if (!m_periodicCosts.Empty()) if (!m_periodicCosts.Empty())
@@ -653,14 +653,14 @@ namespace Game.Spells
foreach (SpellPowerRecord power in m_periodicCosts) foreach (SpellPowerRecord power in m_periodicCosts)
{ {
if (power.RequiredAura != 0 && !caster.HasAura(power.RequiredAura)) if (power.RequiredAuraSpellID != 0 && !caster.HasAura(power.RequiredAuraSpellID))
continue; continue;
int manaPerSecond = (int)power.ManaCostPerSecond; int manaPerSecond = (int)power.ManaPerSecond;
if (power.PowerType != PowerType.Health) if (power.PowerType != PowerType.Health)
manaPerSecond += MathFunctions.CalculatePct(caster.GetMaxPower(power.PowerType), power.ManaCostPercentagePerSecond); manaPerSecond += MathFunctions.CalculatePct(caster.GetMaxPower(power.PowerType), power.PowerPctPerSecond);
else else
manaPerSecond += (int)MathFunctions.CalculatePct(caster.GetMaxHealth(), power.ManaCostPercentagePerSecond); manaPerSecond += (int)MathFunctions.CalculatePct(caster.GetMaxHealth(), power.PowerPctPerSecond);
if (manaPerSecond != 0) if (manaPerSecond != 0)
{ {
+8 -8
View File
@@ -105,7 +105,7 @@ namespace Game.Spells
{ {
for (int t = 0; t < ItemConst.MaxItemEnchantmentEffects; t++) for (int t = 0; t < ItemConst.MaxItemEnchantmentEffects; t++)
{ {
if (pEnchant.EffectSpellID[t] == m_spellInfo.Id) if (pEnchant.EffectArg[t] == m_spellInfo.Id)
{ {
amount = (int)((item_rand_suffix.AllocationPct[k] * castItem.GetItemSuffixFactor()) / 10000); amount = (int)((item_rand_suffix.AllocationPct[k] * castItem.GetItemSuffixFactor()) / 10000);
break; break;
@@ -146,7 +146,7 @@ namespace Game.Spells
uint mountType = (uint)GetMiscValueB(); uint mountType = (uint)GetMiscValueB();
MountRecord mountEntry = Global.DB2Mgr.GetMount(GetId()); MountRecord mountEntry = Global.DB2Mgr.GetMount(GetId());
if (mountEntry != null) if (mountEntry != null)
mountType = mountEntry.MountTypeId; mountType = mountEntry.MountTypeID;
var mountCapability = GetBase().GetUnitOwner().GetMountCapability(mountType); var mountCapability = GetBase().GetUnitOwner().GetMountCapability(mountType);
if (mountCapability != null) if (mountCapability != null)
@@ -2197,7 +2197,7 @@ namespace Game.Spells
}).ToList(); }).ToList();
if (!usableDisplays.Empty()) if (!usableDisplays.Empty())
displayId = usableDisplays.SelectRandom().DisplayID; displayId = usableDisplays.SelectRandom().CreatureDisplayInfoID;
} }
} }
// TODO: CREATE TABLE mount_vehicle (mountId, vehicleCreatureId) for future mounts that are vehicles (new mounts no longer have proper data in MiscValue) // TODO: CREATE TABLE mount_vehicle (mountId, vehicleCreatureId) for future mounts that are vehicles (new mounts no longer have proper data in MiscValue)
@@ -2229,7 +2229,7 @@ namespace Game.Spells
{ {
var mountCapability = CliDB.MountCapabilityStorage.LookupByKey(GetAmount()); var mountCapability = CliDB.MountCapabilityStorage.LookupByKey(GetAmount());
if (mountCapability != null) if (mountCapability != null)
target.CastSpell(target, mountCapability.SpeedModSpell, true); target.CastSpell(target, mountCapability.ModSpellAuraID, true);
} }
} }
else else
@@ -2245,7 +2245,7 @@ namespace Game.Spells
// remove speed aura // remove speed aura
var mountCapability = CliDB.MountCapabilityStorage.LookupByKey(GetAmount()); var mountCapability = CliDB.MountCapabilityStorage.LookupByKey(GetAmount());
if (mountCapability != null) if (mountCapability != null)
target.RemoveAurasDueToSpell(mountCapability.SpeedModSpell, target.GetGUID()); target.RemoveAurasDueToSpell(mountCapability.ModSpellAuraID, target.GetGUID());
} }
} }
} }
@@ -3512,7 +3512,7 @@ namespace Game.Spells
return; return;
Unit target = aurApp.GetTarget(); Unit target = aurApp.GetTarget();
if (target.GetPowerIndex((PowerType)powerDisplay.PowerType) == (int)PowerType.Max) if (target.GetPowerIndex((PowerType)powerDisplay.ActualType) == (int)PowerType.Max)
return; return;
if (apply) if (apply)
@@ -4693,7 +4693,7 @@ namespace Game.Spells
{ {
for (byte i = 0; i < SharedConst.MaxOverrideSpell; ++i) for (byte i = 0; i < SharedConst.MaxOverrideSpell; ++i)
{ {
uint spellId = overrideSpells.SpellID[i]; uint spellId = overrideSpells.Spells[i];
if (spellId != 0) if (spellId != 0)
target.AddTemporarySpell(spellId); target.AddTemporarySpell(spellId);
} }
@@ -4707,7 +4707,7 @@ namespace Game.Spells
{ {
for (byte i = 0; i < SharedConst.MaxOverrideSpell; ++i) for (byte i = 0; i < SharedConst.MaxOverrideSpell; ++i)
{ {
uint spellId = overrideSpells.SpellID[i]; uint spellId = overrideSpells.Spells[i];
if (spellId != 0) if (spellId != 0)
target.RemoveTemporarySpell(spellId); target.RemoveTemporarySpell(spellId);
} }
+5 -18
View File
@@ -3850,9 +3850,9 @@ namespace Game.Spells
ItemRecord itemEntry = CliDB.ItemStorage.LookupByKey(itemId); ItemRecord itemEntry = CliDB.ItemStorage.LookupByKey(itemId);
if (itemEntry != null) if (itemEntry != null)
{ {
if (itemEntry.Class == ItemClass.Weapon) if (itemEntry.ClassID == ItemClass.Weapon)
{ {
switch ((ItemSubClassWeapon)itemEntry.SubClass) switch ((ItemSubClassWeapon)itemEntry.SubclassID)
{ {
case ItemSubClassWeapon.Thrown: case ItemSubClassWeapon.Thrown:
ammoDisplayID = Global.DB2Mgr.GetItemDisplayId(itemId, m_caster.GetVirtualItemAppearanceMod(i)); ammoDisplayID = Global.DB2Mgr.GetItemDisplayId(itemId, m_caster.GetVirtualItemAppearanceMod(i));
@@ -5065,7 +5065,7 @@ namespace Game.Spells
if (SummonProperties == null) if (SummonProperties == null)
break; break;
switch (SummonProperties.Category) switch (SummonProperties.Control)
{ {
case SummonCategory.Pet: case SummonCategory.Pet:
if (!m_spellInfo.HasAttribute(SpellAttr1.DismissPet) && !m_caster.GetPetGUID().IsEmpty()) if (!m_spellInfo.HasAttribute(SpellAttr1.DismissPet) && !m_caster.GetPetGUID().IsEmpty())
@@ -6034,7 +6034,7 @@ namespace Game.Spells
ItemTemplate proto = targetItem.GetTemplate(); ItemTemplate proto = targetItem.GetTemplate();
for (byte e = 0; e < proto.Effects.Count; ++e) for (byte e = 0; e < proto.Effects.Count; ++e)
{ {
if (proto.Effects[e].SpellID != 0 && proto.Effects[e].Trigger == ItemSpelltriggerType.OnUse) if (proto.Effects[e].SpellID != 0 && proto.Effects[e].TriggerType == ItemSpelltriggerType.OnUse)
{ {
isItemUsable = true; isItemUsable = true;
break; break;
@@ -6115,7 +6115,7 @@ namespace Game.Spells
ItemDisenchantLootRecord itemDisenchantLoot = item.GetDisenchantLoot(m_caster.ToPlayer()); ItemDisenchantLootRecord itemDisenchantLoot = item.GetDisenchantLoot(m_caster.ToPlayer());
if (itemDisenchantLoot == null) if (itemDisenchantLoot == null)
return SpellCastResult.CantBeDisenchanted; return SpellCastResult.CantBeDisenchanted;
if (itemDisenchantLoot.RequiredDisenchantSkill > player.GetSkillValue(SkillType.Enchanting)) if (itemDisenchantLoot.SkillRequired > player.GetSkillValue(SkillType.Enchanting))
return SpellCastResult.LowCastlevel; return SpellCastResult.LowCastlevel;
break; break;
} }
@@ -6716,19 +6716,6 @@ namespace Game.Spells
{ {
m_loadedScripts = Global.ScriptMgr.CreateSpellScripts(m_spellInfo.Id, this); m_loadedScripts = Global.ScriptMgr.CreateSpellScripts(m_spellInfo.Id, this);
var holder = Global.SmartAIMgr.GetScript((int)GetSpellInfo().Id, SmartScriptType.Spell);
if (!holder.Empty())
{
var script = new SmartSpell();
script._Init("", GetSpellInfo().Id);
if (script._Load(this))
{
script._Register();
if (script._Validate(GetSpellInfo()))
m_loadedScripts.Add(script);
}
}
foreach (var script in m_loadedScripts) foreach (var script in m_loadedScripts)
{ {
Log.outDebug(LogFilter.Spells, "Spell.LoadScripts: Script `{0}` for spell `{1}` is loaded now", script._GetScriptName(), m_spellInfo.Id); Log.outDebug(LogFilter.Spells, "Spell.LoadScripts: Script `{0}` for spell `{1}` is loaded now", script._GetScriptName(), m_spellInfo.Id);
+4 -4
View File
@@ -1746,7 +1746,7 @@ namespace Game.Spells
break; break;
} }
switch (properties.Category) switch (properties.Control)
{ {
case SummonCategory.Wild: case SummonCategory.Wild:
case SummonCategory.Ally: case SummonCategory.Ally:
@@ -1756,7 +1756,7 @@ namespace Game.Spells
SummonGuardian(effIndex, entry, properties, numSummons); SummonGuardian(effIndex, entry, properties, numSummons);
break; break;
} }
switch (properties.Type) switch (properties.Title)
{ {
case SummonType.Pet: case SummonType.Pet:
case SummonType.Guardian: case SummonType.Guardian:
@@ -1816,7 +1816,7 @@ namespace Game.Spells
if (summon == null) if (summon == null)
continue; continue;
if (properties.Category == SummonCategory.Ally) if (properties.Control == SummonCategory.Ally)
{ {
summon.SetOwnerGUID(m_originalCaster.GetGUID()); summon.SetOwnerGUID(m_originalCaster.GetGUID());
summon.SetFaction(m_originalCaster.getFaction()); summon.SetFaction(m_originalCaster.getFaction());
@@ -5073,7 +5073,7 @@ namespace Game.Spells
if (summon.HasUnitTypeMask(UnitTypeMask.Guardian)) if (summon.HasUnitTypeMask(UnitTypeMask.Guardian))
((Guardian)summon).InitStatsForLevel(level); ((Guardian)summon).InitStatsForLevel(level);
if (properties != null && properties.Category == SummonCategory.Ally) if (properties != null && properties.Control == SummonCategory.Ally)
summon.SetFaction(caster.getFaction()); summon.SetFaction(caster.getFaction());
if (summon.HasUnitTypeMask(UnitTypeMask.Minion) && m_targets.HasDst()) if (summon.HasUnitTypeMask(UnitTypeMask.Minion) && m_targets.HasDst())
+3 -3
View File
@@ -869,9 +869,9 @@ namespace Game.Spells
{ {
if (itemEffect.SpellID == spellInfo.Id) if (itemEffect.SpellID == spellInfo.Id)
{ {
tmpCooldown = itemEffect.Cooldown; tmpCooldown = itemEffect.CoolDownMSec;
tmpCategoryId = itemEffect.Category; tmpCategoryId = itemEffect.SpellCategoryID;
tmpCategoryCooldown = itemEffect.CategoryCooldown; tmpCategoryCooldown = itemEffect.CategoryCoolDownMSec;
break; break;
} }
} }
+49 -53
View File
@@ -59,20 +59,20 @@ namespace Game.Spells
SpellMiscRecord _misc = data.Misc; SpellMiscRecord _misc = data.Misc;
if (_misc != null) if (_misc != null)
{ {
Attributes = (SpellAttr0)_misc.Attributes; Attributes = (SpellAttr0)_misc.Attributes[0];
AttributesEx = (SpellAttr1)_misc.AttributesEx; AttributesEx = (SpellAttr1)_misc.Attributes[1];
AttributesEx2 = (SpellAttr2)_misc.AttributesExB; AttributesEx2 = (SpellAttr2)_misc.Attributes[2];
AttributesEx3 = (SpellAttr3)_misc.AttributesExC; AttributesEx3 = (SpellAttr3)_misc.Attributes[3];
AttributesEx4 = (SpellAttr4)_misc.AttributesExD; AttributesEx4 = (SpellAttr4)_misc.Attributes[4];
AttributesEx5 = (SpellAttr5)_misc.AttributesExE; AttributesEx5 = (SpellAttr5)_misc.Attributes[5];
AttributesEx6 = (SpellAttr6)_misc.AttributesExF; AttributesEx6 = (SpellAttr6)_misc.Attributes[6];
AttributesEx7 = (SpellAttr7)_misc.AttributesExG; AttributesEx7 = (SpellAttr7)_misc.Attributes[7];
AttributesEx8 = (SpellAttr8)_misc.AttributesExH; AttributesEx8 = (SpellAttr8)_misc.Attributes[8];
AttributesEx9 = (SpellAttr9)_misc.AttributesExI; AttributesEx9 = (SpellAttr9)_misc.Attributes[9];
AttributesEx10 = (SpellAttr10)_misc.AttributesExJ; AttributesEx10 = (SpellAttr10)_misc.Attributes[10];
AttributesEx11 = (SpellAttr11)_misc.AttributesExK; AttributesEx11 = (SpellAttr11)_misc.Attributes[11];
AttributesEx12 = (SpellAttr12)_misc.AttributesExL; AttributesEx12 = (SpellAttr12)_misc.Attributes[12];
AttributesEx13 = (SpellAttr13)_misc.AttributesExM; AttributesEx13 = (SpellAttr13)_misc.Attributes[13];
CastTimeEntry = CliDB.SpellCastTimesStorage.LookupByKey(_misc.CastingTimeIndex); CastTimeEntry = CliDB.SpellCastTimesStorage.LookupByKey(_misc.CastingTimeIndex);
DurationEntry = CliDB.SpellDurationStorage.LookupByKey(_misc.DurationIndex); DurationEntry = CliDB.SpellDurationStorage.LookupByKey(_misc.DurationIndex);
RangeIndex = _misc.RangeIndex; RangeIndex = _misc.RangeIndex;
@@ -81,7 +81,7 @@ namespace Game.Spells
SchoolMask = (SpellSchoolMask)_misc.SchoolMask; SchoolMask = (SpellSchoolMask)_misc.SchoolMask;
AttributesCu = 0; AttributesCu = 0;
IconFileDataId = _misc.IconFileDataID; IconFileDataId = _misc.SpellIconFileDataID;
ActiveIconFileDataId = _misc.ActiveIconFileDataID; ActiveIconFileDataId = _misc.ActiveIconFileDataID;
} }
@@ -90,13 +90,13 @@ namespace Game.Spells
// sort all visuals so that the ones without a condition requirement are last on the list // sort all visuals so that the ones without a condition requirement are last on the list
foreach (var key in _visuals.Keys.ToList()) foreach (var key in _visuals.Keys.ToList())
_visuals[key] = _visuals[key].OrderByDescending(x => x.PlayerConditionID).ToList(); _visuals[key] = _visuals[key].OrderByDescending(x => x.CasterPlayerConditionID).ToList();
// SpellScalingEntry // SpellScalingEntry
SpellScalingRecord _scaling = data.Scaling; SpellScalingRecord _scaling = data.Scaling;
if (_scaling != null) if (_scaling != null)
{ {
Scaling._Class = _scaling.ScalingClass; Scaling._Class = _scaling.Class;
Scaling.MinScalingLevel = _scaling.MinScalingLevel; Scaling.MinScalingLevel = _scaling.MinScalingLevel;
Scaling.MaxScalingLevel = _scaling.MaxScalingLevel; Scaling.MaxScalingLevel = _scaling.MaxScalingLevel;
Scaling.ScalesFromItemLevel = _scaling.ScalesFromItemLevel; Scaling.ScalesFromItemLevel = _scaling.ScalesFromItemLevel;
@@ -179,8 +179,8 @@ namespace Game.Spells
if (_equipped != null) if (_equipped != null)
{ {
EquippedItemClass = (ItemClass)_equipped.EquippedItemClass; EquippedItemClass = (ItemClass)_equipped.EquippedItemClass;
EquippedItemSubClassMask = _equipped.EquippedItemSubClassMask; EquippedItemSubClassMask = _equipped.EquippedItemSubclass;
EquippedItemInventoryTypeMask = _equipped.EquippedItemInventoryTypeMask; EquippedItemInventoryTypeMask = _equipped.EquippedItemInvTypes;
} }
// SpellInterruptsEntry // SpellInterruptsEntry
@@ -226,10 +226,10 @@ namespace Game.Spells
if (_target != null) if (_target != null)
{ {
targets = (SpellCastTargetFlags)_target.Targets; targets = (SpellCastTargetFlags)_target.Targets;
ConeAngle = _target.ConeAngle; ConeAngle = _target.ConeDegrees;
Width = _target.Width; Width = _target.Width;
TargetCreatureType = _target.TargetCreatureType; TargetCreatureType = _target.TargetCreatureType;
MaxAffectedTargets = _target.MaxAffectedTargets; MaxAffectedTargets = _target.MaxTargets;
MaxTargetLevel = _target.MaxTargetLevel; MaxTargetLevel = _target.MaxTargetLevel;
} }
@@ -964,7 +964,7 @@ namespace Game.Spells
uint mountType = (uint)effect.MiscValueB; uint mountType = (uint)effect.MiscValueB;
MountRecord mountEntry = Global.DB2Mgr.GetMount(Id); MountRecord mountEntry = Global.DB2Mgr.GetMount(Id);
if (mountEntry != null) if (mountEntry != null)
mountType = mountEntry.MountTypeId; mountType = mountEntry.MountTypeID;
if (mountType != 0 && player.GetMountCapability(mountType) == null) if (mountType != 0 && player.GetMountCapability(mountType) == null)
return SpellCastResult.NotHere; return SpellCastResult.NotHere;
break; break;
@@ -1210,11 +1210,11 @@ namespace Game.Spells
var vehicleSeat = vehicle.GetSeatForPassenger(caster); var vehicleSeat = vehicle.GetSeatForPassenger(caster);
if (!HasAttribute(SpellAttr6.CastableWhileOnVehicle) && !HasAttribute(SpellAttr0.CastableWhileMounted) if (!HasAttribute(SpellAttr6.CastableWhileOnVehicle) && !HasAttribute(SpellAttr0.CastableWhileMounted)
&& (vehicleSeat.Flags[0] & (uint)checkMask) != (uint)checkMask) && (vehicleSeat.Flags & checkMask) != checkMask)
return SpellCastResult.CantDoThatRightNow; return SpellCastResult.CantDoThatRightNow;
// Can only summon uncontrolled minions/guardians when on controlled vehicle // Can only summon uncontrolled minions/guardians when on controlled vehicle
if (vehicleSeat.Flags[0].HasAnyFlag((uint)(VehicleSeatFlags.CanControl | VehicleSeatFlags.Unk2))) if (vehicleSeat.Flags.HasAnyFlag((VehicleSeatFlags.CanControl | VehicleSeatFlags.Unk2)))
{ {
foreach (SpellEffectInfo effect in GetEffectsForDifficulty(caster.GetMap().GetDifficultyID())) foreach (SpellEffectInfo effect in GetEffectsForDifficulty(caster.GetMap().GetDifficultyID()))
{ {
@@ -1222,7 +1222,7 @@ namespace Game.Spells
continue; continue;
var props = CliDB.SummonPropertiesStorage.LookupByKey(effect.MiscValueB); var props = CliDB.SummonPropertiesStorage.LookupByKey(effect.MiscValueB);
if (props != null && props.Category != SummonCategory.Wild) if (props != null && props.Control != SummonCategory.Wild)
return SpellCastResult.CantDoThatRightNow; return SpellCastResult.CantDoThatRightNow;
} }
} }
@@ -2529,20 +2529,16 @@ namespace Game.Spells
{ {
if (RangeEntry == null) if (RangeEntry == null)
return 0.0f; return 0.0f;
if (positive)
return RangeEntry.MinRangeFriend; return RangeEntry.RangeMin[positive ? 1 : 0];
return RangeEntry.MinRangeHostile;
} }
public float GetMaxRange(bool positive = false, Unit caster = null, Spell spell = null) public float GetMaxRange(bool positive = false, Unit caster = null, Spell spell = null)
{ {
if (RangeEntry == null) if (RangeEntry == null)
return 0.0f; return 0.0f;
float range;
if (positive) float range = RangeEntry.RangeMax[positive ? 1 : 0];
range = RangeEntry.MaxRangeFriend;
else
range = RangeEntry.MaxRangeHostile;
if (caster != null) if (caster != null)
{ {
Player modOwner = caster.GetSpellModOwner(); Player modOwner = caster.GetSpellModOwner();
@@ -2601,9 +2597,9 @@ namespace Game.Spells
if (calcLevel < 0) if (calcLevel < 0)
calcLevel = 0; calcLevel = 0;
castTime = (int)(CastTimeEntry.CastTime + CastTimeEntry.CastTimePerLevel * level); castTime = (int)(CastTimeEntry.Base + CastTimeEntry.PerLevel * level);
if (castTime < CastTimeEntry.MinCastTime) if (castTime < CastTimeEntry.Minimum)
castTime = CastTimeEntry.MinCastTime; castTime = CastTimeEntry.Minimum;
} }
if (castTime <= 0) if (castTime <= 0)
@@ -2669,7 +2665,7 @@ namespace Game.Spells
foreach (SpellPowerRecord power in powers) foreach (SpellPowerRecord power in powers)
{ {
if (power.RequiredAura != 0 && !caster.HasAura(power.RequiredAura)) if (power.RequiredAuraSpellID != 0 && !caster.HasAura(power.RequiredAuraSpellID))
continue; continue;
// Spell drain all exist power on cast (Only paladin lay of Hands) // Spell drain all exist power on cast (Only paladin lay of Hands)
@@ -2696,23 +2692,23 @@ namespace Game.Spells
} }
// Base powerCost // Base powerCost
int powerCost = (int)power.ManaCost; int powerCost = power.ManaCost;
// PCT cost from total amount // PCT cost from total amount
if (power.ManaCostPercentage != 0) if (power.PowerCostPct != 0)
{ {
switch (power.PowerType) switch (power.PowerType)
{ {
// health as power used // health as power used
case PowerType.Health: case PowerType.Health:
powerCost += (int)MathFunctions.CalculatePct(caster.GetMaxHealth(), power.ManaCostPercentage); powerCost += (int)MathFunctions.CalculatePct(caster.GetMaxHealth(), power.PowerCostPct);
break; break;
case PowerType.Mana: case PowerType.Mana:
powerCost += (int)MathFunctions.CalculatePct(caster.GetCreateMana(), power.ManaCostPercentage); powerCost += (int)MathFunctions.CalculatePct(caster.GetCreateMana(), power.PowerCostPct);
break; break;
case PowerType.Rage: case PowerType.Rage:
case PowerType.Focus: case PowerType.Focus:
case PowerType.Energy: case PowerType.Energy:
powerCost += MathFunctions.CalculatePct(caster.GetMaxPower(power.PowerType), power.ManaCostPercentage); powerCost += MathFunctions.CalculatePct(caster.GetMaxPower(power.PowerType), power.PowerCostPct);
break; break;
case PowerType.Runes: case PowerType.Runes:
case PowerType.RunicPower: case PowerType.RunicPower:
@@ -2724,8 +2720,8 @@ namespace Game.Spells
} }
} }
if (power.HealthCostPercentage != 0) if (power.PowerCostMaxPct != 0)
healthCost += (int)MathFunctions.CalculatePct(caster.GetMaxHealth(), power.HealthCostPercentage); healthCost += (int)MathFunctions.CalculatePct(caster.GetMaxHealth(), power.PowerCostMaxPct);
if (power.PowerType != PowerType.Health) if (power.PowerType != PowerType.Health)
{ {
@@ -2766,13 +2762,13 @@ namespace Game.Spells
Player modOwner = caster.GetSpellModOwner(); Player modOwner = caster.GetSpellModOwner();
if (modOwner) if (modOwner)
{ {
if (power.PowerIndex == 0) if (power.OrderIndex == 0)
modOwner.ApplySpellMod(Id, SpellModOp.Cost, ref powerCost); modOwner.ApplySpellMod(Id, SpellModOp.Cost, ref powerCost);
else if (power.PowerIndex == 1) else if (power.OrderIndex == 1)
modOwner.ApplySpellMod(Id, SpellModOp.SpellCost2, ref powerCost); modOwner.ApplySpellMod(Id, SpellModOp.SpellCost2, ref powerCost);
} }
if (!caster.IsControlledByPlayer() && MathFunctions.fuzzyEq(power.ManaCostPercentage, 0.0f) && SpellLevel != 0) if (!caster.IsControlledByPlayer() && MathFunctions.fuzzyEq(power.PowerCostPct, 0.0f) && SpellLevel != 0)
{ {
if (HasAttribute(SpellAttr0.LevelDamageCalculation)) if (HasAttribute(SpellAttr0.LevelDamageCalculation))
{ {
@@ -3077,7 +3073,7 @@ namespace Game.Spells
{ {
foreach (SpellXSpellVisualRecord visual in visualList) foreach (SpellXSpellVisualRecord visual in visualList)
{ {
PlayerConditionRecord playerCondition = CliDB.PlayerConditionStorage.LookupByKey(visual.PlayerConditionID); PlayerConditionRecord playerCondition = CliDB.PlayerConditionStorage.LookupByKey(visual.CasterPlayerConditionID);
if (playerCondition == null || (caster.IsTypeId(TypeId.Player) && ConditionManager.IsPlayerMeetingCondition(caster.ToPlayer(), playerCondition))) if (playerCondition == null || (caster.IsTypeId(TypeId.Player) && ConditionManager.IsPlayerMeetingCondition(caster.ToPlayer(), playerCondition)))
return visual.Id; return visual.Id;
} }
@@ -3092,7 +3088,7 @@ namespace Game.Spells
{ {
foreach (var visual in defaultList) foreach (var visual in defaultList)
{ {
PlayerConditionRecord playerCondition = CliDB.PlayerConditionStorage.LookupByKey(visual.PlayerConditionID); PlayerConditionRecord playerCondition = CliDB.PlayerConditionStorage.LookupByKey(visual.CasterPlayerConditionID);
if (playerCondition == null || (caster && caster.IsTypeId(TypeId.Player) && ConditionManager.IsPlayerMeetingCondition(caster.ToPlayer(), playerCondition))) if (playerCondition == null || (caster && caster.IsTypeId(TypeId.Player) && ConditionManager.IsPlayerMeetingCondition(caster.ToPlayer(), playerCondition)))
return visual.Id; return visual.Id;
} }
@@ -3705,14 +3701,14 @@ namespace Game.Spells
Amplitude = _effect.EffectAmplitude; Amplitude = _effect.EffectAmplitude;
ChainAmplitude = _effect.EffectChainAmplitude; ChainAmplitude = _effect.EffectChainAmplitude;
BonusCoefficient = _effect.EffectBonusCoefficient; BonusCoefficient = _effect.EffectBonusCoefficient;
MiscValue = _effect.EffectMiscValue; MiscValue = _effect.EffectMiscValue[0];
MiscValueB = _effect.EffectMiscValueB; MiscValueB = _effect.EffectMiscValue[1];
Mechanic = (Mechanics)_effect.EffectMechanic; Mechanic = (Mechanics)_effect.EffectMechanic;
PositionFacing = _effect.EffectPosFacing; PositionFacing = _effect.EffectPosFacing;
TargetA = new SpellImplicitTargetInfo((Targets)_effect.ImplicitTarget[0]); TargetA = new SpellImplicitTargetInfo((Targets)_effect.ImplicitTarget[0]);
TargetB = new SpellImplicitTargetInfo((Targets)_effect.ImplicitTarget[1]); TargetB = new SpellImplicitTargetInfo((Targets)_effect.ImplicitTarget[1]);
RadiusEntry = CliDB.SpellRadiusStorage.LookupByKey(_effect.EffectRadiusIndex); RadiusEntry = CliDB.SpellRadiusStorage.LookupByKey(_effect.EffectRadiusIndex[0]);
MaxRadiusEntry = CliDB.SpellRadiusStorage.LookupByKey(_effect.EffectRadiusMaxIndex); MaxRadiusEntry = CliDB.SpellRadiusStorage.LookupByKey(_effect.EffectRadiusIndex[1]);
ChainTargets = _effect.EffectChainTargets; ChainTargets = _effect.EffectChainTargets;
ItemType = _effect.EffectItemType; ItemType = _effect.EffectItemType;
TriggerSpell = _effect.EffectTriggerSpell; TriggerSpell = _effect.EffectTriggerSpell;
+11 -11
View File
@@ -642,11 +642,11 @@ namespace Game.Entities
if (skillAbility.SupercedesSpell == 0) if (skillAbility.SupercedesSpell == 0)
continue; continue;
if (!HasSpellInfo(skillAbility.SupercedesSpell) || !HasSpellInfo(skillAbility.SpellID)) if (!HasSpellInfo(skillAbility.SupercedesSpell) || !HasSpellInfo(skillAbility.Spell))
continue; continue;
chains[skillAbility.SupercedesSpell] = skillAbility.SpellID; chains[skillAbility.SupercedesSpell] = skillAbility.Spell;
hasPrev.Add(skillAbility.SpellID); hasPrev.Add(skillAbility.Spell);
} }
// each key in chains that isn't present in hasPrev is a first rank // each key in chains that isn't present in hasPrev is a first rank
@@ -1418,7 +1418,7 @@ namespace Game.Entities
mSkillLineAbilityMap.Clear(); mSkillLineAbilityMap.Clear();
foreach (var skill in CliDB.SkillLineAbilityStorage.Values) foreach (var skill in CliDB.SkillLineAbilityStorage.Values)
mSkillLineAbilityMap.Add(skill.SpellID, skill); mSkillLineAbilityMap.Add(skill.Spell, skill);
Log.outInfo(LogFilter.ServerLoading, "Loaded {0} SkillLineAbility MultiMap Data in {1} ms", mSkillLineAbilityMap.Count, Time.GetMSTimeDiffToNow(oldMSTime)); Log.outInfo(LogFilter.ServerLoading, "Loaded {0} SkillLineAbility MultiMap Data in {1} ms", mSkillLineAbilityMap.Count, Time.GetMSTimeDiffToNow(oldMSTime));
} }
@@ -1627,7 +1627,7 @@ namespace Game.Entities
if (skillLine.AcquireMethod != AbilytyLearnType.OnSkillLearn) if (skillLine.AcquireMethod != AbilytyLearnType.OnSkillLearn)
continue; continue;
SpellInfo spell = GetSpellInfo(skillLine.SpellID); SpellInfo spell = GetSpellInfo(skillLine.Spell);
if (spell == null) // not exist or triggered or talent if (spell == null) // not exist or triggered or talent
continue; continue;
@@ -2189,7 +2189,7 @@ namespace Game.Entities
if (enchant.Effect[s] != ItemEnchantmentType.CombatSpell) if (enchant.Effect[s] != ItemEnchantmentType.CombatSpell)
continue; continue;
SpellInfo procInfo = GetSpellInfo(enchant.EffectSpellID[s]); SpellInfo procInfo = GetSpellInfo(enchant.EffectArg[s]);
if (procInfo == null) if (procInfo == null)
continue; continue;
@@ -2810,13 +2810,13 @@ namespace Game.Entities
SummonPropertiesRecord properties = CliDB.SummonPropertiesStorage.LookupByKey(121); SummonPropertiesRecord properties = CliDB.SummonPropertiesStorage.LookupByKey(121);
if (properties != null) if (properties != null)
properties.Type = SummonType.Totem; properties.Title = SummonType.Totem;
properties = CliDB.SummonPropertiesStorage.LookupByKey(647); // 52893 properties = CliDB.SummonPropertiesStorage.LookupByKey(647); // 52893
if (properties != null) if (properties != null)
properties.Type = SummonType.Totem; properties.Title = SummonType.Totem;
properties = CliDB.SummonPropertiesStorage.LookupByKey(628); properties = CliDB.SummonPropertiesStorage.LookupByKey(628);
if (properties != null) // Hungry Plaguehound if (properties != null) // Hungry Plaguehound
properties.Category = SummonCategory.Pet; properties.Control = SummonCategory.Pet;
Log.outInfo(LogFilter.ServerLoading, "Loaded SpellInfo corrections in {0} ms", Time.GetMSTimeDiffToNow(oldMSTime)); Log.outInfo(LogFilter.ServerLoading, "Loaded SpellInfo corrections in {0} ms", Time.GetMSTimeDiffToNow(oldMSTime));
} }
@@ -2874,11 +2874,11 @@ namespace Game.Entities
foreach (var skillLine in CliDB.SkillLineAbilityStorage.Values) foreach (var skillLine in CliDB.SkillLineAbilityStorage.Values)
{ {
SpellInfo spellInfo = GetSpellInfo(skillLine.SpellID); SpellInfo spellInfo = GetSpellInfo(skillLine.Spell);
if (spellInfo == null) if (spellInfo == null)
continue; continue;
var levels = levelsBySpell.LookupByKey(skillLine.SpellID); var levels = levelsBySpell.LookupByKey(skillLine.Spell);
if (levels != null && levels.SpellLevel != 0) if (levels != null && levels.SpellLevel != 0)
continue; continue;
+1 -1
View File
@@ -46,7 +46,7 @@ namespace Game.Chat
{ {
BroadcastTextRecord bct = CliDB.BroadcastTextStorage.LookupByKey(_textId); BroadcastTextRecord bct = CliDB.BroadcastTextStorage.LookupByKey(_textId);
var packet = new ChatPkt(); var packet = new ChatPkt();
packet.Initialize(_msgType, bct != null ? (Language)bct.Language : Language.Universal, _source, _target, bct != null ? Global.DB2Mgr.GetBroadcastTextValue(bct, locale, _gender) : "", _achievementId, "", locale); packet.Initialize(_msgType, bct != null ? (Language)bct.LanguageID : Language.Universal, _source, _target, bct != null ? Global.DB2Mgr.GetBroadcastTextValue(bct, locale, _gender) : "", _achievementId, "", locale);
return packet; return packet;
} }
+1 -1
View File
@@ -203,7 +203,7 @@ namespace Game
BroadcastTextRecord bct = CliDB.BroadcastTextStorage.LookupByKey(textEntry.BroadcastTextId); BroadcastTextRecord bct = CliDB.BroadcastTextStorage.LookupByKey(textEntry.BroadcastTextId);
if (bct != null) if (bct != null)
{ {
uint broadcastTextSoundId = bct.SoundID[source.GetGender() == Gender.Female ? 1 : 0]; uint broadcastTextSoundId = bct.SoundEntriesID[source.GetGender() == Gender.Female ? 1 : 0];
if (broadcastTextSoundId != 0) if (broadcastTextSoundId != 0)
finalSound = broadcastTextSoundId; finalSound = broadcastTextSoundId;
} }
+1 -1
View File
@@ -2285,7 +2285,7 @@ namespace Scripts.Spells.Generic
// cast speed aura // cast speed aura
MountCapabilityRecord mountCapability = CliDB.MountCapabilityStorage.LookupByKey(aurEff.GetAmount()); MountCapabilityRecord mountCapability = CliDB.MountCapabilityStorage.LookupByKey(aurEff.GetAmount());
if (mountCapability != null) if (mountCapability != null)
target.CastSpell(target, mountCapability.SpeedModSpell, TriggerCastFlags.FullMask); target.CastSpell(target, mountCapability.ModSpellAuraID, TriggerCastFlags.FullMask);
} }
public override void Register() public override void Register()
File diff suppressed because it is too large Load Diff