//This is the default header for most items converted to the new
//tagbased system.
//Remember to create 2 scripts, one using the template, and name this
//script ac_"tagnameofitemgoeshere"  (without the "")

#include "x2_inc_switches"
void main()
{
    // Check if we have the correct event firing the script
    if (GetUserDefinedItemEventNumber() != X2_ITEM_EVENT_ACTIVATE) return;

//Define Variables

   object oItem=GetItemActivated();
   object oActivator=GetItemActivator();
   object oPlayer = GetItemActivator();
   object target = GetItemActivatedTarget();
   string tag = GetTag(oItem);

//You main script function goes under this line.

 {
      if(GetIsDM(oActivator) != TRUE)
      {
         SendMessageToPC(oActivator,"You are mortal and this is not yours!");
         DestroyObject(oItem);
         return;
      }
      // get the wand's activator and target, put target info into local vars on activator
      object oMyActivator = GetItemActivator();
      object oMyTarget = GetItemActivatedTarget();
      SetLocalObject(oMyActivator, "dmfx_wandtarget", oMyTarget);
      location lMyLoc = GetItemActivatedTargetLocation();
      SetLocalLocation(oMyActivator, "dmfx_wandloc", lMyLoc);

      //Make the activator start a conversation with itself
      AssignCommand(oMyActivator, ActionStartConversation(oMyActivator, "conv_dmfxwand", TRUE));
      return;
   }
}