I save the appearance on the creature that equips the belt as nAppearance.
Here is the code for the on equip event:
void main ()
{
//Do not apply the SEF to the user because it comes back on re-loads
//even if you have removed the belt.
object oTarget = GetPCItemLastEquippedBy();
int nAppearance = GetAppearanceType(oTarget);
effect eEffect = EffectNWN2SpecialEffectFile("sp_skin_ice_twa2");
eEffect = ExtraordinaryEffect(eEffect);
eEffect = SupernaturalEffect (eEffect);
SetCreatureAppearanceType(oTarget,APPEARANCE_TYPE_SUCCUBUS);
SetLocalInt(oTarget,"nAppearance",nAppearance);
//ApplyEffectToObject(DURATION_TYPE_PERMANENT,eEffect,oTarget);
}
Here is the code for the unequip event
void main ()
{
object oTarget = GetPCItemLastUnequippedBy();
object oEffectCreator;
int nAppearance = GetLocalInt(oTarget,"nAppearance");
effect eEffect = GetFirstEffect(oTarget);
string sTag;
SetCreatureAppearanceType(oTarget,nAppearance);
while (GetIsEffectValid(eEffect))
{
oEffectCreator = GetEffectCreator(eEffect);
sTag = GetTag(oEffectCreator);
if (sTag =="belt_of_morphing")
{
RemoveEffect(oTarget,eEffect);
eEffect = GetFirstEffect(oTarget);
}
else
{
eEffect = GetNextEffect(oTarget);
}
}
RemoveSEFFromObject(oTarget,"sp_skin_ice_twa2");
}
Modifié par M. Rieder, 30 janvier 2012 - 12:56 .





Retour en haut






