Jump to content

Priest Scroll placement


Recommended Posts

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 by Grammarsalad
Link to comment
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)

Link to comment

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.

Link to comment

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 by Endarire
Link to comment

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.

Link to comment

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.

Link to comment
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

Link to comment
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? 

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...