View Single Post
Aaron
Senior Member
 
Join Date: Oct 2011
Posts: 6,793

Old October 5th, 2015, 07:38 AM
Here is the XML

Code:
  <thing
    id="sCustomWnd"
    name="- Add custom wand -"
    compset="MagicItem"
    description="Add this item to create a wand of a chosen spell."
    buytemplate="BuyGeneral"
    xactspecial="2"> <!-- Barebones purchase, showing just coin fields -->
    <tag group="Helper" tag="CustomItem"/>
    <tag group="Helper" tag="CustSpCont"/>
    <tag group="Helper" tag="EquipMag"/>
    <tag group="User" tag="Tracker"/>
    <tag group="gType" tag="Wand"/>
    <tag group="SpecialTab" tag="GRWand"/>
    <tag group="Helper" tag="EquipAvail"/>
    <eval value="1" phase="Render" priority="105100">
      <after name="Gen Custom Spell Name"/><![CDATA[
      var spellname as string
      foreach pick in gizmo from BaseSpell
        if (eachpick.field[sCL].value > eachpick.field[sCasterMin].value) then
          spellname = splice(spellname,"CL " & ordinal(eachpick.field[sCL].value),", ")
          endif

        spellname = splice(spellname, field[trkMax].value & " charges",", ")
        spellname = lowercase(eachpick.field[sbName].text) & " (" & spellname & ")"
        nexteach

      field[livename].text = "Wand of " & spellname
      field[sbName].text = "wand of " & spellname
      ]]></eval>
    <eval index="2" phase="First" priority="1000"><![CDATA[
      if (field[gIsEquip].value = 0) then
        perform assign[Hide.Tracker]
        perform assign[Hide.Activation]
        perform assign[Helper.SpecUp]
        endif
      ]]></eval>
    <eval index="3" phase="Final" priority="10000"><![CDATA[
      ~our list of spells does not include wordspells
      gizmo.child[CustWand].field[abItemExpr].text = "!component.BaseWord & !Helper.Helper & !Helper.Obsolete"
      ]]></eval>
    <eval index="4" phase="Final" priority="10000"><![CDATA[
      ~during play, this doesn't need to be on the Special tab, but we do want
      ~it displayed in the gear description appendix, so we add tags that will
      ~make it show up in that list if we're outputting this item, but *not* in
      ~the general special abilities list at the end of the statblock
      if (state.isoutput <> 0) then
        perform assign[Helper.ShowSpec]
        perform assign[Hide.Statblock]
        endif
      ]]></eval>

    <evalrule index="1" phase="Validation" priority="5000" severity="warning" message="The Craft Wand feat only allows wands to be created with 50 charges."><![CDATA[
      validif (field[trkMax].value <= 50)
      ]]></evalrule>
    <evalrule index="2" phase="Validation" priority="5000" message="Wands must be created with exactly one spell."><![CDATA[
      validif (tagcount[Helper.CustHasSpl] <= 1)
      ]]></evalrule>
    <child entity="CustWand">
      <tag group="Helper" tag="WandLevReq"/>
      </child>
    </thing>
Aaron is offline   #4 Reply With Quote