mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/DataStores: Updated DungeonEncounter.dbc, DurabilityCosts.dbc, DurabilityQuality.dbc, EmotesEntry.dbc, EmotesText.dbc, Faction.dbc, FactionTemplate.dbc structs
This commit is contained in:
@@ -86,13 +86,13 @@ int32 ReputationMgr::GetBaseReputation(FactionEntry const* factionEntry) const
|
||||
uint32 classMask = _player->getClassMask();
|
||||
for (int i=0; i < 4; i++)
|
||||
{
|
||||
if ((factionEntry->BaseRepRaceMask[i] & raceMask ||
|
||||
(factionEntry->BaseRepRaceMask[i] == 0 &&
|
||||
factionEntry->BaseRepClassMask[i] != 0)) &&
|
||||
(factionEntry->BaseRepClassMask[i] & classMask ||
|
||||
factionEntry->BaseRepClassMask[i] == 0))
|
||||
if ((factionEntry->ReputationRaceMask[i] & raceMask ||
|
||||
(factionEntry->ReputationRaceMask[i] == 0 &&
|
||||
factionEntry->ReputationClassMask[i] != 0)) &&
|
||||
(factionEntry->ReputationClassMask[i] & classMask ||
|
||||
factionEntry->ReputationClassMask[i] == 0))
|
||||
|
||||
return factionEntry->BaseRepValue[i];
|
||||
return factionEntry->ReputationBase[i];
|
||||
}
|
||||
|
||||
// in faction.dbc exist factions with (RepListId >=0, listed in character reputation list) with all BaseRepRaceMask[i] == 0
|
||||
@@ -140,11 +140,11 @@ uint32 ReputationMgr::GetDefaultStateFlags(FactionEntry const* factionEntry) con
|
||||
uint32 classMask = _player->getClassMask();
|
||||
for (int i=0; i < 4; i++)
|
||||
{
|
||||
if ((factionEntry->BaseRepRaceMask[i] & raceMask ||
|
||||
(factionEntry->BaseRepRaceMask[i] == 0 &&
|
||||
factionEntry->BaseRepClassMask[i] != 0)) &&
|
||||
(factionEntry->BaseRepClassMask[i] & classMask ||
|
||||
factionEntry->BaseRepClassMask[i] == 0))
|
||||
if ((factionEntry->ReputationRaceMask[i] & raceMask ||
|
||||
(factionEntry->ReputationRaceMask[i] == 0 &&
|
||||
factionEntry->ReputationClassMask[i] != 0)) &&
|
||||
(factionEntry->ReputationClassMask[i] & classMask ||
|
||||
factionEntry->ReputationClassMask[i] == 0))
|
||||
|
||||
return factionEntry->ReputationFlags[i];
|
||||
}
|
||||
@@ -263,11 +263,11 @@ void ReputationMgr::Initialize()
|
||||
{
|
||||
FactionEntry const* factionEntry = sFactionStore.LookupEntry(i);
|
||||
|
||||
if (factionEntry && (factionEntry->reputationListID >= 0))
|
||||
if (factionEntry && (factionEntry->ReputationIndex >= 0))
|
||||
{
|
||||
FactionState newFaction;
|
||||
newFaction.ID = factionEntry->ID;
|
||||
newFaction.ReputationListID = factionEntry->reputationListID;
|
||||
newFaction.ReputationListID = factionEntry->ReputationIndex;
|
||||
newFaction.Standing = 0;
|
||||
newFaction.Flags = GetDefaultStateFlags(factionEntry);
|
||||
newFaction.needSend = true;
|
||||
@@ -309,12 +309,12 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi
|
||||
// check for sub-factions that receive spillover
|
||||
SimpleFactionsList const* flist = GetFactionTeamList(factionEntry->ID);
|
||||
// if has no sub-factions, check for factions with same parent
|
||||
if (!flist && factionEntry->team && factionEntry->spilloverRateOut != 0.0f)
|
||||
if (!flist && factionEntry->ParentFactionID && factionEntry->ParentFactionModOut != 0.0f)
|
||||
{
|
||||
spillOverRepOut *= factionEntry->spilloverRateOut;
|
||||
if (FactionEntry const* parent = sFactionStore.LookupEntry(factionEntry->team))
|
||||
spillOverRepOut *= factionEntry->ParentFactionModOut;
|
||||
if (FactionEntry const* parent = sFactionStore.LookupEntry(factionEntry->ParentFactionID))
|
||||
{
|
||||
FactionStateList::iterator parentState = _factions.find(parent->reputationListID);
|
||||
FactionStateList::iterator parentState = _factions.find(parent->ReputationIndex);
|
||||
// some team factions have own reputation standing, in this case do not spill to other sub-factions
|
||||
if (parentState != _factions.end() && (parentState->second.Flags & FACTION_FLAG_SPECIAL))
|
||||
{
|
||||
@@ -322,7 +322,7 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi
|
||||
}
|
||||
else // spill to "sister" factions
|
||||
{
|
||||
flist = GetFactionTeamList(factionEntry->team);
|
||||
flist = GetFactionTeamList(factionEntry->ParentFactionID);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -333,9 +333,9 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi
|
||||
{
|
||||
if (FactionEntry const* factionEntryCalc = sFactionStore.LookupEntry(*itr))
|
||||
{
|
||||
if (factionEntryCalc == factionEntry || GetRank(factionEntryCalc) > ReputationRank(factionEntryCalc->spilloverMaxRankIn))
|
||||
if (factionEntryCalc == factionEntry || GetRank(factionEntryCalc) > ReputationRank(factionEntryCalc->ParentFactionCapOut))
|
||||
continue;
|
||||
int32 spilloverRep = int32(spillOverRepOut * factionEntryCalc->spilloverRateIn);
|
||||
int32 spilloverRep = int32(spillOverRepOut * factionEntryCalc->ParentFactionModIn);
|
||||
if (spilloverRep != 0 || !incremental)
|
||||
res = SetOneFactionReputation(factionEntryCalc, spilloverRep, incremental);
|
||||
}
|
||||
@@ -344,7 +344,7 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi
|
||||
}
|
||||
|
||||
// spillover done, update faction itself
|
||||
FactionStateList::iterator faction = _factions.find(factionEntry->reputationListID);
|
||||
FactionStateList::iterator faction = _factions.find(factionEntry->ReputationIndex);
|
||||
if (faction != _factions.end())
|
||||
{
|
||||
res = SetOneFactionReputation(factionEntry, standing, incremental);
|
||||
@@ -356,7 +356,7 @@ bool ReputationMgr::SetReputation(FactionEntry const* factionEntry, int32 standi
|
||||
|
||||
bool ReputationMgr::SetOneFactionReputation(FactionEntry const* factionEntry, int32 standing, bool incremental)
|
||||
{
|
||||
FactionStateList::iterator itr = _factions.find(factionEntry->reputationListID);
|
||||
FactionStateList::iterator itr = _factions.find(factionEntry->ReputationIndex);
|
||||
if (itr != _factions.end())
|
||||
{
|
||||
int32 BaseRep = GetBaseReputation(factionEntry);
|
||||
@@ -402,23 +402,23 @@ bool ReputationMgr::SetOneFactionReputation(FactionEntry const* factionEntry, in
|
||||
return false;
|
||||
}
|
||||
|
||||
void ReputationMgr::SetVisible(FactionTemplateEntry const*factionTemplateEntry)
|
||||
void ReputationMgr::SetVisible(FactionTemplateEntry const* factionTemplateEntry)
|
||||
{
|
||||
if (!factionTemplateEntry->faction)
|
||||
if (!factionTemplateEntry->Faction)
|
||||
return;
|
||||
|
||||
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->faction))
|
||||
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->Faction))
|
||||
// Never show factions of the opposing team
|
||||
if (!(factionEntry->BaseRepRaceMask[1] & _player->getRaceMask() && factionEntry->BaseRepValue[1] == Reputation_Bottom))
|
||||
if (!(factionEntry->ReputationRaceMask[1] & _player->getRaceMask() && factionEntry->ReputationBase[1] == Reputation_Bottom))
|
||||
SetVisible(factionEntry);
|
||||
}
|
||||
|
||||
void ReputationMgr::SetVisible(FactionEntry const* factionEntry)
|
||||
{
|
||||
if (factionEntry->reputationListID < 0)
|
||||
if (factionEntry->ReputationIndex < 0)
|
||||
return;
|
||||
|
||||
FactionStateList::iterator itr = _factions.find(factionEntry->reputationListID);
|
||||
FactionStateList::iterator itr = _factions.find(factionEntry->ReputationIndex);
|
||||
if (itr == _factions.end())
|
||||
return;
|
||||
|
||||
@@ -519,9 +519,9 @@ void ReputationMgr::LoadFromDB(PreparedQueryResult result)
|
||||
Field* fields = result->Fetch();
|
||||
|
||||
FactionEntry const* factionEntry = sFactionStore.LookupEntry(fields[0].GetUInt16());
|
||||
if (factionEntry && (factionEntry->reputationListID >= 0))
|
||||
if (factionEntry && (factionEntry->ReputationIndex >= 0))
|
||||
{
|
||||
FactionState* faction = &_factions[factionEntry->reputationListID];
|
||||
FactionState* faction = &_factions[factionEntry->ReputationIndex];
|
||||
|
||||
// update standing to current
|
||||
faction->Standing = fields[1].GetInt32();
|
||||
|
||||
Reference in New Issue
Block a user