Grammarsalad Posted July 21, 2022 Share Posted July 21, 2022 (edited) Hello party people. I have a functional mod that creates priest scrolls for the game. I'm kinda proud of it; it adds scrolls for mod-added spells, it creates any scrolls not in the game, adds a generic icon for the scroll if none is found in game (it also copies over all existing icons that are only in...BGEE iirc? Maybe it's bg2ee. It's been a while. Anyway, it copies them over if needed and then references them in the scroll file.) One thing I'm a bit stuck on is scroll placement. Again, I want to do this in a (more or less) dynamic way. I have (and/or am creating) lists that differentiate universal spell scrolls, druid exclusive spell scrolls, and cleric exclusive spell scrolls. Same with scroll levels. I also have a list of temples that sell items. I was thinking that if game_is BGEE, then temples can sell scrolls levels 1-3 or so. I might go a little more fine grained, and do it by the actual temple. For example, it seems unlikely that the temple of helm would sell druid scrolls (actually, I'm not sure what to do, exactly, with druid scrolls...) So, long story short, I'm looking for ideas on how best to distribute the scrolls in game. Any ideas? Edited July 21, 2022 by Grammarsalad Quote Link to comment
Grammarsalad Posted July 21, 2022 Author Share Posted July 21, 2022 I could copy over all enemy priests, but I wouldn't want to just add (e.g.) all 1st level priest scrolls to all priests as droppable loot. Is there a way I could randomize something like that by install? Quote Link to comment
subtledoctor Posted July 21, 2022 Share Posted July 21, 2022 I would have whatsername, next to the Friendly Arm Inn, sell druid scrolls with a wink and a nod. Maybe also the Shadow Druids in Cloakwood Forest? Quote Link to comment
Grammarsalad Posted July 21, 2022 Author Share Posted July 21, 2022 2 hours ago, subtledoctor said: I would have whatsername, next to the Friendly Arm Inn, sell druid scrolls with a wink and a nod. Maybe also the Shadow Druids in Cloakwood Forest? Thanks. That makes sense (I don't quite remember whatshername, but definitely the shadow druids) Quote Link to comment
subtledoctor Posted July 21, 2022 Share Posted July 21, 2022 I mean the temple next to the FAI. The priest seems like a bit subversive. (Willing to help that Flaming Fist deserter, etc.) Quote Link to comment
jmerry Posted July 21, 2022 Share Posted July 21, 2022 If you're going a little fine-grained ... Kelddath Ormlyr in Beregost should have the best cleric scrolls for sale. Because he's level 16. Priest of Lathander, though, so none of the evil ones (Cause Wounds, Unholy Blight). And maybe you can gate some things by chapter, adding to the shop once the bridge to Baldur's Gate opens up and he can get more supplies in. Considering that Sorcerous Sundries stocks 20 copies each of six different level 4 and 5 mage scrolls - and you couldn't reach mage level 9 back in original BG1 - having level 4 and 5 priest scrolls available as of chapter 5 shouldn't be too much trouble. Quote Link to comment
Grammarsalad Posted July 23, 2022 Author Share Posted July 23, 2022 Yeah these are good. I should absolutely distinguish "good" from "evil" scrolls as well. I'm assuming the actual store item changes by chapter? Quote Link to comment
Endarire Posted July 23, 2022 Share Posted July 23, 2022 (edited) If you want to distinguish EVULZ magic from GOODY magic, you can. (I don't see much needed distinction between cause wounds and magic missile since offensive offensive arcane spells aren't inherently EVULZ but many offensive divine spells like harm either inherently are or have a strong association with negative energy.)BG1: What about Thalantyr and Sorcerous Sundries selling scrolls? What about the temples throughout the world? What about innkeepers? I'm pretty sure many people would want to buy a scroll of raise dead or cure light wounds or neutralize poison with fewer wanting flame strike or insect swarm. EVULZ scrolls could be sold in BG city's thief guild due to its association with Sarevok. Faldorn the Shadow Druid and her allies are likely vendors of EVULZ scrolls. SOD: There are quartermasters who sell arcane scrolls. Adding divine scrolls to their stocks seems simple.BG2 (SoA) There are temples and a Druid's Grove that likely should sell these items. We also have Ribald's shop and various tavern keepers who sell scrolls.BG2 (ToB) Lazarus's Arcana Archives I & II sell scrolls. It seems trivial for him to also sell all relevant divine scrolls as well!IWDEE Kuldahar has at least one vendor for scrolls. Black Pits 1 Add level 1-5 scrolls to the appropriate scroll vendor Black Pits II Add level 1-7 scrolls to the appropriate scroll vendor All These Games Except Black Pits Series There are likely random treasure charts where you can add scrolls. Ask others how to do it as prudent. Edited July 23, 2022 by Endarire Quote Link to comment
Endarire Posted July 23, 2022 Share Posted July 23, 2022 Also, in general, thief guilds and disreputable vendors likely stock divine items because there's a demand for it. Quote Link to comment
Grammarsalad Posted July 25, 2022 Author Share Posted July 25, 2022 Okay, question: how would I check a store for a particular item. This is what I have right now: //let's create a list of relevant vendors: COPY ~%folder%/lib/lists/store_list.tpa~ ~override~ COPY_EXISTING_REGEXP GLOB ~^.+\.sto$~ ~override~ // Load all stores BEG CAMCODE: READ_BYTE 0x0008 type //Spell type PATCH_IF type = 3 OR 2 BEGIN //temple or inn type READ_BYTE 0x10 "flags" //ELSE 0 PATCH_IF (("%flags%" BAND 0b00100001) = 0b00100001) BEGIN // if cures available and sells stuff; also filters out invalid files INNER_PATCH_SAVE store_name ~%SOURCE_RES%~ BEGIN END INNER_ACTION BEGIN COPY_EXISTING ~store_list.tpa~ ~override~ REPLACE_TEXTUALLY "BEGIN" "BEGIN %store_name% => ~church~" END END PATCH_IF (("%flags%" BAND 0b00100011) = 0b000000011) BEGIN // if buys and sells READ_LONG 0x18 "buy_mark" PATCH_IF buy_mark > 0 BEGIN READ_LONG 0x34 it_off // items Offset READ_LONG 0x38 it_num // Number of items INNER_PATCH_SAVE store_name ~%SOURCE_RES%~ BEGIN END INNER_ACTION BEGIN COPY_EXISTING ~store_list.tpa~ ~override~ REPLACE_TEXTUALLY "BEGIN" "BEGIN %store_name% => ~inn~" END END END END BUT_ONLY Basically, I'm creating a list to use later. In the second check, I have these two: Quote READ_LONG 0x34 it_off // items Offset READ_LONG 0x38 it_num // Number of items I just have these there because I know they have something to do with the items actually sold by the store. What I would like to do is check each item, and if it, say, has a filename "SCRLPET"*, then I would add the store to a particular list. Etc. But, I'm not sure how to actually check for that... It feels 'loopy', but not sure how to do the actual check. Any advice? * the stone to flesh scroll. Etc. Quote Link to comment
DavidW Posted July 26, 2022 Share Posted July 26, 2022 Here's a function that should work: DEFINE_PATCH_FUNCTION item_in_store STR_VAR item="" RET value BEGIN value=0 GET_OFFSET_ARRAY itm_arr STO_V10_ITEMS_SOLD PHP_EACH itm_arr AS itm_ind=>itm_off BEGIN PATCH_IF !value BEGIN READ_ASCII itm_off resref value = ("%resref%" STR_EQ "%item%")? 1: 0 END END END Originally I coded a two-step one that checked for the string first, but that's overkill given how fast it is just to check stores this way. Quote Link to comment
Grammarsalad Posted August 2, 2022 Author Share Posted August 2, 2022 On 7/26/2022 at 10:34 AM, DavidW said: Here's a function that should work: DEFINE_PATCH_FUNCTION item_in_store STR_VAR item="" RET value BEGIN value=0 GET_OFFSET_ARRAY itm_arr STO_V10_ITEMS_SOLD PHP_EACH itm_arr AS itm_ind=>itm_off BEGIN PATCH_IF !value BEGIN READ_ASCII itm_off resref value = ("%resref%" STR_EQ "%item%")? 1: 0 END END END Originally I coded a two-step one that checked for the string first, but that's overkill given how fast it is just to check stores this way. Awesome! Thanks, Dave Quote Link to comment
Endarire Posted August 3, 2022 Share Posted August 3, 2022 High Hedge and Sorcerous Sundries could still sell divine scrolls. Remember that characters would sell things to vendors they didn't already have. Insect swarm isn't specifically Clerical, but is plausibly stocked by temples. Quote Link to comment
Grammarsalad Posted August 5, 2022 Author Share Posted August 5, 2022 On 8/2/2022 at 9:48 PM, Endarire said: High Hedge and Sorcerous Sundries could still sell divine scrolls. Remember that characters would sell things to vendors they didn't already have. Insect swarm isn't specifically Clerical, but is plausibly stocked by temples. I'm going to be doing something more general (which allows me to capture mod added stores and has a more general application). You will be happy to know that this will be EET compatible right out of the gate. What I need is suggestions about what other sort of items would be appropriate for what kind of scrolls. So, right now I have a (very general) thing where I would add level 1 scrolls to stores that also sell the potion of healing (the weakest version). So, that's the question: what specific item should be sold alongside scrolls of a given type? Quote Link to comment
Grammarsalad Posted August 5, 2022 Author Share Posted August 5, 2022 It can be something like, "if it sells potion of healing, then it should sell at least level 1 scrolls. If it sells (idk) a protection scroll against undead, then it should sell 'good' spells." Something like that. Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.