mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-30 05:43:12 +01:00
Core/Quests: Implemented QUEST_OBJECTIVE_FLAG_KILL_PLAYERS_SAME_FACTION
This commit is contained in:
@@ -193,7 +193,7 @@ void KillRewarder::_RewardPlayer(Player* player, bool isDungeon)
|
||||
_RewardHonor(player);
|
||||
// 4.1.1 Send player killcredit for quests with PlayerSlain
|
||||
if (_victim->GetTypeId() == TYPEID_PLAYER)
|
||||
player->KilledPlayerCredit();
|
||||
player->KilledPlayerCredit(_victim->GetGUID());
|
||||
}
|
||||
// Give XP only in PvE or in battlegrounds.
|
||||
// Give reputation and kill credit only in PvE.
|
||||
|
||||
@@ -16804,9 +16804,9 @@ void Player::KilledMonsterCredit(uint32 entry, ObjectGuid guid /*= ObjectGuid::E
|
||||
UpdateQuestObjectiveProgress(QUEST_OBJECTIVE_MONSTER, entry, 1, guid);
|
||||
}
|
||||
|
||||
void Player::KilledPlayerCredit()
|
||||
void Player::KilledPlayerCredit(ObjectGuid victimGuid)
|
||||
{
|
||||
UpdateQuestObjectiveProgress(QUEST_OBJECTIVE_PLAYERKILLS, 0, 1);
|
||||
UpdateQuestObjectiveProgress(QUEST_OBJECTIVE_PLAYERKILLS, 0, 1, victimGuid);
|
||||
}
|
||||
|
||||
void Player::KillCreditGO(uint32 entry, ObjectGuid guid)
|
||||
@@ -16867,6 +16867,11 @@ void Player::UpdateQuestObjectiveProgress(QuestObjectiveType objectiveType, int3
|
||||
bool objectiveIsNowComplete = false;
|
||||
if (objective.IsStoringValue())
|
||||
{
|
||||
if (objectiveType == QUEST_OBJECTIVE_PLAYERKILLS && objective.Flags & QUEST_OBJECTIVE_FLAG_KILL_PLAYERS_SAME_FACTION)
|
||||
if (Player const* victim = ObjectAccessor::GetPlayer(GetMap(), victimGuid))
|
||||
if (victim->GetTeam() != GetTeam())
|
||||
continue;
|
||||
|
||||
int32 currentProgress = GetQuestSlotObjectiveData(logSlot, objective);
|
||||
if (addCount > 0 ? (currentProgress < objective.Amount) : (currentProgress > 0))
|
||||
{
|
||||
|
||||
@@ -1532,7 +1532,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
void ItemRemovedQuestCheck(uint32 entry, uint32 count);
|
||||
void KilledMonster(CreatureTemplate const* cInfo, ObjectGuid guid);
|
||||
void KilledMonsterCredit(uint32 entry, ObjectGuid guid = ObjectGuid::Empty);
|
||||
void KilledPlayerCredit();
|
||||
void KilledPlayerCredit(ObjectGuid victimGuid);
|
||||
void KillCreditGO(uint32 entry, ObjectGuid guid = ObjectGuid::Empty);
|
||||
void TalkedToCreature(uint32 entry, ObjectGuid guid);
|
||||
void KillCreditCriteriaTreeObjective(QuestObjective const& questObjective);
|
||||
|
||||
Reference in New Issue
Block a user