I figured out why commoner types weren't using civilized animations

Most changes were due to that and other behaviors I wanted ambient npcs to do.
This commit is contained in:
EpicValor
2023-09-09 19:56:22 -05:00
parent 80bc1e0c92
commit c369af5071
119 changed files with 50579 additions and 4558 deletions

View File

@@ -1,9 +1,13 @@
void main()
{
if ( GetLocalInt(GetModule(), "DO_ONCE__" + GetTag(OBJECT_SELF)) )
return;
SetLocalInt(GetModule(), "DO_ONCE__" + GetTag(OBJECT_SELF), TRUE);
object oTarget = OBJECT_SELF;
effect eMind = EffectVisualEffect(VFX_DUR_PROT_BARKSKIN, VFX_DUR_PETRIFY);
effect eMind2 = EffectVisualEffect(VFX_DUR_GHOST_TRANSPARENT);
DelayCommand(1.0,ApplyEffectToObject(DURATION_TYPE_PERMANENT, eMind, oTarget));
DelayCommand(1.0,ApplyEffectToObject(DURATION_TYPE_PERMANENT, eMind2, oTarget));
SetLocalInt(OBJECT_SELF, "X1_L_IMMUNE_TO_DISPEL", 10);
SetLocalInt(OBJECT_SELF, "X1_L_IMMUNE_TO_DISPEL", 100);
}

View File

@@ -0,0 +1,34 @@
/*
* Script generated by LS Script Generator, v.TK.0
*
* For download info, please visit:
* http://nwvault.ign.com/View.php?view=Other.Detail&id=1502
*/
// Put this OnHeartbeat.
// Will abort (do nothing) if fighting or talking or if no PCs are in the area.
#include "NW_I0_GENERIC"
#include "x0_i0_anims"
void main()
{
// If running the lowest AI, abort for performance reasons.
if ( GetAILevel() == AI_LEVEL_VERY_LOW )
return;
// If busy with combat or conversation, skip this heartbeat.
if ( IsInConversation(OBJECT_SELF) || GetIsInCombat() )
return;
// Abort if failed a 5% chance.
if ( Random(100) >= 30 )
return;
object oBud = GetRandomFriend(5.0);
// If we found one, start talking to them.
if(OBJECT_INVALID != oBud)
{
AnimActionStartTalking(oBud);
}
}

View File

@@ -0,0 +1,17 @@
//::///////////////////////////////////////////////
//:: Name x2_def_percept
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Default On Perception script
*/
//:://////////////////////////////////////////////
//:: Created By: Keith Warner
//:: Created On: June 11/03
//:://////////////////////////////////////////////
void main()
{
ExecuteScript("nw_c2_default2", OBJECT_SELF);
ExecuteScript("findfriend", OBJECT_SELF);
}

View File

@@ -2,7 +2,7 @@
//:: npc_sit_stay
//:://////////////////////////////////////////////
/*Goes on the OnSpawn and OnConversation script of the NPC that you want to stay <span class="highlight">seated</span>*/
#include "nw_i0_spells"
//#include "nw_i0_spells"
#include "NW_I0_GENERIC"
void main()
{
@@ -55,6 +55,8 @@ void main()
ActionMoveToObject (oWay, FALSE);
}
DelayCommand(GetRandomDelay(180.0, 300.0), ExecuteScript("npc_sit_chair", OBJECT_SELF));
int nTime = Random(180) + 120;
float fTime = IntToFloat(nTime);
DelayCommand(fTime, ExecuteScript("npc_sit_chair", OBJECT_SELF));
}

View File

