Jump to content

Unearthed Arcana present Tome & Blood: more options for arcane casters


Recommended Posts

@kjeron any idea why, when I set up a spell-learning system for sorcerer spells, it doesn't show an icon in the "learn" box when I select a spell and click "memorize?"  Here's the code:

Spoiler
DEFINE_ACTION_FUNCTION sorcerer_spell_learning STR_VAR menu_suffix = ~W~ BEGIN

// sorcerer spell system legend
//
<<<<<<<<  d5/d5msorc.2da
2DA V1.0
****
            	     ResRef   Type>>>>>>>>
  COPY ~d5/d5msorc.2da~ ~override/d5msorc.2da~

 ACTION_IF !(FILE_EXISTS_IN_GAME ~d5xclons.2da~) BEGIN
<<<<<<<< d5/d5xclons.2da
2DA V1.0 
IND
		MEM 	CAST 		TYPE	PROCESSED
100		#		#			#		#
>>>>>>>> 
  COPY ~d5/d5xclons.2da~ ~override/d5xclons.2da~ 
END

//ACTION_IF (FILE_EXISTS_IN_GAME ~d5xclons.2da~) BEGIN

  OUTER_SET high_ind = 99
  COPY_EXISTING ~d5xclons.2da~ ~override~
    COUNT_2DA_COLS cols
    READ_2DA_ENTRIES_NOW ~r2en_xclons~ cols
    FOR (row = 0; row < r2en_xclons; ++row) BEGIN
      READ_2DA_ENTRY_FORMER ~r2en_xclons~ row 0 this_ind
      PATCH_IF (this_ind > high_ind) BEGIN
        SET high_ind = this_ind
      END
    END
  BUT_ONLY

  COPY_EXISTING ~d5xclons.2da~ ~override~
    COUNT_2DA_COLS cols
    COUNT_2DA_ROWS cols rows
    READ_2DA_ENTRY (rows - 1) 0 cols last_ind
  BUT_ONLY

  COPY_EXISTING_REGEXP GLOB ~^.+\.spl$~ ~override~
    PATCH_IF (%SOURCE_SIZE% > 0x71) BEGIN
