Thread: Tweaking chests
View Single Post
  #6  
Old 01-16-2011, 03:18 PM
DarkScythe DarkScythe is offline
Registered Member
 
Join Date: Jan 2011
Posts: 13
Default

Thanks for the information, bucazaurus.

I think there may be a mistake with your assumption though, but then I'm also making assumptions. It would help if someone more experienced with this code could step in to clarify a few things.

Quote:
Originally Posted by bucazaurus View Post
To be honest with you , i had no idea what i did. I saw your post and decided to experiment . My logic behind the numbers was that the game rolls a number ranging from 0 to 100 to decide what the reward will be...

if r < 97 then (...so only if the number rolled is higher then 97 the gold will be generated with that amount .) This says if "r" is less than "97" so it should give gold if it rolls 0-96, I think.
Boxgen.parcount( "money", "*1" ) -- ãåíåðèì äåíåã Mini

Another example.
K = K - 15 (any number below this will generate gold) I believe this should also be the opposite; The next line states if K is less than zero (negative) then it rolls to determine what "r" should be.
if K < 0 then
local r = Boxgen.rnd(100)

if r < 20 then (if the number rolled is between 15 and 20 you get 3 crystals) I think this would be from 0-19, since it's looking for "r" to be less than 20.
Boxgen.parcount( "crystals", "3" )
elseif r < 50 then (if number is between 20 and 50 you get 5 crystals)
Boxgen.parcount( "crystals", "5" )
elseif r < 65 then (and so on )
Boxgen.parcount( "crystals", "10" )

Again , this is how i thought the system works. It might be wrong , but it seems is working.
That said, your tip about looking in the pet files was definitely key.
I spent yesterday testing and trying different values, but I think I've found a balance.

addon_pet.lua definitely alters the chests dug up by the dragon's "treasure searcher" ability, but does not affect chests that already appear on the battlefield when you begin sometimes.

These "pre-existing" chests are modified by boxes.lua that I was working with before it seems. I tested this by, again, setting the "items" chance to 100%, then found a battle with a chest in it. Without my modification, it yielded some gold. After I added the modified file, it instead gave me a "silver rapier" sword. I restarted the battle a few times and it always gave me that one sword.

I have not found the file that modifies the chests that are scattered about the world/adventure map, but I think this is OK because I'm not looking to change those. The chests on the world map are almost always guarded by armies, and those actually make sense to have a lot of gold, since they're being protected.

With that, I went ahead and modified all the "battlefield" chests to give what I feel is a better representation of what these chests should have, while trying not to affect the balance too much. Still, this is a deviation from vanilla, so there WILL be a change in game balance regardless.

From a previous post on these forums,
Quote:
You can get artifacts only from pre-existing chests on the battlefield. Those have the following chances:
- Gold (76%)
- Random scroll (15%)
- Crystals (5%)
- 1 random rune (3%)
- 1 wanderers' scroll (1%)
- random item (1%) - level of the item is based on the difficulty of the battlefield

Chests dug up by the dragon give:
- Gold (72%)
- Random scroll (15%)
- Crystals (5%)
- 1 random rune (5%)
- 1 wanderers' scroll (3%)
I've modified the chances to the following so far:

Quote:
Dragon's chests:
25% for 3 Runes
30% chance of crystals [15% for 3, 40% for 5, 30% for 10, 15% for 15]
15% random scroll [50% for 1, 30% for 2, 20% for 3]
20% wanderer scroll
10% gold [10% "mini" amount, 50% "small", 40% "average"]

Battlefield chests:
25% random item
20% for 5 runes
15% chance of crystals [20% for 5, 50% for 8, 30% for 10]
10% random scroll [same sub-percentages as dragon's]
20% wanderer scroll
10% gold [same sub-percentages as dragon's]
These percentages are based on my assumption of how the code is working, of course. From my bit of playtesting, it seems to be working out well, I'm getting gold still, but much less often than before, and I'm always now interested in digging to see what I find.

The chances are increased quite a bit in some cases, but my reasoning is as follows:
Lower chance of gold means you no longer assume every chest will be gold anyway and stop trying to dig for them (when you have 1mil gold, getting more gold is kind of annoying) but when it does come up with gold, it should be a decent amount. This also means the gold-filled chests scattered around the map are much more valuable.

The next logical thing to hoarde in a chest besides gold, are jewels; in this case, magic crystals and runes. I'm still working out the best numbers for them, but as it's a buried treasure chest, I felt it should be a little more than what you can find lying around on the map in the open. The battlefield chests have more runes (and I may give it more crystals and lower the dragon's chest's crystals instead) because those are random and you cannot dig for them or force them to appear, so there should be a bigger incentive to rush for them. After that, the wanderer scrolls are more valuable than regular spell scrolls, so I increased their chances slightly.

I may eventually copy the code in to randomize the runes you get from 2-4 or 5 maybe, but I'm still testing everything right now.

Sorry for the lengthy rant, but thanks again for helping me out; I appreciate it.

I've attached what I have so far. If anyone tries it out, please let me know what you think. I'm too new to the game to tell what unforeseen consequences this could have.

Thanks!
Attached Files
File Type: zip Modified Treasure Chests-Beta1.zip (8.4 KB, 413 views)
Reply With Quote