59 lines
1.5 KiB
Plaintext
59 lines
1.5 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Name: mooooo
|
|
//:://////////////////////////////////////////////
|
|
/*
|
|
Handles the Moooo :D
|
|
*/
|
|
//:://////////////////////////////////////////////
|
|
//:: Created By: Flash
|
|
//:: Created On: 03-mar-2005
|
|
//:://////////////////////////////////////////////
|
|
#include "mooooo_inc"
|
|
|
|
void main()
|
|
{
|
|
int bIsCow = GetLocalInt(OBJECT_SELF, "is_cow");
|
|
int nCowCycleCount = GetLocalInt(OBJECT_SELF, "cow_cycle");
|
|
|
|
// Victim should no longer be a cow, so turn him back.
|
|
if(!bIsCow)
|
|
{
|
|
AssignCommand (OBJECT_SELF, SetCommandable(TRUE));
|
|
AssignCommand (OBJECT_SELF, ClearAllActions(TRUE));
|
|
RemoveCow(OBJECT_SELF);
|
|
return;
|
|
}
|
|
|
|
// Determine behaviour for this call
|
|
switch(Random(3))
|
|
{
|
|
case 0:
|
|
//SendMessageToPC(OBJECT_SELF, "Calling Talk");
|
|
TalkToPC(OBJECT_SELF);
|
|
break;
|
|
case 1:
|
|
//SendMessageToPC(OBJECT_SELF, "Calling Examine");
|
|
ExamineSomething(OBJECT_SELF);
|
|
break;
|
|
case 2:
|
|
//SendMessageToPC(OBJECT_SELF, "Calling Walk");
|
|
WalkRandomly(OBJECT_SELF);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
// Determin if victim still should be a cow.
|
|
if( nCowCycleCount > GetLocalInt(OBJECT_SELF, "iCowDuration"))
|
|
{
|
|
SetLocalInt(OBJECT_SELF, "cow_cycle", 0);
|
|
SetLocalInt(OBJECT_SELF, "is_cow", FALSE);
|
|
}
|
|
else
|
|
{
|
|
SetLocalInt(OBJECT_SELF, "cow_cycle", ++nCowCycleCount);
|
|
}
|
|
|
|
DelayCommand(7.0f, ExecuteScript("mooooo", OBJECT_SELF));
|
|
}
|