Jump to content

why is my mod making scrolls unlearnable?


subtledoctor

Recommended Posts

I want to change the level of a couple wizard spells. E.g. make Luck into a level 1 spells instead of a level 2 spell. I figure the technique should be

1) ADD_SPELL it at level 1, so that scripts can still look for WIZARD_LUCK

2) Change any 146/147/148 effects in the Luck scroll to learn or cast the new spell instead of the old one

3) I don't know of a simple way to check whether any AI spellcasters have the old Luck spell memorized... so, because it's such an inconsequential spell anyway, just add it to every wizard in the game. Freebies for the AI.

 

But, in-game, when I install this, the scroll is not learnable. Can anyone see a problem with the code below?

//LUCK_____________________________________________________________________________
ACTION_IF FILE_EXISTS_IN_GAME ~spwi209.spl~ THEN BEGIN
 COPY_EXISTING ~spwi209.spl~ ~override~
 ADD_SPELL ~override/spwi209.spl~ 2 1 WIZARD_LUCK
  WRITE_LONG 0x34 1
END
LAF RES_NUM_OF_SPELL_NAME
  STR_VAR spell_name = ~WIZARD_LUCK~
  RET spell_res
END
ACTION_IF FILE_EXISTS_IN_GAME ~scrl93.itm~ THEN BEGIN
 COPY_EXISTING ~scrl93.itm~ ~override~
   WRITE_LONG 0x34 100
     LPF ALTER_EFFECT
      INT_VAR opcode = 146
      STR_VAR resource = EVAL ~%spell_res%~
     END
     LPF ALTER_EFFECT
      INT_VAR opcode = 147
      STR_VAR resource = EVAL ~%spell_res%~
     END
     LPF ALTER_EFFECT
      INT_VAR opcode = 148
      STR_VAR resource = EVAL ~%spell_res%~
     END
  SAY IDENTIFIED_DESC @6131
END
COPY_EXISTING_REGEXP GLOB ~^.+\.cre$~ ~override~
 PATCH_IF (SOURCE_SIZE > 0x2d3) BEGIN
  READ_BYTE 0x273 class
  PATCH_IF (class == 1 || class == 13 || class == 14 || class == 7 || class == 10 || class == 17) BEGIN // wizards
   ADD_KNOWN_SPELL ~%spell_res%~ #0 ~innate~
   ADD_MEMORIZED_SPELL ~%spell_res%~ #0 ~innate~
  END
 END
BUT_ONLY
Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...