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!

Post Office Stone

raisor

Wanderer
Post Office Stone

This is the full Post Office system that I have written. It includes a PostOfficeStone, AddressBook, MailBox, Letter, PostalWorker, PostOfficeEAddon, and PostOfficeSAddon.
The Post Office Stone requires an Addressbook be present in your backpack and a mailbox be present in your bank to work properly. The Letter is just a neat little item that can be used to send messages to other players. The Addons are pre-built buildings that can be placed and the signs name set to post office. The postal worker sells letters and allows players to open their mailboxs when not near a bank.

Installation:
Unzip the *.cs files to your Scripts folder.

Usage:
[ADD PostOfficeStone
[ADD AddressBook
[ADD Letter
[ADD MailBox
[ADD PostalWorker
[ADD PostOfficeSAddon
[ADD PostOfficeSAddonDeed
[ADD PostOfficeEAddon
[ADD PostOfficeEAddonDeed

Updates:
11-27-2004 1:30PM MST - Fixed issue with the LetterReadGump.cs causing a problem of duplication of letters when trying to close it and no recipient or message is entered.
10-27-04 12:00PM MST - Cleaned up post office code and fixed possible bug with letter script.
10-14-04 5:50PM MST - Added my version of the Postal Worker. He Sells letters for 5gp and if you left click on him he has a context menu entry for opening your mail box! Also added in some pre-built buildings that can be used as post offices. See above for usage. If you use the PostOffice addon buildings then be sure to set the brass signs name to post office!
10-13-04 11:00PM MST - Fixed problem with address book not staying blessed.
10-06-04 12:02AM MST - Also, I forgot that you will have to add the following code to the beginning of your LoginStats.cs:
Code:
using Server.Gumps;
Thanks again to Negaduck for pointing this out.
10-04-04 7:38PM MST - Forgot to mention that you have to add the following code to the begining of your LoginStats.cs:
Code:
using Server.Items;
Thanks to Negaduck for pointing this out!
10-03-04 8:53PM MST ? Added Mailbox for items to be delivered to. Place the following code in your CharacterCreation.cs file under the EventSink_CharacterCreated area:
Code:
newChar.BankBox.DropItem( new MailBox() );
Also, in order for the NewMailGump to be shown on player login, you will need to add this code to the LoginStats.cs under the EventSink_Login area:
Code:
MailBox mailbox = m.BankBox.FindItemByType( typeof( MailBox ) ) as MailBox;
if ( mailbox != null )
{
if ( mailbox.NewMail == "true" )
m.SendGump( new NewMailGump( m, mailbox ) );
}
09-15-04 9:18AM MST - Fixed bug with letters. Will no longer blank letter after trying to change it.
09-15-04 8:38AM MST - Made addressbook blessed by default and added script to block adding yourself.
09-14-04 5:52AM MST - Fixed Gump wording in the letter to stop confusion about how to use it. Also fixed wording on PostOfficeGump to point out button added so name can be chosen.
09-13-04 9:11PM MST - Added Serialize and Deserialize methods for addressbook and letter. This should fix issues with lost information on server reboot. *** WARNING *** You will HAVE to delete all letters and address books that currently exist in your world in order to install this upgrade.
09-12-04 8:03PM MST - Got the post office stone to work with the Address book. Post Office Stone now requires the address book to work. Added a few bug fixes with not getting gold back and such. Added Post Office Stone, Address Book, and Letters all in to the same ZIP file.
09-11-04 8:56PM MST - Added code to block containers from being sent. Added code to only delete items if the name specified exists on the shard.
09-11-04 4:39PM MST - Added a message for players that are online to notify them that they have received a new item. Also added the new PostOfficeGump.cs to the zip file.
09-10-04 8:08AM MST - Added the ability to send items from the backpack or the bankbox.
Please feel free to PM me or respond to this thread with any questions, comments, or help with my todo list!

*** CREDITS ***
Thanks to atticus589 for creating an AWESOME gump. I look forward to more of your work!
Thanks to Cmajor for providing the code to block sending containers. Works like a charm!

Thanks,
Tom Sapp
 

Attachments

  • PostOffice.2.5.zip
    21.2 KB · Views: 781
Just an idea

Well to deal with the name problem why dont you just make it so that players send items to a specific character on a specific account by having the player that is sending the item type in a gump <accountname><charactername> then hit a send button and target the item to be sent. Also i would make items sendable from bank boxes due to some items being heavy but make it so you can only send items from your bankbox or backpack. Well that is just one idea that might work i hope it helps some.
 

atticus589

Sorceror
Gump

Raisor Did ask me to make him a gump if you want to use it here it is just replace the old one with this new one...
 

Attachments

  • PostOfficeGump.cs
    4.4 KB · Views: 168

atticus589

Sorceror
2nd gump

Looooks a whole lot better than the first gump.... Not saying anything against Raisor but he asked me to make it and i did... he said it is awesome.... which means alot coming from an experienced scriptor... it just replaces the old gump...
 

Igon

Wanderer
Nice idea, but what happens if the name specified does not exist?
Well, that is really a loaded question, the item is deleted and noone gets it.

Possible solutions:
Create an array of all players that match the name typed, might want to use .ToLower() when creating the array as to catch any capitalization errors. This will not help with multiple players issue but if there is more than one players with the same name, you will atleast be given a choice of who to send it to.

As far as the container issue u mentioned above, create u could create an array with all items in the container. If u wanted to allow multiple items to be sent, send the container then add all of the items in the array to the container. But, if u wanted to allow the post office to send only one item, check the array for the number of items and if there is anything in the box, dont send it stop the script from sending anything.

Thanks for sharing, i look forward to any mods and if i come up with anything ill post here too.
 
Another possible idea would be blocking the ability to accidently send containers altogether. I know you can't send containers using a Bag of Sending... :)
 
C

Cmajor

Guest
thegrandmystic said:
Another possible idea would be blocking the ability to accidently send containers altogether. I know you can't send containers using a Bag of Sending... :)


Add this code before the check for item in the PostOfficeGump.cs, ln 82

Code:
if ( o is Container ) 
       { 
        from.SendMessage( "You can't send Container's" ); 
       }
 

brodock

Sorceror
to be more like a post oficce, you can make the price proportional to the weight of what you are sending...
 

raisor

Wanderer
Taffer said:
Did you make an NPC postman too?
Nope, kessia is working on that! :D

flowerbudd :eek: said:
Wow, this is Fabtastic!
__________________
Housewife and Mother
Owner of The Garden
Thanks!

By the way, the zip is updated with a few changes so ya'll may wanna re-download. Check first post for changes. ;)
 
Top