//    SNPRINT 4 spell_prefix ~%SOURCE_RES%~
      READ_SHORT 0x1c spell_type 
      READ_BYTE 0x25 spell_school
      READ_LONG 0x34 spell_level
      PATCH_IF (~%SOURCE_RES%~ STRING_MATCHES_REGEXP ~[Ss][Pp][Ww][Ii][1-9][0-5][0-9]$~ = 0) && (spell_type = 1) && !(spell_school = 10) && !(~%SOURCE_RES%~ STRING_EQUAL_CASE ~SPWI908~) && !(~%SOURCE_RES%~ STRING_EQUAL_CASE ~SPWI124~) BEGIN
	    SNPRINT (0 - 3) spell_num ~%SOURCE_RES%~
	    SET go = 1
	    PATCH_IF (~%SOURCE_RES%~ STRING_EQUAL_CASE ~SPWI420~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~SPWI710~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~SPWI809~) || (~%SOURCE_RES%~ STRING_EQUAL_CASE ~SPWI617~) BEGIN
	      PATCH_IF NOT (MOD_IS_INSTALLED ~TomeAndBlood.tp2~ ~55~) BEGIN
		    SET go = 0
	      END
	    END	
	    PATCH_IF (go = 1) && !(FILE_CONTAINS_EVALUATED (~hidespl.2da~ ~%SOURCE_RES%~)) BEGIN
          SPRINT $sorcerer_spells(~%SOURCE_RES%~) ~1~
        END
      END
    END
  BUT_ONLY
  
  ACTION_PHP_EACH sorcerer_spells AS sorc_spell => ind BEGIN
    ACTION_IF (%ind% > 0) BEGIN
      OUTER_SET spl_ind = 0
	  ACTION_IF (FILE_CONTAINS_EVALUATED (~d5xclons.2da~ ~%sorc_spell%~)) BEGIN
		COPY_EXISTING ~d5xclons.2da~ ~override~
		  COUNT_2DA_COLS cols
	      READ_2DA_ENTRIES_NOW ~r2en_xclons~ cols
	      FOR (row = 0; row < r2en_xclons; ++row) BEGIN
	        READ_2DA_ENTRY_FORMER ~r2en_xclons~ row 0 prev_ind
	        READ_2DA_ENTRY_FORMER ~r2en_xclons~ row 2 cast_spell
	        PATCH_IF (~%sorc_spell%~ STRING_EQUAL_CASE ~%cast_spell%~) BEGIN
	          SET spl_ind = prev_ind
	        END 
	      END
	    BUT_ONLY
      END
      ACTION_IF (spl_ind = 0) BEGIN
        OUTER_SET high_ind = high_ind + 1
	    OUTER_SET spl_ind = high_ind
	  END
	  APPEND ~d5msorc.2da~ ~sorcerer	%sorc_spell%	3~
      APPEND ~d5xclons.2da~ ~%spl_ind% 	%sorc_spell% 	%sorc_spell% 	arcane 	no ~ UNLESS ~%sorc_spell% 	%sorc_spell%~
    END
  END

  COPY_EXISTING ~d5xclons.2da~ ~override~
    COUNT_2DA_COLS cols
    READ_2DA_ENTRIES_NOW ~r2en_xclons~ cols
    FOR (row = 0; row < r2en_xclons; ++row) BEGIN
      READ_2DA_ENTRY_FORMER ~r2en_xclons~ row 0 x_ind
      READ_2DA_ENTRY_FORMER ~r2en_xclons~ row 1 mem_spell
      INNER_ACTION BEGIN
	    ACTION_IF (FILE_EXISTS_IN_GAME ~%mem_spell%.spl~) BEGIN
          COPY_EXISTING ~%mem_spell%.spl~ ~override~
		    READ_STRREF NAME1 spell_name
		    READ_STRREF UNIDENTIFIED_DESC spell_description
		    READ_LONG 0x34 spell_level
		    READ_ASCII 0x3a spell_icon
		  BUT_ONLY
		  COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/%mem_spell%%menu_suffix%.spl~
            SAY NAME1 ~%spell_name%~
            SAY UNIDENTIFIED_DESC ~%spell_description%~
			WRITE_EVALUATED_ASCII 0x3a ~%spell_icon%~ #8
			LPF ALTER_SPELL_HEADER STR_VAR icon = EVAL ~%spell_icon%~ END
		  	LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 171 target = 1 timing = 9 STR_VAR resource = EVAL ~%mem_spell%~ END
		END
	  END
	END
  BUT_ONLY

  INCLUDE ~%MOD_FOLDER%/lib/semi_spont/sequencer_menu.tpa~

  LAF CREATE_SEQUENCER_MENU 
    INT_VAR 
	 name = RESOLVE_STR_REF (~Spell Selection~)
	 tip = RESOLVE_STR_REF (~Spell Selection~)
	 desc = RESOLVE_STR_REF (~This ability allows you to learn new spells~)
    STR_VAR 
	 resref = ~d5msorc~
	 spelllist = ~d5msorc~
	 spelltable = ~QD_SPLSRCKN~
	 icon = ~spcl919b~
	 title = ~Spell Selection~
	 label = ~Select a spell to learn~
	 subspell = EVAL ~%menu_suffix%~
  END

  COPY_EXISTING ~d5msorc.2da~ ~override/d5msorcX.2da~

END

 

EDIT - now I am seeing the icons. Don't know what the problem was, I might have been overwriting them...?

...

In other news, aside from that little invisible-icon thing, I have re-engineered the multiclass sorcerers component from the ground up, and it is now fully working, 5th-level spells and everything. What's more, I've off-loaded a bunch of it into some portable functions, so I should be able to use this as a base for e.g. re-engineering the shaman-style casting in FnP.

Unfortunately, since the new system is new, it now longer works with the sorcerer spell-switching component and it breaks the Man Sorcerer component. So still more work to be done before I can release it for general use.

Edited by subtledoctor
Link to comment

So. Got a question. Apologies if it has already been answered.

 

When I make a necromancer, the only special abilities I see are craft item, spont casting and rebuke undead (though it says Quick Weapon, clicking on it starts the effect and it shows up on the character page.) I see nothing about any of the touch attacks. Is there something I'm missing by chance?

Link to comment

