From 79f9433dfad274f3b73272bda2a6fd11ae673194 Mon Sep 17 00:00:00 2001 From: E Spause Date: Mon, 13 Mar 2017 06:26:48 -0400 Subject: [PATCH] Merc logic fix for heal spells - allows mercs to select fast healing spells as a 'standard' healing spell & new rule for unsuspend --- common/ruletypes.h | 1 + common/spdat.cpp | 2 +- zone/merc.cpp | 11 ++++++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/common/ruletypes.h b/common/ruletypes.h index d0e2ff2be..7e461071f 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -163,6 +163,7 @@ RULE_INT(Mercs, AggroRadius, 100) // Determines the distance from which a merc RULE_INT(Mercs, AggroRadiusPuller, 25) // Determines the distance from which a merc will aggro group member's target, if they have the group role of puller (also used to determine the distance at which a healer merc will begin healing a group member, if they have the group role of puller) RULE_INT(Mercs, ResurrectRadius, 50) // Determines the distance from which a healer merc will attempt to resurrect a group member's corpse RULE_INT(Mercs, ScaleRate, 100) +RULE_BOOL(Mercs, AllowMercSuspendInCombat, true) RULE_CATEGORY_END() RULE_CATEGORY(Guild) diff --git a/common/spdat.cpp b/common/spdat.cpp index fd4e3c5ea..e88240ef9 100644 --- a/common/spdat.cpp +++ b/common/spdat.cpp @@ -940,7 +940,7 @@ bool IsRegularSingleTargetHealSpell(uint16 spell_id) { if(spells[spell_id].effectid[0] == 0 && spells[spell_id].base[0] > 0 && spells[spell_id].targettype == ST_Target && spells[spell_id].buffduration == 0 && - !IsFastHealSpell(spell_id) && !IsCompleteHealSpell(spell_id) && + !IsCompleteHealSpell(spell_id) && !IsHealOverTimeSpell(spell_id) && !IsGroupSpell(spell_id)) return true; diff --git a/zone/merc.cpp b/zone/merc.cpp index 3e3dfae93..8196d2ba2 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -5468,7 +5468,7 @@ void Client::SuspendMercCommand() { Merc* merc = Merc::LoadMerc(this, &zone->merc_templates[GetMercInfo().MercTemplateID], 0, true); if(merc) { - SpawnMerc(merc, true); + SpawnMerc(merc, false); Log.Out(Logs::General, Logs::Mercenaries, "SuspendMercCommand Successful Unsuspend for %s.", GetName()); } else @@ -5482,6 +5482,15 @@ void Client::SuspendMercCommand() { { Merc* CurrentMerc = GetMerc(); + + if (!RuleB(Mercs, AllowMercSuspendInCombat)) + { + if (!CheckCanSpawnMerc(GetMercInfo().MercTemplateID)) + { + return; + } + } + if(CurrentMerc && GetMercID()) { CurrentMerc->Suspend();