Quote:
Originally Posted by Mathias
...Changing the iPriceCash field can only happen once the item power is a pick...
|
So wouldn't that be the case on a custom magic armor or weapon, where you pick the type of armor or weapon, pick item powers, and
then purchase the item after it has been defined?
The following item (weapon) power has a variable iPriceCash field value, that is set according to which type of weapon the power is added to. Granted, the script is on the power itself, not on another thing, but it is working. (EDIT: I set the price adjustment script to run at First-2550, but it seems to work if set up to First-10000)
Code:
</thing>
<thing id="ipAMSCstImp" name="Casting" description="A {i}casting{/i} weapon is a casting implement and can thus be used as a conduit to cast spells, much like a wand or staff.\n\nIf the weapon is dedicated to one or more spells, only those spells can be cast through it; otherwise, only spells of the affinity(ies) the weapon has a focus for can be cast through it. A wielder with the spellstrike ability ignores these requirements and can in fact use any weapon as a casting implement. Ranged weapons can be casting implements, for the same cost.\n\nBy their nature, wands, as well as masterwork rods and staves, are automatically {i}casting{/i} implements at no extra cost. The limitations above still apply to them, particularly to dedicated wands.\n\nOnly masterwork weapons can be made into {i}casting implements{/i}.\n\n{b}Construction{/b}\n{b}Requirements{/b} Craft Magic Arms and Armor; {b}Cost{/b} 250 gp for light weapons, 1*000 gp for one-handed weapons, 2*250 gp for two-handed weapons, 4*000 gp for firearms, 6*250 gp for siege weapons." compset="ItemPower" summary="Weapon usable as a conduit for spells" uniqueness="useronce">
<fieldval field="iCL" value="3"/>
<usesource source="sSOULAMS"/>
<usesource source="sSOULCamp"/>
<tag group="iSchool" tag="Universal"/>
<tag group="iSchool" tag="Transmutat"/>
<tag group="PowerType" tag="Weapon"/>
<eval phase="PreLevel" priority="5150"><![CDATA[ perform container.parent.setfocus
doneif (state.isfocus = 0)
if (focus.tagis[component.BaseWep] <> 0) then
perform focus.assign[AMSItem.CastImp]
endif]]></eval>
<eval phase="First" priority="2550" index="2"><![CDATA[ perform container.parent.setfocus
doneif (state.isfocus = 0)
if (focus.tagis[wCategory.Firearm] <> 0) then
field[iPriceCash].value = 4000
elseif (focus.tagis[wClass.OneHanded] <> 0) then
field[iPriceCash].value = 1000
elseif (focus.tagis[wClass.TwoHanded] <> 0) then
field[iPriceCash].value = 2250
elseif (focus.tagis[wClass.Siege] <> 0) then
field[iPriceCash].value = 6250
else
field[iPriceCash].value = 250
endif]]></eval>
<evalrule phase="Validation" priority="5000" message="A casting implement must be a masterwork item."><![CDATA[ perform container.parent.setfocus
validif (focus.tagis[EquipType.Masterwork] <> 0)]]></evalrule>
<evalrule phase="PreLevel" priority="5125" index="2" message="Item is already a casting implement.">perform container.parent.setfocus
validif (focus.tagis[AMSItem.CastImp] = 0)</evalrule>
</thing>