Spell: Challenge Evil
Code:
<thing id="pS2ChalEvi" name="Challenge Evil" description="You challenge an evil creature to bring the fight to you, or suffer the consequences. You gain a +2 sacred bonus on all melee attacks against the subject of the spell. At the end of its turn, if the target has not made at least one attack on you, it becomes sickened. If you move away from the target, the spell ends." compset="InPlay">
<fieldval field="pDuration" value="1 min/level"/>
<fieldval field="pMinimum" value="2"/>
<fieldval field="pMaximum" value="2"/>
<usesource source="APG"/>
<tag group="Helper" tag="AdjSpell" name="Spell Adjustment" abbrev="Spell Adjustment"/>
<eval phase="PreLevel" priority="5000"><![CDATA[
~ If we're not enabled, get out now
doneif (field[pIsOn].value = 0)
~ Modify all melee attacks
foreach pick in hero from BaseWep where "wCategory.Melee"
~ All melee attacks are at +2 sacred bonus to hit
eachpick.field[wAttBonus].value += field[pAdjust].value
nexteach]]></eval>
</thing>