Sarum City enhancements
Adjusted commoner type npc behavior scripts.
This commit is contained in:
@@ -397,7 +397,8 @@ void sp_CheckVars(object oNearest, string sCurrentName)
|
||||
GetLocalInt(oNearest, "ReturnHome") ||
|
||||
GetLocalInt(oNearest, "RandomFacing") ||
|
||||
GetLocalInt(oNearest, "ForceAttack") ||
|
||||
GetLocalInt(oNearest, "PlayAnim"))
|
||||
GetLocalInt(oNearest, "PlayAnim") ||
|
||||
GetLocalInt(oNearest, "PickupItems"))
|
||||
SetLocalInt(oNearest, "DoActions", 1);
|
||||
}
|
||||
|
||||
@@ -780,7 +781,8 @@ int sp_CheckObjects(object oNearest)
|
||||
// TEST
|
||||
// ActionDoCommand(sp_PerformActions(oNearest, oCurrent));
|
||||
sp_PerformActions(oNearest, oCurrent);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if (oCurrent != OBJECT_INVALID && GetIsDead(oCurrent)) {
|
||||
DeleteLocalObject(oNearest, "Creature" + IntToString(iCreature));
|
||||
@@ -1314,11 +1316,12 @@ void sp_TagObject(object oNearest, string sTagType, object oNewObject) {
|
||||
}
|
||||
}
|
||||
if (GetLocalInt(oNearest, "ForceAttack")) {
|
||||
object oPC = GetLocalObject(oNearest, "NearestPC");
|
||||
object oPC = GetLocalObject(oNearest, "NearestPC");
|
||||
if (oPC != OBJECT_INVALID) {
|
||||
AssignCommand(oNewObject, ClearAllActions());
|
||||
AssignCommand(oNewObject, ActionAttack(oPC));
|
||||
}
|
||||
|
||||
}
|
||||
// Debug
|
||||
if (iDebug == 1) {
|
||||
@@ -1583,6 +1586,20 @@ location sp_RandomLocation(object oNearest, int iRandArea)
|
||||
}
|
||||
void sp_PerformActions(object oNearest, object oCurrent) {
|
||||
|
||||
if (GetLocalInt(oNearest, "PickupItems"))
|
||||
{
|
||||
object oPickup = GetNearestObject(OBJECT_TYPE_ITEM, oCurrent);
|
||||
if (GetDistanceBetweenLocations(GetLocation(oCurrent),
|
||||
GetLocation(oPickup)) < 8.0)
|
||||
{
|
||||
|
||||
object oCurrent = GetNearestCreatureToLocation(CREATURE_TYPE_PLAYER_CHAR, FALSE, GetLocation(oPickup), 1, CREATURE_TYPE_IS_ALIVE, TRUE);
|
||||
AssignCommand(oCurrent, ClearAllActions());
|
||||
AssignCommand(oCurrent, ActionForceMoveToObject(oPickup, FALSE, 1.0f, 10.0f));
|
||||
AssignCommand(oCurrent, ActionPickUpItem(oPickup));
|
||||
AssignCommand(oCurrent, SpeakString("Ooo, a piece of candy!"));
|
||||
}
|
||||
}
|
||||
// Debug
|
||||
if (iDebug == 3) {
|
||||
sp_Debug("sp_PerformActions");
|
||||
@@ -2122,5 +2139,7 @@ void sp_Main(object oNearest) {
|
||||
if (iIsValid && iToSpawn) {
|
||||
AssignCommand(OBJECT_SELF, sp_CreateObject(oNearest, sBluePrint, iToSpawn));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
28
_module/nss/cutsceneghost.nss
Normal file
28
_module/nss/cutsceneghost.nss
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* 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.
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
effect eEffect;
|
||||
object oSelf = OBJECT_SELF;
|
||||
|
||||
// If running the lowest AI, abort for performance reasons.
|
||||
if ( GetAILevel() == AI_LEVEL_VERY_LOW )
|
||||
return;
|
||||
// Only fire once.
|
||||
if ( GetLocalInt(GetModule(), "DO_ONCE__" + GetTag(OBJECT_SELF)) )
|
||||
return;
|
||||
SetLocalInt(GetModule(), "DO_ONCE__" + GetTag(OBJECT_SELF), TRUE);
|
||||
|
||||
// Apply an effect.
|
||||
eEffect = SupernaturalEffect(EffectCutsceneGhost());
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oSelf);
|
||||
}
|
||||
|
24
_module/nss/cutsceneinvisibl.nss
Normal file
24
_module/nss/cutsceneinvisibl.nss
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* 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.
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
effect eVFX;
|
||||
object oSelf = OBJECT_SELF;
|
||||
|
||||
// Only fire once.
|
||||
if ( GetLocalInt(GetModule(), "DO_ONCE__" + GetTag(OBJECT_SELF)) )
|
||||
return;
|
||||
// Apply a visual effect.
|
||||
eVFX = SupernaturalEffect(EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY));
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eVFX, oSelf);
|
||||
DelayCommand (1.0, SetLocalInt(GetModule(), "DO_ONCE__" + GetTag(OBJECT_SELF), TRUE));
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@ void main()
|
||||
SetAILevel (OBJECT_SELF, AI_LEVEL_HIGH);
|
||||
ClearAllActions();
|
||||
string sSittableTagName = "CHAIR";
|
||||
object oChair = GetRandomObjectByTag(sSittableTagName, 90.0);
|
||||
object oChair = GetRandomObjectByTag(sSittableTagName, 110.0);
|
||||
ActionForceMoveToObject (oChair, FALSE, 1.0f, 120.0);
|
||||
ActionSit(oChair);
|
||||
int nTime = Random(210) + 90;
|
||||
|
@@ -12,7 +12,7 @@ void main()
|
||||
SetAILevel (OBJECT_SELF, AI_LEVEL_HIGH);
|
||||
string sMyTagName = GetTag(OBJECT_SELF);
|
||||
string sSittableTagName = "CHAIR_" + sMyTagName;
|
||||
object oChair = GetRandomObjectByTag(sSittableTagName, 77.0);
|
||||
object oChair = GetRandomObjectByTag(sSittableTagName, 110.0);
|
||||
ActionForceMoveToObject (oChair, FALSE, 1.0f, 120.0);
|
||||
ActionSit(oChair);
|
||||
int nTime = Random(210) + 90;
|
||||
|
@@ -10,7 +10,7 @@ void main()
|
||||
ClearAllActions();
|
||||
SetAILevel (OBJECT_SELF, AI_LEVEL_HIGH);
|
||||
string sSittableTagName = "Woodenbench";
|
||||
object oChair = GetRandomObjectByTag(sSittableTagName, 100.0);
|
||||
object oChair = GetRandomObjectByTag(sSittableTagName, 120.0);
|
||||
ActionForceMoveToObject (oChair, FALSE, 1.0f, 120.0);
|
||||
ActionSit(oChair);
|
||||
int nTime = Random(210) + 90;
|
||||
|
@@ -115,7 +115,7 @@ void main()
|
||||
SetAILevel (OBJECT_SELF, AI_LEVEL_HIGH);
|
||||
string sMyTagName = GetTag(OBJECT_SELF);
|
||||
string sSittableTagName = "CHAIR_" + sMyTagName;
|
||||
object oChair = GetRandomObjectByTag(sSittableTagName, 77.0);
|
||||
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;
|
||||
|
@@ -32,7 +32,8 @@
|
||||
const int EVENT_USER_DEFINED_PRESPAWN = 1510;
|
||||
const int EVENT_USER_DEFINED_POSTSPAWN = 1511;
|
||||
|
||||
|
||||
#include "NW_O2_CONINCLUDE"
|
||||
#include "NW_I0_GENERIC"
|
||||
#include "x2_inc_switches"
|
||||
void main()
|
||||
{
|
||||
|
Reference in New Issue
Block a user