OK, Got that example I mentioned..
Prefab download#include "x2_inc_switches"
void main()
{
int nEvent = GetUserDefinedItemEventNumber(); //Which event triggered this
object oPC; //The player character using the item
object oItem; //The item being used
object oSpellTarget; //The target of the spell
//Set the return value for the item event script
// * X2_EXECUTE_SCRIPT_CONTINUE - continue calling script after executed script is done
// * X2_EXECUTE_SCRIPT_END - end calling script after executed script is done
int nResult = X2_EXECUTE_SCRIPT_END;
switch (nEvent)
{
case X2_ITEM_EVENT_ONHITCAST:
// * This code runs when the item has the 'OnHitCastSpell: Unique power' property
// * and it hits a target(if it is a weapon) or is being hit (if it is a piece of armor)
// * Note that this event fires for non PC creatures as well.
oItem = GetSpellCastItem(); // The item triggering this spellscript
oPC = OBJECT_SELF; // The player triggering it
oSpellTarget = GetSpellTargetObject(); // What the spell is aimed at
if(d4(1) == 4)//25% chance.
{
int iDamDice = d2(GetHitDice(oPC));
if(GetStringLowerCase(GetDeity(oPC))== "talos")
{iDamDice = d6(GetHitDice(oPC));}//d6 for the faithful
int iVFX;
switch(GetIsAreaInterior(GetArea(oPC)))
{//This is just fun Flavor code.
case TRUE: iVFX = VFX_FNF_ELECTRIC_EXPLOSION; break;//If inside Explosion.
case FALSE: iVFX= VFX_IMP_LIGHTNING_M; break;//If outside, Lightning bolt.
}
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(iVFX), oSpellTarget);//Apply the VFX
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(iDamDice, DAMAGE_TYPE_ELECTRICAL, DAMAGE_POWER_ENERGY), oSpellTarget);
}
break;
}
//Pass the return value back to the calling script
SetExecutedScriptReturnValue(nResult);
}
Summary for mere mortals: 25% chance of 1d2 * PC level Electrical damage. (1-80 damage range)
Additionally If Inside/underground It will use the big ball of lightning VFX. If outside, regular lightning bolt(call lightning style).
As an added bonus, for the faithful of Talos(I'm putting the prefab up with a spear) It'll try and match deity string. "talos" with any capitalization will cause it to use d6 for damage(1 - 240 damage range).
'sProbably not what your looking for.. But it does illustrate one method of making an item scale with PC level. Will try and throw up some decent armor tomorrow.