From e1adffc4befb0bfb2d68ff62370f1310498119be Mon Sep 17 00:00:00 2001 From: Paul Coene Date: Wed, 5 Feb 2020 15:32:07 -0500 Subject: [PATCH 1/4] Update npc.cpp --- zone/npc.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/zone/npc.cpp b/zone/npc.cpp index ed5f37bb5..e88ce4b89 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -778,7 +778,15 @@ bool NPC::Process() } if (GetMana() < GetMaxMana()) { - SetMana(GetMana() + mana_regen + npc_sitting_regen_bonus); + int32 npc_idle_mana_regen_bonus = 2; + uint16 meditate_skill = GetSkill(EQEmu::skills::SkillMeditate); + if (!IsEngaged() && meditate_skill > 0) { + uint8 clevel = GetLevel(); + npc_idle_mana_regen_bonus = + (((meditate_skill / 10) + + (clevel - (clevel / 4))) / 4) + 4; + } + SetMana(GetMana() + mana_regen + npc_idle_mana_regen_bonus); } SendHPUpdate(); @@ -3195,4 +3203,4 @@ void NPC::AIYellForHelp(Mob *sender, Mob *attacker) } } -} \ No newline at end of file +} From e19db3b7f4af69ee3ce39a193401fcca63b72ca2 Mon Sep 17 00:00:00 2001 From: Paul Coene Date: Wed, 5 Feb 2020 16:25:24 -0500 Subject: [PATCH 2/4] Update npc.cpp --- zone/npc.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/zone/npc.cpp b/zone/npc.cpp index e88ce4b89..006302126 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -778,17 +778,22 @@ bool NPC::Process() } if (GetMana() < GetMaxMana()) { - int32 npc_idle_mana_regen_bonus = 2; - uint16 meditate_skill = GetSkill(EQEmu::skills::SkillMeditate); - if (!IsEngaged() && meditate_skill > 0) { - uint8 clevel = GetLevel(); - npc_idle_mana_regen_bonus = - (((meditate_skill / 10) + - (clevel - (clevel / 4))) / 4) + 4; + if (RuleB(NPC, UseMeditateBasedManaRegen)) { + int32 npc_idle_mana_regen_bonus = 2; + uint16 meditate_skill = GetSkill(EQEmu::skills::SkillMeditate); + if (!IsEngaged() && meditate_skill > 0) { + uint8 clevel = GetLevel(); + npc_idle_mana_regen_bonus = + (((meditate_skill / 10) + + (clevel - (clevel / 4))) / 4) + 4; + } + SetMana(GetMana() + mana_regen + npc_idle_mana_regen_bonus); + } + else { + SetMana(GetMana() + mana_regen + npc_sitting_regen_bonus); } - SetMana(GetMana() + mana_regen + npc_idle_mana_regen_bonus); } - + SendHPUpdate(); if (zone->adv_data && !p_depop) { From 8dacadb4f9de2928c32b9bf882458a0d9a72d414 Mon Sep 17 00:00:00 2001 From: Paul Coene Date: Wed, 5 Feb 2020 16:26:46 -0500 Subject: [PATCH 3/4] Update ruletypes.h --- common/ruletypes.h | 1 + 1 file changed, 1 insertion(+) diff --git a/common/ruletypes.h b/common/ruletypes.h index 28231c32e..8e5793bc3 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -526,6 +526,7 @@ RULE_INT(NPC, NPCGatePercent, 20, "% at which the NPC Will attempt to gate at") RULE_BOOL(NPC, NPCGateNearBind, false, "Will NPC attempt to gate when near bind location?") RULE_INT(NPC, NPCGateDistanceBind, 75, "Distance from bind before NPC will attempt to gate") RULE_BOOL(NPC, NPCHealOnGate, true, "Will the NPC Heal on Gate") +RULE_BOOL(NPC, UseMeditateBasedManaRegen, false, "Based NPC ooc regen on Meditate skill") RULE_REAL(NPC, NPCHealOnGateAmount, 25, "How much the npc will heal on gate if enabled") RULE_CATEGORY_END() From 1528e7cb09e8635603b4f3441334b85cf8531033 Mon Sep 17 00:00:00 2001 From: Paul Coene Date: Wed, 5 Feb 2020 16:28:07 -0500 Subject: [PATCH 4/4] Update npc.cpp --- zone/npc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/npc.cpp b/zone/npc.cpp index 006302126..96efc83a8 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -793,7 +793,7 @@ bool NPC::Process() SetMana(GetMana() + mana_regen + npc_sitting_regen_bonus); } } - + SendHPUpdate(); if (zone->adv_data && !p_depop) {