D
draco
Guest
why would I post teh Bod script?
Add( new GenericBuyInfo( "Valorite Runic Fletcher's Tool",typeof( RunicFletchersTools ), 5000000, 20, 4130, 2219, new object[] { CraftResource.Valorite }) );
Add( new GenericBuyInfo( typeof( RunicHammer ), 5000, 20, 0x13E3, 0x973, new object[] { CraftResource.DullCopper, 5 } ) );
---------------------------------------------------------=========================================================
Reproducible: Yes ( with a custom script to demonstrate)
Crash: Yes (log further down in description)
This defect invalidates the use of the overloaded GenericBuyInfo constructors that pass arguments for the constructor of the object. Specifically if the last parameter to either of the following signatures of the constructor is not null the system will crash at the sale of the item:
public GenericBuyInfo( Type type, int price, int amount, int itemID, int hue, object[] args ) : this( null, type, price, amount, itemID, hue, args )
public GenericBuyInfo( string name, Type type, int price, int amount, int itemID, int hue, object[] args )
NOTE: This is currently unused in the base distribution but it is defined in the base scripts and does not work as written. Hence the original severity of Trivial.
=== Fix =============================================================
Missing between line 81 and 98 of Scripts\Mobiles\Vendors\SBInfo\GenericBuy.cs is the following line to actually store the passed args into the member variable m_Args.
m_Args = args;
=== Demo =============================================================
add at line 23 of SBSmithTools.cs from:
Add( new GenericBuyInfo( typeof( RunicHammer ), 500, 20, 0x13E3, 0x973, new object[] { CraftResource.DullCopper, 5 } ) );
Start server, [add blacksmith, buy tongs
=== Log ==============================================================
Server Crash Report
===================
Operating System: Microsoft Windows NT 5.0.2195.0
.NET Framework: 1.1.4322.573
Time: 23-Mar-2004 10:47:21
Mobiles: 1311
Items: 38171
Clients:
- Count: 1
+ 127.0.0.1: (account = Lord Arlan) (mobile = 0x1 'Overlord')
Exception:
System.MissingMethodException: No parameterless constructor defined for this object.
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at Server.Mobiles.GenericBuyInfo.GetObject()
at Server.Mobiles.BaseVendor.OnBuyItems(Mobile buyer, ArrayList list)
at Server.Network.PacketHandlers.VendorBuyReply(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)
=========================================================
Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Gumps.MsgReadGump..ctor(Mobile from, String Message)
at Server.Gumps.MsgReplyGump.OnResponse(NetState state, RelayInfo info)
at Server.Network.PacketHandlers.DisplayGumpResponse(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)
DarkArcaneus said:Whenever I [add runicfletcherstools valorite or verite in game... When you single click either the valorite or verite fletchers tools it says "You will find a million gold piece check in your bank" for valorite and "scan completed" for verite. Crazy eh? any ideas would be greatly appreciated.
Thanks a million or the code otherwise it s rocking!!!!
Alatariel said:I'm bumping this as I also had a concern over this small glitch. Has anyone yet found a way to get around this? If I dont fix this they will be demanding million dollar checks because the fletcherstools promised them one! hehe.
Put it on vendors or spawn it on monsters yourself. I've yet to see a script like this in which they do that for you; it just allows for more customization if they don'tDevious said:well there was no bods with it. i am just curious as to how you get it. i have been trying but no luck at it. I would like to know. Thanx.