Mthec

[Released] Mthec's NPCs - Crafter, Buyer, DeliveryContracts, MerchantCap, and CustomTrader

Recommended Posts

Would it be possible to add a sell limit per player to the buyer npc? So an individual player can only receive a set amount of money in a given week? I know someone could just make additional accounts but it would still help a little.

 

I want to use some of these in my newb starter area to buy basic mats like planks or bricks so new players can earn a bit of money to buy and imp basic stuff from other npcs (it will also add to the RP feel having an npc blacksmith in his forge looking to buy metal etc) but I'm afraid someone will just abuse it to make loads of money.

  • Like 1

Share this post


Link to post
Share on other sites

also - been playing with the crafter....i put a lot of items on one at once at I got a notice later saying the items were waiting to be picked up in mail even though that option was not selected. There isnt a single mailbox on the server - do those items exist anymore?

 

EDIT

 

The problem seems to be with large anvils - i think i must have given him three now and cant cant anything back because he wants to mail it and i dont have a mailbox

Edited by CountZero
  • Like 1

Share this post


Link to post
Share on other sites
On 6/20/2019 at 11:50 AM, CountZero said:

Would it be possible to add a sell limit per player to the buyer npc? So an individual player can only receive a set amount of money in a given week? I know someone could just make additional accounts but it would still help a little.

 

I want to use some of these in my newb starter area to buy basic mats like planks or bricks so new players can earn a bit of money to buy and imp basic stuff from other npcs (it will also add to the RP feel having an npc blacksmith in his forge looking to buy metal etc) but I'm afraid someone will just abuse it to make loads of money.

Should be feasible, I'll take a look.  Keeping track of all the players will involve using the database, and the buyer mod is starting to get a little bulky, so I'll probably make it an add-on mod.

On 6/20/2019 at 6:40 PM, CountZero said:

also - been playing with the crafter....i put a lot of items on one at once at I got a notice later saying the items were waiting to be picked up in mail even though that option was not selected. There isnt a single mailbox on the server - do those items exist anymore?

 

EDIT

 

The problem seems to be with large anvils - i think i must have given him three now and cant cant anything back because he wants to mail it and i dont have a mailbox

Hmm, I shall take a look.  Guess there might be a problem with how bulky large anvils are.  If something ends up in the mail then as far as I'm aware it will remain there, so it's not really gone but without a mailbox it's not accessible.

Share this post


Link to post
Share on other sites

yea, im getting a message everytime i log on so ill just get my GM char to create a mailbox for now

 

EDIT

 

he doesnt seem to want to imp large anvils at all :P he just mails them back in the same state.

Edited by CountZero
  • Like 1

Share this post


Link to post
Share on other sites

Crafter fix

Download

 

Fix for issues with large anvils.

Added optional (default disabled)  "/crafters collect" chat command for collecting mailed items when there are no mailboxes.  Uncomment (or add) mail_command=true in the .properties file.

On 6/22/2019 at 11:46 AM, CountZero said:

yea, im getting a message everytime i log on so ill just get my GM char to create a mailbox for now

 

EDIT

 

he doesnt seem to want to imp large anvils at all :P he just mails them back in the same state.

That's one sorted, hopefully.  Turns out the issue was water.  When restocking crafting items the crafter used to use the default weight for water, most items never used it all, unfortunately large anvils did.  I've bumped it up so it won't be a problem anymore.

 

You also got me thinking about servers without mailboxes.  So I added a command to allow people to collect mail items from crafters without a mailbox.  Unfortunately it won't apply to old items, as I didn't want to add a command that might bypass other server features.

  • Like 2

Share this post


Link to post
Share on other sites
2 minutes ago, Mthec said:

Crafter fix

Download

 

Fix for issues with large anvils.

Added optional (default disabled)  "/crafters collect" chat command for collecting mailed items when there are no mailboxes.  Uncomment (or add) mail_command=true in the .properties file.

That's one sorted, hopefully.  Turns out the issue was water.  When restocking crafting items the crafter used to use the default weight for water, most items never used it all, unfortunately large anvils did.  I've bumped it up so it won't be a problem anymore.

 

You also got me thinking about servers without mailboxes.  So I added a command to allow people to collect mail items from crafters without a mailbox.  Unfortunately it won't apply to old items, as I didn't want to add a command that might bypass other server features.

 

champion :D

Share this post


Link to post
Share on other sites

Some how, my pottery crafter got bugged out. What i did is, i have donated ~10 planters to improve skill. Then i gave large amphora to imp it. Logged out. After coming back, i receive email wtih bunch of clay jar with money, 7 out of 10 (i beleave) planters and amphora.I take everything out. 

