Crossfire Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CF: patch for dump_alchemy_costs()




Here is a small patch that adds two new command-line parameters to the
Crossfire server: "-m9" which dumps outs the alchemy information
together with some estimates of the value of the ingredients and
results of each recipe, and "-mt <name>" which lists all treasures
generated by a given monster.  The patch is small (5K uuencoded), so I
hope that it is not a problem to post it to the list.  I wouldn't have
posted it if it was bigger.

The function dump_alchemy_costs() compares the total cost of the
ingredients with the cost of the result, if you had to buy all objects
in a shop.  It does NOT take the rarity of the items into account; I
still have to find a good solution for that.

Try "crossfire -m9 | more" and you will see that several formulae are
using non-existing ingredients.  The errors are:
- one spelling mistake: "orge" instead of "ogre",
- several extra "s" which should not be there: "bolts" and "arrows"
  instead of "bolt" and "arrow",
- some body parts that are never generated by the corresponding
  monsters: there can never be a "madman's hand" or an "ogre's heart"
  because these monsters do not have a hand or a heart in their
  treasure lists.
The last category was a bit tricky to check, so I wrote an extra
function to see what a monster can generate.

The function dump_monster_treasure() goes through the treasure lists
for any monster and prints all items that can be generated.
Currently, it only prints the names of the items but not their
probability of being created.  Maybe I will add that.  Try the
following commands to see how it works:
  crossfire -mt orc
  crossfire -mt elf
  crossfire -mt dragon
  crossfire -mt "electric dragon"

I hope that this code will be useful to some of you...

-Raphael

begin 644 alchemy-dump-patch.gz
M'XL("'%<AS4"`V%L8VAE;7DM9'5M<"UP871C:`#=&F=SVT;V,_,KGGFCB*0@
MFD6%)53&-?&=8OM<)I>),QP(6)(X@0"#!57&T7^_][8#!&G92:YQ[!&P^_:5
M?7T7K58+@G2Y3).'41+E[:"=9M&\]M;/X0?_%KHGT#D>]4Y&QQWH#H>#KPX/
M#XOPM1]9"']=)]`]A4YOU.N,.J<2M%7\T3L<=;VC4Q"O`']A,6?X%R".V=6S
M+$LS3PPG833[Z@%T//4/?P];P%=QE'L0KI>K*S]>,X[//D-.EFG(H/40ER(L
M`OK9/)#O+]^?G^NA*SET_N+QTQ=O/'C^ZN4[\?#Z_-%/S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