/* * Script generated by LS Script Generator, v.TK.0 * * For download info, please visit: * http://nwvault.ign.com/View.php?view=Other.Detail&id=1502 */ // Put this OnHeartbeat. // Will abort (do nothing) if fighting or talking or if no PCs are in the area. #include "NW_I0_GENERIC" #include "x0_i0_anims" void main() { // If running the lowest AI, abort for performance reasons. if ( GetAILevel() == AI_LEVEL_VERY_LOW ) return; // If busy with combat or conversation, skip this heartbeat. if ( IsInConversation(OBJECT_SELF) || GetIsInCombat() ) return; // Abort if failed a 5% chance. if ( Random(100) >= 10 ) return; // Have us perform a sequence of actions. string sSittableTagName = "Woodenbench"; object oChair = GetRandomObjectByTag(sSittableTagName, 70.0); ActionForceMoveToObject (oChair, FALSE, 1.0f, 120.0); ActionSit(oChair); }