@@ -4,59 +4,19 @@
/*Goes on the OnSpawn and OnConversation script of the NPC that you want to stay <span class="highlight">seated</span>*/
#include "nw_i0_spells"
#include "NW_I0_GENERIC"
#include "x0_i0_anims"
void main()
{
int nMatch = GetListenPatternNumber();
object oShouter = GetLastSpeaker();
object oIntruder;
if (nMatch == -1 && GetCommandable(OBJECT_SELF))
{
ClearAllActions();
}
else
if(nMatch != -1 && GetIsObjectValid(oShouter) && !GetIsPC(oShouter) && GetIsFriend(oShouter))
{
if(nMatch == 4)
{
oIntruder = GetLocalObject(oShouter, "NW_BLOCKER_INTRUDER");
}
else if (nMatch == 5)
{
oIntruder = GetLastHostileActor(oShouter);
if(!GetIsObjectValid(oIntruder))
{
oIntruder = GetAttemptedAttackTarget();
if(!GetIsObjectValid(oIntruder))
{
oIntruder = GetAttemptedSpellTarget();
if(!GetIsObjectValid(oIntruder))
{
oIntruder = OBJECT_INVALID;
}
}
}
}
RespondToShout(oShouter, nMatch, oIntruder);
}
if(GetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT))
{
SignalEvent(OBJECT_SELF, EventUserDefined(1004));
}
if(GetCommandable(OBJECT_SELF))
{
//{
//BeginConversation();
//}
SetAILevel (OBJECT_SELF, AI_LEVEL_HIGH);
ClearAllActions();
int nChair = 50;
string sMyTagName = GetTag(OBJECT_SELF);
string sSittableTagName = "CHAIR";
object oChair = GetRandomObjectByTag(sSittableTagName, 110.0);
ActionMoveToObject (oChair, FALSE);
object oChair = GetRandomObjectByTag(sSittableTagName, 90.0);
ActionForceMoveToObject (oChair, FALSE, 1.0f, 120.0);
ActionSit(oChair);
}
DelayCommand(GetRandomDelay(180.0, 300.0), ExecuteScript("npc_sit_chair", OBJECT_SELF));
int nTime = Random(210) + 90;
float fTime = IntToFloat(nTime);
DelayCommand(fTime, ExecuteScript("npc_sit_chair", OBJECT_SELF));
}

View File

@@ -4,59 +4,19 @@
/*Goes on the OnSpawn and OnConversation script of the NPC that you want to stay <span class="highlight">seated</span>*/
#include "nw_i0_spells"
#include "NW_I0_GENERIC"
#include "x0_i0_anims"
void main()
{
int nMatch = GetListenPatternNumber();
object oShouter = GetLastSpeaker();
object oIntruder;
if (nMatch == -1 && GetCommandable(OBJECT_SELF))
{
ClearAllActions();
}
else
if(nMatch != -1 && GetIsObjectValid(oShouter) && !GetIsPC(oShouter) && GetIsFriend(oShouter))
{
if(nMatch == 4)
{
oIntruder = GetLocalObject(oShouter, "NW_BLOCKER_INTRUDER");
}
else if (nMatch == 5)
{
oIntruder = GetLastHostileActor(oShouter);
if(!GetIsObjectValid(oIntruder))
{
oIntruder = GetAttemptedAttackTarget();
if(!GetIsObjectValid(oIntruder))
{
oIntruder = GetAttemptedSpellTarget();
if(!GetIsObjectValid(oIntruder))
{
oIntruder = OBJECT_INVALID;
}
}
}
}
RespondToShout(oShouter, nMatch, oIntruder);
}
if(GetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT))
{
SignalEvent(OBJECT_SELF, EventUserDefined(1004));
}
if(GetCommandable(OBJECT_SELF))
{
//{
//BeginConversation();
//}
ClearAllActions();
int nChair = 1;
SetAILevel (OBJECT_SELF, AI_LEVEL_HIGH);
string sMyTagName = GetTag(OBJECT_SELF);
string sSittableTagName = "CHAIR_" + sMyTagName;
object oChair = GetRandomObjectByTag(sSittableTagName, 110.0);
ActionMoveToObject (oChair, FALSE);
object oChair = GetRandomObjectByTag(sSittableTagName, 77.0);
ActionForceMoveToObject (oChair, FALSE, 1.0f, 120.0);
ActionSit(oChair);
}
DelayCommand(GetRandomDelay(120.0, 300.0), ExecuteScript("npc_sit_stay", OBJECT_SELF));
int nTime = Random(210) + 90;
float fTime = IntToFloat(nTime);
DelayCommand(fTime, ExecuteScript("npc_sit_stay", OBJECT_SELF));
}

View File

