Go Back   RunUO - Ultima Online Emulation > RunUO > Custom Script Releases

Custom Script Releases This forum is where you can release your custom scripts for other users to use.

Please note: By releasing your scripts here you are submitting them to the public and as such agree to publish them under the GPL licensing terms. The RunUO Team has made its software GPL for you to use and enjoy you should do the same for anything based off of RunUO.

Reply
 
Thread Tools Display Modes
Old 06-11-2007, 10:18 PM   #1 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,427
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Smile Linked Books, Linked Bags, oh my!

Linked Books, and Linked Bags

These are fun.

Mordero released his Journey Books, and was wondering if the same type of thing could be done without editing the basebook script. Here is his post:

[RunUO 2.0 RC1] Journey Books

But these 2 scripts are actually very different. The actual scripting of them were more inspired by my own release of the Linked Gates, which you can view here:

Linked Gates

First, the Linked Books.

The magic starts with a bag. A Bag of Linked Books. You double-click the empty bag, and you get 2 books, which are bound (no pun intended) to eachother forever. As long as the bag is empty, it will create 2 Linked Books every time you open it. (GM's only, although you can play with that part.)

Each book is just like a regular book in almost every way, except when you double-click it, it toggles between showing you its own contents, and that of it's mate. The mate acts the same way. Each time you open the book it will toggle back and forth, so it acts sort of like a magic communication device, I guess. Anyway, it's fun.

Next, the Linked Bags.

These are a riot. They are created in the same way. You get a Bag of Linked Bags. When you double-click the bag, it creates 2 Linked Bags (with your name on it too.)

The bags act like you would probably guess. When you drop something in one, it actually appears inside the other. It doesn't matter who is holding it, or where it is, if the bag can hold it, it will drop it in. (Don't worry, you can't give it to an enemy and overload him so you can PK him. It does the normal check to see if the bag can hold the contents.)

Installation:

Drop and go!

Maintenance:

If for some reason a mate gets deleted, you can target a new one by using [props. Enjoy!

UPDATES:

6/16/2007
- Added Linked Gates script to downloads.
- Edited Linked Books. Now you can open the 2nd book from anywhere in Read-Only mode.
- Updated Linked Bags to prevent them from accepting Linked Bags.
Attached Files
File Type: zip LinkedBooks.zip (1.1 KB, 191 views)
File Type: zip LinkedGates.zip (1.9 KB, 177 views)
File Type: zip LinkedBags.zip (948 Bytes, 198 views)

Last edited by Lokai; 06-16-2007 at 10:48 PM.
Lokai is offline   Reply With Quote
Old 06-11-2007, 11:45 PM   #2 (permalink)
Tru
Forum Expert
 
Tru's Avatar
 
Join Date: Jan 2003
Location: California
Age: 40
Posts: 3,260
Default

Excellent. Cool rewards!
Tru is offline   Reply With Quote
Old 06-16-2007, 05:12 PM   #3 (permalink)
Forum Master
 
Lord_Greywolf's Avatar
 
Join Date: Dec 2005
Posts: 9,722
Send a message via Yahoo to Lord_Greywolf
Default

Just noticed something with the books
if they are in 2 different packs - can not open the one in the other pack - it ignores the dbl click, and next time open yours again

if one is in pack and 1 in house (locked down or not) - one in pack can open both, but one in house can not open one in pack

and if both are in different houses and locked down - they can only open themselves and not the other one

so basicaly one person can carry it and write in the book in the house, or if both in same pack can write to both, otherwise problem

so any ideas on a fix?
__________________
http://www.AoAUO.com

:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :)
Lord_Greywolf is offline   Reply With Quote
Old 06-16-2007, 06:09 PM   #4 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,427
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

Quote:
Originally Posted by Lord_Greywolf View Post
Just noticed something with the books
if they are in 2 different packs - can not open the one in the other pack - it ignores the dbl click, and next time open yours again

if one is in pack and 1 in house (locked down or not) - one in pack can open both, but one in house can not open one in pack

and if both are in different houses and locked down - they can only open themselves and not the other one

so basicaly one person can carry it and write in the book in the house, or if both in same pack can write to both, otherwise problem

so any ideas on a fix?
Ah, there is my problem, playing all by myself on my little test server. Give me a bit, and I will think of it.
Lokai is offline   Reply With Quote
Old 06-16-2007, 07:09 PM   #5 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,427
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

Just updated the first post.

- Edited the Linked Books so when you double-click the 2nd time, no matter where the book is in the world it will show you the contents in Read-Only mode.
- Added my Linked Gates to the list of downloads, and separated the scripts into 3 zip files.
Lokai is offline   Reply With Quote
Old 06-16-2007, 08:27 PM   #6 (permalink)
andrewd
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Lokai View Post
Just updated the first post.

- Edited the Linked Books so when you double-click the 2nd time, no matter where the book is in the world it will show you the contents in Read-Only mode.
- Added my Linked Gates to the list of downloads, and separated the scripts into 3 zip files.
can u show the changes because i had to change some things and forgot what i did.thxs
  Reply With Quote
Old 06-16-2007, 08:35 PM   #7 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,427
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

I added this class:

Code:
    public sealed class LinkedBookHeader : Packet
    {
        public LinkedBookHeader(Mobile from, BaseBook book)
            : base(0xD4)
        {
            string title = book.Title == null ? "" : book.Title;
            string author = book.Author == null ? "" : book.Author;
            byte[] titleBuffer = Utility.UTF8.GetBytes(title);
            byte[] authorBuffer = Utility.UTF8.GetBytes(author);
            EnsureCapacity(15 + titleBuffer.Length + authorBuffer.Length);
            m_Stream.Write((int)book.Serial);
            m_Stream.Write((bool)true);
            m_Stream.Write((bool)book.Writable);
            m_Stream.Write((ushort)book.PagesCount);
            m_Stream.Write((ushort)(titleBuffer.Length + 1));
            m_Stream.Write(titleBuffer, 0, titleBuffer.Length);
            m_Stream.Write((byte)0); // terminate
            m_Stream.Write((ushort)(authorBuffer.Length + 1));
            m_Stream.Write(authorBuffer, 0, authorBuffer.Length);
            m_Stream.Write((byte)0); // terminate
        }
    }
And changed this part of the OnDoubleClick method:

Code:
            from.Send(new LinkedBookHeader(from, book)); //changed this line
            from.Send(new BookPageDetails(book));
            Toggle = !Toggle;
        }
