aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2018-03-12 18:20:26 +0100
committerShauren <shauren.trinity@gmail.com>2018-03-12 23:11:49 +0100
commit007b5a68c50bbee7d05acec888d3273c2a5a8577 (patch)
tree4818b60a73730b98ae4785d0630edbd6cd27d5bf /src/server/game/Entities
parent50a912af72ca84095eab5effa7d70e8a50ff8a04 (diff)
Core/DataStores: Fixed db2 structures after 7.3.5
Diffstat (limited to 'src/server/game/Entities')
-rw-r--r--src/server/game/Entities/Creature/TemporarySummon.cpp4
-rw-r--r--src/server/game/Entities/GameObject/GameObject.cpp12
-rw-r--r--src/server/game/Entities/Item/Item.cpp82
-rw-r--r--src/server/game/Entities/Item/ItemEnchantmentMgr.cpp6
-rw-r--r--src/server/game/Entities/Item/ItemTemplate.cpp52
-rw-r--r--src/server/game/Entities/Item/ItemTemplate.h62
-rw-r--r--src/server/game/Entities/Object/Object.cpp4
-rw-r--r--src/server/game/Entities/Player/CollectionMgr.cpp26
-rw-r--r--src/server/game/Entities/Player/CollectionMgr.h2
-rw-r--r--src/server/game/Entities/Player/Player.cpp246
-rw-r--r--src/server/game/Entities/Player/Player.h4
-rw-r--r--src/server/game/Entities/Taxi/TaxiPathGraph.cpp18
-rw-r--r--src/server/game/Entities/Transport/Transport.cpp14
-rw-r--r--src/server/game/Entities/Unit/StatSystem.cpp4
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp38
-rw-r--r--src/server/game/Entities/Vehicle/Vehicle.cpp12
16 files changed, 305 insertions, 281 deletions
diff --git a/src/server/game/Entities/Creature/TemporarySummon.cpp b/src/server/game/Entities/Creature/TemporarySummon.cpp
index 94850995151..b13c85cf36c 100644
--- a/src/server/game/Entities/Creature/TemporarySummon.cpp
+++ b/src/server/game/Entities/Creature/TemporarySummon.cpp
@@ -324,7 +324,7 @@ void Minion::RemoveFromWorld()
bool Minion::IsGuardianPet() const
{
- return IsPet() || (m_Properties && m_Properties->Category == SUMMON_CATEGORY_PET);
+ return IsPet() || (m_Properties && m_Properties->Control == SUMMON_CATEGORY_PET);
}
Guardian::Guardian(SummonPropertiesEntry const* properties, Unit* owner, bool isWorldObject) : Minion(properties, owner, isWorldObject)
@@ -332,7 +332,7 @@ Guardian::Guardian(SummonPropertiesEntry const* properties, Unit* owner, bool is
{
memset(m_statFromOwner, 0, sizeof(float)*MAX_STATS);
m_unitTypeMask |= UNIT_MASK_GUARDIAN;
- if (properties && (properties->Type == SUMMON_TYPE_PET || properties->Category == SUMMON_CATEGORY_PET))
+ if (properties && (properties->Title == SUMMON_TYPE_PET || properties->Control == SUMMON_CATEGORY_PET))
{
m_unitTypeMask |= UNIT_MASK_CONTROLABLE_GUARDIAN;
InitCharmInfo();
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index 59773082cce..26d70dcb2a1 100644
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -2209,8 +2209,8 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player*
uint32 modelId = m_goInfo->displayId;
if (DestructibleModelDataEntry const* modelData = sDestructibleModelDataStore.LookupEntry(m_goInfo->destructibleBuilding.DestructibleModelRec))
- if (modelData->StateDamagedDisplayID)
- modelId = modelData->StateDamagedDisplayID;
+ if (modelData->State0Wmo)
+ modelId = modelData->State0Wmo;
SetDisplayId(modelId);
if (setHealth)
@@ -2237,8 +2237,8 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player*
uint32 modelId = m_goInfo->displayId;
if (DestructibleModelDataEntry const* modelData = sDestructibleModelDataStore.LookupEntry(m_goInfo->destructibleBuilding.DestructibleModelRec))
- if (modelData->StateDestroyedDisplayID)
- modelId = modelData->StateDestroyedDisplayID;
+ if (modelData->State1Wmo)
+ modelId = modelData->State1Wmo;
SetDisplayId(modelId);
if (setHealth)
@@ -2256,8 +2256,8 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player*
uint32 modelId = m_goInfo->displayId;
if (DestructibleModelDataEntry const* modelData = sDestructibleModelDataStore.LookupEntry(m_goInfo->destructibleBuilding.DestructibleModelRec))
- if (modelData->StateRebuildingDisplayID)
- modelId = modelData->StateRebuildingDisplayID;
+ if (modelData->State2Wmo)
+ modelId = modelData->State2Wmo;
SetDisplayId(modelId);
// restores to full health
diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp
index 6815d9f6c91..fa8edb4a6cb 100644
--- a/src/server/game/Entities/Item/Item.cpp
+++ b/src/server/game/Entities/Item/Item.cpp
@@ -56,7 +56,7 @@ void AddItemsSetItem(Player* player, Item* item)
if (set->RequiredSkill && player->GetSkillValue(set->RequiredSkill) < set->RequiredSkillRank)
return;
- if (set->Flags & ITEM_SET_FLAG_LEGACY_INACTIVE)
+ if (set->SetFlags & ITEM_SET_FLAG_LEGACY_INACTIVE)
return;
ItemSetEffect* eff = NULL;
@@ -337,12 +337,12 @@ bool Item::Create(ObjectGuid::LowType guidlow, uint32 itemId, Player const* owne
if (itemProto->GetArtifactID() != artifactAppearanceSet->ArtifactID)
continue;
- if (PlayerConditionEntry const* playerCondition = sPlayerConditionStore.LookupEntry(artifactAppearance->PlayerConditionID))
+ if (PlayerConditionEntry const* playerCondition = sPlayerConditionStore.LookupEntry(artifactAppearance->UnlockPlayerConditionID))
if (!owner || !sConditionMgr->IsPlayerMeetingCondition(owner, playerCondition))
continue;
SetModifier(ITEM_MODIFIER_ARTIFACT_APPEARANCE_ID, artifactAppearance->ID);
- SetAppearanceModId(artifactAppearance->AppearanceModID);
+ SetAppearanceModId(artifactAppearance->ItemAppearanceModifierID);
break;
}
}
@@ -799,7 +799,7 @@ void Item::LoadArtifactData(Player* owner, uint64 xp, uint32 artifactAppearanceI
SetUInt64Value(ITEM_FIELD_ARTIFACT_XP, xp);
SetModifier(ITEM_MODIFIER_ARTIFACT_APPEARANCE_ID, artifactAppearanceId);
if (ArtifactAppearanceEntry const* artifactAppearance = sArtifactAppearanceStore.LookupEntry(artifactAppearanceId))
- SetAppearanceModId(artifactAppearance->AppearanceModID);
+ SetAppearanceModId(artifactAppearance->ItemAppearanceModifierID);
uint8 totalPurchasedRanks = 0;
for (ItemDynamicFieldArtifactPowers& power : powers)
@@ -817,21 +817,21 @@ void Item::LoadArtifactData(Player* owner, uint64 xp, uint32 artifactAppearanceI
switch (enchant->Effect[i])
{
case ITEM_ENCHANTMENT_TYPE_ARTIFACT_POWER_BONUS_RANK_BY_TYPE:
- if (uint32(artifactPower->RelicType) == enchant->EffectSpellID[i])
+ if (uint32(artifactPower->Label) == enchant->EffectArg[i])
power.CurrentRankWithBonus += enchant->EffectPointsMin[i];
break;
case ITEM_ENCHANTMENT_TYPE_ARTIFACT_POWER_BONUS_RANK_BY_ID:
- if (artifactPower->ID == enchant->EffectSpellID[i])
+ if (artifactPower->ID == enchant->EffectArg[i])
power.CurrentRankWithBonus += enchant->EffectPointsMin[i];
break;
case ITEM_ENCHANTMENT_TYPE_ARTIFACT_POWER_BONUS_RANK_PICKER:
if (_bonusData.GemRelicType[e - SOCK_ENCHANTMENT_SLOT] != -1)
{
- if (ArtifactPowerPickerEntry const* artifactPowerPicker = sArtifactPowerPickerStore.LookupEntry(enchant->EffectSpellID[i]))
+ if (ArtifactPowerPickerEntry const* artifactPowerPicker = sArtifactPowerPickerStore.LookupEntry(enchant->EffectArg[i]))
{
PlayerConditionEntry const* playerCondition = sPlayerConditionStore.LookupEntry(artifactPowerPicker->PlayerConditionID);
if (!playerCondition || sConditionMgr->IsPlayerMeetingCondition(owner, playerCondition))
- if (artifactPower->RelicType == _bonusData.GemRelicType[e - SOCK_ENCHANTMENT_SLOT])
+ if (artifactPower->Label == _bonusData.GemRelicType[e - SOCK_ENCHANTMENT_SLOT])
power.CurrentRankWithBonus += enchant->EffectPointsMin[i];
}
}
@@ -1244,7 +1244,7 @@ void Item::SetGem(uint16 slot, ItemDynamicFieldGems const* gem, uint32 gemScalin
{
if (GemPropertiesEntry const* gemProperties = sGemPropertiesStore.LookupEntry(gemTemplate->GetGemProperties()))
{
- if (SpellItemEnchantmentEntry const* gemEnchant = sSpellItemEnchantmentStore.LookupEntry(gemProperties->EnchantID))
+ if (SpellItemEnchantmentEntry const* gemEnchant = sSpellItemEnchantmentStore.LookupEntry(gemProperties->EnchantId))
{
BonusData gemBonus;
gemBonus.Initialize(gemTemplate);
@@ -1255,7 +1255,7 @@ void Item::SetGem(uint16 slot, ItemDynamicFieldGems const* gem, uint32 gemScalin
uint32 gemBaseItemLevel = gemTemplate->GetBaseItemLevel();
if (ScalingStatDistributionEntry const* ssd = sScalingStatDistributionStore.LookupEntry(gemBonus.ScalingStatDistribution))
- if (uint32 scaledIlvl = uint32(sDB2Manager.GetCurveValueAt(ssd->ItemLevelCurveID, gemScalingLevel)))
+ if (uint32 scaledIlvl = uint32(sDB2Manager.GetCurveValueAt(ssd->PlayerLevelToItemLevelCurveID, gemScalingLevel)))
gemBaseItemLevel = scaledIlvl;
_bonusData.GemRelicType[slot] = gemBonus.RelicType;
@@ -1266,7 +1266,7 @@ void Item::SetGem(uint16 slot, ItemDynamicFieldGems const* gem, uint32 gemScalin
{
case ITEM_ENCHANTMENT_TYPE_BONUS_LIST_ID:
{
- if (DB2Manager::ItemBonusList const* bonuses = sDB2Manager.GetItemBonusList(gemEnchant->EffectSpellID[i]))
+ if (DB2Manager::ItemBonusList const* bonuses = sDB2Manager.GetItemBonusList(gemEnchant->EffectArg[i]))
for (ItemBonusEntry const* itemBonus : *bonuses)
if (itemBonus->Type == ITEM_BONUS_ITEM_LEVEL)
_bonusData.GemItemLevelBonus[slot] += itemBonus->Value[0];
@@ -1841,7 +1841,7 @@ uint32 Item::GetBuyPrice(ItemTemplate const* proto, uint32 quality, uint32 itemL
if (!basePrice)
return 0;
- float qualityFactor = qualityPrice->Factor;
+ float qualityFactor = qualityPrice->Data;
float baseFactor = 0.0f;
uint32 inventoryType = proto->GetInventoryType();
@@ -1853,9 +1853,9 @@ uint32 Item::GetBuyPrice(ItemTemplate const* proto, uint32 quality, uint32 itemL
inventoryType == INVTYPE_RANGED ||
inventoryType == INVTYPE_THROWN ||
inventoryType == INVTYPE_RANGEDRIGHT)
- baseFactor = basePrice->WeaponFactor;
+ baseFactor = basePrice->Weapon;
else
- baseFactor = basePrice->ArmorFactor;
+ baseFactor = basePrice->Armor;
if (inventoryType == INVTYPE_ROBE)
inventoryType = INVTYPE_CHEST;
@@ -1863,7 +1863,7 @@ uint32 Item::GetBuyPrice(ItemTemplate const* proto, uint32 quality, uint32 itemL
if (proto->GetClass() == ITEM_CLASS_GEM && proto->GetSubClass() == ITEM_SUBCLASS_GEM_ARTIFACT_RELIC)
{
inventoryType = INVTYPE_WEAPON;
- baseFactor = basePrice->WeaponFactor / 3.0f;
+ baseFactor = basePrice->Weapon / 3.0f;
}
float typeFactor = 0.0f;
@@ -1893,16 +1893,16 @@ uint32 Item::GetBuyPrice(ItemTemplate const* proto, uint32 quality, uint32 itemL
{
case ITEM_SUBCLASS_ARMOR_MISCELLANEOUS:
case ITEM_SUBCLASS_ARMOR_CLOTH:
- typeFactor = armorPrice->ClothFactor;
+ typeFactor = armorPrice->ClothModifier;
break;
case ITEM_SUBCLASS_ARMOR_LEATHER:
- typeFactor = armorPrice->LeatherFactor;
+ typeFactor = armorPrice->LeatherModifier;
break;
case ITEM_SUBCLASS_ARMOR_MAIL:
- typeFactor = armorPrice->MailFactor;
+ typeFactor = armorPrice->ChainModifier;
break;
case ITEM_SUBCLASS_ARMOR_PLATE:
- typeFactor = armorPrice->PlateFactor;
+ typeFactor = armorPrice->PlateModifier;
break;
default:
typeFactor = 1.0f;
@@ -1917,7 +1917,7 @@ uint32 Item::GetBuyPrice(ItemTemplate const* proto, uint32 quality, uint32 itemL
if (!shieldPrice)
return 0;
- typeFactor = shieldPrice->Factor;
+ typeFactor = shieldPrice->Data;
break;
}
case INVTYPE_WEAPONMAINHAND:
@@ -1947,11 +1947,11 @@ uint32 Item::GetBuyPrice(ItemTemplate const* proto, uint32 quality, uint32 itemL
if (!weaponPrice)
return 0;
- typeFactor = weaponPrice->Factor;
+ typeFactor = weaponPrice->Data;
}
standardPrice = false;
- return uint32(proto->GetUnk2() * typeFactor * baseFactor * qualityFactor * proto->GetUnk1());
+ return uint32(proto->GetPriceVariance() * typeFactor * baseFactor * qualityFactor * proto->GetPriceRandomValue());
}
uint32 Item::GetSellPrice(Player const* owner) const
@@ -1973,7 +1973,7 @@ uint32 Item::GetSellPrice(ItemTemplate const* proto, uint32 quality, uint32 item
if (ItemClassEntry const* classEntry = sDB2Manager.GetItemClassByOldEnum(proto->GetClass()))
{
uint32 buyCount = std::max(proto->GetBuyCount(), 1u);
- return cost * classEntry->PriceMod / buyCount;
+ return cost * classEntry->PriceModifier / buyCount;
}
return 0;
@@ -2195,13 +2195,13 @@ uint32 Item::GetItemLevel(ItemTemplate const* itemTemplate, BonusData const& bon
if (fixedLevel)
level = fixedLevel;
else
- level = std::min(std::max(level, ssd->MinLevel), ssd->MaxLevel);
+ level = std::min(std::max(int32(level), ssd->MinLevel), ssd->MaxLevel);
if (SandboxScalingEntry const* sandbox = sSandboxScalingStore.LookupEntry(bonusData.SandboxScalingId))
if ((sandbox->Flags & 2 || sandbox->MinLevel || sandbox->MaxLevel) && !(sandbox->Flags & 4))
- level = std::min(std::max(level, sandbox->MinLevel), sandbox->MaxLevel);
+ level = std::min(std::max(int32(level), sandbox->MinLevel), sandbox->MaxLevel);
- if (uint32 heirloomIlvl = uint32(sDB2Manager.GetCurveValueAt(ssd->ItemLevelCurveID, level)))
+ if (uint32 heirloomIlvl = uint32(sDB2Manager.GetCurveValueAt(ssd->PlayerLevelToItemLevelCurveID, level)))
itemLevel = heirloomIlvl;
}
@@ -2212,7 +2212,7 @@ uint32 Item::GetItemLevel(ItemTemplate const* itemTemplate, BonusData const& bon
uint32 itemLevelBeforeUpgrades = itemLevel;
if (ItemUpgradeEntry const* upgrade = sItemUpgradeStore.LookupEntry(upgradeId))
- itemLevel += upgrade->ItemLevelBonus;
+ itemLevel += upgrade->ItemLevelIncrement;
if (pvpBonus)
itemLevel += sDB2Manager.GetPvpItemLevelBonus(itemTemplate->GetId());
@@ -2266,19 +2266,19 @@ ItemDisenchantLootEntry const* Item::GetDisenchantLoot(ItemTemplate const* itemT
uint8 expansion = itemTemplate->GetRequiredExpansion();
for (ItemDisenchantLootEntry const* disenchant : sItemDisenchantLootStore)
{
- if (disenchant->ItemClass != itemClass)
+ if (disenchant->Class != itemClass)
continue;
- if (disenchant->ItemSubClass >= 0 && itemSubClass)
+ if (disenchant->Subclass >= 0 && itemSubClass)
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;
@@ -2294,8 +2294,8 @@ uint32 Item::GetDisplayId(Player const* owner) const
transmogModifier = AppearanceModifierSlotBySpec[owner->GetActiveTalentGroup()];
if (ItemModifiedAppearanceEntry const* transmog = sItemModifiedAppearanceStore.LookupEntry(GetModifier(transmogModifier)))
- if (ItemAppearanceEntry const* itemAppearance = sItemAppearanceStore.LookupEntry(transmog->AppearanceID))
- return itemAppearance->DisplayID;
+ if (ItemAppearanceEntry const* itemAppearance = sItemAppearanceStore.LookupEntry(transmog->ItemAppearanceID))
+ return itemAppearance->ItemDisplayInfoID;
return sDB2Manager.GetItemDisplayId(GetEntry(), GetAppearanceModId());
}
@@ -2335,7 +2335,7 @@ uint16 Item::GetVisibleAppearanceModId(Player const* owner) const
transmogModifier = AppearanceModifierSlotBySpec[owner->GetActiveTalentGroup()];
if (ItemModifiedAppearanceEntry const* transmog = sItemModifiedAppearanceStore.LookupEntry(GetModifier(transmogModifier)))
- return transmog->AppearanceModID;
+ return transmog->ItemAppearanceModifierID;
return uint16(GetAppearanceModId());
}
@@ -2407,7 +2407,7 @@ void Item::InitArtifactPowers(uint8 artifactId, uint8 artifactTier)
{
for (ArtifactPowerEntry const* artifactPower : sDB2Manager.GetArtifactPowers(artifactId))
{
- if (artifactPower->ArtifactTier != artifactTier)
+ if (artifactPower->Tier != artifactTier)
continue;
if (m_artifactPowerIdToIndex.find(artifactPower->ID) != m_artifactPowerIdToIndex.end())
@@ -2442,7 +2442,7 @@ void Item::ApplyArtifactPowerEnchantmentBonuses(EnchantmentSlot slot, uint32 enc
case ITEM_ENCHANTMENT_TYPE_ARTIFACT_POWER_BONUS_RANK_BY_TYPE:
for (ItemDynamicFieldArtifactPowers const& artifactPower : GetArtifactPowers())
{
- if (uint32(sArtifactPowerStore.AssertEntry(artifactPower.ArtifactPowerId)->RelicType) == enchant->EffectSpellID[i])
+ if (uint32(sArtifactPowerStore.AssertEntry(artifactPower.ArtifactPowerId)->Label) == enchant->EffectArg[i])
{
ItemDynamicFieldArtifactPowers newPower = artifactPower;
if (apply)
@@ -2459,7 +2459,7 @@ void Item::ApplyArtifactPowerEnchantmentBonuses(EnchantmentSlot slot, uint32 enc
}
break;
case ITEM_ENCHANTMENT_TYPE_ARTIFACT_POWER_BONUS_RANK_BY_ID:
- if (ItemDynamicFieldArtifactPowers const* artifactPower = GetArtifactPower(enchant->EffectSpellID[i]))
+ if (ItemDynamicFieldArtifactPowers const* artifactPower = GetArtifactPower(enchant->EffectArg[i]))
{
ItemDynamicFieldArtifactPowers newPower = *artifactPower;
if (apply)
@@ -2477,14 +2477,14 @@ void Item::ApplyArtifactPowerEnchantmentBonuses(EnchantmentSlot slot, uint32 enc
case ITEM_ENCHANTMENT_TYPE_ARTIFACT_POWER_BONUS_RANK_PICKER:
if (slot >= SOCK_ENCHANTMENT_SLOT && slot <= SOCK_ENCHANTMENT_SLOT_3 && _bonusData.GemRelicType[slot - SOCK_ENCHANTMENT_SLOT] != -1)
{
- if (ArtifactPowerPickerEntry const* artifactPowerPicker = sArtifactPowerPickerStore.LookupEntry(enchant->EffectSpellID[i]))
+ if (ArtifactPowerPickerEntry const* artifactPowerPicker = sArtifactPowerPickerStore.LookupEntry(enchant->EffectArg[i]))
{
PlayerConditionEntry const* playerCondition = sPlayerConditionStore.LookupEntry(artifactPowerPicker->PlayerConditionID);
if (!playerCondition || sConditionMgr->IsPlayerMeetingCondition(owner, playerCondition))
{
for (ItemDynamicFieldArtifactPowers const& artifactPower : GetArtifactPowers())
{
- if (sArtifactPowerStore.AssertEntry(artifactPower.ArtifactPowerId)->RelicType == _bonusData.GemRelicType[slot - SOCK_ENCHANTMENT_SLOT])
+ if (sArtifactPowerStore.AssertEntry(artifactPower.ArtifactPowerId)->Label == _bonusData.GemRelicType[slot - SOCK_ENCHANTMENT_SLOT])
{
ItemDynamicFieldArtifactPowers newPower = artifactPower;
if (apply)
@@ -2531,7 +2531,7 @@ void Item::GiveArtifactXp(uint64 amount, Item* sourceItem, uint32 artifactCatego
if (sourceItem && sourceItem->GetModifier(ITEM_MODIFIER_ARTIFACT_KNOWLEDGE_LEVEL))
artifactKnowledgeLevel = sourceItem->GetModifier(ITEM_MODIFIER_ARTIFACT_KNOWLEDGE_LEVEL);
else
- artifactKnowledgeLevel = owner->GetCurrency(artifactCategory->ArtifactKnowledgeCurrencyID) + 1;
+ artifactKnowledgeLevel = owner->GetCurrency(artifactCategory->XpMultCurrencyID) + 1;
if (GtArtifactKnowledgeMultiplierEntry const* artifactKnowledge = sArtifactKnowledgeMultiplierGameTable.GetRow(artifactKnowledgeLevel))
amount = uint64(amount * artifactKnowledge->Multiplier);
diff --git a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp
index 7a7ddedae7b..052e52db633 100644
--- a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp
+++ b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp
@@ -253,14 +253,14 @@ TC_GAME_API uint32 GetRandomPropertyPoints(uint32 itemLevel, uint32 quality, uin
switch (quality)
{
case ITEM_QUALITY_UNCOMMON:
- return randPropPointsEntry->UncommonPropertiesPoints[propIndex];
+ return randPropPointsEntry->Good[propIndex];
case ITEM_QUALITY_RARE:
case ITEM_QUALITY_HEIRLOOM:
- return randPropPointsEntry->RarePropertiesPoints[propIndex];
+ return randPropPointsEntry->Superior[propIndex];
case ITEM_QUALITY_EPIC:
case ITEM_QUALITY_LEGENDARY:
case ITEM_QUALITY_ARTIFACT:
- return randPropPointsEntry->EpicPropertiesPoints[propIndex];
+ return randPropPointsEntry->Epic[propIndex];
}
return 0;
diff --git a/src/server/game/Entities/Item/ItemTemplate.cpp b/src/server/game/Entities/Item/ItemTemplate.cpp
index 97907e8f88d..d541f70215d 100644
--- a/src/server/game/Entities/Item/ItemTemplate.cpp
+++ b/src/server/game/Entities/Item/ItemTemplate.cpp
@@ -46,10 +46,10 @@ uint32 const SocketColorToGemTypeMask[19] =
char const* ItemTemplate::GetName(LocaleConstant locale) const
{
- if (!strlen(ExtendedData->Name->Str[locale]))
+ if (!strlen(ExtendedData->Display->Str[locale]))
return GetDefaultLocaleName();
- return ExtendedData->Name->Str[locale];
+ return ExtendedData->Display->Str[locale];
}
@@ -113,7 +113,7 @@ uint32 ItemTemplate::GetSkill() const
char const* ItemTemplate::GetDefaultLocaleName() const
{
- return ExtendedData->Name->Str[sWorld->GetDefaultDbcLocale()];
+ return ExtendedData->Display->Str[sWorld->GetDefaultDbcLocale()];
}
uint32 ItemTemplate::GetArmor(uint32 itemLevel) const
@@ -141,7 +141,31 @@ uint32 ItemTemplate::GetArmor(uint32 itemLevel) const
if (GetSubClass() < ITEM_SUBCLASS_ARMOR_CLOTH || GetSubClass() > ITEM_SUBCLASS_ARMOR_PLATE)
return 0;
- return uint32(armorQuality->QualityMod[quality] * armorTotal->Value[GetSubClass() - 1] * location->Modifier[GetSubClass() - 1] + 0.5f);
+ float total = 1.0f;
+ float locationModifier = 1.0f;
+ switch (GetSubClass())
+ {
+ case ITEM_SUBCLASS_ARMOR_CLOTH:
+ total = armorTotal->Cloth;
+ locationModifier = location->Clothmodifier;
+ break;
+ case ITEM_SUBCLASS_ARMOR_LEATHER:
+ total = armorTotal->Leather;
+ locationModifier = location->Leathermodifier;
+ break;
+ case ITEM_SUBCLASS_ARMOR_MAIL:
+ total = armorTotal->Mail;
+ locationModifier = location->Chainmodifier;
+ break;
+ case ITEM_SUBCLASS_ARMOR_PLATE:
+ total = armorTotal->Plate;
+ locationModifier = location->Platemodifier;
+ break;
+ default:
+ break;
+ }
+
+ return uint32(armorQuality->Qualitymod[quality] * total * locationModifier + 0.5f);
}
// shields
@@ -167,13 +191,13 @@ void ItemTemplate::GetDamage(uint32 itemLevel, float& minDamage, float& maxDamag
switch (GetInventoryType())
{
case INVTYPE_AMMO:
- dps = sItemDamageAmmoStore.AssertEntry(itemLevel)->DPS[quality];
+ dps = sItemDamageAmmoStore.AssertEntry(itemLevel)->Quality[quality];
break;
case INVTYPE_2HWEAPON:
if (GetFlags2() & ITEM_FLAG2_CASTER_WEAPON)
- dps = sItemDamageTwoHandCasterStore.AssertEntry(itemLevel)->DPS[quality];
+ dps = sItemDamageTwoHandCasterStore.AssertEntry(itemLevel)->Quality[quality];
else
- dps = sItemDamageTwoHandStore.AssertEntry(itemLevel)->DPS[quality];
+ dps = sItemDamageTwoHandStore.AssertEntry(itemLevel)->Quality[quality];
break;
case INVTYPE_RANGED:
case INVTYPE_THROWN:
@@ -181,15 +205,15 @@ void ItemTemplate::GetDamage(uint32 itemLevel, float& minDamage, float& maxDamag
switch (GetSubClass())
{
case ITEM_SUBCLASS_WEAPON_WAND:
- dps = sItemDamageOneHandCasterStore.AssertEntry(itemLevel)->DPS[quality];
+ dps = sItemDamageOneHandCasterStore.AssertEntry(itemLevel)->Quality[quality];
break;
case ITEM_SUBCLASS_WEAPON_BOW:
case ITEM_SUBCLASS_WEAPON_GUN:
case ITEM_SUBCLASS_WEAPON_CROSSBOW:
if (GetFlags2() & ITEM_FLAG2_CASTER_WEAPON)
- dps = sItemDamageTwoHandCasterStore.AssertEntry(itemLevel)->DPS[quality];
+ dps = sItemDamageTwoHandCasterStore.AssertEntry(itemLevel)->Quality[quality];
else
- dps = sItemDamageTwoHandStore.AssertEntry(itemLevel)->DPS[quality];
+ dps = sItemDamageTwoHandStore.AssertEntry(itemLevel)->Quality[quality];
break;
default:
return;
@@ -199,17 +223,17 @@ void ItemTemplate::GetDamage(uint32 itemLevel, float& minDamage, float& maxDamag
case INVTYPE_WEAPONMAINHAND:
case INVTYPE_WEAPONOFFHAND:
if (GetFlags2() & ITEM_FLAG2_CASTER_WEAPON)
- dps = sItemDamageOneHandCasterStore.AssertEntry(itemLevel)->DPS[quality];
+ dps = sItemDamageOneHandCasterStore.AssertEntry(itemLevel)->Quality[quality];
else
- dps = sItemDamageOneHandStore.AssertEntry(itemLevel)->DPS[quality];
+ dps = sItemDamageOneHandStore.AssertEntry(itemLevel)->Quality[quality];
break;
default:
return;
}
float avgDamage = dps * GetDelay() * 0.001f;
- minDamage = (GetStatScalingFactor() * -0.5f + 1.0f) * avgDamage;
- maxDamage = floor(float(avgDamage * (GetStatScalingFactor() * 0.5f + 1.0f) + 0.5f));
+ minDamage = (GetDmgVariance() * -0.5f + 1.0f) * avgDamage;
+ maxDamage = floor(float(avgDamage * (GetDmgVariance() * 0.5f + 1.0f) + 0.5f));
}
bool ItemTemplate::IsUsableByLootSpecialization(Player const* player, bool alwaysAllowBoundToAccount) const
diff --git a/src/server/game/Entities/Item/ItemTemplate.h b/src/server/game/Entities/Item/ItemTemplate.h
index 89a20ab6459..c5e83ff6bab 100644
--- a/src/server/game/Entities/Item/ItemTemplate.h
+++ b/src/server/game/Entities/Item/ItemTemplate.h
@@ -707,16 +707,16 @@ struct TC_GAME_API ItemTemplate
ItemSparseEntry const* ExtendedData;
uint32 GetId() const { return BasicData->ID; }
- uint32 GetClass() const { return BasicData->Class; }
- uint32 GetSubClass() const { return BasicData->SubClass; }
- uint32 GetQuality() const { return ExtendedData->Quality; }
+ uint32 GetClass() const { return BasicData->ClassID; }
+ uint32 GetSubClass() const { return BasicData->SubclassID; }
+ uint32 GetQuality() const { return ExtendedData->OverallQualityID; }
uint32 GetFlags() const { return ExtendedData->Flags[0]; }
uint32 GetFlags2() const { return ExtendedData->Flags[1]; }
uint32 GetFlags3() const { return ExtendedData->Flags[2]; }
uint32 GetFlags4() const { return ExtendedData->Flags[3]; }
- float GetUnk1() const { return ExtendedData->Unk1; }
- float GetUnk2() const { return ExtendedData->Unk2; }
- uint32 GetBuyCount() const { return std::max<uint32>(ExtendedData->BuyCount, 1u); }
+ float GetPriceRandomValue() const { return ExtendedData->PriceRandomValue; }
+ float GetPriceVariance() const { return ExtendedData->PriceVariance; }
+ uint32 GetBuyCount() const { return std::max<uint32>(ExtendedData->VendorStackCount, 1u); }
uint32 GetBuyPrice() const { return ExtendedData->BuyPrice; }
uint32 GetSellPrice() const { return ExtendedData->SellPrice; }
InventoryType GetInventoryType() const { return InventoryType(ExtendedData->InventoryType); }
@@ -726,41 +726,41 @@ struct TC_GAME_API ItemTemplate
int32 GetBaseRequiredLevel() const { return ExtendedData->RequiredLevel; }
uint32 GetRequiredSkill() const { return ExtendedData->RequiredSkill; }
uint32 GetRequiredSkillRank() const { return ExtendedData->RequiredSkillRank; }
- uint32 GetRequiredSpell() const { return ExtendedData->RequiredSpell; }
- uint32 GetRequiredReputationFaction() const { return ExtendedData->RequiredReputationFaction; }
- uint32 GetRequiredReputationRank() const { return ExtendedData->RequiredReputationRank; }
+ uint32 GetRequiredSpell() const { return ExtendedData->RequiredAbility; }
+ uint32 GetRequiredReputationFaction() const { return ExtendedData->MinFactionID; }
+ uint32 GetRequiredReputationRank() const { return ExtendedData->MinReputation; }
uint32 GetMaxCount() const { return ExtendedData->MaxCount; }
uint32 GetContainerSlots() const { return ExtendedData->ContainerSlots; }
- int32 GetItemStatType(uint32 index) const { ASSERT(index < MAX_ITEM_PROTO_STATS); return ExtendedData->ItemStatType[index]; }
+ int32 GetItemStatType(uint32 index) const { ASSERT(index < MAX_ITEM_PROTO_STATS); return ExtendedData->StatModifierBonusStat[index]; }
int32 GetItemStatValue(uint32 index) const { ASSERT(index < MAX_ITEM_PROTO_STATS); return ExtendedData->ItemStatValue[index]; }
- int32 GetItemStatAllocation(uint32 index) const { ASSERT(index < MAX_ITEM_PROTO_STATS); return ExtendedData->ItemStatAllocation[index]; }
- float GetItemStatSocketCostMultiplier(uint32 index) const { ASSERT(index < MAX_ITEM_PROTO_STATS); return ExtendedData->ItemStatSocketCostMultiplier[index]; }
- uint32 GetScalingStatDistribution() const { return ExtendedData->ScalingStatDistribution; }
- uint32 GetDamageType() const { return ExtendedData->DamageType; }
- uint32 GetDelay() const { return ExtendedData->Delay; }
- float GetRangedModRange() const { return ExtendedData->RangedModRange; }
+ int32 GetItemStatAllocation(uint32 index) const { ASSERT(index < MAX_ITEM_PROTO_STATS); return ExtendedData->StatPercentEditor[index]; }
+ float GetItemStatSocketCostMultiplier(uint32 index) const { ASSERT(index < MAX_ITEM_PROTO_STATS); return ExtendedData->StatPercentageOfSocket[index]; }
+ uint32 GetScalingStatDistribution() const { return ExtendedData->ScalingStatDistributionID; }
+ uint32 GetDamageType() const { return ExtendedData->DamageDamageType; }
+ uint32 GetDelay() const { return ExtendedData->ItemDelay; }
+ float GetRangedModRange() const { return ExtendedData->ItemRange; }
ItemBondingType GetBonding() const { return ItemBondingType(ExtendedData->Bonding); }
char const* GetName(LocaleConstant locale) const;
- uint32 GetPageText() const { return ExtendedData->PageText; }
- uint32 GetStartQuest() const { return ExtendedData->StartQuest; }
+ uint32 GetPageText() const { return ExtendedData->PageID; }
+ uint32 GetStartQuest() const { return ExtendedData->StartQuestID; }
uint32 GetLockID() const { return ExtendedData->LockID; }
- uint32 GetRandomProperty() const { return ExtendedData->RandomProperty; }
- uint32 GetRandomSuffix() const { return ExtendedData->RandomSuffix; }
+ uint32 GetRandomProperty() const { return ExtendedData->RandomSelect; }
+ uint32 GetRandomSuffix() const { return ExtendedData->ItemRandomSuffixGroupID; }
uint32 GetItemSet() const { return ExtendedData->ItemSet; }
- uint32 GetArea() const { return ExtendedData->Area; }
- uint32 GetMap() const { return ExtendedData->Map; }
+ uint32 GetArea() const { return ExtendedData->ZoneBound; }
+ uint32 GetMap() const { return ExtendedData->InstanceBound; }
uint32 GetBagFamily() const { return ExtendedData->BagFamily; }
- uint32 GetTotemCategory() const { return ExtendedData->TotemCategory; }
- SocketColor GetSocketColor(uint32 index) const { ASSERT(index < MAX_ITEM_PROTO_SOCKETS); return SocketColor(ExtendedData->SocketColor[index]); }
- uint32 GetSocketBonus() const { return ExtendedData->SocketBonus; }
+ uint32 GetTotemCategory() const { return ExtendedData->TotemCategoryID; }
+ SocketColor GetSocketColor(uint32 index) const { ASSERT(index < MAX_ITEM_PROTO_SOCKETS); return SocketColor(ExtendedData->SocketType[index]); }
+ uint32 GetSocketBonus() const { return ExtendedData->SocketMatchEnchantmentId; }
uint32 GetGemProperties() const { return ExtendedData->GemProperties; }
- float GetArmorDamageModifier() const { return ExtendedData->ArmorDamageModifier; }
- uint32 GetDuration() const { return ExtendedData->Duration; }
- uint32 GetItemLimitCategory() const { return ExtendedData->ItemLimitCategory; }
- HolidayIds GetHolidayID() const { return HolidayIds(ExtendedData->HolidayID); }
- float GetStatScalingFactor() const { return ExtendedData->StatScalingFactor; }
+ float GetQualityModifier() const { return ExtendedData->QualityModifier; }
+ uint32 GetDuration() const { return ExtendedData->DurationInInventory; }
+ uint32 GetItemLimitCategory() const { return ExtendedData->LimitCategory; }
+ HolidayIds GetHolidayID() const { return HolidayIds(ExtendedData->RequiredHoliday); }
+ float GetDmgVariance() const { return ExtendedData->DmgVariance; }
uint8 GetArtifactID() const { return ExtendedData->ArtifactID; }
- uint8 GetRequiredExpansion() const { return ExtendedData->RequiredExpansion; }
+ uint8 GetRequiredExpansion() const { return ExtendedData->ExpansionID; }
uint32 MaxDurability;
std::vector<ItemEffectEntry const*> Effects;
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp
index 75fd5ed1248..05f7a37abb0 100644
--- a/src/server/game/Entities/Object/Object.cpp
+++ b/src/server/game/Entities/Object/Object.cpp
@@ -2356,7 +2356,7 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
uint32 mask = UNIT_MASK_SUMMON;
if (properties)
{
- switch (properties->Category)
+ switch (properties->Control)
{
case SUMMON_CATEGORY_PET:
mask = UNIT_MASK_GUARDIAN;
@@ -2371,7 +2371,7 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
case SUMMON_CATEGORY_ALLY:
case SUMMON_CATEGORY_UNK:
{
- switch (properties->Type)
+ switch (properties->Title)
{
case SUMMON_TYPE_MINION:
case SUMMON_TYPE_GUARDIAN:
diff --git a/src/server/game/Entities/Player/CollectionMgr.cpp b/src/server/game/Entities/Player/CollectionMgr.cpp
index 8f9885de9be..eb4834967ba 100644
--- a/src/server/game/Entities/Player/CollectionMgr.cpp
+++ b/src/server/game/Entities/Player/CollectionMgr.cpp
@@ -163,11 +163,11 @@ void CollectionMgr::LoadAccountHeirlooms(PreparedQueryResult result)
uint32 bonusId = 0;
if (flags & HEIRLOOM_FLAG_BONUS_LEVEL_110)
- bonusId = heirloom->ItemBonusListID[2];
+ bonusId = heirloom->UpgradeItemBonusListID[2];
else if (flags & HEIRLOOM_FLAG_BONUS_LEVEL_100)
- bonusId = heirloom->ItemBonusListID[1];
+ bonusId = heirloom->UpgradeItemBonusListID[1];
else if (flags & HEIRLOOM_FLAG_BONUS_LEVEL_90)
- bonusId = heirloom->ItemBonusListID[0];
+ bonusId = heirloom->UpgradeItemBonusListID[0];
_heirlooms[itemId] = HeirloomData(flags, bonusId);
} while (result->NextRow());
@@ -218,7 +218,7 @@ void CollectionMgr::AddHeirloom(uint32 itemId, uint32 flags)
}
}
-void CollectionMgr::UpgradeHeirloom(uint32 itemId, uint32 castItem)
+void CollectionMgr::UpgradeHeirloom(uint32 itemId, int32 castItem)
{
Player* player = _owner->GetPlayer();
if (!player)
@@ -238,17 +238,17 @@ void CollectionMgr::UpgradeHeirloom(uint32 itemId, uint32 castItem)
if (heirloom->UpgradeItemID[0] == castItem)
{
flags |= HEIRLOOM_FLAG_BONUS_LEVEL_90;
- bonusId = heirloom->ItemBonusListID[0];
+ bonusId = heirloom->UpgradeItemBonusListID[0];
}
if (heirloom->UpgradeItemID[1] == castItem)
{
flags |= HEIRLOOM_FLAG_BONUS_LEVEL_100;
- bonusId = heirloom->ItemBonusListID[1];
+ bonusId = heirloom->UpgradeItemBonusListID[1];
}
if (heirloom->UpgradeItemID[2] == castItem)
{
flags |= HEIRLOOM_FLAG_BONUS_LEVEL_110;
- bonusId = heirloom->ItemBonusListID[2];
+ bonusId = heirloom->UpgradeItemBonusListID[2];
}
for (Item* item : player->GetItemListByEntry(itemId, true))
@@ -277,14 +277,14 @@ void CollectionMgr::CheckHeirloomUpgrades(Item* item)
return;
// Check for heirloom pairs (normal - heroic, heroic - mythic)
- uint32 heirloomItemId = heirloom->NextDifficultyItemID;
+ uint32 heirloomItemId = heirloom->StaticUpgradedItemID;
uint32 newItemId = 0;
while (HeirloomEntry const* heirloomDiff = sDB2Manager.GetHeirloomByItemId(heirloomItemId))
{
if (player->GetItemByEntry(heirloomDiff->ItemID))
newItemId = heirloomDiff->ItemID;
- if (HeirloomEntry const* heirloomSub = sDB2Manager.GetHeirloomByItemId(heirloomDiff->NextDifficultyItemID))
+ if (HeirloomEntry const* heirloomSub = sDB2Manager.GetHeirloomByItemId(heirloomDiff->StaticUpgradedItemID))
{
heirloomItemId = heirloomSub->ItemID;
continue;
@@ -390,10 +390,10 @@ bool CollectionMgr::AddMount(uint32 spellId, MountStatusFlags flags, bool factio
_mounts.insert(MountContainer::value_type(spellId, flags));
// Mount condition only applies to using it, should still learn it.
- if (mount->PlayerConditionId)
+ if (mount->PlayerConditionID)
{
- PlayerConditionEntry const* playerCondition = sPlayerConditionStore.LookupEntry(mount->PlayerConditionId);
- if (!ConditionMgr::IsPlayerMeetingCondition(player, playerCondition))
+ PlayerConditionEntry const* playerCondition = sPlayerConditionStore.LookupEntry(mount->PlayerConditionID);
+ if (playerCondition && !ConditionMgr::IsPlayerMeetingCondition(player, playerCondition))
return false;
}
@@ -655,7 +655,7 @@ bool CollectionMgr::CanAddAppearance(ItemModifiedAppearanceEntry const* itemModi
if (!itemModifiedAppearance)
return false;
- if (itemModifiedAppearance->SourceType == 6 || itemModifiedAppearance->SourceType == 9)
+ if (itemModifiedAppearance->TransmogSourceTypeEnum == 6 || itemModifiedAppearance->TransmogSourceTypeEnum == 9)
return false;
if (!sItemSearchNameStore.LookupEntry(itemModifiedAppearance->ItemID))
diff --git a/src/server/game/Entities/Player/CollectionMgr.h b/src/server/game/Entities/Player/CollectionMgr.h
index 04a05298b81..1c7f9b7036e 100644
--- a/src/server/game/Entities/Player/CollectionMgr.h
+++ b/src/server/game/Entities/Player/CollectionMgr.h
@@ -93,7 +93,7 @@ public:
void LoadAccountHeirlooms(PreparedQueryResult result);
void SaveAccountHeirlooms(SQLTransaction& trans);
void AddHeirloom(uint32 itemId, uint32 flags);
- void UpgradeHeirloom(uint32 itemId, uint32 castItem);
+ void UpgradeHeirloom(uint32 itemId, int32 castItem);
void CheckHeirloomUpgrades(Item* item);
bool UpdateAccountHeirlooms(uint32 itemId, uint32 flags);
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index e8b285d628a..3c69bdc7b83 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -440,7 +440,7 @@ bool Player::Create(ObjectGuid::LowType guidlow, WorldPackets::Character::Charac
SetMap(sMapMgr->CreateMap(info->mapId, this));
- uint8 powertype = cEntry->PowerType;
+ uint8 powertype = cEntry->DisplayPower;
SetObjectScale(1.0f);
@@ -634,7 +634,7 @@ bool Player::Create(ObjectGuid::LowType guidlow, WorldPackets::Character::Charac
{
if (iProto->Effects.size() >= 1)
{
- switch (iProto->Effects[0]->Category)
+ switch (iProto->Effects[0]->SpellCategoryID)
{
case SPELL_CATEGORY_FOOD: // food
count = getClass() == CLASS_DEATH_KNIGHT ? 10 : 4;
@@ -1852,13 +1852,13 @@ void Player::Regenerate(Powers power)
float addvalue = 0.0f;
if (!IsInCombat())
{
- if (powerType->RegenerationDelay && GetMSTimeDiffToNow(m_combatExitTime) < powerType->RegenerationDelay)
+ if (powerType->RegenInterruptTimeMS && GetMSTimeDiffToNow(m_combatExitTime) < uint32(powerType->RegenInterruptTimeMS))
return;
- addvalue = (powerType->RegenerationPeace + GetFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER + powerIndex)) * 0.001f * m_regenTimer;
+ addvalue = (powerType->RegenPeace + GetFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER + powerIndex)) * 0.001f * m_regenTimer;
}
else
- addvalue = (powerType->RegenerationCombat + GetFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER + powerIndex)) * 0.001f * m_regenTimer;
+ addvalue = (powerType->RegenCombat + GetFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER + powerIndex)) * 0.001f * m_regenTimer;
static Rates const RatesForPower[MAX_POWERS] =
{
@@ -1894,7 +1894,7 @@ void Player::Regenerate(Powers power)
addvalue += GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, power) * ((power != POWER_ENERGY) ? m_regenTimerCount : m_regenTimer) / (5 * IN_MILLISECONDS);
}
- int32 minPower = powerType->RegenerationMin;
+ int32 minPower = powerType->MinPower;
int32 maxPower = GetMaxPower(power);
if (addvalue < 0.0f)
@@ -1913,17 +1913,17 @@ void Player::Regenerate(Powers power)
addvalue += m_powerFraction[powerIndex];
int32 integerValue = int32(std::fabs(addvalue));
- if (powerType->RegenerationCenter)
+ if (powerType->CenterPower)
{
- if (curValue > powerType->RegenerationCenter)
+ if (curValue > powerType->CenterPower)
{
addvalue = -std::abs(addvalue);
- minPower = powerType->RegenerationCenter;
+ minPower = powerType->CenterPower;
}
- else if (curValue < powerType->RegenerationCenter)
+ else if (curValue < powerType->CenterPower)
{
addvalue = std::abs(addvalue);
- maxPower = powerType->RegenerationCenter;
+ maxPower = powerType->CenterPower;
}
else
return;
@@ -2154,7 +2154,7 @@ void Player::SetInWater(bool apply)
bool Player::IsInAreaTriggerRadius(const AreaTriggerEntry* trigger) const
{
- if (!trigger || GetMapId() != trigger->MapID)
+ if (!trigger || int32(GetMapId()) != trigger->ContinentID)
return false;
if (trigger->Radius > 0.f)
@@ -2835,7 +2835,7 @@ void Player::RemoveTalent(TalentEntry const* talent)
plrTalent->second = PLAYERSPELL_REMOVED;
}
-bool Player::AddSpell(uint32 spellId, bool active, bool learning, bool dependent, bool disabled, bool loading /*= false*/, uint32 fromSkill /*= 0*/)
+bool Player::AddSpell(uint32 spellId, bool active, bool learning, bool dependent, bool disabled, bool loading /*= false*/, int32 fromSkill /*= 0*/)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo)
@@ -3146,7 +3146,7 @@ bool Player::AddSpell(uint32 spellId, bool active, bool learning, bool dependent
// need to add Battle pets automatically into pet journal
for (BattlePetSpeciesEntry const* entry : sBattlePetSpeciesStore)
{
- if (entry->SummonSpellID == spellId && GetSession()->GetBattlePetMgr()->GetPetCount(entry->ID) == 0)
+ if (entry->SummonSpellID == int32(spellId) && GetSession()->GetBattlePetMgr()->GetPetCount(entry->ID) == 0)
{
GetSession()->GetBattlePetMgr()->AddPet(entry->ID, entry->CreatureID, BattlePetMgr::RollPetBreed(entry->ID), BattlePetMgr::GetDefaultPetQuality(entry->ID));
UpdateCriteria(CRITERIA_TYPE_OWN_BATTLE_PET_COUNT);
@@ -3212,12 +3212,12 @@ bool Player::IsNeedCastPassiveSpellAtLearn(SpellInfo const* spellInfo) const
bool Player::IsCurrentSpecMasterySpell(SpellInfo const* spellInfo) const
{
if (ChrSpecializationEntry const* chrSpec = sChrSpecializationStore.LookupEntry(GetUInt32Value(PLAYER_FIELD_CURRENT_SPEC_ID)))
- return spellInfo->Id == chrSpec->MasterySpellID[0] || spellInfo->Id == chrSpec->MasterySpellID[1];
+ return spellInfo->Id == uint32(chrSpec->MasterySpellID[0]) || spellInfo->Id == uint32(chrSpec->MasterySpellID[1]);
return false;
}
-void Player::LearnSpell(uint32 spell_id, bool dependent, uint32 fromSkill /*= 0*/)
+void Player::LearnSpell(uint32 spell_id, bool dependent, int32 fromSkill /*= 0*/)
{
PlayerSpellMap::iterator itr = m_spells.find(spell_id);
@@ -4559,7 +4559,7 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g
else if (ditemProto->GetClass() == ITEM_CLASS_ARMOR)
dmultiplier = dcost->ArmorSubClassCost[ditemProto->GetSubClass()];
- uint32 costs = uint32(LostDurability * dmultiplier * double(dQualitymodEntry->QualityMod) * item->GetRepairCostMultiplier());
+ uint32 costs = uint32(LostDurability * dmultiplier * double(dQualitymodEntry->Data) * item->GetRepairCostMultiplier());
costs = uint32(costs * discountMod * sWorld->getRate(RATE_REPAIRCOST));
@@ -5511,7 +5511,7 @@ void Player::SetSkill(uint16 id, uint16 step, uint16 newVal, uint16 maxVal)
for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j)
if (SkillLineAbilityEntry const* pAbility = sSkillLineAbilityStore.LookupEntry(j))
if (pAbility->SkillLine == id)
- RemoveSpell(sSpellMgr->GetFirstSpellInChain(pAbility->SpellID));
+ RemoveSpell(sSpellMgr->GetFirstSpellInChain(pAbility->Spell));
// Clear profession lines
if (GetUInt32Value(PLAYER_PROFESSION_SKILL_LINE_1) == id)
@@ -5789,7 +5789,7 @@ bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type) co
return false;
}
- if (!HasSpell(mount->SpellId))
+ if (!HasSpell(mount->SourceSpellID))
{
TC_LOG_ERROR("entities.player", "Player::IsActionButtonDataValid: Mount action %u not added into button %u for player %s (%s): Player does not know this mount",
action, button, GetName().c_str(), GetGUID().ToString().c_str());
@@ -6004,12 +6004,12 @@ uint32 Player::TeamForRace(uint8 race)
{
if (ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race))
{
- switch (rEntry->TeamID)
+ switch (rEntry->Alliance)
{
case 0: return ALLIANCE;
case 1: return HORDE;
}
- TC_LOG_ERROR("entities.player", "Race (%u) has wrong teamid (%u) in DBC: wrong DBC files?", uint32(race), rEntry->TeamID);
+ TC_LOG_ERROR("entities.player", "Race (%u) has wrong teamid (%u) in DBC: wrong DBC files?", uint32(race), rEntry->Alliance);
}
else
TC_LOG_ERROR("entities.player", "Race (%u) not found in DBC: wrong DBC files?", uint32(race));
@@ -6020,7 +6020,7 @@ uint32 Player::TeamForRace(uint8 race)
TeamId Player::TeamIdForRace(uint8 race)
{
if (ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race))
- return TeamId(rEntry->TeamID);
+ return TeamId(rEntry->Alliance);
TC_LOG_ERROR("entities.player", "Race (%u) not found in DBC: wrong DBC files?", race);
return TEAM_NEUTRAL;
@@ -6196,7 +6196,7 @@ void Player::RewardReputation(Quest const* quest)
if (QuestFactionRewardEntry const* questFactionRewEntry = sQuestFactionRewardStore.LookupEntry(row))
{
uint32 field = abs(quest->RewardFactionValue[i]);
- rep = questFactionRewEntry->QuestRewFactionValue[field];
+ rep = questFactionRewEntry->Difficulty[field];
}
}
@@ -6428,13 +6428,13 @@ void Player::RewardPlayerWithRewardPack(RewardPackEntry const* rewardPackEntry)
if (!rewardPackEntry)
return;
- if (CharTitlesEntry const* charTitlesEntry = sCharTitlesStore.LookupEntry(rewardPackEntry->TitleID))
+ if (CharTitlesEntry const* charTitlesEntry = sCharTitlesStore.LookupEntry(rewardPackEntry->CharTitleID))
SetTitle(charTitlesEntry);
ModifyMoney(rewardPackEntry->Money);
if (std::vector<RewardPackXItemEntry const*> const* rewardPackXItems = sDB2Manager.GetRewardPackItemsByRewardID(rewardPackEntry->ID))
for (RewardPackXItemEntry const* rewardPackXItem : *rewardPackXItems)
- AddItem(rewardPackXItem->ItemID, rewardPackXItem->Amount);
+ AddItem(rewardPackXItem->ItemID, rewardPackXItem->ItemQuantity);
}
void Player::AddHonorXP(uint32 xp)
@@ -7667,7 +7667,7 @@ void Player::ApplyItemEquipSpell(Item* item, bool apply, bool formChange /*= fal
ItemEffectEntry const* effectData = proto->Effects[i];
// wrong triggering type
- if (apply && effectData->Trigger != ITEM_SPELLTRIGGER_ON_EQUIP)
+ if (apply && effectData->TriggerType != ITEM_SPELLTRIGGER_ON_EQUIP)
continue;
// check if it is valid spell
@@ -7781,7 +7781,7 @@ void Player::ApplyArtifactPowers(Item* item, bool apply)
}
if (ArtifactAppearanceEntry const* artifactAppearance = sArtifactAppearanceStore.LookupEntry(item->GetModifier(ITEM_MODIFIER_ARTIFACT_APPEARANCE_ID)))
- if (artifactAppearance->ShapeshiftDisplayID && GetShapeshiftForm() == ShapeshiftForm(artifactAppearance->ModifiesShapeshiftFormDisplay))
+ if (artifactAppearance->OverrideShapeshiftDisplayID && GetShapeshiftForm() == ShapeshiftForm(artifactAppearance->OverrideShapeshiftFormID))
RestoreDisplayId();
}
@@ -7804,7 +7804,7 @@ void Player::ApplyArtifactPowerRank(Item* artifact, ArtifactPowerRankEntry const
continue;
if (powerAura->HasEffect(auraEffect->GetEffIndex()))
- auraEffect->ChangeAmount(artifactPowerRank->Value ? artifactPowerRank->Value : auraEffect->GetSpellEffectInfo()->CalcValue());
+ auraEffect->ChangeAmount(artifactPowerRank->AuraPointsOverride ? artifactPowerRank->AuraPointsOverride : auraEffect->GetSpellEffectInfo()->CalcValue());
}
}
else
@@ -7813,10 +7813,10 @@ void Player::ApplyArtifactPowerRank(Item* artifact, ArtifactPowerRankEntry const
else if (apply)
{
CustomSpellValues csv;
- if (artifactPowerRank->Value)
+ if (artifactPowerRank->AuraPointsOverride)
for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)
if (spellInfo->GetEffect(i))
- csv.AddSpellMod(SpellValueMod(SPELLVALUE_BASE_POINT0 + i), artifactPowerRank->Value);
+ csv.AddSpellMod(SpellValueMod(SPELLVALUE_BASE_POINT0 + i), artifactPowerRank->AuraPointsOverride);
CastCustomSpell(artifactPowerRank->SpellID, csv, this, TRIGGERED_FULL_MASK, artifact);
}
@@ -7905,7 +7905,7 @@ void Player::CastItemCombatSpell(DamageInfo const& damageInfo, Item* item, ItemT
ItemEffectEntry const* effectData = proto->Effects[i];
// wrong triggering type
- if (effectData->Trigger != ITEM_SPELLTRIGGER_CHANCE_ON_HIT)
+ if (effectData->TriggerType != ITEM_SPELLTRIGGER_CHANCE_ON_HIT)
continue;
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(effectData->SpellID);
@@ -7963,11 +7963,11 @@ void Player::CastItemCombatSpell(DamageInfo const& damageInfo, Item* item, ItemT
continue;
}
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->EffectSpellID[s]);
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->EffectArg[s]);
if (!spellInfo)
{
TC_LOG_ERROR("entities.player.items", "Player::CastItemCombatSpell: Player '%s' (%s) cast unknown spell (EnchantID: %u, SpellID: %i), ignoring",
- GetName().c_str(), GetGUID().ToString().c_str(), enchant_id, pEnchant->EffectSpellID[s]);
+ GetName().c_str(), GetGUID().ToString().c_str(), enchant_id, pEnchant->EffectArg[s]);
continue;
}
@@ -7982,7 +7982,7 @@ void Player::CastItemCombatSpell(DamageInfo const& damageInfo, Item* item, ItemT
}
// Apply spell mods
- ApplySpellMod(pEnchant->EffectSpellID[s], SPELLMOD_CHANCE_OF_SUCCESS, chance);
+ ApplySpellMod(pEnchant->EffectArg[s], SPELLMOD_CHANCE_OF_SUCCESS, chance);
// Shiv has 100% chance to apply the poison
if (FindCurrentSpellBySpellId(5938) && e_slot == TEMP_ENCHANTMENT_SLOT)
@@ -8039,7 +8039,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, Objec
ItemEffectEntry const* effectData = proto->Effects[i];
// wrong triggering type
- if (effectData->Trigger != ITEM_SPELLTRIGGER_ON_USE)
+ if (effectData->TriggerType != ITEM_SPELLTRIGGER_ON_USE)
continue;
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(effectData->SpellID);
@@ -8076,10 +8076,10 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, Objec
if (pEnchant->Effect[s] != ITEM_ENCHANTMENT_TYPE_USE_SPELL)
continue;
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->EffectSpellID[s]);
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(pEnchant->EffectArg[s]);
if (!spellInfo)
{
- TC_LOG_ERROR("entities.player", "Player::CastItemUseSpell: Enchant %i, cast unknown spell %i", enchant_id, pEnchant->EffectSpellID[s]);
+ TC_LOG_ERROR("entities.player", "Player::CastItemUseSpell: Enchant %i, cast unknown spell %i", enchant_id, pEnchant->EffectArg[s]);
continue;
}
@@ -11233,11 +11233,11 @@ InventoryResult Player::CanEquipChildItem(Item* parentItem) const
if (!childEquipement)
return EQUIP_ERR_OK;
- Item* dstItem = GetItemByPos(INVENTORY_SLOT_BAG_0, childEquipement->AltEquipmentSlot);
+ Item* dstItem = GetItemByPos(INVENTORY_SLOT_BAG_0, childEquipement->ChildItemEquipSlot);
if (!dstItem)
return EQUIP_ERR_OK;
- uint16 childDest = (INVENTORY_SLOT_BAG_0 << 8) | childEquipement->AltEquipmentSlot;
+ uint16 childDest = (INVENTORY_SLOT_BAG_0 << 8) | childEquipement->ChildItemEquipSlot;
InventoryResult msg = CanUnequipItem(childDest, !childItem->IsBag());
if (msg != EQUIP_ERR_OK)
return msg;
@@ -11595,7 +11595,7 @@ InventoryResult Player::CanUseItem(ItemTemplate const* proto) const
return EQUIP_ERR_INTERNAL_BAG_ERROR;
if (ArtifactEntry const* artifact = sArtifactStore.LookupEntry(proto->GetArtifactID()))
- if (artifact->SpecID != GetUInt32Value(PLAYER_FIELD_CURRENT_SPEC_ID))
+ if (artifact->ChrSpecializationID != GetUInt32Value(PLAYER_FIELD_CURRENT_SPEC_ID))
return EQUIP_ERR_CANT_USE_ITEM;
return EQUIP_ERR_OK;
@@ -11720,7 +11720,7 @@ Item* Player::StoreNewItem(ItemPosCountVec const& pos, uint32 itemId, bool updat
if (ItemChildEquipmentEntry const* childItemEntry = sDB2Manager.GetItemChildEquipment(itemId))
{
- if (ItemTemplate const* childTemplate = sObjectMgr->GetItemTemplate(childItemEntry->AltItemID))
+ if (ItemTemplate const* childTemplate = sObjectMgr->GetItemTemplate(childItemEntry->ChildItemID))
{
ItemPosCountVec childDest;
CanStoreItem_InInventorySlots(CHILD_EQUIPMENT_SLOT_START, CHILD_EQUIPMENT_SLOT_END, childDest, childTemplate, count, false, nullptr, NULL_BAG, NULL_SLOT);
@@ -11822,7 +11822,7 @@ Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool
const ItemTemplate* proto = pItem->GetTemplate();
for (uint8 i = 0; i < proto->Effects.size(); ++i)
- if (proto->Effects[i]->Trigger == ITEM_SPELLTRIGGER_ON_OBTAIN) // On obtain trigger
+ if (proto->Effects[i]->TriggerType == ITEM_SPELLTRIGGER_ON_OBTAIN) // On obtain trigger
if (bag == INVENTORY_SLOT_BAG_0 || (bag >= INVENTORY_SLOT_BAG_START && bag < INVENTORY_SLOT_BAG_END))
if (!HasAura(proto->Effects[i]->SpellID))
CastSpell(this, proto->Effects[i]->SpellID, true, pItem);
@@ -11865,7 +11865,7 @@ Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool
const ItemTemplate* proto = pItem2->GetTemplate();
for (uint8 i = 0; i < proto->Effects.size(); ++i)
- if (proto->Effects[i]->Trigger == ITEM_SPELLTRIGGER_ON_OBTAIN) // On obtain trigger
+ if (proto->Effects[i]->TriggerType == ITEM_SPELLTRIGGER_ON_OBTAIN) // On obtain trigger
if (bag == INVENTORY_SLOT_BAG_0 || (bag >= INVENTORY_SLOT_BAG_START && bag < INVENTORY_SLOT_BAG_END))
if (!HasAura(proto->Effects[i]->SpellID))
CastSpell(this, proto->Effects[i]->SpellID, true, pItem2);
@@ -12003,7 +12003,7 @@ void Player::EquipChildItem(uint8 parentBag, uint8 parentSlot, Item* parentItem)
{
if (Item* childItem = GetChildItemByGuid(parentItem->GetChildItem()))
{
- uint16 childDest = (INVENTORY_SLOT_BAG_0 << 8) | itemChildEquipment->AltEquipmentSlot;
+ uint16 childDest = (INVENTORY_SLOT_BAG_0 << 8) | itemChildEquipment->ChildItemEquipSlot;
if (childItem->GetPos() != childDest)
{
Item* dstItem = GetItemByPos(childDest);
@@ -12329,7 +12329,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update)
const ItemTemplate* proto = pItem->GetTemplate();
for (uint8 i = 0; i < proto->Effects.size(); ++i)
- if (proto->Effects[i]->Trigger == ITEM_SPELLTRIGGER_ON_OBTAIN) // On obtain trigger
+ if (proto->Effects[i]->TriggerType == ITEM_SPELLTRIGGER_ON_OBTAIN) // On obtain trigger
RemoveAurasDueToSpell(proto->Effects[i]->SpellID);
ItemRemovedQuestCheck(pItem->GetEntry(), pItem->GetCount());
@@ -13724,7 +13724,7 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool
{
uint32 enchant_display_type = pEnchant->Effect[s];
uint32 enchant_amount = pEnchant->EffectPointsMin[s];
- uint32 enchant_spell_id = pEnchant->EffectSpellID[s];
+ uint32 enchant_spell_id = pEnchant->EffectArg[s];
switch (enchant_display_type)
{
@@ -14952,13 +14952,13 @@ bool Player::CanRewardQuest(Quest const* quest, uint32 reward, bool msg)
{
for (QuestPackageItemEntry const* questPackageItem : *questPackageItems)
{
- if (questPackageItem->ItemID != reward)
+ if (questPackageItem->ItemID != int32(reward))
continue;
if (CanSelectQuestPackageItem(questPackageItem))
{
hasFilteredQuestPackageReward = true;
- InventoryResult res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, questPackageItem->ItemID, questPackageItem->ItemCount);
+ InventoryResult res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, questPackageItem->ItemID, questPackageItem->ItemQuantity);
if (res != EQUIP_ERR_OK)
{
SendEquipError(res, nullptr, nullptr, questPackageItem->ItemID);
@@ -14974,10 +14974,10 @@ bool Player::CanRewardQuest(Quest const* quest, uint32 reward, bool msg)
{
for (QuestPackageItemEntry const* questPackageItem : *questPackageItems)
{
- if (questPackageItem->ItemID != reward)
+ if (questPackageItem->ItemID != int32(reward))
continue;
- InventoryResult res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, questPackageItem->ItemID, questPackageItem->ItemCount);
+ InventoryResult res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, questPackageItem->ItemID, questPackageItem->ItemQuantity);
if (res != EQUIP_ERR_OK)
{
SendEquipError(res, nullptr, nullptr, questPackageItem->ItemID);
@@ -15154,7 +15154,7 @@ bool Player::CanSelectQuestPackageItem(QuestPackageItemEntry const* questPackage
(rewardProto->GetFlags2() & ITEM_FLAG2_FACTION_HORDE && GetTeam() != HORDE))
return false;
- switch (questPackageItem->FilterType)
+ switch (questPackageItem->DisplayType)
{
case QUEST_PACKAGE_FILTER_LOOT_SPECIALIZATION:
return rewardProto->IsUsableByLootSpecialization(this, true);
@@ -15176,17 +15176,17 @@ void Player::RewardQuestPackage(uint32 questPackageId, uint32 onlyItemId /*= 0*/
{
for (QuestPackageItemEntry const* questPackageItem : *questPackageItems)
{
- if (onlyItemId && questPackageItem->ItemID != onlyItemId)
+ if (onlyItemId && questPackageItem->ItemID != int32(onlyItemId))
continue;
if (CanSelectQuestPackageItem(questPackageItem))
{
hasFilteredQuestPackageReward = true;
ItemPosCountVec dest;
- if (CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, questPackageItem->ItemID, questPackageItem->ItemCount) == EQUIP_ERR_OK)
+ if (CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, questPackageItem->ItemID, questPackageItem->ItemQuantity) == EQUIP_ERR_OK)
{
Item* item = StoreNewItem(dest, questPackageItem->ItemID, true, GenerateItemRandomPropertyId(questPackageItem->ItemID));
- SendNewItem(item, questPackageItem->ItemCount, true, false);
+ SendNewItem(item, questPackageItem->ItemQuantity, true, false);
}
}
}
@@ -15198,14 +15198,14 @@ void Player::RewardQuestPackage(uint32 questPackageId, uint32 onlyItemId /*= 0*/
{
for (QuestPackageItemEntry const* questPackageItem : *questPackageItems)
{
- if (onlyItemId && questPackageItem->ItemID != onlyItemId)
+ if (onlyItemId && questPackageItem->ItemID != int32(onlyItemId))
continue;
ItemPosCountVec dest;
- if (CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, questPackageItem->ItemID, questPackageItem->ItemCount) == EQUIP_ERR_OK)
+ if (CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, questPackageItem->ItemID, questPackageItem->ItemQuantity) == EQUIP_ERR_OK)
{
Item* item = StoreNewItem(dest, questPackageItem->ItemID, true, GenerateItemRandomPropertyId(questPackageItem->ItemID));
- SendNewItem(item, questPackageItem->ItemCount, true, false);
+ SendNewItem(item, questPackageItem->ItemQuantity, true, false);
}
}
}
@@ -17805,7 +17805,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
else // has start node, teleport to it
{
TC_LOG_ERROR("entities.player", "Player::LoadFromDB: Player (%s) has too short taxi destination list, teleport to original node.", GetGUID().ToString().c_str());
- mapId = nodeEntry->MapID;
+ mapId = nodeEntry->ContinentID;
Relocate(nodeEntry->Pos.X, nodeEntry->Pos.Y, nodeEntry->Pos.Z, 0.0f);
}
m_taxi.ClearTaxiDestinations();
@@ -17815,10 +17815,10 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
{
// save source node as recall coord to prevent recall and fall from sky
TaxiNodesEntry const* nodeEntry = sTaxiNodesStore.LookupEntry(node_id);
- if (nodeEntry && nodeEntry->MapID == GetMapId())
+ if (nodeEntry && nodeEntry->ContinentID == GetMapId())
{
ASSERT(nodeEntry); // checked in m_taxi.LoadTaxiDestinationsFromString
- mapId = nodeEntry->MapID;
+ mapId = nodeEntry->ContinentID;
Relocate(nodeEntry->Pos.X, nodeEntry->Pos.Y, nodeEntry->Pos.Z, 0.0f);
}
@@ -18519,8 +18519,8 @@ void Player::_LoadInventory(PreparedQueryResult result, PreparedQueryResult arti
artifactPowerData.PurchasedRank = fields[4].GetUInt8();
if (ArtifactPowerEntry const* artifactPower = sArtifactPowerStore.LookupEntry(artifactPowerData.ArtifactPowerId))
{
- if (artifactPowerData.PurchasedRank > artifactPower->MaxRank)
- artifactPowerData.PurchasedRank = artifactPower->MaxRank;
+ if (artifactPowerData.PurchasedRank > artifactPower->MaxPurchasableRank)
+ artifactPowerData.PurchasedRank = artifactPower->MaxPurchasableRank;
artifactPowerData.CurrentRankWithBonus = (artifactPower->Flags & ARTIFACT_POWER_FLAG_FIRST) ? 1 : 0;
@@ -19652,7 +19652,7 @@ bool Player::Satisfy(AccessRequirement const* ar, uint32 target_map, bool report
{
if (missingQuest && !ar->questFailedText.empty())
ChatHandler(GetSession()).PSendSysMessage("%s", ar->questFailedText.c_str());
- else if (mapDiff->Message_lang->Str[sWorld->GetDefaultDbcLocale()][0] != '\0') // if (missingAchievement) covered by this case
+ else if (mapDiff->Message->Str[sWorld->GetDefaultDbcLocale()][0] != '\0') // if (missingAchievement) covered by this case
SendTransferAborted(target_map, TRANSFER_ABORT_DIFFICULTY, target_difficulty);
else if (missingItem)
GetSession()->SendNotification(GetSession()->GetTrinityString(LANG_LEVEL_MINREQUIRED_AND_ITEM), LevelMin, ASSERT_NOTNULL(sObjectMgr->GetItemTemplate(missingItem))->GetName(GetSession()->GetSessionDbcLocale()));
@@ -22076,7 +22076,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc
// 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 * INTERACTION_DISTANCE))
+ if (node->ContinentID != GetMapId() || !IsInDist(node->Pos.X, node->Pos.Y, node->Pos.Z, 2 * INTERACTION_DISTANCE))
{
GetSession()->SendActivateTaxiReply(ERR_TAXITOOFARAWAY);
return false;
@@ -22191,7 +22191,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc
m_taxi.ClearTaxiDestinations();
ModifyMoney(-int64(totalcost));
UpdateCriteria(CRITERIA_TYPE_GOLD_SPENT_FOR_TRAVELLING, 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
@@ -22213,8 +22213,8 @@ bool Player::ActivateTaxiPathTo(uint32 taxi_path_id, uint32 spellid /*= 0*/)
std::vector<uint32> nodes;
nodes.resize(2);
- nodes[0] = entry->From;
- nodes[1] = entry->To;
+ nodes[0] = entry->FromTaxiNode;
+ nodes[1] = entry->ToTaxiNode;
return ActivateTaxiPathTo(nodes, nullptr, spellid);
}
@@ -22255,7 +22255,7 @@ void Player::ContinueTaxiFlight() const
TaxiPathNodeEntry const* prevNode = nodeList[i-1];
// skip nodes at another map
- if (node->MapID != GetMapId())
+ if (node->ContinentID != GetMapId())
continue;
distPrev = distNext;
@@ -22348,17 +22348,17 @@ inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 c
ASSERT(iece);
for (int i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i)
{
- if (iece->RequiredItem[i])
- DestroyItemCount(iece->RequiredItem[i], iece->RequiredItemCount[i] * stacks, true);
+ if (iece->ItemID[i])
+ DestroyItemCount(iece->ItemID[i], iece->ItemCount[i] * stacks, true);
}
for (int i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i)
{
- if (iece->RequirementFlags & (ITEM_EXT_COST_CURRENCY_REQ_IS_SEASON_EARNED_1 << i))
+ if (iece->Flags & (ITEM_EXT_COST_CURRENCY_REQ_IS_SEASON_EARNED_1 << i))
continue;
- if (iece->RequiredCurrency[i])
- ModifyCurrency(iece->RequiredCurrency[i], -int32(iece->RequiredCurrencyCount[i] * stacks), true, true);
+ if (iece->CurrencyID[i])
+ ModifyCurrency(iece->CurrencyID[i], -int32(iece->CurrencyCount[i] * stacks), true, true);
}
}
@@ -22460,7 +22460,7 @@ bool Player::BuyCurrencyFromVendorSlot(ObjectGuid vendorGuid, uint32 vendorSlot,
for (uint8 i = 0; i < MAX_ITEM_EXT_COST_ITEMS; ++i)
{
- if (iece->RequiredItem[i] && !HasItemCount(iece->RequiredItem[i], (iece->RequiredItemCount[i] * stacks)))
+ if (iece->ItemID[i] && !HasItemCount(iece->ItemID[i], (iece->ItemCount[i] * stacks)))
{
SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, nullptr, nullptr);
return false;
@@ -22469,23 +22469,23 @@ bool Player::BuyCurrencyFromVendorSlot(ObjectGuid vendorGuid, uint32 vendorSlot,
for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i)
{
- if (!iece->RequiredCurrency[i])
+ if (!iece->CurrencyID[i])
continue;
- CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(iece->RequiredCurrency[i]);
+ CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(iece->CurrencyID[i]);
if (!entry)
{
SendBuyError(BUY_ERR_CANT_FIND_ITEM, creature, currency, 0); // Find correct error
return false;
}
- if (iece->RequirementFlags & (ITEM_EXT_COST_CURRENCY_REQ_IS_SEASON_EARNED_1 << i))
+ if (iece->Flags & (ITEM_EXT_COST_CURRENCY_REQ_IS_SEASON_EARNED_1 << i))
{
// Not implemented
SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, nullptr, nullptr); // 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(EQUIP_ERR_VENDOR_MISSING_TURNINS, nullptr, nullptr); // Find correct error
return false;
@@ -22493,20 +22493,20 @@ bool Player::BuyCurrencyFromVendorSlot(ObjectGuid vendorGuid, uint32 vendorSlot,
}
// 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(EQUIP_ERR_CANT_EQUIP_RANK, nullptr, nullptr);
return false;
}
- if (iece->RequiredFactionId && uint32(GetReputationRank(iece->RequiredFactionId)) < iece->RequiredFactionStanding)
+ if (iece->MinFactionID && uint32(GetReputationRank(iece->MinFactionID)) < iece->RequiredAchievement)
{
SendBuyError(BUY_ERR_REPUTATION_REQUIRE, creature, currency, 0);
return false;
}
- if (iece->RequirementFlags & ITEM_EXT_COST_FLAG_REQUIRE_GUILD && !GetGuildId())
+ if (iece->Flags & ITEM_EXT_COST_FLAG_REQUIRE_GUILD && !GetGuildId())
{
SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, nullptr, nullptr); // Find correct error
return false;
@@ -22529,21 +22529,21 @@ bool Player::BuyCurrencyFromVendorSlot(ObjectGuid vendorGuid, uint32 vendorSlot,
{
for (uint8 i = 0; i < MAX_ITEM_EXT_COST_ITEMS; ++i)
{
- if (!iece->RequiredItem[i])
+ if (!iece->ItemID[i])
continue;
- DestroyItemCount(iece->RequiredItem[i], iece->RequiredItemCount[i] * stacks, true);
+ DestroyItemCount(iece->ItemID[i], iece->ItemCount[i] * stacks, true);
}
for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i)
{
- if (!iece->RequiredCurrency[i])
+ if (!iece->CurrencyID[i])
continue;
- if (iece->RequirementFlags & (ITEM_EXT_COST_CURRENCY_REQ_IS_SEASON_EARNED_1 << i))
+ if (iece->Flags & (ITEM_EXT_COST_CURRENCY_REQ_IS_SEASON_EARNED_1 << i))
continue;
- ModifyCurrency(iece->RequiredCurrency[i], -int32(iece->RequiredCurrencyCount[i]) * stacks, false, true);
+ ModifyCurrency(iece->CurrencyID[i], -int32(iece->CurrencyCount[i]) * stacks, false, true);
}
}
@@ -22661,7 +22661,7 @@ bool Player::BuyItemFromVendorSlot(ObjectGuid vendorguid, uint32 vendorslot, uin
for (uint8 i = 0; i < MAX_ITEM_EXT_COST_ITEMS; ++i)
{
- if (iece->RequiredItem[i] && !HasItemCount(iece->RequiredItem[i], iece->RequiredItemCount[i] * stacks))
+ if (iece->ItemID[i] && !HasItemCount(iece->ItemID[i], iece->ItemCount[i] * stacks))
{
SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, nullptr, nullptr);
return false;
@@ -22670,22 +22670,22 @@ bool Player::BuyItemFromVendorSlot(ObjectGuid vendorguid, uint32 vendorslot, uin
for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i)
{
- if (!iece->RequiredCurrency[i])
+ if (!iece->CurrencyID[i])
continue;
- CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(iece->RequiredCurrency[i]);
+ CurrencyTypesEntry const* entry = sCurrencyTypesStore.LookupEntry(iece->CurrencyID[i]);
if (!entry)
{
SendBuyError(BUY_ERR_CANT_FIND_ITEM, creature, item, 0);
return false;
}
- if (iece->RequirementFlags & (ITEM_EXT_COST_CURRENCY_REQ_IS_SEASON_EARNED_1 << i))
+ if (iece->Flags & (ITEM_EXT_COST_CURRENCY_REQ_IS_SEASON_EARNED_1 << i))
{
SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, nullptr, nullptr); // 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(EQUIP_ERR_VENDOR_MISSING_TURNINS, nullptr, nullptr);
return false;
@@ -22693,20 +22693,20 @@ bool Player::BuyItemFromVendorSlot(ObjectGuid vendorguid, uint32 vendorslot, uin
}
// 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(EQUIP_ERR_CANT_EQUIP_RANK, nullptr, nullptr);
return false;
}
- if (iece->RequiredFactionId && uint32(GetReputationRank(iece->RequiredFactionId)) < iece->RequiredFactionStanding)
+ if (iece->MinFactionID && uint32(GetReputationRank(iece->MinFactionID)) < iece->MinReputation)
{
SendBuyError(BUY_ERR_REPUTATION_REQUIRE, creature, item, 0);
return false;
}
- if (iece->RequirementFlags & ITEM_EXT_COST_FLAG_REQUIRE_GUILD && !GetGuildId())
+ if (iece->Flags & ITEM_EXT_COST_FLAG_REQUIRE_GUILD && !GetGuildId())
{
SendEquipError(EQUIP_ERR_VENDOR_MISSING_TURNINS, nullptr, nullptr); // Find correct error
return false;
@@ -22898,7 +22898,7 @@ void Player::UpdatePotionCooldown(Spell* spell)
// spell/item pair let set proper cooldown (except non-existing charged spell cooldown spellmods for potions)
if (ItemTemplate const* proto = sObjectMgr->GetItemTemplate(m_lastPotionId))
for (uint8 idx = 0; idx < proto->Effects.size(); ++idx)
- if (proto->Effects[idx]->Trigger == ITEM_SPELLTRIGGER_ON_USE)
+ if (proto->Effects[idx]->TriggerType == ITEM_SPELLTRIGGER_ON_USE)
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(proto->Effects[idx]->SpellID))
GetSpellHistory()->SendCooldownEvent(spellInfo, m_lastPotionId);
}
@@ -22964,13 +22964,13 @@ bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot)
for (uint8 i = 0; i < 5; i++)
{
- if (!Condition->LTOperandType[i])
+ if (!Condition->LtOperandType[i])
continue;
- uint32 _cur_gem = curcount[Condition->LTOperandType[i] - 1];
+ uint32 _cur_gem = curcount[Condition->LtOperandType[i] - 1];
// if have <CompareColor> use them as count, else use <value> from Condition
- uint32 _cmp_gem = Condition->RTOperandType[i] ? curcount[Condition->RTOperandType[i] - 1]: Condition->RTOperand[i];
+ uint32 _cmp_gem = Condition->RtOperandType[i] ? curcount[Condition->RtOperandType[i] - 1]: Condition->RtOperand[i];
switch (Condition->Operator[i])
{
@@ -23850,7 +23850,7 @@ void Player::ApplyEquipCooldown(Item* pItem)
ItemEffectEntry const* effectData = proto->Effects[i];
// apply proc cooldown to equip auras if we have any
- if (effectData->Trigger == ITEM_SPELLTRIGGER_ON_EQUIP)
+ if (effectData->TriggerType == ITEM_SPELLTRIGGER_ON_EQUIP)
{
SpellProcEntry const* procEntry = sSpellMgr->GetSpellProcEntry(effectData->SpellID);
if (!procEntry)
@@ -23862,7 +23862,7 @@ void Player::ApplyEquipCooldown(Item* pItem)
}
// wrong triggering type
- if (effectData->Trigger != ITEM_SPELLTRIGGER_ON_USE)
+ if (effectData->TriggerType != ITEM_SPELLTRIGGER_ON_USE)
continue;
// Don't replace longer cooldowns by equip cooldown if we have any.
@@ -24087,10 +24087,10 @@ void Player::LearnSkillRewardedSpells(uint32 skillId, uint32 skillValue)
for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j)
{
SkillLineAbilityEntry const* ability = sSkillLineAbilityStore.LookupEntry(j);
- if (!ability || ability->SkillLine != skillId)
+ if (!ability || ability->SkillLine != int32(skillId))
continue;
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(ability->SpellID);
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(ability->Spell);
if (!spellInfo)
continue;
@@ -24114,13 +24114,13 @@ void Player::LearnSkillRewardedSpells(uint32 skillId, uint32 skillValue)
continue;
// need unlearn spell
- if (skillValue < ability->MinSkillLineRank && ability->AcquireMethod == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE)
- RemoveSpell(ability->SpellID);
+ if (int32(skillValue) < ability->MinSkillLineRank && ability->AcquireMethod == SKILL_LINE_ABILITY_LEARNED_ON_SKILL_VALUE)
+ 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);
}
}
@@ -27133,17 +27133,17 @@ void Player::SendRefundInfo(Item* item)
for (uint8 i = 0; i < MAX_ITEM_EXT_COST_ITEMS; ++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 (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) // currency cost data
{
- if (iece->RequirementFlags & (ITEM_EXT_COST_CURRENCY_REQ_IS_SEASON_EARNED_1 << i))
+ if (iece->Flags & (ITEM_EXT_COST_CURRENCY_REQ_IS_SEASON_EARNED_1 << 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];
}
GetSession()->SendPacket(setItemPurchaseData.Write());
@@ -27183,17 +27183,17 @@ void Player::SendItemRefundResult(Item* item, ItemExtendedCostEntry const* iece,
itemPurchaseRefundResult.Contents->Money = item->GetPaidMoney();
for (uint8 i = 0; i < MAX_ITEM_EXT_COST_ITEMS; ++i) // item cost data
{
- itemPurchaseRefundResult.Contents->Items[i].ItemCount = iece->RequiredItemCount[i];
- itemPurchaseRefundResult.Contents->Items[i].ItemID = iece->RequiredItem[i];
+ itemPurchaseRefundResult.Contents->Items[i].ItemCount = iece->ItemCount[i];
+ itemPurchaseRefundResult.Contents->Items[i].ItemID = iece->ItemID[i];
}
for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i) // currency cost data
{
- if (iece->RequirementFlags & (ITEM_EXT_COST_CURRENCY_REQ_IS_SEASON_EARNED_1 << i))
+ if (iece->Flags & (ITEM_EXT_COST_CURRENCY_REQ_IS_SEASON_EARNED_1 << i))
continue;
- itemPurchaseRefundResult.Contents->Currencies[i].CurrencyCount = iece->RequiredCurrencyCount[i];
- itemPurchaseRefundResult.Contents->Currencies[i].CurrencyID = iece->RequiredCurrency[i];
+ itemPurchaseRefundResult.Contents->Currencies[i].CurrencyCount = iece->CurrencyCount[i];
+ itemPurchaseRefundResult.Contents->Currencies[i].CurrencyID = iece->CurrencyID[i];
}
}
@@ -27232,8 +27232,8 @@ void Player::RefundItem(Item* item)
bool store_error = false;
for (uint8 i = 0; i < MAX_ITEM_EXT_COST_ITEMS; ++i)
{
- uint32 count = iece->RequiredItemCount[i];
- uint32 itemid = iece->RequiredItem[i];
+ uint32 count = iece->ItemCount[i];
+ uint32 itemid = iece->ItemID[i];
if (count && itemid)
{
@@ -27270,8 +27270,8 @@ void Player::RefundItem(Item* item)
// Grant back extendedcost items
for (uint8 i = 0; i < MAX_ITEM_EXT_COST_ITEMS; ++i)
{
- uint32 count = iece->RequiredItemCount[i];
- uint32 itemid = iece->RequiredItem[i];
+ uint32 count = iece->ItemCount[i];
+ uint32 itemid = iece->ItemID[i];
if (count && itemid)
{
ItemPosCountVec dest;
@@ -27285,11 +27285,11 @@ void Player::RefundItem(Item* item)
// Grant back currencies
for (uint8 i = 0; i < MAX_ITEM_EXT_COST_CURRENCIES; ++i)
{
- if (iece->RequirementFlags & (ITEM_EXT_COST_CURRENCY_REQ_IS_SEASON_EARNED_1 << i))
+ if (iece->Flags & (ITEM_EXT_COST_CURRENCY_REQ_IS_SEASON_EARNED_1 << i))
continue;
- uint32 count = iece->RequiredCurrencyCount[i];
- uint32 currencyid = iece->RequiredCurrency[i];
+ uint32 count = iece->CurrencyCount[i];
+ uint32 currencyid = iece->CurrencyID[i];
if (count && currencyid)
ModifyCurrency(currencyid, count, true, true);
}
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index 9b60c05df1e..3884a0cbbc8 100644
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -1598,8 +1598,8 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
void SendProficiency(ItemClass itemClass, uint32 itemSubclassMask) const;
void SendKnownSpells();
- bool AddSpell(uint32 spellId, bool active, bool learning, bool dependent, bool disabled, bool loading = false, uint32 fromSkill = 0);
- void LearnSpell(uint32 spell_id, bool dependent, uint32 fromSkill = 0);
+ bool AddSpell(uint32 spellId, bool active, bool learning, bool dependent, bool disabled, bool loading = false, int32 fromSkill = 0);
+ void LearnSpell(uint32 spell_id, bool dependent, int32 fromSkill = 0);
void RemoveSpell(uint32 spell_id, bool disabled = false, bool learn_low_rank = true);
void ResetSpells(bool myClassOnly = false);
void LearnCustomSpells();
diff --git a/src/server/game/Entities/Taxi/TaxiPathGraph.cpp b/src/server/game/Entities/Taxi/TaxiPathGraph.cpp
index 513426f0f74..3ec90f577a7 100644
--- a/src/server/game/Entities/Taxi/TaxiPathGraph.cpp
+++ b/src/server/game/Entities/Taxi/TaxiPathGraph.cpp
@@ -40,8 +40,8 @@ void TaxiPathGraph::Initialize()
// Initialize here
for (TaxiPathEntry const* path : sTaxiPathStore)
{
- TaxiNodesEntry const* from = sTaxiNodesStore.LookupEntry(path->From);
- TaxiNodesEntry const* to = sTaxiNodesStore.LookupEntry(path->To);
+ TaxiNodesEntry const* from = sTaxiNodesStore.LookupEntry(path->FromTaxiNode);
+ TaxiNodesEntry const* to = sTaxiNodesStore.LookupEntry(path->ToTaxiNode);
if (from && to && from->Flags & (TAXI_NODE_FLAG_ALLIANCE | TAXI_NODE_FLAG_HORDE) && to->Flags & (TAXI_NODE_FLAG_ALLIANCE | TAXI_NODE_FLAG_HORDE))
AddVerticeAndEdgeFromNodeInfo(from, to, path->ID, edges);
}
@@ -67,7 +67,7 @@ uint32 TaxiPathGraph::GetNodeIDFromVertexID(vertex_descriptor vertexID)
TaxiPathGraph::vertex_descriptor TaxiPathGraph::GetVertexIDFromNodeID(TaxiNodesEntry const* node)
{
- return node->LearnableIndex;
+ return node->CharacterBitNumber;
}
std::size_t TaxiPathGraph::GetVertexCount()
@@ -107,8 +107,8 @@ void TaxiPathGraph::AddVerticeAndEdgeFromNodeInfo(TaxiNodesEntry const* from, Ta
uint32 map1, map2;
DBCPosition2D pos1, pos2;
- DB2Manager::DeterminaAlternateMapPosition(nodes[i - 1]->MapID, nodes[i - 1]->Loc.X, nodes[i - 1]->Loc.Y, nodes[i - 1]->Loc.Z, &map1, &pos1);
- DB2Manager::DeterminaAlternateMapPosition(nodes[i]->MapID, nodes[i]->Loc.X, nodes[i]->Loc.Y, nodes[i]->Loc.Z, &map2, &pos2);
+ DB2Manager::DeterminaAlternateMapPosition(nodes[i - 1]->ContinentID, nodes[i - 1]->Loc.X, nodes[i - 1]->Loc.Y, nodes[i - 1]->Loc.Z, &map1, &pos1);
+ DB2Manager::DeterminaAlternateMapPosition(nodes[i]->ContinentID, nodes[i]->Loc.X, nodes[i]->Loc.Y, nodes[i]->Loc.Z, &map2, &pos2);
if (map1 != map2)
continue;
@@ -179,11 +179,11 @@ std::size_t TaxiPathGraph::GetCompleteNodeRoute(TaxiNodesEntry const* from, Taxi
TaxiPathGraph::vertex_descriptor TaxiPathGraph::CreateVertexFromFromNodeInfoIfNeeded(TaxiNodesEntry const* node)
{
//Check if we need a new one or if it may be already created
- if (m_vertices.size() <= node->LearnableIndex)
- m_vertices.resize(node->LearnableIndex + 1);
+ if (m_vertices.size() <= node->CharacterBitNumber)
+ m_vertices.resize(node->CharacterBitNumber + 1);
- m_vertices[node->LearnableIndex] = node;
- return node->LearnableIndex;
+ m_vertices[node->CharacterBitNumber] = node;
+ return node->CharacterBitNumber;
}
uint32 TaxiPathGraph::EdgeCost::EvaluateDistance(Player const* player) const
diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp
index 5a687b8387b..a9343c68466 100644
--- a/src/server/game/Entities/Transport/Transport.cpp
+++ b/src/server/game/Entities/Transport/Transport.cpp
@@ -183,13 +183,13 @@ void Transport::Update(uint32 diff)
MoveToNextWaypoint();
- sScriptMgr->OnRelocate(this, _currentFrame->Node->NodeIndex, _currentFrame->Node->MapID, _currentFrame->Node->Loc.X, _currentFrame->Node->Loc.Y, _currentFrame->Node->Loc.Z);
+ sScriptMgr->OnRelocate(this, _currentFrame->Node->NodeIndex, _currentFrame->Node->ContinentID, _currentFrame->Node->Loc.X, _currentFrame->Node->Loc.Y, _currentFrame->Node->Loc.Z);
- TC_LOG_DEBUG("entities.transport", "Transport %u (%s) moved to node %u %u %f %f %f", GetEntry(), GetName().c_str(), _currentFrame->Node->NodeIndex, _currentFrame->Node->MapID, _currentFrame->Node->Loc.X, _currentFrame->Node->Loc.Y, _currentFrame->Node->Loc.Z);
+ TC_LOG_DEBUG("entities.transport", "Transport %u (%s) moved to node %u %u %f %f %f", GetEntry(), GetName().c_str(), _currentFrame->Node->NodeIndex, _currentFrame->Node->ContinentID, _currentFrame->Node->Loc.X, _currentFrame->Node->Loc.Y, _currentFrame->Node->Loc.Z);
// Departure event
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; // Update more in new map thread
}
@@ -394,7 +394,7 @@ TempSummon* Transport::SummonPassenger(uint32 entry, Position const& pos, TempSu
uint32 mask = UNIT_MASK_SUMMON;
if (properties)
{
- switch (properties->Category)
+ switch (properties->Control)
{
case SUMMON_CATEGORY_PET:
mask = UNIT_MASK_GUARDIAN;
@@ -409,7 +409,7 @@ TempSummon* Transport::SummonPassenger(uint32 entry, Position const& pos, TempSu
case SUMMON_CATEGORY_ALLY:
case SUMMON_CATEGORY_UNK:
{
- switch (properties->Type)
+ switch (properties->Title)
{
case SUMMON_TYPE_MINION:
case SUMMON_TYPE_GUARDIAN:
@@ -654,7 +654,7 @@ void Transport::DelayedTeleportTransport()
return;
_delayedTeleport = false;
- Map* newMap = sMapMgr->CreateBaseMap(_nextFrame->Node->MapID);
+ Map* newMap = sMapMgr->CreateBaseMap(_nextFrame->Node->ContinentID);
GetMap()->RemoveFromMap<Transport>(this, false);
SetMap(newMap);
@@ -674,7 +674,7 @@ void Transport::DelayedTeleportTransport()
switch (obj->GetTypeId())
{
case TYPEID_PLAYER:
- if (!obj->ToPlayer()->TeleportTo(_nextFrame->Node->MapID, destX, destY, destZ, destO, TELE_TO_NOT_LEAVE_TRANSPORT))
+ if (!obj->ToPlayer()->TeleportTo(_nextFrame->Node->ContinentID, destX, destY, destZ, destO, TELE_TO_NOT_LEAVE_TRANSPORT))
RemovePassenger(obj);
break;
case TYPEID_DYNAMICOBJECT:
diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp
index fb84f81138e..14037920628 100644
--- a/src/server/game/Entities/Unit/StatSystem.cpp
+++ b/src/server/game/Entities/Unit/StatSystem.cpp
@@ -779,8 +779,8 @@ void Player::UpdateAllRunesRegen()
PowerTypeEntry const* runeEntry = sDB2Manager.GetPowerTypeEntry(POWER_RUNES);
uint32 cooldown = GetRuneBaseCooldown();
- SetStatFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER + runeIndex, float(1 * IN_MILLISECONDS) / float(cooldown) - runeEntry->RegenerationPeace);
- SetStatFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER + runeIndex, float(1 * IN_MILLISECONDS) / float(cooldown) - runeEntry->RegenerationCombat);
+ SetStatFloatValue(UNIT_FIELD_POWER_REGEN_FLAT_MODIFIER + runeIndex, float(1 * IN_MILLISECONDS) / float(cooldown) - runeEntry->RegenPeace);
+ SetStatFloatValue(UNIT_FIELD_POWER_REGEN_INTERRUPTED_FLAT_MODIFIER + runeIndex, float(1 * IN_MILLISECONDS) / float(cooldown) - runeEntry->RegenCombat);
}
void Player::_ApplyAllStatBonuses()
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 92d63991e56..4a03028ae15 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -5188,15 +5188,15 @@ void Unit::UpdateDisplayPower()
else if (GetTypeId() == TYPEID_PLAYER)
{
ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(getClass());
- if (cEntry && cEntry->PowerType < MAX_POWERS)
- displayPower = Powers(cEntry->PowerType);
+ if (cEntry && cEntry->DisplayPower < MAX_POWERS)
+ displayPower = Powers(cEntry->DisplayPower);
}
else if (GetTypeId() == TYPEID_UNIT)
{
- if (Vehicle* vehicle = GetVehicle())
+ if (Vehicle* vehicle = GetVehicleKit())
{
if (PowerDisplayEntry const* powerDisplay = sPowerDisplayStore.LookupEntry(vehicle->GetVehicleInfo()->PowerDisplayID[0]))
- displayPower = Powers(powerDisplay->PowerType);
+ displayPower = Powers(powerDisplay->ActualType);
else if (getClass() == CLASS_ROGUE)
displayPower = POWER_ENERGY;
}
@@ -5880,7 +5880,7 @@ void Unit::SetMinion(Minion *minion, bool apply)
}
}
- if (minion->m_Properties && minion->m_Properties->Type == SUMMON_TYPE_MINIPET)
+ if (minion->m_Properties && minion->m_Properties->Title == SUMMON_TYPE_MINIPET)
{
SetCritterGUID(minion->GetGUID());
if (GetTypeId() == TYPEID_PLAYER)
@@ -5911,7 +5911,7 @@ void Unit::SetMinion(Minion *minion, bool apply)
m_Controlled.erase(minion);
- if (minion->m_Properties && minion->m_Properties->Type == SUMMON_TYPE_MINIPET)
+ if (minion->m_Properties && minion->m_Properties->Title == SUMMON_TYPE_MINIPET)
if (GetCritterGUID() == minion->GetGUID())
SetCritterGUID(ObjectGuid::Empty);
@@ -7589,7 +7589,7 @@ MountCapabilityEntry const* Unit::GetMountCapability(uint32 mountType) const
if (!mountCapability)
continue;
- if (ridingSkill < mountCapability->RequiredRidingSkill)
+ if (ridingSkill < mountCapability->ReqRidingSkill)
continue;
if (!(mountCapability->Flags & MOUNT_CAPABIILTY_FLAG_IGNORE_RESTRICTIONS))
@@ -7623,19 +7623,19 @@ MountCapabilityEntry const* Unit::GetMountCapability(uint32 mountType) const
else if (!(mountCapability->Flags & MOUNT_CAPABILITY_FLAG_FLOAT))
continue;
- if (mountCapability->RequiredMap != -1 &&
- int32(GetMapId()) != mountCapability->RequiredMap &&
- GetMap()->GetEntry()->CosmeticParentMapID != mountCapability->RequiredMap &&
- GetMap()->GetEntry()->ParentMapID != mountCapability->RequiredMap)
+ if (mountCapability->ReqMapID != -1 &&
+ int32(GetMapId()) != mountCapability->ReqMapID &&
+ GetMap()->GetEntry()->CosmeticParentMapID != mountCapability->ReqMapID &&
+ GetMap()->GetEntry()->ParentMapID != mountCapability->ReqMapID)
continue;
- if (mountCapability->RequiredArea && !DB2Manager::IsInArea(areaId, mountCapability->RequiredArea))
+ if (mountCapability->ReqAreaID && !DB2Manager::IsInArea(areaId, mountCapability->ReqAreaID))
continue;
- if (mountCapability->RequiredAura && !HasAura(mountCapability->RequiredAura))
+ if (mountCapability->ReqSpellAuraID && !HasAura(mountCapability->ReqSpellAuraID))
continue;
- if (mountCapability->RequiredSpell && !HasSpell(mountCapability->RequiredSpell))
+ if (mountCapability->ReqSpellKnownID && !HasSpell(mountCapability->ReqSpellKnownID))
continue;
return mountCapability;
@@ -9022,7 +9022,7 @@ float Unit::GetSpellMaxRangeForTarget(Unit const* target, SpellInfo const* spell
{
if (!spellInfo->RangeEntry)
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);
@@ -9033,7 +9033,7 @@ float Unit::GetSpellMinRangeForTarget(Unit const* target, SpellInfo const* spell
{
if (!spellInfo->RangeEntry)
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);
@@ -9461,7 +9461,7 @@ int32 Unit::GetCreatePowers(Powers power) const
return GetCreateMana();
if (PowerTypeEntry const* powerType = sDB2Manager.GetPowerTypeEntry(power))
- return powerType->MaxPower;
+ return powerType->MaxBasePower;
return 0;
}
@@ -12096,8 +12096,8 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form) const
if (Aura* artifactAura = GetAura(ARTIFACTS_ALL_WEAPONS_GENERAL_WEAPON_EQUIPPED_PASSIVE))
if (Item* artifact = ToPlayer()->GetItemByGuid(artifactAura->GetCastItemGUID()))
if (ArtifactAppearanceEntry const* artifactAppearance = sArtifactAppearanceStore.LookupEntry(artifact->GetModifier(ITEM_MODIFIER_ARTIFACT_APPEARANCE_ID)))
- if (ShapeshiftForm(artifactAppearance->ModifiesShapeshiftFormDisplay) == form)
- return artifactAppearance->ShapeshiftDisplayID;
+ if (ShapeshiftForm(artifactAppearance->OverrideShapeshiftFormID) == form)
+ return artifactAppearance->OverrideShapeshiftDisplayID;
switch (form)
{
diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp
index 636a1e83fe1..e19938b7c2d 100644
--- a/src/server/game/Entities/Vehicle/Vehicle.cpp
+++ b/src/server/game/Entities/Vehicle/Vehicle.cpp
@@ -77,7 +77,7 @@ void Vehicle::Install()
if (_me->GetTypeId() == TYPEID_UNIT)
{
if (PowerDisplayEntry const* powerDisplay = sPowerDisplayStore.LookupEntry(_vehicleInfo->PowerDisplayID[0]))
- _me->SetPowerType(Powers(powerDisplay->PowerType));
+ _me->SetPowerType(Powers(powerDisplay->ActualType));
else if (_me->getClass() == CLASS_ROGUE)
_me->SetPowerType(POWER_ENERGY);
}
@@ -480,12 +480,12 @@ Vehicle* Vehicle::RemovePassenger(Unit* unit)
_me->SetFlag64(UNIT_NPC_FLAGS, (_me->GetTypeId() == TYPEID_PLAYER ? UNIT_NPC_FLAG_PLAYER_VEHICLE : UNIT_NPC_FLAG_SPELLCLICK));
// Remove UNIT_FLAG_NOT_SELECTABLE if passenger did not have it before entering vehicle
- if (seat->second.SeatInfo->Flags[0] & VEHICLE_SEAT_FLAG_PASSENGER_NOT_SELECTABLE && !seat->second.Passenger.IsUnselectable)
+ if (seat->second.SeatInfo->Flags & VEHICLE_SEAT_FLAG_PASSENGER_NOT_SELECTABLE && !seat->second.Passenger.IsUnselectable)
unit->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
seat->second.Passenger.Reset();
- if (_me->GetTypeId() == TYPEID_UNIT && unit->GetTypeId() == TYPEID_PLAYER && seat->second.SeatInfo->Flags[0] & VEHICLE_SEAT_FLAG_CAN_CONTROL)
+ if (_me->GetTypeId() == TYPEID_UNIT && unit->GetTypeId() == TYPEID_PLAYER && seat->second.SeatInfo->Flags & VEHICLE_SEAT_FLAG_CAN_CONTROL)
_me->RemoveCharmedBy(unit);
if (_me->IsInWorld())
@@ -787,11 +787,11 @@ bool VehicleJoinEvent::Execute(uint64, uint32)
player->StopCastingCharm();
player->StopCastingBindSight();
player->SendOnCancelExpectedVehicleRideAura();
- if (!(veSeat->Flags[1] & VEHICLE_SEAT_FLAG_B_KEEP_PET))
+ if (!(veSeat->FlagsB & VEHICLE_SEAT_FLAG_B_KEEP_PET))
player->UnsummonPetTemporaryIfAny();
}
- if (Seat->second.SeatInfo->Flags[0] & VEHICLE_SEAT_FLAG_PASSENGER_NOT_SELECTABLE)
+ if (Seat->second.SeatInfo->Flags & VEHICLE_SEAT_FLAG_PASSENGER_NOT_SELECTABLE)
Passenger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Passenger->m_movementInfo.transport.pos.Relocate(veSeat->AttachmentOffset.X, veSeat->AttachmentOffset.Y, veSeat->AttachmentOffset.Z);
@@ -801,7 +801,7 @@ bool VehicleJoinEvent::Execute(uint64, uint32)
Passenger->m_movementInfo.transport.vehicleId = Target->GetVehicleInfo()->ID;
if (Target->GetBase()->GetTypeId() == TYPEID_UNIT && Passenger->GetTypeId() == TYPEID_PLAYER &&
- Seat->second.SeatInfo->Flags[0] & VEHICLE_SEAT_FLAG_CAN_CONTROL)
+ Seat->second.SeatInfo->Flags & VEHICLE_SEAT_FLAG_CAN_CONTROL)
ASSERT(Target->GetBase()->SetCharmedBy(Passenger, CHARM_TYPE_VEHICLE)); // SMSG_CLIENT_CONTROL
Passenger->SendClearTarget(); // SMSG_BREAK_TARGET