Senior Member
Join Date: Oct 2016
Posts: 621
|
I need to code a for each loop on my ability (I think) that checks the character for melee weapons and assigns their Wis Bonus as an untyped bonus to attack if the ability is active, while restricting the attack to once a round. I know I need to look at;
foreach pick in hero from BaseWep where "wCategory.Melee" and have it assign; hero.child[Attack].field[Bonus].value += hero.child[aWIS].field[aModBonus].value To each pick But I don't know the script wording to do that, I know the code to disable it when not active but I don't know at all how to restrict the maneuver to once a round. Any help greatly appreciated |
#1 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
Can you post the ability text?
|
#2 |
Senior Member
Join Date: Oct 2016
Posts: 621
|
Harrowing Strike (Su):
As a standard action, the malefactor can spend a point of strife to make a special attack called a harrowing strike. This melee attack, made at her highest attack bonus, functions against any target currently suffering from a curse effect. At 2nd level, the malefactor making a harrowing strike adds her Wisdom bonus to attack rolls. |
#3 |
Senior Member
Join Date: Oct 2016
Posts: 621
|
Actually there is more to it, I think I need to bootstrap a number of abilities to one activation as the rest of the text is;
At 5th level, the malefactor can add her Wisdom bonus to both her damage rolls. At 8th level, the malefactor automatically bypasses concealment with her harrowing strike (targets with total concealment are treated as if they only had concealment). At 11th level, a malefactor’s harrowing strike deal 1d6 bleed damage, as a semi-tangible Yla spirit claws and tears at the target. At 14th level, the malefactor may make a second harrowing strike as part of the same standard action, against any eligible target. Both harrowing strike this round are made at a -2 penalty. At 17th level, the malefactor’s harrowing strike are made as touch attacks. At 20th level, harrowing strike deal 2d6 bleed damage, and the DC of the Heal check made to stop the bleed effect rises to 10 + ˝ the malefactor’s level + her Wisdom bonus. Magical healing only stops this bleed damage with a successful caster level check against the same DC. Your guidance on this is appreciated |
#4 |
Senior Member
Join Date: Oct 2016
Posts: 621
|
So basically what I am trying to do with the ability is
Check for activated, get malefactor level, check for melee weapon/natural weapon/unarmed (I don't know if those would need to be checked for separately or if natural/unarmed are, by default, melee) If level >=2, apply Wis to Attack If level >=5, apply Wis to damage + above If level >=8, apply conditional text? + above 2 If level >=11, add 1d6 bleed damage + all of the above If level >=14, add additional attack, add penalty to both attacks and all of the above If level >=17, make all melee attacks into touch attacks + all of the above If level >=20, increase bleed to 2d6 and add text to set DC to remove at 20+Wis Mod plus all of the above If I want all of this under one activationI am going to have to do it as one ability am I not? |
#5 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
Quote:
Store this in another value field. No, I don't think this is something which needs conditional text. You can do this with an extradam macro, storing the number in another value field (which increases at 20) Quote:
Quote:
Quote:
Quote:
PostAttr 10000 Code:
~Add the standard stops for class abilities doneif (tagis[Helper.ShowSpec] = 0) doneif (tagis[Helper.SpcDisable] <> 0) ~Calculate our various values ~abValue stores bonus to attack field[abValue].value += #attrbonus[aWIS] ~abValue2 stores bonus to damage if (field[xAllLev].value >= 2) then field[abValue2].value += #attrbonus[aWIS] endif ~abValue3 stores number of bleed dice if (field[xAllLev].value >= 20) then field[abValue3].value += 2 elseif (field[xAllLev].value >= 11) then field[abValue3].value += 1 endif ~abValue4 stores size of bleed dice field[abValue4].value += 6 ~At 20th, we get a DC if (field[xAllLev].value >= 20) then perform assign[StandardDC.aWIS] endif ~Add a stop for the activation. doneif (field[abilActive].value = 0) foreach pick in hero from AttDam where "wCategory.Melee" ~Apply melee attack eachpick.field[atmBonus].value += field[abValue].value ~Apply melee damage eachpick.field[dmmBonus].value += field[abValue2].value ~Apply bleed (if we were high enough level to have set a number of dice if (field[abValue3].value >= 1) then #extradamage[eachpick, " plus " & field[abValue3].value & "d" & field[abValue4].value & " bleed",field[thingname].text] endif ~Apply touch if higher than 17th level. if (field[xAllLev].value >= 17) then perform eachpick.assign[wCategory.Touch] endif nexteach The above is not tested, tweak as necessary. Last edited by Aaron; February 7th, 2018 at 03:30 PM. Reason: Adding disclaimer |
|||||
#6 |
Senior Member
Join Date: Oct 2016
Posts: 621
|
|
#7 |
Senior Member
Join Date: Oct 2016
Posts: 621
|
Ok, I don't know what I have done, but when I switch to the class tab, I get the following error;
Attempt to access non-live pick via script fails for pick 'cMALHarStr' Location: 'additem' script for Portal 'ClsBaseCom' near line 2 - - - Attempt to access 'focus' pick or thing from script when no focus exists Location: 'additem' script for Portal 'ClsBaseCom' near line 4 cMALHarStr is the new ability |
#8 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
Quote:
|
|
#9 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
Quote:
Let me look around the processes for generating attack bonuses in case there is a tag or something I forgot about which might make this easier. |
|
#10 |
|
|