Go Back   RunUO - Ultima Online Emulation > RunUO > RunUO Post Archive

RunUO Post Archive The Archvie

Reply
 
Thread Tools Display Modes
Old 03-17-2004, 04:15 PM   #1 (permalink)
Forum Expert
 
Join Date: Jan 2004
Posts: 1,377
Post [RunUO1.0] Personal Bless Deed v1.3 (OSI)

Version History:

[V 1.3] - 04/05/06
Fixed Serialization/Deserialization bug

[V 1.2] - 04/04/21
Now RunUO 1.0 RC0 compatible

[V 1.1] - 04/03/17
Fixed a small bug with Server.ContextMenus
New Readme included

[V 1.0] - 04/03/17
Initial Release


Summary:
"A Personal Bless Deed is a deed that will allow the blessing of a treasured personal item. The deed can only be used by the player it has been created for. The item will only be blessed for the player who used the deed on it, not even for other characters on the same account. Blessing a cursed item is not possible. The owner can use the 'Unbless' context menu on the blessed item to remove the effect. If he choses to do so, the Personal Bless Deed is restored and will be placed in the players backpack. Please note that, in order to bless or unbless an item, both the deed and the item must be in the players backpack or on the paperdoll."

The deed works (nearly) similar to the one used on OSI servers. There is only one small difference: My version allows you to only bless weapons, armor and clothing (shields are actually derived from BaseArmor and thus can be blessed too). However, on OSI Servers you are able to bless any non-stackable item (with the exception of containers). This includes scissors, dye tubs and even usable items such as potions or food (This has been tested on 04/03/15 on Europa & Atlantic Servers).

Since I believe this is a bug (your deed is lost when you drink a blessed potion or eat blessed food) my version will only be able to bless armor, clothing and weapons (as stated above).

Every single message you get when using this deed is correct and 100% the same as on OSI. The standard RunUO warning gump is used in order to display the information when the Personal Bless Deed is used. Note that the sound when blessing an item also comes without any visual effects on OSI servers. Not getting any confirmation when removing a Personal Bless Deed is also intentional. Weight, displayed loot type and gump size / positions are correct.

I want to thank the following people for helping me with this script:

- Ignacio Vazquez-Abrams
- Phantom
- tobagin
- Crack177
- LtLDevil


This Version is FINAL. If any bugs are found I will fix them. I will not add any features though.

If you have any problems with this script, feel free to post them here. Do not PM/email/ICQ me about this script or you will be put on ignore. If the answer can be found in the included README file or in the description, I will not bother to answer.

Description:

The following constructors are used:
  • PersonalBlessDeed ()
  • PersonalBlessDeed ( Serial serial )
  • PersonalBlessDeed ( Mobile owner )

When used with the Mobile owner parameter, the deed will save the owner in a variable of the Mobile type. It is only usable by the player set in this variable. If no player is set, the deed will not be usable by anyone. In the latter case it will display "Personal Bless Deed For A Player". If the Mobile is set, the correct ~1_name~ value will be used.

Installation:

Required Steps
  1. Drop the PersonalBlessDeed.cs file in your Custom Scripts folder.
  2. The files BaseWeapon.cs, BaseArmor.cs and BaseClothing.cs are modified RunUO 1.0 distro files. So if you are using the distro version of those files, you can just overwrite them with the versions found in this zip file. The serialize/deserialize methods in those files are correct. So when the server asks you to delete some objects you have obviously done something wrong.
  3. If you do not have distro versions of the three files mentioned above, you find instructions on how to edit them in the file README.TXT included in the zip.

Optional Step
In case you want to give a Personal Bless Deed to all newly created characters you need to edit the file CharacterCreation.cs

Find the following function:

Code:
private static void AddBackpack( Mobile m )
{
(...)
}
And add this line at the end of the function:

Code:
PackItem( new PersonalBlessDeed(m) );
This will ensure that the newly created Personal Bless Deed is only usable by the character it has been created for.
Attached Files
File Type: zip PersonalBlessDeed13.zip (31.8 KB, 1346 views)
__________________
Dracarys
retired - consider me dead to these boards
Dracarys is offline   Reply With Quote
Old 03-17-2004, 05:50 PM   #2 (permalink)
 
