
#include "prc_class_const"

location lTarget;
object oSpawn;
object oTarget;
/*   Script generated by
Lilac Soul's NWN Script Generator, v. 1.6

For download info, please visit:
http://www.lilacsoul.revility.com    */

//Put this OnUsed
void main()
{

object oPC = GetLastUsedBy();

if (!GetIsPC(oPC)) return;

int nInt;
nInt=GetLocalInt(oPC, "intCrystalDestroyed");

if (!(nInt == 1))
   return;

int iDivine	= GetLevelByClass(CLASS_TYPE_CLERIC, oPC) 	
			+ GetLevelByClass(CLASS_TYPE_ARCHIVIST, oPC)
			+ GetLevelByClass(CLASS_TYPE_FAVOURED_SOUL, oPC)
			+ GetLevelByClass(CLASS_TYPE_HEALER, oPC)
			+ GetLevelByClass(CLASS_TYPE_BLIGHTER, oPC)
			+ GetLevelByClass(CLASS_TYPE_FAVOURED_SOUL, oPC)
			+ GetLevelByClass(CLASS_TYPE_OCULAR, oPC)
			+ GetLevelByClass(CLASS_TYPE_SHAMAN, oPC)
			+ GetLevelByClass(CLASS_TYPE_UR_PRIEST, oPC);
			
if (iDivine>0)
   {
   FloatingTextStringOnCreature("The air crackles as you reach for the potion.  A force field blocking you has been dispelled.", oPC);

   SetLocalInt(oPC, "intCrystalDestroyed", 2);

   SetLocalInt(oPC, "c42Started", 2);

   oTarget = GetObjectByTag("c42Door");

   SetLocked(oTarget, FALSE);

   oTarget = oPC;

   lTarget = GetLocation(oTarget);

   oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "couatl", lTarget);

   oTarget = oSpawn;

   AssignCommand(oTarget, ActionStartConversation(oPC, ""));
     return;
   }
SendMessageToPC(oPC, "There is a force field of some kind blocking you from reaching the potion on the stela.");

}
