Anasayfa
UO Sunucular
Forumlar
Profilim
UO-Developer.COM
function onSpeech( myString, myPlayer, myNPC, pSock ) 
{
   if( !myNPC.InRange( myPlayer, 2 ) )
      return;
   var startQuest = myPlayer.GetTag( "KT_START" );
   var Speech_Array = myString.split(" ");
   var i = 0, currObj = 0;

   for( i = 1; i <Speech_Array> 0 )
            {
            var myGump = new Gump; // create a new gump 

               myGump.AddPage(0);
               myGump.AddBackground( 0, 0, 400, 350, 0xA28 );
               myGump.AddBackground( 30, 115, 350, 170, 0x0bb8 );
               myGump.AddGump( 130, 20, 0x64 ); // Sign Image
               myGump.AddText( 150, 30, 0, "Kill Task" );
               myGump.AddText( 180, 60, 0, "Unfinished" );
               myGump.AddText( 82, 120, 0, "Alas, you still have "+NumToString( numToKill )+" more monsters to slay" );
               myGump.AddText( 30, 140, 0, "before you receive your reward!" );
               myGump.AddText( 35, 300, 0, "Keep Going" );
               myGump.AddText( 160, 300, 0, "Quite" );
               myGump.AddButton( 200, 300, 0x0fa5, 1, 0, 2 ); //quite
               myGump.AddButton( 100, 300, 0x0fa5, 1, 0, 3 ); // keep going
               myGump.Send( myPlayer ); // send this gump to client now
               myGump.Free(); // clear this gump from uox-memory
               return false;
            }
            else
            {
               myNPC.TextMessage( "Wonderful work my friend, here is your reward." );
               var goldToGive = 0;
               switch( taskLevel )
               {
               case 1:      goldToGive = 500;      break;
               case 2:      goldToGive = 1000;      break;
               case 3:      goldToGive = 2000;      break;
               case 4:      goldToGive = 4000;      break;
               }
               CreateDFNItem( myPlayer.socket, myPlayer, "0x0EED", goldToGive, "ITEM", true );
               myPlayer.SoundEffect( 0x0037, false );
               myPlayer.SetTag( "KT_NUMTOKILL", 0 );
               myPlayer.SetTag( "KT_IDTOKILL", 0 );
               myPlayer.SetTag( "KT_LEVEL", 0 );
            }
        }
        else if( Speech_Array[currObj].match( /\bQuite\b/i ) )
        {
               myNPC.TurnToward( myPlayer );
               myNPC.TextMessage( "Fine i didnt want you doing any quests any how." );
               myPlayer.SetTag( "KT_NUMTOKILL", 0 );
               myPlayer.SetTag( "KT_IDTOKILL", 0 );
               myPlayer.SetTag( "KT_LEVEL", 0 );
        }
        else
            myNPC.TextMessage( "You must first take on a task to receive a reward." );
      }
      currObj++;
   }
}