Join Date: Jan 2004
Posts: 753
Send a message via ICQ to Crack177 Send a message via AIM to Crack177 Send a message via Yahoo to Crack177
Default

This script works great. Thanks Dracarys. This will work good for my players. They will get this as a prize.
__________________
Quote:
psz wrote:
You can't block an account because someone doesn't know what they're doing... If the devs did, there'd be, what, 100 accounts instead of ~42000...
Quote:
Phantom wrote:
dieirlthnxbye
The two best quotes I have seen so far on this forum.
My Website
Crack177 is offline   Reply With Quote
Old 03-17-2004, 07:02 PM   #3 (permalink)
 
Join Date: Oct 2002
Age: 23
Posts: 4,689
Default

You could have used an interface which would use forward-backward casting to integrate it into all items. Along with some reflection shit. That would be VERY difficult to do and probably not worth it. Great job, although since I use a baseitem class, I will be able to put this into it for it to work with every item.
XxSP1DERxX is offline   Reply With Quote
Old 03-17-2004, 07:12 PM   #4 (permalink)
Forum Expert
 
Join Date: Jan 2004
Posts: 1,377
Default

That's good although i don't recommend it. You will have to make a check for a lot of items. Like

is BasePotion
is BaseFood

As i said, OSI PBD's are bugged. I have them implemented on my shard differently anyway. Currently you can throw your PBD away and it's lost forever. On a freeshard this might not be a big problem since it can be replaced. Losing it on OSI, however is quite bad since you won't get it back ever. Someone used the Insurance exploit on me on europa and looted a very good 1/3 bracelet with a lot of sdi and lmc. This brace was personally blessed. He even wanted to give the deed back but only the owner can remove it. Since he didn't want to give me the brace back (understandable) he called a GM to remove the blessing and give me the deed back. As it gies, however, the GM deleted the deed and left.

To avoid this i used an old idea posted on stratics suggestions board that basically adds a context menu to your character and allows you to bless/unbless/retrieve your item. Works way better :-)
__________________
Dracarys
retired - consider me dead to these boards
Dracarys is offline   Reply With Quote
Old 03-17-2004, 07:20 PM   #5 (permalink)
 
Join Date: Oct 2002
Age: 23
Posts: 4,689
Default

Yeah definately does work better. It would be great if this could be put into distro and attached to the Item class, then using configure (for like insurance) it could be disabled.

The way it works on OSI is fine if there are no exploits to take the blessed item from the person who owns it. The GMs are also not part of OSI emulation, you cannot consider that when you are coding it, although dumbass asshole GMs are a part of shards so I guess you can think of it either way.
XxSP1DERxX is offline   Reply With Quote
Old 03-17-2004, 07:27 PM   #6 (permalink)
Forum Expert
 
Join Date: Jan 2004
Posts: 1,377
Default

Unfortunately these exploits still exist.

The OSI way is still crap:

1) Buy or mix a potion
2) Personal-Bless the potion
3) Drink it

Whoops, deed gone. I tried that yesterday after server-save.
__________________
Dracarys
retired - consider me dead to these boards
Dracarys is offline   Reply With Quote
Old 03-17-2004, 07:29 PM   #7 (permalink)
 
Join Date: Oct 2002
Age: 23
Posts: 4,689
Default

Well obviously if this was made into the distro, the delete method would return the deed before it finishes the deletion proccess. Other than that, you can't do much. However with a baseitem class, you can do the same as what the devs would with the distro and that is, change the baseitem's (and basecontainer i might add) delete method to return the deed.
XxSP1DERxX is offline   Reply With Quote
Old 03-18-2004, 05:04 AM   #8 (permalink)
Forum Expert
 
Join Date: Jan 2004
Posts: 1,377
Default

Quote:
Originally Posted by XxSP1DERxX
and basecontainer i might add
How so?


