Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[PF] Sneak Attack as a buff

1459330601

Edited 1465642137
I'm new to Macros in Roll20, system is Pathfinder and I'm having a hard time figuring out the correct syntax for this task. I want to have a die as bonus damage in my buff slot instead of a fixed number. I tried:  1d6 +1d6 /roll1d6 [[1d6]] [[+1d6]] +[[/roll1d6] [[ @{1d6} ]] +[[ @{1d6} ]] Google gives me generic results, none of them is specifically about adding a damage die as a buff. I'm confused. ******************* UPDATE********************* Thread was auto-closed, in the meantime I found a solution: Add this in the weapon notes: Sneak Attack Damage: [[ [[ ceil([[ @{repeating_buff_$x_buff-enable_toggle} + @{repeating_buff_$y_buff-enable_toggle} + @{repeating_buff_$z_buff-enable_toggle} ]]/3) ]] *nd6 ]] n = insert the number of your character's sneak attack dice x,y, and z obviously represent the buff number associated. I'm using these: X = Flanking Buff (adds +2 to hit) Y = Invisibility Buff (will be used in the Stealth Skill, also gives +2 to hit) Z = Any other cause of sneak attack with no bonuses ingrained (succesful feint, flat-footed, hunter's surprise, whatever) What it does: 1) Uses the "@{repeating_buff_$#_buff-enable_toggle}" function to check if buff # is active (value=1) or not (value=0) 2) Adds together the relevant buffs 3) Divides by 3 This produces 2 possible results:  - 0, because no condition is met  - fraction between 0 and 1, because one or more conditions are met 4) The "ceil()" function always rounds up. Therefore, if it was 0, it stays 0 if it was >0 AND <1, it becomes 1 (note: it cannot be >1 because we divided by 3. If we're using more conditions, adjust the number accordingly) 5) multiplies the result (either 0 or 1) by the number of sneak attack dice In short: As long as at least one condition is met, sneak attack will happen. There, done. Thanks to everybody who posted in this thread. I couldn't do this without your help.
Those fields take numeric values only, but what you can do is use the buff as an on/off toggle for part of your macro. For example : &{template:pf_attack} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} {{name=@{name}}} {{attack=[[ 1d20cs>[[ @{crit-target} ]] + [[ @{total-attack} ]] ]]}} {{damage=[[ @{damage-dice-num}d@{damage-die} + [[ @{total-damage} ]]  + @{repeating_buff_$1_buff-enable_toggle}*5d6 ]]}} {{crit_confirm=[[ 1d20 + [[ @{total-attack} ]] ]]}} {{crit_damage=[[ [[ (@{damage-dice-num} * (@{crit-multiplier} - 1)) ]]d@{damage-die} + [[ (@{total-damage} * (@{crit-multiplier} - 1)) ]] ]]}} {{type=@{type}}} {{description=@{notes}}} @{iterative_attacks} @{macro_options} This is using the standard attack macros that come on the attack page. You can just insert the bolded text into your own macros.
1459378570

Edited 1459378631
chris b.
Pro
Sheet Author
API Scripter
For adding rolls, you either add it to the macro-text for that row, as he shows above, or you can add it to the notes field that is printed to the rolltemplate. like this: Sneak attack (if applicable): [[2d6]] One of my players just adds it to the notes field in the weapon so it always applies and we either ignore it or not depending on if he got a sneak attack. we are considering adding some seperate precision damage fields to use instead of having to edit macros. Just need time to do it.
Sam M. said: Those fields take numeric values only, but what you can do is use the buff as an on/off toggle for part of your macro. For example : &{template:pf_attack} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} {{name=@{name}}} {{attack=[[ 1d20cs>[[ @{crit-target} ]] + [[ @{total-attack} ]] ]]}} {{damage=[[ @{damage-dice-num}d@{damage-die} + [[ @{total-damage} ]]  + @{repeating_buff_$1_buff-enable_toggle}*5d6 ]]}} {{crit_confirm=[[ 1d20 + [[ @{total-attack} ]] ]]}} {{crit_damage=[[ [[ (@{damage-dice-num} * (@{crit-multiplier} - 1)) ]]d@{damage-die} + [[ (@{total-damage} * (@{crit-multiplier} - 1)) ]] ]]}} {{type=@{type}}} {{description=@{notes}}} @{iterative_attacks} @{macro_options} This is using the standard attack macros that come on the attack page. You can just insert the bolded text into your own macros. I've been looking for a way to toggle buffs with macros, however I tried this one and it didnt seem to work.
Could you paste the content of your macro here so we can have a look?
1460012299
vÍnce
Pro
Sheet Author
Mal said: Sam M. said: Those fields take numeric values only, but what you can do is use the buff as an on/off toggle for part of your macro. For example : &{template:pf_attack} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} {{name=@{name}}} {{attack=[[ 1d20cs>[[ @{crit-target} ]] + [[ @{total-attack} ]] ]]}} {{damage=[[ @{damage-dice-num}d@{damage-die} + [[ @{total-damage} ]]  + @{repeating_buff_$1_buff-enable_toggle}*5d6 ]]}} {{crit_confirm=[[ 1d20 + [[ @{total-attack} ]] ]]}} {{crit_damage=[[ [[ (@{damage-dice-num} * (@{crit-multiplier} - 1)) ]]d@{damage-die} + [[ (@{total-damage} * (@{crit-multiplier} - 1)) ]] ]]}} {{type=@{type}}} {{description=@{notes}}} @{iterative_attacks} @{macro_options} This is using the standard attack macros that come on the attack page. You can just insert the bolded text into your own macros. I've been looking for a way to toggle buffs with macros, however I tried this one and it didnt seem to work. You can't actually toggle a buff from a macro.  ;-(  You have to do that from the sheet directly, or perhaps using an API script.  The trick above uses the buff's toggle switch (0 or 1) to apply additional damage to the macro, but you still have to enable the buff prior to rolling the attack if you want the additional damage.