object oTalmiss = GetObjectByTag("talmiss");
if(GetIsNight()&& !GetGlobalInt("TempleShout0904")){
//SendMessageToPC(GetFirstPC(FALSE),"night");
SetLocalObject(oTalmiss,"chestItem",GetItemInSlot(INVENTORY_SLOT_CHEST,oTalmiss));
SetLocalObject(oTalmiss,"leftHand",GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oTalmiss));
SetLocalObject(oTalmiss,"rightHand",GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oTalmiss));
DelayCommand(0.2,AssignCommand(oTalmiss,ActionUnequipItem(GetItemInSlot(INVENTORY_SLOT_CHEST,oTalmiss))));
//DelayCommand(0.2,AssignCommand(oTalmiss,ActionUnequipItem(GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oTalmiss))));
DelayCommand(0.2,AssignCommand(oTalmiss,ActionUnequipItem(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oTalmiss))));
DelayCommand(0.5,AssignCommand(oTalmiss,JumpToObject(GetObjectByTag("wp_talmisslseep"))));
DelayCommand(1.0,talmissSleep());
SetBaseSkillRank(oTalmiss,SKILL_SPOT,0,FALSE);
DelayCommand(0.5,AssignCommand(GetObjectByTag("talmiss2"),JumpToObject(GetObjectByTag("wp_talmisslseep2"))));
DelayCommand(0.5,AssignCommand(GetObjectByTag("talkni02a"),JumpToObject(GetObjectByTag("wp_talmisslseep3"))));
}
else{
/*
SendMessageToPC(GetFirstPC(FALSE),"day: " + GetTag(GetLocalObject(oTalmiss,"chestItem")));
SendMessageToPC(GetFirstPC(FALSE),"day: " + GetTag(GetLocalObject(oTalmiss,"leftHand")));
SendMessageToPC(GetFirstPC(FALSE),"day: " + GetTag(GetLocalObject(oTalmiss,"rightHand")));
*/
SetBaseSkillRank(GetObjectByTag("talmiss"),SKILL_SPOT,30,FALSE);
DelayCommand(0.2,AssignCommand(oTalmiss,ClearAllActions(TRUE)));
DelayCommand(0.5,AssignCommand(oTalmiss,JumpToObject(GetObjectByTag("WP_talmiss"))));
//BUG the NPC refuses to equip right hand and left hand item.
DelayCommand(0.9,AssignCommand(oTalmiss,ClearAllActions(TRUE)));
DelayCommand(1.0,AssignCommand(oTalmiss,ActionEquipItem(GetLocalObject(oTalmiss,"chestItem"),INVENTORY_SLOT_CHEST)));
DelayCommand(1.5,AssignCommand(oTalmiss,ActionEquipItem(GetLocalObject(oTalmiss,"rightHand"),INVENTORY_SLOT_RIGHTHAND)));
//DelayCommand(2.0,AssignCommand(oTalmiss,ActionEquipItem(GetLocalObject(oTalmiss,"leftHand"),INVENTORY_SLOT_LEFTHAND)));
//DelayCommand(0.5,AssignCommand(GetObjectByTag("talmiss2"),JumpToObject(GetObjectByTag("WP_talmiss2"))));
DelayCommand(0.5,AssignCommand(GetObjectByTag("talkni02a"),JumpToObject(GetObjectByTag("WP_talkni02a"))));
}