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:
34
_module/nss/findfriend.nss
Normal file
34
_module/nss/findfriend.nss
Normal 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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user