One of clay jars had coins i was not able to do anything with.

I gave same amphora for improvement. Logged out. After login back, that amphora appeared in inventory window, but not within inventory and i can not interact with it. I always get message that It is in mail right now, but upon checking mail it states that it is empty. So i have ended up with amphora in inventory, i can not do anything with.

Share this post


Link to post
Share on other sites
On 6/25/2019 at 4:56 PM, Tokeiito said:

Some how, my pottery crafter got bugged out. What i did is, i have donated ~10 planters to improve skill. Then i gave large amphora to imp it. Logged out. After coming back, i receive email wtih bunch of clay jar with money, 7 out of 10 (i beleave) planters and amphora.I take everything out. 

One of clay jars had coins i was not able to do anything with.

I gave same amphora for improvement. Logged out. After login back, that amphora appeared in inventory window, but not within inventory and i can not interact with it. I always get message that It is in mail right now, but upon checking mail it states that it is empty. So i have ended up with amphora in inventory, i can not do anything with.

Sorry I didn't reply till now, I was working on another task.

 

I've had a quick look and test myself, but can't reproduce what happened to you.  I will keep trying though.  In the mean time, assuming you've not turned off logging could you post the contents of the one for the crafter?  It might help narrow things down.  The file should be in the WurmServerLauncher folder, and it should be named crafter_<name>_<id>.log.

 

As for the stuck amphora, not sure what caused it but have you restarted the server since?  That usually clears up bugged inventory.  If that doesn't work let me know and I'll think of another solution.  If you're happy modifying the database, then just find the item and set the MAILED column to 0, although I completely understand if you're not happy to do that.

Share this post


Link to post
Share on other sites

Hello

I cant remember exactly,,,for delivery contract....is it possible to pack mats into it and send the contract via mail to another player and he can open it to get the mats?

 

Eject

Share this post


Link to post
Share on other sites

Can you make the delivery contracts so that i can pack up items in it and sell it via mail?

Just tested it but i cant drag and drop the delivery contract into the mailbox

Share this post


Link to post
Share on other sites
On 6/30/2019 at 12:15 PM, Eject said:

Can you make the delivery contracts so that i can pack up items in it and sell it via mail?

Just tested it but i cant drag and drop the delivery contract into the mailbox

Sure thing.  The contracts are marked "noDrop" to prevent them from being used for storage, so I just need to find a way to work round it.  Already started, but not done yet.

  • Like 1

Share this post


Link to post
Share on other sites

New Mod Release - MerchantCap

Download

 

Set a per player trade cap for merchants.  If a player makes any trade with a capped merchant it will add to their player spending history and if any trade would go over that amount it will prevent the trade from completing.

 

Using a GM character and wand, right-click on the merchant and there will be a "Cap Trade" option, with "Set Cap" as a sub-option.  This will bring up a window where you can set, and later remove, the cap.  After a cap has been set there will be a second sub-option, "Clear History", if you wish to remove all player transactions with this particular merchant.  Otherwise the history will remain, so you can toggle the cap on and off without losing history.

 

Can be used without BuyerMerchant on normal merchants, or with BuyerMerchant to also work on buyers.

 

Unlike most of my mods, this does use a database.  It is called "merchantcap.db" and can be found with all the other databases in <ServerName>/sqlite.

On 6/20/2019 at 11:50 AM, CountZero said:

Would it be possible to add a sell limit per player to the buyer npc? So an individual player can only receive a set amount of money in a given week? I know someone could just make additional accounts but it would still help a little.

 

I want to use some of these in my newb starter area to buy basic mats like planks or bricks so new players can earn a bit of money to buy and imp basic stuff from other npcs (it will also add to the RP feel having an npc blacksmith in his forge looking to buy metal etc) but I'm afraid someone will just abuse it to make loads of money.

Hopefully this should do what you want.

  • Like 3

Share this post


Link to post
Share on other sites

yeah, this sounds like a very very interessting mod! I like to try it...thank you @Mthec

  • Like 1

Share this post


Link to post
Share on other sites
18 hours ago, Mthec said:

New Mod Release - MerchantCap

Download

 

Set a per player trade cap for merchants.  If a player makes any trade with a capped merchant it will add to their player spending history and if any trade would go over that amount it will prevent the trade from completing.

 

Using a GM character and wand, right-click on the merchant and there will be a "Cap Trade" option, with "Set Cap" as a sub-option.  This will bring up a window where you can set, and later remove, the cap.  After a cap has been set there will be a second sub-option, "Clear History", if you wish to remove all player transactions with this particular merchant.  Otherwise the history will remain, so you can toggle the cap on and off without losing history.

 