Okay, I've updated the mod to fix the multiclass sorcerers' spell learning and casting. All of that code is tightened up, and it is more compatible with other similar applications such as clerics' spontaneous casting in Faiths & Powers, and the broader 5E spellcasting conversion mod.

NOTE: trying to fully integrate the Mana Sorcerer kit ended up being a ton of extra work for little or no added functionality, so I couldn't justify it. The Mana Sorcerer still works, and is still interesting, but notably the Mana Sorcerer will not get spell-switching like other sorcerers, if you happen to install that option. Sorry - my gas tank is empty.

Once again, this update makes major changes to the "semi_spontaneous" library of functions (now up to 0.7 internally) which is shared by several mods. If you use these features of the update, then you should update all of the following mods that you may be using:

Cheers.

Notably, while those functions were first designed for 5E-style casting, they now also support full sorcerer-style casting. So if you want to make a multiclass fighter/dragon disciple kit, or something like that, it is now pretty easy to do so. The actual code needed is pretty sparse - after adding the kits themselves, the code for one multi-sorcerer kit looks like this:

Spoiler
//get kit identifiers_________________________________________________________________
//
OUTER_SET fighter_sorcerer_code = (0x4000 + %D5_FIGHTER_SORCERER%)

APPEND ~splprot.2da~ ~D5_KIT_IS%TAB%152%TAB%-1%TAB%1~ UNLESS ~D5_KIT_IS~
COPY_EXISTING ~splprot.2da~ ~override~
	COUNT_2DA_COLS cols
	READ_2DA_ENTRIES_NOW rows cols
	FOR (row = 1; row < rows; ++row) BEGIN
	  READ_2DA_ENTRY_FORMER rows row 0 ~stat~
	  PATCH_IF ~%stat%~ STRING_EQUAL_CASE ~D5_KIT_IS~ BEGIN
	    SET kit_is_row = %row%
	  END
	END
BUT_ONLY

//5E CASTING COMPAT___________________________________________________________________
// add 318 effects to exempt multisorc from 5E casting
ACTION_FOR_EACH 5e_spl IN ~d5zz000~ ~d5zzini~ /*~d5zlots~*/ ~d5zltwz~ BEGIN
  ACTION_IF (FILE_EXISTS_IN_GAME ~%5e_spl%.spl~) BEGIN
    COPY_EXISTING ~%5e_spl%.spl~ ~override~ 
	  LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = %fighter_sorcerer_code% parameter2 = %kit_is_row% timing = 0 duration = 1 STR_VAR resource = EVAL ~%5e_spl%~ END
    BUT_ONLY
  END
END

LAF sorcerer_spell_learning STR_VAR menu_suffix = ~W~ END

LAF semi_armor_casting END

LAF semi_sorcerer_casting STR_VAR menu_suffix = ~W~ END // suffix must be the same as spell-learning!

LAF arcane_casting_slots STR_VAR slot_table = ~mxsplsrc~ table_spl = ~d5xltsr~ END

COPY_EXISTING ~d5xrfsh.spl~ ~override~
			  ~d5xx000.spl~ ~override~
  LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %fighter_sorcerer_code% parameter2 = %kit_is_row% timing = 1 STR_VAR resource = ~d5xltsr~ END

//make sequencer/contingency scrolls unusable by multi sorcerers_______________________
//
ACTION_IF !(MOD_IS_INSTALLED ~TomeAndBlood.tp2~ ~53~) AND !(MOD_IS_INSTALLED ~TomeAndBlood.tp2~ ~54~) BEGIN
  ACTION_IF FILE_EXISTS_IN_GAME ~scrl9q.itm~ BEGIN
	COPY_EXISTING ~scrl9q.itm~ ~override~
	  LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 319 parameter1 = %fighter_sorcerer_code% parameter2 = 9 power = 0 timing = 2 END
  END
END
ACTION_IF !(MOD_IS_INSTALLED ~TomeAndBlood.tp2~ ~53~) AND !(MOD_IS_INSTALLED ~TomeAndBlood.tp2~ ~54~) AND !(MOD_IS_INSTALLED ~TomeAndBlood.tp2~ ~55~) BEGIN
  ACTION_FOR_EACH meta_scroll IN ~scrl6p~ ~scrl8l~ ~scrl9d~ ~scrl7u~ BEGIN
	ACTION_IF FILE_EXISTS_IN_GAME ~%meta_scroll%.itm~ BEGIN
	  COPY_EXISTING ~%meta_scroll%.itm~ ~override~
		LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 319 parameter1 = %fighter_sorcerer_code% parameter2 = 9 power = 0 timing = 2 END
	END
  END