function onGumpPress(pSock, myButtonID)
{
  var myPlayer = pSock.currentChar;
   switch( myButtonID )
   {
      case 0: // no
         myPlayer.SysMessage("Well thanks any way.");
      break;
      case 1: // yes
         var myGump = new Gump; // create a new gump
         var numToKill = RandomNumber( 3, 7 );
         var typeToKill = CreateGenericQuest( myPlayer, 1, numToKill );

            myGump.AddPage(0);
            myGump.AddBackground( 0, 0, 400, 350, 0xA28 );
            myGump.AddBackground( 30, 115, 350, 170, 0x0bb8 ); // Tile White Bacground
            myGump.AddGump( 130, 20, 0x64 ); // Sign Image
            myGump.AddText( 150, 30, 0, "Kill Task" );
            myGump.AddText( 180, 60, 0, "Novice" );
            myGump.AddText( 82, 120, 0, "Excellent, please return to me after you" );
            myGump.AddText( 30, 140, 0, "have slain "+NumToString( numToKill )+" "+typeToKill+"." );
            myGump.AddText( 35, 300, 0, "Keep Going" );
            myGump.AddText( 160, 300, 0, "Quite" );
            myGump.AddButton( 200, 300, 0x0fa5, 1, 0, 2 ); //quite
            myGump.AddButton( 100, 300, 0x0fa5, 1, 0, 3 ); // keep going
            myGump.Send( myPlayer ); // send this gump to client now
            myGump.Free(); // clear this gump from uox-memory
            return false;
      break;
      case 2: // Quite
         myPlayer.SetTag( "KT_NUMTOKILL", 0 );
         myPlayer.SetTag( "KT_IDTOKILL", 0 );
         myPlayer.SetTag( "KT_LEVEL", 0 ); 
         myPlayer.SysMessage("Thanks for quiting.");
      break;
      case 3: // keep going
         myPlayer.SysMessage("Thanks for not quiting.");
      break;
      case 4: // accepted quest
            var myGump = new Gump; // create a new gump 

            myGump.AddPage(1);
            myGump.AddBackground( 0, 0, 400, 350, 0xA28 );
            myGump.AddBackground( 30, 115, 350, 170, 0x0bb8 ); // Tile White Bacground
            myGump.AddGump( 130, 20, 0x64 ); // Sign Image
            myGump.AddText( 150, 30, 0, "Fisherman Quest" );
            myGump.AddText( 180, 60, 0, "Novice" );
            myGump.AddText( 82, 120, 0, "Ryan Glances up with a worried look in his eye." );
            myGump.AddText( 30, 140, 0, "Please, Gentle neighbour could you assist me. I'm nothing" );
            myGump.AddText( 30, 160, 0, "but a simple fisherman, But today i came across a rare" );
            myGump.AddText( 30, 180, 0, "sight a golden scaled fish. But as i pulled it out of the" );
            myGump.AddText( 30, 200, 0, "water, a mongbat swooped in and stole it from under my" );
            myGump.AddText( 30, 220, 0, "noise. Please, will you find the mongbat and retrieve my" );
            myGump.AddText( 30, 240, 0, "fish for me." );
            myGump.AddText( 35, 300, 0, "Yes" );
            myGump.AddText( 160, 300, 0, "No" );
            myGump.AddButton( 180, 300, 0x0fa5, 1, 0, 0 ); // no
            myGump.AddButton( 60, 300, 0x0fa5, 1, 0, 1 ); //yes
            myGump.Send( myPlayer ); // send this gump to client now
            myGump.Free(); // clear this gump from uox-memory
            return false;
      break;
      case 5: // yes
         var myGump = new Gump; // create a new gump
         var numToKill = RandomNumber( 3, 7 );
         var typeToKill = CreateGenericQuest( myPlayer, 2, numToKill );

            myGump.AddPage(0);
            myGump.AddBackground( 0, 0, 400, 350, 0xA28 );
            myGump.AddBackground( 30, 115, 350, 170, 0x0bb8 ); // Tile White Bacground
            myGump.AddGump( 130, 20, 0x64 ); // Sign Image
            myGump.AddText( 150, 30, 0, "Kill Task" );
            myGump.AddText( 180, 60, 0, "Journeyman" );
            myGump.AddText( 82, 120, 0, "Excellent, please return to me after you" );
            myGump.AddText( 30, 140, 0, "have slain "+NumToString( numToKill )+" "+typeToKill+"." );
            myGump.AddText( 35, 300, 0, "Keep Going" );
            myGump.AddText( 160, 300, 0, "Quite" );
            myGump.AddButton( 200, 300, 0x0fa5, 1, 0, 2 ); //quite
            myGump.AddButton( 100, 300, 0x0fa5, 1, 0, 3 ); // keep going
            myGump.Send( myPlayer ); // send this gump to client now
            myGump.Free(); // clear this gump from uox-memory
            return false;
      break;
      case 6: // yes
         var myGump = new Gump; // create a new gump
         var numToKill = RandomNumber( 3, 7 );
         var typeToKill = CreateGenericQuest( myPlayer, 3, numToKill );

            myGump.AddPage(0);
            myGump.AddBackground( 0, 0, 400, 350, 0xA28 );
            myGump.AddBackground( 30, 115, 350, 170, 0x0bb8 ); // Tile White Bacground
            myGump.AddGump( 130, 20, 0x64 ); // Sign Image
            myGump.AddText( 150, 30, 0, "Kill Task" );
            myGump.AddText( 180, 60, 0, "Adept" );
            myGump.AddText( 82, 120, 0, "Excellent, please return to me after you" );
            myGump.AddText( 30, 140, 0, "have slain "+NumToString( numToKill )+" "+typeToKill+"." );
            myGump.AddText( 35, 300, 0, "Keep Going" );
            myGump.AddText( 160, 300, 0, "Quite" );
            myGump.AddButton( 200, 300, 0x0fa5, 1, 0, 2 ); //quite
            myGump.AddButton( 100, 300, 0x0fa5, 1, 0, 3 ); // keep going
            myGump.Send( myPlayer ); // send this gump to client now
            myGump.Free(); // clear this gump from uox-memory
            return false;
      break;
      case 7: // yes
         var myGump = new Gump; // create a new gump
         var numToKill = RandomNumber( 3, 7 );
         var typeToKill = CreateGenericQuest( myPlayer, 4, numToKill );

            myGump.AddPage(0);
            myGump.AddBackground( 0, 0, 400, 350, 0xA28 );
            myGump.AddBackground( 30, 115, 350, 170, 0x0bb8 ); // Tile White Bacground
            myGump.AddGump( 130, 20, 0x64 ); // Sign Image
            myGump.AddText( 150, 30, 0, "Kill Task" );
            myGump.AddText( 180, 60, 0, "Grandmaster" );
            myGump.AddText( 82, 120, 0, "Excellent, please return to me after you" );
            myGump.AddText( 30, 140, 0, "have slain "+NumToString( numToKill )+" "+typeToKill+"." );
            myGump.AddText( 35, 300, 0, "Keep Going" );
            myGump.AddText( 160, 300, 0, "Quite" );
            myGump.AddButton( 200, 300, 0x0fa5, 1, 0, 2 ); //quite
            myGump.AddButton( 100, 300, 0x0fa5, 1, 0, 3 ); // keep going
            myGump.Send( myPlayer ); // send this gump to client now
            myGump.Free(); // clear this gump from uox-memory
            return false;
      break;
    }
}