@@ -4,59 +4,18 @@
/*Goes on the OnSpawn and OnConversation script of the NPC that you want to stay <span class="highlight">seated</span>*/
#include "nw_i0_spells"
#include "NW_I0_GENERIC"
#include "x0_i0_anims"
void main()
{
int nMatch = GetListenPatternNumber();
object oShouter = GetLastSpeaker();
object oIntruder;
if (nMatch == -1 && GetCommandable(OBJECT_SELF))
{
ClearAllActions();
//BeginConversation();
}
else
if(nMatch != -1 && GetIsObjectValid(oShouter) && !GetIsPC(oShouter) && GetIsFriend(oShouter))
{
if(nMatch == 4)
{
oIntruder = GetLocalObject(oShouter, "NW_BLOCKER_INTRUDER");
}
else if (nMatch == 5)
{
oIntruder = GetLastHostileActor(oShouter);
if(!GetIsObjectValid(oIntruder))
{
oIntruder = GetAttemptedAttackTarget();
if(!GetIsObjectValid(oIntruder))
{
oIntruder = GetAttemptedSpellTarget();
if(!GetIsObjectValid(oIntruder))
{
oIntruder = OBJECT_INVALID;
}
}
}
}
RespondToShout(oShouter, nMatch, oIntruder);
}
if(GetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT))
{
SignalEvent(OBJECT_SELF, EventUserDefined(1004));
}
if(GetCommandable(OBJECT_SELF))
{
//{
//BeginConversation();
//}
ClearAllActions();
int nChair = 1;
string sMyTagName = GetTag(OBJECT_SELF);
SetAILevel (OBJECT_SELF, AI_LEVEL_HIGH);
string sSittableTagName = "Woodenbench";
object oChair = GetRandomObjectByTag(sSittableTagName, 110.0);
ActionMoveToObject (oChair, FALSE);
object oChair = GetRandomObjectByTag(sSittableTagName, 100.0);
ActionForceMoveToObject (oChair, FALSE, 1.0f, 120.0);
ActionSit(oChair);
}
DelayCommand(GetRandomDelay(200.0, 280.0), ExecuteScript("npc_sit_woodenbe", OBJECT_SELF));
int nTime = Random(210) + 90;
float fTime = IntToFloat(nTime);
DelayCommand(fTime, ExecuteScript("npc_sit_woodenbe", OBJECT_SELF));
}

View File

@@ -81,7 +81,7 @@ void main()
// * This will cause an NPC to use common animations it possesses,
// * and use social ones to any other nearby friendly NPCs.
// *
//SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
// * Same as above, except NPC will wander randomly around the
// * area.
@@ -245,7 +245,7 @@ void main()
// * and those will be walked at night. (The standard waypoints
// * will be walked during the day.)
// * The night "posting" waypoint tag is simply "NIGHT_" + NPC tag.
WalkWayPoints();
//WalkWayPoints();
//* Create a small amount of treasure on the creature

View File

@@ -9,5 +9,5 @@ void main()
SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
ClearAllActions();
ActionSit (GetNearestObjectByTag ("CHAIR", OBJECT_SELF));
DelayCommand(10.0,ExecuteScript("oldman_sit",OBJECT_SELF));
DelayCommand(6.0,ExecuteScript("oldman_sit",OBJECT_SELF));
}

View File

@@ -20,7 +20,7 @@ void main()
// *
//SetSpawnInCondition(NW_FLAG_HEARTBEAT_EVENT);
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
//SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
//SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
//SetCombatCondition(X0_COMBAT_FLAG_RANGED);
//SetCombatCondition(X0_COMBAT_FLAG_DEFENSIVE);

View File

@@ -1,5 +1,16 @@
#include "nw_o2_coninclude"
#include "x0_i0_walkway"
void main()
{
ActionSit (GetNearestObjectByTag ("CHAIR_Queen", OBJECT_SELF));
DelayCommand(10.0,ExecuteScript("queen_sit",OBJECT_SELF));
// ***** BEGIN DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) ***** //
SetListeningPatterns();
WalkWayPoints();
GenerateNPCTreasure();
// ***** END DEFAULT GENERIC BEHAVIOR ***** //
// Sit in the assigned chair.
string sChairTag = "CHAIR_Queen";
object oChair = GetNearestObjectByTag(sChairTag);
ActionSit(oChair);
}

View File

@@ -0,0 +1,14 @@
void main()
{
if(GetCommandable(OBJECT_SELF))
{
// Standard response, but clear actions *after* the conversation starts.
BeginConversation();
ClearAllActions();
// Sit in the assigned chair.
string sChairTag = "CHAIR_Queen";
object oChair = GetNearestObjectByTag(sChairTag);
ActionSit(oChair);
}
}

View File

@@ -60,7 +60,7 @@ void main()
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
//* If this is set, the NPC will appear using the "EffectAppear" animation instead of fading in.
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
//SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
//* This will play Ambient Animations until the NPC sees an enemy or is cleared.
//* NOTE: These animations will play automatically for Encounter Creatures.
@@ -75,7 +75,7 @@ void main()
NW_FLAG_AMBIENT_ANIMATIONS or NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS.
*/
SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
//SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
//* Civilized creatures interact with placeables in their area that have the tag "NW_INTERACTIVE"
//* and "talk" to each other.
//*
@@ -87,7 +87,7 @@ void main()
//* performing their ambient animations when they first perceive a player, and they will stop when the
//* player moves away.
SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
//SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
//* Civilized creatures with this flag set will randomly use a few voicechats. It's a good idea to avoid
//* putting this on multiple creatures using the same voiceset.

View File

@@ -79,7 +79,7 @@ void main()
SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
// Interacts with placeables + More civilized actions. See Readme.
SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
//SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// Will use random voicechats during animations, if Civilized
// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
@@ -104,7 +104,7 @@ void main()
//SetSpawnInCondition(NW_FLAG_DEATH_EVENT); //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
// DEFAULT GENERIC BEHAVIOR (DO NOT TOUCH) *****************************************************************************************
//GetRandomFriend(20.0);
SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to.
//WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
// 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them

View File

@@ -74,7 +74,7 @@ void main()
SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
// Interacts with placeables + More civilized actions. See Readme.
SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
//SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// Will use random voicechats during animations, if Civilized
// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
@@ -105,13 +105,21 @@ void main()
SetLocalInt(OBJECT_SELF, "iRumor", Random(13) + 1);
SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to.
WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
//WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
// 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them
// 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after
// combat.
GenerateNPCTreasure(); //* Use this to create a small amount of treasure on the creature
DelayCommand(GetRandomDelay(5.0, 15.0), ExecuteScript("npc_sit_woodenbe", OBJECT_SELF));
ClearAllActions();
SetAILevel (OBJECT_SELF, AI_LEVEL_HIGH);
string sSittableTagName = "Woodenbench";
object oChair = GetRandomObjectByTag(sSittableTagName, 100.0);
DelayCommand(60.0, ActionForceMoveToObject (oChair, FALSE, 1.0f, 120.0f));
DelayCommand(60.1, ActionSit(oChair));
int nTime = Random(200) + 90;
float fTime = IntToFloat(nTime);
DelayCommand(fTime, ExecuteScript("npc_sit_woodenbe", OBJECT_SELF));
}

View File

@@ -11,7 +11,7 @@
//:: Created By: Preston Watamaniuk
//:: Created On: Oct 25, 2001
//:://////////////////////////////////////////////
#include "nw_i0_spells"
#include "ms_name_inc"
#include "rnd_commoner_inc"
#include "NW_O2_CONINCLUDE"
@@ -74,7 +74,7 @@ void main()
SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
// Interacts with placeables + More civilized actions. See Readme.
SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
//SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// Will use random voicechats during animations, if Civilized
// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
@@ -105,12 +105,20 @@ void main()
SetLocalInt(OBJECT_SELF, "iRumor", Random(13) + 1);
SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to.
WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
//WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
// 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them
// 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after
// combat.
GenerateNPCTreasure(); //* Use this to create a small amount of treasure on the creature
DelayCommand(10.5, ExecuteScript("npc_sit_chair", OBJECT_SELF));
ClearAllActions();
string sSittableTagName = "CHAIR";
object oChair = GetRandomObjectByTag(sSittableTagName, 90.0);
DelayCommand(60.0, ActionForceMoveToObject (oChair, FALSE, 1.0f, 120.0f));
DelayCommand(60.1, ActionSit(oChair));
int nTime = Random(200) + 90;
float fTime = IntToFloat(nTime);
DelayCommand(fTime, ExecuteScript("npc_sit_chair", OBJECT_SELF));
}

