71 lines
2.4 KiB
Plaintext
71 lines
2.4 KiB
Plaintext
|
//::///////////////////////////////////////////////
|
||
|
//:: Default On Heartbeat
|
||
|
//:: NW_C2_DEFAULT1
|
||
|
//:: Copyright (c) 2001 Bioware Corp.
|
||
|
//:://////////////////////////////////////////////
|
||
|
/*
|
||
|
This script will have people perform default
|
||
|
animations.
|
||
|
*/
|
||
|
|
||
|
|
||
|
//:://////////////////////////////////////////////
|
||
|
//:: Created By: Preston Watamaniuk
|
||
|
//:: Created On: Nov 23, 2001
|
||
|
//:://////////////////////////////////////////////
|
||
|
#include "NW_I0_GENERIC"
|
||
|
#include "sc_dart_include"
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
int event_no = GetUserDefinedEventNumber();
|
||
|
event this_event = EventUserDefined(event_no);
|
||
|
object current_contestant = GetLocalObject(getDB(), CONTESTANT2);
|
||
|
int player_turn = GetLocalInt(getDB(), PLAYER_TURN);
|
||
|
|
||
|
if (this_event == NPC_THROW_DART_EVENT) {
|
||
|
//SpeakString("NPC_THROW_DART_EVENT event");
|
||
|
//object dart = CreateItemOnObject(DART_ITEM);
|
||
|
//ActionEquipItem(dart, INVENTORY_SLOT_RIGHTHAND);
|
||
|
setBestTarget();
|
||
|
ActionAttack(getDB());
|
||
|
}
|
||
|
else if (this_event == NPC_START_TURN) {
|
||
|
//SpeakString("NPC_START_TURN event");
|
||
|
ActionDoCommand(SetLocalInt(OBJECT_SELF,"BUSY",1));
|
||
|
object dart = CreateItemOnObject(DART_ITEM, OBJECT_SELF, 50);
|
||
|
SetLocalObject(OBJECT_SELF, "DART_OBJ", dart);
|
||
|
ActionEquipItem(dart, INVENTORY_SLOT_RIGHTHAND);
|
||
|
location throw_pos = GetLocation(GetWaypointByTag(THROW_WAYPOINT));
|
||
|
ActionWait(1.0);
|
||
|
ActionMoveToLocation(throw_pos);
|
||
|
setBestTarget();
|
||
|
ActionAttack(getDB());
|
||
|
}
|
||
|
else if (this_event == NPC_END_TURN) {
|
||
|
//SpeakString("NPC_END_TURN event");
|
||
|
ActionWait(1.0);
|
||
|
ClearAllActions();
|
||
|
WalkWayPoints();
|
||
|
ActionDoCommand(SetLocalInt(OBJECT_SELF,"BUSY",0));
|
||
|
}
|
||
|
else if (this_event == NPC_WIN) {
|
||
|
//SpeakString("NPC_WIN event");
|
||
|
SpeakString("I won!");
|
||
|
ClearAllActions();
|
||
|
WalkWayPoints();
|
||
|
object dart = GetLocalObject(OBJECT_SELF, "DART_OBJ");
|
||
|
DestroyObject(dart);
|
||
|
ActionDoCommand(SetLocalInt(OBJECT_SELF,"BUSY",0));
|
||
|
}
|
||
|
else if (this_event == NPC_LOSE) {
|
||
|
//SpeakString("NPC_LOSE event");
|
||
|
SpeakString("What? I lost!");
|
||
|
ClearAllActions();
|
||
|
WalkWayPoints();
|
||
|
object dart = GetLocalObject(OBJECT_SELF, "DART_OBJ");
|
||
|
DestroyObject(dart);
|
||
|
ActionDoCommand(SetLocalInt(OBJECT_SELF,"BUSY",0));
|
||
|
}
|
||
|
}
|