// NPC Monologue Script
//
// This script will make an NPC talk a bit to no one in particular.
// Its kinda like a combo of crier.js & turnip.js :)
//
var TalkPause = 7500; // Pause between sentences
var Msg1 = "I'm not the one who's so far away.."
var Msg2 = "When I feel the snake bite into my veins.."
var Msg3 = "Never did I wanna be here again.."
var Msg4 = "And I don't remember why I came.."
var Msg5 = "Voodoo, voodoo, voodoo, voodoo..."
function inRange( pCharacter, objInRange )
{
if( objInRange.isChar ) // Somebody is in range
{
pCharacter.StartTimer( TalkPause, 1, true ); // Starts monologue
}
}
function onTimer( pCharacter, timerID )
{
if( timerID == 1 )
{
pCharacter.StartTimer( TalkPause, 2, true); // The number is what timerID to go to next
pCharacter.TextMessage( Msg1 );
}
if( timerID == 2 )
{
pCharacter.StartTimer( TalkPause, 3, true );
pCharacter.TextMessage( Msg2 );
}
if( timerID == 3 )
{
pCharacter.StartTimer( TalkPause, 4, true );
pCharacter.TextMessage( Msg3 );
}
if( timerID == 4 )
{
pCharacter.StartTimer( TalkPause, 5, true );
pCharacter.TextMessage( Msg4 );
}
if( timerID == 5 )
{
pCharacter.StartTimer( TalkPause, 1, true ); // You can ditch this line to prevent them from repeating
pCharacter.TextMessage( Msg5 );
}
}
// Also, I want to work on computing a range from the NPC's coordinates..
//
// This script will make an NPC talk a bit to no one in particular.
// Its kinda like a combo of crier.js & turnip.js :)
//
var TalkPause = 7500; // Pause between sentences
var Msg1 = "I'm not the one who's so far away.."
var Msg2 = "When I feel the snake bite into my veins.."
var Msg3 = "Never did I wanna be here again.."
var Msg4 = "And I don't remember why I came.."
var Msg5 = "Voodoo, voodoo, voodoo, voodoo..."
function inRange( pCharacter, objInRange )
{
if( objInRange.isChar ) // Somebody is in range
{
pCharacter.StartTimer( TalkPause, 1, true ); // Starts monologue
}
}
function onTimer( pCharacter, timerID )
{
if( timerID == 1 )
{
pCharacter.StartTimer( TalkPause, 2, true); // The number is what timerID to go to next
pCharacter.TextMessage( Msg1 );
}
if( timerID == 2 )
{
pCharacter.StartTimer( TalkPause, 3, true );
pCharacter.TextMessage( Msg2 );
}
if( timerID == 3 )
{
pCharacter.StartTimer( TalkPause, 4, true );
pCharacter.TextMessage( Msg3 );
}
if( timerID == 4 )
{
pCharacter.StartTimer( TalkPause, 5, true );
pCharacter.TextMessage( Msg4 );
}
if( timerID == 5 )
{
pCharacter.StartTimer( TalkPause, 1, true ); // You can ditch this line to prevent them from repeating
pCharacter.TextMessage( Msg5 );
}
}
// Also, I want to work on computing a range from the NPC's coordinates..