Clean up Skin?
Zephirius
Member Posts: 419
I've given the PC the penalty of level draining 1d4 levels. off of his skin. Now I want to "clean" his skin. How do I go about deleting or cleaning up his skin and removing all effects from it?
#include "x3_inc_skin" void main() { object oPC = GetEnteringObject(); if (!GetIsPC(oPC)) return; int nOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF)); if (nOnce == TRUE) { return; } SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE); effect eNegativeFX; eNegativeFX = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE); effect eTrap; eTrap = EffectNegativeLevel(d4(), FALSE); effect eNegBurst; eNegBurst = EffectVisualEffect(VFX_FNF_LOS_EVIL_20); DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, eNegBurst, oPC)); ApplyEffectToObject(DURATION_TYPE_INSTANT, eNegativeFX, oPC); ApplyEffectToObject(DURATION_TYPE_INSTANT, eTrap, oPC); int nNeg = EFFECT_TYPE_NEGATIVELEVEL; if (nNeg == TRUE) { object oSkin; oSkin = SKIN_SupportGetSkin(oPC); SetTag(oSkin, "DELETE_SKIN"); itemproperty ipAward; ipAward = ItemPropertyDamagePenalty(IP_CONST_ONHIT_LEVELDRAIN); AddItemProperty(DURATION_TYPE_PERMANENT, ipAward, oSkin); object oTarget; oTarget = oSkin; effect eEffect; while (GetIsEffectValid(eEffect)) { if (GetEffectType(eEffect)==EFFECT_TYPE_NEGATIVELEVEL) DelayCommand(10.0, RemoveEffect(oTarget, eEffect)); eEffect = GetNextEffect(oTarget); } } }
0
Comments
Here's your coding lesson for the day:
(And I mean it as a good way to learn)