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!

[RunU O 2.0 RC1& RC2] The Complete Customizable Vendor

krazeykow

Sorceror
[RUO ALL] The Complete Customizable Vendor [Updated 12/09/09]

The Complete Customizable Vendor​
Full Support Any* XML Attachment Version (XmlPoints, etc.) Released 12/9/09

Update History:

New XML Version Released 12/9/09 - Supports any XML Attachment (XmlPoints, XmlStaffPoints, etc.)
New Version Released 11/20/09 - Includes Stone Vendor

Why is it called the Complete Customizable Vendor?

Now supports any XML attachment on a player or an item! For example, with XmlPoints system, you simply select XmlAttachment, type the name 'XmlPoints' and target the player!

Payment type can be set to anything imaginable. Tokens, PvP Points, Gold, Quest Items, etc. If it is a number in [props of the player or an item, it can be the payment! Direct consumption of the item also works.

Add customized items without ever scripting them inside the game. The vendor system automatically recognizes the additions you have made to the item through [props. Each item the vendor obtains is a mirror image of what you add. Bags work as well!

Choose between a stone based or mobile based reward vendor. Update 11/20/09 now includes a stone version, never bother with creating your own reward stones again!

Create your own automated reward room that runs directly off of the vendor system. Called 'Displays', they are individual items that can be displayed in a showcase. Once the player clicks on the item, a menu pops up with further information and the option to purchase. (Shown lower right in picture)

Restock options bring a whole new dimension of versatility. Items can be set to be 'Limited Editions' i.e. only a set amount can be sold. Of course, count, refresh rate, and many other options are also available.

The Classic OSI vendor menu is available through the mobile version, keeping continuity for vendor malls.

Never lose track of any of the vendors. All vendors are listed with a 'go to' option.

Make quick copies of your vendors with the 'copy vendor' option.


About me

With no prior knowledge, I came to this community in 2004 looking for a helping hand in learning programming. I never knew it would take me this far. This is my creation as an example of how far I've come with RunUO. Special thanks included below

*Zippy, Vorspire, Lord_Greywolf, Lokai, Taffer, b0b01​

Installation


Drag and drop.
Add a vendor - [add mobilerewardvendor
Add a stone - [add stonerewardvendor

Please leave feedback and/or suggestions, thank you.

NOTICE:
**First time installing the system:
If the compiler has an error that reads 'Namespace '<global namespace>' contains a definition conflicting with alias 'Reward'. Type namespace System.CustomizableVendor right before public class Currency at the top. Add { directly after it. Then add a } at the very bottom.
**Already have the system installed:
Use the Replace All method for Reward and use anything else (CustomReward, etc.).



Choose only one of the following.
 

Attachments

  • [RC2] Rewards System.cs
    87.8 KB · Views: 1,400
  • [RC1] Rewards System.cs
    87.6 KB · Views: 382
  • [RC2] Rewards System - XML Attachments .cs
    94.8 KB · Views: 1,021
  • [RC1] Rewards System - XML Attachments .cs
    94.6 KB · Views: 316

RavonTUS

Sorceror
krazeykow;771617 said:
Please leave feedback and/or suggestions, thank you.

Greetings,

Is there a reason StoneRewardVendor is not Serialize/Deseialize? I get this message when compiling, however it continues to run.

Code:
Scripts: Verifying...Warning: StoneRewardVendor
       - No serialization constructor
       - No Serialize() method
       - No Deserialize() method

-Ravon
 

Mideon

Page
This looks really neat. Going to check it out later as soon as I get a chance. Thanks for the submission!
 

Seven Pack

Wanderer
RavonTUS;771623 said:
Greetings,

Is there a reason StoneRewardVendor is not Serialize/Deseialize? I get this message when compiling, however it continues to run.

Code:
Scripts: Verifying...Warning: StoneRewardVendor
       - No serialization constructor
       - No Serialize() method
       - No Deserialize() method

-Ravon

I also am having this problem. But, I installed the script and it is freakin' awesome!!

Kudos for all who helped. :D
 

redsnow

Sorceror
Cant wait to get this working, this will be perfect for my Shard...

I get this error

Code:
RunUO - [www.runuo.com] Version 2.0, Build 2968.26078
Core: Running on .NET Framework Version 2.0.50727
Scripts: Compiling C# scripts...failed (3 errors, 0 warnings)
Errors:
 + Custom/Mondain's Legacy/Engines/Quests/Items/RewardBox.cs:
    CS0576: Line 14: Namespace '<global namespace>' contains a definition confli
cting with alias 'Reward'
 + Custom/Mondain's Legacy/Engines/Quests/Items/CraftsmanSatchel.cs:
    CS0576: Line 12: Namespace '<global namespace>' contains a definition confli
cting with alias 'Reward'
    CS0576: Line 74: Namespace '<global namespace>' contains a definition confli
cting with alias 'Reward'
    CS0576: Line 86: Namespace '<global namespace>' contains a definition confli
cting with alias 'Reward'
    CS0576: Line 110: Namespace '<global namespace>' contains a definition confl
icting with alias 'Reward'
    CS0576: Line 119: Namespace '<global namespace>' contains a definition confl
icting with alias 'Reward'
    CS0576: Line 143: Namespace '<global namespace>' contains a definition confl
icting with alias 'Reward'
    CS0576: Line 152: Namespace '<global namespace>' contains a definition confl
icting with alias 'Reward'
    CS0576: Line 176: Namespace '<global namespace>' contains a definition confl
icting with alias 'Reward'
    CS0576: Line 185: Namespace '<global namespace>' contains a definition confl
icting with alias 'Reward'
    CS0576: Line 209: Namespace '<global namespace>' contains a definition confl
icting with alias 'Reward'
    CS0576: Line 221: Namespace '<global namespace>' contains a definition confl
icting with alias 'Reward'
 + Custom/Mondain's Legacy/Engines/Quests/Items/RewardBag.cs:
    CS0576: Line 14: Namespace '<global namespace>' contains a definition confli
cting with alias 'Reward'
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

I Know what it means just don't know how to fix it. I'm guessing i have to change the name "Reward" in this script, but what do i change it too without messing it up?

Thanks
 

Vorspire

Knight
Looks like you just need to change every instance of "Reward" to "RewardX" or somjething besides "Reward", because it is causing Type-Cast conflictions in the server. You already have a class called "Reward" - that is why it is conflicing :D

As for StoneRewardVendor, simply add these lines to the bottom of the script, but before the second last closing brace '}'

Code:
public StoneRewardVendor( Serial serial) : base ( serial )
{
}

public override void Serialize( GenericWriter writer )
{
writer.Write( (int)0 ); //Version 0
}

public override void Deserialize( GenericReader reader )
{
int version = reader.ReadInt();
}
 

Seven Pack

Wanderer
Vorspire;771645 said:
Looks like you just need to change every instance of "Reward" to "RewardX" or somjething besides "Reward", because it is causing Type-Cast conflictions in the server. You already have a class called "Reward" - that is why it is conflicing :D

As for StoneRewardVendor, simply add these lines to the bottom of the script, but before the second last closing brace '}'

Code:
public StoneRewardVendor( Serial serial) : base ( serial )
{
}

public override void Serialize( GenericWriter writer )
{
writer.Write( (int)0 ); //Version 0
}

public override void Deserialize( GenericReader reader )
{
int version = reader.ReadInt();
}

Yeah, I tried that and it doesn't work. I don't know if there are any variables that need to be set during that process or not.

But, this is what I keep getting:

Code:
Errors:
 + Custom/RewardSystem.cs:
    CS1520: Line 1947: Class, struct, or interface method must have a return typ
e
    CS1002: Line 1947: ; expected
    CS1519: Line 1947: Invalid token ')' in class, struct, or interface member d
eclaration
 

Vorspire

Knight
Can you post lines 1900 to 1950 please? -That error is caused by..

a) A missing return type (ex: return false; )
b) A missing line-end ';'
c) An extra ')'

Judging by the error, the culprit is the extra ')'
 

krazeykow

Sorceror
I was so happy to release it, I really never created that object, haha! - Updated and fixed.

@Seven Pack, use the find and replace method on my release (assuming you have the other reward added to your server).

@Users with RUO RC1, Please tell me if the 'View Item' option brings up a container showing the item. (Make sure to look behind menu)

Please leave feedback to how it works and any improvements you would like to see in future releases, thanks.
 

ClanCC

Wanderer
hm, your script doesn't like me. Using Latest SVN, Linux.
Code:
$ mono RunUO.exe
RunUO - [www.runuo.com] Version 2.0, Build 3129.30506
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 2 processors
Core: Unix environment detected
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
Errors:
 + Customs/Rewards System.cs:
    CS0308: Line 344: The non-generic method `ReadItem' cannot be used with type arguments
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.
 

Mideon

Page
Wow all I can say is Kudos to this one. Very unique submission, I love it. I am going to mod it slightly so that I can use it on my rp server, but wow this is a really great submission. Cheers and thank you!
 

krazeykow

Sorceror
ClanCC;771705 said:
hm, your script doesn't like me. Using Latest SVN, Linux.
Code:
$ mono RunUO.exe
RunUO - [www.runuo.com] Version 2.0, Build 3129.30506
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 2 processors
Core: Unix environment detected
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
Errors:
 + Customs/Rewards System.cs:
    CS0308: Line 344: The non-generic method `ReadItem' cannot be used with type arguments
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

Odd... my documents show that there is a generic method - T ReadItem and WriteItem<T> so I naturally took advantage of it .. in any case, you will want to do this:

Change this:
Code:
m_Reward = reader.ReadItem<Item>();

To This:
Code:
m_Reward = (Item)reader.ReadItem();

Thanks for the feedback Mideon, I'd love to hear more, especially suggestions.
 

Mideon

Page
Ah, one thing that'd really be cool, is the ability to set how many times a certain item can be bought, and perhaps even a regeneration rate.

So you put an item up on the vendor and you set it so only 10 of it can be sold, but it'll regenerate 1 every hour until it's back at it's max amount of 10 or something.
 

ACME_INC

Sorceror
One thing. It does not see money in my bank box. I have to have it on my player. How do I get it to work so that it can see the gold in my account? Or if I want to use hides, how do I get it to see the hides in my bank box?
 

ClanCC

Wanderer
krazeykow;771718 said:
Odd... my documents show that there is a generic method - T ReadItem and WriteItem<T> so I naturally took advantage of it .. in any case, you will want to do this:

Change this:
Code:
m_Reward = reader.ReadItem<Item>();
To This:
Code:
m_Reward = (Item)reader.ReadItem();

Thanks that works, I had to do the following changes to fix everything.

Line 344: Change
Code:
 m_Reward = reader.ReadItem<Item>();
to
Code:
 m_Reward = (Item)reader.ReadItem();
Line 606: Change
Code:
 m_Reward = reader.ReadItem<Reward>();
to
Code:
 m_Reward = (Reward)reader.ReadItem();
Line 1,531: Change
Code:
 Reward r = reader.ReadItem<Reward>();
Code:
 Reward r = (Reward)reader.ReadItem();
Line 1,532: Change
Code:
 MetalBox box = reader.ReadItem<MetalBox>();
to
Code:
 MetalBox box = (MetalBox)reader.ReadItem();
Line 1,689: Change
Code:
 Reward r = reader.ReadItem<Reward>();
to
Code:
 Reward r = (Reward)reader.ReadItem();
Line 1,694: Change
Code:
 m_Currency = reader.ReadItem<Currency>();
to
Code:
 m_Currency = (Currency)reader.ReadItem();
Line 1,699: Change
Code:
 m_Box = reader.ReadItem<DisplayBox>();
to
Code:
 m_Box = (DisplayBox)reader.ReadItem();
After doing these changes, It loaded with no errors :)
 

krazeykow

Sorceror
Major Updated, Requires A Simple Replacement

8/3/08 - Please get the latest update if you have a previous version installed.

This update was thanks to ClannCC and ACME_INC!!

The more feedback I get.. the faster I can make this system even better!!

PLEASE leave feedback/suggestions, I made this JUST for the community.. it would be nice to HEAR from the community.
 

ACME_INC

Sorceror
Thank you! I updated to the new version of the script and now the vendor accepts gold and leather out of the players bank box. Very nice and usefull. This is a great script. Again thank you.


* Everyone who is using this script should give a 5 star rating for this thread.
 

krazeykow

Sorceror
Thanks for the feedback

I'm currently working on the next big update package for this system, it includes:

  • Choose the amount, maximum, and refresh time of an item. - Thanks Mideon (Uses complex shared timer system to maximize resources)
  • A couple of new menus to choose from

I need more suggestions and feedback to really revolutionize this system.

@ACME_INC, thank you for rating the script, I really appreciate the positive feedback, I don't even run a server, I made this just to share with the community.
 
Top