# HG changeset patch
# User Matti Hamalainen
# Date 1585554813 -10800
# Node ID 0b12af2c103afe2930e6f78dec001c987643cbe6
# Parent 06f3892d53e9468f2e0f44bd27d11d74dd7b0fd7
Split prices.php configuration into a separate PHP file, do some cleanups in the code as well.
diff -r 06f3892d53e9 -r 0b12af2c103a prices.config.php
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/prices.config.php Mon Mar 30 10:53:33 2020 +0300
@@ -0,0 +1,279 @@
+
+ *
+ * Requires PHP 5.4 or later, primarily tested on PHP 5.6.x.
+ * Also tested on PHP 7.3.
+ *
+ * Notes:
+ * - Possibility for discount can be enabled per section, there is
+ * no "global" discount for everything, however.
+ *
+ * - Services in $services1_prices have a threshold for quantity
+ * discount, but services in $services2_prices do not. The total
+ * service discount % applies to both, too.
+ *
+ * - If "extra" field is set (as it is for services that have some
+ * additional material costs), the extra price DOES NOT get
+ * the section discount % applied!!
+ *
+ * - Ammunition, potions and salves sections have a "base" price,
+ * on top of which specials (more difficult to make, etc.) additional
+ * price can be set.
+ *
+ */
+//
+// General settings
+//
+$pageTitle = "Ggr's Merchant Pricelist";
+$pageCharset = "UTF-8";
+//$pageCSS = "foobar.css"; // Uncomment and change this, if you want to use your own CSS stylesheet file
+
+
+//
+// Enable different service and product sections
+//
+$sections = [
+ "services1" => true,
+ "services2" => true,
+ "reagents" => true,
+ "arrows" => true,
+ "salves" => true,
+ "potions" => false,
+];
+
+
+//
+// Global additional description string, added to start of the page
+//
+$global_desc = '
+
+I do NOT make alchemist potions or rings*, or any SHIP stuff.
+
+(*) Well, actually I do make rings, but only for personal amusement. I do
+not wish to spend time trying to come up with some specific ring type.)
+
+';
+
+
+//
+// Generic services section settings
+//
+$services = [
+ "name" => "services",
+ "title" => "Generic services",
+ "discount" => true, // enable discounts for this section
+
+ "desc" => "As one might expect, I have most of the relevant
+skills/spells/masteries at 100%.",
+];
+
+
+// Services with discount thresholds for prices
+$services1_prices = [
+ "fw" => [
+ "name" => "Feather weight",
+ "subj" => "cast",
+ "tresh" => 20, // threshold count for discount
+ "price1" => 2500, // price per item below discount threshold
+ "base" => 10000, // base price for discounted total
+ "price2" => 1750 // price per item with discount
+ ],
+ "prot" => [
+ "name" => "Protect armour/weapon/item",
+ "subj" => "cast",
+ "tresh" => 20,
+ "price1" => 3000,
+ "base" => 10000,
+ "price2" => 2000
+ ],
+ "repair" => [
+ "name" => "Repair armour/weapon/item",
+ "tresh" => 6,
+ "subj" => "item",
+ "price1" => 10000,
+ "price2" => 7500,
+ "extra" => " + materials"
+ ],
+];
+
+
+// Services _without_ discount threshold
+$services2_prices = [
+ "labels" => [
+ "name" => "Labelling",
+ "subj" => "item",
+ "price" => 3000
+ ],
+ "surg80" => [
+ "name" => "Surgery to 80%",
+ "subj" => "item",
+ "price" => 10000,
+ ],
+ "surg100" => [
+ "name" => "Surgery to 100",
+ "subj" => "item",
+ "price" => 15000,
+ ],
+ "mip" => [
+ "name" => "Money is Power",
+ "subj" => "cast",
+ "price" => 10000,
+ ],
+ "makegear" => [
+ "name" => "Make mount gear",
+ "subj" => "item",
+ "price" => 20000,
+ "extra" => " + materials",
+ ],
+ "refitgear" => [
+ "name" => "Refit mount gear",
+ "subj" => "item",
+ "price" => 10000,
+ "extra" => " + materials"
+ ],
+
+ "createaw" => [
+ "name" => "Create armour/weapon",
+ "subj" => "item",
+ "price" => 15000,
+ "extra" => " + materials"
+ ],
+];
+
+
+//
+// Mage reagents
+//
+$reagents = [
+ "name" => "reagent",
+ "title" => "Power reagents",
+ "discount" => true, // enable discounts for this section
+ "datafile" => "reagents.txt",
+
+ "desc" => "Bulk orders may require time to complete, inquire.
+Notice! Availability presented below may or may not reflect the current stock situation.",
+
+ "prices" => [
+ "Blast reagents" => [
+ "acid1" => ["acid", "Acid Blast", "handful of olivine powder", 125],
+ "acid2" => ["acid", "Acid Storm", "pair of interlocked rings", 125],
+
+ "asph1" => ["asph", "Blast Vacuum", "bronze marble", 150],
+ "asph2" => ["asph", "Vacuum Globe", "small fan", 150],
+
+ "elec1" => ["elec", "Electrocution", "small piece of electrum wire", 125],
+ "elec2" => ["elec", "Lightning Storm", "cluster of tungsten wires", 125],
+
+ "cold1" => ["cold", "Cold Ray", "steel arrowhead", 150],
+ "cold2" => ["cold", "Hailstorm", "handful of onyx gravel", 125],
+
+ "pois1" => ["pois", "Summon Carnal Spores", "silvery bark chip", 125],
+ "pois2" => ["pois", "Killing Cloud", "ebony tube", 100],
+
+ "fire1" => ["fire", "Lava Blast", "granite sphere", 125],
+ "fire2" => ["fire", "Lava Storm", "blue cobalt cup", 125],
+
+ "mana1" => ["mana", "Golden Arrow", "copper rod", 125],
+ "mana2" => ["mana", "Magic Eruption", "tiny platinum hammer", 125],
+ ],
+
+ "Prot reagents" => [
+ "phys3" => ["phys", "Armour of Aether", "small highsteel disc", 200],
+ "acid3" => ["acid", "Acid Shield", "stone cube", 125],
+ "asph3" => ["asph", "Aura of Wind", "tiny leather bag", 275],
+ "fire3" => ["fire", "Flame Shield", "small glass cone", 150],
+ "cold3" => ["cold", "Frost Shield", "grey fur triangle", 275],
+ "elec3" => ["elec", "Lightning Shield", "small iron rod", 100],
+ "mana3" => ["mana", "Repulsor Aura", "quartz prism", 125],
+ "pois3" => ["pois", "Shield of Detoxification", "tiny amethyst crystal", 125],
+ ],
+ ],
+];
+
+
+//
+// Ammunition
+//
+$arrows = [
+ "name" => "arrow",
+ "title" => "Ammunition",
+ "desc" => "Only advertised damage types are available. If you want
+other material combos for base ammunition, these may be negotiable. Feel
+free to inquire about other ammunition types (bullets, etc.).
+",
+
+ "base" => 300, // base price per arrow, the values below are added on top of this
+ "discount" => true, // enable discounts for this section
+
+ "i_fields" => 2,
+ "i_price" => 2,
+ "i_titles" => ["Type", "Materials", "Price / arrow", "#"],
+ "prices" => [
+ "phys" => ["Normal (phys)", "ebony, feathers, diamond", 0],
+ "psi" => ["Psi", "* + brain", 100],
+ "acid" => ["Acid", "* + stomach", 100],
+ "elec" => ["Elec", "* + tungsten", 100],
+ "mana" => ["Mana", "* + crystalline", 150],
+ "cold" => ["Cold", "* + ice", 150],
+ "fire" => ["Fire", "* + fire", 250],
+ "asph" => ["Asphyx", "* + toadstool", 350],
+// "pois" => ["Poison", "* + h'cliz", 300],
+ ],
+];
+
+
+//
+// Salves
+//
+$salves = [
+ "name" => "salve",
+ "title" => "Salves",
+ "desc" => "All salves sold by me are +25 to stat with 10 min
+duration. Salves of same type do not stack, so you can't get +50 or such,
+but different types of salves can be used simultaneously (like int and wis).
+One salve has 4 portions (e.g. 4 uses) and weighs about 1kg.
+
+Salve orders will take some time to complete, I don't keep much stock on these currently.
+",
+
+ "base" => 6000,
+ "discount" => false,
+
+ "i_fields" => 1,
+ "i_price" => 1,
+ "i_titles" => ["Salve", "Price / piece", "#"],
+ "prices" => [
+ "str" => ["+str", 0],
+ "con" => ["+con", 0],
+ "int" => ["+int", 0],
+ "wis" => ["+wis", 0],
+ "dex" => ["+dex", 0],
+
+ "pack" => ["white cloth pack for holding salves [0/15]", 29000],
+ ],
+];
+
+
+//
+// Alchemist potions
+//
+$potions = [
+ "name" => "potion",
+ "title" => "Alchemist potions",
+ "desc" => "Potion orders have no guaranteed completion time! If you want
+potions sooner rather than later, ask someone else!
+",
+
+ "base" => 5500,
+ "discount" => false,
+
+ "i_fields" => 1,
+ "i_price" => 1,
+ "i_titles" => ["Potion", "Price / piece", "#"],
+ "prices" => [
+ "generic" => ["Generic potion", 0],
+ ],
+];
+
+?>
\ No newline at end of file
diff -r 06f3892d53e9 -r 0b12af2c103a prices.php
--- a/prices.php Wed Aug 21 17:26:04 2019 +0300
+++ b/prices.php Mon Mar 30 10:53:33 2020 +0300
@@ -1,264 +1,25 @@
-
+
- *
- * Requires PHP 4.3 or later, primarily tested on PHP 5.2.x.
- *
- * Notes:
- * - Possibility for discount can be enabled per section, there is
- * no "global" discount for everything, however.
+ * (C) Copyright 2009-2013,2020 Matti 'Ggr' Hamalainen
*
- * - Services in $services1_prices have a threshold for quantity
- * discount, but services in $services2_prices do not. The total
- * service discount % applies to both, too.
- *
- * - If "extra" field is set (as it is for services that have some
- * additional material costs), the extra price DOES NOT get
- * the section discount % applied!!
- *
- * - Ammunition, potions and salves sections have a "base" price,
- * on top of which specials (more difficult to make, etc.) additional
- * price can be set.
+ * Requires PHP 5.4 or later, primarily tested on PHP 5.6.x.
+ * Also tested on PHP 7.3.
*
*/
-// General settings
-$pageIndex = "prices.php";
-$pageTitle = "Ggr's Merchant Pricelist";
-$pageCharset = "UTF-8";
-//$pageCSS = "foobar.css"; // Uncomment and change this, if you want to use your own CSS stylesheet file
-
-
-// Enable service and product sections
-$sections = array(
- "services1" => true,
- "services2" => true,
- "reagents" => true,
- "arrows" => true,
- "salves" => true,
- "potions" => false,
-);
-
-
-// Global additional desc, added to start of the page
-$global_desc = '
-
-I do NOT make alchemist potions or rings*, or any SHIP stuff.
-
-(*) Well, actually I do make rings, but only for personal amusement. I do
-not wish to spend time trying to come up with some specific ring type.)
-