Rober M. said:
The macro below works correctly now (it now heal a target token and reduce the used points from the character sheet), but it has 2 problems.....
1. Problem. The name of the target (token that recive the healing effect) does not appear in the chat, only appears the healer's name (Paladin's name)
2. Problem. As example, If a token has 30 hp max (28 hp current), and the Paladin heal 4, in the token appears 32 hp (2 above the max limit). It's a bit stupid because my players will choose the exact amount, but in case of macros like Second Wind, that you roll a die may be the case. Any way to limit this to the natural maximum of the token?
3. Problem. I don't know if this is a problem in itself, or an incompatibility between APIs. I have the API of Aura/Tint HealthColor, and when I ejecute the Lay on hands macro with the Paladin, I do not see the green effect of the sparks on the token that receives the healing effect. Normally when i modify the bar 3 (hp) manually i see the red effect when i rest and the green effect when i add.
&{template:atkdmg} {{normal=1}} {{rname=LAY ON HANDS
}} {{attack=1}} {{r1=[[?{Number of points to Heal|@{selected|class_resource}}]]}} {{dmg1flag=1}} {{damage=1}} {{dmg1=[[@{selected|class_resource}-?{Number of points to Heal}]]}} {{dmg1type=points left}} {{desc=You can spend 5 HP's to Cure one Disease, or Neutralize one Poison.
Using ?{Number of points to Heal} points.}} {{charname=@{selected|token_name}}}
!modattr --silent --name @{target|Who is Healed|token_name} --hp|+?{Number of points to Heal}
!modattr --silent --charid @{selected|character_id} --class_resource|-?{Number of points to Heal}
I accidentally didn't make the two @{target|Who is Healed|token_name} exactly the same. One had 'Healed' capitalized and the other had 'healed' uncapitalized, so it should have made you select two targets.
1. You removed the {{mod=on ***@{target|Who is Healed|token_name}***}} from your macro, which is why it isn't showing the name of the token that is healed.
2. Yes it's possible. This will take the number of LoH points selected, and compare it too the target's max HP minus current HP (so the maximum that could be applied to the target), and keeps the lower of the two numbers.
[[{?{Number of points to Heal},[[@{target|Who is Healed|hp|max}-@{target|Who is Healed|hp}]]}kl1]]
3. It's an API communication issue. If you use Token-Mod, then it will still update Aura/Tint HealthColors, so you can switch out the API call for the healing portion to TokenMod instead of ChatSetAttr to get the healing animation to play.
!token-mod --ids @{target|Who is Healed|token_id} --set bar1_value|+[[{?{Number of points to Heal},[[@{target|Who is Healed|hp|max}-@{target|Who is Healed|hp}]]}kl1]]
Here's the full macro without "Using ### points." in the desc field. You probably don't need that, as it's the value in the R1 range section anyways:
!?{Number of points to Heal|@{selected|class_resource}}
!token-mod --ids @{target|Who is Healed|token_id} --set bar1_value|+[[{?{Number of points to Heal},[[@{target|Who is Healed|hp|max}-@{target|Who is Healed|hp}]]}kl1]]
!modattr --silent --name @{selected|token_name} --class_resource|-[[{?{Number of points to Heal},[[@{target|Who is Healed|hp|max}-@{target|Who is Healed|hp}]]}kl1]]
&{template:atkdmg} {{normal=1}} {{mod=on ***@{target|Who is Healed|token_name}***}} {{rname=LAY ON HANDS
}} {{attack=1}} {{r1=[[{?{Number of points to Heal},[[@{target|Who is Healed|hp|max}-@{target|Who is Healed|hp}]]}kl1]]}} {{dmg1flag=1}} {{damage=1}} {{dmg1=[[@{selected|class_resource}-[[{?{Number of points to Heal},[[@{target|Who is Healed|hp|max}-@{target|Who is Healed|hp}]]}kl1]]]]}}{{dmg1type=points left}} {{desc=You can spend 5 HP's to Cure one Disease, or Neutralize one Poison.}} {{charname=@{selected|token_name}}}
Edit: Macro with "Using ### points." in the desc field. For some reason it wasn't working when the Desc section was at the end, but when I moved it earlier in the macro it works for me.
!?{Number of points to Heal|@{selected|class_resource}}
!token-mod --ids @{target|Who is Healed|token_id} --set bar1_value|+[[{?{Number of points to Heal},[[@{target|Who is Healed|hp|max}-@{target|Who is Healed|hp}]]}kl1]]
!modattr --silent --name @{selected|token_name} --class_resource|-[[{?{Number of points to Heal},[[@{target|Who is Healed|hp|max}-@{target|Who is Healed|hp}]]}kl1]]
&{template:atkdmg} {{desc=You can spend 5 HP's to Cure one Disease, or Neutralize one Poison.
Using [[{?{Number of points to Heal},[[@{target|Who is Healed|hp|max}-@{target|Who is Healed|hp}]]}kl1]] points.}} {{charname=@{selected|token_name}}} {{normal=1}} {{mod=on ***@{target|Who is Healed|token_name}***}} {{rname=LAY ON HANDS
}} {{attack=1}} {{r1=[[{?{Number of points to Heal},[[@{target|Who is Healed|hp|max}-@{target|Who is Healed|hp}]]}kl1]]}} {{dmg1flag=1}} {{damage=1}} {{dmg1=[[@{selected|class_resource}-[[{?{Number of points to Heal},[[@{target|Who is Healed|hp|max}-@{target|Who is Healed|hp}]]}kl1]]]]}}{{dmg1type=points left}}
This screencap was taken after after the Life Cleric had 45/50 hp, and the Paladin tried to use 10 of his 20 LoH points:
