145 lines
5.1 KiB
Plaintext
145 lines
5.1 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"
|
|
string sSayThis;
|
|
int iTalkVolume = TALKVOLUME_TALK;
|
|
int iRollTen = d10(1);
|
|
int iTalkFlag = 0;
|
|
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));
|
|
}
|
|
|
|
if(d100(1) > 71) //Gives this script a 30% chance of completing
|
|
{ //Its execution. Call it my anti-spam code. (c:
|
|
if(iRollTen != 0) //Just in case a 0 slips in though I don't think
|
|
{ //It's possible.
|
|
switch(iRollTen) //Jump to the rolled statement number.
|
|
{
|
|
case 1:
|
|
sSayThis = "My father had to help fix that mess that Zolad made.";
|
|
break;
|
|
case 2:
|
|
sSayThis = "Mr. Gledd is asking us to help with the problem in the cemetery.";
|
|
break;
|
|
case 3:
|
|
sSayThis = "Last I heard...the King asked him to go into the sewers to find it.";
|
|
break;
|
|
case 4:
|
|
sSayThis = "Maybe you should come with us next time.";
|
|
break;
|
|
case 5:
|
|
sSayThis = "A friend of ours blessed a home in the center of town. It is a safe haven if you go back.";
|
|
break;
|
|
case 6:
|
|
sSayThis = "You should have Father Glubryn take a look.";
|
|
break;
|
|
case 7:
|
|
sSayThis = "Then what did you do?";
|
|
break;
|
|
case 8:
|
|
sSayThis = "Well he was standing there with this double bladed sword...";
|
|
break;
|
|
case 9:
|
|
sSayThis = "I think I might stay here for a few days before going back out.";
|
|
break;
|
|
case 10:
|
|
sSayThis = "The King? He asked us to find out who is under control of the Thieves' Guild.";
|
|
break;
|
|
}
|
|
SpeakString(sSayThis, iTalkVolume);
|
|
}
|
|
}
|
|
}
|