View File

@@ -74,7 +74,7 @@ void main()
SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
// Interacts with placeables + More civilized actions. See Readme.
SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
//SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
// Will use random voicechats during animations, if Civilized
// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
@@ -111,7 +111,16 @@ void main()
// combat.
GenerateNPCTreasure(); //* Use this to create a small amount of treasure on the creature
DelayCommand(GetRandomDelay(5.0, 15.0), ExecuteScript("npc_sit_stay", OBJECT_SELF));
ClearAllActions();
SetAILevel (OBJECT_SELF, AI_LEVEL_HIGH);
string sMyTagName = GetTag(OBJECT_SELF);
string sSittableTagName = "CHAIR_" + sMyTagName;
object oChair = GetRandomObjectByTag(sSittableTagName, 77.0);
DelayCommand(60.0, ActionForceMoveToObject (oChair, FALSE, 1.0f, 120.0f));
DelayCommand(60.1, ActionSit(oChair));
int nTime = Random(200) + 90;
float fTime = IntToFloat(nTime);
DelayCommand(fTime, ExecuteScript("npc_sit_stay", OBJECT_SELF));
}

View File

@@ -67,14 +67,14 @@ void main()
//SetSpawnInCondition(NW_FLAG_APPEAR_SPAWN_IN_ANIMATION);
//SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
//SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS);
SetSpawnInCondition(NW_FLAG_AMBIENT_ANIMATIONS, TRUE);
//This will play Ambient Animations until the NPC sees an enemy or is cleared.
//NOTE that these animations will play automatically for Encounter Creatures.
//SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED, TRUE);
// Interacts with placeables + More civilized actions. See Readme.
//SetAnimationCondition(NW_ANIM_FLAG_CHATTER);
//SetAnimationCondition(NW_ANIM_FLAG_CHATTER, TRUE);
// Will use random voicechats during animations, if Civilized
// NOTE: ONLY ONE OF THE FOLOOWING ESCAPE COMMANDS SHOULD EVER BE ACTIVATED AT ANY ONE TIME.
@@ -102,16 +102,21 @@ void main()
SetLocalInt(OBJECT_SELF, "iDialogue", Random(10) + 1);
SetLocalInt(OBJECT_SELF, "iRumor", Random(60) + 1);
SetLocalInt(OBJECT_SELF, "iRumor", Random(5) + 1);
SetListeningPatterns(); // Goes through and sets up which shouts the NPC will listen to.
WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
//WalkWayPoints(); // Optional Parameter: void WalkWayPoints(int nRun = FALSE, float fPause = 1.0)
// 1. Looks to see if any Way Points in the module have the tag "WP_" + NPC TAG + "_0X", if so walk them
// 2. If the tag of the Way Point is "POST_" + NPC TAG the creature will return this way point after
// combat.
GenerateNPCTreasure(); //* Use this to create a small amount of treasure on the creature
DelayCommand(GetRandomDelay(5.0, 15.0), ExecuteScript("re_rndwayp_go", OBJECT_SELF));
ClearAllActions();
object oWalk = GetRandomObjectByTag("CityNoble", 50.0);
DelayCommand(60.0, ActionForceMoveToObject (oWalk, FALSE, 1.0f, 120.0f));
int nTime = Random(60) + 60;
float fTime = IntToFloat(nTime);
DelayCommand(fTime, ExecuteScript("re_rndwayp_go", OBJECT_SELF));
}

View File

