Aantioch_Infernum/_module/nss/npc_sit_stay.nss

23 lines
845 B
Plaintext
Raw Normal View History

2023-08-08 16:22:17 -04:00
//::///////////////////////////////////////////////
//:: npc_sit_stay
//:://////////////////////////////////////////////
/*Goes on the OnSpawn and OnConversation script of the NPC that you want to stay <span class="highlight">seated</span>*/
#include "nw_i0_spells"
2023-08-08 16:22:17 -04:00
#include "NW_I0_GENERIC"
#include "x0_i0_anims"
2023-08-08 16:22:17 -04:00
void main()
{
2023-08-08 16:22:17 -04:00
ClearAllActions();
SetAILevel (OBJECT_SELF, AI_LEVEL_HIGH);
2023-08-08 16:22:17 -04:00
string sMyTagName = GetTag(OBJECT_SELF);
string sSittableTagName = "CHAIR_" + sMyTagName;
object oChair = GetRandomObjectByTag(sSittableTagName, 77.0);
ActionForceMoveToObject (oChair, FALSE, 1.0f, 120.0);
2023-08-08 16:22:17 -04:00
ActionSit(oChair);
int nTime = Random(210) + 90;
float fTime = IntToFloat(nTime);
DelayCommand(fTime, ExecuteScript("npc_sit_stay", OBJECT_SELF));
2023-08-08 16:22:17 -04:00
}