END

//QD_MULTICLASS_______________________________________________________________________
//
ACTION_IF FILE_EXISTS_IN_GAME ~d5fsorc.2da~ BEGIN
  LAF qd_multiclass
	STR_VAR
		kit_name = ~D5_FIGHTER_SORCERER~ 
		kit_clab = ~d5fsorc~
		base_class = ~M~
		mc_dir = ~tomeandblood/lib/qd_mc~
  END
END 

 

 

Edited by subtledoctor
Link to comment
2 hours ago, krazedhermit said:

Hmm. From the scrolls? Ghoul Touch, Vampiric Touch, Chill touch scrolls have no learn spell button on them. Could that be another mod conflicting?

Might need to use them from a quickslot. Honestly I forget. But if another mod changes those scrolls after this one, then that might mess it up, yes. 

Link to comment

Kay. So. Testing tome and blood, I install just it on a fresh install of BG2EE. I give the character scrolls of chill touch, ghoul touch, vampiric touch. Put them in the quickslot.. Nothing. At no point can I write the scrolls to the spellbook or anywhere else. Any ideas?

I apologize if I'm being a pest.

Edited by krazedhermit
Link to comment

Hi again. I wanted to try out the "Multiclass Sorcerers" component (even if you said it is not correct working).

I saw that there are some spell included in the sorcerers spell list, which i think should not (Chaos Shield/Improved Chaos Shield) and some are not included which should (Dimension Door). And when i install other mods with new spell, these are also not castable.

Is there a file, where you can add/remove spells, before you install the component (so that they are selectable)?

I just installed the mod V0.9.13 with a blank BG2EE an noticed, that the "COMPONENT 45: Arcane Crafting" is not selectable during the installation. And i was not able to install the "Multiclass Sorcerers" component because of errors (i will install V0.9.12 of the mod until this is fixed).

SETUP-TOMEANDBLOOD.DEBUG

Link to comment
6 hours ago, stekraut said:

I just installed the mod V0.9.13 with a blank BG2EE an noticed, that the "COMPONENT 45: Arcane Crafting" is not selectable during the installation.

Ya, we've had reports that it isn't working so i disabled it for the moment.

6 hours ago, stekraut said:

And i was not able to install the "Multiclass Sorcerers" component because of errors

Whoops, looks like unlucky 13 was a dud, fixed now in v0.9.14.

15 hours ago, krazedhermit said:

I give the character scrolls of chill touch, ghoul touch, vampiric touch. Put them in the quickslot.. Nothing. At no point can I write the scrolls to the spellbook or anywhere else. Any ideas?

Looking at the code (for the first time in several years), it looks like e.g. scrl82.itm should have a 147 effect letting you learn "d5nect1.spl" which is the new innate version of Chill touch. So you should theoretically be able to learn it just like you learn other spells. s long as some other mod hasn't messed with scrl82.itm. And as long as the game lets you use opcode 147 to learn innate abilities (which I think it does, I tested this way back when...)

If you want, you can edit /tomeandblood/comp/setup_specialists.tpa and delete lines 713 to 718. Then install the mod, and you will get the innates automatically at certain levels (1/5/9, or something like that).

I think.

Link to comment
Guest RelentlessImp

Attempted a fresh install of just Tome and Blood 0.9.16, just Sorcerer content + Ability Score Spells, on both IWD:EE and BG:EE. Something funky happens now; straight Sorcerers don't get their spellcasting initialized, so they can't pick any spells. Multisorcerers get the ability, but it doesn't function, and it has a dialog.tlk error:

3nV2Wr9.jpg

(In IWD:EE it reads "Ettin".)

Link to comment

@subtledoctor do you know if the Arcanist spells work with the spell refreshment from iiSpellSystemAdjustments (resurrected igi's Spell System Adjustments mod). That mod works fine for regular mages and sorcerers in current-patch BG2EE, but afaik the Tome&Blood Arcanist is using a custom spell system (spells that activate the actual spells?). Thanks!

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...