@@ -6,55 +6,11 @@
#include "NW_I0_GENERIC"
void main()
{
int nMatch = GetListenPatternNumber();
object oShouter = GetLastSpeaker();
object oIntruder;
if (nMatch == -1 && GetCommandable(OBJECT_SELF))
{
ClearAllActions();
}
else
if(nMatch != -1 && GetIsObjectValid(oShouter) && !GetIsPC(oShouter) && GetIsFriend(oShouter))
{
if(nMatch == 4)
{
oIntruder = GetLocalObject(oShouter, "NW_BLOCKER_INTRUDER");
}
else if (nMatch == 5)
{
oIntruder = GetLastHostileActor(oShouter);
if(!GetIsObjectValid(oIntruder))
{
oIntruder = GetAttemptedAttackTarget();
if(!GetIsObjectValid(oIntruder))
{
oIntruder = GetAttemptedSpellTarget();
if(!GetIsObjectValid(oIntruder))
{
oIntruder = OBJECT_INVALID;
}
}
}
}
RespondToShout(oShouter, nMatch, oIntruder);
}
if(GetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT))
{
SignalEvent(OBJECT_SELF, EventUserDefined(1004));
}
if(GetCommandable(OBJECT_SELF))
{
//{
//BeginConversation();
//}
ClearAllActions();
string sWay = "NW_STOP";
object oWay = GetRandomObjectByTag(sWay, 110.0);
ActionMoveToObject (oWay, FALSE);
}
DelayCommand(GetRandomDelay(180.0, 300.0), ExecuteScript("re_rndwayp_go", OBJECT_SELF));
object oWalk = GetRandomObjectByTag("CityNoble", 50.0);
ActionForceMoveToObject (oWalk, FALSE, 1.0f, 120.0f);
int nTime = Random(60) + 60;
float fTime = IntToFloat(nTime);
DelayCommand(fTime, ExecuteScript("re_rndwayp_go", OBJECT_SELF));
}

View File

@@ -0,0 +1,32 @@
/*
* Script generated by LS Script Generator, v.TK.0
*
* For download info, please visit:
* http://nwvault.ign.com/View.php?view=Other.Detail&id=1502
*/
// Put this OnHeartbeat.
// Will abort (do nothing) if fighting or talking or if no PCs are in the area.
#include "NW_I0_GENERIC"
#include "x0_i0_anims"
void main()
{
// If running the lowest AI, abort for performance reasons.
if ( GetAILevel() == AI_LEVEL_VERY_LOW )
return;
// If busy with combat or conversation, skip this heartbeat.
if ( IsInConversation(OBJECT_SELF) || GetIsInCombat() )
return;
// Abort if failed a 5% chance.
if ( Random(100) >= 10 )
return;
// Have us perform a sequence of actions.
string sSittableTagName = "Woodenbench";
object oChair = GetRandomObjectByTag(sSittableTagName, 70.0);
ActionForceMoveToObject (oChair, FALSE, 1.0f, 120.0);
ActionSit(oChair);
}

View File

@@ -1,11 +1,15 @@
void main()
{
if ( GetLocalInt(GetModule(), "DO_ONCE__" + GetTag(OBJECT_SELF)) )
return;
SetLocalInt(GetModule(), "DO_ONCE__" + GetTag(OBJECT_SELF), TRUE);
object oTarget = OBJECT_SELF;
effect eMind2 = EffectCutsceneParalyze();
effect eMind = EffectVisualEffect(VFX_DUR_PETRIFY);
DelayCommand(1.0,ApplyEffectToObject(DURATION_TYPE_PERMANENT, eMind, oTarget));
DelayCommand(1.0,ApplyEffectToObject(DURATION_TYPE_PERMANENT, eMind2, oTarget));
SetLocalInt(OBJECT_SELF, "X1_L_IMMUNE_TO_DISPEL", 10);
}

1934
_module/nss/x0_i0_anims.nss Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,18 @@
//::///////////////////////////////////////////////
//:: Name x2_def_heartbeat
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Default Heartbeat script
*/
//:://////////////////////////////////////////////
//:: Created By: Keith Warner
//:: Created On: June 11/03
//:://////////////////////////////////////////////
void main()
{
ExecuteScript("nw_c2_default1", OBJECT_SELF);
}

View File

