PDA

View Full Version : NPC Saves vs. Spells in 3.5E



leozelig
July 14th, 2015, 02:13
I am working on automating npc saves vs. spells for my DCCRPG ruleset using 3.5E as a template. In the manager_spell script, what is the difference between types castsave and spellsave?

Moon Wizard
July 14th, 2015, 03:38
One is used when a "cast" action is made which actually encompasses the spell chat notification, the spell attack roll (if any), and the spell save trigger (if any).

The other one is used when the spell save trigger is dragged directly, instead of using cast button.

They should be almost identical in handling with minor differences.

Note, I recently found a bug where one of them was not calling the mod function. See the latest v3.1.2 beta of the manager_spell.lua script.

Regards,
JPG

leozelig
July 14th, 2015, 12:39
Got it, thanks!

leozelig
July 15th, 2015, 12:53
I ended up just calling the regular saving throw functions on a successful spell check roll (type "save"). It seems to work fine, but maybe there is an advantage to defining the other types that I am missing. Even the getSaveVsRoll function does not appear to be necessary as far as I can tell, but my ruleset uses the spell check result as the save DC, so it is probably just a difference in game mechanics.

Anyway, thanks again for the clarification...

Moon Wizard
July 15th, 2015, 19:24
In D&D, the spell is cast by one creature, but the saving throw roll to resist is made by a different creature. It's one of the few mechanisms in D&D that works that way, which is why it's more complex.

Glad it's working.

Cheers,
JPG

leozelig
July 17th, 2015, 12:35
Thanks, Moon.

One last question... When multiple targets are selected, the spell check roll displays for each target (same result for each as intended). This really clutters up the chat window.

Not a big deal, but is there a simple way to get the spell check to display only once? Does the OnSpellTargeting function control that? I could not figure out why this is happening.

Moon Wizard
July 17th, 2015, 18:36
I'm traveling now and answering from memory on phone, so might be a little off.

There's a nOrder variable attached to rTarget actor table variable when a single roll is applied to multiple targets. You would need to check that you are only displaying the roll result when nOrder does not exist or nOrder == 1.

There should be some examples in the D&D rulesets, but I can't remember exactly which ones. Think damage rolls are relevant.

Cheers,
JPG

leozelig
July 17th, 2015, 22:32
Awesome, I can work with that!

leozelig
July 18th, 2015, 02:37
In case someone else is interested...

I inserted this little chunk of code (borrowed from 5E) at the end of my onSpellCast function, which did the trick:


local bShowMsg = true;
if rTarget and rTarget.nOrder and rTarget.nOrder ~= 1 then
bShowMsg = false;
end
if bShowMsg then
Comm.deliverChatMessage(rMessage);
end

Now the spell check result displays only once, regardless of how many creatures are targeted. :)