Some issues:
- as far as I know, only time anyone lies down is if they die, so no sleeping in bed.
- if he walks into another npc, he gets stuck until the next scheduled event assuming that takes him a different route.
- need code to check above and blocked seats if trying to sit somewhere.
Code: Select all
// Fisherman in Britain job script 3206
// Could be any NPC, but you probably won't want 2 fishing
// in the same spot.
// maybe an array of fishing spots & randomly pick one.
function onAISliver( tChar )
{
var hour = GetHour();
var minute = GetMinute();
var hDisp = hour.toString();
var mDisp = minute.toString();
if( minute < 10 )
mDisp = "0" + mDisp;
var curr_time = hDisp + ":" + mDisp; //set up the clock
if ( curr_time == "5:00" )
{
//get breakfast?
// wake up and go fish
tChar.WalkTo( 1468, 1711, 1000 ); //walk to door
// open in door
tChar.WalkTo( 1484, 1768, 1000 ); //walk to docks
tChar.TextMessage( "Time for some fishin'." );
// Turn character towards water set dir = 4?; DIRECTION=SE?
// Casting animation
// Skill checks for catching fish.
// Need to open doors!
}
if ( curr_time == "12:00" )
{
// go to pub for lunch
tChar.TextMessage( "Time for some lunch." );
tChar.WalkTo( 1432, 1731, 1000 ); //walk to inn door
// open in door
// check for if blocked (someone else is sitting there) choose another seat
tChar.WalkTo( 1427, 1724, 1000 ); //walk to seat
}
if ( curr_time == "12:30" )
{
// go fish some more
tChar.TextMessage( "Time for some fishin'." );
tChar.WalkTo( 1431, 1771, 1000 ); //walk to door
// open in door
tChar.WalkTo( 1484, 1768, 1000 ); //walk to docks
}
if ( curr_time == "17:00" )
{
// go to butcher & sell fish
tChar.TextMessage( "Time for sellin' fish." );
tChar.WalkTo( 1452, 1728, 1000 ); // walk to door
// open in door
tChar.WalkTo( 1451, 1723, 1000 ); // move to center
}
// fish sell for about 2 gold each
// butcher sells fish steaks for 6 gold
// need to find an inn that sells cooked fish for price
// runner for the butcher that delivers products 1 or 2 gold per deliver?
if ( curr_time == "18:00" )
{
// go to pub for dinner
tChar.TextMessage( "Time for dinner." );
tChar.WalkTo( 1452, 1727, 1000 ); //walk to door
// open in door
tChar.WalkTo( 1432, 1731, 1000 ); //walk to inn door
// open in door
// check for if blocked (someone else is sitting there) choose another seat
tChar.WalkTo( 1427, 1724, 1000 ); //walk to seat
}
// time before/after dinner to do shopping or whatever..
// check for if blocked (someone else is sitting there)
if ( curr_time == "21:00" )
{
// go to home for sleep
tChar.TextMessage( "Yawn, time for bed." );
tChar.WalkTo( 1468, 1712, 1000 ); //walk to door
// open in door
tChar.WalkTo( 1468, 1705, 1000 ); //walk to bed
tChar.TextMessage( "I'm sleeping, but I can't figure out how to lay down!" );
}
}