Sign in to follow this  
Ulviirala

[Released] (1.1.3) PVEpLands Treasure Hunting - Inspired by Ultima Online treasure maps

Recommended Posts

This mod was commissioned to me in early January this year, and I've gotten the express wish for it to be released as open source after some time of exclusive availability to the PVEpLands server. So far it has proven to break up the daily monotony quite well.

 

Key features:

  • Find treasure maps by digging (includes flattening, leveling, and general digging (clay, moss, peat, et cetera), mining (tunneling only), fishing, and/or hunting creatures.
  • Maps have 10 configurable tiers and is represented as treasure map QL.
  • Strongly inspired by Ultima Online treasure maps.
  • There might be startled creatures nearby ;)
  • Extensive configuration options.
  • Configuration can be changed and reloaded without restarting the server (right-click, select Treasuremap > Reload config, watch event log for orange text).

 

Download: https://github.com/dmon82/TreasureHunting/releases

Treasure Hunting 1.1.3 is compiled against ModLoader version v0.26.3-e9998cf and Wurm Unlimited 1.4.0.1.

 

Changelog:

Spoiler
  • 1.1.2 - Fixed a bug where reward items were always picked from the highest tier.
  • 1.1.2 - Added a new log message to clarify what reward item, from which reward group, has been picked for what tier.
  • 1.1.3 - Added map drops to surface mining and tunneling, but with a separate chance, because it's much faster than regular mining.
  • 1.1.3 - Fixed some spelling errors in the properties file.
  • 1.1.3 - Ironed out a bit of internal code.
  • 1.1.3 - Fixed an exploit (more on the forums about it soon).
  • 1.1.3 - Added options to set a min and max distance from the player to the treasure of newly found maps.
  • 1.1.3 - Added chance to find maps while surface mining and tunneling with a separately configurable chance.

 

I strongly advise to take your time going through the config file, it's quite extensive. There might be items (e.g. seasonal gifts, sorcery items, trader contracts) that you don't want to introduce, that's in the default config. It has been stressed to me, that the ability to reload the mod configuration during server runtime without restarting is an invaluable convenience. And I'd probably get in trouble if I don't mention it. Feel free to draw inspiration from, and improve upon it :) the release has been motivated by that spirit. Please let me know if any issues arise.

 

For the not-so-adventurous, here is how it works exactly:

Spoiler

There is a configurable chance that you can find a treasure map by any of the means mentioned above. The QL and thus tier of the map depends on your relevant skills, and the quality and rarity of your tool (e.g. digging and the shovel, fishing and the fishing rod). For killed creatures, it depends on their weaponless fighting skill, because that is the skill almost all creatures have and use. The map QL and thus tier of the map will then be determined by a skill check against those values with a configurable difficulty (the end of the config file has some examples). The mod will try to find a random location on the map that is not submerged in water, and not in a very steep area (height difference in dirts configurable), and outside of a village or holy zone.

 

When you find a map, it will send a message to your event log. The config file allows to mark the messages orange to draw more attention to it, as well as having the "rare" swirl and drumroll.

 