Lokai is offline   Reply With Quote
Old 06-16-2007, 08:55 PM   #8 (permalink)
Forum Master
 
Lord_Greywolf's Avatar
 
Join Date: Dec 2005
Posts: 9,722
Send a message via Yahoo to Lord_Greywolf
Default

will give it a try at least this way they can read it

did you change linkbags at all? (i have not noticed any problem with them yet - just making sure of no changes)
__________________
http://www.AoAUO.com

:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :)
Lord_Greywolf is offline   Reply With Quote
Old 06-16-2007, 10:40 PM   #9 (permalink)
andrewd
Guest
 
Posts: n/a
Default i have found one problem

with the bags that is if u drop the linked bag into the other liked bag they will remove each other and become part of the internal items.
need a check to not allow u to drop the bag in one another.
i like the scripts alot u the man lokai
  Reply With Quote
Old 06-16-2007, 10:43 PM   #10 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,427
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

Quote:
Originally Posted by andrewd View Post
with the bags that is if u drop the linked bag into the other liked bag they will remove each other and become part of the internal items.
need a check to not allow u to drop the bag in one another.
i like the scripts alot u the man lokai
Thanks for the unusual error catch there. I will check it out.
Lokai is offline   Reply With Quote
Old 06-16-2007, 10:45 PM   #11 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,427
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

This ought to take care of it:

Code:
        public override bool OnDragDropInto(Mobile from, Item item, Point3D p)
        {
            if (item is LinkedBag) return false; //This line added.
I updated the download with this also.

Last edited by Lokai; 06-16-2007 at 10:49 PM.
Lokai is offline   Reply With Quote
Old 06-16-2007, 10:46 PM   #12 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 41
Posts: 1,427
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

Quote:
Originally Posted by Lord_Greywolf View Post
will give it a try at least this way they can read it

did you change linkbags at all? (i have not noticed any problem with them yet - just making sure of no changes)
No other changes except the one andrewd found, which is fixed now.
Lokai is offline   Reply With Quote
Old 04-03-2008, 12:05 PM   #13 (permalink)
Forum Novice
 
Hanse_T_Insane's Avatar
 
Join Date: Jan 2007
Location: Mount Morris New York
Age: 47
Posts: 215
Send a message via Skype™ to Hanse_T_Insane
Default

How would you set it so that gold and powerscrolls could not be used with it?
Hanse_T_Insane is offline   Reply With Quote
Old 04-03-2008, 12:31 PM   #14 (permalink)
Forum Novice
 
Fenn's Avatar
 
Join Date: May 2005
Age: 28
Posts: 157
Default

on line 36 of LinkedBags.cs:

Code:
            if (item is LinkedBag) return false;
You can limit the items to go in there. If you didn't want gold or power scrolls, you could do the following:

Code:
            if( item is LinkedBag || item is Gold || item is PowerScroll ) return false;
__________________

Universal Storage Keys
- I won't stop until I've found a way to stick an entire shard into these things!
Fenn is offline   Reply With Quote
Old 11-01-2008, 06:22 PM   #15 (permalink)
Lurker
 
Join Date: Sep 2008
Age: 44
Posts: 5
Default

the zip files for bags and books are empty the gates worked great
Dodger-b is offline   Reply With Quote
Old 11-01-2008, 09:50 PM   #16 (permalink)
Forum Novice
 
Join Date: Jul 2006
Location: Oklahoma
Age: 30
Posts: 612
Default

Quote:
Originally Posted by Dodger-b View Post
the zip files for bags and books are empty the gates worked great
Winrar will repair the archive... But in case you or someone else doesnt have winrar here is the .cs files.
Attached Files
File Type: cs LinkedBags.cs (3.1 KB, 19 views)
File Type: cs LinkedBooks.cs (4.1 KB, 15 views)
__________________
Friends Come and go but Enemies accumulate
oiii88 is offline   Reply With Quote
Old 11-01-2008, 10:56 PM   #17 (permalink)
Lurker
 
Join Date: Sep 2008
Age: 44
Posts: 5
Default

i have win rar and Izarc winrar said they were empty wouldnt open them izarc opened them to empty folders tyvm for the files
Dodger-b is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5