|
||
|
|||||||
| Script Support Get support for modifying RunUO Scripts, or writing your own! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Forum Novice
Join Date: Dec 2006
Posts: 480
|
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
|
|
|
|
|
|
#2 (permalink) |
|
Forum Expert
Join Date: Sep 2004
Age: 31
Posts: 677
|
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. |
|
|
|
|
|
#3 (permalink) |
|
Forum Master
|
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 ..... :) |
|
|
|
|
|
#4 (permalink) |
|
Forum Novice
Join Date: Dec 2006
Posts: 480
|
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
|
|
|
|
|
|
#6 (permalink) | |
|
Forum Novice
Join Date: Dec 2006
Posts: 480
|
Quote:
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.
}
![]() regards
__________________
legendsofkaine.page.tl
|
|
|
|
|
|
|
#7 (permalink) |
|
Forum Master
|
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 ..... :) |
|
|
|
|
|
#8 (permalink) |
|
Forum Novice
Join Date: Dec 2006
Posts: 480
|
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 );
}
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;
}
Any help guys ? Thanks and Regards
__________________
legendsofkaine.page.tl
|
|
|
|
|
|
#9 (permalink) |
|
Forum Master
|
"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 ..... :) |
|
|
|
|
|
#10 (permalink) | |
|
Forum Novice
Join Date: Dec 2006
Posts: 480
|
Quote:
or do I have to go to every single vendor script, and do it there ? regards
__________________
legendsofkaine.page.tl
|
|
|
|
|
|
|
#11 (permalink) |
|
Forum Master
|
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 ..... :) |
|
|
|
![]() |
| Bookmarks |
| Tags |
| issues, vendor |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|