Can be used without BuyerMerchant on normal merchants, or with BuyerMerchant to also work on buyers.

 

Unlike most of my mods, this does use a database.  It is called "merchantcap.db" and can be found with all the other databases in <ServerName>/sqlite.

Hopefully this should do what you want.

 

 

does the history clear itself after a set period or do you have to clear it manually each time?

Share this post


Link to post
Share on other sites
40 minutes ago, CountZero said:

 

 

does the history clear itself after a set period or do you have to clear it manually each time?

It's manual.

 

I can add a settable timer if you want.  I just figured if people are going to keep a merchant/buyer restocked they would just reset it whenever they want (if ever).

Share this post


Link to post
Share on other sites
5 hours ago, Mthec said:

It's manual.

 

I can add a settable timer if you want.  I just figured if people are going to keep a merchant/buyer restocked they would just reset it whenever they want (if ever).

 

a timer (daily/weekly) would be great :D its to stop people over-using the buyer

 

cheers

Share this post


Link to post
Share on other sites

DeliveryContracts update

Download

 

Delivery contracts can now be sent in the mail.

On 6/30/2019 at 12:15 PM, Eject said:

Can you make the delivery contracts so that i can pack up items in it and sell it via mail?

Just tested it but i cant drag and drop the delivery contract into the mailbox

Haven't tested mailing across servers as I don't have that setup, but everything else seems okay.  Let me know if there are any issues.

 

MerchantCap update

Download

 

Added clear_history option.  Default is off, options are daily, weekly, monthly, yearly.  All times are in Wurm time.

 

After the specified time has elapsed, all player spending history will be erased.  Caps will not be affected.

4 hours ago, CountZero said:

 

a timer (daily/weekly) would be great :D its to stop people over-using the buyer

 

cheers

Differentiating between real time and Wurm time was a bit tricky, so I opted for the latter.  I figure that's more "realistic" and hopefully still does what you want.  Let me know if it is a problem.

  • Like 2

Share this post


Link to post
Share on other sites
15 hours ago, Mthec said:

DeliveryContracts update

Download

 

Delivery contracts can now be sent in the mail.

Haven't tested mailing across servers as I don't have that setup, but everything else seems okay.  Let me know if there are any issues.

 

MerchantCap update

Download

 

Added clear_history option.  Default is off, options are daily, weekly, monthly, yearly.  All times are in Wurm time.

 

After the specified time has elapsed, all player spending history will be erased.  Caps will not be affected.

Differentiating between real time and Wurm time was a bit tricky, so I opted for the latter.  I figure that's more "realistic" and hopefully still does what you want.  Let me know if it is a problem.

 

thats perfectly fine! i can just convert normal time to wurm time :D

 

thanks a million

Edited by CountZero
  • Like 1

Share this post


Link to post
Share on other sites
When using: Merchantcap with wand i get a server crash?


[05:02:39 PM] SEVERE com.wurmonline.server.Server: java.lang.reflect.InvocationTargetException
org.gotti.wurmunlimited.modloader.classhooks.HookException: java.lang.reflect.InvocationTargetException
	at org.gotti.wurmunlimited.modloader.classhooks.HookManager.invoke(HookManager.java:394)
	at com.wurmonline.server.Players.pollPlayers(Players.java)
	at com.wurmonline.server.Server.run(Server.java:1916)
	at java.util.TimerThread.mainLoop(Timer.java:555)
	at java.util.TimerThread.run(Timer.java:505)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.gotti.wurmunlimited.modloader.server.ProxyServerHook$6$1.invoke(ProxyServerHook.java:181)
	at org.gotti.wurmunlimited.modloader.classhooks.HookManager.invoke(HookManager.java:384)
	... 4 more
Caused by: org.gotti.wurmunlimited.modloader.classhooks.HookException: java.lang.reflect.InvocationTargetException
	at org.gotti.wurmunlimited.modloader.classhooks.HookManager.invoke(HookManager.java:394)
	at com.wurmonline.server.Players.pollPlayers$2(Players.java)
	... 9 more
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.nyxcode.wurm.timedpay.TimedPay.lambda$null$0(TimedPay.java:42)
	at org.gotti.wurmunlimited.modloader.classhooks.HookManager.invoke(HookManager.java:384)
	... 10 more
