Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
foreach pick in hero from BaseSpell where "BonusSpAt.? & Spellbook.cHelpWit & component.BaseCustSp"foreach pick in hero from BaseSpell where "BonusSpAt.?"
foreach pick in hero from BaseSpell where "Spellbook.cHelpWit"
foreach pick in hero from BaseSpell where "component.BaseCustSp"	  doneif (field[gIsEquip].value = 0)
      
      ~ Generate our search expression to target the correct spell
      var searchexpr as string
           
	  foreach pick in hero from BaseSpell where "BonusSpAt.? & Spellbook.cHelpWit"
	    if (eachpick.isroot <> 0) then
	      if (eachpick.root.tagis[component.BaseCustSp] <> 0) then
		     debug "id: " & eachpick.idstring
		  endif
		endif
	 nexteach
	
	  
      ~ Cycle through all the Custom/metamagic copies of our chosen spell,
      ~ and reduce their effective level by 1 (keeping them from going negative)
      foreach pick in hero from BaseSpell where searchexpr
        eachpick.field[sLevel].value = maximum(eachpick.field[sLevelBase].value,maximum(eachpick.field[sLevel].value - 1,0))
        nexteach	  doneif (field[gIsEquip].value = 0)
      
      ~ Generate our search expression to target the correct spell
      var searchexpr as string
	             
	  foreach pick in hero from BaseSpell where "BonusSplAt.? & Spellbook.cHelpWit"
	    if (eachpick.isroot <> 0) then
	      if (eachpick.root.tagis[component.BaseCustSp] <> 0) then
		     searchexpr = "thingid." & eachpick.idstring & " & HasMetMag.?"
		  endif
		endif
		
		foreach pick in hero from BaseSpell where searchexpr
        eachpick.field[sLevel].value = maximum(eachpick.field[sLevelBase].value,maximum(eachpick.field[sLevel].value - 1,0))
        nexteach
	  
	  nexteachMy thought the issue is here. I am not 100% sure what sLevelBase is but assuming its the base level of the spell I think the code does nothing.Code:eachpick.field[sLevel].value = maximum(eachpick.field[sLevelBase].value,maximum(eachpick.field[sLevel].value - 1,0))
