thanks everyone.
i tested both a regular clarity potion and the extended potion using a lvl 10 paladin (not sure if the class/lvl makes a difference) the non extended clarity effect lasted 48 seconds, the extended pot had a duration of 30 seconds...
here are the two scripts
#include "pw_mod_inc"
void main()
{
ExtendedClarity();
}
void ExtendedClarity()
{
object oPC;
if (!GetIsPC(GetItemActivatedTarget()))
{
return;
}
oPC = GetItemActivator();
object oCaster;
oCaster = oPC;
object oTarget;
oTarget = oPC;
//Declare major variables
effect eImm1 = EffectImmunity(IMMUNITY_TYPE_MIND_SPELLS);
effect eDam = EffectDamage(1, DAMAGE_TYPE_NEGATIVE);
effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_POSITIVE);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
effect eLink = EffectLinkEffects(eImm1, eVis);
eLink = EffectLinkEffects(eLink, eDur);
effect eSearch = GetFirstEffect(oTarget);
/*////////////////////////////////////////
Begin Define duration here
Uncomment whichever method you choose.
Use GetCasterLevel to maintain potion
casting level
////////////////////////////////////////*/
//int nDuration = GetLevelByClass(CLASS_TYPE_WIZARD, oPC);
//int nDuration = GetHitDice(oPC);
int nDuration = GetCasterLevel(OBJECT_SELF);
// End Define duration here
int nMetaMagic = GetMetaMagicFeat();
//Enter Metamagic conditions
if (nMetaMagic == METAMAGIC_EXTEND || GetBaseItemType(GetSpellCastItem()) == BASE_ITEM_POTIONS)
{
nDuration = nDuration *2; //Duration is +100%
}
/*if (nMetaMagic == METAMAGIC_EXTEND)
{
nDuration = nDuration *2; //Duration is +100%
}*/
int bValid;
int bVisual;
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(oPC, SPELL_CLARITY, FALSE));
//Search through effects
while(GetIsEffectValid(eSearch))
{
bValid = FALSE;
//Check to see if the effect matches a particular type defined below
if (GetEffectType(eSearch) == EFFECT_TYPE_DAZED)
{
bValid = TRUE;
}
else if(GetEffectType(eSearch) == EFFECT_TYPE_CHARMED)
{
bValid = TRUE;
}
else if(GetEffectType(eSearch) == EFFECT_TYPE_SLEEP)
{
bValid = TRUE;
}
else if(GetEffectType(eSearch) == EFFECT_TYPE_CONFUSED)
{
bValid = TRUE;
}
else if(GetEffectType(eSearch) == EFFECT_TYPE_STUNNED)
{
bValid = TRUE;
}
//Apply damage and remove effect if the effect is a match
if (bValid == TRUE)
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
RemoveEffect(oTarget, eSearch);
bVisual = TRUE;
}
eSearch = GetNextEffect(oTarget);
}
float fTime = 30.0 + RoundsToSeconds(nDuration);
//After effects are removed we apply the immunity to mind spells to the target
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fTime);
}
i am missing bExtend = TRUE. i didn't understand that part, sorry.