void main()
{
object oPC=GetPCSpeaker();
AssignCommand(oPC,ClearAllActions());
AssignCommand(oPC,PlayAnimation(ANIMATION_LOOPING_WORSHIP,0.5,180.0));
if (!GetIsObjectValid(GetItemPossessedBy(oPC,"jw_dwarf_rit")))
  {
   return;
  }

SendMessageToPC(oPC,"You read the words on the scrap of paper given to you by Joyin Crownshield");
AssignCommand(oPC,SpeakString("Actions count. Intentions are one thing, but it is the result that is most important. Keep records of your strivings and ideas, to encourage others who come after you."));

object oAnvil=GetObjectByTag("jw_undgon_pool");
object oDiamond=GetItemPossessedBy(oAnvil,"jw_hugesaph");
if (!GetIsObjectValid(oDiamond))
{
 SendMessageToPC(oPC,"Nothing happens - something seems to be missing");
 return;
}



object oEquip=GetItemPossessedBy(oAnvil,"jw_undshd1");
string sMake="jw_undshd1m";

if (!GetIsObjectValid(oEquip))
{
 oEquip=GetItemPossessedBy(oAnvil,"jw_undshd2");
 sMake="jw_undshd2m";
}

if (!GetIsObjectValid(oEquip))
{
 oEquip=GetItemPossessedBy(oAnvil,"jw_undshd3");
 sMake="jw_undshd3m";
}

if (!GetIsObjectValid(oEquip))
{
 SendMessageToPC(oPC,"Nothing happens - something seems to be missing");
 return;
}




DestroyObject(oDiamond);
DestroyObject(oEquip);

object oLoot=CreateItemOnObject(sMake,oAnvil,1);

if (!GetIsObjectValid(oLoot))
{
SendMessageToAllDMs(GetName(oPC)+" has a problem with the undead gond shrine, it failed to make "+sMake+" tell Palmer");
SendMessageToPC(oPC, "Sorry, you have a problem with the undead gond, it failed to make "+sMake+" tell Palmer and he'll give you the item and fix it.");
}

//visual effects
        int n;
        float fBeamDuration = 15.0;
        float fBeamDelay = 3.0;
        effect eBeam = EffectBeam(VFX_BEAM_HOLY, OBJECT_SELF, BODY_NODE_HAND, FALSE);
        effect eBeam2 = EffectBeam(VFX_BEAM_COLD, OBJECT_SELF, BODY_NODE_HAND, FALSE);
        effect eStrike = EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_HOLY);
        effect eShake = EffectVisualEffect(VFX_FNF_SCREEN_SHAKE);
        string sPedestalTag;
        object oPedestal;

        for (n = 1; n <= 6; n++)
            {
            sPedestalTag = "jw_undpil" + IntToString(n);
            oPedestal= GetNearestObjectByTag(sPedestalTag, OBJECT_SELF, 1);
            DelayCommand(fBeamDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam, oPedestal, fBeamDuration));
            fBeamDelay = fBeamDelay + (IntToFloat(n) / 10);
            fBeamDuration = fBeamDuration - (IntToFloat(n) / 10);
            }
        DelayCommand(fBeamDelay, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam2, oAnvil, fBeamDuration));
        DelayCommand((fBeamDuration + fBeamDelay - 1.0), ApplyEffectToObject(DURATION_TYPE_INSTANT, eShake, oAnvil));
        DelayCommand((fBeamDuration + fBeamDelay + 0.5), ApplyEffectToObject(DURATION_TYPE_INSTANT, eStrike, oAnvil));
}