I'm currently messing with interfaces and might re-release a more-close-to-osi version once i figured out how this stuff works.
__________________
Dracarys
retired - consider me dead to these boards
Dracarys is offline   Reply With Quote
Old 04-01-2004, 03:49 PM   #9 (permalink)
 
Join Date: Oct 2003
Location: Wyoming
Age: 27
Posts: 62
Thumbs up Props

Great script you have here...in fact it's one of the few scripts I've gotten here that I didn't need to edit any code on to make it work right. I've been waiting for this script for a while. Thanks for posting it.

-Davil the Dark
AEther Storm Shard
thedavil is offline   Reply With Quote
Old 04-01-2004, 04:28 PM   #10 (permalink)
Forum Expert
 
Join Date: Jan 2004
Posts: 1,377
Default

Thank you

Glad you like it. :-)
__________________
Dracarys
retired - consider me dead to these boards
Dracarys is offline   Reply With Quote
Old 04-04-2004, 06:45 AM   #11 (permalink)
 
Join Date: Oct 2003
Location: Scotland
Age: 30
Posts: 84
Default

Great Script Thanks
__________________
Possibly maybe thinking about a new shard, All depends on if i can be bothered. :p
Karami is offline   Reply With Quote
Old 04-21-2004, 02:10 PM   #12 (permalink)
 
Join Date: Mar 2004
Location: JAX, FL
Age: 32
Posts: 86
Send a message via ICQ to LtLDevil
Default Does this script still work on 1.0?

Or do i need to modify it to make it work ?
Thanks,
Devil
LtLDevil is offline   Reply With Quote
Old 04-21-2004, 02:56 PM   #13 (permalink)
Forum Expert
 
Join Date: Jan 2004
Posts: 1,377
Default

Quote:
Originally Posted by LtLDevil
Or do i need to modify it to make it work ?
Thanks,
Devil
No, this works just the same on 1.0RC0.

Maybe I will post a re-written version of this, once I figure out how to do it with interfaces. Until then, this version will work with the current RunUO release.
__________________
Dracarys
retired - consider me dead to these boards
Dracarys is offline   Reply With Quote
Old 04-21-2004, 03:24 PM   #14 (permalink)
 
Join Date: Mar 2004
Location: JAX, FL
Age: 32
Posts: 86
Send a message via ICQ to LtLDevil
Default I droped it in and ran compiler.

This is what I saw..
Any ideas?


This is with your distro c# scripts for weps, armor, and clothing.
I just made backups of the originals, and replaced them with yours.
LtLDevil is offline   Reply With Quote
Old 04-21-2004, 03:34 PM   #15 (permalink)
Forum Expert
 
Join Date: Jan 2004
Posts: 1,377
Default

Quote:
Originally Posted by LtLDevil
This is what I saw..
Any ideas?

This is with your distro c# scripts for weps, armor, and clothing.
I just made backups of the originals, and replaced them with yours.
Ooooh, I see that's what you mean... *cough* *cough*

Let me fix this, just a minute, I'll repost it.
__________________
Dracarys
retired - consider me dead to these boards
Dracarys is offline   Reply With Quote
Old 04-21-2004, 05:05 PM   #16 (permalink)
Forum Expert
 
Join Date: Jan 2004
Posts: 1,377
Default

Done, you can re-download it :-)

Now works for 1.0RC0
__________________
Dracarys
retired - consider me dead to these boards
Dracarys is offline   Reply With Quote
Old 04-21-2004, 05:17 PM   #17 (permalink)
 
Join Date: Mar 2004
Location: JAX, FL
Age: 32
Posts: 86
Send a message via ICQ to LtLDevil
Lightbulb Awesome!

Your the best Dracarys!
I'll get it on as soon as I get home from the office.. *Time to go home*
Your script worked awesome on Beta36! I know it will also work just as well with the new release..
Thanks,
Devil
LtLDevil is offline   Reply With Quote
Old 04-21-2004, 05:21 PM   #18 (permalink)
 
Join Date: Oct 2002
Age: 23
Posts: 4,689
Default

