// *** Critically hit immunity custom potion for Alangara, by Tarashon *** #include "x2_inc_spellhook" void main() { object oPC; if ((GetObjectType(GetItemActivatedTarget())!=OBJECT_TYPE_CREATURE) ){ SendMessageToPC(GetItemActivator(), "Improper use of item!"); return;} oPC = GetItemActivator(); object oTarget; oTarget = oPC; effect eEffect; eEffect = EffectImmunity(IMMUNITY_TYPE_CRITICAL_HIT); effect eDur = EffectVisualEffect(VFX_DUR_AURA_GREEN); effect eLink = EffectLinkEffects(eEffect, eDur); int nDuration = 30; if ( GetItemPossessedBy(oTarget, "potioncrystal7") != OBJECT_INVALID ) { nDuration = nDuration +10; } // *** Fokus Token in action *** // if (GetItemPossessedBy(oPC, "potioncrystal6")!= OBJECT_INVALID) { if (d100()<=25) { CreateItemOnObject("criticalresist", oPC); FloatingTextStringOnCreature("The Focus Stone emits a brief radiance as it restores your potion", oPC); } } // *** End of focus Token *** // float fTime = RoundsToSeconds(nDuration); //After effects are removed we apply the immunity to mind spells to the target ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fTime); }