*Merge.
--HG-- branch : trunk
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
DELETE FROM trinity_string where entry=1010;
|
||||
INSERT INTO trinity_string (entry, content_default) VALUES(1010, "| Account | Character | IP | GM | EXP |");
|
||||
@@ -56,4 +56,5 @@ INSTALL(FILES
|
||||
1618_world.sql
|
||||
1646_mangos_7369_01_world_quest_template.sql
|
||||
1654_world.sql
|
||||
1657_world.sql
|
||||
DESTINATION share/trinity/sql/updates)
|
||||
@@ -86,7 +86,7 @@ ObjectAccessor::GetNPCIfCanInteractWith(Player const &player, uint64 guid, uint3
|
||||
if(factionTemplate)
|
||||
{
|
||||
FactionEntry const* faction = sFactionStore.LookupEntry(factionTemplate->faction);
|
||||
if( faction->reputationListID >= 0 && player.GetReputationRank(faction) <= REP_UNFRIENDLY)
|
||||
if( faction && faction->reputationListID >= 0 && player.GetReputationRank(faction) <= REP_UNFRIENDLY)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
+8
-1
@@ -5757,6 +5757,7 @@ void Player::SetFactionVisibleForFactionTemplateId(uint32 FactionTemplateId)
|
||||
if(!factionTemplateEntry)
|
||||
return;
|
||||
|
||||
if(factionTemplateEntry->faction)
|
||||
SetFactionVisibleForFactionId(factionTemplateEntry->faction);
|
||||
}
|
||||
|
||||
@@ -10172,6 +10173,12 @@ uint8 Player::CanStoreItems( Item **pItems,int count) const
|
||||
pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, t );
|
||||
if( pBag )
|
||||
{
|
||||
pBagProto = pBag->GetProto();
|
||||
|
||||
// special bag already checked
|
||||
if( pBagProto && (pBagProto->Class != ITEM_CLASS_CONTAINER || pBagProto->SubClass != ITEM_SUBCLASS_CONTAINER))
|
||||
continue;
|
||||
|
||||
for(uint32 j = 0; j < pBag->GetBagSize(); j++)
|
||||
{
|
||||
if( inv_bags[t-INVENTORY_SLOT_BAG_START][j] == 0 )
|
||||
@@ -19241,7 +19248,7 @@ BGQueueIdBasedOnLevel Player::GetBattleGroundQueueIdFromLevel(BattleGroundTypeId
|
||||
float Player::GetReputationPriceDiscount( Creature const* pCreature ) const
|
||||
{
|
||||
FactionTemplateEntry const* vendor_faction = pCreature->getFactionTemplateEntry();
|
||||
if(!vendor_faction)
|
||||
if(!vendor_faction || !vendor_faction->faction)
|
||||
return 1.0f;
|
||||
|
||||
ReputationRank rank = GetReputationRank(vendor_faction->faction);
|
||||
|
||||
+14
-2
@@ -7382,6 +7382,8 @@ bool Unit::IsHostileTo(Unit const* unit) const
|
||||
if(tester->GetTypeId()==TYPEID_PLAYER)
|
||||
{
|
||||
// forced reaction
|
||||
if(target_faction->faction)
|
||||
{
|
||||
ForcedReactions::const_iterator forceItr = ((Player*)tester)->m_forcedReactions.find(target_faction->faction);
|
||||
if(forceItr!=((Player*)tester)->m_forcedReactions.end())
|
||||
return forceItr->second <= REP_HOSTILE;
|
||||
@@ -7392,10 +7394,13 @@ bool Unit::IsHostileTo(Unit const* unit) const
|
||||
if(FactionState const* factionState = ((Player*)tester)->GetFactionState(raw_target_faction))
|
||||
return (factionState->Flags & FACTION_FLAG_AT_WAR);
|
||||
}
|
||||
}
|
||||
// CvP forced reaction and reputation case
|
||||
else if(target->GetTypeId()==TYPEID_PLAYER)
|
||||
{
|
||||
// forced reaction
|
||||
if(tester_faction->faction)
|
||||
{
|
||||
ForcedReactions::const_iterator forceItr = ((Player const*)target)->m_forcedReactions.find(tester_faction->faction);
|
||||
if(forceItr!=((Player const*)target)->m_forcedReactions.end())
|
||||
return forceItr->second <= REP_HOSTILE;
|
||||
@@ -7405,6 +7410,7 @@ bool Unit::IsHostileTo(Unit const* unit) const
|
||||
if(raw_tester_faction && raw_tester_faction->reputationListID >=0 )
|
||||
return ((Player const*)target)->GetReputationRank(raw_tester_faction) <= REP_HOSTILE;
|
||||
}
|
||||
}
|
||||
|
||||
// common faction based case (CvC,PvC,CvP)
|
||||
return tester_faction->IsHostileTo(*target_faction);
|
||||
@@ -7491,6 +7497,8 @@ bool Unit::IsFriendlyTo(Unit const* unit) const
|
||||
if(tester->GetTypeId()==TYPEID_PLAYER)
|
||||
{
|
||||
// forced reaction
|
||||
if(target_faction->faction)
|
||||
{
|
||||
ForcedReactions::const_iterator forceItr = ((Player const*)tester)->m_forcedReactions.find(target_faction->faction);
|
||||
if(forceItr!=((Player const*)tester)->m_forcedReactions.end())
|
||||
return forceItr->second >= REP_FRIENDLY;
|
||||
@@ -7501,10 +7509,13 @@ bool Unit::IsFriendlyTo(Unit const* unit) const
|
||||
if(FactionState const* FactionState = ((Player*)tester)->GetFactionState(raw_target_faction))
|
||||
return !(FactionState->Flags & FACTION_FLAG_AT_WAR);
|
||||
}
|
||||
}
|
||||
// CvP forced reaction and reputation case
|
||||
else if(target->GetTypeId()==TYPEID_PLAYER)
|
||||
{
|
||||
// forced reaction
|
||||
if(tester_faction->faction)
|
||||
{
|
||||
ForcedReactions::const_iterator forceItr = ((Player const*)target)->m_forcedReactions.find(tester_faction->faction);
|
||||
if(forceItr!=((Player const*)target)->m_forcedReactions.end())
|
||||
return forceItr->second >= REP_FRIENDLY;
|
||||
@@ -7514,6 +7525,7 @@ bool Unit::IsFriendlyTo(Unit const* unit) const
|
||||
if(raw_tester_faction->reputationListID >=0 )
|
||||
return ((Player const*)target)->GetReputationRank(raw_tester_faction) >= REP_FRIENDLY;
|
||||
}
|
||||
}
|
||||
|
||||
// common faction based case (CvC,PvC,CvP)
|
||||
return tester_faction->IsFriendlyTo(*target_faction);
|
||||
@@ -7522,7 +7534,7 @@ bool Unit::IsFriendlyTo(Unit const* unit) const
|
||||
bool Unit::IsHostileToPlayers() const
|
||||
{
|
||||
FactionTemplateEntry const* my_faction = getFactionTemplateEntry();
|
||||
if(!my_faction)
|
||||
if(!my_faction || !my_faction->faction)
|
||||
return false;
|
||||
|
||||
FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->faction);
|
||||
@@ -7535,7 +7547,7 @@ bool Unit::IsHostileToPlayers() const
|
||||
bool Unit::IsNeutralToAll() const
|
||||
{
|
||||
FactionTemplateEntry const* my_faction = getFactionTemplateEntry();
|
||||
if(!my_faction)
|
||||
if(!my_faction || !my_faction->faction)
|
||||
return true;
|
||||
|
||||
FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->faction);
|
||||
|
||||
@@ -735,24 +735,40 @@ struct FactionTemplateEntry
|
||||
{
|
||||
if(ID == entry.ID)
|
||||
return true;
|
||||
if(enemyFaction[0] == entry.faction || enemyFaction[1] == entry.faction || enemyFaction[2] == entry.faction || enemyFaction[3] == entry.faction )
|
||||
if(entry.faction)
|
||||
{
|
||||
for(int i = 0; i < 4; ++i)
|
||||
if (enemyFaction[i] == entry.faction)
|
||||
return false;
|
||||
if(friendFaction[0] == entry.faction || friendFaction[1] == entry.faction || friendFaction[2] == entry.faction || friendFaction[3] == entry.faction )
|
||||
for(int i = 0; i < 4; ++i)
|
||||
if (friendFaction[i] == entry.faction)
|
||||
return true;
|
||||
}
|
||||
return (friendlyMask & entry.ourMask) || (ourMask & entry.friendlyMask);
|
||||
}
|
||||
bool IsHostileTo(FactionTemplateEntry const& entry) const
|
||||
{
|
||||
if(ID == entry.ID)
|
||||
return false;
|
||||
if(enemyFaction[0] == entry.faction || enemyFaction[1] == entry.faction || enemyFaction[2] == entry.faction || enemyFaction[3] == entry.faction )
|
||||
if(entry.faction)
|
||||
{
|
||||
for(int i = 0; i < 4; ++i)
|
||||
if (enemyFaction[i] == entry.faction)
|
||||
return true;
|
||||
if(friendFaction[0] == entry.faction || friendFaction[1] == entry.faction || friendFaction[2] == entry.faction || friendFaction[3] == entry.faction )
|
||||
for(int i = 0; i < 4; ++i)
|
||||
if (friendFaction[i] == entry.faction)
|
||||
return false;
|
||||
}
|
||||
return (hostileMask & entry.ourMask) != 0;
|
||||
}
|
||||
bool IsHostileToPlayers() const { return (hostileMask & FACTION_MASK_PLAYER) !=0; }
|
||||
bool IsNeutralToAll() const { return hostileMask == 0 && friendlyMask == 0 && enemyFaction[0]==0 && enemyFaction[1]==0 && enemyFaction[2]==0 && enemyFaction[3]==0; }
|
||||
bool IsNeutralToAll() const
|
||||
{
|
||||
for(int i = 0; i < 4; ++i)
|
||||
if (enemyFaction[i] != 0)
|
||||
return false;
|
||||
return hostileMask == 0 && friendlyMask == 0;
|
||||
}
|
||||
bool IsContestedGuardFaction() const { return (factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD)!=0; }
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "7373"
|
||||
#define REVISION_NR "7374"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
||||
Reference in New Issue
Block a user