Something perhaps along these lines?
#include "x2_inc_switches"
#include "x2_inc_intweapon"
void ApplyArmorEffects(object oPC)
{
effect eInvis
// Do not apply if already there:
effect eScan = GetFirstEffect(oPC);
while (GetIsEffectValid(eScan))
{
if (GetEffectCreator(eScan) == OBJECT_SELF) //return; do not stop the script, but remove the old effects
RemoveEffect(oPC, eScan);
eScan = GetNextEffect(oPC);
}
if ( (GetHitDice(oPC) == 1) )
{
// Add a check for specific character class here as well
// Change AC bonus here
eInvis = SupernaturalEffect (EffectACIncrease (1, DAMAGE_TYPE_MAGICAL));
}
ApplyEffectToObject (DURATION_TYPE_PERMANENT, eInvis, oPC);
}
void main()
{
object oPC = GetPCLevelingUp();
object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, oPC);
AssignCommand(oItem, ApplyArmorEffects(oPC));
}
You'll want to work on it of course but that's a general idea and option for OnLevelUp.
FP!
Modifié par Fester Pot, 16 décembre 2010 - 09:33 .