Speechs

Got any custom JavaScript additions/tweaks you think other people would like to see? Post 'em here!
Post Reply
dragon slayer
UOX3 Guru
Posts: 776
Joined: Thu Dec 21, 2006 7:37 am
Has thanked: 4 times
Been thanked: 26 times

Speechs

Post by dragon slayer »

here some awesome speech.js for your shards :0

speech_actor.js
function onSpeech( myString, myPlayer, myNPC )
{      
    if( !myNPC.InRange( myPlayer, 2 ) )
        return;
    var Speech_Array = myString.split(" ");
    var i = 0, currObj = 0;
        var region = myPlayer.region;
    for( i = 1; i <= Speech_Array.length; i++ )
    {
     
        if( Speech_Array[currObj].match( /\bName\b/i ))
        {
            myNPC.TurnToward( myPlayer );
            myNPC.TextMessage( "My name is "+myNPC.name+". A pleasure, I'm sure." );
            return;
        }
        if( Speech_Array[currObj].match( /\bHail\b/i ) || Speech_Array[currObj].match( /\bHi\b/i ) || Speech_Array[currObj].match( /\bHello\b/i ) || Speech_Array[currObj].match( /\bgreetings\b/i ) || Speech_Array[currObj].match( /\bgood\b/i ) || Speech_Array[currObj].match( /\bsee\b/i )|| Speech_Array[currObj].match( /\bthee\b/i ) ) 
        {

            myNPC.TurnToward( myPlayer );
                        switch( RandomNumber( 0, 2 ) )
                        {
                               case 0: myNPC.TextMessage( "What dost thou want?" );break;//wicked
                               case 1: myNPC.TextMessage( "Greetings." ); break;//Neutral
                               case 2: if(myPlayer.orgID == 0x190 )
                                       {
                                          myNPC.TextMessage( "Hello, milord "+myPlayer.name+"." ); break;// Goodhearted
                                       }
                                       else
                                       {
                                                myNPC.TextMessage( "Hello, milady "+myPlayer.name+"." ); break;// Goodhearted
                                       }
                               default: myNPC.TextMessage( "Hello there "+myPlayer.name+"!" );
                        }
            return;

        }
        else if( Speech_Array[currObj].match( /\bhow\b/i ))
        {

            myNPC.TurnToward( myPlayer );
            switch( RandomNumber( 0, 2 ) )
                        {
                               case 0: myNPC.TextMessage( "None of thy business!" );break;//wicked
                               case 1: myNPC.TextMessage( "I'm doing relatively well." ); break;//Neutral
                               case 2: if(myPlayer.orgID == 0x190 )
                                       {
                                          myNPC.TextMessage( "I am well, milord "+myPlayer.name+" I hope thou art the same." ); break;// Goodhearted
                                       }
                                       else
                                       {
                                                myNPC.TextMessage( "I am well, milady "+myPlayer.name+" I hope thou art the same.." ); break;// Goodhearted
                                       }
                               default: myNPC.TextMessage( "Hello there "+myPlayer.name+"!" );
                        }
            return;

        }

        else if( Speech_Array[currObj].match( /\bjob\b/i ))
        {

            myNPC.TurnToward( myPlayer );
            myNPC.TextMessage( "The stage, my ignoble friend, is my - as thou dost say - job." );
            return;

        }
        else if( Speech_Array[currObj].match( /\bactor\b/i ))  
        {

            myNPC.TurnToward( myPlayer );
            myNPC.TextMessage( "I, "+myPlayer.name+" am no mere actor. I am an ... ac-tore!" );
            return;

        }
        else if( Speech_Array[currObj].match( /\bwhat\b/i ) || Speech_Array[currObj].match( /\bdo\b/i ))   
        {

            myNPC.TurnToward( myPlayer );
            myNPC.TextMessage( "I am an Ac-tore!" );
            return;

        }
        else if( Speech_Array[currObj].match( /\bac-tore\b/i ))
        {

            myNPC.TurnToward( myPlayer );
            myNPC.TextMessage( "I have performed, to the best of my humble abilities, for Lord British and other Nobles of this fine land." );
            return;

        }
        else if( Speech_Array[currObj].match( /\bact\b/i ))
        {

            myNPC.TurnToward( myPlayer );
            myNPC.TextMessage( "To paraphrase: All our land is a stage, acted upon by men and women who shall, in their lives, play many parts. I just happen to be one of the best of them." );
            return;

        }
        else if( Speech_Array[currObj].match( /\bperform\b/i ))
        {

            myNPC.TurnToward( myPlayer );
            myNPC.TextMessage( "To live is to act. And the world is our stage. And thou art the janitor, my friend." );
            return;

        }
        else if( Speech_Array[currObj].match( /\bstage\b/i ))  
        {

            myNPC.TurnToward( myPlayer );
            myNPC.TextMessage( "The stage is that which I yearn for." );
            return;

        }
        else if( Speech_Array[currObj].match( /\bNoble\b/i ))  
        {

            myNPC.TurnToward( myPlayer );
            myNPC.TextMessage( "The arts prospers in Britannia, thanks to the generosity of Lord British and the great nobles of this land." );
            return;

        }
        else if( Speech_Array[currObj].match( /\bLord British\b/i ))   
        {

            myNPC.TurnToward( myPlayer );
            myNPC.TextMessage( "Lord British is well-known as one of the greatest supporters of the arts." );
            return;

        }
        else if( Speech_Array[currObj].match( /\bart\b/i ))
        {

            myNPC.TurnToward( myPlayer );
            myNPC.TextMessage( "The nobility of this land supports the fine arts. They seem to appreciate our humble efforts." );
            return;

        }
        else if( Speech_Array[currObj].match( /\btheatre\b/i ))
        {

            myNPC.TurnToward( myPlayer );
            myNPC.TextMessage( "Ah! That grande analogy of life! The theatre!" );
            return;

        }
        else if( Speech_Array[currObj].match( /\btheater\b/i ))
        {

            myNPC.TurnToward( myPlayer );
            myNPC.TextMessage( "The theatre IS my life!" );
            return;

        }
        else if( Speech_Array[currObj].match( /\bcostume\b/i ))
        {

            myNPC.TurnToward( myPlayer );
            myNPC.TextMessage( "What thou dost wear ... is not that thy costume? So is all that I doth put on, mine." );
            return;

        }
        else if( Speech_Array[currObj].match( /\bclothing\b/i ))   
        {

            myNPC.TurnToward( myPlayer );
            myNPC.TextMessage( "I doth wear clothes, "+myPlayer.name+" Even that which I wear on the stage, is but clothing." );
            return;

        }
        else if( Speech_Array[currObj].match( /\bClothes\b/i ))
        {

            myNPC.TurnToward( myPlayer );
            myNPC.TextMessage( "Clothes do make the man, do they not?" );
            return;

        }
        else if( Speech_Array[currObj].match( /\bclothe\b/i )) 
        {

            myNPC.TurnToward( myPlayer );
            myNPC.TextMessage( "Buy thy clothes from a tailor, "+myPlayer.name+"." );
            return;

        }
        else if( Speech_Array[currObj].match( /\bsissy\b/i ))  
        {

            myNPC.TurnToward( myPlayer );
            myNPC.TextMessage( "Art thou mocking me? Well thy ignorant words fall on deaf ears." );
            return;

        }
        else if( Speech_Array[currObj].match( /\bwuss\b/i ))   
        {

            myNPC.TurnToward( myPlayer );
            myNPC.TextMessage( "I shall brook no discourtesy from the likes of a bottom-dweller like thyself![Leave]" );
            return;

        }
        else if( Speech_Array[currObj].match( /\bpriss\b/i ))  
        {

            myNPC.TurnToward( myPlayer );
            myNPC.TextMessage( "Thou art not of the intelligence to understand what it is that we suffer so diligently to accomplish, "+myPlayer.name+". Compassion is not a virtue of thine!" );
            return;

        }
        else if( Speech_Array[currObj].match( /\breal job\b/i ))   
        {

            myNPC.TurnToward( myPlayer );
            myNPC.TextMessage( "Art thou mocking me?" );
            return;

        }
        else if( Speech_Array[currObj].match( /\bwhere am i\b/i ) || Speech_Array[currObj].match( /\blost\b/i ))   
        {

            myNPC.TurnToward( myPlayer );
            if( region.name.toLowerCase() == "the town of Britain".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Britain, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Yew".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Yew, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Skara Brae".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Skara Brae, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Trinsic".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Trinsic, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Cove".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Cove, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Vesper".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Vesper, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Minoc".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Minoc, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Moonglow".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Moonglow, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Nujel'm".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Nujel'm, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Magincia".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Magincia, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Ocllo".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Ocllo, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Buccaneers' Den".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Buccaneers' Den, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Serpent's Hold".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Serpent's Hold, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Jhelom".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Jhelom, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Wind".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Wind, of course." );
                        }
            return;

        }
        currObj++;
    }
}
speech_pirate.js
function onSpeech( myString, myPlayer, myNPC )
{
    if( !myNPC.InRange( myPlayer, 2 ) )
        return;
    var Speech_Array = myString.split(" ");
    var i = 0, currObj = 0;
    for( i = 1; i <= Speech_Array.length; i++ )
    {
        if( Speech_Array[currObj].match( /\bName\b/i ))
        {
            myNPC.TurnToward( myPlayer );
                        myNPC.TextMessage( "Arrhh my name is "+myNPC.name+"." );
            return;
        }
        if( Speech_Array[currObj].match( /\bHail\b/i ) || Speech_Array[currObj].match( /\bHi\b/i ) || Speech_Array[currObj].match( /\bHello\b/i ) || Speech_Array[currObj].match( /\bgreetings\b/i ) || Speech_Array[currObj].match( /\bgood\b/i ) || Speech_Array[currObj].match( /\bsee\b/i )|| Speech_Array[currObj].match( /\bthee\b/i ) ) 
        {

            myNPC.TurnToward( myPlayer );
                        switch( RandomNumber( 0, 2 ) )
                        {
                               case 0: myNPC.TextMessage( "What dost thou want?" );break;//wicked
                               case 1: myNPC.TextMessage( "Greetings." ); break;//Neutral
                               case 2: if(myPlayer.orgID == 0x190 )
                                       {
                                          myNPC.TextMessage( "Hello, milord "+myPlayer.name+"." ); break;// Goodhearted
                                       }
                                       else
                                       {
                                                myNPC.TextMessage( "Hello, milady "+myPlayer.name+"." ); break;// Goodhearted
                                       }
                               default: myNPC.TextMessage( "Hello there "+myPlayer.name+"!" );
                        }
            return;

        }
        else if( Speech_Array[currObj].match( /\bhow\b/i ))
        {

            myNPC.TurnToward( myPlayer );
            switch( RandomNumber( 0, 2 ) )
                        {
                               case 0: myNPC.TextMessage( "None of thy business!" );break;//wicked
                               case 1: myNPC.TextMessage( "I'm doing relatively well." ); break;//Neutral
                               case 2: if(myPlayer.orgID == 0x190 )
                                       {
                                          myNPC.TextMessage( "I am well, milord "+myPlayer.name+" I hope thou art the same." ); break;// Goodhearted
                                       }
                                       else
                                       {
                                                myNPC.TextMessage( "I am well, milady "+myPlayer.name+" I hope thou art the same.." ); break;// Goodhearted
                                       }
                               default: myNPC.TextMessage( "Hello there "+myPlayer.name+"!" );
                        }
            return;

        }

        else if( Speech_Array[currObj].match( /\boccupation\b/i )) 
        {

            myNPC.TurnToward( myPlayer );
                        switch( RandomNumber( 0, 2 ) )
                        {
                               case 0: myNPC.TextMessage( "I'll demonstrate!" );
                                       myNPC.aitype = 2;     break;//wicked
                               case 1: myNPC.TextMessage( "I help my Captain.  That's what I do" ); break;//Neutral
                               case 2: myNPC.TextMessage( "I fill mine own pockets, is what I do!" ); break;// Goodhearted
                               default: myNPC.TextMessage( "I help my Captain. That's what I do." );
                        }
            return;

        }
        else if( Speech_Array[currObj].match( /\bprofession\b/i )) 
        {

            myNPC.TurnToward( myPlayer );
                        switch( RandomNumber( 0, 2 ) )
                        {
                               case 0: myNPC.TextMessage( "Job?  I TAKE what I want!  Why should I need a job?" ); break;//wicked
                               case 1: myNPC.TextMessage( "Job? A job is what regular sailors have" ); break;//Neutral
                               case 2: myNPC.TextMessage( "Job? Oh. Yes!  I am Arrhh... a sailor!  Yeah, that's it!" ); break;// Goodhearted
                               default: myNPC.TextMessage( "Job? Oh. Yes! I am Arrhh... a sailor! Yeah, that's it!" );
                        }
            return;

        }
        else if( Speech_Array[currObj].match( /\bwhat\b/i ) || Speech_Array[currObj].match( /\bdo\b/i ))   
        {

            myNPC.TurnToward( myPlayer );
                        switch( RandomNumber( 0, 2 ) )
                        {
                               case 0: myNPC.TextMessage( "Job? I don't need no stinking job!" ); break;//wicked
                               case 1: myNPC.TextMessage( "I live on the sea.  'Tis no job, but a life!" ); break;//Neutral
                               case 2: myNPC.TextMessage( "I relieve the economically enhanced citizens of their...Arrhh...heavy loads." ); break;// Goodhearted
                               default: myNPC.TextMessage( "Job? Oh. Yes! I am Arrhh... a sailor! Yeah, that's it!" );
                        }
            return;

        }
        else if( Speech_Array[currObj].match( /\bPirate\b/i ))
        {

            myNPC.TurnToward( myPlayer );
                        switch( RandomNumber( 0, 2 ) )
                        {
                               case 0: myNPC.TextMessage( "Pull thy sword!" );
                                       myNPC.aitype = 2;     break;//wicked
                               case 1: myNPC.TextMessage( "Ah!  A pirate's life is a happy life!" ); break;//Neutral
                               case 2: myNPC.TextMessage( "Argh!  Thou'rt an ugly one!  I like that in a person!" ); break;// Goodhearted
                               default: myNPC.TextMessage( "Ah!  A pirate's life is a happy life!" );
                        }
            return;

        }
        else if( Speech_Array[currObj].match( /\bScum\b/i ))
        {

            myNPC.TurnToward( myPlayer );
                        switch( RandomNumber( 0, 2 ) )
                        {
                               case 0: myNPC.TextMessage( "Defend thyself, landlubber!" );
                                       myNPC.aitype = 2;     break;//wicked
                               case 1: myNPC.TextMessage( "Watch thyself.  I have little patience." ); break;//Neutral
                               case 2: myNPC.TextMessage( "Argh!  Oh, pardon me! Somthin' lodged there in my throat!" ); break;// Goodhearted
                               default: myNPC.TextMessage( "Watch thyself.  I have little patience." );
                        }
            return;

        }
        else if( Speech_Array[currObj].match( /\bMatey\b/i ))
        {

            myNPC.TurnToward( myPlayer );
                        switch( RandomNumber( 0, 2 ) )
                        {
                               case 0: myNPC.TextMessage( "I have no patience with thee!" );
                                       myNPC.aitype = 2;     break;//wicked
                               case 1: myNPC.TextMessage( "Tain't right to call me that!" ); break;//Neutral
                               case 2: myNPC.TextMessage( "Ack!  I mean...Argh!" ); break;// Goodhearted
                               default: myNPC.TextMessage( "Ack!  I mean...Argh!" );
                        }
            return;

        }
        else if( Speech_Array[currObj].match( /\bSailor\b/i ))
        {

            myNPC.TurnToward( myPlayer );
                        switch( RandomNumber( 0, 2 ) )
                        {
                               case 0: myNPC.TextMessage( "I'm more than a sailor, mate!" );break;//wicked
                               case 1: myNPC.TextMessage( "Now don't go callin' me, a simple honest sailor, a name like that!" ); break;//Neutral
                               case 2: myNPC.TextMessage( "Yup!  A pirate's - er a sailor's life is a happy life!" ); break;// Goodhearted
                               default: myNPC.TextMessage( "Yup!  A pirate's - er a sailor's life is a happy life!" );
                        }
            return;

        }
        else if( Speech_Array[currObj].match( /\bship\b/i ))
        {

            myNPC.TurnToward( myPlayer );
                        switch( RandomNumber( 0, 2 ) )
                        {
                               case 0: myNPC.TextMessage( "I've sailed with the best!" );break;//wicked
                               case 1: myNPC.TextMessage( "I'll get my own ship someday!  Even if I have to die to do it!" ); break;//Neutral
                               case 2: myNPC.TextMessage( "I shall have my own ship, soon!" ); break;// Goodhearted
                               default: myNPC.TextMessage( "I shall have my own ship, soon!" );
                        }
            return;

        }
        else if( Speech_Array[currObj].match( /\bsail\b/i ) || Speech_Array[currObj].match( /\bcaptain\b/i ))
        {

            myNPC.TurnToward( myPlayer );
                        switch( RandomNumber( 0, 2 ) )
                        {
                               case 0: myNPC.TextMessage( "I've sailed with the best captains on the sea! 'Course, they're all dead, now." );break;//wicked
                               case 1: myNPC.TextMessage( "I've sailed with the best captains on the sea! 'Course, they're all dead, now. Or in prison." ); break;//Neutral
                               case 2: myNPC.TextMessage( "Someday, I'll BE the best captain on the sea!" ); break;// Goodhearted
                               default: myNPC.TextMessage( "Someday, I'll BE the best captain on the sea!" );
                        }
            return;

        }
        else if( Speech_Array[currObj].match( /\bwhere am i\b/i ) || Speech_Array[currObj].match( /\blost\b/i ))   
        {

            myNPC.TurnToward( myPlayer );
            if( region.name.toLowerCase() == "the town of Britain".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Britain, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Yew".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Yew, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Skara Brae".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Skara Brae, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Trinsic".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Trinsic, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Cove".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Cove, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Vesper".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Vesper, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Minoc".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Minoc, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Moonglow".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Moonglow, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Nujel'm".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Nujel'm, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Magincia".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Magincia, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Ocllo".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Ocllo, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Buccaneers' Den".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Buccaneers' Den, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Serpent's Hold".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Serpent's Hold, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Jhelom".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Jhelom, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Wind".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Wind, of course." );
                        }
            return;

        }
        currObj++;
    }
}
speech_tavernkeeper.js
function onSpeech( myString, myPlayer, myNPC )
{
    if( !myNPC.InRange( myPlayer, 2 ) )
        return;
    var Speech_Array = myString.split(" ");
    var i = 0, currObj = 0;
    for( i = 1; i <= Speech_Array.length; i++ )
    {
        if( Speech_Array[currObj].match( /\bName\b/i ))
        {
            myNPC.TurnToward( myPlayer );
                        myNPC.TextMessage( "Hello my name is "+myNPC.name+"." );
            return;
        }
        if( Speech_Array[currObj].match( /\bHail\b/i ) || Speech_Array[currObj].match( /\bHi\b/i ) || Speech_Array[currObj].match( /\bHello\b/i ) || Speech_Array[currObj].match( /\bgreetings\b/i ) || Speech_Array[currObj].match( /\bgood\b/i ) || Speech_Array[currObj].match( /\bsee\b/i )|| Speech_Array[currObj].match( /\bthee\b/i ) ) 
        {

            myNPC.TurnToward( myPlayer );
                        switch( RandomNumber( 0, 2 ) )
                        {
                               case 0: myNPC.TextMessage( "What dost thou want?" );break;//wicked
                               case 1: myNPC.TextMessage( "Greetings." ); break;//Neutral
                               case 2: if(myPlayer.orgID == 0x190 )
                                       {
                                          myNPC.TextMessage( "Hello, milord "+myPlayer.name+"." ); break;// Goodhearted
                                       }
                                       else
                                       {
                                                myNPC.TextMessage( "Hello, milady "+myPlayer.name+"." ); break;// Goodhearted
                                       }
                               default: myNPC.TextMessage( "Hello there "+myPlayer.name+"!" );
                        }
            return;

        }
        else if( Speech_Array[currObj].match( /\bhow\b/i ))
        {

            myNPC.TurnToward( myPlayer );
            switch( RandomNumber( 0, 2 ) )
                        {
                               case 0: myNPC.TextMessage( "None of thy business!" );break;//wicked
                               case 1: myNPC.TextMessage( "I'm doing relatively well." ); break;//Neutral
                               case 2: if(myPlayer.orgID == 0x190 )
                                       {
                                          myNPC.TextMessage( "I am well, milord "+myPlayer.name+" I hope thou art the same." ); break;// Goodhearted
                                       }
                                       else
                                       {
                                                myNPC.TextMessage( "I am well, milady "+myPlayer.name+" I hope thou art the same.." ); break;// Goodhearted
                                       }
                               default: myNPC.TextMessage( "Hello there "+myPlayer.name+"!" );
                        }
            return;

        }
        else if( Speech_Array[currObj].match( /\bjob\b/i ) || Speech_Array[currObj].match( /\bwhat\b/i ) || Speech_Array[currObj].match( /\bdo\b/i ))  
        {
            myNPC.TurnToward( myPlayer );
                        switch( RandomNumber( 0, 2 ) )
                        {
                            case 0: myNPC.TextMessage( "I run this tavern." ); break;
                            case 1: myNPC.TextMessage( "I run this place." ); break;
                            case 2: myNPC.TextMessage( "I'm the tavernkeeper here." ); break;
                            default: myNPC.TextMessage( "I'm the tavernkeeper here." );
                        }
            return;
        }
        else if( Speech_Array[currObj].match( /\btavern\b/i ))
        {
            myNPC.TurnToward( myPlayer );
                        switch( RandomNumber( 0, 2 ) )
                        {
                            case 0: myNPC.TextMessage( "I keep this tavern clean and in business." ); break;
                            case 1: myNPC.TextMessage( "I am a tavernkeeper, yes." ); break;
                            case 2: myNPC.TextMessage( "I work hard to keep my customers happy." ); break;
                            default: myNPC.TextMessage( "I am a tavernkeeper, yes." );
                        }
            return;
        }

        else if( Speech_Array[currObj].match( /\bale\b/i ))
        {

            myNPC.TurnToward( myPlayer );
                        switch( RandomNumber( 0, 2 ) )
                        {
                               case 0: if(myPlayer.karma < 0 )
                                       {
                                           myNPC.TextMessage( "I brew my own Ale, and 'tis excellent, strong and suitable for one such as thee." ); break;//wicked
                                       }
                                       if(myPlayer.murdercount > 0)
                                       {
                                           myNPC.TextMessage( "I could sell thee a drink, if thou doth promise me not to wreck the place" ); break;//wicked
                                       }
                                       if(myPlayer.fame > 1000 )
                                       {
                                           myNPC.TextMessage( "would be an honor to serve thee from my casks, if thou dost deign to drink the brew of one as ill-fortuned as I." ); break;//wicked
                                       }
                                       else
                                         myNPC.TextMessage( "I sell the finest Ale, all of mine own brewing. 'Tis the only thing to give me comfort in these trying times." ); break;//wicked
                               case 1: if(myPlayer.karma < 0 )
                                       {
                                           myNPC.TextMessage( "I sell Ale, yes." ); break;//Neutral
                                       }    
                                       if(myPlayer.fame > 1000 )
                                       {
                                           if(myPlayer.orgID == 0x190 )
                                           {
                                                myNPC.TextMessage( "Only the best Ale for milord "+myPlayer.name+"." ); break;//Neutral
                                           }
                                           else
                                           {
                                                myNPC.TextMessage( "Only the best Ale for milady "+myPlayer.name+"." ); break;//Neutral
                                           }
                                       }
                                       else
                                         myNPC.TextMessage( "Certainly I sell Ale, and at a reasonable price too." ); break;//Neutral
                               case 2: if(myPlayer.karma < 0 )
                                       {
                                           if(myPlayer.orgID == 0x190 )
                                           {
                                                myNPC.TextMessage( "Canst thou give me one good reason why one such as I should slake the thirst of a scoundrel such as thee?" ); break;// Goodhearted
                                           }
                                           else
                                           {
                                                myNPC.TextMessage( "Canst thou give me one good reason why one such as I should slake the thirst of a witch such as thee?" ); break;// Goodhearted
                                           }
                                       }    
                                       if(myPlayer.fame > 1000 )
                                       {
                                           myNPC.TextMessage( "The very highest quality Ale, brewed by myself, is available here--I shall serve thee from my private cask." ); break;// Goodhearted
                                       }
                                       else
                                         myNPC.TextMessage( "Gladly will I serve thee Ale, friend." ); break;// Goodhearted
                               default: myNPC.TextMessage( "It would be a pleasure indeed to serve thee of my Ale." );
                        }
            return;

        }
        else if( Speech_Array[currObj].match( /\beer\b/i ))
        {

            myNPC.TurnToward( myPlayer );
                        switch( RandomNumber( 0, 2 ) )
                        {
                               case 0: if(myPlayer.karma < 0 )
                                       {
                                           myNPC.TextMessage( "I brew my own Beer, and 'tis excellent, strong and suitable for one such as thee." ); break;//wicked
                                       }
                                       if(myPlayer.murdercount > 0)
                                       {
                                           myNPC.TextMessage( "I could sell thee a drink, if thou doth promise me not to wreck the place" ); break;//wicked
                                       }
                                       if(myPlayer.fame > 1000 )
                                       {
                                           myNPC.TextMessage( "would be an honor to serve thee from my casks, if thou dost deign to drink the brew of one as ill-fortuned as I." ); break;//wicked
                                       }
                                       else
                                         myNPC.TextMessage( "I sell the finest Beer, all of mine own brewing. 'Tis the only thing to give me comfort in these trying times." ); break;//wicked
                               case 1: if(myPlayer.karma < 0 )
                                       {
                                           myNPC.TextMessage( "I sell Beer, yes." ); break;//Neutral
                                       }    
                                       if(myPlayer.fame > 1000 )
                                       {
                                           if(myPlayer.orgID == 0x190 )
                                           {
                                                myNPC.TextMessage( "Only the best Beer for milord "+myPlayer.name+"." ); break;//Neutral
                                           }
                                           else
                                           {
                                                myNPC.TextMessage( "Only the best Beer for milady "+myPlayer.name+"." ); break;//Neutral
                                           }
                                       }
                                       else
                                         myNPC.TextMessage( "Certainly I sell Beer, and at a reasonable price too." ); break;//Neutral
                               case 2: if(myPlayer.karma < 0 )
                                       {
                                           if(myPlayer.orgID == 0x190 )
                                           {
                                                myNPC.TextMessage( "Canst thou give me one good reason why one such as I should slake the thirst of a scoundrel such as thee?" ); break;// Goodhearted
                                           }
                                           else
                                           {
                                                myNPC.TextMessage( "Canst thou give me one good reason why one such as I should slake the thirst of a witch such as thee?" ); break;// Goodhearted
                                           }
                                       }    
                                       if(myPlayer.fame > 1000 )
                                       {
                                           myNPC.TextMessage( "The very highest quality Beer, brewed by myself, is available here--I shall serve thee from my private cask." ); break;// Goodhearted
                                       }
                                       else
                                         myNPC.TextMessage( "Gladly will I serve thee Beer, friend." ); break;// Goodhearted
                               default: myNPC.TextMessage( "It would be a pleasure indeed to serve thee of my Beer." );
                        }
            return;

        }
        else if( Speech_Array[currObj].match( /\barmaid\b/i ) || Speech_Array[currObj].match( /\wench\b/i ) || Speech_Array[currObj].match( /\waitress\b/i ))  
        {

            myNPC.TurnToward( myPlayer );
                        switch( RandomNumber( 0, 1 ) )
                        {
                               case 0: if(myPlayer.karma < 0 )
                                       {
                                           myNPC.TextMessage( "Aye, barmaids, wenches, waitresses. Who can afford to pay them these  days? Plannest thou to steal one away or somesuch?/Seek thee a sister in thy villainy?" ); break;//wicked
                                       }
                                       if(myPlayer.fame > 1000 )
                                       {
                                           myNPC.TextMessage( "What of her? She works hard." ); break;//wicked
                                       }
                                       else
                                         myNPC.TextMessage( "What, art thou desperate for company/is she a cousin or sister?" ); break;//wicked
                               case 1: if(myPlayer.karma < 0 )
                                       {
                                           myNPC.TextMessage( "Thou dost seek the ? I should have known that thy presence here was not because of me." ); break;//Neutral
                                       }    
                                       if(myPlayer.fame > 1000 )
                                       {
                                            myNPC.TextMessage( "The barmaids get quite a lot of unwanted attention, this being an establishment where men drink." ); break;//Neutral
                                       }
                                       else
                                         myNPC.TextMessage( "What of her? She works hard." ); break;// Goodhearted
                               default: myNPC.TextMessage( "What of her? She is hired help." );
                        }
            return;

        }
        else if( Speech_Array[currObj].match( /\bwhere am i\b/i ) || Speech_Array[currObj].match( /\blost\b/i ))   
        {

            myNPC.TurnToward( myPlayer );
            if( region.name.toLowerCase() == "the town of Britain".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Britain, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Yew".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Yew, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Skara Brae".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Skara Brae, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Trinsic".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Trinsic, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Cove".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Cove, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Vesper".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Vesper, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Minoc".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Minoc, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Moonglow".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Moonglow, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Nujel'm".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Nujel'm, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Magincia".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Magincia, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Ocllo".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Ocllo, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Buccaneers' Den".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Buccaneers' Den, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Serpent's Hold".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Serpent's Hold, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Jhelom".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Jhelom, of course." );
                        }
            else if( region.name.toLowerCase() == "the town of Wind".toLowerCase() )
                        {
                           myNPC.TextMessage( "Why, thou'rt in the city of Wind, of course." );
                        }
            return;

        }
        currObj++;
    }
}
Last edited by dragon slayer on Mon Dec 19, 2011 6:38 am, edited 1 time in total.
Post Reply