mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 16:51:29 +00:00
[Bug Fix (faction)] Do not award faction if NPC is charmed. (#1945)
* Do not award faction if npc is charmed. * No faction on kill of charmed mob or questreward of same
This commit is contained in:
parent
b9722c6d28
commit
e850d80656
@ -2411,7 +2411,7 @@ bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, EQ::skills::SkillTy
|
||||
give_exp_client = give_exp->CastToClient();
|
||||
|
||||
//do faction hits even if we are a merchant, so long as a player killed us
|
||||
if (give_exp_client && !RuleB(NPC, EnableMeritBasedFaction))
|
||||
if (!IsCharmed() && give_exp_client && !RuleB(NPC, EnableMeritBasedFaction))
|
||||
hate_list.DoFactionHits(GetNPCFactionID());
|
||||
|
||||
bool IsLdonTreasure = (this->GetClass() == LDON_TREASURE);
|
||||
|
||||
@ -8678,7 +8678,7 @@ void Client::QuestReward(Mob* target, uint32 copper, uint32 silver, uint32 gold,
|
||||
|
||||
if (faction)
|
||||
{
|
||||
if (target && target->IsNPC())
|
||||
if (target && target->IsNPC() && !target->IsCharmed())
|
||||
{
|
||||
int32 nfl_id = target->CastToNPC()->GetNPCFactionID();
|
||||
SetFactionLevel(CharacterID(), nfl_id, GetBaseClass(), GetBaseRace(), GetDeity(), true);
|
||||
@ -8714,7 +8714,7 @@ void Client::QuestReward(Mob* target, const QuestReward_Struct &reward, bool fac
|
||||
|
||||
if (faction)
|
||||
{
|
||||
if (target && target->IsNPC())
|
||||
if (target && target->IsNPC() && !target->IsCharmed())
|
||||
{
|
||||
int32 nfl_id = target->CastToNPC()->GetNPCFactionID();
|
||||
SetFactionLevel(CharacterID(), nfl_id, GetBaseClass(), GetBaseRace(), GetDeity(), true);
|
||||
|
||||
@ -1353,7 +1353,8 @@ void QuestManager::save() {
|
||||
|
||||
void QuestManager::faction(int faction_id, int faction_value, int temp) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
if (initiator && initiator->IsClient()) {
|
||||
running_quest run = quests_running_.top();
|
||||
if(run.owner->IsCharmed() == false && initiator && initiator->IsClient()) {
|
||||
if(faction_id != 0 && faction_value != 0) {
|
||||
initiator->SetFactionLevel2(
|
||||
initiator->CharacterID(),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user