LoT_PRC8/_module/nss/rp_po_at6_scare.nss

41 lines
1.4 KiB
Plaintext
Raw Permalink Normal View History

2023-09-25 21:32:17 -04:00
//::///////////////////////////////////////////////
//:: Name
//:: FileName
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
"Scare" the ox so that is will move out of the way.
This prevents the ox from being able to pin people
in and have to kill the ox to get away. After the
ox has run a few meters, have it resume whatever it
was previously doing.
*/
//:://////////////////////////////////////////////
//:: Created By: Rogers Pessin (Tigsen)
//:: Created On: August 4, 2002
//:://////////////////////////////////////////////
void main()
{
// Scare the ox into moving 3m from the scarer.
object oScarer = GetPCSpeaker();
if (oScarer==OBJECT_INVALID) return;
AssignCommand(oScarer,ActionSpeakString("MOVE IT!!!!!"));
ClearAllActions();
ActionMoveAwayFromObject(oScarer, TRUE, 5.0);
// Lastly, see if we need to continue following the ox's owner.
int iStatus = GetLocalInt(OBJECT_SELF,"RP_OX_STATUS");
if (iStatus)
{
// iStatus is TRUE, which means the ox was following its owner.
object oOwner = GetLocalObject(OBJECT_SELF,"RP_Owner_Obj");
if (GetIsObjectValid(oOwner) && GetIsPC(oOwner))
{
// Resume following the owner after fleeing from the scarer.
ActionForceFollowObject(oScarer,FeetToMeters(IntToFloat(iStatus)));
} // end if (GetIsObjectValid(oOwner) && GetIsPC(oOwner))
} // end if (iStatus)
} // end void main()