I created a function wich gives random item properties to an object. I plan to use it often so thats why its better to create a function that i can call every time and not to make the whole script everytime i need it.
void EnchantItemAt(object oArma, int nTr)
{
while (nTr > 0)
{
int nR = Random(21);
if (nR == 1)
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyAbilityBonus(IP_CONST_ABILITY_CHA, d4(1)), oArma);
Declaration dont match parameters error.
if (nR == 2)
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyAbilityBonus(IP_CONST_ABILITY_CON, d4(1)), oArma);
if (nR == 3)
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyAbilityBonus(IP_CONST_ABILITY_DEX, d4(1)), oArma);
if (nR == 4)
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyAbilityBonus(IP_CONST_ABILITY_INT, d4(1)), oArma);
if (nR == 5)
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyAbilityBonus(IP_CONST_ABILITY_STR, d4(1)), oArma);
if (nR == 6)
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyAbilityBonus(IP_CONST_ABILITY_WIS, d4(1)), oArma);
//if (nR == 7)
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyAdditional(IP_CONST_ADDITIONAL_CURSED), oArma);
if (nR ==
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyAdditional(IP_CONST_ADDITIONAL_CURSED), oArma);
if (nR == 9)
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyAttackBonus(d4(1)), oArma);
if (nR == 10)
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyAttackBonus(d4(1)), oArma);
if (nR == 11)
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyAttackBonusVsAlign(d6(1),d4(1)), oArma);
if (nR == 12)
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyBonusFeat(IP_CONST_FEAT_ALERTNESS), oArma);
if (nR == 13)
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyBonusFeat(IP_CONST_FEAT_CLEAVE), oArma);
if (nR == 14)
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyBonusFeat(IP_CONST_FEAT_COMBAT_CASTING), oArma);
if (nR == 15)
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyBonusFeat(IP_CONST_FEAT_DISARM), oArma);
if (nR == 16)
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyBonusFeat(IP_CONST_FEAT_KNOCKDOWN), oArma);
if (nR == 17)
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyBonusFeat(IP_CONST_FEAT_POWERATTACK), oArma);
if (nR == 18)
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyBonusFeat(IP_CONST_FEAT_SNEAK_ATTACK_1D6), oArma);
if (nR == 19)
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyBonusFeat(IP_CONST_FEAT_WHIRLWIND), oArma);
if (nR == 20)
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyBonusSpellResistance(d6(1)), oArma);
//if (nR == 21)
AddItemProperty(DURATION_TYPE_PERMANENT, ItemPropertyCastSpell(Random(300),Random(14)), oArma);
nTr = nTr-1;
}
}
Ok, so thats my function... then i added a placeable wich onused it should give a random itemprop to the user weapon:
Well i think this should work, but i get a "declaration dont match parameters" on the "my_functions" in red showed before.
Obviously im doing something wrong when calling the function but i cant figure out what.
So i need some help.