RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Runic fletcherstool

DarkArcaneus

Wanderer
Script Question about RunicFletchersTools

I am a noobie scriptor I humbly ask you scripting giants to look at my code... I got two questions.

1.
Here is my code for trying to sell these Runic Fletcher Tools

Add( new GenericBuyInfo( "Valorite Runic Fletcher's Tool",typeof( RunicFletchersTools Valorite), 5000000, 20, 4130, 2219 ) );
Add( new GenericBuyInfo( "Verite Runic Fletcher's Tool",typeof( RunicFletchersTools Verite), 2000000, 20, 4130, 2207 ) );
Add( new GenericBuyInfo( "Agapite Runic Fletcher's Tool",typeof( RunicFletchersTools Agapite), 1000000, 20, 4130, 2425 ) );
Add( new GenericBuyInfo( "Gold Runic Fletcher's Tool",typeof( RunicFletchersTools Gold), 300000, 20, 4130, 2213 ) );
Add( new GenericBuyInfo( "Bronze Runic Fletcher's Tool",typeof( RunicFletchersTools Bronze), 100000, 20, 4130, 2418 ) );
Add( new GenericBuyInfo( "Copper Runic Fletcher's Tool",typeof( RunicFletchersTools Copper), 75000, 20, 4130, 2413 ) );
Add( new GenericBuyInfo( "Shadow Iron Fletcher's Tool",typeof( RunicFletchersTools ShadowIron), 50000, 20, 4130, 2406 ) );
Add( new GenericBuyInfo( "Dull Copper Runic Fletcher's Tool",typeof( RunicFletchersTools DullCopper), 25000, 20, 4130, 2419 ) );

If I take the color out.. the code compiles but server crashes when item is bought. With the color in the line the code will not compile. I get expected Error Invalid Expression Term. Any thoughts to correct this ?

2.
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!!!! :)
 

awdball

Sorceror
Don't fight with it. The correct format of this call has a bug I'll post in a bit. Go to script downloads and find the runicvendor script. It's an acceptable workaround.
---------------------------------------------------------
awdball (old school c coder learning and luvin c#)
 

awdball

Sorceror
B36 bug: GenericBuyInfo does not implement m_Args correctly

Since the bug report forum has been replaced by bugzilla I thought I'd let you all know about this here.

The correct format to call to add these items to a vendor is:
public GenericBuyInfo( string name, Type type, int price, int amount, int itemID, int hue, object[] args )

For example the following would allow a vendor to sell a valorite runic fletchers tool kit:

== WARNING DO NOT DO THIS UNTIL YOU READ REST OF POST WILL CRASH SERVER ==
Code:
Add( new GenericBuyInfo( "Valorite Runic Fletcher's Tool",typeof( RunicFletchersTools ), 5000000, 20, 4130, 2219, new object[] { CraftResource.Valorite }) );
== /WARNING ==

or to sell a 5 use dull copper smiths hammer
== WARNING DO NOT DO THIS UNTIL YOU READ REST OF POST WILL CRASH SERVER ==
Code:
Add( new GenericBuyInfo( typeof( RunicHammer  ), 5000, 20, 0x13E3, 0x973, new object[] { CraftResource.DullCopper, 5 } )  );
== /WARNING ==

To make this really work without crashing see below about adding a line to GenericBuy.cs

bugzilla submission bug # 9: GenericBuyInfo does not implement m_Args correctly
=========================================================

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)

=========================================================
---------------------------------------------------------
awdball (old school c coder learning and luvin c#)
 
I

InnerStaff

Guest
i get this crash log i believe it has to do with this script cause i dont crash when its not in....see if u can help
Code:
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)
 
I

InnerStaff

Guest
this line is differnt from ur crash report has nothing to do with vendors... 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)
 
Z

zaphieon

Guest
nice job man





 

Almassey

Sorceror
I was able to get everything to work as far as placing the runicfletcherstools, but when I craft a bow, it has no additional attributes like the runic hammer does. Am I missing somthing?
 

joshw

Sorceror
Are you crafting it from logs or metal see logs don't give resource attributes
thats why you almost have to have a custom wood system to make this useful.
 

jmw_stylus

Sorceror
[add runicfletcherstools <resource>
[add runicfletcherstools <resource> <amount>

in other words:
[add runicfletcherstools gold (making the default gold one, 50 uses)
or
[add runicfletcherstools gold 30 (giving it 30 uses)

im guessing yer not spelling it right. also, an item like this wouldn't show up in the search if u did [add runic, as it requires a resource be named to add it. As far as how players can acquire them ingame, that's for u to decide. If u want them available thru bods, u need to script a bowyer bod system. Personally im too lazy to do that, i included them in my prize room for tokens. Most RunUO shards don't have the playerbase to support bod trading amongst players anyway, and it's nearly impossible to fill the large bods required to get high level runics as a reward anyway. Hope this helps u folks trying to figure out the usage. :)
 

Alatariel

Wanderer
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!!!! :)


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. ;)
 

awdball

Sorceror
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. ;)

yup we kinda covered that one in this thread:

Anyone famialr with the Fletchers Runic Tool?

a Search on "million runic" could have lead you to it.
---------------------------------------------------------
awdball (old school c coder learning and luvin c#)
 

Zidane4056

Wanderer
Devious 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.
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't
 

warduke

Wanderer
Need help posting it to vendor...

Please can someone post a working SBRunic scipt, I wanted to include the fletching tools along with the others.. They work just fine in game just cant seem to get them working on a vendor.

Thanks
 

surge

Wanderer
try this to add it
[add runicfletcherstools 9


9 is val
8 is verite
and so on

and this will add it to the RunicDealer

in the SBRunic.cs add this line

Add( new GenericBuyInfo( "Runic Fletchers Tool",typeof( RunicFletchersTools ), 500000, 20, 0x1022, 0x8AB, new object[] { CraftResource.Valorite, 50 } ) );

you may want to make it all 1 line
 

Astro_Demon

Wanderer
God Damn It People

@$@#$#$ IT PEOPLE HAVE SOME @#$@# SENCE A GUY HAS POSTED TWICE ON THIS THREAD TELLING YOU HOW TO ADD IT!!!!! ITS EASY!

[add runicfletcherstool {ORE TYPE}

MY #$%%^ GOD, YOU LOSERS.
 
Top