just wondering if anyone has a working bag of blessing script, I cant seem to find any that works properly, any help is appreciated, Thanx
 
Just to clarify you want a bag of blessing that keeps the items inside the bag that are also blessed. Even upon death or removing it from the players backpack?
not just a bag that blesses items. right?

Here is code for a Bag that blesses items placed into it.
I take no credit for this script.
Code:
using System;
using Server.Network;

namespace Server.Items
{
      public class BlessBag : Container
    {
        [Constructable]
        public BlessBag() : base( 0xE76) /*Bag =0xE76 ,Backpack = 0x9B2, Pouch = 0xE79, GrayMetalChest = 0xE7C, WoodenBox = 0xE7D, SmallCrate = 0xE7E, StrongBox = 0xE80*/
        {
          
            Name = "A Blessing Bag";
            Weight = 0.0;
            Hue = 0;
            LootType = LootType.Blessed;
      
        }
  
        public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
      {
        if ( !base.OnDragDropInto( from, item, p ) )
        return false;
        item.LootType = LootType.Blessed;
        from.SendMessage("Thee item becomes Blessed");
        return true;
      }
    
        public override bool OnDragDrop( Mobile from, Item dropped )
      {
        if ( !base.OnDragDrop( from, dropped ) )
        return false;
        dropped.LootType = LootType.Blessed;
        from.SendMessage("Thee item becomes Blessed");
        return true;
      }

        public BlessBag(Serial serial) : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);
            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();
        }
    }
}
 
Last edited by a moderator:
I have entered ur code and made it a .cs file and this is the error I get, I don't quite understand it, cause in laymans terms, it would mean I don't have a base foundation for any type of container. I don't know what else to do I changed it around a bit and same error everytime. thanx and sorry about the pics it is my first time posting pics sorry so large. any help is appreciated.error.jpg script.jpg
 
Change your:
Code:
namespace Server.items

To this:
Code:
namespace Server.Items

C# is case sensitive ;)
 
ok I changed that and for some reason that script now when I start up the server it kicks up a bunch of warnings on other scripts, and telling me that blessed doesn't exist, etc... so im gonna scrap that one and start over with it, thanx for the reply.
 
The code Hank posted above compiles fine for me. If you wanna post the new errors you are getting I can point you in the right direction.
 
Can you post your whole script for me? I can't see all the code from your above screenshot but I do see one error on it.
Change line 15:
Code:
LootType = Blessed;
to:
Code:
LootType = LootType.Blessed;

Need to see the code for the other errors.
 
Line 28:
Code:
public override bool OnDragDrop(Mobile from, Item Dropped)
to:
Code:
public override bool OnDragDrop(Mobile from, Item dropped)



Line 44:
Code:
writer.Writer((int)0); // version
to:
Code:
writer.Write((int)0); // version
 
OMG!!!!! it works it works woot woot, I wanna thank you Kalamus and also u Hank.. I didn't realize how much spelling comes into play for scripting. u guys rock ty ty for all the help and patience dealing with me.
 
i was gonna post it to custom releases with props to u guys but it says (You have insufficient privileges to post here.)why is that??? i don't understand
 
To add a script- you will need to click on UO Archieve (top tab) then on Add Resource and last Custom Releases :)
 
Hmm found a little bug on this item, working on the fix for you . But upon death all items in bless bag are emptied into players main backpack. Should not be hard to change, if i figure it I will post changes ;)
 
Hmm found a little bug on this item, working on the fix for you . But upon death all items in bless bag are emptied into players main backpack. Should not be hard to change, if i figure it I will post changes ;)
The code I posted was never intended to do anything more then bless items that are placed into it. As I posted in my original message with the code.
Just to clarify you want a bag of blessing that keeps the items inside the bag that are also blessed. Even upon death or removing it from the players backpack?
not just a bag that blesses items. right?

Here is code for a Bag that blesses items placed into it.
I take no credit for this script.
OP never said anything about wanting the bag to keep items upon death.
 
Last edited by a moderator:
Aye, lol, cool the jets rock star, just offering to improve his item a little bit, If he wishes to keep it as it is, i'm sure he will post. Thank you
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back