Jump to content

Raduziel

Modders
  • Posts

    225
  • Joined

  • Last visited

Posts posted by Raduziel

  1. 4 hours ago, subtledoctor said:

    I don’t think there even are any spells in some of those categories.

    Ok, I think I understand the problem now and maybe I've expressed myself poorly.

     

    Quote

    - one array of 1st-level cleric-only spells excluded from good casters

    Taking this as an example. That's not what I'm looking for what I want is, following this example, all first-level spells that are not druid exclusive and not evil exclusive.

    Examples of such spells: Command, Magic Stone, Sanctuary...

    So maybe I need to invert the zeros and ones from the BAND part of the code?

    Edit:

    Changing to:

    	PATCH_IF (alignment BAND 0b11111011 = 0b11111011) BEGIN
    	PATCH_IF (class     BAND 0b01111111 = 0b01111111) BEGIN

    Also doesn't work...

    Edit2:

    Made a new test using BOR

    PATCH_IF (alignment BOR 0b00000100 = 0b00000100) BEGIN
    PATCH_IF (class     BOR 0b10000000 = 0b10000000) BEGIN

    Doing this the spells appear in the spellbook but too many spells, as you can see in the image attached - Change Chicken, Dark Gift, Chromatic Orb (twice), Repulse X, two versions of Entangle and Bless, Spirit Ward, a nameless spell with a Detect Evil icon, etc.

    Baldr000.png

    But that's definitely some progress, no doubt.

    Anyone with an insight of what I may be doing wrong?

    Thanks. 

  2. 3 hours ago, subtledoctor said:

    "0b00000100" represents the eight bits (the eight 1s or 0s after the 'b') in each byte.  In NI the "flags" field is 4 bytes large... but you still have to deal with each byte individually.  So for the good/evil flags you do

    
    READ_BYTE 0x1e good_evil

    and for the druid/cleric restrictions you do

    
    READ_BYTE 0x21 druid_cleric

    and deal with each one separately. 

    Like this?

    COPY_EXISTING_REGEXP ~^.+\.spl$~ override
    	PATCH_IF %SOURCE_SIZE% > 0x71 BEGIN
    	READ_SHORT 0x1c type
    	READ_LONG  0x34 level
    	READ_BYTE  0x1e alignment
    	READ_BYTE  0x21 class
    	PATCH_IF type  = 2 BEGIN
    	PATCH_IF (alignment BAND 0b00000100 = 0b00000100) BEGIN
    	PATCH_IF (class     BAND 0b10000000 = 0b10000000) BEGIN
    	PATCH_IF level = 1 BEGIN
    	SPRINT $level_one_divine(~%SOURCE_RES%~)   ~1~
    	END
    	PATCH_IF level = 2 BEGIN
    	SPRINT $level_two_divine(~%SOURCE_RES%~)   ~1~
    	END
    	PATCH_IF level = 3 BEGIN
    	SPRINT $level_three_divine(~%SOURCE_RES%~) ~1~
    	END
    	PATCH_IF level = 4 BEGIN
    	SPRINT $level_four_divine(~%SOURCE_RES%~)  ~1~
    	END
    		END
    			END
    				END
    					END
    	BUT_ONLY

     

    Still doesn't work, though.

    This will be done only twice (for Mazzy and Shar-Teel) so the eleven-arrays approach doesn't seem necessary.

  3. @subtledoctor

    Apparently it doesn't work (for adding spells at least):

    This installs smoothly but the NPC's spellbook is blank.

    COPY_EXISTING_REGEXP ~^.+\.spl$~ override
    	PATCH_IF %SOURCE_SIZE% > 0x71 BEGIN
    	READ_SHORT 0x1c type
    	READ_LONG  0x34 level
    	READ_LONG  0x1e restriction
    	PATCH_IF type  = 2 BEGIN
    	PATCH_IF (restriction BAND 0b10000100 = 0b10000100) BEGIN
    	PATCH_IF level = 1 BEGIN
    	SPRINT $level_one_divine(~%SOURCE_RES%~)   ~1~
    	END
    	PATCH_IF level = 2 BEGIN
    	SPRINT $level_two_divine(~%SOURCE_RES%~)   ~1~
    	END
    	PATCH_IF level = 3 BEGIN
    	SPRINT $level_three_divine(~%SOURCE_RES%~) ~1~
    	END
    	PATCH_IF level = 4 BEGIN
    	SPRINT $level_four_divine(~%SOURCE_RES%~)  ~1~
    	END
    		END
    			END
    				END
    	BUT_ONLY
    			
    
        COPY_EXISTING ~shartd.cre~ ~override~
          WRITE_SHORT     0x244 0
          WRITE_BYTE      0x246 "%kit%"
          WRITE_BYTE      0x247 0x40
    	  WRITE_BYTE	  0x239 0        //Exceptional Strength
    	  WRITE_BYTE	  0x23b 9        //Wisdom
    	  WRITE_BYTE	  0x23d 11       //Constitution
    	  WRITE_BYTE	  0x273 3        //Class
    	  WRITE_LONG      0x028 24592    //Animation
    	  WRITE_BYTE      0x052 20       //Thac0
    	  WRITE_BYTE      0x054 10       //Death
    	  WRITE_BYTE      0x055 14       //Wands
    	  WRITE_BYTE      0x056 13       //Paralyze
    	  WRITE_BYTE      0x057 16       //Breath
    	  WRITE_BYTE      0x058 15       //Spells
    	  PHP_EACH level_one_divine   AS spl => nul  BEGIN
    	ADD_KNOWN_SPELL ~%spl%~ #0 ~priest~
    	  END
    	  PHP_EACH level_two_divine   AS spl => nul  BEGIN
    	ADD_KNOWN_SPELL ~%spl%~ #1 ~priest~
    	  END
    	  ADD_MEMORIZED_SPELL ~CLERIC_DOOM~        #0 ~priest~ (2)
    	  ADD_MEMORIZED_SPELL ~CLERIC_FLAME_BLADE~ #1 ~priest~ (1)
    	  READ_LONG       0x2a8 spl_off
    	  READ_LONG       0x2ac spl_num
    		FOR (i = 0; i < spl_num; ++i) BEGIN
    			READ_SHORT (spl_off + i * 0x10 + 0x8) type
    			PATCH_IF (type = 0) BEGIN
    				READ_SHORT (spl_off + i * 0x10) level
    					PATCH_MATCH level WITH
    			0 BEGIN	WRITE_SHORT (spl_off + i * 0x10 + 0x2) 2 END
    			1 BEGIN	WRITE_SHORT (spl_off + i * 0x10 + 0x2) 1 END
    			DEFAULT
    			
    		END
    	END
    END
    	BUT_ONLY

    The extra "1" at 0b00000100 is to keep Druid/Shaman spells away. I also tested without it and the spellbook was empty still. Also using READ_BYTE instead of READ_LONG doesn't do the trick.

    Thanks for the help.

  4. 5 hours ago, subtledoctor said:
    
      READ_BYTE 0x1e good_evil
      PATCH_IF (good_evil BAND 0b00000100 = 0b00000100) BEGIN
        [this spell excludes Good casters]
      END
      PATCH_IF (good_evil BAND 0b00000010 = 0b00000010) BEGIN
        [this spell excludes Good casters]
      END

    I think.  That's untested but is basically how you can check specific bits in fields such as spell flags.

    I'll test it and provide feedback. If it work as I'm planning I'll pay you a beer someday.

  5. 18 minutes ago, subtledoctor said:

    Something like (sorry for the formatting, you can’t edit text tagged as code when using a mobile browser)...

    
    COPY_EXISTING_REGEXP GLOB ~[all .spl]~
    	PATCH_IF %SOURCE_SIZE% > 0x71 BEGIN
    	READ_SHORT 0x1c type
    	READ_LONG 0x34 level
    	PATCH_IF type = 2 BEGIN
    	PATCH_IF level = 1 BEGIN
    	SPRINT $level_one_divine(~%SOURCE_RES%~) ~1~
    	END
    	PATCH_IF level = 2 BEGIN
    	SPRINT $level_two_divine(~%SOURCE_RES%~) ~1~
    	END
    	[etc. levels 3-7]
    	END
    	END
    	END
    	BUT_ONLY
    	COPY_EXISTING ~this_npc.cre~ ~override~
    	PHP_EACH level_seven_divine AS spl => nul BEGIN
    	REMOVE_SPELL ~%spl%~
    	END
    	[etc. for whatever spell levels]
    	BUT_ONLY

    That will save me a lot of time, thanks!

    I will try to adapt and use it to ADD_SPELL for two NPCs but I need to add one more filter (other than type and level) that is alignment restriction - so an Evil character wouldn't receive spells like Holy Smite and a Good character wouldn't receive spells like Unholy Smite.

    I know I would need to mess with READ_LONG 0x1e (Exclusion Flags) and bits 1 (exclude Evil) and 2 (exclude Good). But... how?

    Thanks in advance!

  6. 10 minutes ago, subtledoctor said:

    Ah, it’s for an NPC. My brain read it  as an in-game ability.

    So it’s being done at install-time? That’s much easier. In that case I would just generate an array of all spells of the appropriate levels and spell type, and PHP_EACH -> REMOVE_SPELL %spell%

    Seems like an excellent solution and exactly what I'm looking for but IDK if I know how to do it to be honest. I could also use this to do the inverse (add spells) for DoF's Mazzy and Shar-Teel's component (so far the spells are added one by one).

  7. 18 minutes ago, subtledoctor said:

    I don’t quite understand the concept (magically get 10 levels of wizard experience?) but I've tried something like that, and the only way I found is to use opcode 172. Which means the mod must be installed after all other mods that add wizard spells. 

    The method is in Tome & Blood’s ‘Revised Illusionary Clones’ component... it creates a spell with a bunch of 172 effects to remove all wizard spells above level X.

    Let's say the character has 20,000 XP

    As a pureclass Cleric it would be a 5th level Cleric with access to spells up to the Third Circle.

    As a multiclass Cleric-Mage it would be a 4th level Cleric/4th level Mage with access to spells up to the Second Circle only.

    So if the "make this character a CM instead of a C" component is chosen, the Third Circle entry at the spellbook needs to be removed and its slots zeroed.

    I'm talking about removing divine spells. Arcane ones will be added by this component but that is quite easy. Removing is not that bad with REMOVE_KNOWS_SPELL but I may skip a mod-added one.

    Cheers.

  8. Hey,

    So I'm working with @Lava in a project where I'll turn a cleric into a cleric/mage.

    That means the XP will be split and some cleric levels will be lost - which mean eventually losing access to a whole spell circle.

    I do know how to remove spells one by one (quiet easy actually) but doing the way I usually do some mod-added spells may be left behind.

    SO...

    Is there a tricky to track and remove all the spells from a cleric spellbook based on the spell's level?

    Thanks in advance.

  9. On 5/5/2020 at 6:19 PM, kjeron said:

    Your assumption is correct.  You would have to make the robes usable by all clerics, then restrict all other kits from wearing them, either through op319 on the item, or op180 applied in the Kit's CLAB.  Item restrictions are all additive, you can't selectively allow an item to be used by one or two.

    Thanks for the feedback. This closes this matter.

  10. On 4/30/2020 at 5:26 PM, Necromanx2 said:

    Question for you @Raduziel. I started a Cleric of Azuth and another of Mystra. Looking at the Faiths and Avatars book, it says Azuth should be able to cast wizard spell scrolls, while Mystra can use wizard items (wands and robes). Would it be possible to give the kits these abilities?  Giving both kits the ability to use all wizard items would be a fine compromise as it would be close to the book and allow Azuth to use robes (given his no armor restriction).

    What do you think?

    EDIT: I looked at the book again and saw that in the kit descriptions for "Magical Items" they both say use all mage items, but Mystra says except scrolls while Azuth includes scrolls.

    That would be awesome - actually some other deities grants this kind of grace - but I've decided to let this aside for two reasons:

    1) Balance.

    2) Pareto Principle. A lot of effort for a small contribution - and it could also conflict with some other mods; DoF already bites a huge share of those by not being compatible with many other cleric-kit mods.

    I'll see what I can do about specifically Azuth's robes, though. I think I'll need to allow it to be wearable by all clerics and then restrict them to all kits but Azuth. If that's the case, I'll pass.

    @kjeron do you have an insight on this matter? I may be overcomplicating things.

  11. On 3/25/2020 at 2:07 AM, athies said:

    And because I'm better than making pictures than writing, I started work on her portraits to deal with writer's block 🥳 Progress is steady, and I think I'm a third ways done with critical PC/Theil talk for SOA. It's looking like there will be at least two personal encounters eventually.  

    THIEL_BL.jpg.59cb03091f651ad510d2ced0d88ab060.jpg

    Wow. that's an awesome portrait.

×
×
  • Create New...