From cd9f84aae50e9d05bb432a42629965e5eff9222f Mon Sep 17 00:00:00 2001 From: n0n4m3 Date: Sat, 26 Dec 2009 09:43:39 +0100 Subject: Implement expected combat stop with friendly faction. by VladimirMangos --HG-- branch : trunk --- src/game/SpellAuras.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/game/SpellAuras.cpp') diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index faa8c3407dc..f3352d015a2 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -3925,10 +3925,14 @@ void AuraEffect::HandleForceReaction(bool apply, bool Real, bool changeAmount) Player* player = (Player*)m_target; uint32 faction_id = GetMiscValue(); - uint32 faction_rank = m_amount; + ReputationRank faction_rank = ReputationRank(m_amount); - player->GetReputationMgr().ApplyForceReaction(faction_id,ReputationRank(faction_rank),apply); + player->GetReputationMgr().ApplyForceReaction(faction_id,faction_rank,apply); player->GetReputationMgr().SendForceReactions(); + + // stop fighting if at apply forced rank friendly or at remove real rank friendly + if (apply && faction_rank >= REP_FRIENDLY || !apply && player->GetReputationRank(faction_id) >= REP_FRIENDLY) + player->StopAttackFaction(faction_id); } void AuraEffect::HandleAuraModSkill(bool apply, bool Real, bool /*changeAmount*/) -- cgit v1.2.3