@@ -0,0 +1,16 @@
//::///////////////////////////////////////////////
//:: Name x2_def_heartbeat
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Default Heartbeat script
*/
//:://////////////////////////////////////////////
//:: Created By: Keith Warner
//:: Created On: June 11/03
//:://////////////////////////////////////////////
void main()
{
ExecuteScript("nw_c2_default1", OBJECT_SELF);
}

View File

@@ -0,0 +1,17 @@
//::///////////////////////////////////////////////
//:: Name x2_def_heartbeat
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Default Heartbeat script
*/
//:://////////////////////////////////////////////
//:: Created By: Keith Warner
//:: Created On: June 11/03
//:://////////////////////////////////////////////
void main()
{
ExecuteScript("nw_c2_default1", OBJECT_SELF);
ExecuteScript("sitwoodbench", OBJECT_SELF);
}

View File

@@ -0,0 +1,93 @@
//::///////////////////////////////////////////////
//:: Name x2_def_spawn
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Default On Spawn script
2003-07-28: Georg Zoeller:
If you set a ninteger on the creature named
"X2_USERDEFINED_ONSPAWN_EVENTS"
The creature will fire a pre and a post-spawn
event on itself, depending on the value of that
variable
1 - Fire Userdefined Event 1510 (pre spawn)
2 - Fire Userdefined Event 1511 (post spawn)
3 - Fire both events
2007-12-31: Deva Winblood
Modified to look for X3_HORSE_OWNER_TAG and if
it is defined look for an NPC with that tag
nearby or in the module (checks near first).
It will make that NPC this horse's master.
*/
//:://////////////////////////////////////////////
//:: Created By: Keith Warner, Georg Zoeller
//:: Created On: June 11/03
//:://////////////////////////////////////////////
const int EVENT_USER_DEFINED_PRESPAWN = 1510;
const int EVENT_USER_DEFINED_POSTSPAWN = 1511;
#include "x2_inc_switches"
void main()
{
SetSpawnInCondition(NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);
SetAnimationCondition(NW_ANIM_FLAG_IS_CIVILIZED);
string sTag;
object oNPC;
// User defined OnSpawn event requested?
int nSpecEvent = GetLocalInt(OBJECT_SELF,"X2_USERDEFINED_ONSPAWN_EVENTS");
// Pre Spawn Event requested
if (nSpecEvent == 1 || nSpecEvent == 3 )
{
SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_PRESPAWN ));
}
sTag=GetLocalString(OBJECT_SELF,"X3_HORSE_OWNER_TAG");
if (GetStringLength(sTag)>0)
{ // look for master
oNPC=GetNearestObjectByTag(sTag);
if (GetIsObjectValid(oNPC)&&GetObjectType(oNPC)==OBJECT_TYPE_CREATURE)
{ // master found
AddHenchman(oNPC);
} // master found
else
{ // look in module
oNPC=GetObjectByTag(sTag);
if (GetIsObjectValid(oNPC)&&GetObjectType(oNPC)==OBJECT_TYPE_CREATURE)
{ // master found
AddHenchman(oNPC);
} // master found
else
{ // master does not exist - remove X3_HORSE_OWNER_TAG
DeleteLocalString(OBJECT_SELF,"X3_HORSE_OWNER_TAG");
} // master does not exist - remove X3_HORSE_OWNER_TAG
} // look in module
} // look for master
/* Fix for the new golems to reduce their number of attacks */
int nNumber = GetLocalInt(OBJECT_SELF,CREATURE_VAR_NUMBER_OF_ATTACKS);
if (nNumber >0 )
{
SetBaseAttackBonus(nNumber);
}
// Execute default OnSpawn script.
ExecuteScript("nw_c2_default9", OBJECT_SELF);
//Post Spawn event requeste
if (nSpecEvent == 2 || nSpecEvent == 3)
{
SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_POSTSPAWN));
}
}

View File

@@ -0,0 +1,17 @@
//::///////////////////////////////////////////////
//:: Name x2_def_percept
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Default On Perception script
*/
//:://////////////////////////////////////////////
//:: Created By: Keith Warner
//:: Created On: June 11/03
//:://////////////////////////////////////////////
void main()
{
ExecuteScript("nw_c2_default2", OBJECT_SELF);
}