Comm/Trade: I don't know how the logic worked. Do prices vary for different shops? Do I need a list of item prices or is it calced?
Ok... Comms and trade are quite complex. I know a fair bit about how to use it, I don't know most of the inner workings. I'll tell you a bit of what I know about trade:
There are 'standard' prices for all items. Most of these prices can be read from the posters outside shops. Here are the prices:
Basic items (the shop at the start of the game):
- Dagger - 5
- Leather shield - 6
- Long sword - 10
- Short sword - 10
- Staff - 8
- Leather armour - 7
- Chainmail - 12
- Buckler - 10
--
Advanced items (the shop near the entrance to the serpent tower):
- Battle gloves - 10
- Battle axe - 12
- Large shield - 15
- Plate mail - 16
(+ all basic items)
--
Elite (the shops inside the moon tower):
- n'egg (red or blue) - 4
- Battle staff - 15
- Mithril sword - 15
- Mithril axe - 20
- Mithril gloves - 18
- Mithril chain - 20
- Mithril plate - 25
(+ all advanced & basic items; basic items only offered rarely)
---
Potion shops:
- Dragon ale - 8
- Serpent slime - 10
- Moon elixir - 12
- Brimstone broth - 15
(these are only sold at the potion shops; and no other items are offered at potion shops.)
--
Other (items that are not for sale unless they've come from a player - I haven't got a complete list)
- troll's axe - 25
- adamant chain - 32
- adamant plate -
- adamant gloves - 27
- crystal chain - 43
- crystal plate -
- crystal gloves -
- moon shield - 20
- dragon scale shield - 30
- war shield -
When speaking to a shop keeper, they will offer a new (random) item every time you ask them what they have to sell. (using the 'purchase' button) Whereas if you speak to any non shopkeeper NPC, they'll offer the same item each time. If you end the conversation and speak to them again, they offer a different item (except in the extended levels, where it works a bit differently.)
If the player 'offers' an amount of gold less than the acceptable price, the NPC will simply say no. Normally, only the standard price is acceptable when purchasing items; *but* if the player character is sufficiently high level / charisma, then the player can buy the item at a 20% discount. (I have no idea what the cutoff is. All I know is that normally when you buy things there is no chance of a discount; but if you come back to a shop later in the game, you can often get a discount.)
When selling, the NPC will start by offering 50% of the standard price; but if you continue the conversation (particularly with praise) then they will later offer higher prices. The selling value can go from 50% all the way up to 100% of the standard price; and you can get that just by pressing 'praise' over and over. However - this friendliness is cyclic, ie. after 100% it will jump back down to 50%. (Note: if the player purchases an item and gets the 20% discount, the cyclic 'friendliness' will be set to 100%; and so the player can then immediately sell the item for a profit.)
Non shop-keeper NPCs will offer items like a basic shop, or and advanced shop, or an elite shop - depending on the NPC's level. (Roughly speaking, anything before the serpent tower will be basic; anything from from serpent before dragon will be advanced, and dragon onwards will be elite - but I haven't done much testing on this.) Interestingly, the summoned blue monster from the illusion spell offers elite level items (ie. mithril plate etc.)
No NPC will sell you adamant or crystal items; but those items do still follow the same rules. On the other hand, unique items such as wands, rings, gems, and unique weapons cannot be sold. The NPC says something like "I never trust the super-natural".
The general conversation goes like this:
Player - purchase:
"Hast thou aught to sell?"NPC -
"What dost offer for my leather armour?"Player - offer:
"Wilt thou accept 11 gold?" (player offers whatever is in the cursor item slot)
NPC -
"Yes" (and the gold is immediately swapped for the gold - unless the player has changed what is in the item slot.)
--
As you can see there is a lot of detail. It's a relatively complex system. I don't know what exactly causes the prices to go up, or the discount to be given. I also don't know exactly what the conditions are for the NPC cutting off the conversation. (I have some general patterns; but not much info. It is far more likely at the bottom on the 'friendliness cycle'; and it is far more likely for enemies rather than shop keepers! I have a little bit more to say about the 'exchange' feature; but that can wait for another day.
One last thing, the communication options should highlight when you mouse over them. Currently the browser version doesn't do that.