mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-24 07:30:07 -04:00
Core/DataStores: Updated DungeonEncounter.dbc, DurabilityCosts.dbc, DurabilityQuality.dbc, EmotesEntry.dbc, EmotesText.dbc, Faction.dbc, FactionTemplate.dbc structs
This commit is contained in:
@@ -54,9 +54,9 @@ AuctionHouseObject* AuctionHouseMgr::GetAuctionsMap(uint32 factionTemplateId)
|
||||
FactionTemplateEntry const* uEntry = sFactionTemplateStore.LookupEntry(factionTemplateId);
|
||||
if (!uEntry)
|
||||
return &mNeutralAuctions;
|
||||
else if (uEntry->ourMask & FACTION_MASK_ALLIANCE)
|
||||
else if (uEntry->Mask & FACTION_MASK_ALLIANCE)
|
||||
return &mAllianceAuctions;
|
||||
else if (uEntry->ourMask & FACTION_MASK_HORDE)
|
||||
else if (uEntry->Mask & FACTION_MASK_HORDE)
|
||||
return &mHordeAuctions;
|
||||
else
|
||||
return &mNeutralAuctions;
|
||||
@@ -413,9 +413,9 @@ AuctionHouseEntry const* AuctionHouseMgr::GetAuctionHouseEntry(uint32 factionTem
|
||||
FactionTemplateEntry const* u_entry = sFactionTemplateStore.LookupEntry(factionTemplateId);
|
||||
if (!u_entry)
|
||||
houseid = 7; // goblin auction house
|
||||
else if (u_entry->ourMask & FACTION_MASK_ALLIANCE)
|
||||
else if (u_entry->Mask & FACTION_MASK_ALLIANCE)
|
||||
houseid = 1; // human auction house
|
||||
else if (u_entry->ourMask & FACTION_MASK_HORDE)
|
||||
else if (u_entry->Mask & FACTION_MASK_HORDE)
|
||||
houseid = 6; // orc auction house
|
||||
else
|
||||
houseid = 7; // goblin auction house
|
||||
|
||||
@@ -133,7 +133,7 @@ void HostileRefManager::deleteReferencesForFaction(uint32 faction)
|
||||
while (ref)
|
||||
{
|
||||
HostileReference* nextRef = ref->next();
|
||||
if (ref->GetSource()->GetOwner()->GetFactionTemplateEntry()->faction == faction)
|
||||
if (ref->GetSource()->GetOwner()->GetFactionTemplateEntry()->Faction == faction)
|
||||
{
|
||||
ref->removeReference();
|
||||
delete ref;
|
||||
|
||||
@@ -398,9 +398,9 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
for (uint32 i=0; i<sFactionStore.GetNumRows(); ++i)
|
||||
{
|
||||
FactionEntry const* faction = sFactionStore.LookupEntry(i);
|
||||
if (faction && faction->team)
|
||||
if (faction && faction->ParentFactionID)
|
||||
{
|
||||
SimpleFactionsList &flist = sFactionTeamMap[faction->team];
|
||||
SimpleFactionsList &flist = sFactionTeamMap[faction->ParentFactionID];
|
||||
flist.push_back(i);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -938,7 +938,7 @@ struct DestructibleModelDataEntry
|
||||
} StateRebuilding;
|
||||
struct
|
||||
{
|
||||
//uint32 DisplayID; // 15
|
||||
uint32 DisplayID; // 15
|
||||
//uint32 InitDoodadSet; // 16
|
||||
//uint32 AmbientDoodadSet; // 17
|
||||
//uint32 NameSet; // 18
|
||||
@@ -952,67 +952,72 @@ struct DestructibleModelDataEntry
|
||||
|
||||
struct DungeonEncounterEntry
|
||||
{
|
||||
uint32 id; // 0 unique id
|
||||
uint32 mapId; // 1 map id
|
||||
int32 difficulty; // 2 instance mode
|
||||
//uint32 unk0; // 3
|
||||
uint32 encounterIndex; // 4 encounter index for creating completed mask
|
||||
char* encounterName; // 5 encounter name
|
||||
//uint32 nameFlags; // 21
|
||||
//uint32 unk1; // 22
|
||||
uint32 ID; // 0
|
||||
uint32 MapID; // 1
|
||||
uint32 DifficultyID; // 2
|
||||
uint32 OrderIndex; // 3
|
||||
//uint32 Bit; // 4
|
||||
char* Name_lang; // 5
|
||||
//uint32 CreatureDisplayID; // 6
|
||||
//uint32 Flags; // 7
|
||||
};
|
||||
|
||||
struct DurabilityCostsEntry
|
||||
{
|
||||
uint32 Itemlvl; // 0
|
||||
uint32 multiplier[29]; // 1-29
|
||||
uint32 ID; // 0
|
||||
uint32 WeaponSubClassCost[21]; // 1-22
|
||||
uint32 ArmorSubClassCost[8]; // 23-30
|
||||
};
|
||||
|
||||
struct DurabilityQualityEntry
|
||||
{
|
||||
uint32 Id; // 0
|
||||
float quality_mod; // 1
|
||||
uint32 ID; // 0
|
||||
float QualityMod; // 1
|
||||
};
|
||||
|
||||
struct EmotesEntry
|
||||
{
|
||||
uint32 Id; // 0
|
||||
//char* Name; // 1, internal name
|
||||
//uint32 AnimationId; // 2, ref to animationData
|
||||
uint32 Flags; // 3, bitmask, may be unit_flags
|
||||
uint32 EmoteType; // 4, Can be 0, 1 or 2 (determine how emote are shown)
|
||||
uint32 UnitStandState; // 5, uncomfirmed, may be enum UnitStandStateType
|
||||
//uint32 SoundId; // 6, ref to soundEntries
|
||||
//uint32 unk7 // 7
|
||||
uint32 ID; // 0
|
||||
//char* EmoteSlashCommand; // 1
|
||||
//uint32 AnimID; // 2 ref to animationData
|
||||
uint32 EmoteFlags; // 3 bitmask, may be unit_flags
|
||||
uint32 EmoteSpecProc; // 4 Can be 0, 1 or 2 (determine how emote are shown)
|
||||
uint32 EmoteSpecProcParam; // 5 uncomfirmed, may be enum UnitStandStateType
|
||||
//uint32 EmoteSoundID; // 6 ref to soundEntries
|
||||
//uint32 SpellVisualKitID // 7
|
||||
};
|
||||
|
||||
struct EmotesTextEntry
|
||||
{
|
||||
uint32 Id;
|
||||
uint32 textid;
|
||||
uint32 ID; // 0
|
||||
//char* Name_lang; // 1
|
||||
uint32 EmoteID; // 2
|
||||
//uint32 EmoteText[16]; // 3-18
|
||||
};
|
||||
|
||||
struct FactionEntry
|
||||
{
|
||||
uint32 ID; // 0 m_ID
|
||||
int32 reputationListID; // 1 m_reputationIndex
|
||||
uint32 BaseRepRaceMask[4]; // 2-5 m_reputationRaceMask
|
||||
uint32 BaseRepClassMask[4]; // 6-9 m_reputationClassMask
|
||||
int32 BaseRepValue[4]; // 10-13 m_reputationBase
|
||||
uint32 ReputationFlags[4]; // 14-17 m_reputationFlags
|
||||
uint32 team; // 18 m_parentFactionID
|
||||
float spilloverRateIn; // 19 Faction gains incoming rep * spilloverRateIn
|
||||
float spilloverRateOut; // 20 Faction outputs rep * spilloverRateOut as spillover reputation
|
||||
uint32 spilloverMaxRankIn; // 21 The highest rank the faction will profit from incoming spillover
|
||||
//uint32 spilloverRank_unk; // 22 It does not seem to be the max standing at which a faction outputs spillover ...so no idea
|
||||
char* name; // 23 m_name_lang
|
||||
//char* description; // 24 m_description_lang
|
||||
uint32 GroupExpansion; // 25 m_factionGroupExpansion
|
||||
uint32 ID; // 0
|
||||
int32 ReputationIndex; // 1
|
||||
uint32 ReputationRaceMask[4]; // 2-5
|
||||
uint32 ReputationClassMask[4]; // 6-9
|
||||
int32 ReputationBase[4]; // 10-13
|
||||
uint32 ReputationFlags[4]; // 14-17
|
||||
uint32 ParentFactionID; // 18
|
||||
float ParentFactionModIn; // 19 Faction gains incoming rep * ParentFactionModIn
|
||||
float ParentFactionModOut; // 20 Faction outputs rep * ParentFactionModOut as spillover reputation
|
||||
uint32 ParentFactionCapIn; // 21 The highest rank the faction will profit from incoming spillover
|
||||
//uint32 ParentFactionCapOut; // 22
|
||||
char* Name_lang; // 23
|
||||
//char* Description_lang; // 24
|
||||
uint32 Expansion; // 25
|
||||
//uint32 Flags; // 26
|
||||
//uint32 FriendshipRepID; // 27
|
||||
|
||||
// helpers
|
||||
bool CanHaveReputation() const
|
||||
{
|
||||
return reputationListID >= 0;
|
||||
return ReputationIndex >= 0;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1020,14 +1025,14 @@ struct FactionEntry
|
||||
|
||||
struct FactionTemplateEntry
|
||||
{
|
||||
uint32 ID; // 0 m_ID
|
||||
uint32 faction; // 1 m_faction
|
||||
uint32 factionFlags; // 2 m_flags
|
||||
uint32 ourMask; // 3 m_factionGroup
|
||||
uint32 friendlyMask; // 4 m_friendGroup
|
||||
uint32 hostileMask; // 5 m_enemyGroup
|
||||
uint32 enemyFaction[MAX_FACTION_RELATIONS]; // 6 m_enemies[MAX_FACTION_RELATIONS]
|
||||
uint32 friendFaction[MAX_FACTION_RELATIONS]; // 10 m_friend[MAX_FACTION_RELATIONS]
|
||||
uint32 ID; // 0
|
||||
uint32 Faction; // 1
|
||||
uint32 Flags; // 2
|
||||
uint32 Mask; // 3 m_factionGroup
|
||||
uint32 FriendMask; // 4 m_friendGroup
|
||||
uint32 EnemyMask; // 5 m_enemyGroup
|
||||
uint32 Enemies[MAX_FACTION_RELATIONS]; // 6
|
||||
uint32 Friends[MAX_FACTION_RELATIONS]; // 10
|
||||
//------------------------------------------------------- end structure
|
||||
|
||||
// helpers
|
||||
@@ -1035,41 +1040,41 @@ struct FactionTemplateEntry
|
||||
{
|
||||
if (ID == entry.ID)
|
||||
return true;
|
||||
if (entry.faction)
|
||||
if (entry.Faction)
|
||||
{
|
||||
for (int i = 0; i < MAX_FACTION_RELATIONS; ++i)
|
||||
if (enemyFaction[i] == entry.faction)
|
||||
if (Enemies[i] == entry.Faction)
|
||||
return false;
|
||||
for (int i = 0; i < MAX_FACTION_RELATIONS; ++i)
|
||||
if (friendFaction[i] == entry.faction)
|
||||
if (Friends[i] == entry.Faction)
|
||||
return true;
|
||||
}
|
||||
return (friendlyMask & entry.ourMask) || (ourMask & entry.friendlyMask);
|
||||
return (FriendMask & entry.Mask) || (Mask & entry.FriendMask);
|
||||
}
|
||||
bool IsHostileTo(FactionTemplateEntry const& entry) const
|
||||
{
|
||||
if (ID == entry.ID)
|
||||
return false;
|
||||
if (entry.faction)
|
||||
if (entry.Faction)
|
||||
{
|
||||
for (int i = 0; i < MAX_FACTION_RELATIONS; ++i)
|
||||
if (enemyFaction[i] == entry.faction)
|
||||
if (Enemies[i] == entry.Faction)
|
||||
return true;
|
||||
for (int i = 0; i < MAX_FACTION_RELATIONS; ++i)
|
||||
if (friendFaction[i] == entry.faction)
|
||||
if (Friends[i] == entry.Faction)
|
||||
return false;
|
||||
}
|
||||
return (hostileMask & entry.ourMask) != 0;
|
||||
return (EnemyMask & entry.Mask) != 0;
|
||||
}
|
||||
bool IsHostileToPlayers() const { return (hostileMask & FACTION_MASK_PLAYER) !=0; }
|
||||
bool IsHostileToPlayers() const { return (EnemyMask & FACTION_MASK_PLAYER) !=0; }
|
||||
bool IsNeutralToAll() const
|
||||
{
|
||||
for (int i = 0; i < MAX_FACTION_RELATIONS; ++i)
|
||||
if (enemyFaction[i] != 0)
|
||||
if (Enemies[i] != 0)
|
||||
return false;
|
||||
return hostileMask == 0 && friendlyMask == 0;
|
||||
return EnemyMask == 0 && FriendMask == 0;
|
||||
}
|
||||
bool IsContestedGuardFaction() const { return (factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD) != 0; }
|
||||
bool IsContestedGuardFaction() const { return (Flags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD) != 0; }
|
||||
};
|
||||
|
||||
struct GameObjectDisplayInfoEntry
|
||||
|
||||
@@ -44,13 +44,13 @@ char const ChrClassesXPowerTypesfmt[] = "nii";
|
||||
char const CinematicSequencesEntryfmt[] = "nxxxxxxxxx";
|
||||
char const CreatureDisplayInfofmt[] = "nixifxxxxxxxxxxxxxxxx";
|
||||
char const CreatureDisplayInfoExtrafmt[] = "dixxxxxxxxxxxxxxxxxxx";
|
||||
char const CreatureFamilyfmt[] = "nfifiiiiixix";
|
||||
char const CreatureFamilyfmt[] = "nfifiiiiixsx";
|
||||
char const CreatureModelDatafmt[] = "nixxxxxxxxxxxxxffxxxxxxxxxxxxxxxxx";
|
||||
char const CreatureSpellDatafmt[] = "niiiixxxx";
|
||||
char const CreatureTypefmt[] = "nxx";
|
||||
char const CurrencyTypesfmt[] = "nixxxxxixixx";
|
||||
char const DestructibleModelDatafmt[] = "nixxxixxxxixxxxxxxxxxxxx";
|
||||
char const DungeonEncounterfmt[] = "niixisxx";
|
||||
char const CurrencyTypesfmt[] = "nixxxxxiiixx";
|
||||
char const DestructibleModelDatafmt[] = "nixxxixxxxixxxxixxxxxxxx";
|
||||
char const DungeonEncounterfmt[] = "niiixsxx";
|
||||
char const DurabilityCostsfmt[] = "niiiiiiiiiiiiiiiiiiiiiiiiiiiii";
|
||||
char const DurabilityQualityfmt[] = "nf";
|
||||
char const EmotesEntryfmt[] = "nxxiiixx";
|
||||
|
||||
@@ -409,7 +409,7 @@ bool Creature::UpdateEntry(uint32 entry, CreatureData const* data /*= nullptr*/)
|
||||
// checked and error show at loading templates
|
||||
if (FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(cInfo->faction))
|
||||
{
|
||||
if (factionTemplate->factionFlags & FACTION_TEMPLATE_FLAG_PVP)
|
||||
if (factionTemplate->Flags & FACTION_TEMPLATE_FLAG_PVP)
|
||||
SetPvP(true);
|
||||
else
|
||||
SetPvP(false);
|
||||
|
||||
@@ -573,16 +573,6 @@ const uint32 MaxItemSubclassValues[MAX_ITEM_CLASS] =
|
||||
MAX_ITEM_SUBCLASS_GLYPH
|
||||
};
|
||||
|
||||
inline uint8 ItemSubClassToDurabilityMultiplierId(uint32 ItemClass, uint32 ItemSubClass)
|
||||
{
|
||||
switch (ItemClass)
|
||||
{
|
||||
case ITEM_CLASS_WEAPON: return ItemSubClass;
|
||||
case ITEM_CLASS_ARMOR: return ItemSubClass + 21;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform
|
||||
#if defined(__GNUC__)
|
||||
#pragma pack(1)
|
||||
|
||||
@@ -2638,9 +2638,9 @@ Creature* Player::GetNPCIfCanInteractWith(ObjectGuid guid, uint32 npcflagmask)
|
||||
|
||||
// not unfriendly
|
||||
if (FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(creature->getFaction()))
|
||||
if (factionTemplate->faction)
|
||||
if (FactionEntry const* faction = sFactionStore.LookupEntry(factionTemplate->faction))
|
||||
if (faction->reputationListID >= 0 && GetReputationMgr().GetRank(faction) <= REP_UNFRIENDLY)
|
||||
if (factionTemplate->Faction)
|
||||
if (FactionEntry const* faction = sFactionStore.LookupEntry(factionTemplate->Faction))
|
||||
if (faction->ReputationIndex >= 0 && GetReputationMgr().GetRank(faction) <= REP_UNFRIENDLY)
|
||||
return NULL;
|
||||
|
||||
// not too far
|
||||
@@ -5234,8 +5234,13 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g
|
||||
return TotalCost;
|
||||
}
|
||||
|
||||
uint32 dmultiplier = dcost->multiplier[ItemSubClassToDurabilityMultiplierId(ditemProto->Class, ditemProto->SubClass)];
|
||||
uint32 costs = uint32(LostDurability*dmultiplier*double(dQualitymodEntry->quality_mod));
|
||||
uint32 dmultiplier = 0;
|
||||
if (ditemProto->Class == ITEM_CLASS_WEAPON)
|
||||
dmultiplier = dcost->WeaponSubClassCost[ditemProto->SubClass];
|
||||
else if (ditemProto->Class == ITEM_CLASS_ARMOR)
|
||||
dmultiplier = dcost->ArmorSubClassCost[ditemProto->SubClass];
|
||||
|
||||
uint32 costs = uint32(LostDurability*dmultiplier*double(dQualitymodEntry->QualityMod));
|
||||
|
||||
costs = uint32(costs * discountMod * sWorld->getRate(RATE_REPAIRCOST));
|
||||
|
||||
@@ -23870,10 +23875,10 @@ bool Player::GetBGAccessByLevel(BattlegroundTypeId bgTypeId) const
|
||||
float Player::GetReputationPriceDiscount(Creature const* creature) const
|
||||
{
|
||||
FactionTemplateEntry const* vendor_faction = creature->GetFactionTemplateEntry();
|
||||
if (!vendor_faction || !vendor_faction->faction)
|
||||
if (!vendor_faction || !vendor_faction->Faction)
|
||||
return 1.0f;
|
||||
|
||||
ReputationRank rank = GetReputationRank(vendor_faction->faction);
|
||||
ReputationRank rank = GetReputationRank(vendor_faction->Faction);
|
||||
if (rank <= REP_NEUTRAL)
|
||||
return 1.0f;
|
||||
|
||||
|
||||
@@ -7323,12 +7323,12 @@ ReputationRank Unit::GetReactionTo(Unit const* target) const
|
||||
return *repRank;
|
||||
if (!selfPlayerOwner->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_IGNORE_REPUTATION))
|
||||
{
|
||||
if (FactionEntry const* targetFactionEntry = sFactionStore.LookupEntry(targetFactionTemplateEntry->faction))
|
||||
if (FactionEntry const* targetFactionEntry = sFactionStore.LookupEntry(targetFactionTemplateEntry->Faction))
|
||||
{
|
||||
if (targetFactionEntry->CanHaveReputation())
|
||||
{
|
||||
// check contested flags
|
||||
if (targetFactionTemplateEntry->factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD
|
||||
if (targetFactionTemplateEntry->Flags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD
|
||||
&& selfPlayerOwner->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP))
|
||||
return REP_HOSTILE;
|
||||
|
||||
@@ -7360,14 +7360,14 @@ ReputationRank Unit::GetFactionReactionTo(FactionTemplateEntry const* factionTem
|
||||
if (Player const* targetPlayerOwner = target->GetAffectingPlayer())
|
||||
{
|
||||
// check contested flags
|
||||
if (factionTemplateEntry->factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD
|
||||
if (factionTemplateEntry->Flags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD
|
||||
&& targetPlayerOwner->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP))
|
||||
return REP_HOSTILE;
|
||||
if (ReputationRank const* repRank = targetPlayerOwner->GetReputationMgr().GetForcedRankIfAny(factionTemplateEntry))
|
||||
return *repRank;
|
||||
if (!target->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_IGNORE_REPUTATION))
|
||||
{
|
||||
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->faction))
|
||||
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->Faction))
|
||||
{
|
||||
if (factionEntry->CanHaveReputation())
|
||||
{
|
||||
@@ -7388,7 +7388,7 @@ ReputationRank Unit::GetFactionReactionTo(FactionTemplateEntry const* factionTem
|
||||
return REP_FRIENDLY;
|
||||
if (targetFactionTemplateEntry->IsFriendlyTo(*factionTemplateEntry))
|
||||
return REP_FRIENDLY;
|
||||
if (factionTemplateEntry->factionFlags & FACTION_TEMPLATE_FLAG_HOSTILE_BY_DEFAULT)
|
||||
if (factionTemplateEntry->Flags & FACTION_TEMPLATE_FLAG_HOSTILE_BY_DEFAULT)
|
||||
return REP_HOSTILE;
|
||||
// neutral by default
|
||||
return REP_NEUTRAL;
|
||||
@@ -7407,11 +7407,11 @@ bool Unit::IsFriendlyTo(Unit const* unit) const
|
||||
bool Unit::IsHostileToPlayers() const
|
||||
{
|
||||
FactionTemplateEntry const* my_faction = GetFactionTemplateEntry();
|
||||
if (!my_faction || !my_faction->faction)
|
||||
if (!my_faction || !my_faction->Faction)
|
||||
return false;
|
||||
|
||||
FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->faction);
|
||||
if (raw_faction && raw_faction->reputationListID >= 0)
|
||||
FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->Faction);
|
||||
if (raw_faction && raw_faction->ReputationIndex >= 0)
|
||||
return false;
|
||||
|
||||
return my_faction->IsHostileToPlayers();
|
||||
@@ -7420,11 +7420,11 @@ bool Unit::IsHostileToPlayers() const
|
||||
bool Unit::IsNeutralToAll() const
|
||||
{
|
||||
FactionTemplateEntry const* my_faction = GetFactionTemplateEntry();
|
||||
if (!my_faction || !my_faction->faction)
|
||||
if (!my_faction || !my_faction->Faction)
|
||||
return true;
|
||||
|
||||
FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->faction);
|
||||
if (raw_faction && raw_faction->reputationListID >= 0)
|
||||
FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->Faction);
|
||||
if (raw_faction && raw_faction->ReputationIndex >= 0)
|
||||
return false;
|
||||
|
||||
return my_faction->IsNeutralToAll();
|
||||
@@ -10322,7 +10322,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo
|
||||
if (FactionTemplateEntry const* factionTemplate = creature->GetFactionTemplateEntry())
|
||||
{
|
||||
if (!(player->GetReputationMgr().GetForcedRankIfAny(factionTemplate)))
|
||||
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplate->faction))
|
||||
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplate->Faction))
|
||||
if (FactionState const* repState = player->GetReputationMgr().GetState(factionEntry))
|
||||
if (!(repState->Flags & FACTION_FLAG_AT_WAR))
|
||||
return false;
|
||||
@@ -16037,7 +16037,7 @@ void Unit::StopAttackFaction(uint32 faction_id)
|
||||
{
|
||||
if (Unit* victim = GetVictim())
|
||||
{
|
||||
if (victim->GetFactionTemplateEntry()->faction == faction_id)
|
||||
if (victim->GetFactionTemplateEntry()->Faction == faction_id)
|
||||
{
|
||||
AttackStop();
|
||||
if (IsNonMeleeSpellCast(false))
|
||||
@@ -16052,7 +16052,7 @@ void Unit::StopAttackFaction(uint32 faction_id)
|
||||
AttackerSet const& attackers = getAttackers();
|
||||
for (AttackerSet::const_iterator itr = attackers.begin(); itr != attackers.end();)
|
||||
{
|
||||
if ((*itr)->GetFactionTemplateEntry()->faction == faction_id)
|
||||
if ((*itr)->GetFactionTemplateEntry()->Faction == faction_id)
|
||||
{
|
||||
(*itr)->AttackStop();
|
||||
itr = attackers.begin();
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -741,7 +741,7 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket& recvData)
|
||||
if (!em)
|
||||
return;
|
||||
|
||||
uint32 emote_anim = em->textid;
|
||||
uint32 emote_anim = em->EmoteID;
|
||||
|
||||
switch (emote_anim)
|
||||
{
|
||||
|
||||
@@ -600,11 +600,11 @@ void InstanceScript::UpdateEncounterState(EncounterCreditType type, uint32 credi
|
||||
DungeonEncounter const* encounter = *itr;
|
||||
if (encounter->creditType == type && encounter->creditEntry == creditEntry)
|
||||
{
|
||||
completedEncounters |= 1 << encounter->dbcEntry->encounterIndex;
|
||||
completedEncounters |= 1 << encounter->dbcEntry->OrderIndex;
|
||||
if (encounter->lastEncounterDungeon)
|
||||
{
|
||||
dungeonId = encounter->lastEncounterDungeon;
|
||||
TC_LOG_DEBUG("lfg", "UpdateEncounterState: Instance %s (instanceId %u) completed encounter %s. Credit Dungeon: %u", instance->GetMapName(), instance->GetInstanceId(), encounter->dbcEntry->encounterName, dungeonId);
|
||||
TC_LOG_DEBUG("lfg", "UpdateEncounterState: Instance %s (instanceId %u) completed encounter %s. Credit Dungeon: %u", instance->GetMapName(), instance->GetInstanceId(), encounter->dbcEntry->Name_lang, dungeonId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -86,7 +86,7 @@ class ReputationMgr
|
||||
|
||||
FactionState const* GetState(FactionEntry const* factionEntry) const
|
||||
{
|
||||
return factionEntry->CanHaveReputation() ? GetState(factionEntry->reputationListID) : NULL;
|
||||
return factionEntry->CanHaveReputation() ? GetState(factionEntry->ReputationIndex) : NULL;
|
||||
}
|
||||
|
||||
FactionState const* GetState(RepListID id) const
|
||||
@@ -111,7 +111,7 @@ class ReputationMgr
|
||||
|
||||
ReputationRank const* GetForcedRankIfAny(FactionTemplateEntry const* factionTemplateEntry) const
|
||||
{
|
||||
ForcedReactions::const_iterator forceItr = _forcedReactions.find(factionTemplateEntry->faction);
|
||||
ForcedReactions::const_iterator forceItr = _forcedReactions.find(factionTemplateEntry->Faction);
|
||||
return forceItr != _forcedReactions.end() ? &forceItr->second : NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -566,7 +566,7 @@ public:
|
||||
{
|
||||
FactionState const& faction = itr->second;
|
||||
FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction.ID);
|
||||
char const* factionName = factionEntry ? factionEntry->name : "#Not found#";
|
||||
char const* factionName = factionEntry ? factionEntry->Name_lang : "#Not found#";
|
||||
ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry);
|
||||
std::string rankName = handler->GetTrinityString(ReputationRankStrIndex[rank]);
|
||||
std::ostringstream ss;
|
||||
|
||||
@@ -299,7 +299,7 @@ public:
|
||||
{
|
||||
FactionState const* factionState = target ? target->GetReputationMgr().GetState(factionEntry) : NULL;
|
||||
|
||||
std::string name = factionEntry->name;
|
||||
std::string name = factionEntry->Name_lang;
|
||||
if (name.empty())
|
||||
continue;
|
||||
|
||||
|
||||
@@ -1233,16 +1233,16 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (factionEntry->reputationListID < 0)
|
||||
if (factionEntry->ReputationIndex < 0)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->name, factionId);
|
||||
handler->PSendSysMessage(LANG_COMMAND_FACTION_NOREP_ERROR, factionEntry->Name_lang, factionId);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
target->GetReputationMgr().SetOneFactionReputation(factionEntry, amount, false);
|
||||
target->GetReputationMgr().SendState(target->GetReputationMgr().GetState(factionEntry));
|
||||
handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->name, factionId,
|
||||
handler->PSendSysMessage(LANG_COMMAND_MODIFY_REP, factionEntry->Name_lang, factionId,
|
||||
handler->GetNameLink(target).c_str(), target->GetReputationMgr().GetReputation(factionEntry));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ public:
|
||||
{
|
||||
uint32 Spell = 0;
|
||||
|
||||
switch (pFaction->faction)
|
||||
switch (pFaction->Faction)
|
||||
{
|
||||
case 1011: Spell = SPELL_REP_LC; break;
|
||||
case 935: Spell = SPELL_REP_SHAT; break;
|
||||
|
||||
Reference in New Issue
Block a user