I am making a new customer feat that will detect the "Mighty" attribute of a bow and the strength modifier of the character wielding it and make the "Mighty" attribute be equal to the strength modifier if it is lower. I am writing a script for it but thus far I cannot get it to compile. Can someone give me some advise? This is what I have thus far;
object oPC = GetFirstPC(FALSE);
int IsBowEquipped(object oPC)
{
// get the type of item wielded in the right hand
object oItem = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC);
int nType = GetBaseItemType(oItem);
// check if (holding a bow and (having the right feat)
if (((nType == BASE_ITEM_LONGBOW) || (nType == BASE_ITEM_SHORTBOW) && (GetHasFeat(FEAT_SHARPSHOOT_MODIFY_BOW, oPC))))
{
return TRUE;
}
else
{
return FALSE;
}
}
int oStr = GetAbilityModifier(ABILITY_STRENGTH, oPC);
int oMight = GetItemPropertyType(ITEM_PROPERTY_MIGHTY, oItem);
if (oMight < oStr)
{
oMight = oStr;
}
void main()
{
if (IsBowEquipped(oPC)&& (GetLocalInt(oPC,"FEAT_SHARPSHOOT_MODIFY_BOW") <1))
{
SetLocalInt(oPC,"FEAT_SHARPSHOOT_MODIFY_BOW",1);
effect eEffect = ApplyEffectToObject(SupernaturalEffect(ItemPropertyMaxRangeStrengthMod(oMight, oItem)));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oPC, HoursToSeconds(12));
}
else
{
SetLocalInt(oPC,"FEAT_SHARPSHOOT_MODIFY_BOW",0);
}
}