RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

page after BOD drop

gilgamash

Knight
page after BOD drop

Greets,

I would embrace if, after dropping a bod from a bod-book, the book did not return to the first page.
So here my suggestion of how to avoid this; have done only some minor testing so far, but it seems to work (including, e.g., turning to a previous page in case the dropped bod was the only one of the current page)
-----------

Into BOBGumps.cs

insert this function into the class:

Code:
 public int GetPageForIndex(int index)
{
  iint count = 0;

   if (index <= 0)
     return 0;

   ArrayList list = m_List;

   for (int i = 0; i < index && i < list.Count; i++)
   {
      object obj = list[i];
      if (CheckFilter(obj))
      {
         if (obj is BOBLargeEntry)
           count += ((BOBLargeEntry)obj).Entries.Length;
         else
           count++;
       }
     }
     return (int)((count / 10) - Convert.ToInt32((count % 10) == 0));
   }

and change the drop part (line 274 ff) to

Code:
  if ( type == 0 ) // Drop
  {
    if ( m_Book.IsChildOf( m_From.Backpack ) )
    {
	Item item = Reconstruct( obj );
	if ( item != null )
	{
		m_From.AddToBackpack( item );
		m_From.SendLocalizedMessage( 1045152 ); // The bulk order deed has been placed in your backpack.
		m_Book.Entries.Remove( obj );
		m_Book.InvalidateProperties();

                if (m_Book.Entries.Count > 0)
                {
                    m_Page = GetPageForIndex(index);
                    m_From.SendGump(new BOBGump(m_From, m_Book, m_Page, null));
                 }
                 else
                     m_From.SendLocalizedMessage(1062381); // The book is empty.
	}
	else
       {
	  m_From.SendMessage( "Internal error. The bulk order deed could not be reconstructed." );
	}
    }
  }

G.
 

meeex

Sorceror
Hello
who can help me pls
the gump "Price all" from TamingBOBGump.cs not works
the gump "Price all" from FletchBOBGump.cs works
where is the error on TamingBOBGump.cs
 

Attachments

  • TamingBOBGump.cs
    19.3 KB · Views: 0
  • FletchBOBGump.cs
    36.4 KB · Views: 1
Top