TrinityCore/TrinityCore — Issue #3770: [Spell] Prayer of Mending not smart-healing
Author: loneguardian
Created: 2011-11-01 12:57:04+00:00
State: open

**Name of bug**
Prayer of Mending doesn't smart heal

**Links**
http://old.wowhead.com/spell=41635
_the spell id is from SpellMgr.cpp, not sure which one is the correct one_

**Description**
Currently on d3a7ac5d7dad8f3677de8b69d29ffbe36deb51dd

in Unit.cpp

``` if (Unit* target = GetNextRandomRaidMemberOrPet(radius))
{
CastCustomSpell(target, spellProto->Id, &heal, NULL, NULL, true, NULL, triggeredByAura, caster_guid);
if (Aura* aura = target->GetAura(spellProto->Id, caster->GetGUID()))
aura->SetCharges(jumps);
}
```

Despite the bugged nature of reactive heals (they doesn't heal the damage which procs the heal, resulting in a lot of overhealing), Prayer of Mending jumps around randomly instead of being a smart heal.

**How it should work**
It should behave like a smart heal, jumping to those who needs it the most instead of randomly jumping around. Maybe implementing the same targetting as Chain Heal?

According to http://spotheal.wordpress.com/2009/11/10/prayer-of-mending-use-it-more/
> It seems to prefer targets in this order:
>
> 1. Biggest Health Deficit
> 2. Lowest total health

According to http://www.tankspot.com/showthread.php?73859-Efficiency-Prayer-of-Mending-Bouncing
> PoM is a smart heal meaning it will jump to anyone in range that has the lowest health, I find that in situations where everyone is full **it tends to jump from the tank back to my self** which is handy because I can use shadow ward death to force it to jump again.

*not confirmed, doesn't seem to read it on anywhere else regarding the bolded part*