Shopkeepers - New Inventories!

Discussion in 'General Modification' started by Sol Invictus, Oct 8, 2003.

Remove all ads!
  1. Sol Invictus

    Sol Invictus Beholder Watcher Veteran

    Joined:
    Aug 25, 2003
    Messages:
    325
    Likes Received:
    0
    I'm trying to figure out how to add new stuff to the shopkeepers' inventories and it's hell. I was one of you guys (Phay? :) ) managed to get the inventories working so he would restock bullets and the like.

    Anyway, I was wondering if you could add sorcerer_outfit_red, robe_monk_white, and robe_monk_blue to the list of stuff the Tailor sells.

    Also, Greathelm to the Smith. It looks cool.

    It'd be nice if someone in Nulb gave you 'eyeglasses' as a quest reward. They're sunglasses and they show in the game! I might look to implementing those myself.

    Bandanas for sale in the tailor would be pretty sweet, too - since pirates don't drop them! :(
     
  2. Sol Invictus

    Sol Invictus Beholder Watcher Veteran

    Joined:
    Aug 25, 2003
    Messages:
    325
    Likes Received:
    0
    One question: what file are you editing, and what are you changing?

    I'd like to do this myself.
     
  3. Sol Invictus

    Sol Invictus Beholder Watcher Veteran

    Joined:
    Aug 25, 2003
    Messages:
    325
    Likes Received:
    0
    I'm looking at the graphics files right now and it looks like there's a TON of other stuff not in the game - magic slings, a sorcerer's helmet (looks like something a pharaoh would wear), a crapload of shields and a bunch of weapons.

    Anyway - I've made some new graphics for the Ioun Stones. I'll upload them soon with a bunch of other stuff.
     
  4. Phalzyr

    Phalzyr Established Member Veteran

    Joined:
    Sep 25, 2003
    Messages:
    193
    Likes Received:
    1
    Are you refering to me when you say Phay or is someelse have that name :) BTW it wasn't me, I've just been doing dialog,mes files, and python scripts...
     
  5. Sol Invictus

    Sol Invictus Beholder Watcher Veteran

    Joined:
    Aug 25, 2003
    Messages:
    325
    Likes Received:
    0
    Yeah, I was referring to you.
     
  6. Aginor37

    Aginor37 Member

    Joined:
    Sep 26, 2003
    Messages:
    37
    Likes Received:
    0
    There are only 2 merchants you can modify reliably right now, the blaksmith in Homm and Calmert in the Homm church. None of the rest will refresh their merchandise on any reliable system, so It's a pain to get new merchandise on them. However, assuming you force a refresh of the merchandise (by either resting for 30 days or fighting and looting a monster with loot), you can put pretty much whatever you like on those two, as long as it is a fully working item (i.e. has graphic, isn't flagged No_Use, ect.).
     
  7. Aginor37

    Aginor37 Member

    Joined:
    Sep 26, 2003
    Messages:
    37
    Likes Received:
    0
    Here's a copy of a post I made to the Dev-only board, outlining what I know about how to do it. As long as you follow the rules, you should be able to add any item you want to the above 2 merchants. However, I won't guarantee that the items themselves aren't bugged, since many that are available are bugged already (shoddy coding).


    Okay, here is everything I have learned about the merchant system. I will be editing this post as I learn more, but if anyone knows anything I don't, feel free to add it. Since this is in the Library, let's keep it to just raw data and factual knowledge. Let's save the speculation for the other forum.

    First, the inventory system for the merchants is handled by 2 files (not counting Proto.tab, which has it's fingers in everyything), Invensource.mes and InvensourceBuy.mes, both in the \rules directory of ToEE3.dat. Another useful file to look at when looking at these is Description.mes, which is in the /mes directory of ToEE3.dat.

    Descrtption.mes is just that, descriptions. It has a listing of every spell, item, and NPC in the game, with the corresponding proto.tab ID# for each.

    InvensourceBuy.mes is just a reference file, giving definition to a variable within invensource.mes. This variable defines just what, if anything, said merchant will buy from you. there are 8 options for this variable, ranging from buying nothing to buying everything, but at a reduced price.

    Invensource.mes is the backbone of the NPC merchant system. This file contains all the data necessary for merchants to do what they do. Here is an example of an entry in Invensource.mes.

    {3}{Miller's store: buy_list_num,1 50,4072 50,4170}

    {3} is just an internal Id# as far as I know, I have been unable to find anything in the proto entries for the merchants to give any relevance to the number. However, the .exe probably uses it to match the NPC to his inventory, so I don't advise messing with it.

    Miller's store: Tells you who you are dealing with on this line, in this case the store inventory of the Miller.

    buy_list_num,1 is the variable I mentioned above, the one referenced in InvensourceBuy.mes. In this case, 1 means that he won't buy anything from you.

    50,4072 and 50,4170 are actual item entries. the 50 is the percentage chance that on any given "restock", he will have this item for sale. In other words, every time this merchant "restocks", he can either have one of these items, both of them or none of them for sale. Since both are set to 50 (as opposed to 100, or always has) there is no guarantee he will have either. 4072 and 4170 are item ID#s, in this case being a scythe and a masterwork scythe. The definitions for these numbers can be found within Description.mes and Proto.tab.

    The other function of Invensource.mes is to hold the loot tables of everything in the game, from monsters to chests to NPCs. These follow the same syntax as the merchant entries, but have a few more options in what item is generated and how.

    {59}{Gnoll: (4003,4004,4005,4006) (6001,6002) (6004,6006,6007,6008) copper,3-18 silver,3-18}

    The first two parts are the same as with a merchant, these being the name and internal ID#.

    (4003,4004,4005,4006) is an array of items that said Gnoll may spawn with. The difference between this and 50,4072 50,4170 is that only one of these items will spawn, as opposed to having a 50% chance of either or both spawning. This is why we see snolls with range weapons or melee weapons, but not both. It picks only one item within the array.

    copper,3-18 silver,3-18 are self-explanatory. This is how much coin the monster has to loot when you kill it, and in what denominations. so a Gnoll will drop anywhere from 3 to 18 coppers, and 3 to 18 silvers as well. The variables that can be used in this are copper, silver, gold, platinum, or gems. You can also assign a static value to this, causing that NPC or type of monster to always drop the same amount of coin. You do this by putting just the number you want to drop; for example you would put "platinum,5000" without the quotes if you wanted it to drop 5000 platinum every time.
     
  8. Sol Invictus

    Sol Invictus Beholder Watcher Veteran

    Joined:
    Aug 25, 2003
    Messages:
    325
    Likes Received:
    0
    Well this is really screwy. Is there a file somewhere where I can edit the inventories of the stores and I don't mean the refreshables, so that they contain the items I give them from the very start.

    Also, has anyone figured out how to set the refresh timer for the store inventories?
     
  9. Elithea

    Elithea Member

    Joined:
    Oct 1, 2003
    Messages:
    4
    Likes Received:
    0
    This is what I've found with shop inventories...

    I can edit the invensource.mes file for the Hommlet blacksmith
    store - give the store new items.

    Place the invensource.mes file into:
    $temple_root\data\rules (ie. globally not local to the module)

    Leave Hommlet map - eg. go to Nulb - rest at least 1 day and
    return to Hommlet. The blacksmith store will now have the new
    inventory as per the invensource.mes mod.

    I have not got this to work for the tailor or Mother Screng's
    stores. I haven't tried other stores.

    Hope this helps someone.
     
Our Host!