QUOTE (Erica @ February 26, 2008 08:04 am) |
Nice just one problem when players unlock it and untrap it they open chest but cant take anything out of the chest says something like cant do that or cant move it its set to moveble false in chest. |
CODE |
// allow items to be lifted instead of stolen from containers LiftOverride = true; |
CODE |
public BaseContainer( int itemID ) : base( itemID ) { // allow items to be lifted instead of stolen from containers by default LiftOverride = true; } |
QUOTE (Erica @ March 11, 2008 02:41 pm) |
Hi ArteGordon question i see that theres randomjewelry in treasure only thing im curious is instead of it giving a ring or bracelet with no stats on them how would i go about adding this in your treasurechest so it does add stats on the bracelet or ring ect ect. |
CODE |
// Jewelry for( int i = Utility.Random( 1, 2 ); i > 1; i-- ) DropItem( Loot.RandomJewelry() ); |
CODE |
// Jewelry for( int i = Utility.Random( 1, 2 ); i > 1; i-- ) DropItem( BaseXmlSpawner.MagicJewelry(1,m_Level) ); |
CODE |
using Server.Mobiles; |
QUOTE (ArteGordon @ March 13, 2008 06:32 am) | ||||||||
The default Loot code doesnt implement random magic jewelry, but XmlSpawner does, so you could do it like this In the treasure chest scripts change things like this
to this
which will drop random magic jewelry with the level of the attributes determined by the level of the treasure chest. And add this to the top of the script as well
|
CODE |
// According to OSI, loot in level 3 chest is: // Gold 250 - 350 // Arrows 10 // Reagents // Scrolls // Potions // Gems // Magic Wand // Magic weapon // Magic armour // Magic clothing (not implemented) // Magic jewelry (not implemented) |
QUOTE (Greystar @ March 13, 2008 09:38 am) | ||
Related Question... Since it's in RunUO for magic jewelry couldn't you just mod this to use the stuff from TreasureMapChest? The following was in level 3.
|
CODE |
else if ( item is BaseJewel ) { int attributeCount; int min, max; GetRandomAOSStats( out attributeCount, out min, out max ); BaseRunicTool.ApplyAttributesTo( (BaseJewel)item, attributeCount, min, max ); cont.DropItem( item ); } |
CODE |
public static Item MagicJewelry(int minLevel, int maxLevel) { BaseCreature.Cap(ref minLevel, 0, 5); BaseCreature.Cap(ref maxLevel, 0, 5); if (Core.AOS) { Item item = Loot.RandomJewelry(); if (item == null) return null; int attributeCount, min, max; BaseCreature.GetRandomAOSStats(minLevel, maxLevel, out attributeCount, out min, out max); if (item is BaseJewel) BaseRunicTool.ApplyAttributesTo((BaseJewel)item, attributeCount, min, max); return item; } else { Item jewel = Loot.RandomJewelry(); return jewel; } } |
CODE |
RunUO - [www.runuo.com] Version 2.0, Build 2959.20979 Core: Running on .NET Framework Version 2.0.50727 Core: Optimizing for 2 processors Scripts: Compiling C# scripts...failed (1 errors, 0 warnings) Errors: + Items/Containers/Container.cs: CS1518: Line 30: Expected class, delegate, enum, interface, or struct CS1518: Line 38: Expected class, delegate, enum, interface, or struct CS1518: Line 46: Expected class, delegate, enum, interface, or struct CS1518: Line 52: Expected class, delegate, enum, interface, or struct CS1518: Line 75: Expected class, delegate, enum, interface, or struct CS0116: Line 81: A namespace does not directly contain members such as field s or methods CS1022: Line 84: Type or namespace definition, or end-of-file expected Scripts: One or more scripts failed to compile or no script files were found. - Press return to exit, or R to try again. |
CODE |
public BaseContainer( int itemID ) : base( itemID ) { // allow items to be lifted instead of stolen from containers by default LiftOverride = true; } } |
QUOTE |
public BaseContainer( int itemID ) : base( itemID ) { // allow items to be lifted instead of stolen from containers by default LiftOverride = true; } <--- get rid of this one } |