// rts_it_teamwand  - Team control wand
void main()
{
   object oPC=GetItemActivator();
   object oTarg=GetItemActivatedTarget();
   string sID=GetLocalString(oPC,"sTeamID");
   object oLead=GetLocalObject(GetModule(),"oTeamLead"+sID);
   effect eDmg=EffectDamage(1);
   if (oLead==oPC)
   { // is leader
     if (oTarg!=OBJECT_INVALID&&oTarg!=oPC)
      SetLocalObject(oPC,"oTarget",oTarg);
     else { DeleteLocalObject(oPC,"oTarget"); }
     AssignCommand(oPC,ClearAllActions());
     AssignCommand(oPC,ActionStartConversation(oPC,"team_wand",TRUE,FALSE));
   } // is leader
   else
   { //  not allowed
     SendMessageToPC(oPC,"The wand burns your hands as you use it and you are not the leader.  It then vanishes.");
     ApplyEffectToObject(DURATION_TYPE_INSTANT,eDmg,oPC,1.0);
     DestroyObject(GetItemActivated());
   } //  not allowed
}