void main()
{
  int nNum = 1;
  object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR,PLAYER_CHAR_IS_PC,OBJECT_SELF,nNum);
  object oLodestone = OBJECT_SELF;
  while (GetIsPC(oPC))
  {
    if (GetDistanceBetween(oPC,oLodestone) <= 25.0)
    {
      int nStrMod = GetAbilityModifier(ABILITY_STRENGTH,oPC);
      object oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST,oPC);
      int nArmorClass = GetItemACValue(oArmor);
      int nDC = 0;
      SendMessageToPC(oPC,"There is a powerful lodestone in this hallway.");
      if ((nArmorClass > 0) && (GetHasFeat(FEAT_ARMOR_PROFICIENCY_LIGHT,oPC) == TRUE))
        nDC = 4;
      if ((nArmorClass > 3) && (GetHasFeat(FEAT_ARMOR_PROFICIENCY_MEDIUM,oPC) == TRUE))
        nDC = 8;
      if ((nArmorClass > 5) && (GetHasFeat(FEAT_ARMOR_PROFICIENCY_HEAVY,oPC) == TRUE))
        nDC = 12;
      int nDieRoll = d6();
      int nDieRollMod = nDieRoll + nStrMod;
      string sDieRollMsg = "Strength roll: " + IntToString(nDieRoll) + " + " + IntToString(nStrMod) + " = " + IntToString(nDieRollMod) + " vs. DC " + IntToString(nDC) + " ";
      if (nDieRollMod >= nDC)
        SendMessageToPC(oPC,sDieRollMsg + "Resisted.");
      if (nDieRollMod < nDC)
      {
        SendMessageToPC(oPC,sDieRollMsg + "Failed.");
        AssignCommand(oPC,ActionDoCommand(ClearAllActions(TRUE)));
        AssignCommand(oPC,ActionMoveToObject(oLodestone,TRUE,1.0f));
        AssignCommand(oPC,SetCommandable(FALSE));
        AssignCommand(oPC,DelayCommand(4.0,SetCommandable(TRUE)));
      }
    }
    nNum++;
    oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR,PLAYER_CHAR_IS_PC,OBJECT_SELF,nNum);
  }
}
