Go Back   RunUO - Ultima Online Emulation > RunUO > Script Support

Script Support Get support for modifying RunUO Scripts, or writing your own!

Reply
 
Thread Tools Display Modes
Old 06-24-2008, 10:42 AM   #1 (permalink)
Forum Novice
 
typhoonbot's Avatar
 
Join Date: Dec 2006
Posts: 480
Question Some issues with vendors

Hey everyone :>

I have been playing around with vendor creation, and stocking for a while now - but I have come to that time when I am uncertain of some thing I wish to do.

1) I have an item that is stackable that I give out as quest rewards, role-playing rewards etc. I want to make a vendor, that takes a certain amount of these items in exchange for one of the different items he/she is selling. in other words, how do I put it into scripting to tell a vendor to take these items instead of gold.

EG, in case you don't understand: say the item is called "a fish" now these are stackable... I want to make a vendor, that sells various items that I have scripted (addons etc) and takes the amount of "fish" from the players backpack. Each item on the Vendor's buy menu will cost different amounts of "fish".

2) I want to make it possible for thieves to steal items from the buy list of vendors. however in order to keep it balanced, they must only have a certain chance (not too high) and if they fail, they are turned to criminal and revealed.

could anyone tell me how I could attempt to achieve any of these tasks please...

thanks and regards
__________________
legendsofkaine.page.tl
typhoonbot is offline   Reply With Quote
Old 06-24-2008, 10:52 AM   #2 (permalink)
Forum Expert
 
Join Date: Sep 2004
Age: 31
Posts: 677
Default

Not sure about the first one... I'd have to guess that it's somewhere in the BaseVendor script. Have no idea if it'd be feasible to try.

For the second question, easiest thing you could do is go into each vendor's script and add the items they sell to their backpack. Wouldn't make any difference to their actual sell lists, but it'd be the easiest way to do it. Until they ran out of items.
__________________
Please don't preach to me. You won't convert me. You won't convince me. I am me and you are you. I will respect you because that's who I am. Disrespect me, and you've only proven who you really are.
Vhaerun is offline   Reply With Quote
Old 06-24-2008, 11:29 AM   #3 (permalink)
Forum Master
 
Lord_Greywolf's Avatar
 
Join Date: Dec 2005
Posts: 6,777
Send a message via Yahoo to Lord_Greywolf
Default

Daats vender stone does what you want - can use almost anything as curency

as for #2 besides what he mentioned above (that ios because the items they are selling are in a special hidden pack [like the bank is] on the vendor) you would also have to modify the stealing script to allow from the vendors and modify the chances for it if trying to steal from them and not other critters/players
__________________
http://www.AoAUO.com

:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :)
Lord_Greywolf is offline   Reply With Quote
Old 06-24-2008, 11:36 AM   #4 (permalink)
Forum Novice
 
typhoonbot's Avatar
 
Join Date: Dec 2006
Posts: 480
Default

Thanks for the helpful reply man - besides I have thought of a way to get my first task completed. ill simply make an item, like a magic stone, or something that is permanently placed in town. players can dbl click the item - and I will design a gump, this gump will have the options of what they can select to trade, and the gump will run a check to see if they have enough "fish " and then if so, take that amount and create the item in players backpack - easy peasy.

Altho I might post any problems I have here if I cant sort them out..

so once again thanks for the help

and regards

__________________
legendsofkaine.page.tl
typhoonbot is offline   Reply With Quote
Old 06-24-2008, 11:38 AM   #5 (permalink)
Forum Novice
 
typhoonbot's Avatar
 
Join Date: Dec 2006
Posts: 480
Default

Ahh thanks Lord_Greywolf - your idea is good aswell, I will most definately look into DAATS vendor stone

regards
__________________
legendsofkaine.page.tl
typhoonbot is offline   Reply With Quote
Old 06-24-2008, 12:39 PM   #6 (permalink)
Forum Novice
 
typhoonbot's Avatar
 
Join Date: Dec 2006
Posts: 480
Default ok

Quote:
easiest thing you could do is go into each vendor's script and add the items they sell to their backpack. Wouldn't make any difference to their actual sell lists, but it'd be the easiest way to do it. Until they ran out of items.
ok, I have removed the following lines from Stealing.cs:

Code:
			if ( root is BaseVendor && ((BaseVendor)root).IsInvulnerable )
				{
					m_Thief.SendLocalizedMessage( 1005598 ); // You can't steal from shopkeepers.
				}
				else if ( root is PlayerVendor )
				{
					m_Thief.SendLocalizedMessage( 502709 ); // You can't steal from vendors.
				}
