Jump to content

Share Seven signs SS->AA exchanger AI


Recommended Posts

Hi there

Just an simple snippet of code taken from seven signs AI and adapted to work on other NPC.

No big magic here. Also code needs some additions (for example return an error message if player does not have any seal stones)

Credits: NCSoft? i guess? :D 

 

      if( reply == 2 )
      {
        if( myself::GetInventoryInfo( talker, 0 ) >= myself::GetInventoryInfo( talker, 1 ) * 0.800000 ||
            myself::GetInventoryInfo( talker, 2 ) >= myself::GetInventoryInfo( talker, 3 ) * 0.800000 )
        {
          myself::ShowSystemMessage( talker, 1118 );
          return;
        }
        i0 = myself::OwnItemCount( talker, @blue_sealstone );
        i1 = myself::OwnItemCount( talker, @green_sealstone );
        i2 = myself::OwnItemCount( talker, @red_sealstone );
        if( i0 > 0 || i1 > 0 || i2 > 0 )
        {
          i3 = i0 * 3 + ( i1 * 5 + i2 * 10 );
          if( i0 > 0 )
          {
            if( 2 == 2 )
            {
              myself::DeleteItem1( talker, @blue_sealstone, i0 );
            }
            else
            {
              myself::DeleteItem1( talker, @blue_sealstone, i0 );
            }
          }
          if( i1 > 0 )
          {
            if( 2 == 2 )
            {
              myself::DeleteItem1( talker, @green_sealstone, i1 );
            }
            else
            {
              myself::DeleteItem1( talker, @green_sealstone, i1 );
            }
          }
          if( i2 > 0 )
          {
            if( 2 == 2 )
            {
              myself::DeleteItem1( talker, @red_sealstone, i2 );
            }
            else
            {
              myself::DeleteItem1( talker, @red_sealstone, i2 );
            }
          }
          if( i3 > 0 )
          {
            myself::GiveItem1( talker, @adena_of_ancient, i3 );
          }
        }
      }

 

 

Edited by Griunvaldas
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...