function CreateGenericQuest( myPlayer, questLevel, numToKill )
{
   var typeToKill = GetMonsterType( myPlayer, questLevel );
   myPlayer.SetTag( "KT_NUMTOKILL", numToKill );
   myPlayer.SetTag( "KT_LEVEL", questLevel );
   myPlayer.SetTag( "KT_START", 0 );
   return typeToKill;
}

function GetMonsterType( myPlayer, questLevel )
{
   var retVal = "";
   switch( questLevel )
   {
   case 1:
      switch( RandomNumber( 0, 2 ) )
      {
      case 0:
         myPlayer.SetTag( "KT_IDTOKILL", 0x008c );
         retVal = "orcish mages";
         break;
      case 1:
         myPlayer.SetTag( "KT_IDTOKILL", 0x008f );
         retVal = "ratman shaman";
         break;
      case 2:
         myPlayer.SetTag( "KT_IDTOKILL", 0x0002 );
         retVal = "ettins";
         break;
      }
      break;
   case 2:
      switch( RandomNumber( 0, 2 ) )
      {
      case 0:
         myPlayer.SetTag( "KT_IDTOKILL", 0x0004 );
         retVal = "gargoyles";
         break;
      case 1:
         myPlayer.SetTag( "KT_IDTOKILL", 0x0016 );
         retVal = "gazers";
         break;
      case 2:
         myPlayer.SetTag( "KT_IDTOKILL", 0x008a );
         retVal = "orc lords";
         break;
      }
      break;
   case 3:
      switch( RandomNumber( 0, 2 ) )
      {
      case 0:
         myPlayer.SetTag( "KT_IDTOKILL", 0x0018 );
         retVal = "liches";
         break;
      case 1:
         myPlayer.SetTag( "KT_IDTOKILL", 0x0089 );
         retVal = "ophidian avengers";
         break;
      case 2:
         myPlayer.SetTag( "KT_IDTOKILL", 0x004c );
         retVal = "titans";
         break;
      }
      break;
   case 4:
      switch( RandomNumber( 0, 2 ) )
      {
      case 0:
         myPlayer.SetTag( "KT_IDTOKILL", 0x002e );
         retVal = "ancient wyrms";
         break;
      case 1:
         myPlayer.SetTag( "KT_IDTOKILL", 0x0028 );
         retVal = "balrons";
         break;
      case 2:
         myPlayer.SetTag( "KT_IDTOKILL", 0x0054 );
         retVal = "ogre lords";
         break;
      }
      break;
   }
   return retVal;
}

UO-Dev SPONSOR

Paylaş

XFacebook

Faydalı mı?

Bu içerik size yardımcı oldu mu?

UO-Dev SPONSOR

Henüz yorum yapılmamış. Yorum yazabilmek için giriş yapmanız gerekir.

Üyelerin oylama ortalaması (10 dışında) :

Henüz Oylanmamış

Oylar: 0

Paylaş

XFacebook

Faydalı mı?

Bu içerik size yardımcı oldu mu?