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
@@ -2164,8 +2164,8 @@ namespace Game.Entities
uint modelId = m_goInfo.displayId;
DestructibleModelDataRecord modelData = CliDB.DestructibleModelDataStorage.LookupByKey(m_goInfo.DestructibleBuilding.DestructibleModelRec);
if (modelData != null)
if (modelData.StateDamagedDisplayID != 0)
modelId = modelData.StateDamagedDisplayID;
if (modelData.State0Wmo != 0)
modelId = modelData.State0Wmo;
SetDisplayId(modelId);
if (setHealth)
@@ -2196,8 +2196,8 @@ namespace Game.Entities
uint modelId = m_goInfo.displayId;
DestructibleModelDataRecord modelData = CliDB.DestructibleModelDataStorage.LookupByKey(m_goInfo.DestructibleBuilding.DestructibleModelRec);
if (modelData != null)
if (modelData.StateDestroyedDisplayID != 0)
modelId = modelData.StateDestroyedDisplayID;
if (modelData.State1Wmo != 0)
modelId = modelData.State1Wmo;
SetDisplayId(modelId);
if (setHealth)
@@ -2216,8 +2216,8 @@ namespace Game.Entities
uint modelId = m_goInfo.displayId;
DestructibleModelDataRecord modelData = CliDB.DestructibleModelDataStorage.LookupByKey(m_goInfo.DestructibleBuilding.DestructibleModelRec);
if (modelData != null)
if (modelData.StateRebuildingDisplayID != 0)
modelId = modelData.StateRebuildingDisplayID;
if (modelData.State2Wmo != 0)
modelId = modelData.State2Wmo;
SetDisplayId(modelId);
// restores to full health
+41 -41
View File
@@ -103,13 +103,13 @@ namespace Game.Entities
if (itemProto.GetArtifactID() != artifactAppearanceSet.ArtifactID)
continue;
PlayerConditionRecord playerCondition = CliDB.PlayerConditionStorage.LookupByKey(artifactAppearance.PlayerConditionID);
PlayerConditionRecord playerCondition = CliDB.PlayerConditionStorage.LookupByKey(artifactAppearance.UnlockPlayerConditionID);
if (playerCondition != null)
if (!owner || !ConditionManager.IsPlayerMeetingCondition(owner, playerCondition))
continue;
SetModifier(ItemModifier.ArtifactAppearanceId, artifactAppearance.Id);
SetAppearanceModId(artifactAppearance.AppearanceModID);
SetAppearanceModId(artifactAppearance.ItemAppearanceModifierID);
break;
}
}
@@ -546,7 +546,7 @@ namespace Game.Entities
SetModifier(ItemModifier.ArtifactAppearanceId, artifactAppearanceId);
ArtifactAppearanceRecord artifactAppearance = CliDB.ArtifactAppearanceStorage.LookupByKey(artifactAppearanceId);
if (artifactAppearance != null)
SetAppearanceModId(artifactAppearance.AppearanceModID);
SetAppearanceModId(artifactAppearance.ItemAppearanceModifierID);
byte totalPurchasedRanks = 0;
foreach (ItemDynamicFieldArtifactPowers power in powers)
@@ -565,22 +565,22 @@ namespace Game.Entities
switch (enchant.Effect[i])
{
case ItemEnchantmentType.ArtifactPowerBonusRankByType:
if (artifactPower.RelicType == enchant.EffectSpellID[i])
if (artifactPower.Label == enchant.EffectArg[i])
power.CurrentRankWithBonus += (byte)enchant.EffectPointsMin[i];
break;
case ItemEnchantmentType.ArtifactPowerBonusRankByID:
if (artifactPower.Id == enchant.EffectSpellID[i])
if (artifactPower.Id == enchant.EffectArg[i])
power.CurrentRankWithBonus += (byte)enchant.EffectPointsMin[i];
break;
case ItemEnchantmentType.ArtifactPowerBonusRankPicker:
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)
{
PlayerConditionRecord playerCondition = CliDB.PlayerConditionStorage.LookupByKey(artifactPowerPicker.PlayerConditionID);
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];
}
}
@@ -1010,7 +1010,7 @@ namespace Game.Entities
GemPropertiesRecord gemProperties = CliDB.GemPropertiesStorage.LookupByKey(gemTemplate.GetGemProperties());
if (gemProperties != null)
{
SpellItemEnchantmentRecord gemEnchant = CliDB.SpellItemEnchantmentStorage.LookupByKey(gemProperties.EnchantID);
SpellItemEnchantmentRecord gemEnchant = CliDB.SpellItemEnchantmentStorage.LookupByKey(gemProperties.EnchantId);
if (gemEnchant != null)
{
BonusData gemBonus = new BonusData(gemTemplate);
@@ -1029,7 +1029,7 @@ namespace Game.Entities
ScalingStatDistributionRecord ssd = CliDB.ScalingStatDistributionStorage.LookupByKey(gemBonus.ScalingStatDistribution);
if (ssd != null)
{
uint scaledIlvl = (uint)Global.DB2Mgr.GetCurveValueAt(ssd.ItemLevelCurveID, gemScalingLevel);
uint scaledIlvl = (uint)Global.DB2Mgr.GetCurveValueAt(ssd.PlayerLevelToItemLevelCurveID, gemScalingLevel);
if (scaledIlvl != 0)
gemBaseItemLevel = scaledIlvl;
}
@@ -1042,7 +1042,7 @@ namespace Game.Entities
{
case ItemEnchantmentType.BonusListID:
{
var bonusesEffect = Global.DB2Mgr.GetItemBonusList(gemEnchant.EffectSpellID[i]);
var bonusesEffect = Global.DB2Mgr.GetItemBonusList(gemEnchant.EffectArg[i]);
if (bonusesEffect != null)
{
foreach (ItemBonusRecord itemBonus in bonusesEffect)
@@ -1600,7 +1600,7 @@ namespace Game.Entities
if (basePrice == null)
return 0;
float qualityFactor = qualityPrice.Factor;
float qualityFactor = qualityPrice.Data;
float baseFactor = 0.0f;
var inventoryType = proto.GetInventoryType();
@@ -1612,9 +1612,9 @@ namespace Game.Entities
inventoryType == InventoryType.Ranged ||
inventoryType == InventoryType.Thrown ||
inventoryType == InventoryType.RangedRight)
baseFactor = basePrice.WeaponFactor;
baseFactor = basePrice.Weapon;
else
baseFactor = basePrice.ArmorFactor;
baseFactor = basePrice.Armor;
if (inventoryType == InventoryType.Robe)
inventoryType = InventoryType.Chest;
@@ -1622,7 +1622,7 @@ namespace Game.Entities
if (proto.GetClass() == ItemClass.Gem && (ItemSubClassGem)proto.GetSubClass() == ItemSubClassGem.ArtifactRelic)
{
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.Cloth:
typeFactor = armorPrice.ClothFactor;
typeFactor = armorPrice.ClothModifier;
break;
case ItemSubClassArmor.Leather:
typeFactor = armorPrice.LeatherFactor;
typeFactor = armorPrice.LeatherModifier;
break;
case ItemSubClassArmor.Mail:
typeFactor = armorPrice.MailFactor;
typeFactor = armorPrice.ChainModifier;
break;
case ItemSubClassArmor.Plate:
typeFactor = armorPrice.PlateFactor;
typeFactor = armorPrice.PlateModifier;
break;
default:
typeFactor = 1.0f;
@@ -1677,7 +1677,7 @@ namespace Game.Entities
if (shieldPrice == null)
return 0;
typeFactor = shieldPrice.Factor;
typeFactor = shieldPrice.Data;
break;
}
case InventoryType.WeaponMainhand:
@@ -1707,11 +1707,11 @@ namespace Game.Entities
if (weaponPrice == null)
return 0;
typeFactor = weaponPrice.Factor;
typeFactor = weaponPrice.Data;
}
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)
@@ -1733,7 +1733,7 @@ namespace Game.Entities
if (classEntry != null)
{
uint buyCount = Math.Max(proto.GetBuyCount(), 1u);
return (uint)(cost * classEntry.PriceMod / buyCount);
return (uint)(cost * classEntry.PriceModifier / buyCount);
}
return 0;
@@ -1764,7 +1764,7 @@ namespace Game.Entities
var enchant = CliDB.SpellItemEnchantmentStorage.LookupByKey(GetEnchantmentId(e));
if (enchant != null)
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)
if (randomSuffix.Enchantment[k] == enchant.Id)
return (int)((randomSuffix.AllocationPct[k] * GetItemSuffixFactor()) / 10000);
@@ -1781,7 +1781,7 @@ namespace Game.Entities
var enchant = CliDB.SpellItemEnchantmentStorage.LookupByKey(GetEnchantmentId(e));
if (enchant != null)
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)
if (randomProp.Enchantment[k] == enchant.Id)
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))
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)
itemLevel = heirloomIlvl;
}
@@ -2016,7 +2016,7 @@ namespace Game.Entities
uint itemLevelBeforeUpgrades = itemLevel;
ItemUpgradeRecord upgrade = CliDB.ItemUpgradeStorage.LookupByKey(upgradeId);
if (upgrade != null)
itemLevel += upgrade.ItemLevelBonus;
itemLevel += upgrade.ItemLevelIncrement;
if (pvpBonus)
itemLevel += Global.DB2Mgr.GetPvpItemLevelBonus(itemTemplate.GetId());
@@ -2072,19 +2072,19 @@ namespace Game.Entities
byte expansion = itemTemplate.GetRequiredExpansion();
foreach (ItemDisenchantLootRecord disenchant in CliDB.ItemDisenchantLootStorage.Values)
{
if (disenchant.ItemClass != itemClass)
if (disenchant.ClassID != itemClass)
continue;
if (disenchant.ItemSubClass >= 0 && itemSubClass != 0)
if (disenchant.Subclass >= 0 && itemSubClass != 0)
continue;
if (disenchant.ItemQuality != quality)
if (disenchant.Quality != quality)
continue;
if (disenchant.MinItemLevel > itemLevel || disenchant.MaxItemLevel < itemLevel)
if (disenchant.MinLevel > itemLevel || disenchant.MaxLevel < itemLevel)
continue;
if (disenchant.Expansion != -2 && disenchant.Expansion != expansion)
if (disenchant.ExpansionID != -2 && disenchant.ExpansionID != expansion)
continue;
return disenchant;
@@ -2102,9 +2102,9 @@ namespace Game.Entities
ItemModifiedAppearanceRecord transmog = CliDB.ItemModifiedAppearanceStorage.LookupByKey(GetModifier(transmogModifier));
if (transmog != null)
{
ItemAppearanceRecord itemAppearance = CliDB.ItemAppearanceStorage.LookupByKey(transmog.AppearanceID);
ItemAppearanceRecord itemAppearance = CliDB.ItemAppearanceStorage.LookupByKey(transmog.ItemAppearanceID);
if (itemAppearance != null)
return itemAppearance.DisplayID;
return itemAppearance.ItemDisplayInfoID;
}
return Global.DB2Mgr.GetItemDisplayId(GetEntry(), GetAppearanceModId());
@@ -2147,7 +2147,7 @@ namespace Game.Entities
ItemModifiedAppearanceRecord transmog = CliDB.ItemModifiedAppearanceStorage.LookupByKey(GetModifier(transmogModifier));
if (transmog != null)
return transmog.AppearanceModID;
return transmog.ItemAppearanceModifierID;
return (ushort)GetAppearanceModId();
}
@@ -2223,7 +2223,7 @@ namespace Game.Entities
{
foreach (ArtifactPowerRecord artifactPower in Global.DB2Mgr.GetArtifactPowers(artifactId))
{
if (artifactPower.ArtifactTier != artifactTier)
if (artifactPower.Tier != artifactTier)
continue;
if (m_artifactPowerIdToIndex.ContainsKey(artifactPower.Id))
@@ -2259,7 +2259,7 @@ namespace Game.Entities
{
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;
if (apply)
@@ -2281,7 +2281,7 @@ namespace Game.Entities
break;
case ItemEnchantmentType.ArtifactPowerBonusRankByID:
{
ItemDynamicFieldArtifactPowers artifactPower = GetArtifactPower(enchant.EffectSpellID[i]);
ItemDynamicFieldArtifactPowers artifactPower = GetArtifactPower(enchant.EffectArg[i]);
if (artifactPower != null)
{
ItemDynamicFieldArtifactPowers newPower = artifactPower;
@@ -2304,7 +2304,7 @@ namespace Game.Entities
case ItemEnchantmentType.ArtifactPowerBonusRankPicker:
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)
{
PlayerConditionRecord playerCondition = CliDB.PlayerConditionStorage.LookupByKey(artifactPowerPicker.PlayerConditionID);
@@ -2312,7 +2312,7 @@ namespace Game.Entities
{
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;
if (apply)
@@ -2363,7 +2363,7 @@ namespace Game.Entities
if (sourceItem && sourceItem.GetModifier(ItemModifier.ArtifactKnowledgeLevel) != 0)
artifactKnowledgeLevel = sourceItem.GetModifier(ItemModifier.ArtifactKnowledgeLevel);
else
artifactKnowledgeLevel = owner.GetCurrency(artifactCategory.ArtifactKnowledgeCurrencyID) + 1;
artifactKnowledgeLevel = owner.GetCurrency(artifactCategory.XpMultCurrencyID) + 1;
GtArtifactKnowledgeMultiplierRecord artifactKnowledge = CliDB.ArtifactKnowledgeMultiplierGameTable.GetRow(artifactKnowledgeLevel);
if (artifactKnowledge != null)
@@ -2403,7 +2403,7 @@ namespace Game.Entities
if (set.RequiredSkill != 0 && player.GetSkillValue((SkillType)set.RequiredSkill) < set.RequiredSkillRank)
return;
if (set.Flags.HasAnyFlag(ItemSetFlags.LegacyInactive))
if (set.SetFlags.HasAnyFlag(ItemSetFlags.LegacyInactive))
return;
ItemSetEffect eff = null;
+3 -3
View File
@@ -216,14 +216,14 @@ namespace Game.Entities
switch (quality)
{
case ItemQuality.Uncommon:
return randPropPointsEntry.UncommonPropertiesPoints[propIndex];
return randPropPointsEntry.Good[propIndex];
case ItemQuality.Rare:
case ItemQuality.Heirloom:
return randPropPointsEntry.RarePropertiesPoints[propIndex];
return randPropPointsEntry.Superior[propIndex];
case ItemQuality.Epic:
case ItemQuality.Legendary:
case ItemQuality.Artifact:
return randPropPointsEntry.EpicPropertiesPoints[propIndex];
return randPropPointsEntry.Epic[propIndex];
}
return 0;
}
+66 -42
View File
@@ -38,7 +38,7 @@ namespace Game.Entities
public string GetName(LocaleConstant locale = SharedConst.DefaultLocale)
{
return ExtendedData.Name[locale];
return ExtendedData.Display[locale];
}
public bool CanChangeEquipStateInCombat()
@@ -124,7 +124,31 @@ namespace Game.Entities
if (GetSubClass() < (uint)ItemSubClassArmor.Cloth || GetSubClass() > (uint)ItemSubClassArmor.Plate)
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
@@ -150,13 +174,13 @@ namespace Game.Entities
switch (GetInventoryType())
{
case InventoryType.Ammo:
dps = CliDB.ItemDamageAmmoStorage.LookupByKey(itemLevel).DPS[(int)quality];
dps = CliDB.ItemDamageAmmoStorage.LookupByKey(itemLevel).Quality[(int)quality];
break;
case InventoryType.Weapon2Hand:
if (GetFlags2().HasAnyFlag(ItemFlags2.CasterWeapon))
dps = CliDB.ItemDamageTwoHandCasterStorage.LookupByKey(itemLevel).DPS[(int)quality];
dps = CliDB.ItemDamageTwoHandCasterStorage.LookupByKey(itemLevel).Quality[(int)quality];
else
dps = CliDB.ItemDamageTwoHandStorage.LookupByKey(itemLevel).DPS[(int)quality];
dps = CliDB.ItemDamageTwoHandStorage.LookupByKey(itemLevel).Quality[(int)quality];
break;
case InventoryType.Ranged:
case InventoryType.Thrown:
@@ -164,15 +188,15 @@ namespace Game.Entities
switch ((ItemSubClassWeapon)GetSubClass())
{
case ItemSubClassWeapon.Wand:
dps = CliDB.ItemDamageOneHandCasterStorage.LookupByKey(itemLevel).DPS[(int)quality];
dps = CliDB.ItemDamageOneHandCasterStorage.LookupByKey(itemLevel).Quality[(int)quality];
break;
case ItemSubClassWeapon.Bow:
case ItemSubClassWeapon.Gun:
case ItemSubClassWeapon.Crossbow:
if (GetFlags2().HasAnyFlag(ItemFlags2.CasterWeapon))
dps = CliDB.ItemDamageTwoHandCasterStorage.LookupByKey(itemLevel).DPS[(int)quality];
dps = CliDB.ItemDamageTwoHandCasterStorage.LookupByKey(itemLevel).Quality[(int)quality];
else
dps = CliDB.ItemDamageTwoHandStorage.LookupByKey(itemLevel).DPS[(int)quality];
dps = CliDB.ItemDamageTwoHandStorage.LookupByKey(itemLevel).Quality[(int)quality];
break;
default:
return;
@@ -182,17 +206,17 @@ namespace Game.Entities
case InventoryType.WeaponMainhand:
case InventoryType.WeaponOffhand:
if (GetFlags2().HasAnyFlag(ItemFlags2.CasterWeapon))
dps = CliDB.ItemDamageOneHandCasterStorage.LookupByKey(itemLevel).DPS[(int)quality];
dps = CliDB.ItemDamageOneHandCasterStorage.LookupByKey(itemLevel).Quality[(int)quality];
else
dps = CliDB.ItemDamageOneHandStorage.LookupByKey(itemLevel).DPS[(int)quality];
dps = CliDB.ItemDamageOneHandStorage.LookupByKey(itemLevel).Quality[(int)quality];
break;
default:
return;
}
float avgDamage = dps * GetDelay() * 0.001f;
minDamage = (GetStatScalingFactor() * -0.5f + 1.0f) * avgDamage;
maxDamage = (float)Math.Floor(avgDamage * (GetStatScalingFactor() * 0.5f + 1.0f) + 0.5f);
minDamage = (GetDmgVariance() * -0.5f + 1.0f) * avgDamage;
maxDamage = (float)Math.Floor(avgDamage * (GetDmgVariance() * 0.5f + 1.0f) + 0.5f);
}
public bool IsUsableByLootSpecialization(Player player, bool alwaysAllowBoundToAccount)
@@ -225,16 +249,16 @@ namespace Game.Entities
}
public uint GetId() { return BasicData.Id; }
public ItemClass GetClass() { return (ItemClass)BasicData.Class; }
public uint GetSubClass() { return BasicData.SubClass; }
public ItemQuality GetQuality() { return (ItemQuality)ExtendedData.Quality; }
public ItemClass GetClass() { return (ItemClass)BasicData.ClassID; }
public uint GetSubClass() { return BasicData.SubclassID; }
public ItemQuality GetQuality() { return (ItemQuality)ExtendedData.OverallQualityID; }
public ItemFlags GetFlags() { return (ItemFlags)ExtendedData.Flags[0]; }
public ItemFlags2 GetFlags2() { return (ItemFlags2)ExtendedData.Flags[1]; }
public ItemFlags3 GetFlags3() { return (ItemFlags3)ExtendedData.Flags[2]; }
public uint GetFlags4() { return ExtendedData.Flags[3]; }
public float GetUnk1() { return ExtendedData.Unk1; }
public float GetUnk2() { return ExtendedData.Unk2; }
public uint GetBuyCount() { return Math.Max(ExtendedData.BuyCount, 1u); }
public float GetPriceRandomValue() { return ExtendedData.PriceRandomValue; }
public float GetPriceVariance() { return ExtendedData.PriceVariance; }
public uint GetBuyCount() { return Math.Max(ExtendedData.VendorStackCount, 1u); }
public uint GetBuyPrice() { return ExtendedData.BuyPrice; }
public uint GetSellPrice() { return ExtendedData.SellPrice; }
public InventoryType GetInventoryType() { return ExtendedData.inventoryType; }
@@ -244,15 +268,15 @@ namespace Game.Entities
public int GetBaseRequiredLevel() { return ExtendedData.RequiredLevel; }
public uint GetRequiredSkill() { return ExtendedData.RequiredSkill; }
public uint GetRequiredSkillRank() { return ExtendedData.RequiredSkillRank; }
public uint GetRequiredSpell() { return ExtendedData.RequiredSpell; }
public uint GetRequiredReputationFaction() { return ExtendedData.RequiredReputationFaction; }
public uint GetRequiredReputationRank() { return ExtendedData.RequiredReputationRank; }
public uint GetRequiredSpell() { return ExtendedData.RequiredAbility; }
public uint GetRequiredReputationFaction() { return ExtendedData.MinFactionID; }
public uint GetRequiredReputationRank() { return ExtendedData.MinReputation; }
public uint GetMaxCount() { return ExtendedData.MaxCount; }
public uint GetContainerSlots() { return ExtendedData.ContainerSlots; }
public int GetItemStatType(uint index)
{
Contract.Assert(index < ItemConst.MaxStats);
return ExtendedData.ItemStatType[index];
return ExtendedData.StatModifierBonusStat[index];
}
public int GetItemStatValue(uint index)
{
@@ -262,42 +286,42 @@ namespace Game.Entities
public int GetItemStatAllocation(uint index)
{
Contract.Assert(index < ItemConst.MaxStats);
return ExtendedData.ItemStatAllocation[index];
return ExtendedData.StatPercentEditor[index];
}
public float GetItemStatSocketCostMultiplier(uint index)
{
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 GetDelay() { return ExtendedData.Delay; }
public float GetRangedModRange() { return ExtendedData.RangedModRange; }
public uint GetDelay() { return ExtendedData.ItemDelay; }
public float GetRangedModRange() { return ExtendedData.ItemRange; }
public ItemBondingType GetBonding() { return (ItemBondingType)ExtendedData.Bonding; }
public uint GetPageText() { return ExtendedData.PageText; }
public uint GetStartQuest() { return ExtendedData.StartQuest; }
public uint GetPageText() { return ExtendedData.PageID; }
public uint GetStartQuest() { return ExtendedData.StartQuestID; }
public uint GetLockID() { return ExtendedData.LockID; }
public uint GetRandomProperty() { return ExtendedData.RandomProperty; }
public uint GetRandomSuffix() { return ExtendedData.RandomSuffix; }
public uint GetRandomProperty() { return ExtendedData.RandomSelect; }
public uint GetRandomSuffix() { return ExtendedData.ItemRandomSuffixGroupID; }
public uint GetItemSet() { return ExtendedData.ItemSet; }
public uint GetArea() { return ExtendedData.Area; }
public uint GetMap() { return ExtendedData.Map; }
public uint GetArea() { return ExtendedData.ZoneBound; }
public uint GetMap() { return ExtendedData.InstanceBound; }
public BagFamilyMask GetBagFamily() { return (BagFamilyMask)ExtendedData.BagFamily; }
public uint GetTotemCategory() { return ExtendedData.TotemCategory; }
public uint GetTotemCategory() { return ExtendedData.TotemCategoryID; }
public SocketColor GetSocketColor(uint index)
{
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 float GetArmorDamageModifier() { return ExtendedData.ArmorDamageModifier; }
public uint GetDuration() { return ExtendedData.Duration; }
public uint GetItemLimitCategory() { return ExtendedData.ItemLimitCategory; }
public HolidayIds GetHolidayID() { return (HolidayIds)ExtendedData.HolidayID; }
public float GetStatScalingFactor() { return ExtendedData.StatScalingFactor; }
public float GetQualityModifier() { return ExtendedData.QualityModifier; }
public uint GetDuration() { return ExtendedData.DurationInInventory; }
public uint GetItemLimitCategory() { return ExtendedData.LimitCategory; }
public HolidayIds GetHolidayID() { return (HolidayIds)ExtendedData.RequiredHoliday; }
public float GetDmgVariance() { return ExtendedData.DmgVariance; }
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; }
@@ -153,11 +153,11 @@ namespace Game.Entities
uint bonusId = 0;
if (flags.HasAnyFlag(HeirloomPlayerFlags.BonusLevel110))
bonusId = heirloom.ItemBonusListID[2];
bonusId = heirloom.UpgradeItemBonusListID[2];
else if (flags.HasAnyFlag(HeirloomPlayerFlags.BonusLevel100))
bonusId = heirloom.ItemBonusListID[1];
bonusId = heirloom.UpgradeItemBonusListID[1];
else if (flags.HasAnyFlag(HeirloomPlayerFlags.BonusLevel90))
bonusId = heirloom.ItemBonusListID[0];
bonusId = heirloom.UpgradeItemBonusListID[0];
_heirlooms[itemId] = new HeirloomData(flags, bonusId);
} while (result.NextRow());
@@ -232,17 +232,17 @@ namespace Game.Entities
if (heirloom.UpgradeItemID[0] == castItem)
{
flags |= HeirloomPlayerFlags.BonusLevel90;
bonusId = heirloom.ItemBonusListID[0];
bonusId = heirloom.UpgradeItemBonusListID[0];
}
if (heirloom.UpgradeItemID[1] == castItem)
{
flags |= HeirloomPlayerFlags.BonusLevel100;
bonusId = heirloom.ItemBonusListID[1];
bonusId = heirloom.UpgradeItemBonusListID[1];
}
if (heirloom.UpgradeItemID[2] == castItem)
{
flags |= HeirloomPlayerFlags.BonusLevel110;
bonusId = heirloom.ItemBonusListID[2];
bonusId = heirloom.UpgradeItemBonusListID[2];
}
foreach (Item item in player.GetItemListByEntry(itemId, true))
@@ -272,7 +272,7 @@ namespace Game.Entities
return;
// Check for heirloom pairs (normal - heroic, heroic - mythic)
uint heirloomItemId = heirloom.NextDifficultyItemID;
uint heirloomItemId = heirloom.StaticUpgradedItemID;
uint newItemId = 0;
HeirloomRecord heirloomDiff;
while ((heirloomDiff = Global.DB2Mgr.GetHeirloomByItemId(heirloomItemId)) != null)
@@ -280,7 +280,7 @@ namespace Game.Entities
if (player.GetItemByEntry(heirloomDiff.ItemID))
newItemId = heirloomDiff.ItemID;
HeirloomRecord heirloomSub = Global.DB2Mgr.GetHeirloomByItemId(heirloomDiff.NextDifficultyItemID);
HeirloomRecord heirloomSub = Global.DB2Mgr.GetHeirloomByItemId(heirloomDiff.StaticUpgradedItemID);
if (heirloomSub != null)
{
heirloomItemId = heirloomSub.ItemID;
@@ -385,10 +385,10 @@ namespace Game.Entities
_mounts[spellId] = flags;
// 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);
if (!ConditionManager.IsPlayerMeetingCondition(player, playerCondition))
PlayerConditionRecord playerCondition = CliDB.PlayerConditionStorage.LookupByKey(mount.PlayerConditionID);
if (playerCondition != null && !ConditionManager.IsPlayerMeetingCondition(player, playerCondition))
return false;
}
@@ -578,7 +578,7 @@ namespace Game.Entities
if (itemModifiedAppearance == null)
return false;
if (itemModifiedAppearance.SourceType == 6 || itemModifiedAppearance.SourceType == 9)
if (itemModifiedAppearance.TransmogSourceTypeEnum == 6 || itemModifiedAppearance.TransmogSourceTypeEnum == 9)
return false;
if (!CliDB.ItemSearchNameStorage.ContainsKey(itemModifiedAppearance.ItemID))
+5 -5
View File
@@ -56,8 +56,8 @@ namespace Game.Entities
ArtifactPowerRecord artifactPower = CliDB.ArtifactPowerStorage.LookupByKey(artifactPowerData.ArtifactPowerId);
if (artifactPower != null)
{
if (artifactPowerData.PurchasedRank > artifactPower.MaxRank)
artifactPowerData.PurchasedRank = artifactPower.MaxRank;
if (artifactPowerData.PurchasedRank > artifactPower.MaxPurchasableRank)
artifactPowerData.PurchasedRank = artifactPower.MaxPurchasableRank;
artifactPowerData.CurrentRankWithBonus = (byte)(artifactPower.Flags.HasAnyFlag(ArtifactPowerFlag.First) ? 1 : 0);
@@ -2659,7 +2659,7 @@ namespace Game.Entities
else // have start node, to it
{
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);
}
m_taxi.ClearTaxiDestinations();
@@ -2669,10 +2669,10 @@ namespace Game.Entities
{
// save source node as recall coord to prevent recall and fall from sky
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
mapId = nodeEntry.MapID;
mapId = nodeEntry.ContinentID;
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;
for (byte i = 0; i < ItemConst.MaxItemExtCostItems; ++i)
{
uint count = iece.RequiredItemCount[i];
uint itemid = iece.RequiredItem[i];
uint count = iece.ItemCount[i];
uint itemid = iece.ItemID[i];
if (count != 0 && itemid != 0)
{
@@ -116,8 +116,8 @@ namespace Game.Entities
// Grant back extendedcost items
for (byte i = 0; i < ItemConst.MaxItemExtCostItems; ++i)
{
uint count = iece.RequiredItemCount[i];
uint itemid = iece.RequiredItem[i];
uint count = iece.ItemCount[i];
uint itemid = iece.ItemID[i];
if (count != 0 && itemid != 0)
{
List<ItemPosCount> dest = new List<ItemPosCount>();
@@ -131,11 +131,11 @@ namespace Game.Entities
// Grant back currencies
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;
uint count = iece.RequiredCurrencyCount[i];
uint currencyid = iece.RequiredCurrency[i];
uint count = iece.CurrencyCount[i];
uint currencyid = iece.CurrencyID[i];
if (count != 0 && currencyid != 0)
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
{
setItemPurchaseData.Contents.Items[i].ItemCount = iece.RequiredItemCount[i];
setItemPurchaseData.Contents.Items[i].ItemID = iece.RequiredItem[i];
setItemPurchaseData.Contents.Items[i].ItemCount = iece.ItemCount[i];
setItemPurchaseData.Contents.Items[i].ItemID = iece.ItemID[i];
}
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;
setItemPurchaseData.Contents.Currencies[i].CurrencyCount = iece.RequiredCurrencyCount[i];
setItemPurchaseData.Contents.Currencies[i].CurrencyID = iece.RequiredCurrency[i];
setItemPurchaseData.Contents.Currencies[i].CurrencyCount = iece.CurrencyCount[i];
setItemPurchaseData.Contents.Currencies[i].CurrencyID = iece.CurrencyID[i];
}
SendPacket(setItemPurchaseData);
@@ -205,17 +205,17 @@ namespace Game.Entities
itemPurchaseRefundResult.Contents.Value.Money = item.GetPaidMoney();
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].ItemID = iece.RequiredItem[i];
itemPurchaseRefundResult.Contents.Value.Items[i].ItemCount = iece.ItemCount[i];
itemPurchaseRefundResult.Contents.Value.Items[i].ItemID = iece.ItemID[i];
}
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;
itemPurchaseRefundResult.Contents.Value.Currencies[i].CurrencyCount = iece.RequiredCurrencyCount[i];
itemPurchaseRefundResult.Contents.Value.Currencies[i].CurrencyID = iece.RequiredCurrency[i];
itemPurchaseRefundResult.Contents.Value.Currencies[i].CurrencyCount = iece.CurrencyCount[i];
itemPurchaseRefundResult.Contents.Value.Currencies[i].CurrencyID = iece.CurrencyID[i];
}
}
@@ -442,7 +442,7 @@ namespace Game.Entities
else if (ditemProto.GetClass() == ItemClass.Armor)
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));
if (costs == 0) //fix for ITEM_QUALITY_ARTIFACT
@@ -1159,7 +1159,7 @@ namespace Game.Entities
ItemTemplate proto = pItem.GetTemplate();
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 (!HasAura(proto.Effects[i].SpellID))
CastSpell(this, proto.Effects[i].SpellID, true, pItem);
@@ -1202,7 +1202,7 @@ namespace Game.Entities
ItemTemplate proto = pItem2.GetTemplate();
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 (!HasAura(proto.Effects[i].SpellID))
CastSpell(this, proto.Effects[i].SpellID, true, pItem2);
@@ -1321,7 +1321,7 @@ namespace Game.Entities
ItemChildEquipmentRecord childItemEntry = Global.DB2Mgr.GetItemChildEquipment(itemId);
if (childItemEntry != null)
{
ItemTemplate childTemplate = Global.ObjectMgr.GetItemTemplate(childItemEntry.AltItemID);
ItemTemplate childTemplate = Global.ObjectMgr.GetItemTemplate(childItemEntry.ChildItemID);
if (childTemplate != null)
{
List<ItemPosCount> childDest = new List<ItemPosCount>();
@@ -1510,7 +1510,7 @@ namespace Game.Entities
ArtifactRecord artifact = CliDB.ArtifactStorage.LookupByKey(proto.GetArtifactID());
if (artifact != null)
if (artifact.SpecID != GetUInt32Value(PlayerFields.CurrentSpecId))
if (artifact.ChrSpecializationID != GetUInt32Value(PlayerFields.CurrentSpecId))
return InventoryResult.CantUseItem;
return InventoryResult.Ok;
@@ -1735,7 +1735,7 @@ namespace Game.Entities
Item childItem = GetChildItemByGuid(parentItem.GetChildItem());
if (childItem)
{
ushort childDest = (ushort)((InventorySlots.Bag0 << 8) | itemChildEquipment.AltEquipmentSlot);
ushort childDest = (ushort)((InventorySlots.Bag0 << 8) | itemChildEquipment.ChildItemEquipSlot);
if (childItem.GetPos() != childDest)
{
Item dstItem = GetItemByPos(childDest);
@@ -2521,17 +2521,17 @@ namespace Game.Entities
var iece = CliDB.ItemExtendedCostStorage.LookupByKey(crItem.ExtendedCost);
for (int i = 0; i < ItemConst.MaxItemExtCostItems; ++i)
{
if (iece.RequiredItem[i] != 0)
DestroyItemCount(iece.RequiredItem[i], iece.RequiredItemCount[i] * stacks, true);
if (iece.ItemID[i] != 0)
DestroyItemCount(iece.ItemID[i], iece.ItemCount[i] * stacks, true);
}
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;
if (iece.RequiredCurrency[i] != 0)
ModifyCurrency((CurrencyTypes)iece.RequiredCurrency[i], -(int)(iece.RequiredCurrencyCount[i] * stacks), true, true);
if (iece.CurrencyID[i] != 0)
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)
{
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);
return false;
@@ -3511,23 +3511,23 @@ namespace Game.Entities
for (byte i = 0; i < ItemConst.MaxItemExtCostCurrencies; ++i)
{
if (iece.RequiredCurrency[i] == 0)
if (iece.CurrencyID[i] == 0)
continue;
CurrencyTypesRecord entry = CliDB.CurrencyTypesStorage.LookupByKey(iece.RequiredCurrency[i]);
CurrencyTypesRecord entry = CliDB.CurrencyTypesStorage.LookupByKey(iece.CurrencyID[i]);
if (entry == null)
{
SendBuyError(BuyResult.CantFindItem, creature, currency); // Find correct error
return false;
}
if (iece.RequirementFlags.HasAnyFlag((byte)((uint)ItemExtendedCostFlags.RequireSeasonEarned1 << i)))
if (iece.Flags.HasAnyFlag((byte)((uint)ItemExtendedCostFlags.RequireSeasonEarned1 << i)))
{
// Not implemented
SendEquipError(InventoryResult.VendorMissingTurnins); // Find correct error
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
return false;
@@ -3535,20 +3535,20 @@ namespace Game.Entities
}
// check for personal arena rating requirement
if (GetMaxPersonalArenaRatingRequirement(iece.RequiredArenaSlot) < iece.RequiredPersonalArenaRating)
if (GetMaxPersonalArenaRatingRequirement(iece.ArenaBracket) < iece.RequiredArenaRating)
{
// probably not the proper equip err
SendEquipError(InventoryResult.CantEquipRank);
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);
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
return false;
@@ -3571,21 +3571,21 @@ namespace Game.Entities
{
for (byte i = 0; i < ItemConst.MaxItemExtCostItems; ++i)
{
if (iece.RequiredItem[i] == 0)
if (iece.ItemID[i] == 0)
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)
{
if (iece.RequiredCurrency[i] == 0)
if (iece.CurrencyID[i] == 0)
continue;
if (iece.RequirementFlags.HasAnyFlag((byte)((uint)ItemExtendedCostFlags.RequireSeasonEarned1 << i)))
if (iece.Flags.HasAnyFlag((byte)((uint)ItemExtendedCostFlags.RequireSeasonEarned1 << i)))
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)
{
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);
return false;
@@ -3711,22 +3711,22 @@ namespace Game.Entities
for (byte i = 0; i < ItemConst.MaxItemExtCostCurrencies; ++i)
{
if (iece.RequiredCurrency[i] == 0)
if (iece.CurrencyID[i] == 0)
continue;
var entry = CliDB.CurrencyTypesStorage.LookupByKey(iece.RequiredCurrency[i]);
var entry = CliDB.CurrencyTypesStorage.LookupByKey(iece.CurrencyID[i]);
if (entry == null)
{
SendBuyError(BuyResult.CantFindItem, creature, item);
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
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);
return false;
@@ -3734,20 +3734,20 @@ namespace Game.Entities
}
// check for personal arena rating requirement
if (GetMaxPersonalArenaRatingRequirement(iece.RequiredArenaSlot) < iece.RequiredPersonalArenaRating)
if (GetMaxPersonalArenaRatingRequirement(iece.ArenaBracket) < iece.RequiredArenaRating)
{
// probably not the proper equip err
SendEquipError(InventoryResult.CantEquipRank);
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);
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
return false;
@@ -4264,7 +4264,7 @@ namespace Game.Entities
continue;
// wrong triggering type
if (apply && spellData.Trigger != ItemSpelltriggerType.OnEquip)
if (apply && spellData.TriggerType != ItemSpelltriggerType.OnEquip)
continue;
// check if it is valid spell
@@ -4336,7 +4336,7 @@ namespace Game.Entities
var effectData = proto.Effects[i];
// 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);
if (procEntry == null)
@@ -4353,7 +4353,7 @@ namespace Game.Entities
continue;
// wrong triggering type
if (effectData.Trigger != ItemSpelltriggerType.OnUse)
if (effectData.TriggerType != ItemSpelltriggerType.OnUse)
continue;
// Don't replace longer cooldowns by equip cooldown if we have any.
@@ -5277,11 +5277,11 @@ namespace Game.Entities
if (childEquipement == null)
return InventoryResult.Ok;
Item dstItem = GetItemByPos(InventorySlots.Bag0, childEquipement.AltEquipmentSlot);
Item dstItem = GetItemByPos(InventorySlots.Bag0, childEquipement.ChildItemEquipSlot);
if (!dstItem)
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());
if (msg != InventoryResult.Ok)
return msg;
@@ -5428,7 +5428,7 @@ namespace Game.Entities
ArtifactAppearanceRecord artifactAppearance = CliDB.ArtifactAppearanceStorage.LookupByKey(item.GetModifier(ItemModifier.ArtifactAppearanceId));
if (artifactAppearance != null)
if (artifactAppearance.ShapeshiftDisplayID != 0 && GetShapeshiftForm() == (ShapeShiftForm)artifactAppearance.ModifiesShapeshiftFormDisplay)
if (artifactAppearance.OverrideShapeshiftDisplayID != 0 && GetShapeshiftForm() == (ShapeShiftForm)artifactAppearance.OverrideShapeshiftFormID)
RestoreDisplayId();
}
@@ -5451,7 +5451,7 @@ namespace Game.Entities
continue;
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
@@ -5460,10 +5460,10 @@ namespace Game.Entities
else if (apply)
{
Dictionary<SpellValueMod, int> csv = new Dictionary<SpellValueMod, int>();
if (artifactPowerRank.Value != 0)
if (artifactPowerRank.AuraPointsOverride != 0)
for (int i = 0; i < SpellConst.MaxEffects; ++i)
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);
}
@@ -5651,7 +5651,7 @@ namespace Game.Entities
ItemTemplate proto = pItem.GetTemplate();
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);
ItemRemovedQuestCheck(pItem.GetEntry(), pItem.GetCount());
+1 -1
View File
@@ -512,7 +512,7 @@ namespace Game.Entities
{
if (missingQuest != 0 && !string.IsNullOrEmpty(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);
else if (missingItem != 0)
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)
return;
CharTitlesRecord charTitlesEntry = CliDB.CharTitlesStorage.LookupByKey(rewardPackEntry.TitleID);
CharTitlesRecord charTitlesEntry = CliDB.CharTitlesStorage.LookupByKey(rewardPackEntry.CharTitleID);
if (charTitlesEntry != null)
SetTitle(charTitlesEntry);
@@ -245,7 +245,7 @@ namespace Game.Entities
if (rewardPackXItems != null)
{
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))
{
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)
{
SendEquipError(res, null, null, questPackageItem.ItemID);
@@ -672,7 +672,7 @@ namespace Game.Entities
if (questPackageItem.ItemID != reward)
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)
{
SendEquipError(res, null, null, questPackageItem.ItemID);
@@ -829,7 +829,7 @@ namespace Game.Entities
(rewardProto.GetFlags2().HasAnyFlag(ItemFlags2.FactionHorde) && GetTeam() != Team.Horde))
return false;
switch (questPackageItem.FilterType)
switch (questPackageItem.DisplayType)
{
case QuestPackageFilter.LootSpecialization:
return rewardProto.IsUsableByLootSpecialization(this, true);
@@ -859,10 +859,10 @@ namespace Game.Entities
{
hasFilteredQuestPackageReward = true;
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));
SendNewItem(item, questPackageItem.ItemCount, true, false);
SendNewItem(item, questPackageItem.ItemQuantity, true, false);
}
}
}
@@ -879,10 +879,10 @@ namespace Game.Entities
continue;
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));
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];
uint enchant_amount = pEnchant.EffectPointsMin[s];
uint enchant_spell_id = pEnchant.EffectSpellID[s];
uint enchant_spell_id = pEnchant.EffectArg[s];
switch (enchant_display_type)
{
@@ -1064,7 +1064,7 @@ namespace Game.Entities
if (proto != null)
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);
if (spellInfo != null)
@@ -1158,7 +1158,7 @@ namespace Game.Entities
// remove all spells that related to this skill
foreach (var pAbility in CliDB.SkillLineAbilityStorage.Values)
if (pAbility.SkillLine == id)
RemoveSpell(Global.SpellMgr.GetFirstSpellInChain(pAbility.SpellID));
RemoveSpell(Global.SpellMgr.GetFirstSpellInChain(pAbility.Spell));
// Clear profession lines
if (GetUInt32Value(PlayerFields.ProfessionSkillLine1) == id)
@@ -1396,13 +1396,13 @@ namespace Game.Entities
for (byte i = 0; i < 5; i++)
{
if (Condition.LTOperandType[i] == 0)
if (Condition.LtOperandType[i] == 0)
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
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])
{
@@ -1507,7 +1507,7 @@ namespace Game.Entities
continue;
// wrong triggering type
if (spellData.Trigger != ItemSpelltriggerType.OnUse)
if (spellData.TriggerType != ItemSpelltriggerType.OnUse)
continue;
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spellData.SpellID);
@@ -1544,10 +1544,10 @@ namespace Game.Entities
if (pEnchant.Effect[s] != ItemEnchantmentType.UseSpell)
continue;
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(pEnchant.EffectSpellID[s]);
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(pEnchant.EffectArg[s]);
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;
}
@@ -1573,14 +1573,14 @@ namespace Game.Entities
void LearnSkillRewardedSpells(uint skillId, uint skillValue)
{
ulong raceMask = getRaceMask();
long raceMask = getRaceMask();
uint classMask = getClassMask();
foreach (var ability in CliDB.SkillLineAbilityStorage.Values)
{
if (ability.SkillLine != skillId)
continue;
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(ability.SpellID);
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(ability.Spell);
if (spellInfo == null)
continue;
@@ -1605,12 +1605,12 @@ namespace Game.Entities
// need unlearn spell
if (skillValue < ability.MinSkillLineRank && ability.AcquireMethod == AbilytyLearnType.OnSkillValue)
RemoveSpell(ability.SpellID);
RemoveSpell(ability.Spell);
// need learn
else if (!IsInWorld)
AddSpell(ability.SpellID, true, true, true, false, false, ability.SkillLine);
AddSpell(ability.Spell, true, true, true, false, false, ability.SkillLine);
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);
uint cooldown = GetRuneBaseCooldown();
SetStatFloatValue(UnitFields.PowerRegenFlatModifier + runeIndex, (float)(1 * Time.InMilliseconds) / (float)cooldown - runeEntry.RegenerationPeace);
SetStatFloatValue(UnitFields.PowerRegenInterruptedFlatModifier + runeIndex, (float)(1 * Time.InMilliseconds) / (float)cooldown - runeEntry.RegenerationCombat);
SetStatFloatValue(UnitFields.PowerRegenFlatModifier + runeIndex, (float)(1 * Time.InMilliseconds) / (float)cooldown - runeEntry.RegenPeace);
SetStatFloatValue(UnitFields.PowerRegenInterruptedFlatModifier + runeIndex, (float)(1 * Time.InMilliseconds) / (float)cooldown - runeEntry.RegenCombat);
}
public uint GetRuneCooldown(byte index) { return m_runes.Cooldown[index]; }
@@ -3052,7 +3052,7 @@ namespace Game.Entities
continue;
// wrong triggering type
if (spellData.Trigger != ItemSpelltriggerType.ChanceOnHit)
if (spellData.TriggerType != ItemSpelltriggerType.ChanceOnHit)
continue;
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spellData.SpellID);
@@ -3109,11 +3109,11 @@ namespace Game.Entities
continue;
}
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(pEnchant.EffectSpellID[s]);
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(pEnchant.EffectArg[s]);
if (spellInfo == null)
{
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;
}
@@ -3128,7 +3128,7 @@ namespace Game.Entities
}
// 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
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));
int powertype = (int)cEntry.PowerType;
int powertype = (int)cEntry.DisplayPower;
SetObjectScale(1.0f);
@@ -388,7 +388,7 @@ namespace Game.Entities
{
if (!iProto.Effects.Empty())
{
switch (iProto.Effects[0].Category)
switch (iProto.Effects[0].SpellCategoryID)
{
case 11: // food
count = (uint)(GetClass() == Class.Deathknight ? 10 : 4);
@@ -1425,7 +1425,7 @@ namespace Game.Entities
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());
return false;
@@ -1655,7 +1655,7 @@ namespace Game.Entities
if (questFactionRewEntry != null)
{
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)
{
if (trigger == null || GetMapId() != trigger.MapID)
if (trigger == null || GetMapId() != trigger.ContinentID)
return false;
if (trigger.Radius > 0.0f)
@@ -3752,13 +3752,13 @@ namespace Game.Entities
if (!IsInCombat())
{
if (powerType.RegenerationDelay != 0 && Time.GetMSTimeDiffToNow(m_combatExitTime) < powerType.RegenerationDelay)
if (powerType.RegenInterruptTimeMS != 0 && Time.GetMSTimeDiffToNow(m_combatExitTime) < powerType.RegenInterruptTimeMS)
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
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 =
{
@@ -3793,7 +3793,7 @@ namespace Game.Entities
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);
if (addvalue < 0.0f)
@@ -3812,17 +3812,17 @@ namespace Game.Entities
addvalue += m_powerFraction[powerIndex];
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);
minPower = powerType.RegenerationCenter;
minPower = powerType.CenterPower;
}
else if (curValue < powerType.RegenerationCenter)
else if (curValue < powerType.CenterPower)
{
addvalue = Math.Abs(addvalue);
maxPower = powerType.RegenerationCenter;
maxPower = powerType.CenterPower;
}
else
return;
@@ -3982,46 +3982,46 @@ namespace Game.Entities
switch (selection)
{
case 0:
if (!entry.Flags.HasAnyFlag((ushort)1))
if (!entry.Flags.HasAnyFlag((short)1))
return false;
return !entry.Flags.HasAnyFlag((ushort)0x2C);
return !entry.Flags.HasAnyFlag((short)0x2C);
case 1:
if (!entry.Flags.HasAnyFlag((ushort)1))
if (!entry.Flags.HasAnyFlag((short)1))
return false;
if (!entry.Flags.HasAnyFlag((ushort)0x94))
if (!entry.Flags.HasAnyFlag((short)0x94))
return false;
return !entry.Flags.HasAnyFlag((ushort)8);
return !entry.Flags.HasAnyFlag((short)8);
case 2:
if (!entry.Flags.HasAnyFlag((ushort)1))
if (!entry.Flags.HasAnyFlag((short)1))
return false;
if (!entry.Flags.HasAnyFlag((ushort)0x70))
if (!entry.Flags.HasAnyFlag((short)0x70))
return false;
return !entry.Flags.HasAnyFlag((ushort)8);
return !entry.Flags.HasAnyFlag((short)8);
case 3:
if (!entry.Flags.HasAnyFlag((ushort)1))
if (!entry.Flags.HasAnyFlag((short)1))
return false;
if (!entry.Flags.HasAnyFlag((ushort)0x20))
if (!entry.Flags.HasAnyFlag((short)0x20))
return false;
return !entry.Flags.HasAnyFlag((ushort)8);
return !entry.Flags.HasAnyFlag((short)8);
case 4:
case 8:
if (!entry.Flags.HasAnyFlag((ushort)3))
if (!entry.Flags.HasAnyFlag((short)3))
return false;
return !entry.Flags.HasAnyFlag((ushort)0x2C);
return !entry.Flags.HasAnyFlag((short)0x2C);
case 5:
case 9:
if (!entry.Flags.HasAnyFlag((ushort)3))
if (!entry.Flags.HasAnyFlag((short)3))
return false;
if (!entry.Flags.HasAnyFlag((ushort)0x94))
if (!entry.Flags.HasAnyFlag((short)0x94))
return false;
return !entry.Flags.HasAnyFlag((ushort)8);
return !entry.Flags.HasAnyFlag((short)8);
case 6:
case 10:
if (!entry.Flags.HasAnyFlag((ushort)3))
if (!entry.Flags.HasAnyFlag((short)3))
return false;
if (!entry.Flags.HasAnyFlag((ushort)0x70))
if (!entry.Flags.HasAnyFlag((short)0x70))
return false;
return !entry.Flags.HasAnyFlag((ushort)8);
return !entry.Flags.HasAnyFlag((short)8);
case 7:
return true;
default:
@@ -5143,7 +5143,7 @@ namespace Game.Entities
{
ChrRacesRecord rEntry = CliDB.ChrRacesStorage.LookupByKey((byte)race);
if (rEntry != null)
return rEntry.TeamID;
return (uint)rEntry.Alliance;
Log.outError(LogFilter.Player, "Race ({0}) not found in DBC: wrong DBC files?", race);
return TeamId.Neutral;
@@ -6731,7 +6731,7 @@ namespace Game.Entities
// 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.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);
return false;
@@ -6842,7 +6842,7 @@ namespace Game.Entities
m_taxi.ClearTaxiDestinations();
ModifyMoney(-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;
}
else
@@ -6863,8 +6863,8 @@ namespace Game.Entities
List<uint> nodes = new List<uint>();
nodes.Add(entry.From);
nodes.Add(entry.To);
nodes.Add(entry.FromTaxiNode);
nodes.Add(entry.ToTaxiNode);
return ActivateTaxiPathTo(nodes, null, spellid);
}
@@ -6905,7 +6905,7 @@ namespace Game.Entities
var prevNode = nodeList[i - 1];
// skip nodes at another map
if (node.MapID != GetMapId())
if (node.ContinentID != GetMapId())
continue;
distPrev = distNext;
@@ -7054,7 +7054,7 @@ namespace Game.Entities
}
public bool IsSpellFitByClassAndRace(uint spell_id)
{
ulong racemask = getRaceMask();
long racemask = getRaceMask();
uint classmask = getClassMask();
var bounds = Global.SpellMgr.GetSkillLineAbilityMapBounds(spell_id);
+1 -1
View File
@@ -538,7 +538,7 @@ namespace Game.Entities
PowerTypeRecord powerTypeEntry = Global.DB2Mgr.GetPowerTypeEntry(powerType);
if (powerTypeEntry != null)
return powerTypeEntry.MaxPower;
return powerTypeEntry.MaxBasePower;
return 0;
}
+9 -9
View File
@@ -37,8 +37,8 @@ namespace Game.Entities
// Initialize here
foreach (TaxiPathRecord path in CliDB.TaxiPathStorage.Values)
{
TaxiNodesRecord from = CliDB.TaxiNodesStorage.LookupByKey(path.From);
TaxiNodesRecord to = CliDB.TaxiNodesStorage.LookupByKey(path.To);
TaxiNodesRecord from = CliDB.TaxiNodesStorage.LookupByKey(path.FromTaxiNode);
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))
AddVerticeAndEdgeFromNodeInfo(from, to, path.Id, edges);
}
@@ -62,7 +62,7 @@ namespace Game.Entities
uint GetVertexIDFromNodeID(TaxiNodesRecord node)
{
return node.LearnableIndex;
return node.CharacterBitNumber;
}
int GetVertexCount()
@@ -105,8 +105,8 @@ namespace Game.Entities
uint map1, map2;
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].MapID, nodes[i].Loc.X, nodes[i].Loc.Y, nodes[i].Loc.Z, out map2, out pos2);
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].ContinentID, nodes[i].Loc.X, nodes[i].Loc.Y, nodes[i].Loc.Z, out map2, out pos2);
if (map1 != map2)
continue;
@@ -172,11 +172,11 @@ namespace Game.Entities
uint CreateVertexFromFromNodeInfoIfNeeded(TaxiNodesRecord node)
{
//Check if we need a new one or if it may be already created
if (m_vertices.Length <= node.LearnableIndex)
Array.Resize(ref m_vertices, (int)node.LearnableIndex + 1);
if (m_vertices.Length <= node.CharacterBitNumber)
Array.Resize(ref m_vertices, (int)node.CharacterBitNumber + 1);
m_vertices[node.LearnableIndex] = node;
return node.LearnableIndex;
m_vertices[node.CharacterBitNumber] = node;
return node.CharacterBitNumber;
}
TaxiNodesRecord[] m_vertices = new TaxiNodesRecord[0];
+2 -2
View File
@@ -337,7 +337,7 @@ namespace Game.Entities
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; }
@@ -373,7 +373,7 @@ namespace Game.Entities
m_bonusSpellDamage = 0;
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;
InitCharmInfo();
+7 -7
View File
@@ -213,15 +213,15 @@ namespace Game.Entities
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);
// Departure event
var nextframe = GetKeyFrames()[_nextFrame];
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;
}
@@ -399,7 +399,7 @@ namespace Game.Entities
UnitTypeMask mask = UnitTypeMask.Summon;
if (properties != null)
{
switch (properties.Category)
switch (properties.Control)
{
case SummonCategory.Pet:
mask = UnitTypeMask.Guardian;
@@ -414,7 +414,7 @@ namespace Game.Entities
case SummonCategory.Ally:
case SummonCategory.Unk:
{
switch (properties.Type)
switch (properties.Title)
{
case SummonType.Minion:
case SummonType.Guardian:
@@ -664,7 +664,7 @@ namespace Game.Entities
var nextFrame = GetKeyFrames()[_nextFrame];
_delayedTeleport = false;
Map newMap = Global.MapMgr.CreateBaseMap(nextFrame.Node.MapID);
Map newMap = Global.MapMgr.CreateBaseMap(nextFrame.Node.ContinentID);
GetMap().RemoveFromMap(this, false);
SetMap(newMap);
@@ -684,7 +684,7 @@ namespace Game.Entities
switch (obj.GetTypeId())
{
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);
break;
case TypeId.DynamicObject:
+8 -8
View File
@@ -687,7 +687,7 @@ namespace Game.Entities
if (mountCapability == null)
continue;
if (ridingSkill < mountCapability.RequiredRidingSkill)
if (ridingSkill < mountCapability.ReqRidingSkill)
continue;
if (!mountCapability.Flags.HasAnyFlag(MountCapabilityFlags.IgnoreRestrictions))
@@ -721,19 +721,19 @@ namespace Game.Entities
else if (!mountCapability.Flags.HasAnyFlag(MountCapabilityFlags.Float))
continue;
if (mountCapability.RequiredMap != -1 &&
GetMapId() != mountCapability.RequiredMap &&
GetMap().GetEntry().CosmeticParentMapID != mountCapability.RequiredMap &&
GetMap().GetEntry().ParentMapID != mountCapability.RequiredMap)
if (mountCapability.ReqMapID != -1 &&
GetMapId() != mountCapability.ReqMapID &&
GetMap().GetEntry().CosmeticParentMapID != mountCapability.ReqMapID &&
GetMap().GetEntry().ParentMapID != mountCapability.ReqMapID)
continue;
if (mountCapability.RequiredArea != 0 && !Global.DB2Mgr.IsInArea(areaId, mountCapability.RequiredArea))
if (mountCapability.ReqAreaID != 0 && !Global.DB2Mgr.IsInArea(areaId, mountCapability.ReqAreaID))
continue;
if (mountCapability.RequiredAura != 0 && !HasAura(mountCapability.RequiredAura))
if (mountCapability.ReqSpellAuraID != 0 && !HasAura(mountCapability.ReqSpellAuraID))
continue;
if (mountCapability.RequiredSpell != 0 && !HasSpell(mountCapability.RequiredSpell))
if (mountCapability.ReqSpellKnownID != 0 && !HasSpell(mountCapability.ReqSpellKnownID))
continue;
return mountCapability;
+2 -2
View File
@@ -198,7 +198,7 @@ namespace Game.Entities
if (minion.HasUnitTypeMask(UnitTypeMask.Guardian))
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());
if (GetTypeId() == TypeId.Player)
@@ -228,7 +228,7 @@ namespace Game.Entities
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())
SetCritterGUID(ObjectGuid.Empty);
+2 -2
View File
@@ -2991,7 +2991,7 @@ namespace Game.Entities
{
if (spellInfo.RangeEntry == null)
return 0;
if (spellInfo.RangeEntry.MaxRangeFriend == spellInfo.RangeEntry.MaxRangeHostile)
if (spellInfo.RangeEntry.RangeMax[0] == spellInfo.RangeEntry.RangeMax[1])
return spellInfo.GetMaxRange();
if (!target)
return spellInfo.GetMaxRange(true);
@@ -3002,7 +3002,7 @@ namespace Game.Entities
{
if (spellInfo.RangeEntry == null)
return 0;
if (spellInfo.RangeEntry.MinRangeFriend == spellInfo.RangeEntry.MinRangeHostile)
if (spellInfo.RangeEntry.RangeMin[0] == spellInfo.RangeEntry.RangeMin[1])
return spellInfo.GetMinRange();
if (!target)
return spellInfo.GetMinRange(true);
+8 -8
View File
@@ -1175,8 +1175,8 @@ namespace Game.Entities
{
ArtifactAppearanceRecord artifactAppearance = CliDB.ArtifactAppearanceStorage.LookupByKey(artifact.GetModifier(ItemModifier.ArtifactAppearanceId));
if (artifactAppearance != null)
if ((ShapeShiftForm)artifactAppearance.ModifiesShapeshiftFormDisplay == form)
return artifactAppearance.ShapeshiftDisplayID;
if ((ShapeShiftForm)artifactAppearance.OverrideShapeshiftFormID == form)
return artifactAppearance.OverrideShapeshiftDisplayID;
}
}
@@ -1892,17 +1892,17 @@ namespace Game.Entities
else if (GetTypeId() == TypeId.Player)
{
ChrClassesRecord cEntry = CliDB.ChrClassesStorage.LookupByKey(GetClass());
if (cEntry != null && cEntry.PowerType < PowerType.Max)
displayPower = cEntry.PowerType;
if (cEntry != null && cEntry.DisplayPower < PowerType.Max)
displayPower = cEntry.DisplayPower;
}
else if (GetTypeId() == TypeId.Unit)
{
Vehicle vehicle = GetVehicle();
Vehicle vehicle = GetVehicleKit();
if (vehicle)
{
PowerDisplayRecord powerDisplay = CliDB.PowerDisplayStorage.LookupByKey(vehicle.GetVehicleInfo().PowerDisplayID[0]);
if (powerDisplay != null)
displayPower = (PowerType)powerDisplay.PowerType;
displayPower = (PowerType)powerDisplay.ActualType;
else if (GetClass() == Class.Rogue)
displayPower = PowerType.Energy;
}
@@ -2097,9 +2097,9 @@ namespace Game.Entities
{
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()
{
+6 -6
View File
@@ -75,7 +75,7 @@ namespace Game.Entities
{
PowerDisplayRecord powerDisplay = CliDB.PowerDisplayStorage.LookupByKey(_vehicleInfo.PowerDisplayID[0]);
if (powerDisplay != null)
_me.SetPowerType((PowerType)powerDisplay.PowerType);
_me.SetPowerType((PowerType)powerDisplay.ActualType);
else if (_me.GetClass() == Class.Rogue)
_me.SetPowerType(PowerType.Energy);
}
@@ -343,12 +343,12 @@ namespace Game.Entities
_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
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);
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);
if (_me.IsInWorld)
@@ -579,11 +579,11 @@ namespace Game.Entities
player.StopCastingCharm();
player.StopCastingBindSight();
player.SendOnCancelExpectedVehicleRideAura();
if (!veSeat.Flags[1].HasAnyFlag((uint)VehicleSeatFlagsB.KeepPet))
if (!veSeat.FlagsB.HasAnyFlag(VehicleSeatFlagsB.KeepPet))
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.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();
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
Passenger.SendClearTarget(); // SMSG_BREAK_TARGET