Sorry I didn't post about this. What you would have to do is tack on an override to the delete method for basecontainer (if you want to allow containers to be personally blessed), in order to return the deed. I don't know, doesn't matter, good job on the bless deed.
XxSP1DERxX is offline   Reply With Quote
Old 04-21-2004, 05:22 PM   #19 (permalink)
 
Join Date: Oct 2002
Age: 23
Posts: 4,689
Default

I haven't tested it, or used it since i put it in actually, although what would happen if you personally bless something that is stackable, then split the stack? Are stackable items blessable?
XxSP1DERxX is offline   Reply With Quote
Old 04-21-2004, 05:32 PM   #20 (permalink)
Forum Expert
 
Join Date: Jan 2004
Posts: 1,377
Default

In order to prevent exploiting, I only allow blessing of Clothes, Armor and Weapons and all items derived from these classes (i.e. shields)

There is an extra check to disallow stackable items. What would happen? Well, technically you would have two blessed items if you split the stack. That's the exploit.

PBD's can't be used on stackable items on OSI, by the way. But as mentioned before, you can bless food/potions on OSI.

Containers can't also be blessed with this script (Or on OSI for that matter).
__________________
Dracarys
retired - consider me dead to these boards
Dracarys is offline   Reply With Quote
Old 04-21-2004, 05:50 PM   #21 (permalink)
 
Join Date: Oct 2002
Age: 23
Posts: 4,689
Default

Okay so nevermind what i said about basecontainer. As for making this fairly easy to use, and work with the item class, the easiest way is to use the baseitem class with an interface.

Another way you can do it, is to make an arraylist. While the bless deed is on an item, it is in the internal map. While there, whenever you want to find out if it should be blessed, you can check it by looping through the arraylist, then checking if one of them is linked to the item that is blessed, and then if the property of that bless deed also matches the person who owns the blessed item.

To elaborate on the other method i said in pm. You can use the bless deed, put it into the internal map, then hook it via events and a delegate, to the OnDelete method (to return the deed to its owner), and hook it to the OnAdded method (or whatever other methods would take care of it being deleted or moved for its blessed effect).
XxSP1DERxX is offline   Reply With Quote
Old 04-21-2004, 06:26 PM   #22 (permalink)
Forum Expert
 
Join Date: Jan 2004
Posts: 1,377
Default

See PM. Ad first method, we don't have a BaseItem class. Really the only problem is getting an interface to ADD a function to a existing class without editing the class itself! Kind of impossible, I think.
__________________
Dracarys
retired - consider me dead to these boards
Dracarys is offline   Reply With Quote
Old 04-21-2004, 06:30 PM   #23 (permalink)
 
Join Date: Oct 2002
Age: 23
Posts: 4,689
Default

You cant do it with interfaces. Although I do suggest, you just edit BaseArmor, BaseWeapon, BaseClothing, etc.

Or are there more items than those which can be blessed?
XxSP1DERxX is offline   Reply With Quote
Old 04-21-2004, 06:38 PM   #24 (permalink)
Forum Expert
 
Join Date: Jan 2004
Posts: 1,377
Default

Quote:
Originally Posted by XxSP1DERxX
You cant do it with interfaces. Although I do suggest, you just edit BaseArmor, BaseWeapon, BaseClothing, etc.

Or are there more items than those which can be blessed?
Well, in a way yes. On OSI at least. Ideally i would have an interface IPBlessable that could just be added to every item you want to be blessable.



Quote:
Originally Posted by XxSP1DERxX
Although I do suggest, you just edit BaseArmor, BaseWeapon, BaseClothing, etc.
That's the way it works now...
__________________
Dracarys
retired - consider me dead to these boards
Dracarys is offline   Reply With Quote
Old 04-21-2004, 06:44 PM   #25 (permalink)
 
Join Date: Oct 2002
Age: 23
Posts: 4,689
Default

Nothing you can do other than that . The interface will allow you to reference all of the blessable items without excessive if statements, and thats the best I can think of without interpolating, and reflecting the item class.

Krrios did say, one day a long time ago. I wonder how long until someone figures out how to reflect the core.
XxSP1DERxX 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 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5