Core/DataStores: Fixed db2 structures after 7.3.5
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user