162 lines
6.7 KiB
Plaintext
162 lines
6.7 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"
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
if(GetSpawnInCondition(NW_FLAG_FAST_BUFF_ENEMY))
|
||
|
{
|
||
|
if(TalentAdvancedBuff(40.0))
|
||
|
{
|
||
|
SetSpawnInCondition(NW_FLAG_FAST_BUFF_ENEMY, FALSE);
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if(GetSpawnInCondition(NW_FLAG_DAY_NIGHT_POSTING))
|
||
|
{
|
||
|
int nDay = FALSE;
|
||
|
if(GetIsDay() || GetIsDawn())
|
||
|
{
|
||
|
nDay = TRUE;
|
||
|
}
|
||
|
if(GetLocalInt(OBJECT_SELF, "NW_GENERIC_DAY_NIGHT") != nDay)
|
||
|
{
|
||
|
if(nDay == TRUE)
|
||
|
{
|
||
|
SetLocalInt(OBJECT_SELF, "NW_GENERIC_DAY_NIGHT", TRUE);
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
SetLocalInt(OBJECT_SELF, "NW_GENERIC_DAY_NIGHT", FALSE);
|
||
|
}
|
||
|
WalkWayPoints();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if(!GetHasEffect(EFFECT_TYPE_SLEEP))
|
||
|
{
|
||
|
if(!GetIsPostOrWalking())
|
||
|
{
|
||
|
if(!GetIsObjectValid(GetAttemptedAttackTarget()) && !GetIsObjectValid(GetAttemptedSpellTarget()))
|
||
|
{
|
||
|
if(!GetIsObjectValid(GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN)))
|
||
|
{
|
||
|
if(!GetBehaviorState(NW_FLAG_BEHAVIOR_SPECIAL) && !IsInConversation(OBJECT_SELF))
|
||
|
{
|
||
|
if(GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS) || GetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS_AVIAN))
|
||
|
{
|
||
|
PlayMobileAmbientAnimations();
|
||
|
}
|
||
|
else if(GetIsEncounterCreature() &&
|
||
|
!GetIsObjectValid(GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN)))
|
||
|
{
|
||
|
PlayMobileAmbientAnimations();
|
||
|
}
|
||
|
else if(GetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS) &&
|
||
|
!GetIsObjectValid(GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN)))
|
||
|
{
|
||
|
PlayImmobileAmbientAnimations();
|
||
|
}
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
DetermineSpecialBehavior();
|
||
|
}
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
DetermineCombatRound();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
if(GetSpawnInCondition(NW_FLAG_SLEEPING_AT_NIGHT))
|
||
|
{
|
||
|
effect eVis = EffectVisualEffect(VFX_IMP_SLEEP);
|
||
|
if(d10() > 6)
|
||
|
{
|
||
|
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
if(GetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT))
|
||
|
{
|
||
|
SignalEvent(OBJECT_SELF, EventUserDefined(1001));
|
||
|
}
|
||
|
|
||
|
{
|
||
|
object oNPC = OBJECT_SELF;
|
||
|
object oArea = GetArea (oNPC);
|
||
|
vector vPosition = GetPosition (oNPC);
|
||
|
float fOrientation = GetFacing (oNPC);
|
||
|
location lSpawn = Location (oArea, vPosition, fOrientation);
|
||
|
if(GetIsDay()) {
|
||
|
if (GetTag(oNPC) == "RHUN_WRCAT1") {
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "human006", lSpawn, TRUE);
|
||
|
AssignCommand(oNPC, SetIsDestroyable(TRUE));
|
||
|
DestroyObject(oNPC);
|
||
|
} else if (GetTag(oNPC) == "RHUN_WRCAT2") {
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "human2", lSpawn, TRUE);
|
||
|
AssignCommand(oNPC, SetIsDestroyable(TRUE)); AssignCommand(oNPC, SetIsDestroyable(TRUE)); DestroyObject(oNPC);
|
||
|
} else if (GetTag(oNPC) == "RHUN_WRCAT3") {
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "human008", lSpawn, TRUE);
|
||
|
AssignCommand(oNPC, SetIsDestroyable(TRUE)); DestroyObject(oNPC);
|
||
|
} else if (GetTag(oNPC) == "RHUN_WRCAT4") {
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "human003", lSpawn, TRUE);
|
||
|
AssignCommand(oNPC, SetIsDestroyable(TRUE)); DestroyObject(oNPC);
|
||
|
} else if (GetTag(oNPC) == "RHUN_WRCAT5") {
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "human007", lSpawn, TRUE);
|
||
|
AssignCommand(oNPC, SetIsDestroyable(TRUE)); DestroyObject(oNPC);
|
||
|
} else if (GetTag(oNPC) == "RHUN_WRCAT6") {
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "human004", lSpawn, TRUE);
|
||
|
AssignCommand(oNPC, SetIsDestroyable(TRUE)); DestroyObject(oNPC);
|
||
|
} else if (GetTag(oNPC) == "RHUN_WRCAT7") {
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "sano", lSpawn, TRUE);
|
||
|
AssignCommand(oNPC, SetIsDestroyable(TRUE)); DestroyObject(oNPC);
|
||
|
} else if (GetTag(oNPC) == "RHUN_WRCAT8") {
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "human005", lSpawn, TRUE);
|
||
|
AssignCommand(oNPC, SetIsDestroyable(TRUE)); DestroyObject(oNPC);
|
||
|
}}
|
||
|
else {
|
||
|
if (GetTag(oNPC) == "RHUN_CATHUM1") {
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "werecat001", lSpawn, TRUE);
|
||
|
AssignCommand(oNPC, SetIsDestroyable(TRUE)); DestroyObject(oNPC);
|
||
|
} else if (GetTag(oNPC) == "RHUN_CATHUM2") {
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "werecat002", lSpawn, TRUE);
|
||
|
AssignCommand(oNPC, SetIsDestroyable(TRUE)); DestroyObject(oNPC);
|
||
|
} else if (GetTag(oNPC) == "RHUN_CATHUM3") {
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "werecat003", lSpawn, TRUE);
|
||
|
AssignCommand(oNPC, SetIsDestroyable(TRUE)); DestroyObject(oNPC);
|
||
|
} else if (GetTag(oNPC) == "RHUN_CATHUM4") {
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "werecat004", lSpawn, TRUE);
|
||
|
AssignCommand(oNPC, SetIsDestroyable(TRUE)); DestroyObject(oNPC);
|
||
|
} else if (GetTag(oNPC) == "RHUN_CATHUM5") {
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "werecat005", lSpawn, TRUE);
|
||
|
AssignCommand(oNPC, SetIsDestroyable(TRUE)); DestroyObject(oNPC);
|
||
|
} else if (GetTag(oNPC) == "RHUN_CATHUM6") {
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "werecat006", lSpawn, TRUE);
|
||
|
AssignCommand(oNPC, SetIsDestroyable(TRUE)); DestroyObject(oNPC);
|
||
|
} else if (GetTag(oNPC) == "RHUN_CATHUM7") {
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "werecat007", lSpawn, TRUE);
|
||
|
AssignCommand(oNPC, SetIsDestroyable(TRUE)); DestroyObject(oNPC);
|
||
|
} else if (GetTag(oNPC) == "RHUN_CATHUM8") {
|
||
|
CreateObject(OBJECT_TYPE_CREATURE, "werecat008", lSpawn, TRUE);
|
||
|
AssignCommand(oNPC, SetIsDestroyable(TRUE)); DestroyObject(oNPC);}}
|
||
|
}
|
||
|
|
||
|
}
|