5E Product Walkthrough Playlist
  1. #1
    leozelig's Avatar
    Join Date
    Jun 2007
    Location
    Eastern USA
    Posts
    1,863
    Blog Entries
    1

    NPC Saves vs. Spells in 3.5E

    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?

  2. #2
    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

  3. #3
    leozelig's Avatar
    Join Date
    Jun 2007
    Location
    Eastern USA
    Posts
    1,863
    Blog Entries
    1
    Got it, thanks!

  4. #4
    leozelig's Avatar
    Join Date
    Jun 2007
    Location
    Eastern USA
    Posts
    1,863
    Blog Entries
    1
    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...

  5. #5
    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

  6. #6
    leozelig's Avatar
    Join Date
    Jun 2007
    Location
    Eastern USA
    Posts
    1,863
    Blog Entries
    1
    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.

  7. #7
    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

  8. #8
    leozelig's Avatar
    Join Date
    Jun 2007
    Location
    Eastern USA
    Posts
    1,863
    Blog Entries
    1
    Awesome, I can work with that!

  9. #9
    leozelig's Avatar
    Join Date
    Jun 2007
    Location
    Eastern USA
    Posts
    1,863
    Blog Entries
    1
    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:

    Code:
        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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
DICE PACKS BUNDLE

Log in

Log in