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() diff --git a/zone/npc.cpp b/zone/npc.cpp index ed5f37bb5..96efc83a8 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -778,7 +778,20 @@ bool NPC::Process() } if (GetMana() < GetMaxMana()) { - SetMana(GetMana() + mana_regen + npc_sitting_regen_bonus); + 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); + } } SendHPUpdate(); @@ -3195,4 +3208,4 @@ void NPC::AIYellForHelp(Mob *sender, Mob *attacker) } } -} \ No newline at end of file +}