You can then use a compass on the map, to get rough directions that work exactly like a priest's Locate Soul spell. Once you think you're standing on the right map tile, you can use your shovel or pickaxe (whether you're on a rock surface or not) to start digging for the treasure. You'll find out once the action finishes, and if there's no treasure, it's not on the right tile.

 

The config file allows the compass as well as the map to take damage when you read it, eventually destroying the map. This might jack up the challenge to find the map in as few reads as possible, and get the best reward.

 

GMs: The map coordinates are saved in Data1 (DataX, DataY) of the treasure map. GMs can also create treasure maps by right-clicking a map tile with their wand activated, and choosing to create one "Here", or at a random location. AuxData will determine the QL of the map (random QL if AuxData is 0). Right-clicking treasure maps, they will have an option to teleport to the location. With sufficient privileges, there will also be the option to reload the configuration file.

 

Once the treasure chest is dug up, it might be locked (configurable), and lockpicks as well as lock picking may be required. A bunch of creatures will spawn around the treasure chest, their names will be suffixed with the player who dug it up to discourage digging up chests and letting strong creatures roam free. The spawns are configurable and are based on a weight system.

 

Server admins: Finding treasure maps, digging up chests, guardian spawns, and the chest contents are logged in fair detail and should be traceable in the log file. Make sure to keep copies if you're concerned, I don't think the automatic log rotation works.

 

There might be rewards that can't be picked up (e.g. looms), those can be "unloaded" from the treasure chest, so you might want to bring a large cart or wagon. The rewards can be money, liquid source, metal lumps, sleep powders, HotA statues, and random picks from groups of items (e.g. lockpicks, magic chests, star gems, rare, supreme, and fantastic items, strange bones, sorcery items), all configurable. Once the treasure chest is completely emptied, it will disappear.

 

Please don't hesitate to ask any questions you have.

Edited by Ulviirala
1.1.3 update
  • Like 11

Share this post


Link to post
Share on other sites

That is cool as **** will be looking into this for my new server for certain!

Share this post


Link to post
Share on other sites

Thank you for releasing this! Seeing this is a nice boost to my modding motivation, I was starting to loose faith in WU for a moment their :(.

 

I hopped you had done something different for selecting the treasure spawn locations. It seems to be plain old RNG to select x,y and then test that tile for various failure conditions. Note, from what I saw in TreasureMap.CreateTreasuremap(...). Nothing wrong with this way, it clearly works and is probably the most common way to approach a problem like above.

Share this post


Link to post
Share on other sites

I see to be having an issue where the map quality does not seem to be lining up with the tier of the chest and thus, pulling out any loot from pretty much any map.continuing testing to see if i've ####ed it up.

 

 

Edited by JockII

Share this post


Link to post
Share on other sites
7 hours ago, JockII said:

I see to be having an issue where the map quality does not seem to be lining up with the tier of the chest and thus, pulling out any loot from pretty much any map.continuing testing to see if i've ####ed it up.

 

 

    /**
     * Generates item rewards as specified in the config file.
     * @param quality Quality of the treasure.
     * @return A list if items, may be empty.
     */
    public static ArrayList<Item> getTierRewards(double quality) {
        ArrayList<Item> list = new ArrayList<>();
        int tier = Math.max(9, Math.min(0, (int)quality / 10));

I'd like to believe that the mod has been relatively reliable, the Admin on PVEpLands has spawned quite a number of chests to test things by himself. The tier should be QL (floored) / 10, capped from 0 to 9. Rewards outside of the tiered ones are always in the chest (e.g. lumps, liquid source, money, a chance for a rare (literal meaning, not item quality), very rare, and extremely rare item, unless scaled to 0), and then one or some of the tiered rewards in tierRewardN=n:n:n:n.

# Syntax:
# 	tierRewardN=guaruanteed:optional:chance:group,...,group,group

So by default, the fourth tier for example:

tierReward3=1:3:10:0,1,2,3,5

Guarantees 1 item from the reward groups 0, 1, 2, 3, or 5, and tries 3 times with a 10 % chance to add an additional item.

Edited by Ulviirala

Share this post


Link to post
Share on other sites

Thank you for explaining this further, I totally get it now..... My bad!

 

is the additional item from the same tierRewards?

 

 

 

Edited by JockII

Share this post


Link to post
Share on other sites

I created a 1ql map

 

tierReward0=1:1:10:0,1

 

And pulled out a star emerald 


# Star gems: 375 star emerald, 377 star ruby, 379 black opalm 381 star diamond,
#            383 star sapphire.
rewardGroup6=375,377,379,381,383

 

i have also pulled out a small magic chest.

 

# Expensive trader items: 668 rod of transmutation, 665 small magic chest,
#       664 large magic chest, 229 trader contract
rewardGroup4=665

 

From another 1ql map.

 

The creatures are spawning correctly, from the correct tier and the correct spawn groups.

 

 

 

 

Edited by JockII

Share this post


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

I created a 1ql map

 

tierReward0=1:1:10:0,1

 

And pulled out a star emerald 

Star emerald is 375 in reward group 6, but uh... I have no idea why or how that could've happened. Do you still have the server.log that I could have a look at? Map rarity (rare, supreme, fantastic) does have an effect on their tier, but that's still out of reach for tiers with that reward group.

Edited by Ulviirala

Share this post


Link to post
Share on other sites

I'm not sure how, but I must've introduced a significant bug in the 1.1.1 update. When picking the item rewards from the reward groups, it always chose groups from the highest tier, because I unintendedly switched the max(min()) statement, to keep the tier value in the valid bounds. It's quite embarrassing, I'll have to admit.

 

Updating to 1.1.2 is strongly recommended. It's now the latest release on github. When updating, do not overwrite your .properties file, to keep your custom settings.

 

There was an exception in Jock's server logfiles that I'm not quite sure how it happens, and I've added additional code to try and clarify why it happens (optional reward items are not being created, as the chance seems to be 0 or less, when it actually shouldn't be). I will keep an eye on that.

Edited by Ulviirala
  • Like 2

Share this post


Link to post
Share on other sites

So if you change the .properties file to tweak the settings, and a GM selects "reload config" do those new properties take effect without needing to restart the server? That appears to be the case from my testing

Edited by solmark

Share this post


Link to post
Share on other sites
1 hour ago, solmark said:

So if you change the .properties file to tweak the settings, and a GM selects "reload config" do those new properties take effect without needing to restart the server? That appears to be the case from my testing

Yes, if a GM right-clicks and selects "Reload config" from the Treasuremap sub-menu, the changes of the config take effect immediately without restarting the server.

 

If there was an error, it would say so in orange text. And an Admin should take a look at the error in the console and fix whatever it says was wrong, it should have information about what part couldn't be reloaded.

  • Like 1

Share this post


Link to post
Share on other sites

Hello Ulviirala

 

Can you make so, that the treasure maps will disapear from your inventory if you change the server, like housewrits or other stuff, same with runes.

The problem with runes is, you can port to others place on a neighbour server and i believe the treasure map will bring you to a wrong place if you use it at the wrong server.

 

Eject

  • Like 1

Share this post


Link to post
Share on other sites

Maps carried to another server will tell you it is on another server when you use compass on it. So it won't take you to the wrong place for the treasure. 

Edited by Jerone0601

Share this post


Link to post
Share on other sites

where you can set the min max distance from the place you find the map to the target place?

 

Eject

Edited by Eject

Share this post


Link to post
Share on other sites
On 9/18/2017 at 4:05 PM, Eject said:

Hello Ulviirala

 

Can you make so, that the treasure maps will disapear from your inventory if you change the server, like housewrits or other stuff, same with runes.

The problem with runes is, you can port to others place on a neighbour server and i believe the treasure map will bring you to a wrong place if you use it at the wrong server.

 

Eject

I hadn't considered multi-server setups, because it wasn't intended to be used on clusters, but I see what I can do in a future update. Same for the recall runes. It's weird that it would tell you that the treasure is on another server, because I haven't put any code in place that would do so myself, and I have no experience with WU clusters yet.

 

There's no setting that allows you to set a min or max distance from the place that the map was found at, the location is a randomly picked tile that is not submerged in water, is not lava, not in a village or building, not near holy ground (e.g. white/black light altar zone), and in a sufficiently flat (as per config) 3x3 area.

  • Like 1

Share this post


Link to post
Share on other sites

Do you embed the server ID in the map? I didn't modify the code and only briefly skimmed it. But it clearly tells my players it's the other server if they trying using another server.We tested that the first day we got it before releasing it.

Share this post


Link to post
Share on other sites

With lockpicking disabled/banned on PvE servers how does this mod get around this?  Do I just need to disable locking of chests altogether?

Share this post


Link to post
Share on other sites
On 9/23/2017 at 2:16 PM, mwdennis said:

With lockpicking disabled/banned on PvE servers how does this mod get around this?  Do I just need to disable locking of chests altogether?

I haven't had the time to test this mod enough myself but if it uses the same base treasure chests bdew's mod will fix that. If the mod uses normal chests I'm guessing they are already not locked.

 

https://forum.wurmonline.com/index.php?/topic/138254-released-bdew-server-mods-waaay-too-many-to-list-in-the-title-updated-apr-26/

Share this post


Link to post
Share on other sites

i dont know why, but suddenly we all get just QL1 maps

 

Eject

Share this post


Link to post
Share on other sites

I have been playing with this mod for a while now and really enjoy it but I'd like to see a setting in .properties to change how far from where player is when it gets map for treasure to be. Some servers have very big maps and you could end up having to travel 6000 tiles to get a treasure, which is a bit excessive really.

Share this post


Link to post
Share on other sites
On 26/9/2017 at 8:15 AM, Cuddles said:

I have been playing with this mod for a while now and really enjoy it but I'd like to see a setting in .properties to change how far from where player is when it gets map for treasure to be. Some servers have very big maps and you could end up having to travel 6000 tiles to get a treasure, which is a bit excessive really.

Same here. 

Share this post


Link to post
Share on other sites

Does anyone want to share their .properties files that work for them, it would be useful to help get an idea of what works best for people

Share this post


Link to post
Share on other sites
On 9/23/2017 at 8:16 PM, mwdennis said:

With lockpicking disabled/banned on PvE servers how does this mod get around this?  Do I just need to disable locking of chests altogether?

 

On 9/25/2017 at 9:36 AM, LifesaverM said:

I haven't had the time to test this mod enough myself but if it uses the same base treasure chests bdew's mod will fix that. If the mod uses normal chests I'm guessing they are already not locked.

 

https://forum.wurmonline.com/index.php?/topic/138254-released-bdew-server-mods-waaay-too-many-to-list-in-the-title-updated-apr-26/

I had tried to make the digger the owner of the chest, because I seem to remember that you can lockpick your owned items. The problem was, if you're the owner, you can open the chest regardless. Bdew's mod should indeed allow them to be claimed, as they use the same template ID that his code works against. For locked chests on servers where it won't allow lockpicking, it would need to be turned off or another solution is required. I will put it on the todo list, looking into it.

 

On 9/25/2017 at 10:55 AM, Eject said:

i dont know why, but suddenly we all get just QL1 maps

 

Eject

I'm not sure, for anything but hunting it's a skill roll against the relevant skill (digging, mining, fishing), for hunting it's a skill roll against a creature's weaponless fighting. The average FS of everybody involved in the kill is also a factor, because we wanted to work against deathcarts with a bunch of low FS alts farming maps very well. Skill rolls are made with the difficulty in the properties file, at the end of which is a large list of example values and average rolls for difficulty and skill levels. That's "average" with WurmRNG ;)

 

On 9/26/2017 at 8:15 AM, Cuddles said:

I have been playing with this mod for a while now and really enjoy it but I'd like to see a setting in .properties to change how far from where player is when it gets map for treasure to be. Some servers have very big maps and you could end up having to travel 6000 tiles to get a treasure, which is a bit excessive really.

 

11 hours ago, Danielle said:

Same here. 

I had put it on the todo list, and I'll now pretend that I actually work on things on that list! ;) So that option is new in the 1.1.3 update, details in the post below.

Edited by Ulviirala

Share this post


Link to post
Share on other sites

It's strongly recommended to update to 1.1.3 at your earliest convenience, as it fixes an exploitable behaviour that will be outlined on the forums in the coming days. Keeping your server log files around is also a good idea, if you'd like to take retrospective actions against exploiters.

 

Download: https://github.com/dmon82/TreasureHunting/releases/tag/1.1.3

 

  • Don't overwrite your .properties file to keep your current custom settings.
  • Fixed an exploitable behaviour, more details soon.
  • Added surface mining and tunneling for having a chance to find maps, with a separately configurable chance, because it's faster than cave wall mining. To change the default, paste the following in your properties file:
Spoiler

# 1 in N chance for finding a treasuremap while surface mining.
#
# [default: 10000, min: 1, max: 2147483647]
mapSurfaceMiningChance=10000

  • Added the option to specify min and max distances from players to treasures for newly found map. To change the default, paste the following in your properties file:
Spoiler

# The minimum distance that a treasure needs to be away from
# the player who finds it, or the creature that has been slain
# while hunting.
#
# Set this lower than the max distance, and not too large, or
# map creations might fail due to not finding a random spot.
#
# This option was added in version 1.1.3.
#
# [default: 0]
minTreasureDistance=0

# The maximum distance that a treasure is allowed to be away
# from the player who finds it, or the creature that has been
# slain while hunting.
#
# Set this greater than the min distance, and not too low, or
# map creations might fail due to not finding a suitable spot.
#
# This option was added in version 1.1.3.
#
# [default: 2147683647]
maxTreasureDistance=2147483647

  • Changed the way that bonus sleep powder is calculated to simply (QL / 10) * sleepPowderMultiplier, or 0 to only provide a base number of powders, to remove the overcomplexification.
Spoiler

# The amount of more possible pieces of sleep powder,
# that is (QL / 10) * sleepPowderMultiplier.
#
# With a multiplier of 1.0 and a map QL of 90, you will get
# a random amount of (90 / 10) * 1 = [0 to 8] sleep powder.
#
# [default: 1.0, min: 0.0, max 100.0]
sleepPowderMultiplier=1.0

  • Fixed some spelling errors in the default properties file.
  • Ironed out some internal code.
Edited by Ulviirala
  • Like 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this