Caused by: java.lang.NoClassDefFoundError: mod/wurmunlimited/bml/BML
	at com.wurmonline.server.behaviours.CapAction.action(CapAction.java:31)
	at org.gotti.wurmunlimited.modsupport.actions.ActionPerformerBehaviour.action(ActionPerformerBehaviour.java:87)
	at org.gotti.wurmunlimited.modsupport.actions.WrappedBehaviour.lambda$action$10(WrappedBehaviour.java:106)
	at org.gotti.wurmunlimited.modsupport.actions.WrappedBehaviour.action(WrappedBehaviour.java:211)
	at org.gotti.wurmunlimited.modsupport.actions.WrappedBehaviour.action(WrappedBehaviour.java:106)
	at org.gotti.wurmunlimited.modsupport.actions.ActionPerformerChain.action(ActionPerformerChain.java:81)
	at com.wurmonline.server.behaviours.Action.poll(Action.java:3543)
	at com.wurmonline.server.behaviours.ActionStack.poll(ActionStack.java:247)
	at com.wurmonline.server.players.Player.pollActions(Player.java:9793)
	at com.wurmonline.server.Players.pollPlayers$1(Players.java:4641)
	... 15 more
Caused by: java.lang.ClassNotFoundException: mod.wurmunlimited.bml.BML
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at javassist.Loader.delegateToParent(Loader.java:431)
	at org.gotti.wurmunlimited.modloader.classhooks.HookManager$1.delegateToParent(HookManager.java:174)
	at javassist.Loader.loadClass(Loader.java:311)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 25 more

 
[05:02:39 PM] INFO com.wurmonline.server.Server: Shutting down at: 
java.lang.Exception
	at com.wurmonline.server.Server.shutDown$1(Server.java:3729)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.gotti.wurmunlimited.modloader.server.ProxyServerHook$8$1.invoke(ProxyServerHook.java:232)
	at org.gotti.wurmunlimited.modloader.classhooks.HookManager.invoke(HookManager.java:384)
	at com.wurmonline.server.Server.shutDown(Server.java)
	at com.wurmonline.server.Server.run(Server.java:2599)
	at java.util.TimerThread.mainLoop(Timer.java:555)
	at java.util.TimerThread.run(Timer.java:505)
  • Like 1

Share this post


Link to post
Share on other sites

MerchantCap fix

Download

 

Sorry about that, forgot to include one of my custom libraries in the download.  The problem masks itself on my end.  Thanks for the report.

  • Like 1

Share this post


Link to post
Share on other sites
26 minutes ago, Mthec said:

MerchantCap fix

Download

 

Sorry about that, forgot to include one of my custom libraries in the download.  The problem masks itself on my end.  Thanks for the report.

 

I was like what am i doing wrong haha thanks for quick update!

  • Like 1

Share this post


Link to post
Share on other sites

Trying to add the Crafter to our server... get this error on start up, spams it every few secs.

Haven't placed one yet.

ava.lang.NullPointerException
        at mod.wurmunlimited.npcs.CrafterAIData.sendNextAction(CrafterAIData.java:245)
        at mod.wurmunlimited.npcs.CrafterAI.pollCreature(CrafterAI.java:54)
        at com.wurmonline.server.creatures.Creature.poll(Creature.java:6017)
        at com.wurmonline.server.creatures.Creatures.pollAllCreatures(Creatures.java:1834)
        at com.wurmonline.server.zones.Zones.pollNextZones(Zones.java:1975)
        at com.wurmonline.server.Server.run(Server.java:1911)
        at java.util.TimerThread.mainLoop(Timer.java:555)
        at java.util.TimerThread.run(Timer.java:505)

config is

classname=mod.wurmunlimited.npcs.CrafterMod
classpath=crafter.jar
sharedClassLoader=true

update_traders=true
contracts_on_traders=false
output=save

base_price=1.0
mail_price=100

# Refined pricing modifiers
blacksmithing=1.0
weaponsmithing=1.0
jewelrysmithing=1.0
chainsmithing=1.0
platesmithing=1.0
carpentry=1.0
fine_carpentry=1.0
fletching=1.0
bowyery=1.0
leatheworking=1.0
clothtailoring=1.0
stonecutting=1.0
shieldsmithing=1.0
pottery=1.0
dragon_armour=10.0

# Other Options - Uncomment to use.
## for_owner (-10%), tax_and_upkeep (default 25 or set upkeep_percentage), all_tax
payment_option=all-tax
upkeep_percentage=25.0
contract_price_in_irons=10000
can_learn=true
starting_skill=50
max_skill=100
use_owner_price_modifier=false
minimum_price_modifier=0.1
mail_command=true

 

Edited by evilkilem

Share this post


Link to post
Share on other sites
2 hours ago, evilkilem said:

## for_owner (-10%), tax_and_upkeep (default 25 or set upkeep_percentage), all_tax
payment_option=all-tax

i havent played around with mod but 1 thing jumps out at me

 

you have all-tax but the commented out bit has all_tax

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.