1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Bag of Blessing

Discussion in 'Script Support' started by Damien Darkwater, Jan 29, 2014.

  1. Damien Darkwater
    Offline

    Damien Darkwater New Member

    Joined:
    Jan 23, 2014
    Messages:
    28
    Likes Received:
    0
    Publish Number:
    54
    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
     
  2. Hank
    Offline

    Hank Active Member

    Joined:
    Nov 14, 2013
    Messages:
    972
    Likes Received:
    152
    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 (C#):
    1. using System;
    2. using Server.Network;
    3.  
    4. namespace Server.Items
    5. {
    6.       public class BlessBag : Container
    7.     {
    8.         [Constructable]
    9.         public BlessBag() : base( 0xE76) /*Bag =0xE76 ,Backpack = 0x9B2, Pouch = 0xE79, GrayMetalChest = 0xE7C, WoodenBox = 0xE7D, SmallCrate = 0xE7E, StrongBox = 0xE80*/
    10.         {
    11.          
    12.             Name = "A Blessing Bag";
    13.             Weight = 0.0;
    14.             Hue = 0;
    15.             LootType = LootType.Blessed;
    16.      
    17.         }
    18.  
    19.         public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
    20.       {
    21.         if ( !base.OnDragDropInto( from, item, p ) )
    22.         return false;
    23.         item.LootType = LootType.Blessed;
    24.         from.SendMessage("Thee item becomes Blessed");
    25.         return true;
    26.       }
    27.    
    28.         public override bool OnDragDrop( Mobile from, Item dropped )
    29.       {
    30.         if ( !base.OnDragDrop( from, dropped ) )
    31.         return false;
    32.         dropped.LootType = LootType.Blessed;
    33.         from.SendMessage("Thee item becomes Blessed");
    34.         return true;
    35.       }
    36.  
    37.         public BlessBag(Serial serial) : base(serial)
    38.         {
    39.         }
    40.  
    41.         public override void Serialize(GenericWriter writer)
    42.         {
    43.             base.Serialize(writer);
    44.             writer.Write((int)0); // version
    45.         }
    46.  
    47.         public override void Deserialize(GenericReader reader)
    48.         {
    49.             base.Deserialize(reader);
    50.             int version = reader.ReadInt();
    51.         }
    52.     }
    53. }
     
    #2 Hank, Jan 29, 2014
    Last edited: Jan 29, 2014
    • Two Thumbs Up Two Thumbs Up x 1
  3. Damien Darkwater
    Offline

    Damien Darkwater New Member

    Joined:
    Jan 23, 2014
    Messages:
    28
    Likes Received:
    0
    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
     
  4. Kalamus
    Offline

    Kalamus Active Member

    Joined:
    Apr 24, 2013
    Messages:
    282
    Likes Received:
    32
    Change your:
    Code (C#):
    1. namespace Server.items
    To this:
    Code (C#):
    1. namespace Server.Items
    C# is case sensitive ;)
     
  5. Damien Darkwater
    Offline

    Damien Darkwater New Member

    Joined:
    Jan 23, 2014
    Messages:
    28
    Likes Received:
    0
    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.
     
  6. Damien Darkwater
    Offline

    Damien Darkwater New Member

    Joined:
    Jan 23, 2014
    Messages:
    28
    Likes Received:
    0
    Back to the drawing board, lol
     
  7. Kalamus
    Offline

    Kalamus Active Member

    Joined:
    Apr 24, 2013
    Messages:
    282
    Likes Received:
    32
    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.
     
  8. Damien Darkwater
    Offline

    Damien Darkwater New Member

    Joined:
    Jan 23, 2014
    Messages:
    28
    Likes Received:
    0
    here's the new errors, im not worried about the warnings at this time new errors.jpg
     
  9. Kalamus
    Offline

    Kalamus Active Member

    Joined:
    Apr 24, 2013
    Messages:
    282
    Likes Received:
    32
    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 (C#):
    1. LootType = Blessed;
    to:
    Code (C#):
    1. LootType = LootType.Blessed;
    Need to see the code for the other errors.
     
  10. Damien Darkwater
    Offline

    Damien Darkwater New Member

    Joined:
    Jan 23, 2014
    Messages:
    28
    Likes Received:
    0
    ok here is the whole script
     

    Attached Files:

  11. Kalamus
    Offline

    Kalamus Active Member

    Joined:
    Apr 24, 2013
    Messages:
    282
    Likes Received:
    32
    Line 28:
    Code (C#):
    1. public override bool OnDragDrop(Mobile from, Item Dropped)
    to:
    Code (C#):
    1. public override bool OnDragDrop(Mobile from, Item dropped)


    Line 44:
    Code (C#):
    1. writer.Writer((int)0); // version
    to:
    Code (C#):
    1. writer.Write((int)0); // version
     
  12. Damien Darkwater
    Offline

    Damien Darkwater New Member

    Joined:
    Jan 23, 2014
    Messages:
    28
    Likes Received:
    0
    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.
     
  13. Rochaven
    Offline

    Rochaven Member

    Joined:
    Jan 21, 2014
    Messages:
    162
    Likes Received:
    1
    GRATS Damien !!! Consider it your Birthday from them guys lol
     
  14. Kalamus
    Offline

    Kalamus Active Member

    Joined:
    Apr 24, 2013
    Messages:
    282
    Likes Received:
    32
    Well props go to Hank for posting the script. I just fixed your spelling/case errors :).
     
  15. Damien Darkwater
    Offline

    Damien Darkwater New Member

    Joined:
    Jan 23, 2014
    Messages:
    28
    Likes Received:
    0
    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
     
  16. Milva
    Offline

    Admin Moderator

    Joined:
    Mar 3, 2013
    Messages:
    3,544
    Likes Received:
    389
    To add a script- you will need to click on UO Archieve (top tab) then on Add Resource and last Custom Releases :)
     
  17. Damien Darkwater
    Offline

    Damien Darkwater New Member

    Joined:
    Jan 23, 2014
    Messages:
    28
    Likes Received:
    0
    aaaaa ok thank you
     
  18. Milva
    Offline

    Admin Moderator

    Joined:
    Mar 3, 2013
    Messages:
    3,544
    Likes Received:
    389
    Your welcome :)
     
  19. Rochaven
    Offline

    Rochaven Member

    Joined:
    Jan 21, 2014
    Messages:
    162
    Likes Received:
    1
    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 ;)
     
  20. Hank
    Offline

    Hank Active Member

    Joined:
    Nov 14, 2013
    Messages:
    972
    Likes Received:
    152
    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.
    OP never said anything about wanting the bag to keep items upon death.
     
    #20 Hank, Feb 2, 2014
    Last edited: Feb 2, 2014
Similar Threads: Bag Blessing
Forum Title Date
Archived Bug Reports Bag of Sending Charge Consumption Aug 1, 2017
Custom Releases Dusty Artifact Bag Jun 9, 2017
Archived Bug Reports Max limit bag stack Jun 5, 2017
General Discussion Dusty Artifact Bag - Spin off creation 2 errors cant figure out May 30, 2017
Script Support Need help fix item drop in bag May 17, 2017
Script Support LootBag gold not stack Feb 13, 2017
Custom Releases Bag Of Sending (Send items, not by weight) Feb 3, 2017