aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Globals/ObjectMgr.cpp
diff options
context:
space:
mode:
authorRat <gmstreetrat@gmail.com>2014-11-10 15:18:01 +0100
committerRat <gmstreetrat@gmail.com>2014-11-10 15:18:01 +0100
commitac0ff1fc9b4c409089bbcb0256bdbc2f5cc4a405 (patch)
tree9e939bb2b427ba8ae3e4c5512a6fc9975469c31f /src/server/game/Globals/ObjectMgr.cpp
parentd268b81044707e15266eadb4ab49f176135d4c26 (diff)
parent43d5fb5eaefeafb34bea10ff5c6a2878c6c14df1 (diff)
Merge branch 'dbc' of https://github.com/Intel/TrinityCore into Intel-dbc
Conflicts: src/server/game/DataStores/DBCStores.cpp src/server/game/DataStores/DBCStructure.h src/server/game/Events/GameEventMgr.cpp
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp80
1 files changed, 40 insertions, 40 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 576ebf4f547..49b9c2c45ae 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -950,7 +950,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
if (cInfo->scale <= 0.0f)
{
if (displayScaleEntry)
- const_cast<CreatureTemplate*>(cInfo)->scale = displayScaleEntry->scale;
+ const_cast<CreatureTemplate*>(cInfo)->scale = displayScaleEntry->CreatureModelScale;
else
const_cast<CreatureTemplate*>(cInfo)->scale = 1.0f;
}
@@ -2373,7 +2373,7 @@ uint32 FillItemArmor(uint32 itemlevel, uint32 itemClass, uint32 itemSubclass, ui
if (itemSubclass < ITEM_SUBCLASS_ARMOR_CLOTH || itemSubclass > ITEM_SUBCLASS_ARMOR_PLATE)
return 0;
- return uint32(armorQuality->Value[quality] * armorTotal->Value[itemSubclass - 1] * location->Value[itemSubclass - 1] + 0.5f);
+ return uint32(armorQuality->QualityMod[quality] * armorTotal->Value[itemSubclass - 1] * location->Modifier[itemSubclass - 1] + 0.5f);
}
// shields
@@ -2381,7 +2381,7 @@ uint32 FillItemArmor(uint32 itemlevel, uint32 itemClass, uint32 itemSubclass, ui
if (!shield)
return 0;
- return uint32(shield->Value[quality] + 0.5f);
+ return uint32(shield->Quality[quality] + 0.5f);
}
uint32 FillMaxDurability(uint32 itemClass, uint32 itemSubClass, uint32 inventoryType, uint32 quality, uint32 itemLevel)
@@ -2490,18 +2490,18 @@ void FillDisenchantFields(uint32* disenchantID, uint32* requiredDisenchantSkill,
disenchant->MinItemLevel <= itemTemplate.ItemLevel &&
disenchant->MaxItemLevel >= itemTemplate.ItemLevel)
{
- if (disenchant->Id == 60 || disenchant->Id == 61) // epic item disenchant ilvl range 66-99 (classic)
+ if (disenchant->ID == 60 || disenchant->ID == 61) // epic item disenchant ilvl range 66-99 (classic)
{
if (itemTemplate.RequiredLevel > 60 || itemTemplate.RequiredSkillRank > 300)
continue; // skip to epic item disenchant ilvl range 90-199 (TBC)
}
- else if (disenchant->Id == 66 || disenchant->Id == 67) // epic item disenchant ilvl range 90-199 (TBC)
+ else if (disenchant->ID == 66 || disenchant->ID == 67) // epic item disenchant ilvl range 90-199 (TBC)
{
if (itemTemplate.RequiredLevel <= 60 || (itemTemplate.RequiredSkill && itemTemplate.RequiredSkillRank <= 300))
continue;
}
- *disenchantID = disenchant->Id;
+ *disenchantID = disenchant->ID;
*requiredDisenchantSkill = disenchant->RequiredDisenchantSkill;
return;
}
@@ -2792,10 +2792,10 @@ void ObjectMgr::LoadItemTemplates()
for (int j = 0; j < MAX_OUTFIT_ITEMS; ++j)
{
- if (entry->ItemId[j] <= 0)
+ if (entry->ItemID[j] <= 0)
continue;
- uint32 item_id = entry->ItemId[j];
+ uint32 item_id = entry->ItemID[j];
if (!GetItemTemplate(item_id))
notFoundOutfit.insert(item_id);
@@ -3098,10 +3098,10 @@ void ObjectMgr::PlayerCreateInfoAddItemHelper(uint32 race_, uint32 class_, uint3
bool found = false;
for (uint8 x = 0; x < MAX_OUTFIT_ITEMS; ++x)
{
- if (entry->ItemId[x] > 0 && uint32(entry->ItemId[x]) == itemId)
+ if (entry->ItemID[x] > 0 && uint32(entry->ItemID[x]) == itemId)
{
found = true;
- const_cast<CharStartOutfitEntry*>(entry)->ItemId[x] = 0;
+ const_cast<CharStartOutfitEntry*>(entry)->ItemID[x] = 0;
break;
}
}
@@ -3188,8 +3188,8 @@ void ObjectMgr::LoadPlayerInfo()
info->positionY = positionY;
info->positionZ = positionZ;
info->orientation = orientation;
- info->displayId_m = rEntry->model_m;
- info->displayId_f = rEntry->model_f;
+ info->displayId_m = rEntry->MaleDisplayID;
+ info->displayId_f = rEntry->FemaleDisplayID;
_playerInfo[current_race][current_class] = info;
++count;
@@ -5303,7 +5303,7 @@ void ObjectMgr::LoadInstanceEncounters()
if (lastEncounterDungeon && !sLFGMgr->GetLFGDungeonEntry(lastEncounterDungeon))
{
- TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an encounter %u (%s) marked as final for invalid dungeon id %u, skipped!", entry, dungeonEncounter->encounterName, lastEncounterDungeon);
+ TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an encounter %u (%s) marked as final for invalid dungeon id %u, skipped!", entry, dungeonEncounter->Name_lang, lastEncounterDungeon);
continue;
}
@@ -5312,7 +5312,7 @@ void ObjectMgr::LoadInstanceEncounters()
{
if (itr != dungeonLastBosses.end())
{
- TC_LOG_ERROR("sql.sql", "Table `instance_encounters` specified encounter %u (%s) as last encounter but %u (%s) is already marked as one, skipped!", entry, dungeonEncounter->encounterName, itr->second->id, itr->second->encounterName);
+ TC_LOG_ERROR("sql.sql", "Table `instance_encounters` specified encounter %u (%s) as last encounter but %u (%s) is already marked as one, skipped!", entry, dungeonEncounter->Name_lang, itr->second->ID, itr->second->Name_lang);
continue;
}
@@ -5326,7 +5326,7 @@ void ObjectMgr::LoadInstanceEncounters()
CreatureTemplate const* creatureInfo = GetCreatureTemplate(creditEntry);
if (!creatureInfo)
{
- TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid creature (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName);
+ TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid creature (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->Name_lang);
continue;
}
const_cast<CreatureTemplate*>(creatureInfo)->flags_extra |= CREATURE_FLAG_EXTRA_DUNGEON_BOSS;
@@ -5335,29 +5335,29 @@ void ObjectMgr::LoadInstanceEncounters()
case ENCOUNTER_CREDIT_CAST_SPELL:
if (!sSpellMgr->GetSpellInfo(creditEntry))
{
- TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid spell (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->encounterName);
+ TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid spell (entry %u) linked to the encounter %u (%s), skipped!", creditEntry, entry, dungeonEncounter->Name_lang);
continue;
}
break;
default:
- TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid credit type (%u) for encounter %u (%s), skipped!", creditType, entry, dungeonEncounter->encounterName);
+ TC_LOG_ERROR("sql.sql", "Table `instance_encounters` has an invalid credit type (%u) for encounter %u (%s), skipped!", creditType, entry, dungeonEncounter->Name_lang);
continue;
}
- if (dungeonEncounter->difficulty == -1)
+ if (dungeonEncounter->DifficultyID == -1)
{
for (uint32 i = 0; i < MAX_DIFFICULTY; ++i)
{
- if (GetMapDifficultyData(dungeonEncounter->mapId, Difficulty(i)))
+ if (GetMapDifficultyData(dungeonEncounter->MapID, Difficulty(i)))
{
- DungeonEncounterList& encounters = _dungeonEncounterStore[MAKE_PAIR32(dungeonEncounter->mapId, i)];
+ DungeonEncounterList& encounters = _dungeonEncounterStore[MAKE_PAIR32(dungeonEncounter->MapID, i)];
encounters.push_back(new DungeonEncounter(dungeonEncounter, EncounterCreditType(creditType), creditEntry, lastEncounterDungeon));
}
}
}
else
{
- DungeonEncounterList& encounters = _dungeonEncounterStore[MAKE_PAIR32(dungeonEncounter->mapId, dungeonEncounter->difficulty)];
+ DungeonEncounterList& encounters = _dungeonEncounterStore[MAKE_PAIR32(dungeonEncounter->MapID, dungeonEncounter->DifficultyID)];
encounters.push_back(new DungeonEncounter(dungeonEncounter, EncounterCreditType(creditType), creditEntry, lastEncounterDungeon));
}
@@ -5998,9 +5998,9 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float
{
// if find graveyard at different map from where entrance placed (or no entrance data), use any first
if (!mapEntry
- || mapEntry->entrance_map < 0
- || uint32(mapEntry->entrance_map) != entry->map_id
- || (mapEntry->entrance_x == 0 && mapEntry->entrance_y == 0))
+ || mapEntry->CorpseMapID < 0
+ || uint32(mapEntry->CorpseMapID) != entry->map_id
+ || (mapEntry->CorpsePos.X == 0 && mapEntry->CorpsePos.Y == 0)) // Check X and Y
{
// not have any corrdinates for check distance anyway
entryFar = entry;
@@ -6008,8 +6008,8 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float
}
// at entrance map calculate distance (2D);
- float dist2 = (entry->x - mapEntry->entrance_x)*(entry->x - mapEntry->entrance_x)
- +(entry->y - mapEntry->entrance_y)*(entry->y - mapEntry->entrance_y);
+ float dist2 = (entry->x - mapEntry->CorpsePos.X)*(entry->x - mapEntry->CorpsePos.X)
+ +(entry->y - mapEntry->CorpsePos.Y)*(entry->y - mapEntry->CorpsePos.Y);
if (foundEntr)
{
if (dist2 < distEntr)
@@ -6301,7 +6301,7 @@ AreaTriggerStruct const* ObjectMgr::GetGoBackTrigger(uint32 Map) const
bool useParentDbValue = false;
uint32 parentId = 0;
const MapEntry* mapEntry = sMapStore.LookupEntry(Map);
- if (!mapEntry || mapEntry->entrance_map < 0)
+ if (!mapEntry || mapEntry->CorpseMapID < 0)
return NULL;
if (mapEntry->IsDungeon())
@@ -6315,12 +6315,12 @@ AreaTriggerStruct const* ObjectMgr::GetGoBackTrigger(uint32 Map) const
useParentDbValue = true;
}
- uint32 entrance_map = uint32(mapEntry->entrance_map);
+ uint32 entrance_map = uint32(mapEntry->CorpseMapID);
for (AreaTriggerContainer::const_iterator itr = _areaTriggerStore.begin(); itr != _areaTriggerStore.end(); ++itr)
if ((!useParentDbValue && itr->second.target_mapId == entrance_map) || (useParentDbValue && itr->second.target_mapId == parentId))
{
AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(itr->first);
- if (atEntry && atEntry->mapid == Map)
+ if (atEntry && atEntry->MapID == Map)
return &itr->second;
}
return NULL;
@@ -7079,7 +7079,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
continue;
}
- if (factionEntry->team == 0)
+ if (factionEntry->ParentFactionID == 0)
{
TC_LOG_ERROR("sql.sql", "Faction (faction.dbc) %u in `reputation_spillover_template` does not belong to any team, skipping", factionId);
continue;
@@ -7097,7 +7097,7 @@ void ObjectMgr::LoadReputationSpilloverTemplate()
continue;
}
- if (factionSpillover->reputationListID < 0)
+ if (factionSpillover->ReputationIndex < 0)
{
TC_LOG_ERROR("sql.sql", "Spillover faction (faction.dbc) %u for faction %u in `reputation_spillover_template` can not be listed for client, and then useless, skipping", repTemplate.faction[i], factionId);
continue;
@@ -7853,11 +7853,11 @@ int32 ObjectMgr::GetBaseReputationOf(FactionEntry const* factionEntry, uint8 rac
for (int i = 0; i < 4; i++)
{
- if ((!factionEntry->BaseRepClassMask[i] ||
- factionEntry->BaseRepClassMask[i] & classMask) &&
- (!factionEntry->BaseRepRaceMask[i] ||
- factionEntry->BaseRepRaceMask[i] & raceMask))
- return factionEntry->BaseRepValue[i];
+ if ((!factionEntry->ReputationClassMask[i] ||
+ factionEntry->ReputationClassMask[i] & classMask) &&
+ (!factionEntry->ReputationRaceMask[i] ||
+ factionEntry->ReputationRaceMask[i] & raceMask))
+ return factionEntry->ReputationBase[i];
}
return 0;
@@ -7865,17 +7865,17 @@ int32 ObjectMgr::GetBaseReputationOf(FactionEntry const* factionEntry, uint8 rac
SkillRangeType GetSkillRangeType(SkillRaceClassInfoEntry const* rcEntry)
{
- SkillLineEntry const* skill = sSkillLineStore.LookupEntry(rcEntry->SkillId);
+ SkillLineEntry const* skill = sSkillLineStore.LookupEntry(rcEntry->SkillID);
if (!skill)
return SKILL_RANGE_NONE;
- if (sSkillTiersStore.LookupEntry(rcEntry->SkillTier))
+ if (sSkillTiersStore.LookupEntry(rcEntry->SkillTierID))
return SKILL_RANGE_RANK;
- if (rcEntry->SkillId == SKILL_RUNEFORGING)
+ if (rcEntry->SkillID == SKILL_RUNEFORGING)
return SKILL_RANGE_MONO;
- switch (skill->categoryId)
+ switch (skill->CategoryID)
{
case SKILL_CATEGORY_ARMOR:
return SKILL_RANGE_MONO;