• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Magical Lineage and reduced Metamagic

TCArknight

Well-known member
Is there a way to use the ReduMMCost tag to apply to any metamagic added to a spell?

Added the ReduMMCost tags, which serve to reduce the cost of certain Metamagics. There are two ways to use this. If the tag is applied to the hero, then all Metamagic spells with a matching HasMetaMag tag will be reduced in cost by an equal number of tags. For example, if you want all Maximized spells to be reduced from +3 levels to +1 level, apply 2 ReduMMCost.mmMaximize tags to the hero. The other method is to foreach through the custom spells and find some combination, then apply the ReduMMCost tag directly to that spell, so only it is lessened. For example, an ability that said Maximized Fire spells cost only +2 levels would foreach through all spells, looking for those with the fire descriptor and HasMetaMag.mmMaximize, and apply 1 ReduMMCost.mmMaximize tag to each of those. Any other maximized spells who don't meet the requirements of the foreach would still cost +3 levels.

Reading this, there doesn't seem to be a ReduMMCost.All type of tag. If I wanted to modify the Magical Lineage trait to reduce the cost of any tags added to it. Would the best way be to pull any tags on the chosen spell and do a foreach looping through them adding a ReduMMCost for each one?
 
So is Magical Lineage supposed to give 1 level discount per MM applied or just a 1 level discount to the first MM applied?
 
My understanding is that it's a 1 level discount for each MM feat applied.
Benefit: Pick one spell when you choose this trait. When you apply metamagic feats to this spell, treat its actual level as 1 lower for determining the spell’s final adjusted level.
Although I guess it could be 1 level total after all MM feats...
 
Let me try and work this out, then I'll post the mods you can make to tide you over till next release in a few weeks.
 
You can make a copy of Magical Lineage and add the following eval script to it. I've left in all the debugs and instructions so that you can see my thought process and testing, but those are not necessary and you can delete them if you like. I'll certainly remove them from the official version.

PostAttr 5000
Code:
     doneif (field[usrChosen1].ischosen = 0)
     
     ~ Generate our search expression to target the correct spell
     var searchexpr as string
     searchexpr = "thingid." & field[usrChosen1].chosen.idstring
     searchexpr &= " & HasMetaMag.?"

     debug "Seachexpr is " & searchexpr
     
     var thispos as number
     var deletepart as string
     var alltags as string
     var thistag as string
     
     ~ Cycle through all the Custom/metamagic copies of our chosen spell
     foreach pick in hero from BaseSpell where searchexpr
       ~ First, clear out any alltags from previous spells we may have foreached through. Same for all the other variables.
       alltags = ""
       thistag = ""
       deletepart = ""
       thispos = 0

       ~ Now generate a new string for this copy
       alltags = replace(eachpick.tagids[HasMetaMag.?," | "], "HasMetaMag", "ReduMMCost", 0)
       debug "alltags is " & alltags
       
       ~ Now count our way up. Each iteration chops one of the tags off of the alltags strings, and then assigns that tag. We will have a number of iterations equal to the number of HasMetaMag tags are present on this spell.
       var i as number
       for i = 1 to eachpick.tagcount[HasMetaMag.?]
         debug ""
         debug ""
         debug ""
         debug "Our current iteration is " & i
         
         ~ Get the Pos to tell how many letters we need to pull off for the thistag
         thispos = pos(alltags," | ") 
         
         ~ If thispos = -1, that means the divider was not found, and we have only the one tag remaining in alltags, so we can just assign that.
         if (thispos = -1) then
           thistag = alltags
           perform eachpick.assignstr[thistag]
           debug "This is our last iteration, the final tag we assign is " & thistag

         ~ Otherwise we need to start chopping it up
         else
           ~ Now pull off that many spaces from the front, starting at 0.
           thistag = mid(alltags, 0, thispos) 
           debug "thistag is " & thistag

           deletepart = thistag & " | "
           debug "deletepart is " & deletepart

           ~ Delete what we just pulled off of alltags
           alltags = replace(alltags, deletepart, "", 0)

           debug "alltags after subtract deletepart is " & alltags
           perform eachpick.assignstr[thistag]

           debug "The tag we assigned this time was " & thistag
           endif
         next
       nexteach
 
Back
Top