else if ( Ammo is ArmorPiercingArrow )
if ( Ammo is BaseArrow )
((BaseArrow)Ammo).Hit( attacker, defender );
I appreciate your input Spider. I will make some of the changes you pointed out as soon as I get a chance. I was in too much of a hurry to make a BaseTub it was quicker for me to do a "find/replace" to make the different tubs, but I will do as you suggested. ThanksNagul, your approach is interesting, although how come you put the double click method for arrows into the bow, and not into the baseranged? What if someone created a baseranged item which is not based off of the bow? Its a small technicality, although it makes things alot easier in my opinion.
Also you have checks such as
Code:
else if ( Ammo is ArmorPiercingArrow )
You could do a check for something to the effect of
Code:
if ( Ammo is BaseArrow )((BaseArrow)Ammo).Hit( attacker, defender );
This would allow you to add more Arrow types, without having to add more code changes to the BaseRanged file.
Also something I was thinking was, what if they were not using a quiver, then they could not use these different arrows? Another method of allowing them to select arrows, is to let them double click the arrows themselves, which would switch the arrow type. Just food for thought of course.
Another suggestion is if the tub files you have are so similar, you could make an abstract BaseDipTub object, and inheret each one after that. The unique messages and arrow type could be held in properties.
OK I made the BaseArrow.cs which contains the ArrowTypes in it. How would I call it in BaseRanged.cs? I appreciate your advice, thank you.Nagual, what I did for my previous shard (its not ported to my new shard yet), is where ALL bows use different 'arrow types' as I call them, unless you specify otherwise (a property).
This will make it so that you don't have to edit the bow/composite bow/any other bow to SPECIFICALLY use your arrow types.
Then you just have code in your BaseRanged that says, if it doesn't override the ArrowType, use whatever they selected as an arrow.
You can also put the bow/crossbow doubleclick to select the arrows/bolts into BaseRanged and use Ammo in conjuction with item typeof( Arrow ) and item typeof( Bolt ) as a way to determine whether to use different arrow types, different bolt types, or neither.
RunUO - [www.runuo.com] Version 1.0.0, Build 36918
Scripts: Compiling C# scripts...done (0 errors, 0 warnings)
Scripts: Compiling VB.net scripts...no files found.
Scripts: Verifying...done (2100 items, 595 mobiles)
World: Loading...An error was encountered while loading a saved object
- Type: Server.Items.Frostbringer
- Serial: 0x40018A03
Delete the object? (y/n)
y
Delete all objects of that type? (y/n)
y
After pressing return an exception will be thrown and the server will terminate
Error:
System.Exception: Load failed (items=True, mobiles=False, guilds=False, regions=
False, type=Server.Items.Frostbringer, serial=0x40018A03) ---> System.Exception:
***** Bad serialize on Server.Items.Frostbringer *****
at Server.World.Load()
--- End of inner exception stack trace ---
at Server.World.Load()
at Server.ScriptCompiler.Compile(Boolean debug)
at Server.Core.Main(String[] args)
This exception is fatal, press return to exit
I have no idea what you are talking about. You were the first to report the problem correct? So you wanted me to tell you before you reported it? I didn't recognize the issue when I first posted it. Like I said I know how to add it and remove it proper.well if you'd told me it wouldn't be a problem
My test runs on differnt saves from my server, and my server is 30 mins away.
etherkye said:it doesn't matter now. Whats done is done.
I'll just wait for the update XD