but when attempting to steal an item from a vendors backback. it says "<vendor name> cannot be harmed. This is becuase every vendor / NPC is immortal (yellow). How can I get around this ?

regards
__________________
legendsofkaine.page.tl
typhoonbot is offline   Reply With Quote
Old 06-24-2008, 06:47 PM   #7 (permalink)
Forum Master
 
Lord_Greywolf's Avatar
 
Join Date: Dec 2005
Posts: 6,777
Send a message via Yahoo to Lord_Greywolf
Default

check to see if your vendors have higher accesslevels than players
this line was in my stealing, and that would do it:
else if ( root is Mobile && ((Mobile)root).AccessLevel > AccessLevel.Player )

also for testing purposes, make the vendor mortal - [mortal and target the vendor - and see if you can steal then - if so then you know it is being invul causing the problem and not something else
__________________
http://www.AoAUO.com

:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :)
Lord_Greywolf is offline   Reply With Quote
Old 06-26-2008, 05:20 AM   #8 (permalink)
Forum Novice
 
typhoonbot's Avatar
 
Join Date: Dec 2006
Posts: 480
Question found issue

AHA! Okay, I found the problem - it was in playermobile O_0

anyway look at this:

Code:
		public override bool CanBeHarmful( Mobile target, bool message, bool ignoreOurBlessedness )
		{
			if ( m_DesignContext != null || (target is PlayerMobile && ((PlayerMobile)target).m_DesignContext != null) )
				return false;

			if ( (target is BaseVendor && ((BaseVendor)target).IsInvulnerable) || target is PlayerVendor || target is TownCrier )
			{
				if ( message )
				{
					if ( target.Title == null )
						SendMessage( "{0} the vendor cannot be harmed or stolen from.", target.Name );
					else
						SendMessage( "{0} {1} cannot be harmed or stolen from.", target.Name, target.Title );
				}				
				return false;
			}

			return base.CanBeHarmful( target, message, ignoreOurBlessedness );
		}
the "return false;" in blue is what needs to be true, but it must only be under a certain condition, I just cant figure out how to refer to the actual mobile player (thief stealing) in that return section.

IE: I am making a thieves guild, that people need to join, and once they join if their stealing is high enough - they will be able to steal from vendors, BUT by that blue "return false;" I need to have:

Code:
if playermobile.Title = "certain title"
     {
          return true;
     }

else
   {
       return false;
    }
I just don't know how to refer to the player mobile, because it was not declared / defined in the description and I'm not sure where to do that...

Any help guys ?

Thanks and Regards
__________________
legendsofkaine.page.tl
typhoonbot is offline   Reply With Quote
Old 06-26-2008, 01:32 PM   #9 (permalink)
Forum Master
 
Lord_Greywolf's Avatar
 
Join Date: Dec 2005
Posts: 6,777
Send a message via Yahoo to Lord_Greywolf
Default

"this" is the playermobile in this case

so
if (this.Title = "certain title")
__________________
http://www.AoAUO.com

:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :)
Lord_Greywolf is offline   Reply With Quote
Old 06-28-2008, 12:47 PM   #10 (permalink)
Forum Novice
 
typhoonbot's Avatar
 
Join Date: Dec 2006
Posts: 480
Default me again

Quote:
Originally Posted by Vhaerun View Post
For the second question, easiest thing you could do is go into each vendor's script and add the items they sell to their backpack. Wouldn't make any difference to their actual sell lists, but it'd be the easiest way to do it. Until they ran out of items.
Ok, is there a way that I can just do one piece of coding, to add all items on sell list to the vendors backpack (like in basevendor.cs or something)

or do I have to go to every single vendor script, and do it there ?

regards
__________________
legendsofkaine.page.tl
typhoonbot is offline   Reply With Quote
Old 06-28-2008, 02:05 PM   #11 (permalink)
Forum Master
 
Lord_Greywolf's Avatar
 
Join Date: Dec 2005
Posts: 6,777
Send a message via Yahoo to Lord_Greywolf
Default

look at the "restock" and "stock" part of base vendor

and basicaly dupe what they do in there, but also into their pack

might also want to put an adjustment in there also, since they are no linger "invul" - before loading down the pack of:
pack maxweight = 65000 & packs maxitems = 65000
else stuff might not load in their right from being overloaded

(DO NOT do it in the vendors serial/deserial - their packs might not actualy be made yet, and can cause problems - just add a couple of quick lines in the same routine to "refresh" those stats incase they are lost on restarts)
__________________
http://www.AoAUO.com

:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :)
Lord_Greywolf is offline   Reply With Quote
Reply

Bookmarks

Tags
issues, vendor


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5