Core/Quests: Fix quests with RepObjective2 set. Closes #2901.
Misc: Correct a file name, move a spell error to error log and a small typo in trinity_string
This commit is contained in:
@@ -0,0 +1 @@
|
||||
UPDATE `trinity_string` SET `content_default`='Faction %s (%u) can''t have reputation.' WHERE `entry`=326; -- can'nt -> can't
|
||||
@@ -441,7 +441,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const
|
||||
data << uint32(quest->GetRepObjectiveFaction()); // shown in quest log as part of quest objective
|
||||
data << uint32(quest->GetRepObjectiveValue()); // shown in quest log as part of quest objective
|
||||
|
||||
data << uint32(quest->GetRepObjectiveFaction2()); // shown in quest log as part of quest objective OPOSITE faction
|
||||
data << uint32(quest->GetRepObjectiveFaction2()); // shown in quest log as part of quest objective OPPOSITE faction
|
||||
data << uint32(quest->GetRepObjectiveValue2()); // shown in quest log as part of quest objective OPPOSITE faction
|
||||
|
||||
data << uint32(quest->GetNextQuestInChain()); // client will request this quest from NPC, if not 0
|
||||
|
||||
@@ -14630,10 +14630,6 @@ bool Player::CanCompleteQuest(uint32 quest_id)
|
||||
if (repFacId && GetReputationMgr().GetReputation(repFacId) < qInfo->GetRepObjectiveValue())
|
||||
return false;
|
||||
|
||||
uint32 repFacId2 = qInfo->GetRepObjectiveFaction2();
|
||||
if (repFacId2 && GetReputationMgr().GetReputation(repFacId2) < qInfo->GetRepObjectiveValue2())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -15266,6 +15262,16 @@ bool Player::SatisfyQuestReputation(Quest const* qInfo, bool msg)
|
||||
SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ);
|
||||
return false;
|
||||
}
|
||||
|
||||
// ReputationObjective2 does not seem to be an objective requirement but a requirement
|
||||
// to be able to accept the quest
|
||||
uint32 fIdObj = qInfo->GetRepObjectiveFaction2();
|
||||
if (fIdObj && GetReputationMgr().GetReputation(fIdObj) >= qInfo->GetRepObjectiveValue2())
|
||||
{
|
||||
if (msg)
|
||||
SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3931,28 +3931,28 @@ void ObjectMgr::LoadQuests()
|
||||
// no changes, quest can't be done for this requirement
|
||||
}
|
||||
|
||||
if (!qinfo->RepObjectiveFaction && qinfo->RepObjectiveValue > 0)
|
||||
if (!qinfo->RepObjectiveFaction && qinfo->RepObjectiveValue != 0)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RepObjectiveValue` = %d but `RepObjectiveFaction` is 0, value has no effect",
|
||||
qinfo->GetQuestId(), qinfo->RepObjectiveValue);
|
||||
// warning
|
||||
}
|
||||
|
||||
if (!qinfo->RepObjectiveFaction2 && qinfo->RepObjectiveValue2 > 0)
|
||||
if (!qinfo->RepObjectiveFaction2 && qinfo->RepObjectiveValue2 != 0)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RepObjectiveValue2` = %d but `RepObjectiveFaction2` is 0, value has no effect",
|
||||
qinfo->GetQuestId(), qinfo->RepObjectiveValue2);
|
||||
// warning
|
||||
}
|
||||
|
||||
if (!qinfo->RequiredMinRepFaction && qinfo->RequiredMinRepValue > 0)
|
||||
if (!qinfo->RequiredMinRepFaction && qinfo->RequiredMinRepValue != 0)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RequiredMinRepValue` = %d but `RequiredMinRepFaction` is 0, value has no effect",
|
||||
qinfo->GetQuestId(), qinfo->RequiredMinRepValue);
|
||||
// warning
|
||||
}
|
||||
|
||||
if (!qinfo->RequiredMaxRepFaction && qinfo->RequiredMaxRepValue > 0)
|
||||
if (!qinfo->RequiredMaxRepFaction && qinfo->RequiredMaxRepValue != 0)
|
||||
{
|
||||
sLog->outErrorDb("Quest %u has `RequiredMaxRepValue` = %d but `RequiredMaxRepFaction` is 0, value has no effect",
|
||||
qinfo->GetQuestId(), qinfo->RequiredMaxRepValue);
|
||||
|
||||
@@ -2335,7 +2335,7 @@ void Spell::SelectEffectTargets(uint32 i, SpellImplicitTargetInfo const& cur)
|
||||
}
|
||||
else
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SPELL: unknown target coordinates for spell ID %u", m_spellInfo->Id);
|
||||
sLog->outError("SPELL: unknown target coordinates for spell ID %u", m_spellInfo->Id);
|
||||
Unit* target = NULL;
|
||||
if (uint64 guid = m_caster->GetUInt64Value(UNIT_FIELD_TARGET))
|
||||
target = ObjectAccessor::GetUnit(*m_caster, guid);
|
||||
|
||||
Reference in New Issue
Block a user