Here's an example of some code I have written that already does what you're looking for, more or less:
/**
* This will apply an array of effects to an object.
*/
void ApplyEffectsOnObject(int nDurationType,
effect[] eEffects,
object oTarget,
float fDuration = 0.0f,
object oCreator = OBJECT_SELF,
int nAbilityID = 0)
{
int nSize = GetArraySize(eEffects);
int index;
for (index = 0; index < nSize; index++)
ApplyEffectOnObject(nDurationType, eEffects[index], oTarget, fDuration, oCreator, nAbilityID);
}
//////bunch of other stuff before the part that will interest you
effect[] eEffects;
eEffects[0] = EffectEnchantment(ENCHANTMENT_LIGHTNING);
eEffects[1] = EffectVisualEffect(TEMPEST_ELECTRICITY_VFX);
eEffects[2] = EffectModifyProperty(PROPERTY_ATTRIBUTE_ATTACK_SPEED_MODIFIER, -0.5);
eEffects[3] = EffectModifyMovementSpeed(2.0);
ApplyEffectsOnObject(EFFECT_DURATION_TYPE_TEMPORARY, eEffects, oTarget, 100.0, oTarget, ABILITY_TALENT_FLURRY_ATTACK);
******************************************************************
So, I seem to remember effect linking in NWN1, but I haven't used that here. I just make use of arrays, and create an array of various effects. Then I apply that array of effects to the object.
With regards to making an icon pop up, just make sure you specify the ability id at the end of the
ApplyEffectOnObject() function. Then you'll see the icon do it's thing as time winds down, and when it's gone, all the effects will be gone as well.
EDIT - I missed one question you had. The icon, description, etc. would be added to
ABI_Base.xls. Assuming you're familiar with editing 2DA's, I would make a M2DA version of
ABI_Base.xls, and put your stuff in there.
Modifié par Challseus, 02 décembre 2009 - 04:26 .