your are on the right track, yes lay on hands has a daily useage limit of 1 use per healing (on yourself or others) and
channel energy uses up 2 daily uses of lay on hands (easy to follow?)
now the code i have for this is as follows
*note these scripts were not created by me*
in the Getting Feat tab of Editing the feat
L = cr.GetClassLevel("Pal")
notimes = (int(l/2))+cr.ChaMod
cr.SetVariable "LoH", notimes
dim myatt
dim lohatt
for i=0 to cr.NoAttacks-1
set myatt = cr.Attack(i)
if instr(myatt.Name,"Lay on Hands") > 0 then
set lohatt = cr.Attack(i)
end if
next
if func.ValidAt(lohatt)=FALSE then
set lohatt = cr.MakeNewAttack()
lohatt.Name = "Lay on Hands"
else
end if
lohatt.Category = 1
lohatt.DamageType= "S,P,B,magic, good, silver,cold iron, admantine"
lohatt.DamageStr=(cstr(int(l/2)) & "d6")
lohatt.noDice=int(l/2)
lohatt.Dice = 6
lohatt.Touch = True
calcqty
in the removing feat tab
cr.RemoveVariable("LoH")
in the using feat tab
qty = func.cvint(cr.GetVariable("LoH"))
func.AddToCombatLog("uses left = " & qty)
if qty <= 0 then
func.AddtoCombatLog cr.Name & " has no more uses of Lay on Hands."
exit sub
end if
'Now choose a PC (friendly) in the current group to heal
dim OtherCr, OtherName, DamageHad
set OtherCR = func.ChooseCreature("Select which creature to heal using Lay on Hands", 0, TRUE, True)
if OtherCr is nothing then
OtherName = "(No PC selected)"
end if
dice = cstr(int(cr.GetClassLevel("pal")/2)) & "d6"
if cr.HasFeatName("Greater Mercy") then
l=msgbox("Are you using a mercy",4)
if l=7 then dice = cstr(int(cr.GetClassLevel("pal")/2)+1) & "d6"
end if
roll = func.RollDice(dice)
total = inputbox("Please roll " & dice & " for the amount of healing","Healing Roll",roll)
Othercr.HP=othercr.HP+total
if othercr.hp>othercr.HPBase then othercr.HP=othercr.HPBase
qty=qty-1
func.AddToCombatLog(othercr.Name & " has been healed to " & othercr.hp & "." & cr.Name & " has " & qty & " uses of lay on
hand left for today")
mercy = cr.GetVariable("mercy")
func.AddToCombatLog(othercr.Name & "is also cured of the following effects:" & mercy)
cr.SetVariable "LoH", qty
In the Rest tab
calcqty
in the Other tab
sub calcqty()
s = cr.GetVariable("ExtraSmiting")
M = len(s)
ES = M * 2
L = cr.GetClassLevel("Pal")
notimes = (int(l/2))+cr.ChaMod+ES
cr.SetVariable "LoH", notimes
if Hours = 0 then func.AddtoCombatLog cr.Name & "'s lay onhand uses is reset."
end sub
Now for Channeling Positive Energy
in the getting feat tab
func.AddToCombatLog("\cf2 \b1" & cr.Name & " \b0 \cf0 has been assigned the Channel Positive Energy feat")
PalLvl = cr.GetClassLevel("Pal")
If PalLvl < 4 then
func.AddToCombatLog("Paladin must be \cf1 4th level \cf0 to Channel Positive Energy.")
end if
in the removing feat tab
func.AddToCombatLog("The Channel Positive Energy feat has been removed from \cf2 \b1" & cr.Name & "\b0 \cf0 .")
cr.RemoveVariable("Channel Energy")
in the using feat tab
'Created by Jdeleski
'Design Point: - If a creature is already dead, then the selection menus will not show that creature,
' either for healing or for damaging (undead).
' - If a living creature is already at full HP, then it will not show on the healing
' selection menu
' - The character can only channel energy once on a specific creature per round, therefore
' If the user has already healed a specific creature or damaged a specific undead,
' then the "CURE ALL" or "DAMAGE ALL" options will not be available.
' - Nonlethal damage is cured AFTER all lethal damage has been
'
'Version 2.3 - Streamlined menus a bit
' - Added test and combat log output for paladins < level 3
'Version 2.2 - Added Will Save to channeled damage
'Version 2.1 - Streamlined code to eliminate forcing DMGenie user to select "Done" or "Cancel"
' after healing or damaging the last creature on the list; selecting that last creature
' on the list now automatically ends the ChanPosEnergy process.
' - Fixed bug that didn't let character select undead between 0 hp and -10 hp
' - Fixed bug that didn't heal living creatures if Con = 0 (e.g. automatons)
'Version 2.0 - Large update; too many changes to list. Improved logic to add "smarts" that
' streamline the user's input sequences, added options, fixed bugs, etc.
'Version 1.0 - Created by Jdeleski
'
'BOOLEAN VARIABLES:
' CharBoolean = Tracks whether a valid creature is available to be healed
' UndeadCharBoolean = Tracks whether a valid undead creature is available to damage
' CancelChannelEnergy = Tracks whether user cancelled out of entering data
' CharHealed = Tracks whether any characters have been healed this round
' UndeadDamaged = Tracks whether any undead have been damaged this round
' RemoveAllOption = Tracks if any creature has already been selected individually for healing or
' damage, in which case the "Cure All" or "Damage All" option should vanish
'
'*************** Calculate DC for the cleric's channel energy feature
PalLvl = cr.GetClassLevel("Pal")
ChanEnergyDC = 10 + int(PalLvl/2) + cr.ChaMod
func.AddToCombatLog("-----------------------------------------------------------")
func.AddToCombatLog("\b1 CHANNEL POSITIVE ENERGY Feature\b0")
CharHealed = FALSE
CharDamaged = FALSE
CancelChannelEnergy = FALSE
RemoveAllOption = FALSE
if PalLvl < 4 then
qty = 0
choice = "CANCEL"
UndeadCharBoolean = FALSE
func.AddToCombatLog("Paladin must be \cf1 4th level \cf0 to use this feat.")
else
qty = int(func.cvint(cr.GetVariable("LoH"))/2)
end if
if qty <= 0 then
func.AddtoCombatLog("\cf2 \b1" & cr.Name & " \b0 \cf0 \cf1 has no uses of Channel Energy available. \cf0")
func.AddToCombatLog("-----------------------------------------------------------")
exit sub
end if
dice = cstr(int((cr.GetClassLevel("pal")/2) + 0.5)) & "d6"
roll = func.RollDice(dice)
'*****************************************************************************************
'****************** Test to see what creatures need healing/damage *******************
'*****************************************************************************************
UndeadCharBoolean = False 'Boolean variable to track whether a valid undead is available to be damaged
CharBoolean = False
i = 0
func.GetNextCreatureInit 2 'Set GetNextCreature function to Current Encounter
set target = func.GetNextCreature
While (Not target Is Nothing) 'loop until end of list of creatures
if (target.creaturetype = "Undead") OR (target.creaturetype = "undead") then
if (target.Hp > -10) then 'if creature is not dead, then proceed with killing it!
UndeadCharBoolean = True 'Set flag that DMGenie has identified a valid undead creature
end if
else if (target.hp < target.HPBase) OR (target.subdual > 0) then 'else if target not undead and needs healing
CharBoolean = True 'Set flag that DMGenie has identified a valid living creature to heal
end if
end if
' i = i + 1
set target = func.GetNextCreature
Wend
if UndeadCharBoolean = TRUE then 'If there are undead alive in this enounter
if CharBoolean = TRUE then 'If there are undead AND there are living creatures that need healing
choice = func.ChooseString("Please choose whether to heal or damage creatures: "," Heal Creatures"," Damage Undead")
if choice = -1 then 'User cancelled out of Channel Energy process
CancelChannelEnergy = TRUE
end if
else choice = " Damage Undead" 'if there are valid undead to damage AND no living creatures
end if
else 'if no undead
if CharBoolean = TRUE then 'If there are no undead but there are living creatures that need healing
choice = " Heal Creatures"
else
func.AddToCombatLog("\cf1 There are no living creatures to heal and no undead to damage in this encounter. \cf0")
choice = "CANCEL"
end if
end if
if choice = " Heal Creatures" then
'***********************************************************************************************
'************************************** Healing Process *************************************
'***********************************************************************************************
'*** Create list of characters to heal, then ask user to select each, one by one ***************************
If CancelChannelEnergy = FALSE then
ChannelCharChooseStr = "CharNum = func.Choose(""Select creature(s) to heal. REMEMBER: This feat heals ALL living
creatures within 30 ft, not just friendlies. """
CharBoolean = False 'Boolean variable to track whether a valid creature is available to be healed
i = 0
func.GetNextCreatureInit 2 'Set GetNextCreature function to Current Encounter
set target = func.GetNextCreature
While (Not target Is Nothing) 'Initialize string
If target.CreatureType <> "Undead" then 'if creature is NOT an Undead
if (target.HP > -target.Con) OR ((Target.con = 0) AND (target.HP > -10)) then 'if creature is not dead
if (target.HP < target.HPBase) OR (Target.subdual > 0) then 'if creature needs healing
CharBoolean = True 'There is a valid creature to heal
ChannelCharChooseStr = func.Append((ChannelCharChooseStr), ("""" & target.Name & """"))
ChannelCharChooseStr = func.Append((ChannelCharChooseStr), ("" & i & ""))
end if
end if
end if
i = i + 1
set target = func.GetNextCreature
Wend
LastCreature = i - 1 'Remember string # for the last creature
ChannelCharChooseStr = func.Append((ChannelCharChooseStr), ("""" & " CURE ALL FRIENDS ONLY" & """"))
ChannelCharChooseStr = func.Append((ChannelCharChooseStr), ("" & i & ""))
CureAllFriends = i 'Remember string # for "CURE ALL FRIENDS"
i = i + 1
ChannelCharChooseStr = func.Append((ChannelCharChooseStr), ("""" & " DONE WITH CHANNELING" & """"))
ChannelCharChooseStr = func.Append((ChannelCharChooseStr), ("" & i & ""))
DONE = i 'Remember string # for "DONE"
ChannelCharChooseStrInit = ChannelCharChooseStrInit & ")" 'Done initializing string
ChannelCharChooseStr = ChannelCharChooseStr & ")" 'Done initializing string
CharNum = -1
While (CharNum <> DONE) 'Loop while user has not selected DONE
If CharBoolean = True then 'There are valid creatures in the current encounter
if RemoveAllOption = TRUE then 'If any creature has been healed, then remove "Cure All" option
StringToRemove = func.Append((StringToRemove), (""" CURE ALL FRIENDS ONLY"""))
StringToRemove = func.Append((StringToRemove), ("" & CureAllFriends & ""))
ChannelCharChooseStr = func.remove((ChannelCharChooseStr), (StringToRemove))
StringToRemove = "" 'Reset string
end if
Execute(ChannelCharChooseStr) 'Get creature to heal
if CharNum = -1 then 'Cancelled out of creature selection
CancelChannelEnergy = TRUE
CharNum = DONE
else
If CharNum <> DONE then
If CharNum = CureAllFriends then
' ***CURE ALL FRIENDS LOOP
if (CharHealed = FALSE) then 'if no character healed yet
roll = func.RollDice(dice)
total = inputbox("Please roll " & dice & " for amt of channeled HEALING per creature this
round.","Healing Roll",roll)
if (total = "") then
func.AddToCombatLog("\cf1 Die roll cancelled. \cf0")
CancelChannelEnergy = TRUE
end if
end if 'end loop to get HP healed
func.GetNextCreatureInit 2 'Reset GetNextCreature function to Current Encounter
CharNum = 0
While (CharNum < LastCreature) OR (CharNum = LastCreature)
set target = func.GetNextCreature
If target.enemy = FALSE then 'if creature is a friend
if (target.HP > -target.Con) OR ((Target.con = 0) AND (target.HP > -10)) then 'if creature is not
dead
if (target.HP < target.HPBase) OR (Target.subdual > 0)then 'if creature is not already at full
HP
RemainHealNum = 0 'initialize extra healing counter
NonlethalHealed = 0 'initialize nonlethal healing counter
target.HP = target.HP + total
' *** The following calculations check for lethal vs. nonlethal dmg
DamageHad = target.HPBase - target.HP 'Calc amt of dmg already on target
Basehealed = total 'Assume base healed is = to max of heal spell
if target.HP > target.HPBase then 'if target has less damage than the cure provides
target.HP = target.HPBase
RemainHealNum = total - DamageHad 'Any extra healing to apply to nonlethal?
Basehealed = DamageHad 'track damage that creature initially had
if RemainHealNum > 0 then 'if extra healing available for nonlethal
Nonlethalhealed = RemainHealNum
target.subdual = target.subdual - RemainHealNum
if target.subdual < 0 then 'if healing exceeds subdual dmg
Nonlethalhealed = nonlethalhealed + target.subdual
target.subdual = 0
end if
end if
end if
CharHealed = TRUE
if NonLethalHealed = 0 then
if Target.hp = Target.hpbase then
func.AddToCombatLog("\b1" & target.Name & " \b0 is healed to " & target.hp & " max
HP.")
else
func.AddToCombatLog("\b1" & target.Name & " \b0 is healed to " & target.hp & " HP.")
end if
else 'if there was nonlethal dmg healed
func.AddToCombatLog("\b1" & target.Name & " \b0 is healed to " & target.hp & " max HP +
cured of " & NonLethalHealed & " HP of nonlethal dmg.")
end if
end if
end if
end if
CharNum = CharNum + 1
Wend
if CharHealed = FALSE then
func.AddToCombatLog("\cf1 No characters required healing. \cf0")
end if
CharNum = DONE
else 'If not curing all friends
' *** SELECT SPECIFIC LIVING CREATURES TO HEAL
func.GetNextCreatureInit 2 'Reset GetNextCreature function to Current Encounter
For i = 0 to CharNum step 1
set target = func.GetNextCreature
next
' Now remove the string for the selected character from the list since they've been healed
i=i-1
StringToRemove = func.Append((StringToRemove), ("""" & target.Name & """"))
StringToRemove = func.Append((StringToRemove), ("" & i & ""))
ChannelCharChooseStr = func.remove((ChannelCharChooseStr), (StringToRemove))
StringToRemove = "" 'Reset string
if (CharHealed = FALSE) then 'if no character healed yet, then get healing total
roll = func.RollDice(dice)
total = inputbox("Please roll " & dice & " for amt of channeled HEALING per creature this
round.","Healing Roll",roll)
if (total = "") then
func.AddToCombatLog("\cf1 Die roll cancelled. \cf0")
CancelChannelEnergy = TRUE
end if
end if
if (target.Hp > -target.Con) OR ((Target.con = 0) AND (target.HP > -10)) then 'if creature is not dead
RemainHealNum = 0 'initialize extra healing counter
NonlethalHealed = 0 'initialize nonlethal healing counter
target.HP = target.HP + total
' *** The following calculations check for lethal vs. nonlethal dmg
DamageHad = target.HPBase - target.HP 'Calc amt of dmg already on target
Basehealed = total 'Assume base healed is = to max of heal spell
if target.HP > target.HPBase then 'if target has less damage than the cure provides
target.HP = target.HPBase
RemainHealNum = total - DamageHad 'Any extra healing to apply to nonlethal?
Basehealed = DamageHad 'track damage that creature initially had
if RemainHealNum > 0 then 'if extra healing available for nonlethal
Nonlethalhealed = RemainHealNum
target.subdual = target.subdual - RemainHealNum
if target.subdual < 0 then 'if healing exceeds subdual dmg
Nonlethalhealed = nonlethalhealed + target.subdual
target.subdual = 0
end if
end if
end if
CharHealed = TRUE
RemoveAllOption = TRUE 'Tell DMGenie to remove the option to heal all friends
if NonLethalHealed = 0 then
if Target.hp = Target.hpbase then
func.AddToCombatLog("\b1" & target.Name & " \b0 is healed to " & target.hp & " max HP.")
else
func.AddToCombatLog("\b1" & target.Name & " \b0 is healed to " & target.hp & " HP.")
end if
else 'if there was nonlethal dmg healed
func.AddToCombatLog("\b1" & target.Name & " \b0 is healed to " & target.hp & " max HP + cured of "
& NonLethalHealed & " HP of nonlethal dmg.")
end if
else func.AddToCombatLog(
target.name & " is already dead, therefore not healed.")
end if 'End of test to see if creature is not dead
end if 'End of Curing all friends loop
end if 'CharNum <> DONE
end if 'CharNum = -1 (cancelled out of selecting a character to heal)
' Test to see if no creatures left to heal
func.GetNextCreatureInit 2 'Initialize GetNextCreature function to Current Encounter
Test = -1
CharBoolean = False
set ValidCreatureTest = func.getNextCreature
While (Not ValidCreatureTest Is Nothing) 'Initialize string
If ValidCreatureTest.CreatureType <> "Undead" then 'if creature is NOT an Undead
Test = InStr(ChannelCharChooseStr,ValidCreatureTest.Name)
' If the character name is not within the command string which selects characters to heal
if (Test > 0) then
CharBoolean = TRUE
end if
end if
set ValidCreatureTest = func.GetNextCreature
Wend
if CharBoolean = FALSE then CharNum = DONE
func.GetNextCreatureInit 2 'Initialize GetNextCreature function to Current Encounter
n = 0
If CharNum <> DONE then
While n < CharNum 'Reset target counter back to previously selected char for next loop
set target = func.GetNextCreature
n = n + 1
Wend
end if
end if 'CharBoolean = TRUE
wend
if (CharHealed = TRUE) then 'If user healed someone
qty = cr.GetVariable("LoH")
qty = qty - 2
cr.SetVariable "LoH", qty
func.AddToCombatLog("\b1 \cf2" & cr.Name & " \cf0 \b0 may ChanPosEnergy \b1 " & int(qty/2) & " \b0 X more before
resting; \b1 " & qty & " \b0 \i1 LayOnHands \i0 left.")
else
if (CancelChannelEnergy = TRUE) AND (CharHealed = FALSE) then
func.AddToCombatLog("\cf1 No creatures selected. \cf0")
end if
end if
else 'CancelChannelEnergy = TRUE
func.AddToCombatLog("\cf1 Cancelled by User. \cf0")
end if 'CancelChannelEnergy = FALSE
'***********************************************************************************************
'********************************** Damage Undead Process ***********************************
'***********************************************************************************************
else if choice = " Damage Undead" then
func.AddToCombatLog("Damn! Damn those undead to hell!")
'*** Create list of undead to damage, then ask user to select each, one by one ***************************
If CancelChannelEnergy = FALSE then
ChannelCharChooseStr = "CharNum = func.Choose(""Select undead creature(s) to damage. """
CharBoolean = False 'Boolean variable to track whether a valid undead is available to be damaged
i = 0
func.GetNextCreatureInit 2 'Set GetNextCreature function to Current Encounter
set target = func.GetNextCreature
While (Not target Is Nothing) 'Initialize string
if (target.creaturetype = "Undead") OR (target.creaturetype = "undead") then
if (target.Hp > -10) then 'if undead creature is not dead, then proceed with killing it!
CharBoolean = True 'DMGenie has identified a valid creature to damage
ChannelCharChooseStr = func.Append((ChannelCharChooseStr), ("""" & target.Name & """"))
ChannelCharChooseStr = func.Append((ChannelCharChooseStr), ("" & i & ""))
end if
end if
i = i + 1
set target = func.GetNextCreature
Wend
if CharBoolean = True then 'If there are undead to damage
LastCreature = i - 1 'Remember string # for the last creature
ChannelCharChooseStr = func.Append((ChannelCharChooseStr), ("""" & " DAMAGE ALL UNDEAD IN THIS ENCOUNTER" &
""""))
ChannelCharChooseStr = func.Append((ChannelCharChooseStr), ("" & i & ""))
DmgAllUndead = i 'Remember string # for "DAMAGE ALL UNDEAD"
i = i + 1
ChannelCharChooseStr = func.Append((ChannelCharChooseStr), ("""" & " DONE WITH CHANNELING" & """"))
ChannelCharChooseStr = func.Append((ChannelCharChooseStr), ("" & i & ""))
DONE = i 'Remember string # for "DONE"
ChannelCharChooseStr = ChannelCharChooseStr & ")" 'Done initializing string
CharNum = -1
While (CharNum <> DONE) 'while the user has not selected "DONE"
if RemoveAllOption = TRUE then 'If any undead has been damaged, then remove "Damage All" option
StringToRemove = func.Append((StringToRemove), (""" DAMAGE ALL UNDEAD IN THIS ENCOUNTER"""))
StringToRemove = func.Append((StringToRemove), ("" & DmgAllUndead & ""))
ChannelCharChooseStr = func.remove((ChannelCharChooseStr), (StringToRemove))
StringToRemove = "" 'Reset string
end if
Execute(ChannelCharChooseStr)
if CharNum = -1 then 'Cancelled out of creature selection
CancelChannelEnergy = TRUE
CharNum = DONE
else
If CharNum <> DONE then
If CharNum = DmgAllUndead then
func.GetNextCreatureInit 2 'Reset GetNextCreature function to Current Encounter
CharNum = 0
While (CharNum < LastCreature) OR (CharNum = LastCreature)
set target = func.GetNextCreature
if (CharDamaged = FALSE) then 'if no character healed yet
roll = func.RollDice(dice)
total = inputbox("Please roll " & dice & " for the amount of channeled DAMAGE","Damage
Roll",roll)
if (total = "") then
func.AddToCombatLog("\cf1 Die roll cancelled. \cf0")
CancelChannelEnergy = TRUE
end if
end if 'end loop to get HP healed
If target.CreatureType = "Undead" then 'if creature is an Undead
if (target.Hp > -10) then 'if creature is not dead
roll = func.RollDice("1d20")
WillSaveTotal = roll + target.WillSave
if WillSaveTotal < ChanEnergyDC then
target.HP = target.HP - total 'apply damage
func.AddToCombatLog("~~\b1" &
target.name & "\b0")
func.AddToCombatLog("Dieroll+WillBonus = " & roll & "+" & target.willsave & " = " &
WillSaveTotal & " vs. DC=" & ChanEnergyDC & ".")
func.AddToCombatLog("Failed. FULL dmg = " & total & "; leaving " & target.hp & " HP.")
else
target.HP = target.HP - int(total/2)
func.AddToCombatLog("~~\b1" &
target.name & "\b0")
func.AddToCombatLog("Dieroll+WillBonus = " & roll & "+" & target.willsave & " = " &
WillSaveTotal & " vs. DC=" & ChanEnergyDC & ".")
func.AddToCombatLog("Success! HALF dmg = " & int(total/2) & "; leaving " & target.hp &
" HP.")
end if
end if
end if
CharNum = CharNum + 1
CharDamaged = TRUE
Wend
' func.AddToCombatLog("\cf2 All Undead in this encounter have been damaged. \cf0 ")
CharNum = DONE
else 'if not damaging all undead
func.GetNextCreatureInit 2 'Reset GetNextCreature function to Current Encounter
For i = 0 to CharNum step 1
set target = func.GetNextCreature
next
' Now remove the string for the selected character from the list since they've been healed
i=i-1
StringToRemove = func.Append((StringToRemove), ("""" & target.Name & """"))
StringToRemove = func.Append((StringToRemove), ("" & i & ""))
ChannelCharChooseStr = func.remove((ChannelCharChooseStr), (StringToRemove))
StringToRemove = "" 'Reset string
if (CharDamaged = FALSE) then 'if no character healed yet
roll = func.RollDice(dice)
total = inputbox("Please roll " & dice & " for the amount of channeled DAMAGE per creature this
round.","Damage Roll",roll)
if (total = "") then
func.AddToCombatLog("\cf1 Die roll cancelled. \cf0")
CancelChannelEnergy = TRUE
end if
end if 'end loop to get HP healed
if (target.Hp > -10) then 'if creature is not dead
roll = func.RollDice("1d20")
WillSaveTotal = roll + target.WillSave
if WillSaveTotal < ChanEnergyDC then
target.HP = target.HP - total 'apply damage
func.AddToCombatLog("~~\b1" &
target.name & "\b0")
func.AddToCombatLog("Dieroll+WillBonus = " & roll & "+" & target.willsave & " = " &
WillSaveTotal & " vs. DC=" & ChanEnergyDC & ".")
func.AddToCombatLog("Failed. FULL dmg = " & total & "; leaving " & target.hp & " HP.")
else
target.HP = target.HP - int(total/2)
func.AddToCombatLog("~~\b1" &
target.name & "\b0")
func.AddToCombatLog("Dieroll+WillBonus = " & roll & "+" & target.willsave & " = " &
WillSaveTotal & " vs. DC=" & ChanEnergyDC & ".")
func.AddToCombatLog("Success! HALF dmg = " & int(total/2) & "; leaving " & target.hp & "
HP.")
end if
CharDamaged = TRUE
RemoveAllOption = TRUE
else func.AddToCombatLog(
target.name & " is already dead, therefore not damaged.")
end if
end if 'Curing all friends
end if 'CharNum <> DONE
end if 'CharNum = -1 (cancelled out of selecting a character to heal)
' Test to see if no creatures left to heal
func.GetNextCreatureInit 2 'Initialize GetNextCreature function to Current Encounter
Test = -1
CharBoolean = False
set ValidCreatureTest = func.getNextCreature 'Initialize string
While (Not ValidCreatureTest Is Nothing)
If ValidCreatureTest.CreatureType = "Undead" then 'if creature is an Undead
Test = InStr(ChannelCharChooseStr,ValidCreatureTest.Name)
' If the undead name is within the command string which selects creatures to damage
if (Test > 0) then
CharBoolean = TRUE
end if
end if
set ValidCreatureTest = func.GetNextCreature
Wend
if CharBoolean = FALSE then CharNum = DONE
func.GetNextCreatureInit 2 'Initialize GetNextCreature function to Current Encounter
n = 0
If CharNum <> DONE then
While n < CharNum 'Reset target counter back to previously selected char for next loop
set target = func.GetNextCreature
n = n + 1
Wend
end if
wend 'End of check to see if done cycling through undead creatures
if (CharDamaged = TRUE) then 'AND (CancelChannelEnergy = FALSE) i.e. If user did not cancel out of entering
any data
qty = cr.GetVariable("LoH")
qty = qty - 2
cr.SetVariable "LoH", qty
func.AddToCombatLog("\b1 \cf2" & cr.Name & " \cf0 \b0 may ChanPosEnergy \b1 " & int(qty/2) & " \b0 X more
before resting; \b1 " & qty & " \b0 \i1 LayOnHands \i0 left.")
else
if (CancelChannelEnergy = TRUE) AND (CharDamaged = FALSE) then
func.AddToCombatLog("\cf1 No creatures selected. \cf0")
end if
end if
else func.AddToCombatLog("There were no Undead in this encounter to damage!")
end if 'CharBoolean = FALSE i.e. there are undead to damage
else func.AddToCombatLog("\cf1 User cancelled channel energy \cf0") 'Die Roll Cancelled
end if 'Die roll loop
else if Choice = "CANCEL" then
func.AddToCombatLog("\cf1 Channel Positive Energy Cancelled. \cf0")
CancelChannelEnergy = TRUE
end if
end if 'Choice = Heal, Damage Undead, CANCEL
end if
If CancelChannelEnergy = FALSE then
func.AddToCombatLog("\b1 Done using Channel Energy. \b0")
end if
func.AddToCombatLog("-----------------------------------------------------------")
in the Stop using feat tab
L = cr.GetClassLevel("Pal")
notimes = (int(l/2))+cr.ChaMod
cr.SetVariable "Channel Energy", notimes
if Hours = 0 then func.AddtoCombatLog cr.Name & "'s Channel Energy uses is reset."
put these in the feat using the edit button and you should have it working