From e356a6391be6737700f89102067dee9e7f72033d Mon Sep 17 00:00:00 2001 From: subtledoctor Date: Mon, 16 Aug 2021 18:09:52 -0400 Subject: [PATCH] 0.9.13 better spontaneous --- TomeAndBlood/README.txt | 8 +- TomeAndBlood/TomeAndBlood.tp2 | 5 +- TomeAndBlood/comp/setup_arcanist.tpa | 39 +- TomeAndBlood/comp/setup_mana_sorcerer.tpa | 207 +- TomeAndBlood/comp/setup_manasorc_2.tpa | 1038 ++++++ .../comp/setup_multiclass_sorcerers.tpa | 774 +--- TomeAndBlood/comp/setup_spell_switching.tpa | 51 +- TomeAndBlood/data/multi_sorcerers/d5zlosr.cre | Bin 0 -> 2120 bytes TomeAndBlood/lib/misc_tnb_functions.tpa | 238 +- .../lib/semi_spont/SEQUENCER_MENU.tpa | 618 ++++ TomeAndBlood/lib/semi_spont/d5lernwi.bam | Bin 0 -> 3132 bytes TomeAndBlood/lib/semi_spont/d5msorc.itm | Bin 0 -> 218 bytes TomeAndBlood/lib/semi_spont/d5msorc.spl | Bin 0 -> 202 bytes .../lib/semi_spontaneous zspla from 172.tpa | 3224 ----------------- TomeAndBlood/lib/semi_spontaneous.tpa | 3029 ++++++++++++++-- TomeAndBlood/qd_tnb_settings.ini | 7 +- 16 files changed, 4703 insertions(+), 4535 deletions(-) create mode 100644 TomeAndBlood/comp/setup_manasorc_2.tpa create mode 100644 TomeAndBlood/data/multi_sorcerers/d5zlosr.cre create mode 100644 TomeAndBlood/lib/semi_spont/SEQUENCER_MENU.tpa create mode 100644 TomeAndBlood/lib/semi_spont/d5lernwi.bam create mode 100644 TomeAndBlood/lib/semi_spont/d5msorc.itm create mode 100755 TomeAndBlood/lib/semi_spont/d5msorc.spl delete mode 100755 TomeAndBlood/lib/semi_spontaneous zspla from 172.tpa diff --git a/TomeAndBlood/README.txt b/TomeAndBlood/README.txt index f6a2d41..928d8cc 100644 --- a/TomeAndBlood/README.txt +++ b/TomeAndBlood/README.txt @@ -1,6 +1,6 @@ # TomeAndBlood -Tome And Blood: More Options for Wizards and Sorcerers v0.9.6 +Tome And Blood: More Options for Wizards and Sorcerers v0.9.13 ## Overview @@ -121,13 +121,13 @@ COMPONENT 48: Armored Casting for Bards Bards can cast spells in leather armor. -COMPONENTS 51, 52, 53, 54, 55: Innate Metamagic +COMPONENTS 51-55: Innate Metamagic The first four of these components make spell sequencers and contingencies into innate abilities (Chain Contingency becomes an HLA) so they don't cost spell slots; but "filling" them with spells still uses the spell slots associated with those spells. These four components differ according to how you get metamagic (automatically as you level up, or learned from scrolls) and whether or not sorcerers can use metamagic spells. The 5th version leaves sequencers and contingencies as spells you must memorize, but when you cast them, you "fill" them with any spell you *know,* without expending any memorization slots. -COMPONENTS 61, 62, 63: Cantrips +COMPONENTS 61-63: Cantrips Component 61 allows mages and sorcerers to use one cantrip as an innate ability with unlimited uses. @@ -172,7 +172,7 @@ The Arcanist's preparation slots are governed by MXSPLWIZ.2da; any changes you m *DO NOT* install this component if you are going to use the broader 5E Spellcasting mod. -COMPONENT 80: Mana Sorcerer +COMPONENT 85: Mana Sorcerer This component gives sorcerers (only unkitted sorcerers, for now) an innate ability to use mana points to cast spells instead of spell-level-based casting slots. Your known spells will be the same (you must choose them manually from an item ability) but you will have a pool of mana points instead of spell slots. Casting a spell costs as many points as its spell level; you will start with ~2 mana points and can progress to as many as 120, at level 25. While more flexible, this is generally less firepower than a normal sorcerer has if you tally up their spell slots; so the Mana Sorcerer has a Restorative Meditation innate ability that can be used between fights, which will restore one half of the points you recently spent, rounded down. diff --git a/TomeAndBlood/TomeAndBlood.tp2 b/TomeAndBlood/TomeAndBlood.tp2 index 684e678..aeea2cf 100755 --- a/TomeAndBlood/TomeAndBlood.tp2 +++ b/TomeAndBlood/TomeAndBlood.tp2 @@ -1,6 +1,6 @@ BACKUP ~TomeAndBlood/backup~ AUTHOR ~aquadrizzt~ -VERSION ~0.9.12~ +VERSION ~0.9.13~ ALWAYS @@ -250,6 +250,7 @@ LAF revised_specialists END BEGIN @45 DESIGNATED 45 REQUIRE_PREDICATE (GAME_IS ~bgee bg2ee iwdee eet~) @2 +DEPRECATED @4 //GROUP @7 COPY_EXISTING ~sw1h01.itm~ ~override/qdtnb_crafting.qd~ //detection for this component @@ -556,7 +557,7 @@ LAF mana_sorcerer END BEGIN @93 DESIGNATED 93 REQUIRE_PREDICATE (FILE_EXISTS_IN_GAME ~enginest.2da~) @3 -REQUIRE_PREDICATE (MOD_IS_INSTALLED ~tomeandblood.tp2~ ~80~) OR (MOD_IS_INSTALLED ~tomeandblood.tp2~ ~82~) @1 +REQUIRE_PREDICATE (MOD_IS_INSTALLED ~tomeandblood.tp2~ ~80~) OR (MOD_IS_INSTALLED ~tomeandblood.tp2~ ~82~) @4 //GROUP @7 COPY_EXISTING ~sw1h01.itm~ ~override/qdtnb_slotitm.qd~ //detection for this component diff --git a/TomeAndBlood/comp/setup_arcanist.tpa b/TomeAndBlood/comp/setup_arcanist.tpa index 29daa8e..cbb4ac4 100755 --- a/TomeAndBlood/comp/setup_arcanist.tpa +++ b/TomeAndBlood/comp/setup_arcanist.tpa @@ -100,6 +100,18 @@ END // OUTER_SET arcanist_code = (0x4000 + %D5_ARCANIST%) +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 + //KIT ABILITIES______________________________________________________________________ COPY ~tomeandblood/data/arcanist/d5acnst.2da~ ~override~ @@ -121,10 +133,11 @@ COPY ~tomeandblood/data/arcanist/d5cstarc.2da~ ~override~ LPF arcane_casting_slots STR_VAR table_spl = ~d5zltac~ END BUT_ONLY +COPY_EXISTING ~d5zprpd.spl~ ~override~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %arcanist_code% parameter2 = %kit_is_row% timing = 1 STR_VAR resource = ~d5zltacz~ END + APPEND ~d5acnst.2da~ ~SPELL_INIT AP_D5ZZ000 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** -LESSPREP AP_D5Z0SLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** -NO_ASPLS AP_D5Z0SPL **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** -CST_SLTS AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC AP_D5ZLTAC ~ UNLESS ~AP_D5ZZ000~ +NO_ASPLS AP_D5Z0SPL **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ ACTION_IF (MOD_IS_INSTALLED ~tomeandblood.tp2~ ~62~) BEGIN // L1 cantrips COPY_EXISTING ~d5zltac.spl~ ~override~ @@ -142,26 +155,6 @@ ACTION_IF (MOD_IS_INSTALLED ~tomeandblood.tp2~ ~62~) BEGIN // L1 cantrips IF_EXISTS BUT_ONLY END -//splprot kit check___________________________________________________________________ -// -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 - -//patch spell refresh_________________________________________________________________ -// -COPY_EXISTING ~d5zprpd.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %arcanist_code% parameter2 = %kit_is_row% timing = 1 STR_VAR resource = ~d5zltac~ END -IF_EXISTS BUT_ONLY - //KIT DESCRIPTION PATCHES_____________________________________________________________ // diff --git a/TomeAndBlood/comp/setup_mana_sorcerer.tpa b/TomeAndBlood/comp/setup_mana_sorcerer.tpa index 61ce281..981971b 100644 --- a/TomeAndBlood/comp/setup_mana_sorcerer.tpa +++ b/TomeAndBlood/comp/setup_mana_sorcerer.tpa @@ -224,9 +224,6 @@ END //add spell slot stat checks to SPLPROT_______________________________________________ // -//APPEND ~splprot.2da~ ~D5_MANA_PTS%TAB%109%TAB%-1%TAB%7~ UNLESS ~D5_MANA_PTS~ -//APPEND ~splprot.2da~ ~D5_MANA_LESS%TAB%109%TAB%-1%TAB%2~ UNLESS ~D5_MANA_LESS~ - APPEND ~splprot.2da~ ~D5_TRKNG_PTS%TAB%33%TAB%-1%TAB%7~ UNLESS ~D5_TRKNG_PTS~ APPEND ~splprot.2da~ ~D5_TRKNG_LESS%TAB%33%TAB%-1%TAB%2~ UNLESS ~D5_TRKNG_LESS~ APPEND ~splprot.2da~ ~D5_FATIGUE_IS%TAB%30%TAB%-1%TAB%1~ UNLESS ~D5_FATIGUE_IS~ @@ -236,14 +233,6 @@ COPY_EXISTING ~splprot.2da~ ~override~ 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_MANA_PTS~ BEGIN - SET mana_points = %row% - END - PATCH_IF ~%stat%~ STRING_EQUAL_CASE ~D5_MANA_LESS~ BEGIN - SET mana_less = %row% - END -*/ PATCH_IF ~%stat%~ STRING_EQUAL_CASE ~D5_TRKNG_PTS~ BEGIN SET tracking_points = %row% END @@ -256,8 +245,7 @@ COPY_EXISTING ~splprot.2da~ ~override~ END BUT_ONLY - -/* +/* might not need this //mana caster spellstate______________________________________________________________ // ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_MANA_ARCANE~)) BEGIN @@ -273,18 +261,37 @@ ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_MANA_ARCANE~)) BEGIN END BUT_ONLY END -/* -ACTION_IF !(FILE FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_MANA_ARCANE~)) BEGIN - LAF d5_resolve_state STR_VAR new_state_id = ~D5_MANA_ARCANE~ RET new_state_ind END - OUTER_SET mana_caster_arcane = %new_state_ind% -END -*/ + ACTION_IF !(VARIABLE_IS_SET %mana_caster_arcane%) BEGIN LAF d5_resolve_state STR_VAR new_state_id = ~D5_MANA_ARCANE~ RET new_state_ind END OUTER_SET mana_caster_arcane = %new_state_ind% END */ +/* +to do: + +- use same innates as multisorc +- use same refresh +- on choose to cast via mana: +- make immune to xspls +-- (add 318 effect to xspls exempting manasorc state) +- alter_effect xrfsh from "parameter1 = %semi_sorc_state% parameter2 = 110" to "parameter1 = %manasorc_state% parameter2 = 111" to cast xspls +-- ditto for every innate clone; and also add 326 casting xsplm if state=manasorc +-- ditto for every seq_menu spell +- make alt version: xsplm +- make alt versions of xwot etc. (xmot?) +- make immune to everything that starts with "d5src" +- make immune to xstts +- apply xsttm (adds manasorc state) +- make version of slots spell that uses tracking (xltmn?) +- apply xx000 + +hopefully using 146 and spells doesn't slow things down... + +*/ + + //remove all mage spell slots_________________________________________________________ // COPY ~tomeandblood/lib/d5_base.spl~ ~override/d50wslt.spl~ @@ -309,6 +316,10 @@ NOSLOTS AP_D50WSLT **** **** **** **** **** //create advance copies of some spells________________________________________________ // COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5ms206.spl~ +COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5ms206x.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5ms206~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5ms206x~ END + //COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5ms318.spl~ COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5mpts1.spl~ @@ -449,6 +460,117 @@ END APPEND ~d5_zmana.2da~ ~MANA_PTS AP_D5MAN2A AP_D5MAN2B AP_D5MAN2C AP_D5MAN2D AP_D5MAN2E AP_D5MAN4A AP_D5MAN4B AP_D5MAN4C AP_D5MAN4D AP_D5MAN4E AP_D5MAN6A AP_D5MAN6B AP_D5MAN6C AP_D5MAN6D AP_D5MAN6E AP_D5MAN8A AP_D5MAN8B AP_D5MAN8C AP_D5MAN8D AP_D5MAN8E AP_D5MAN3A AP_D5MAN3B AP_D5MAN3C AP_D5MAN3D AP_D5MAN3E **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ +//set up spell learn UI screens_______________________________________________________ +// +COPY ~tomeandblood/lib/d5_base.spl~ ~override/d50wspl.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~SPWI908~ END + PATCH_IF !(MOD_IS_INSTALLED ~TomeAndBlood.tp2~ ~16~) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = ~SPWI110~ END + END + PATCH_IF !(MOD_IS_INSTALLED ~TomeAndBlood.tp2~ ~55~) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~SPWI420~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~SPWI710~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~SPWI809~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~SPWI617~ END + END + +// mana sorcerer spell-choice list +<<<<<<<< d5/d5mnsrc.2da +2DA V1.0 +**** + ResRef Type>>>>>>>> +COPY ~d5/d5mnsrc.2da~ ~override/d5mnsrc.2da~ + +// mana sorcerer spell system legend +<<<<<<<< d5/d5clonmn.2da +2DA V1.0 +SPLRES + 206 LEARN EFF INNATE DISPLAY SWITCH SWITCH2 +>>>>>>>> +COPY ~d5/d5clonmn.2da~ ~override/d5clonmn.2da~ + +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 ~this_spell~ ~%SOURCE_RES%~ + READ_STRREF NAME1 spell_name + READ_STRREF UNIDENTIFIED_DESC spell_description + READ_ASCII 0x3a spell_icon + PATCH_IF (FILE_CONTAINS_EVALUATED (~spell.ids~ ~2%spell_num%~)) BEGIN + INNER_PATCH_SAVE mana_206_spell ~%SOURCE_RES%~ BEGIN + REPLACE_TEXTUALLY ~^[Ss][Pp][Ww][Ii]~ ~d5m6~ + END + INNER_PATCH_SAVE mana_learn_spell ~%SOURCE_RES%~ BEGIN +// REPLACE_TEXTUALLY ~^[Ss][Pp][Ww][Ii]~ ~d5mx~ + REPLACE_TEXTUALLY ~%SOURCE_RES%~ ~%SOURCE_RES%M~ + END + INNER_PATCH_SAVE mana_innate_spell ~%SOURCE_RES%~ BEGIN + REPLACE_TEXTUALLY ~^[Ss][Pp][Ww][Ii]~ ~d5m4~ + END + INNER_PATCH_SAVE mana_spell_eff ~%SOURCE_RES%~ BEGIN + REPLACE_TEXTUALLY ~^[Ss][Pp][Ww][Ii]~ ~D5MV~ + END + INNER_PATCH_SAVE 172_spell ~%SOURCE_RES%~ BEGIN + REPLACE_TEXTUALLY ~^[Ss][Pp][Ww][Ii]~ ~d5sz~ + END + INNER_PATCH_SAVE mana_172_subspell ~%SOURCE_RES%~ BEGIN + REPLACE_TEXTUALLY ~^[Ss][Pp][Ww][Ii]~ ~d5mz~ + END + INNER_ACTION BEGIN + APPEND ~d5mnsrc.2da~ ~manasorc %this_spell% 3~ + APPEND ~d5clonmn.2da~ ~%this_spell% %mana_206_spell% %mana_learn_spell% %mana_spell_eff% %mana_innate_spell% %this_spell% %172_spell% %mana_172_subspell% ~ +// make learn spells + COPY ~tomeandblood/lib/d5_base.spl~ ~override/%this_spell%M.spl~ + WRITE_EVALUATED_ASCII 0x3a ~%spell_icon%~ #8 + LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 171 target = 1 timing = 9 STR_VAR resource = EVAL ~%this_spell%~ END +// remove all known spells after chargen + COPY_EXISTING ~d50wspl.spl~ ~override~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~%this_spell%~ END + END + END + END + END + END +BUT_ONLY + +//ACTION_IF !(FILE_EXISTS_IN_GAME ~d5mnsrcX.2da~) BEGIN + + COPY_EXISTING ~d5msorc.2da~ ~override/d5mnsrc.2da~ + + INCLUDE ~tomeandblood/lib/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 = ~d5mnsrc~ + spelllist = ~d5mnsrc~ + spelltable = ~QD_SPLSRCKN~ + icon = ~spcl919b~ + title = ~Spell Selection~ + label = ~Select a spell to learn~ + subspell = ~M~ + END + +COPY_EXISTING ~d5mnsrc.2da~ ~override/d5mnsrcX.2da~ + +//END + + //initialize ability and learn item___________________________________________________ // COPY ~tomeandblood/data/multi_sorcerers/d5msorc.itm~ ~override/d5mana.itm~ // learn spells .itm @@ -469,10 +591,12 @@ COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5mana.spl~ APPEND ~d5_zmana.2da~ ~LEARNSPLS GA_D5MANA **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ - -//set up spell learn UI screens_______________________________________________________ -// -LAF sorcerer_spell_learning END +ACTION_IF (FILE_EXISTS_IN_GAME ~d5mnsrc.spl~) BEGIN + COPY_EXISTING ~d5mnsrc.spl~ ~override~ + LPF DELETE_EFFECT INT_VAR match_opcode = 171 STR_VAR match_resource = ~d5mnsrc~ END + LPF DELETE_EFFECT INT_VAR match_opcode = 172 STR_VAR match_resource = ~d5mnsrc~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 power = 0 parameter2 = 1 timing = 1 STR_VAR resource = ~d5ms206x~ END +END //make mana clone spells______________________________________________________________ @@ -499,6 +623,8 @@ COPY_EXISTING ~d5clonmn.2da~ ~override~ // make innates with cloned spell effects ACTION_IF NOT FILE_EXISTS_IN_GAME ~%innate_spell%.spl~ BEGIN COPY_EXISTING ~%spell_res%.spl~ ~override/%innate_spell%.spl~ + SAY NAME1 ~~ +// SAY UNIDENTIFIED_DESC ~~ WRITE_SHORT 0x1c 4 WRITE_LONG 0x34 spell_level SET one_level_less = (spell_level - 1) @@ -640,6 +766,7 @@ COPY_EXISTING ~d5clonmn.2da~ ~override~ END // make learn spells canceling the 206 COPY ~tomeandblood/lib/d5_base.spl~ ~override/%learn_spell%.spl~ + SAY NAME1 ~%spell_name%~ WRITE_EVALUATED_ASCII 0x3a ~%spell_icon%~ #8 LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~%206_spell%~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5ms206~ END @@ -648,6 +775,7 @@ COPY_EXISTING ~d5clonmn.2da~ ~override~ LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter1 = 0 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5msplz~ END // make copy of learn spell for kjeron's UI system (eventually, just rename the learn spell to this name) // COPY_EXISTING ~%learn_spell%.spl~ ~override/%spell_res%N.spl~ +/* exempt from spell switching, until incorporated with the new multisorc system // add subspell to switch spell ACTION_IF (FILE_EXISTS_IN_GAME ~%switch_spell%.spl~) BEGIN COPY ~tomeandblood/lib/d5_base.spl~ ~override/%switch_subspell%.spl~ @@ -659,9 +787,15 @@ COPY_EXISTING ~d5clonmn.2da~ ~override~ LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%switch_subspell%~ END BUT_ONLY END +*/ // add 172 to d5msplz# COPY_EXISTING ~d5msplz.spl~ ~override~ LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~%innate_spell%~ END +// remove all known spells after chargen + COPY_EXISTING ~d50wspl.spl~ ~override~ + LPF DELETE_EFFECT INT_VAR match_opcode = 172 STR_VAR match_resource = EVAL ~%spell_res%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 1 STR_VAR resource = EVAL ~%spell_res%~ END + IF_EXISTS // generate slot#x spells // ***** this all needs to change... not exactly sure how! COPY_EXISTING ~d5mpts1.spl~ ~override~ @@ -720,33 +854,6 @@ COPY_EXISTING ~d5clonmn.2da~ ~override~ END BUT_ONLY -//set up spell learn UI screens_______________________________________________________ -// -//ACTION_IF !(FILE_EXISTS_IN_GAME ~d5mnsrcX.2da~) BEGIN - -// COPY_EXISTING ~d5msorc.2da~ ~override/d5mnsrc.2da~ - - INCLUDE ~tomeandblood/lib/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 = ~d5mnsrc~ - spelllist = ~d5mnsrc~ - spelltable = ~QD_SPLSRCKN~ - icon = ~spcl919b~ - title = ~Spell Selection~ - label = ~Select a spell to learn~ - subspell = ~M~ - END - -COPY_EXISTING ~d5mnsrc.2da~ ~override/d5mnsrcX.2da~ - -//END - //remove known spells right after chargen_____________________________________________ // diff --git a/TomeAndBlood/comp/setup_manasorc_2.tpa b/TomeAndBlood/comp/setup_manasorc_2.tpa new file mode 100644 index 0000000..bfe1ddb --- /dev/null +++ b/TomeAndBlood/comp/setup_manasorc_2.tpa @@ -0,0 +1,1038 @@ +//__________________________________________________________________________________ +//__________________________________________________________________________________ +// +// MANA POINT SORCERER +//__________________________________________________________________________________ +//__________________________________________________________________________________ + + +// to expand this to every sorcerer: +// ...ADD_KIT_EX to clone all sorcerer kits to a mage kits +// ...append mana.2da +// - ...give each sorcerer kit the 'change method' ability +// - ...have the script change each kit to its mana clone +// ...figure out multisorc later + + +DEFINE_ACTION_FUNCTION mana_sorcerer BEGIN + + +ACTION_IF (FILE_EXISTS_IN_GAME ~5E_casting_settings.ini~) BEGIN + INCLUDE ~override/5E_casting_settings.ini~ +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~5E_casting_settings.ini~) BEGIN + INCLUDE ~%MOD_FOLDER%/lib/semi_spont/5E_casting_settings.ini~ +END + +LAM 5E_casting_settings + +//INCLUDE ~tomeandblood/lib/qd_multiclass.tpa~ + + +//go________________________________________________________________________________ +// +<<<<<<<< d5/d5_mana.2da +2DA V1.0 +**** + 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 +ABILITY **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +>>>>>>>> +COPY ~d5/d5_mana.2da~ ~override/d5_mana.2da~ + +<<<<<<<< d5/d5_zmana.2da +ABILITY **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +>>>>>>>> +COPY ~d5/d5_zmana.2da~ ~override/d5_zmana.2da~ + +//__________________________________________________________________________________ + +LAF check_kit_conflict END + +ADD_KIT ~D5_MANA_SORCERER~ + +//WEAPON PROFICIENCIES________________________________________________________________ +//11 T S F Q S S +//10 L S W C L U W I +//9 A M B L S O I W A A O N +//8 R A A O H H M A I R C S R G +//7 G L M S N O A I R H L T R L H 2 D L 2 E E E E E E E E E E E +//6 E L S I T G R N K T D H A M E O O O H A E W E E E E E E E E X X X X X X X X X X X +//5 S S S B P S A S T D A A A A S L O R S N R S A N W E X X X X X X X X T T T T T T T T T T T +//4 W W P L I S R W S E T R G M C P B R M S S G T D L N D E A T T T T T T T T R R R R R R R R R R R +//3 O O B E U K A I D O W A D A W G M L E E N A T B B B A I D S A P R R R R R R R R A A A A A A A A A A A +//2 R R O A N E X L S R O X S N A E E U A R I C A O O O R N E H P O A A A A A A A A 1 1 1 1 1 1 1 1 1 1 2 +//1 D D W R T D E E W D R E W A K R R B R D N E F W W W T G D I O N 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 +~D5_MANA_SORCERER 0 0 0 0 0 0 0 0~ +~D5_MANA_SORCERER 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0~ + +//MINIMUM KIT STATS_________________________________________________________________ +// STR DEX CON INT WIS CHR +~D5_MANA_SORCERER 0 0 0 0 0 0~ + +//KIT STAT MODIFIERS________________________________________________________________ +// STR DEX CON INT WIS CHR +~D5_MANA_SORCERER 0 0 0 0 0 0~ + +//REQUIREMENTS TO DUAL TO THIS KIT_________________________________________________ +// STR DEX CON INT WIS CHR +~D5_MANA_SORCERER 0 0 0 0 0 0~ + +//REQUIREMENTS TO DUAL FROM THIS KIT________________________________________________ +// STR DEX CON INT WIS CHR +~D5_MANA_SORCERER 0 0 0 0 0 0~ + +//ALIGNMENT RESTRICTIONS____________________________________________________________ +// LG LN LE NG TN NE CG CN CE +~D5_MANA_SORCERER 1 1 1 1 1 1 1 1 1~ + +//DUAL CLASS OPTIONS________________________________________________________________ +// FT CL MA TH DR RA +~D5_MANA_SORCERER 0 0 0 0 0 0~ + +//KIT ABILITIES 2DA FILE______________________________________________________________ +~override/d5_mana.2da~ + +//RACIAL KIT AVAILABILITY_____________________________________________________________ +~~ + +//UNUSABLE FLAGS AND KIT BASE CLASS_________________________________________________ +//CLASSES: Mage = 1, Fighter = 2, Cleric = 3, Thief = 4, Bard = 5 +// Paladin 6, Druid = 11, Ranger = 12, Sorcerer = 19 +// Monk = 20, FC = 8, CT = 15, CR = 18, FM = 7, CM = 14, MT = 13 +~0x00020000 1~ + +//HIGH LEVEL ABILITIES ABBREVIATION_________________________________________________ +~So0~ + +//TOB STARTING EQUIPMENT_____________________________________________________________ +~CHAN09 * HELM07 BAG26 RING06 RING31 * BOOT01 AMUL20 BRAC10 BELT06 AROW11,40 BULL03,40 BOLT06,40 POTN52,5 POTN04,2 POTN14,5 HAMM07 SW1H27 STAF08~ + +//CHARACTER CREATION KIT DESCRIPTION________________________________________________ +SAY @17081 +SAY @17082 +SAY @17083 + +//EE KIT EXTRAS_____________________________________________________________________ +// +ACTION_IF GAME_IS ~bgee bg2ee eet iwdee~ THEN BEGIN + LAF fl#add_kit_ee + INT_VAR + briefdesc = RESOLVE_STR_REF (@17083) + STR_VAR + kit_name = D5_MANA_SORCERER + clswpbon = ~0 0 3~ + hpclass = ~HPWIZ~ + clsrcreq = ~0 0 0 0 0 0 0~ + END +END + + +//class/kit switch__________________________________________________________________ +// +COPY ~tomeandblood/data/mana_sorcerer/d5ymana.spl~ ~override~ +COPY ~tomeandblood/data/mana_sorcerer/d5ymana.eff~ ~override~ + +COPY ~tomeandblood/data/mana_sorcerer/d5msplbk.bam~ ~override~ +COPY ~tomeandblood/data/mana_sorcerer/d5zmana.spl~ ~override~ + SAY NAME1 @17085 + SAY UNIDENTIFIED_DESC @17085 + LPF ALTER_SPELL_HEADER INT_VAR target = 5 location = 4 STR_VAR icon = ~d5msplbk~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = ~d5zmana~ END +COPY ~tomeandblood/data/mana_sorcerer/d5zmana.eff~ ~override~ +COPY ~tomeandblood/data/mana_sorcerer/d5zmana.cre~ ~override~ +COMPILE ~tomeandblood/data/mana_sorcerer/d5zmana.baf~ +COMPILE ~tomeandblood/data/mana_sorcerer/d5zmana.d~ + +ACTION_IF (NOT FILE_EXISTS_IN_GAME ~clabma01.2da~) THEN BEGIN + COPY ~tomeandblood/data/core/BLANKCLAB.2da~ ~override/clabma01.2da~ //generate undefined clab file +END + +APPEND ~clabma01.2da~ ~SWITCH AP_D5YMANA **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ + + +//KIT DESCRIPTION PATCHES_____________________________________________________________ +// +OUTER_SPRINT advantages @1006 +OUTER_SPRINT abilities @1007 +OUTER_SPRINT disadvantages @1008 +OUTER_SPRINT restrictions @1009 +OUTER_SPRINT tra_21985 @21985 +OUTER_SPRINT tra_21986 @21986 + +COPY_EXISTING ~kitlist.2da~ ~override~ + COUNT_2DA_ROWS 9 rows + FOR (row = 3; row < rows; row += 1) BEGIN + READ_2DA_ENTRY row 5 9 kit_clab + READ_2DA_ENTRY row 4 9 kit_desc + PATCH_IF (~%kit_clab%~ STRING_EQUAL_CASE ~d5_mana~) BEGIN + SET desc = %kit_desc% + PATCH_IF (IS_AN_INT %desc%) BEGIN + PATCH_IF !(FILE_EXISTS_IN_GAME ~qdtnb_identify.qd~) BEGIN + GET_STRREF %desc% kit_description + INNER_PATCH_SAVE kit_description ~%kit_description%~ BEGIN + REPLACE_TEXTUALLY ~%restrictions%~ ~%tra_21986%~ + REPLACE_TEXTUALLY ~%disadvantages%~ ~%tra_21986%~ + END + INNER_ACTION BEGIN + STRING_SET_EVALUATE %kit_desc% ~%kit_description%~ + END + END + PATCH_IF !(MOD_IS_INSTALLED ~tomeandblood.tp2~ ~55~) BEGIN // innate sequencers + GET_STRREF %desc% kit_description + INNER_PATCH_SAVE kit_description ~%kit_description%~ BEGIN + REPLACE_TEXTUALLY ~%restrictions%~ ~%tra_21985%~ + REPLACE_TEXTUALLY ~%disadvantages%~ ~%tra_21986%~ + END + INNER_ACTION BEGIN + STRING_SET_EVALUATE %kit_desc% ~%kit_description%~ + END + END + END + END + END +BUT_ONLY + + +//make all spells unusable by the mage kit__________________________________________ +// +// set usability to beastmaster kit above +// set flag on all wizard spells, here +// +COPY_EXISTING_REGEXP GLOB ~^.+\.spl$~ ~override~ + PATCH_IF (SOURCE_SIZE > 0x71) BEGIN + READ_SHORT 0x1c spell_type + READ_LONG 0x34 spell_level + PATCH_IF (spell_type = 1) && (spell_level > 0) BEGIN +// READ_BYTE 0x20 exclude_3 + WRITE_BYTE 0x20 (THIS BOR 0b00000010) + END + END +IF_EXISTS BUT_ONLY + + +//get kit identifiers_________________________________________________________________ +// +OUTER_SET mana_sorcerer_code = (0x4000 + %D5_MANA_SORCERER%) + + +//known spells table__________________________________________________________________ +// +ACTION_IF !(FILE_EXISTS_IN_GAME ~QD_SPLSRCKN.2da~) BEGIN + COPY_EXISTING ~SPLSRCKN.2da~ ~override/QD_SPLSRCKN.2da~ //save a copy of the existing sorcerer spell progression +END + + +//add spell slot stat checks to SPLPROT_______________________________________________ +// +APPEND ~splprot.2da~ ~D5_TRKNG_PTS%TAB%33%TAB%-1%TAB%7~ UNLESS ~D5_TRKNG_PTS~ +APPEND ~splprot.2da~ ~D5_TRKNG_LESS%TAB%33%TAB%-1%TAB%2~ UNLESS ~D5_TRKNG_LESS~ +APPEND ~splprot.2da~ ~D5_FATIGUE_IS%TAB%30%TAB%-1%TAB%1~ UNLESS ~D5_FATIGUE_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_TRKNG_PTS~ BEGIN + SET tracking_points = %row% + END + PATCH_IF ~%stat%~ STRING_EQUAL_CASE ~D5_TRKNG_LESS~ BEGIN + SET tracking_less = %row% + END + PATCH_IF ~%stat%~ STRING_EQUAL_CASE ~D5_FATIGUE_IS~ BEGIN + SET fatigue_value = %row% + END + END +BUT_ONLY + +/* might not need this +//mana caster spellstate______________________________________________________________ +// +ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_MANA_ARCANE~)) BEGIN + COPY_EXISTING ~splstate.ids~ ~override~ + COUNT_2DA_COLS cols + READ_2DA_ENTRIES_NOW rows cols + FOR (row = 1; row < rows; ++row) BEGIN + READ_2DA_ENTRY_FORMER rows row 1 ~state_name~ + READ_2DA_ENTRY_FORMER rows row 0 ~state_ind~ + PATCH_IF (~%state_name%~ STRING_EQUAL_CASE ~D5_MANA_ARCANE~) BEGIN + SET mana_caster_arcane = %state_ind% + END + END + BUT_ONLY +END + +ACTION_IF !(VARIABLE_IS_SET %mana_caster_arcane%) BEGIN + LAF d5_resolve_state STR_VAR new_state_id = ~D5_MANA_ARCANE~ RET new_state_ind END + OUTER_SET mana_caster_arcane = %new_state_ind% +END +*/ + +/* +to do: + +- use same innates as multisorc +- use same refresh +- on choose to cast via mana: +- make immune to xspls +-- (add 318 effect to xspls exempting manasorc state) +- alter_effect xrfsh from "parameter1 = %semi_sorc_state% parameter2 = 110" to "parameter1 = %manasorc_state% parameter2 = 111" to cast xspls +-- ditto for every innate clone; and also add 326 casting xsplm if state=manasorc +-- ditto for every seq_menu spell +- make alt version: xsplm +- make alt versions of xwot etc. (xmot?) +- make immune to everything that starts with "d5src" +- make immune to xstts +- apply xsttm (adds manasorc state) +- make version of slots spell that uses tracking (xltmn?) +- apply xx000 + +hopefully using 146 and spells doesn't slow things down... + +*/ + + +//remove all mage spell slots_________________________________________________________ +// +COPY ~tomeandblood/lib/d5_base.spl~ ~override/d50wslt.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 42 target = 1 parameter1 = (0 - 1) parameter2 = 511 timing = 9 END +BUT_ONLY + +APPEND ~d5_zmana.2da~ ~NOSLOTS AP_D50WSLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +NOSLOTS AP_D50WSLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +NOSLOTS AP_D50WSLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +NOSLOTS AP_D50WSLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +NOSLOTS AP_D50WSLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +NOSLOTS AP_D50WSLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +NOSLOTS AP_D50WSLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +NOSLOTS AP_D50WSLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +NOSLOTS AP_D50WSLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +NOSLOTS AP_D50WSLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +NOSLOTS AP_D50WSLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +NOSLOTS AP_D50WSLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +~ + + +//create advance copies of some spells________________________________________________ +// +COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5ms206.spl~ +COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5ms206x.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5ms206~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5ms206x~ END + +//COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5ms318.spl~ + +COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5mpts1.spl~ +COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5mpts2.spl~ + +/* +need to check for bit-equality, but apply the bit's underlying value in 233 +1+2+4+8+16+32+64 = 7 bits to provide up to 127 points +so 7 spells to check for bit-equality +7 patches in the big function +each with a number of .eff effects matching their value, up to 64 +seems doable + +OUTER_FOR (pts = 1; pts < 75; ++pts) BEGIN + COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5mpts%pts%.spl~ +END + +COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5mnplz.spl~ + FOR (pts = 1; pts < 75; ++pts) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (%pts%) parameter2 = %tracking_points% timing = 1 STR_VAR resource = EVAL ~d5mpts%pts%~ END + END +*/ + +// ***** need to make these for each spell level, and add appropriate .effs to each, + +COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5mpts1.spl~ +COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5mpts2.spl~ +COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5mpts3.spl~ +COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5mpts4.spl~ +COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5mpts5.spl~ +COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5mpts6.spl~ +COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5mpts7.spl~ + +COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5msplz.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 1 parameter2 = %tracking_points% timing = 9 STR_VAR resource = ~d5mpts1~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 2 parameter2 = %tracking_points% timing = 9 STR_VAR resource = ~d5mpts2~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 4 parameter2 = %tracking_points% timing = 9 STR_VAR resource = ~d5mpts3~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 8 parameter2 = %tracking_points% timing = 9 STR_VAR resource = ~d5mpts4~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 16 parameter2 = %tracking_points% timing = 9 STR_VAR resource = ~d5mpts5~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 32 parameter2 = %tracking_points% timing = 9 STR_VAR resource = ~d5mpts6~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 64 parameter2 = %tracking_points% timing = 9 STR_VAR resource = ~d5mpts7~ END + + +//assign stats for mana points _______________________________________________________ +// +// Points = (stat 33) +// +/* +ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5mana1.spl~ BEGIN + ACTION_FOR_EACH num IN ~1~ ~2~ ~3~ ~4~ ~6~ ~7~ ~8~ ~9~ BEGIN + COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5mana%num%.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = %num% parameter2 = 0 timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5mana%let%~ END + END +END +*/ +ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5man2a.spl~ BEGIN + ACTION_FOR_EACH let IN ~a~ ~b~ ~c~ ~d~ ~e~ /*~f~ ~g~ ~h~ ~i~ ~j~ ~k~ ~l~ ~m~ ~n~ ~o~ ~p~ ~q~ ~r~ ~s~ ~t~*/ BEGIN + COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5man2%let%.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = 2 parameter2 = 0 timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5man2%let%~ END + END +END +ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5man3a.spl~ BEGIN + ACTION_FOR_EACH let IN ~a~ ~b~ ~c~ ~d~ ~e~ /*~f~ ~g~ ~h~ ~i~ ~j~ ~k~ ~l~ ~m~ ~n~ ~o~ ~p~ ~q~ ~r~ ~s~ ~t~*/ BEGIN + COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5man3%let%.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = 3 parameter2 = 0 timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5man3%let%~ END + END +END +ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5man4a.spl~ BEGIN + ACTION_FOR_EACH let IN ~a~ ~b~ ~c~ ~d~ ~e~ /*~f~ ~g~ ~h~ ~i~ ~j~ ~k~ ~l~ ~m~ ~n~ ~o~ ~p~ ~q~ ~r~ ~s~ ~t~*/ BEGIN + COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5man4%let%.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = 4 parameter2 = 0 timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5man4%let%~ END + END +END +ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5man6a.spl~ BEGIN + ACTION_FOR_EACH let IN ~a~ ~b~ ~c~ ~d~ ~e~ /*~f~ ~g~ ~h~ ~i~ ~j~ ~k~ ~l~ ~m~ ~n~ ~o~ ~p~ ~q~ ~r~ ~s~ ~t~*/ BEGIN + COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5man6%let%.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = 6 parameter2 = 0 timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5man6%let%~ END + END +END +ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5man8a.spl~ BEGIN + ACTION_FOR_EACH let IN ~a~ ~b~ ~c~ ~d~ ~e~ /*~f~ ~g~ ~h~ ~i~ ~j~ ~k~ ~l~ ~m~ ~n~ ~o~ ~p~ ~q~ ~r~ ~s~ ~t~*/ BEGIN + COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5man8%let%.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = 8 parameter2 = 0 timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5man8%let%~ END + END +END + +ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5man-1.spl~ BEGIN + COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5man-1.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = (0 - 1) parameter2 = 0 timing = 0 duration = 126144000 END + COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5man_1.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = (0 - 1) parameter2 = 0 timing = 0 duration = 126144000 END +END +ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5man-2.spl~ BEGIN + COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5man-2.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = (0 - 2) parameter2 = 0 timing = 0 duration = 126144000 END + COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5man_2.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = (0 - 2) parameter2 = 0 timing = 0 duration = 126144000 END +END +ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5man-3.spl~ BEGIN + COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5man-3.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = (0 - 3) parameter2 = 0 timing = 0 duration = 126144000 END + COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5man_3.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = (0 - 3) parameter2 = 0 timing = 0 duration = 126144000 END +END +ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5man-4.spl~ BEGIN + COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5man-4.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = (0 - 4) parameter2 = 0 timing = 0 duration = 126144000 END + COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5man_4.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = (0 - 4) parameter2 = 0 timing = 0 duration = 126144000 END +END +ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5man-5.spl~ BEGIN + COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5man-5.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = (0 - 5) parameter2 = 0 timing = 0 duration = 126144000 END +END +ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5man-6.spl~ BEGIN + COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5man-6.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = (0 - 6) parameter2 = 0 timing = 0 duration = 126144000 END +END +ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5man-7.spl~ BEGIN + COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5man-7.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = (0 - 7) parameter2 = 0 timing = 0 duration = 126144000 END +END +ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5man-8.spl~ BEGIN + COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5man-8.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = (0 - 8) parameter2 = 0 timing = 0 duration = 126144000 END +END +ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5man-9.spl~ BEGIN + COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5man-9.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = (0 - 9) parameter2 = 0 timing = 0 duration = 126144000 END +END + +APPEND ~d5_zmana.2da~ ~MANA_PTS AP_D5MAN2A AP_D5MAN2B AP_D5MAN2C AP_D5MAN2D AP_D5MAN2E AP_D5MAN4A AP_D5MAN4B AP_D5MAN4C AP_D5MAN4D AP_D5MAN4E AP_D5MAN6A AP_D5MAN6B AP_D5MAN6C AP_D5MAN6D AP_D5MAN6E AP_D5MAN8A AP_D5MAN8B AP_D5MAN8C AP_D5MAN8D AP_D5MAN8E AP_D5MAN3A AP_D5MAN3B AP_D5MAN3C AP_D5MAN3D AP_D5MAN3E **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ + + +//set up spell learn UI screens_______________________________________________________ +// +LAF sorcerer_spell_learning END + + +//set up spell learn UI screens_______________________________________________________ +// +//ACTION_IF !(FILE_EXISTS_IN_GAME ~d5mnsrcX.2da~) BEGIN + + COPY_EXISTING ~d5msorc.2da~ ~override/d5mnsrc.2da~ + + INCLUDE ~tomeandblood/lib/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 = ~d5mnsrc~ + spelllist = ~d5mnsrc~ + spelltable = ~QD_SPLSRCKN~ + icon = ~spcl919b~ + title = ~Spell Selection~ + label = ~Select a spell to learn~ + subspell = ~M~ + END + +COPY_EXISTING ~d5mnsrc.2da~ ~override/d5mnsrcX.2da~ + +//END + + +//initialize ability and learn item___________________________________________________ +// +COPY ~tomeandblood/data/multi_sorcerers/d5msorc.itm~ ~override/d5mana.itm~ // learn spells .itm + SAY NAME1 @17021 + SAY NAME2 @17021 + SAY UNIDENTIFIED_DESC @17022 + SAY IDENTIFIED_DESC @17022 + LPF ALTER_ITEM_HEADER INT_VAR target = 7 speed = 0 STR_VAR icon = ~d5lernwi~ END + LPF ALTER_EFFECT INT_VAR match_opcode = 146 STR_VAR resource = ~d5mnsrc~ END + +COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5mana.spl~ + SAY NAME1 @17050 + SAY UNIDENTIFIED_DESC @17050 + WRITE_SHORT 0x1c 4 + LPF ALTER_SPELL_HEADER INT_VAR target = 5 location = 4 STR_VAR icon = ~d5lernwi~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 143 target = 1 parameter1 = 14 timing = 9 STR_VAR resource = ~d5mana~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = ~d5mana~ END + +APPEND ~d5_zmana.2da~ ~LEARNSPLS GA_D5MANA **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ + +ACTION_IF (FILE_EXISTS_IN_GAME ~d5mnsrc.spl~) BEGIN + COPY_EXISTING ~d5mnsrc.spl~ ~override~ + LPF DELETE_EFFECT INT_VAR match_opcode = 171 STR_VAR match_resource = ~d5mnsrc~ END + LPF DELETE_EFFECT INT_VAR match_opcode = 172 STR_VAR match_resource = ~d5mnsrc~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 power = 0 parameter2 = 1 timing = 1 STR_VAR resource = ~d5ms206x~ END +END + + +//make mana clone spells______________________________________________________________ +// +COPY_EXISTING ~d5clonmn.2da~ ~override~ + COUNT_2DA_ROWS 8 rows + FOR (row = 0; row < rows; ++row) BEGIN + READ_2DA_ENTRY row 0 8 spell_res + READ_2DA_ENTRY row 1 8 206_spell + READ_2DA_ENTRY row 2 8 learn_spell + READ_2DA_ENTRY row 3 8 spell_eff + READ_2DA_ENTRY row 4 8 innate_spell + READ_2DA_ENTRY row 5 8 real_spell + READ_2DA_ENTRY row 6 8 switch_spell + READ_2DA_ENTRY row 7 8 switch_subspell + INNER_ACTION BEGIN + ACTION_IF (FILE_EXISTS_IN_GAME ~%spell_res%.spl~) BEGIN + COPY_EXISTING ~%spell_res%.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 +// make innates with cloned spell effects + ACTION_IF NOT FILE_EXISTS_IN_GAME ~%innate_spell%.spl~ BEGIN + COPY_EXISTING ~%spell_res%.spl~ ~override/%innate_spell%.spl~ + SAY NAME1 ~~ +// SAY UNIDENTIFIED_DESC ~~ + WRITE_SHORT 0x1c 4 + WRITE_LONG 0x34 spell_level + SET one_level_less = (spell_level - 1) + SET two_levels_less = (spell_level - 2) + SET three_levels_less = (spell_level - 3) + SET four_levels_less = (spell_level - 4) + READ_LONG 0x64 abil_offset + READ_SHORT 0x68 abil_number + READ_BYTE (%abil_offset% + 0x0c) abil_target + READ_SHORT (%abil_offset% + 0x0e) abil_range + READ_LONG 0x6a eff_offset + WHILE (%abil_number% > 0) BEGIN + SET abil_number = (%abil_number% - 1) + WRITE_SHORT (%abil_offset% + 0x26 + (0x28 * %abil_number%)) 1 + END + LPF DELETE_EFFECT END + PATCH_IF (%abil_target% = 4) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 148 target = 1 power = 0 parameter1 = 0 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%real_spell%~ END + PATCH_IF (%abil_range% < 35) BEGIN + PATCH_IF (%abil_range% > 4) BEGIN + LPF ALTER_SPELL_HEADER INT_VAR range = (%abil_range% - 3) END + END + PATCH_IF (%abil_range% < 5) BEGIN + LPF ALTER_SPELL_HEADER INT_VAR target = 5 END + END + END + END + ELSE BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 2 power = 0 parameter2 = 1 timing = 9 STR_VAR resource = EVAL ~%real_spell%~ END + END + PATCH_IF !(MOD_IS_INSTALLED ~tomeandblood.tp2~ ~62~) BEGIN + PATCH_IF (%spell_level% = 1) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5man-1~ END + END + PATCH_IF (%spell_level% = 2) OR (%spell_level% = 3) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5man_1~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5man-%one_level_less%~ END + END + PATCH_IF (%spell_level% = 4) OR (%spell_level% = 5) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5man_2~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5man-%two_levels_less%~ END + END + PATCH_IF (%spell_level% = 6) OR (%spell_level% = 7) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5man_3~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5man-%three_levels_less%~ END + END + PATCH_IF (%spell_level% = 8) OR (%spell_level% = 9) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5man_4~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5man-%four_levels_less%~ END + END + END + PATCH_IF (MOD_IS_INSTALLED ~tomeandblood.tp2~ ~62~) BEGIN + PATCH_IF (%spell_level% = 2) OR (%spell_level% = 3) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5man_1~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5man-%one_level_less%~ END + END + PATCH_IF (%spell_level% = 4) OR (%spell_level% = 5) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5man_2~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5man-%two_levels_less%~ END + END + PATCH_IF (%spell_level% = 6) OR (%spell_level% = 7) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5man_3~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5man-%three_levels_less%~ END + END + PATCH_IF (%spell_level% = 8) OR (%spell_level% = 9) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5man_4~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5man-%four_levels_less%~ END + END + END + PATCH_IF (lose_spell_on_interrupt = 0) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5msplz~ END + END + PATCH_IF (lose_spell_on_interrupt = 1) BEGIN + LPF ADD_SPELL_CFEFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5msplz~ END + END + END +// make .EFFs adding the arcane clone + CREATE EFF ~%spell_eff%~ + WRITE_LONG 0x10 171 + WRITE_LONG 0x14 1 + WRITE_LONG 0x24 0 + WRITE_LONG 0x28 1 + WRITE_SHORT 0x2c 100 + WRITE_EVALUATED_ASCII 0x30 ~%innate_spell%~ #8 + WRITE_LONG 0x90 1 + WRITE_EVALUATED_ASCII 0x94 ~%spell_eff%~ #8 +// make 206 spells preventing the .EFF + COPY ~tomeandblood/lib/d5_base.spl~ ~override/%206_spell%.spl~ + WRITE_SHORT 0x1c 4 + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END +// add 206 spells to CLAB spell + COPY_EXISTING ~d5ms206.spl~ ~override~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 9 STR_VAR resource = EVAL ~%206_spell%~ END +// add 318 effects to initialize spell + ACTION_IF (%spell_level% = 9) BEGIN + COPY_EXISTING ~d5msplz.spl~ ~override~ + LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = 9 parameter2 = %tracking_less% timing = 0 duration = 1 STR_VAR resource = EVAL ~%spell_eff%~ END + IF_EXISTS BUT_ONLY + END + ACTION_IF (%spell_level% = 8) BEGIN + COPY_EXISTING ~d5msplz.spl~ ~override~ + LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = 8 parameter2 = %tracking_less% timing = 0 duration = 1 STR_VAR resource = EVAL ~%spell_eff%~ END + IF_EXISTS BUT_ONLY + END + ACTION_IF (%spell_level% = 7) BEGIN + COPY_EXISTING ~d5msplz.spl~ ~override~ + LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = 7 parameter2 = %tracking_less% timing = 0 duration = 1 STR_VAR resource = EVAL ~%spell_eff%~ END + IF_EXISTS BUT_ONLY + END + ACTION_IF (%spell_level% = 6) BEGIN + COPY_EXISTING ~d5msplz.spl~ ~override~ + LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = 6 parameter2 = %tracking_less% timing = 0 duration = 1 STR_VAR resource = EVAL ~%spell_eff%~ END + IF_EXISTS BUT_ONLY + END + ACTION_IF (%spell_level% = 5) BEGIN + COPY_EXISTING ~d5msplz.spl~ ~override~ + LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = 5 parameter2 = %tracking_less% timing = 0 duration = 1 STR_VAR resource = EVAL ~%spell_eff%~ END + IF_EXISTS BUT_ONLY + END + ACTION_IF (%spell_level% = 4) BEGIN + COPY_EXISTING ~d5msplz.spl~ ~override~ + LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = 4 parameter2 = %tracking_less% timing = 0 duration = 1 STR_VAR resource = EVAL ~%spell_eff%~ END + IF_EXISTS BUT_ONLY + END + ACTION_IF (%spell_level% = 3) BEGIN + COPY_EXISTING ~d5msplz.spl~ ~override~ + LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = 3 parameter2 = %tracking_less% timing = 0 duration = 1 STR_VAR resource = EVAL ~%spell_eff%~ END + IF_EXISTS BUT_ONLY + END + ACTION_IF (%spell_level% = 2) BEGIN + COPY_EXISTING ~d5msplz.spl~ ~override~ + LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = 2 parameter2 = %tracking_less% timing = 0 duration = 1 STR_VAR resource = EVAL ~%spell_eff%~ END + IF_EXISTS BUT_ONLY + END + ACTION_IF (%spell_level% = 1) BEGIN + COPY_EXISTING ~d5msplz.spl~ ~override~ + LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = 1 parameter2 = %tracking_less% timing = 0 duration = 1 STR_VAR resource = EVAL ~%spell_eff%~ END + IF_EXISTS BUT_ONLY + END +// make learn spells canceling the 206 + COPY ~tomeandblood/lib/d5_base.spl~ ~override/%learn_spell%.spl~ + SAY NAME1 ~%spell_name%~ + WRITE_EVALUATED_ASCII 0x3a ~%spell_icon%~ #8 + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~%206_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5ms206~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 171 target = 1 timing = 9 STR_VAR resource = EVAL ~%real_spell%~ END +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 309 target = 1 parameter1 = 1 parameter2 = 0 timing = 9 STR_VAR resource = EVAL ~%real_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter1 = 0 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5msplz~ END +// make copy of learn spell for kjeron's UI system (eventually, just rename the learn spell to this name) +// COPY_EXISTING ~%learn_spell%.spl~ ~override/%spell_res%N.spl~ +// add subspell to switch spell + ACTION_IF (FILE_EXISTS_IN_GAME ~%switch_spell%.spl~) BEGIN + COPY ~tomeandblood/lib/d5_base.spl~ ~override/%switch_subspell%.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 1 STR_VAR resource = EVAL ~%learn_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%206_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter1 = 0 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5msplz~ END +// LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = 19 parameter2 = 105 timing = 0 duration = 0 STR_VAR resource = EVAL ~%switch_subspell%~ END + COPY_EXISTING ~%switch_spell%.spl~ ~override~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%switch_subspell%~ END + BUT_ONLY + END +// add 172 to d5msplz# + COPY_EXISTING ~d5msplz.spl~ ~override~ + LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~%innate_spell%~ END +// remove all known spells after chargen + COPY_EXISTING ~d50wspl.spl~ ~override~ + LPF DELETE_EFFECT INT_VAR match_opcode = 172 STR_VAR match_resource = EVAL ~%spell_res%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 1 STR_VAR resource = EVAL ~%spell_res%~ END + IF_EXISTS +// generate slot#x spells +// ***** this all needs to change... not exactly sure how! + COPY_EXISTING ~d5mpts1.spl~ ~override~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + BUT_ONLY + COPY_EXISTING ~d5mpts2.spl~ ~override~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + BUT_ONLY + COPY_EXISTING ~d5mpts3.spl~ ~override~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + BUT_ONLY + COPY_EXISTING ~d5mpts4.spl~ ~override~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + BUT_ONLY + COPY_EXISTING ~d5mpts5.spl~ ~override~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + BUT_ONLY + COPY_EXISTING ~d5mpts6.spl~ ~override~ + FOR (pts_count = 1; pts_count < 33; ++pts_count) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + END + BUT_ONLY + COPY_EXISTING ~d5mpts7.spl~ ~override~ + FOR (pts_count = 1; pts_count < 65; ++pts_count) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END + END + BUT_ONLY + END + END // end inner_action + END +BUT_ONLY + + +//remove known spells right after chargen_____________________________________________ +// +APPEND ~d5_zmana.2da~ ~NO_WSPLS AP_D50WSPL **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ + + +//apply EFF protections_______________________________________________________________ +// +//APPEND ~d5_zmana.2da~ ~NO_RSPLS AP_D5MS318 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ +APPEND ~d5_zmana.2da~ ~NO_LSPLS AP_D5MS206 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ + + +//daily spell refresh_________________________________________________________________ +// +COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5mnptz.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = ~d5mnpts~ END + +APPEND ~d5_zmana.2da~ ~MANA_PTS AP_D5MNPTZ **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ + +CREATE EFF ~d5mnpts~ + WRITE_LONG 0x10 232 + WRITE_LONG 0x14 1 + WRITE_LONG 0x1c 0 + WRITE_LONG 0x20 20 + WRITE_LONG 0x24 9 + WRITE_SHORT 0x2c 100 + WRITE_ASCII 0x30 ~d5mnpt~ #8 + WRITE_LONG 0x48 102 + +COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5mnpt.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 0 parameter2 = %fatigue_value% timing = 1 STR_VAR resource = ~d5mrfrsh~ END + + +// spell to refresh spell slots_______________________________________________________ +ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5mrfrsh.spl~ BEGIN + COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5mrfrsh.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 93 target = 1 parameter1 = 1 parameter2 = 1 timing = 1 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5man-1~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5man_1~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5man-2~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5man_2~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5man-3~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5man_3~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5man-4~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5man_4~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5man-5~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5man-6~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5man-7~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5man-8~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5man-9~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5msplz~ END +END + + +// restorative meditation ability_____________________________________________________ +COPY ~tomeandblood/data/mana_sorcerer/d5prmed.bam~ ~override~ +COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5msmed.spl~ + SAY NAME1 @17087 + SAY UNIDENTIFIED_DESC @17088 + WRITE_ASCII 0x3a ~d5prmed~ #8 + LPF ALTER_SPELL_HEADER INT_VAR target = 5 location = 4 STR_VAR icon = ~d5prmed~ END + WRITE_BYTE 0x1a (THIS BOR 0b00000001) // set as non-combat ability + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5man_1~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5man_2~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5man_3~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5man_4~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5msplz~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = ~d5msmed~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 171 target = 1 timing = 9 STR_VAR resource = ~d5msmed~ END + +APPEND ~d5_zmana.2da~ ~RESTORE GA_D5MSMED **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ + + +//make sequencer/contingency scrolls unusable by mana 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 = %mana_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 = %mana_sorcerer_code% parameter2 = 9 power = 0 timing = 2 END + END + END +END + +ACTION_IF (MOD_IS_INSTALLED ~TomeAndBlood.tp2~ ~55~) BEGIN + ACTION_IF FILE_EXISTS_IN_GAME ~M_d5meta.lua~ BEGIN + APPEND ~M_d5meta.lua~ ~mageBookStrings['D5M4420'] = mageBookStrings['SPWI420'] -- Minor Sequencer clone, replace resource, keep quotes +mageBookStrings['D5M4617'] = mageBookStrings['SPWI710'] -- Spell Sequencer +mageBookStrings['D5M4710'] = mageBookStrings['SPWI809'] -- Spell Trigger +mageBookStrings['D5M4809'] = mageBookStrings['SPWI617'] -- Contingency +mageBookStrings['D5M4908'] = mageBookStrings['SPWI908'] -- Chain Contingency~ + END +END + +ACTION_IF FILE_EXISTS_IN_GAME ~spwi420d.spl~ BEGIN + COPY_EXISTING ~spwi420d.spl~ ~override/d5m4420d.spl~ + LPF ALTER_EFFECT INT_VAR silent = 1 STR_VAR resource = ~d5m4420~ END +END +ACTION_IF FILE_EXISTS_IN_GAME ~spwi420p.spl~ BEGIN + COPY_EXISTING ~spwi420p.spl~ ~override/d5m4420p.spl~ + LPF ALTER_EFFECT INT_VAR silent = 1 STR_VAR resource = ~d5m4420~ END +END +ACTION_IF FILE_EXISTS_IN_GAME ~spwi710d.spl~ BEGIN + COPY_EXISTING ~spwi710d.spl~ ~override/d5m4710d.spl~ + LPF ALTER_EFFECT INT_VAR silent = 1 STR_VAR resource = ~d5m4710~ END +END +ACTION_IF FILE_EXISTS_IN_GAME ~spwi710p.spl~ BEGIN + COPY_EXISTING ~spwi710p.spl~ ~override/d5m4710p.spl~ + LPF ALTER_EFFECT INT_VAR silent = 1 STR_VAR resource = ~d5m4710~ END +END +ACTION_IF FILE_EXISTS_IN_GAME ~spwi809d.spl~ BEGIN + COPY_EXISTING ~spwi809d.spl~ ~override/d5m4809d.spl~ + LPF ALTER_EFFECT INT_VAR silent = 1 STR_VAR resource = ~d5m4809~ END +END +ACTION_IF FILE_EXISTS_IN_GAME ~spwi809p.spl~ BEGIN + COPY_EXISTING ~spwi809p.spl~ ~override/d5m4809p.spl~ + LPF ALTER_EFFECT INT_VAR silent = 1 STR_VAR resource = ~d5m4809~ END +END + + +//manasorc no get innate sequencers___________________________________________________ +// +ACTION_IF FILE_EXISTS_IN_GAME ~d5adsq1m.spl~ BEGIN + ACTION_IF !(FILE_EXISTS_IN_GAME ~d5msnsq.spl~) BEGIN + CREATE SPL ~d5msnsq~ + COPY_EXISTING ~d5msnsq.spl~ ~override~ + LPF ADD_SPELL_HEADER INT_VAR target = 1 END + COPY_EXISTING ~d5msnsq.spl~ ~override~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5adsq1m~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5adsq2m~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5adsq3m~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5adcntm~ END + END + APPEND ~d5_zmana.2da~ ~NO_META AP_D5MSNSQ **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ +END + + +//disable quickspell buttons and scroll learning______________________________________ +// +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5srcnq.spl~) BEGIN + COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5srcnq.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 144 target = 1 parameter2 = 3 timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 144 target = 1 parameter2 = 4 timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 144 target = 1 parameter2 = 5 timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 101 target = 1 parameter2 = 147 timing = 9 END +END + +APPEND ~d5_zmana.2da~ ~NO_QUICK AP_D5SRCNQ **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ + + +//add spell switching_________________________________________________________________ +// +ACTION_IF (FILE_EXISTS_IN_GAME ~qdtnb_switch3.qd~) BEGIN + APPEND ~d5_zmana.2da~ ~SWITCH_SPL GA_D5SWTCH **** GA_D5SWTCH **** **** GA_D5SWTCH **** **** GA_D5SWTCH **** **** GA_D5SWTCH **** **** GA_D5SWTCH **** **** GA_D5SWTCH **** **** GA_D5SWTCH **** **** GA_D5SWTCH **** **** GA_D5SWTCH **** **** GA_D5SWTCH **** **** GA_D5SWTCH **** **** GA_D5SWTCH **** **** GA_D5SWTCH **** **** GA_D5SWTCH **** **** GA_D5SWTCH **** **** GA_D5SWTCH **** **** ~ UNLESS ~GA_D5SWTCH~ +END + +ACTION_IF (FILE_EXISTS_IN_GAME ~qdtnb_switch1.qd~) BEGIN + APPEND ~d5_zmana.2da~ ~SWITCH_SPL GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH GA_D5SWTCH ~ UNLESS ~GA_D5SWTCH~ +END + + +//apply manasorc to clab table(s)_____________________________________________________ +// +COPY_EXISTING ~d5_mana.2da~ ~override~ + APPEND_FILE ~override/d5_zmana.2da~ + + +//make HLA tables_____________________________________________________________________ +// ...clone sorcerer HLAs as innates +// +ACTION_IF FILE_EXISTS_IN_GAME ~spwi920.spl~ BEGIN + COPY_EXISTING ~spwi920.spl~ ~override/d5hl920.spl~ + WRITE_SHORT 0x1c 4 +END +ACTION_IF FILE_EXISTS_IN_GAME ~spwi921.spl~ BEGIN + COPY_EXISTING ~spwi921.spl~ ~override/d5hl921.spl~ + WRITE_SHORT 0x1c 4 +END +ACTION_IF FILE_EXISTS_IN_GAME ~spwi922.spl~ BEGIN + COPY_EXISTING ~spwi922.spl~ ~override/d5hl922.spl~ + WRITE_SHORT 0x1c 4 +END +ACTION_IF FILE_EXISTS_IN_GAME ~spwi923.spl~ BEGIN + COPY_EXISTING ~spwi923.spl~ ~override/d5hl923.spl~ + WRITE_SHORT 0x1c 4 +END +ACTION_IF FILE_EXISTS_IN_GAME ~spwi924.spl~ BEGIN + COPY_EXISTING ~spwi924.spl~ ~override/d5hl924.spl~ + WRITE_SHORT 0x1c 4 +END +ACTION_IF FILE_EXISTS_IN_GAME ~spwi925.spl~ BEGIN + COPY_EXISTING ~spwi925.spl~ ~override/d5hl925.spl~ + WRITE_SHORT 0x1c 4 +END +/* +ACTION_IF FILE_EXISTS_IN_GAME ~spcl928.spl~ BEGIN + COPY_EXISTING ~spcl928.spl~ ~override/d5hl928.spl~ + LPF ALTER_EFFECT INT_VAR match_opcode = 42 opcode = 95 target = 1 parameter1 = 3 parameter2 = 0 timing = 9 END +END +ACTION_IF FILE_EXISTS_IN_GAME ~spcl929.spl~ BEGIN + COPY_EXISTING ~spcl929.spl~ ~override/d5hl929.spl~ + LPF ALTER_EFFECT INT_VAR match_opcode = 42 opcode = 95 target = 1 parameter1 = 6 parameter2 = 0 timing = 9 END +END +ACTION_IF FILE_EXISTS_IN_GAME ~spcl930.spl~ BEGIN + COPY_EXISTING ~spcl930.spl~ ~override/d5hl930.spl~ + LPF ALTER_EFFECT INT_VAR match_opcode = 42 opcode = 95 target = 1 parameter1 = 12 parameter2 = 0 timing = 9 END +END +*/ + +LAF action_replace_hla STR_VAR kit_name = ~D5_MANA_SORCERER~ remove_ability = ~GA_SPWI920~ ability = ~GA_D5HL920~ END +LAF action_replace_hla STR_VAR kit_name = ~D5_MANA_SORCERER~ remove_ability = ~GA_SPWI921~ ability = ~GA_D5HL921~ END +LAF action_replace_hla STR_VAR kit_name = ~D5_MANA_SORCERER~ remove_ability = ~GA_SPWI922~ ability = ~GA_D5HL922~ END +LAF action_replace_hla STR_VAR kit_name = ~D5_MANA_SORCERER~ remove_ability = ~GA_SPWI923~ ability = ~GA_D5HL923~ END +LAF action_replace_hla STR_VAR kit_name = ~D5_MANA_SORCERER~ remove_ability = ~GA_SPWI924~ ability = ~GA_D5HL924~ END +LAF action_replace_hla STR_VAR kit_name = ~D5_MANA_SORCERER~ remove_ability = ~GA_SPWI925~ ability = ~GA_D5HL925~ END +LAF action_remove_hla STR_VAR kit_name = ~D5_MANA_SORCERER~ remove_ability = ~AP_SPWI928~ END +LAF action_remove_hla STR_VAR kit_name = ~D5_MANA_SORCERER~ remove_ability = ~AP_SPWI929~ END +LAF action_remove_hla STR_VAR kit_name = ~D5_MANA_SORCERER~ remove_ability = ~AP_SPWI930~ END + + + +//fix burning hands targeting_______________________________________________________ +// +COPY_EXISTING ~spwi103.spl~ ~override~ + READ_LONG 0x08 burning_hands_strref +BUT_ONLY + +ACTION_IF (IS_AN_INT %burning_hands_strref%) BEGIN + COPY_EXISTING_REGEXP GLOB ~^.+\.spl$~ ~override~ + PATCH_IF (%SOURCE_SIZE% > 0x71) BEGIN + SET burning_change = 0 + READ_LONG 0x08 name + PATCH_IF (name = burning_hands_strref) BEGIN + GET_OFFSET_ARRAY ab_array SPL_V10_HEADERS + PHP_EACH ab_array AS int => ab_off BEGIN + PATCH_IF (burning_change = 0) BEGIN + READ_BYTE (ab_off + 0x0c) target + PATCH_IF target = 5 BEGIN + SET burning_change = 1 + END + END + END + PATCH_IF (burning_change = 1) BEGIN + LPF ALTER_SPELL_HEADER INT_VAR target = 1 END + LPF ALTER_EFFECT INT_VAR match_opcode = 148 opcode = 146 target = 2 STR_VAR match_resource = ~spwi103~ END + END + END + END + BUT_ONLY +END + + + +END // end define function +//____________________________________________________________________________________ + diff --git a/TomeAndBlood/comp/setup_multiclass_sorcerers.tpa b/TomeAndBlood/comp/setup_multiclass_sorcerers.tpa index 2d5a054..c983ea0 100644 --- a/TomeAndBlood/comp/setup_multiclass_sorcerers.tpa +++ b/TomeAndBlood/comp/setup_multiclass_sorcerers.tpa @@ -150,7 +150,7 @@ ADD_KIT ~D5_SORCERER_CLERIC~ //ALIGNMENT RESTRICTIONS____________________________________________________________ // LG LN LE NG TN NE CG CN CE -~D5_SORCERER_CLERIC 1 0 0 1 0 0 1 0 0~ +~D5_SORCERER_CLERIC 1 1 1 1 1 1 1 1 1~ //DUAL CLASS OPTIONS________________________________________________________________ // FT CL MA TH DR RA @@ -286,7 +286,7 @@ ADD_KIT ~D5_SORCERER_THIEF~ //ALIGNMENT RESTRICTIONS____________________________________________________________ // LG LN LE NG TN NE CG CN CE -~D5_SORCERER_THIEF 0 1 1 1 1 0 1 1 1~ +~D5_SORCERER_THIEF 0 1 1 1 1 1 1 1 1~ //DUAL CLASS OPTIONS________________________________________________________________ // FT CL MA TH DR RA @@ -329,31 +329,12 @@ ACTION_IF GAME_IS ~bgee bg2ee eet iwdee~ THEN BEGIN END END -/* -plan: -- d5ssplz# does 172 (borrow & combine from srci#), and 326 for d5slot#x -- d5slot#x triggers all EFFs according to stat values (borrow & combine from srci#) -- EFFs 171 innate clones -- innate clones cast real wiz spells??? <--- DECISION (I think, no for now) -- innate clones reduce appropriate stat -- innate clones cast d5ssplz# on 1-sec delay, where # = level - -- 206 against all EFFs at chargen -- learn_spell = 321 206_spell, and 171 real_spell - -- 232 from chargen -- just does 326 for refresh -- refresh does 321 on stat reductions, then casts d5ssplz on 1-sec delay -*/ - //get kit identifiers_________________________________________________________________ // OUTER_SET fighter_sorcerer_code = (0x4000 + %D5_FIGHTER_SORCERER%) OUTER_SET sorcerer_cleric_code = (0x4000 + %D5_SORCERER_CLERIC%) OUTER_SET sorcerer_thief_code = (0x4000 + %D5_SORCERER_THIEF%) -//5E CASTING COMPAT___________________________________________________________________ -// add 318 effects to exempt multisorc from 5E casting 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 @@ -365,6 +346,9 @@ COPY_EXISTING ~splprot.2da~ ~override~ 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~ @@ -375,688 +359,58 @@ ACTION_FOR_EACH 5e_spl IN ~d5zz000~ ~d5zzini~ /*~d5zlots~*/ ~d5zltwz~ BEGIN END END -/* -COPY_EXISTING ~kit.ids~ ~override~ - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW rows cols - FOR (row = 1; row < rows; ++row) BEGIN - READ_2DA_ENTRY_FORMER rows row 1 ~kit_name~ - PATCH_IF ~%kit_name%~ STRING_EQUAL_CASE ~D5_FIGHTER_SORCERER~ BEGIN - SET fighter_sorcerer_row = %row% - READ_2DA_ENTRY_FORMER rows fighter_sorcerer_row 0 fighter_sorcerer_code - END - PATCH_IF ~%kit_name%~ STRING_EQUAL_CASE ~D5_SORCERER_CLERIC~ BEGIN - SET sorcerer_cleric_row = %row% - READ_2DA_ENTRY_FORMER rows sorcerer_cleric_row 0 sorcerer_cleric_code - END - PATCH_IF ~%kit_name%~ STRING_EQUAL_CASE ~D5_SORCERER_THIEF~ BEGIN - SET sorcerer_thief_row = %row% - READ_2DA_ENTRY_FORMER rows sorcerer_thief_row 0 sorcerer_thief_code - END - END -BUT_ONLY -*/ +LAM sorcerer_learning_suffix -//add spell slot stat checks to SPLPROT_______________________________________________ -// -APPEND ~splprot.2da~ ~D5_SLOTS_1_7%TAB%108%TAB%-1%TAB%7~ UNLESS ~D5_SLOTS_1_7~ -APPEND ~splprot.2da~ ~D5_SLOTS_8_9%TAB%109%TAB%-1%TAB%7~ UNLESS ~D5_SLOTS_8_9~ -APPEND ~splprot.2da~ ~D5_FATIGUE_IS%TAB%30%TAB%-1%TAB%1~ UNLESS ~D5_FATIGUE_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_SLOTS_1_7~ BEGIN - SET fake_sorc_slots_1_7 = %row% - END - PATCH_IF ~%stat%~ STRING_EQUAL_CASE ~D5_SLOTS_8_9~ BEGIN - SET fake_sorc_slots_8_9 = %row% - END - PATCH_IF ~%stat%~ STRING_EQUAL_CASE ~D5_FATIGUE_IS~ BEGIN - SET fatigue_value = %row% - END - END -BUT_ONLY +LAF sorcerer_spell_learning STR_VAR menu_suffix = EVAL ~%sorcerer_learn_suffix%~ END -//multi sorc spellstate_______________________________________________________________ -// -ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_MULTI_SORC~)) BEGIN - COPY_EXISTING ~splstate.ids~ ~override~ - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW rows cols - FOR (row = 1; row < rows; ++row) BEGIN - READ_2DA_ENTRY_FORMER rows row 1 ~state_name~ - READ_2DA_ENTRY_FORMER rows row 0 ~state_ind~ - PATCH_IF (~%state_name%~ STRING_EQUAL_CASE ~D5_MULTI_SORC~) BEGIN - SET multi_sorc_state = %state_ind% - END - END - BUT_ONLY -END -/* -ACTION_IF !(FILE FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_MULTI_SORC~)) BEGIN - LAF d5_resolve_state STR_VAR new_state_id = ~D5_MULTI_SORC~ RET new_state_ind END - OUTER_SET multi_sorc_state = %new_state_ind% -END -*/ -ACTION_IF !(VARIABLE_IS_SET %multi_sorc_state%) BEGIN - LAF d5_resolve_state STR_VAR new_state_id = ~D5_MULTI_SORC~ RET new_state_ind END - OUTER_SET multi_sorc_state = %new_state_ind% -END - - -//remove all mage spell slots_________________________________________________________ -// -/* -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d50wcst.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 145 target = 1 parameter2 = 0 timing = 9 END -BUT_ONLY - -APPEND ~d5sorc.2da~ ~NO_CAST AP_D50WCST **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ +/* do this in d5xxini +APPEND ~d5sorc.2da~ ~LEARNSPLS GA_D5MSOR1 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ +APPEND ~d5sorc.2da~ ~LEARNSPLS AP_D5MSOR2 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ */ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d50wslt.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 42 target = 1 parameter1 = (0 - 1) parameter2 = 511 timing = 9 END -BUT_ONLY - -APPEND ~d5sorc.2da~ ~NOSLOTS AP_D50WSLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** -NOSLOTS AP_D50WSLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** -NOSLOTS AP_D50WSLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** -NOSLOTS AP_D50WSLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** -NOSLOTS AP_D50WSLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** -NOSLOTS AP_D50WSLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** -NOSLOTS AP_D50WSLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** -NOSLOTS AP_D50WSLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** -NOSLOTS AP_D50WSLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** -NOSLOTS AP_D50WSLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** -NOSLOTS AP_D50WSLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** -NOSLOTS AP_D50WSLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** -~ - - -//create advance copies of some spells________________________________________________ -// -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5w206.spl~ - -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot1a.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot1b.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot1c.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot1d.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot2a.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot2b.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot2c.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot2d.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot3a.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot3b.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot3c.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot3d.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot4a.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot4b.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot4c.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot4d.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot5a.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot5b.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot5c.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot5d.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot6a.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot6b.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot6c.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot6d.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot7a.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot7b.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot7c.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot7d.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot8a.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot8b.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot8c.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot8d.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot9a.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot9b.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot9c.spl~ -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slot9d.spl~ - -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5ssplz.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 4) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5slot1a~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 4) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5slot1b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 4) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5slot1c~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 4) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5slot1d~ END -//COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5ssplz2.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 8) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5slot2a~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 8) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5slot2b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 8) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5slot2c~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 8) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5slot2d~ END -//COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5ssplz3.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 12) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5slot3a~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 12) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5slot3b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 12) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5slot3c~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 12) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5slot3d~ END -//COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5ssplz4.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 16) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5slot4a~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 16) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5slot4b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 16) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5slot4c~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 16) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5slot4d~ END -//COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5ssplz5.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 20) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5slot5a~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 20) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5slot5b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 20) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5slot5c~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 20) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5slot5d~ END -//COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5ssplz6.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 24) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5slot6a~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 24) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5slot6b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 24) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5slot6c~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 24) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5slot6d~ END -//COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5ssplz7.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 28) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5slot7a~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 28) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5slot7b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 28) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5slot7c~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 28) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5slot7d~ END -//COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5ssplz8.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 24) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5slot8a~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 24) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5slot8b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 24) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5slot8c~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 24) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5slot8d~ END -//COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5ssplz9.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 28) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5slot9a~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 28) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5slot9b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 28) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5slot9c~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 28) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5slot9d~ END - - -//assign stats for spell slots to each spell level____________________________________ -// -// level 1 = (134 << 8) // OR: 108 << 4 -// level 2 = (134 << 12) // 108 << 8 -// level 3 = (134 << 16) // 108 << 12 -// level 4 = (134 << 20) // 108 << 16 -// level 5 = (108 << 8) // 108 << 20 -// level 6 = (108 << 12) // 108 << 24 -// level 7 = (108 << 16) // 108 << 28 -// level 8 = (108 << 20) // 109 << 24 -// level 9 = (108 << 24) // 109 << 28 -// -ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5src1a.spl~ BEGIN - ACTION_FOR_EACH let IN ~a~ ~b~ ~c~ /*~d~ ~e~ ~f~ ~g~ ~h~ ~i~ ~j~ ~k~ ~l~ ~m~ ~n~ ~o~ ~p~ ~q~ ~r~ ~s~ ~t~*/ BEGIN - COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5src1%let%.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src1%let%~ END - END -END -ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5src2a.spl~ BEGIN - ACTION_FOR_EACH let IN ~a~ ~b~ ~c~ /*~d~ ~e~ ~f~ ~g~ ~h~ ~i~ ~j~ ~k~ ~l~ ~m~ ~n~ ~o~ ~p~ ~q~ ~r~ ~s~ ~t~*/ BEGIN - COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5src2%let%.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src2%let%~ END - END -END -ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5src3a.spl~ BEGIN - ACTION_FOR_EACH let IN ~a~ ~b~ ~c~ /*~d~ ~e~ ~f~ ~g~ ~h~ ~i~ ~j~ ~k~ ~l~ ~m~ ~n~ ~o~ ~p~ ~q~ ~r~ ~s~ ~t~*/ BEGIN - COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5src3%let%.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src3%let%~ END - END -END -ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5src4a.spl~ BEGIN - ACTION_FOR_EACH let IN ~a~ ~b~ ~c~ /*~d~ ~e~ ~f~ ~g~ ~h~ ~i~ ~j~ ~k~ ~l~ ~m~ ~n~ ~o~ ~p~ ~q~ ~r~ ~s~ ~t~*/ BEGIN - COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5src4%let%.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src4%let%~ END - END -END -ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5src5a.spl~ BEGIN - ACTION_FOR_EACH let IN ~a~ ~b~ ~c~ /*~d~ ~e~ ~f~ ~g~ ~h~ ~i~ ~j~ ~k~ ~l~ ~m~ ~n~ ~o~ ~p~ ~q~ ~r~ ~s~ ~t~*/ BEGIN - COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5src5%let%.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 20) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src5%let%~ END - END -END -ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5src6a.spl~ BEGIN - ACTION_FOR_EACH let IN ~a~ ~b~ ~c~ /*~d~ ~e~ ~f~ ~g~ ~h~ ~i~ ~j~ ~k~ ~l~ ~m~ ~n~ ~o~ ~p~ ~q~ ~r~ ~s~ ~t~*/ BEGIN - COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5src6%let%.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 24) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src6%let%~ END - END -END -ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5src7a.spl~ BEGIN - ACTION_FOR_EACH let IN ~a~ ~b~ ~c~ /*~d~ ~e~ ~f~ ~g~ ~h~ ~i~ ~j~ ~k~ ~l~ ~m~ ~n~ ~o~ ~p~ ~q~ ~r~ ~s~ ~t~*/ BEGIN - COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5src7%let%.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 28) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src7%let%~ END - END -END -ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5src8a.spl~ BEGIN - ACTION_FOR_EACH let IN ~a~ ~b~ ~c~ /*~d~ ~e~ ~f~ ~g~ ~h~ ~i~ ~j~ ~k~ ~l~ ~m~ ~n~ ~o~ ~p~ ~q~ ~r~ ~s~ ~t~*/ BEGIN - COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5src8%let%.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 24) parameter2 = (109 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src8%let%~ END - END -END -ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5src9a.spl~ BEGIN - ACTION_FOR_EACH let IN ~a~ ~b~ ~c~ /*~d~ ~e~ ~f~ ~g~ ~h~ ~i~ ~j~ ~k~ ~l~ ~m~ ~n~ ~o~ ~p~ ~q~ ~r~ ~s~ ~t~*/ BEGIN - COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5src9%let%.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 28) parameter2 = (109 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src9%let%~ END - END -END +LAF semi_armor_casting END -ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5src-1.spl~ BEGIN - COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5src-1.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 4) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -END -ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5src-2.spl~ BEGIN - COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5src-2.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 8) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -END -ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5src-3.spl~ BEGIN - COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5src-3.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 12) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -END -ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5src-4.spl~ BEGIN - COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5src-4.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 16) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -END -ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5src-5.spl~ BEGIN - COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5src-5.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 20) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -END -ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5src-6.spl~ BEGIN - COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5src-6.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 24) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -END -ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5src-7.spl~ BEGIN - COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5src-7.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 28) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -END -ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5src-8.spl~ BEGIN - COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5src-8.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 24) parameter2 = (109 + (0x10000 * 1)) timing = 1 END -END -ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5src-9.spl~ BEGIN - COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5src-9.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 28) parameter2 = (109 + (0x10000 * 1)) timing = 1 END -END +LAF semi_sorcerer_casting STR_VAR menu_suffix = EVAL ~%sorcerer_learn_suffix%~ END -COPY_EXISTING ~mxsplsrc.2da~ ~override~ - LPF arcane_casting_slots STR_VAR table_spl = ~d5srslt~ END -BUT_ONLY -/* -COPY ~tomeandblood/lib/semi_spont/d5__slt.spl~ ~override/d5srslt.spl~ - LPF ADD_SPELL_EFFECT INT_VAR header = 1 opcode = 233 target = 1 parameter1 = (3 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 2 opcode = 233 target = 1 parameter1 = (4 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 3 opcode = 233 target = 1 parameter1 = (5 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 4 opcode = 233 target = 1 parameter1 = (6 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 4 opcode = 233 target = 1 parameter1 = (3 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 5 opcode = 233 target = 1 parameter1 = (6 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 5 opcode = 233 target = 1 parameter1 = (4 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 6 opcode = 233 target = 1 parameter1 = (6 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 6 opcode = 233 target = 1 parameter1 = (5 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 6 opcode = 233 target = 1 parameter1 = (3 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 7 opcode = 233 target = 1 parameter1 = (6 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 7 opcode = 233 target = 1 parameter1 = (6 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 7 opcode = 233 target = 1 parameter1 = (4 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 8 opcode = 233 target = 1 parameter1 = (6 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 8 opcode = 233 target = 1 parameter1 = (6 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 8 opcode = 233 target = 1 parameter1 = (5 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 8 opcode = 233 target = 1 parameter1 = (3 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 9 opcode = 233 target = 1 parameter1 = (6 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 9 opcode = 233 target = 1 parameter1 = (6 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 9 opcode = 233 target = 1 parameter1 = (6 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 9 opcode = 233 target = 1 parameter1 = (4 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 10 opcode = 233 target = 1 parameter1 = (6 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 10 opcode = 233 target = 1 parameter1 = (6 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 10 opcode = 233 target = 1 parameter1 = (6 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 10 opcode = 233 target = 1 parameter1 = (5 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 10 opcode = 233 target = 1 parameter1 = (3 << 20) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 11 opcode = 233 target = 1 parameter1 = (6 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 11 opcode = 233 target = 1 parameter1 = (6 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 11 opcode = 233 target = 1 parameter1 = (6 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 11 opcode = 233 target = 1 parameter1 = (6 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 11 opcode = 233 target = 1 parameter1 = (4 << 20) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 12 opcode = 233 target = 1 parameter1 = (6 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 12 opcode = 233 target = 1 parameter1 = (6 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 12 opcode = 233 target = 1 parameter1 = (6 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 12 opcode = 233 target = 1 parameter1 = (6 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 12 opcode = 233 target = 1 parameter1 = (5 << 20) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 12 opcode = 233 target = 1 parameter1 = (3 << 24) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 13 opcode = 233 target = 1 parameter1 = (6 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 13 opcode = 233 target = 1 parameter1 = (6 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 13 opcode = 233 target = 1 parameter1 = (6 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 13 opcode = 233 target = 1 parameter1 = (6 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 13 opcode = 233 target = 1 parameter1 = (6 << 20) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 13 opcode = 233 target = 1 parameter1 = (4 << 24) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 14 opcode = 233 target = 1 parameter1 = (6 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 14 opcode = 233 target = 1 parameter1 = (6 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 14 opcode = 233 target = 1 parameter1 = (6 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 14 opcode = 233 target = 1 parameter1 = (6 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 14 opcode = 233 target = 1 parameter1 = (6 << 20) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 14 opcode = 233 target = 1 parameter1 = (5 << 24) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 14 opcode = 233 target = 1 parameter1 = (3 << 28) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 15 opcode = 233 target = 1 parameter1 = (6 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 15 opcode = 233 target = 1 parameter1 = (6 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 15 opcode = 233 target = 1 parameter1 = (6 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 15 opcode = 233 target = 1 parameter1 = (6 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 15 opcode = 233 target = 1 parameter1 = (6 << 20) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 15 opcode = 233 target = 1 parameter1 = (6 << 24) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 15 opcode = 233 target = 1 parameter1 = (4 << 28) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 16 opcode = 233 target = 1 parameter1 = (6 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 16 opcode = 233 target = 1 parameter1 = (6 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 16 opcode = 233 target = 1 parameter1 = (6 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 16 opcode = 233 target = 1 parameter1 = (6 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 16 opcode = 233 target = 1 parameter1 = (6 << 20) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 16 opcode = 233 target = 1 parameter1 = (6 << 24) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 16 opcode = 233 target = 1 parameter1 = (5 << 28) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 16 opcode = 233 target = 1 parameter1 = (3 << 24) parameter2 = (109 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 17 opcode = 233 target = 1 parameter1 = (6 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 17 opcode = 233 target = 1 parameter1 = (6 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 17 opcode = 233 target = 1 parameter1 = (6 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 17 opcode = 233 target = 1 parameter1 = (6 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 17 opcode = 233 target = 1 parameter1 = (6 << 20) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 17 opcode = 233 target = 1 parameter1 = (6 << 24) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 17 opcode = 233 target = 1 parameter1 = (6 << 28) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 17 opcode = 233 target = 1 parameter1 = (4 << 24) parameter2 = (109 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 18 opcode = 233 target = 1 parameter1 = (6 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 18 opcode = 233 target = 1 parameter1 = (6 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 18 opcode = 233 target = 1 parameter1 = (6 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 18 opcode = 233 target = 1 parameter1 = (6 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 18 opcode = 233 target = 1 parameter1 = (6 << 20) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 18 opcode = 233 target = 1 parameter1 = (6 << 24) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 18 opcode = 233 target = 1 parameter1 = (6 << 28) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 18 opcode = 233 target = 1 parameter1 = (5 << 24) parameter2 = (109 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 18 opcode = 233 target = 1 parameter1 = (3 << 28) parameter2 = (109 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 19 opcode = 233 target = 1 parameter1 = (6 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 19 opcode = 233 target = 1 parameter1 = (6 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 19 opcode = 233 target = 1 parameter1 = (6 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 19 opcode = 233 target = 1 parameter1 = (6 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 19 opcode = 233 target = 1 parameter1 = (6 << 20) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 19 opcode = 233 target = 1 parameter1 = (6 << 24) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 19 opcode = 233 target = 1 parameter1 = (6 << 28) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 19 opcode = 233 target = 1 parameter1 = (6 << 24) parameter2 = (109 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 19 opcode = 233 target = 1 parameter1 = (4 << 28) parameter2 = (109 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 20 opcode = 233 target = 1 parameter1 = (6 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 20 opcode = 233 target = 1 parameter1 = (6 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 20 opcode = 233 target = 1 parameter1 = (6 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 20 opcode = 233 target = 1 parameter1 = (6 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 20 opcode = 233 target = 1 parameter1 = (6 << 20) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 20 opcode = 233 target = 1 parameter1 = (6 << 24) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 20 opcode = 233 target = 1 parameter1 = (6 << 28) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 20 opcode = 233 target = 1 parameter1 = (6 << 24) parameter2 = (109 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 20 opcode = 233 target = 1 parameter1 = (6 << 28) parameter2 = (109 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 21 opcode = 233 target = 1 parameter1 = (6 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 21 opcode = 233 target = 1 parameter1 = (6 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 21 opcode = 233 target = 1 parameter1 = (6 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 21 opcode = 233 target = 1 parameter1 = (6 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 21 opcode = 233 target = 1 parameter1 = (6 << 20) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 21 opcode = 233 target = 1 parameter1 = (6 << 24) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 21 opcode = 233 target = 1 parameter1 = (6 << 28) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 21 opcode = 233 target = 1 parameter1 = (6 << 24) parameter2 = (109 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 21 opcode = 233 target = 1 parameter1 = (6 << 28) parameter2 = (109 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 22 opcode = 233 target = 1 parameter1 = (6 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 22 opcode = 233 target = 1 parameter1 = (6 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 22 opcode = 233 target = 1 parameter1 = (6 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 22 opcode = 233 target = 1 parameter1 = (6 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 22 opcode = 233 target = 1 parameter1 = (6 << 20) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 22 opcode = 233 target = 1 parameter1 = (6 << 24) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 22 opcode = 233 target = 1 parameter1 = (6 << 28) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 22 opcode = 233 target = 1 parameter1 = (6 << 24) parameter2 = (109 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 22 opcode = 233 target = 1 parameter1 = (6 << 28) parameter2 = (109 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 23 opcode = 233 target = 1 parameter1 = (6 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 23 opcode = 233 target = 1 parameter1 = (6 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 23 opcode = 233 target = 1 parameter1 = (6 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 23 opcode = 233 target = 1 parameter1 = (6 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 23 opcode = 233 target = 1 parameter1 = (6 << 20) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 23 opcode = 233 target = 1 parameter1 = (6 << 24) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 23 opcode = 233 target = 1 parameter1 = (6 << 28) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 23 opcode = 233 target = 1 parameter1 = (6 << 24) parameter2 = (109 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 23 opcode = 233 target = 1 parameter1 = (6 << 28) parameter2 = (109 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 24 opcode = 233 target = 1 parameter1 = (6 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 24 opcode = 233 target = 1 parameter1 = (6 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 24 opcode = 233 target = 1 parameter1 = (6 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 24 opcode = 233 target = 1 parameter1 = (6 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 24 opcode = 233 target = 1 parameter1 = (6 << 20) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 24 opcode = 233 target = 1 parameter1 = (6 << 24) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 24 opcode = 233 target = 1 parameter1 = (6 << 28) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 24 opcode = 233 target = 1 parameter1 = (6 << 24) parameter2 = (109 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 24 opcode = 233 target = 1 parameter1 = (6 << 28) parameter2 = (109 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 25 opcode = 233 target = 1 parameter1 = (6 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 25 opcode = 233 target = 1 parameter1 = (6 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 25 opcode = 233 target = 1 parameter1 = (6 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 25 opcode = 233 target = 1 parameter1 = (6 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 25 opcode = 233 target = 1 parameter1 = (6 << 20) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 25 opcode = 233 target = 1 parameter1 = (6 << 24) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 25 opcode = 233 target = 1 parameter1 = (6 << 28) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 25 opcode = 233 target = 1 parameter1 = (6 << 24) parameter2 = (109 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR header = 25 opcode = 233 target = 1 parameter1 = (6 << 28) parameter2 = (109 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 1 STR_VAR resource = ~d5srslt~ END -*/ +APPEND ~d5sorc.2da~ ~SORC_INIT AP_D5XX000 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ -APPEND ~d5sorc.2da~ -~SRCSLOTS AP_D5SRSLT AP_D5SRSLT AP_D5SRSLT AP_D5SRSLT AP_D5SRSLT AP_D5SRSLT AP_D5SRSLT AP_D5SRSLT AP_D5SRSLT AP_D5SRSLT AP_D5SRSLT AP_D5SRSLT AP_D5SRSLT AP_D5SRSLT AP_D5SRSLT AP_D5SRSLT AP_D5SRSLT AP_D5SRSLT AP_D5SRSLT AP_D5SRSLT AP_D5SRSLT AP_D5SRSLT AP_D5SRSLT AP_D5SRSLT AP_D5SRSLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ -/* -APPEND ~d5sorc.2da~ ~SRCSLOTS AP_D5SRC1A AP_D5SRC1D AP_D5SRC1E AP_D5SRC1F AP_D5SRC2D AP_D5SRC2E AP_D5SRC2F AP_D5SRC3E AP_D5SRC3F AP_D5SRC4E AP_D5SRC4F AP_D5SRC5E AP_D5SRC5F AP_D5SRC6E AP_D5SRC6F AP_D5SRC7E AP_D5SRC7F AP_D5SRC8E AP_D5SRC8F AP_D5SRC9E **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** -SRCSLOTS AP_D5SRC1B **** **** AP_D5SRC2A **** AP_D5SRC3A AP_D5SRC3D AP_D5SRC4A AP_D5SRC4D AP_D5SRC5A AP_D5SRC5D AP_D5SRC6A AP_D5SRC6D AP_D5SRC7A AP_D5SRC7D AP_D5SRC8A AP_D5SRC8D AP_D5SRC9A AP_D5SRC9D AP_D5SRC9F **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** -SRCSLOTS AP_D5SRC1C **** **** AP_D5SRC2B **** AP_D5SRC3B **** AP_D5SRC4B **** AP_D5SRC5B **** AP_D5SRC6B **** AP_D5SRC7B **** AP_D5SRC8B **** AP_D5SRC9B **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** -SRCSLOTS **** **** **** AP_D5SRC2C **** AP_D5SRC3C **** AP_D5SRC4C **** AP_D5SRC5C **** AP_D5SRC6C **** AP_D5SRC7C **** AP_D5SRC8C **** AP_D5SRC9C **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +/* do this in d5xxini +APPEND ~d5sorc.2da~ ~NOSLOTS AP_D5X0SLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +NOSLOTS AP_D5X0SLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +NOSLOTS AP_D5X0SLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +NOSLOTS AP_D5X0SLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +NOSLOTS AP_D5X0SLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +NOSLOTS AP_D5X0SLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +NOSLOTS AP_D5X0SLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +NOSLOTS AP_D5X0SLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +NOSLOTS AP_D5X0SLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +NOSLOTS AP_D5X0SLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +NOSLOTS AP_D5X0SLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** +NOSLOTS AP_D5X0SLT **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ */ -//set up spell learning UI____________________________________________________________ +//set up casting slots________________________________________________________________ // -LAF sorcerer_spell_learning END - - -//make sorc clone spells______________________________________________________________ -// -COPY_EXISTING ~d5clonsc.2da~ ~override~ - COUNT_2DA_ROWS 8 rows - FOR (row = 0; row < rows; ++row) BEGIN - READ_2DA_ENTRY row 0 8 spell_res - READ_2DA_ENTRY row 1 8 206_spell - READ_2DA_ENTRY row 2 8 learn_spell - READ_2DA_ENTRY row 3 8 spell_eff - READ_2DA_ENTRY row 4 8 innate_spell - READ_2DA_ENTRY row 5 8 real_spell - READ_2DA_ENTRY row 6 8 switch_spell - READ_2DA_ENTRY row 7 8 switch_subspell - INNER_ACTION BEGIN - ACTION_IF (FILE_EXISTS_IN_GAME ~%spell_res%.spl~) BEGIN - COPY_EXISTING ~%spell_res%.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 -// make innates with cloned spell effects - ACTION_IF NOT FILE_EXISTS_IN_GAME ~%innate_spell%.spl~ BEGIN - COPY_EXISTING ~%spell_res%.spl~ ~override/%innate_spell%.spl~ - WRITE_SHORT 0x1c 4 - WRITE_LONG 0x34 spell_level - READ_LONG 0x64 abil_offset - READ_SHORT 0x68 abil_number - READ_BYTE (%abil_offset% + 0x0c) abil_target - READ_SHORT (%abil_offset% + 0x0e) abil_range - READ_LONG 0x6a eff_offset - WHILE (%abil_number% > 0) BEGIN - SET abil_number = (%abil_number% - 1) - WRITE_SHORT (%abil_offset% + 0x26 + (0x28 * %abil_number%)) 1 - END - LPF DELETE_EFFECT END - PATCH_IF (%abil_target% = 4) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 148 target = 1 power = 0 parameter1 = 0 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%real_spell%~ END - PATCH_IF (%abil_range% < 35) BEGIN - PATCH_IF (%abil_range% > 4) BEGIN - LPF ALTER_SPELL_HEADER INT_VAR range = (%abil_range% - 3) END - END - PATCH_IF (%abil_range% < 5) BEGIN - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - END - END - END - ELSE BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 2 power = 0 parameter2 = 1 timing = 9 STR_VAR resource = EVAL ~%real_spell%~ END - END - PATCH_IF !(MOD_IS_INSTALLED ~tomeandblood.tp2~ ~62~) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5src-%spell_level%~ END - END - PATCH_IF (MOD_IS_INSTALLED ~tomeandblood.tp2~ ~62~) BEGIN - PATCH_IF (%spell_level% > 1) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5src-%spell_level%~ END - END - END - PATCH_IF (lose_spell_on_interrupt = 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5ssplz~ END - END - PATCH_IF (lose_spell_on_interrupt = 1) BEGIN - LPF ADD_SPELL_CFEFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5ssplz~ END - END - END -// make .EFFs adding the arcane clone - CREATE EFF ~%spell_eff%~ - WRITE_LONG 0x10 171 - WRITE_LONG 0x14 1 - WRITE_LONG 0x24 0 - WRITE_LONG 0x28 1 - WRITE_SHORT 0x2c 100 - WRITE_EVALUATED_ASCII 0x30 ~%innate_spell%~ #8 - WRITE_LONG 0x90 1 - WRITE_EVALUATED_ASCII 0x94 ~%spell_eff%~ #8 -// make 206 spells preventing the .EFF - COPY ~tomeandblood/lib/d5_base.spl~ ~override/%206_spell%.spl~ - WRITE_SHORT 0x1c 4 - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END -// add 206 spells to CLAB spell - COPY_EXISTING ~d5w206.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 9 STR_VAR resource = EVAL ~%206_spell%~ END -// make learn spells canceling the 206 - COPY ~tomeandblood/lib/d5_base.spl~ ~override/%learn_spell%.spl~ - WRITE_EVALUATED_ASCII 0x3a ~%spell_icon%~ #8 - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~%206_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter1 = 0 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5ssplz~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = 19 parameter2 = 105 timing = 0 duration = 0 STR_VAR resource = EVAL ~%learn_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 171 target = 1 timing = 9 STR_VAR resource = EVAL ~%real_spell%~ END -// make copy of learn spell for kjeron's UI system (eventually, just rename the learn spell to this name) -// overwrite the existing ones -// COPY_EXISTING ~%learn_spell%.spl~ ~override/%spell_res%M.spl~ -// add subspell to switch spell - ACTION_IF (FILE_EXISTS_IN_GAME ~%switch_spell%.spl~) BEGIN - COPY ~tomeandblood/lib/d5_base.spl~ ~override/%switch_subspell%.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 1 STR_VAR resource = EVAL ~%learn_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%206_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter1 = 0 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5ssplz~ END -// LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = 19 parameter2 = 105 timing = 0 duration = 0 STR_VAR resource = EVAL ~%switch_subspell%~ END - COPY_EXISTING ~%switch_spell%.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%switch_subspell%~ END - BUT_ONLY - END -// add 172 to d5ssplz# - COPY_EXISTING ~d5ssplz.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~%innate_spell%~ END -// generate slot#x spells - COPY_EXISTING ~d5slot%spell_level%a.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END - COPY_EXISTING ~d5slot%spell_level%b.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END - COPY_EXISTING ~d5slot%spell_level%c.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END - COPY_EXISTING ~d5slot%spell_level%d.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = EVAL ~%spell_eff%~ END - END - END // end inner_action - END // end for each row -BUT_ONLY - -APPEND ~d5sorc.2da~ ~LEARNSPLS GA_D5MSOR1 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ -APPEND ~d5sorc.2da~ ~LEARNSPLS AP_D5MSOR2 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ - - -//remove known spells right after chargen_____________________________________________ -// -APPEND ~d5sorc.2da~ ~NO_WSPLS AP_D50WSPL **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ - - -//apply EFF protections_______________________________________________________________ -// -APPEND ~d5sorc.2da~ ~NO_WSPLS AP_D5W206 **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ - - -//daily spell slot refresh____________________________________________________________ -// -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5slotz.spl~ - PATCH_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_MULTI_SORC~)) BEGIN - INNER_ACTION BEGIN - COPY_EXISTING ~splstate.ids~ ~override~ - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW rows cols - FOR (row = 1; row < rows; ++row) BEGIN - READ_2DA_ENTRY_FORMER rows row 1 ~state_name~ - READ_2DA_ENTRY_FORMER rows row 0 ~state_ind~ - PATCH_IF (~%state_name%~ STRING_EQUAL_CASE ~D5_MULTI_SORC~) BEGIN - SET multi_sorc_state = %state_ind% - END - END - BUT_ONLY - END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 328 target = 1 special = 1 parameter2 = %multi_sorc_state% timing = 9 END - END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = ~d5slots~ END - -APPEND ~d5sorc.2da~ ~SPLSLOTS AP_D5SLOTZ **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ - -CREATE EFF ~d5slots~ - WRITE_LONG 0x10 232 - WRITE_LONG 0x14 1 - WRITE_LONG 0x1c 0 - WRITE_LONG 0x20 20 - WRITE_LONG 0x24 9 - WRITE_SHORT 0x2c 100 - WRITE_ASCII 0x30 ~d5sslot~ #8 - WRITE_LONG 0x48 102 - -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5sslot.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 0 duration = 7 STR_VAR resource = ~d5w206~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 0 parameter2 = %fatigue_value% timing = 1 STR_VAR resource = ~d5srfrsh~ END - - -// spell to refresh spell slots_______________________________________________________ -ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5srfrsh.spl~ BEGIN - COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5srfrsh.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 93 target = 1 parameter1 = 1 parameter2 = 1 timing = 1 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5src-1~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5src-2~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5src-3~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5src-4~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5src-5~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5src-6~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5src-7~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5src-8~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5src-9~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5ssplz~ END -END +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 + LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %sorcerer_cleric_code% parameter2 = %kit_is_row% timing = 1 STR_VAR resource = ~d5xltsr~ END + LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %sorcerer_thief_code% parameter2 = %kit_is_row% timing = 1 STR_VAR resource = ~d5xltsr~ END /* //make sure sequencer/contingency works if possible___________________________________ // ACTION_IF FILE_EXISTS_IN_GAME ~M_d5meta.lua~ BEGIN - // umm... actually, maybe the metamagic component will take care of this entirely...h + // umm... actually, maybe the metamagic component will take care of this entirely... END */ - /* //manually create versions of sequencer/contingency___________________________________ // @@ -1136,7 +490,6 @@ ACTION_IF FILE_EXISTS_IN_GAME ~spwi809p.spl~ BEGIN LPF ALTER_EFFECT INT_VAR silent = 1 STR_VAR resource = ~d5w4809~ END END - //multisorc no get innate sequencers__________________________________________________ // ACTION_IF FILE_EXISTS_IN_GAME ~d5adsq1m.spl~ BEGIN @@ -1149,7 +502,13 @@ ACTION_IF FILE_EXISTS_IN_GAME ~d5adsq1m.spl~ BEGIN LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5adsq3m~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5adcntm~ END - APPEND ~d5sorc.2da~ ~NO_META AP_D5MSNSQ **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ +// APPEND ~d5sorc.2da~ ~NO_META AP_D5MSNSQ **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ + + ACTION_IF (FILE_EXISTS_IN_GAME ~d5xxini.spl~) BEGIN + COPY_EXISTING ~d5xxini.spl~ ~override~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5msnsq~ END + END + END @@ -1224,19 +583,6 @@ LAF action_replace_hla STR_VAR kit_name = ~D5_SORCERER_THIEF~ remove_ability = ~ LAF action_replace_hla STR_VAR kit_name = ~D5_SORCERER_THIEF~ remove_ability = ~AP_SPWI930~ ability = ~AP_D5HL930~ END -//disable quickspell buttons and scroll learning______________________________________ -// -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5srcnq.spl~) BEGIN - COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5srcnq.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 144 target = 1 parameter2 = 3 timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 144 target = 1 parameter2 = 4 timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 144 target = 1 parameter2 = 5 timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 101 target = 1 parameter2 = 147 timing = 9 END -END - -APPEND ~d5sorc.2da~ ~NO_QUICK AP_D5SRCNQ **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ - - //add spell switching_________________________________________________________________ // ACTION_IF (FILE_EXISTS_IN_GAME ~qdtnb_switch3.qd~) BEGIN @@ -1289,44 +635,6 @@ ACTION_IF FILE_EXISTS_IN_GAME ~d5tsorc.2da~ BEGIN END -/* separate component because needs to work for both multisorc and arcanists -// bonus spell slot items_____________________________________________________________ -// -LAF arcane_spont_items END -*/ - -//fix burning hands targeting_______________________________________________________ -// -COPY_EXISTING ~spwi103.spl~ ~override~ - READ_LONG 0x08 burning_hands_strref -BUT_ONLY - -ACTION_IF (IS_AN_INT %burning_hands_strref%) BEGIN - COPY_EXISTING_REGEXP GLOB ~^.+\.spl$~ ~override~ - PATCH_IF (%SOURCE_SIZE% > 0x71) BEGIN - SET burning_change = 0 - READ_LONG 0x08 name - PATCH_IF (name = burning_hands_strref) BEGIN - GET_OFFSET_ARRAY ab_array SPL_V10_HEADERS - PHP_EACH ab_array AS int => ab_off BEGIN - PATCH_IF (burning_change = 0) BEGIN - READ_BYTE (ab_off + 0x0c) target - PATCH_IF target = 5 BEGIN - SET burning_change = 1 - END - END - END - PATCH_IF (burning_change = 1) BEGIN - LPF ALTER_SPELL_HEADER INT_VAR target = 1 END - LPF ALTER_EFFECT INT_VAR match_opcode = 148 opcode = 146 target = 2 STR_VAR match_resource = ~spwi103~ END - END - END - END - BUT_ONLY -END - - - END // end define function //____________________________________________________________________________________ diff --git a/TomeAndBlood/comp/setup_spell_switching.tpa b/TomeAndBlood/comp/setup_spell_switching.tpa index 78a244c..1982ee5 100755 --- a/TomeAndBlood/comp/setup_spell_switching.tpa +++ b/TomeAndBlood/comp/setup_spell_switching.tpa @@ -4,7 +4,7 @@ // ----------------------------- -DEFINE_ACTION_FUNCTION spell_switching INT_VAR switch_interval = 2 BEGIN +DEFINE_ACTION_FUNCTION spell_switching INT_VAR switch_interval = 1 BEGIN //duplicate splsrckn.2da______________________________________________________________ // @@ -13,9 +13,11 @@ ACTION_IF !(FILE_EXISTS_IN_GAME ~QD_SPLSRCKN.2da~) BEGIN END -//set up spell learning UI____________________________________________________________ +//set up spell learning_______________________________________________________________ // -LAF sorcerer_spell_learning END +LAM sorcerer_learning_suffix + +LAF sorcerer_spell_learning STR_VAR menu_suffix = EVAL ~%sorcerer_learn_suffix%~ END //set up switching dialogue__________________________________________________________ @@ -38,32 +40,29 @@ COPY ~d5/d5swtch2.txt~ ~weidu_external/tomeandblood/d5swtch2.txt~ OUTER_SPRINT switch_prefix @8301 OUTER_SET switch_ind = 1 -COPY_EXISTING ~d5clonsc.2da~ ~override~ - COUNT_2DA_ROWS 7 rows +COPY_EXISTING ~d5xclons.2da~ ~override~ + COUNT_2DA_COLS cols + COUNT_2DA_ROWS cols rows FOR (row = 0; row < rows; ++row) BEGIN - READ_2DA_ENTRY row 0 8 spell_res - READ_2DA_ENTRY row 2 8 learn_spell - READ_2DA_ENTRY row 6 8 switch_spell + READ_2DA_ENTRY row 0 cols spell_ind + READ_2DA_ENTRY row 2 cols spell_res + SPRINT learn_spell ~%spell_res%%sorcerer_learn_suffix%~ + SPRINT switch_spell ~d5x%spell_ind%h~ INNER_ACTION BEGIN - ACTION_IF (FILE_EXISTS_IN_GAME ~%spell_res%.spl~) BEGIN - COPY_EXISTING ~%spell_res%.spl~ ~override~ - READ_STRREF NAME1 spell_name -// READ_STRREF UNIDENTIFIED_DESC spell_description - READ_ASCII 0x3a spell_icon - BUT_ONLY -// make learn spell spells - COPY ~tomeandblood/lib/d5_base.spl~ ~override/%learn_spell%.spl~ - WRITE_EVALUATED_ASCII 0x3a ~%spell_icon%~ #8 - LPF ALTER_SPELL_HEADER STR_VAR icon = EVAL ~%spell_icon%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 171 target = 1 timing = 9 STR_VAR resource = EVAL ~%spell_res%~ END + ACTION_IF (FILE_EXISTS_IN_GAME ~%spell_res%.spl~) BEGIN + COPY_EXISTING ~%spell_res%.spl~ ~override~ + READ_STRREF NAME1 spell_name +// READ_STRREF UNIDENTIFIED_DESC spell_description + READ_ASCII 0x3a spell_icon + BUT_ONLY // make 172 spell - COPY ~tomeandblood/lib/d5_base.spl~ ~override/%switch_spell%.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 1 STR_VAR resource = EVAL ~%spell_res%~ END + COPY ~tomeandblood/lib/d5_base.spl~ ~override/%switch_spell%.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 1 STR_VAR resource = EVAL ~%spell_res%~ END // set up dialogue - OUTER_SPRINT switch_spell_text ~%switch_prefix%: %spell_name%~ - APPEND_OUTER ~weidu_external/tomeandblood/d5swtch1.txt~ ~~~~~IF ~HaveKnownSpellRES("%spell_res%")~ THEN REPLY ~%spell_name%~ GOTO d5_swtch_%switch_ind%~~~~~ KEEP_CRLF - APPEND_OUTER ~weidu_external/tomeandblood/d5swtch2.txt~ ~~~~~IF ~~ THEN BEGIN d5_swtch_%switch_ind% %WNL% SAY ~%switch_spell_text%~ %WNL% IF ~~ THEN REPLY @8303 DO ~ApplySpellRES("%switch_spell%",myself)~ EXIT %WNL% IF ~~ THEN REPLY @8304 GOTO d5_swtch %WNL% IF ~~ THEN REPLY @8302 EXIT %WNL% END %WNL%~~~~~ KEEP_CRLF - END + OUTER_SPRINT switch_spell_text ~%switch_prefix%: %spell_name%~ + APPEND_OUTER ~weidu_external/tomeandblood/d5swtch1.txt~ ~~~~~IF ~HaveKnownSpellRES("%spell_res%")~ THEN REPLY ~%spell_name%~ GOTO d5_swtch_%switch_ind%~~~~~ KEEP_CRLF + APPEND_OUTER ~weidu_external/tomeandblood/d5swtch2.txt~ ~~~~~IF ~~ THEN BEGIN d5_swtch_%switch_ind% %WNL% SAY ~%switch_spell_text%~ %WNL% IF ~~ THEN REPLY @8303 DO ~ApplySpellRES("%switch_spell%",myself)~ EXIT %WNL% IF ~~ THEN REPLY @8304 GOTO d5_swtch %WNL% IF ~~ THEN REPLY @8302 EXIT %WNL% END %WNL%~~~~~ KEEP_CRLF + END END SET ++switch_ind END @@ -147,7 +146,7 @@ COPY ~tomeandblood/data/core/d5spm3m.spl~ ~override~ SAY NAME1 @1100 SAY UNIDENTIFIED_DESC @1100 WRITE_ASCII 0x3a ~d5spm3mb~ #8 - LPF ALTER_SPELL_HEADER STR_VAR icon = ~d5spm3mb~ END + LPF ALTER_SPELL_HEADER INT_VAR speed = 0 target = 7 STR_VAR icon = ~d5spm3mb~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = ~d5spm3m~ END diff --git a/TomeAndBlood/data/multi_sorcerers/d5zlosr.cre b/TomeAndBlood/data/multi_sorcerers/d5zlosr.cre new file mode 100644 index 0000000000000000000000000000000000000000..499d1e52d9ed35645914c0e1c39c2001c4e3fa8f GIT binary patch literal 2120 zcmeHIOHKko5Ul|Q85YKgCdOcl2T(K3AQE-ON1a5F42dSLF~N;4Jb*4;>lHkPD;J)? z19%K~T5oy^=#B{nRz|Bs`n}iH)z#GnG~(9!soDxYQzN$fMWQl5Y7J_TdrMT>-}RSE z2e48&K;tl|@$nj$gX++y!g@B3Z_rV-8;oaI9mWj+y}C@);a) z#@7?dC!yXjsU>3BSl3%>uafihJM4^bQg7`Os*#R2k(hV~!FUH?u{s0c{ZzC$(fh0T z&pO-Rl<(rf=R4ijBu`tPhPQZ=9Z$H_WtzCZZO+bMBpzsYcf;- literal 0 HcmV?d00001 diff --git a/TomeAndBlood/lib/misc_tnb_functions.tpa b/TomeAndBlood/lib/misc_tnb_functions.tpa index e545b11..bd7a86a 100755 --- a/TomeAndBlood/lib/misc_tnb_functions.tpa +++ b/TomeAndBlood/lib/misc_tnb_functions.tpa @@ -598,183 +598,73 @@ END //////////////////////////////////////////////////////////////////////// -//set up spell learn UI screens_______________________________________________________ -// -DEFINE_ACTION_FUNCTION sorcerer_spell_learning BEGIN - -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5__wiz_learn.d5~) BEGIN - -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d50wspl.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~SPWI908~ END - PATCH_IF !(MOD_IS_INSTALLED ~TomeAndBlood.tp2~ ~16~) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = ~SPWI110~ END - END - PATCH_IF !(MOD_IS_INSTALLED ~TomeAndBlood.tp2~ ~55~) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~SPWI420~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~SPWI710~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~SPWI809~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~SPWI617~ END - END - -// basic sorcerer spell-choice list -<<<<<<<< d5/d5msorc.2da -2DA V1.0 -**** - ResRef Type>>>>>>>> -COPY ~d5/d5msorc.2da~ ~override/d5msorc.2da~ - -// identical, but for mana sorcerers -<<<<<<<< d5/d5mnsrc.2da -2DA V1.0 -**** - ResRef Type>>>>>>>> -COPY ~d5/d5mnsrc.2da~ ~override/d5mnsrc.2da~ - -// multisorcerer spell system legend -<<<<<<<< d5/d5clonsc.2da -2DA V1.0 -SPLRES - 206 LEARN EFF INNATE DISPLAY SWITCH SWITCH2 ->>>>>>>> -COPY ~d5/d5clonsc.2da~ ~override/d5clonsc.2da~ - -// mana sorcerer spell system legend -<<<<<<<< d5/d5clonmn.2da -2DA V1.0 -SPLRES - 206 LEARN EFF INNATE DISPLAY SWITCH SWITCH2 ->>>>>>>> -COPY ~d5/d5clonmn.2da~ ~override/d5clonmn.2da~ - -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 ~this_spell~ ~%SOURCE_RES%~ - READ_STRREF NAME1 spell_name - READ_STRREF UNIDENTIFIED_DESC spell_description - READ_ASCII 0x3a spell_icon - PATCH_IF (FILE_CONTAINS_EVALUATED (~spell.ids~ ~2%spell_num%~)) BEGIN - INNER_PATCH_SAVE sorc_206_spell ~%SOURCE_RES%~ BEGIN - REPLACE_TEXTUALLY ~^[Ss][Pp][Ww][Ii]~ ~d5w6~ - END - INNER_PATCH_SAVE mana_206_spell ~%SOURCE_RES%~ BEGIN - REPLACE_TEXTUALLY ~^[Ss][Pp][Ww][Ii]~ ~d5m6~ - END - INNER_PATCH_SAVE sorc_learn_spell ~%SOURCE_RES%~ BEGIN -// REPLACE_TEXTUALLY ~^[Ss][Pp][Ww][Ii]~ ~d5wx~ - REPLACE_TEXTUALLY ~%SOURCE_RES%~ ~%SOURCE_RES%W~ - END - INNER_PATCH_SAVE mana_learn_spell ~%SOURCE_RES%~ BEGIN -// REPLACE_TEXTUALLY ~^[Ss][Pp][Ww][Ii]~ ~d5mx~ - REPLACE_TEXTUALLY ~%SOURCE_RES%~ ~%SOURCE_RES%M~ - END - INNER_PATCH_SAVE sorc_innate_spell ~%SOURCE_RES%~ BEGIN - REPLACE_TEXTUALLY ~^[Ss][Pp][Ww][Ii]~ ~d5w4~ - END - INNER_PATCH_SAVE mana_innate_spell ~%SOURCE_RES%~ BEGIN - REPLACE_TEXTUALLY ~^[Ss][Pp][Ww][Ii]~ ~d5m4~ - END - INNER_PATCH_SAVE sorc_spell_eff ~%SOURCE_RES%~ BEGIN - REPLACE_TEXTUALLY ~^[Ss][Pp][Ww][Ii]~ ~D5WV~ - END - INNER_PATCH_SAVE mana_spell_eff ~%SOURCE_RES%~ BEGIN - REPLACE_TEXTUALLY ~^[Ss][Pp][Ww][Ii]~ ~D5MV~ - END - INNER_PATCH_SAVE 172_spell ~%SOURCE_RES%~ BEGIN - REPLACE_TEXTUALLY ~^[Ss][Pp][Ww][Ii]~ ~d5sz~ - END - INNER_PATCH_SAVE multi_172_subspell ~%SOURCE_RES%~ BEGIN - REPLACE_TEXTUALLY ~^[Ss][Pp][Ww][Ii]~ ~d5wz~ - END - INNER_PATCH_SAVE mana_172_subspell ~%SOURCE_RES%~ BEGIN - REPLACE_TEXTUALLY ~^[Ss][Pp][Ww][Ii]~ ~d5mz~ - END - INNER_ACTION BEGIN - APPEND ~d5msorc.2da~ ~sorcerer %this_spell% 3~ - APPEND ~d5mnsrc.2da~ ~manasorc %this_spell% 3~ - APPEND ~d5clonsc.2da~ ~%this_spell% %sorc_206_spell% %sorc_learn_spell% %sorc_spell_eff% %sorc_innate_spell% %this_spell% %172_spell% %multi_172_subspell% ~ - APPEND ~d5clonmn.2da~ ~%this_spell% %mana_206_spell% %mana_learn_spell% %mana_spell_eff% %mana_innate_spell% %this_spell% %172_spell% %mana_172_subspell% ~ -// make learn spells canceling the 206 - COPY ~tomeandblood/lib/d5_base.spl~ ~override/%this_spell%M.spl~ - WRITE_EVALUATED_ASCII 0x3a ~%spell_icon%~ #8 - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 171 target = 1 timing = 9 STR_VAR resource = EVAL ~%this_spell%~ END -// remove all known spells after chargen - COPY_EXISTING ~d50wspl.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~%this_spell%~ END - END - END - END +// Add new ability header to current spell resource + +DEFINE_PATCH_FUNCTION D5_ADD_ONE_SPELL_HEADER + +INT_VAR + type = 1 + location = 4 + target = 1 + target_count = 0 + range = 0 + required_level = 1 + speed = 0 + projectile = 1 + copy_header = 0 + insert_point = ~-1~ +STR_VAR + icon = ~~ +RET + insert_point +BEGIN + SET hs = 0x28 + READ_LONG 0x64 ho + READ_SHORT 0x68 hc + READ_LONG 0x6a eo + SET insert_point = (insert_point > hc || insert_point < 0) ? hc : insert_point + SET copy_header = (copy_header < 0) ? 0 : copy_header + PATCH_IF (copy_header > hc) BEGIN + PATCH_WARN ~WARNING: Unable to copy %copy_header%th header, %SOURCE_FILE% contains only %hc% headers!~ + END ELSE BEGIN + INSERT_BYTES (ho + insert_point * hs) hs + SET hc += 1 + SET eo += hs + PATCH_IF (copy_header) BEGIN + READ_SHORT (ho + (copy_header - 1) * hs + 0x1e) ec + READ_SHORT (ho + (copy_header - 1) * hs + 0x20) ei + READ_ASCII (eo + ei * 0x30) effs (ec * 0x30) + READ_ASCII (ho + (copy_header - 1) * hs) copy (hs) + WRITE_ASCIIE (ho + insert_point * hs) ~%copy%~ (hs) + END + WRITE_SHORT 0x68 hc + WRITE_LONG 0x6a eo + READ_SHORT 0x70 ei // technically, it is a counter + FOR (i = ho; i < ho + hc * hs; i += hs) BEGIN + READ_SHORT (i + 0x1e) ec + WRITE_SHORT (i + 0x20) ei + SET ei += ec + END + PATCH_IF (copy_header) BEGIN + READ_SHORT (ho + insert_point * hs + 0x1e) ec + READ_SHORT (ho + insert_point * hs + 0x20) ei + INSERT_BYTES (eo + ei * 0x30) (ec * 0x30) + WRITE_ASCIIE (eo + ei * 0x30) ~%effs%~ (ec * 0x30) + END ELSE BEGIN + SET off = ho + insert_point * hs + WRITE_BYTE off type + WRITE_BYTE (off + 0x2) location + WRITE_ASCIIE (off + 0x4) ~%icon%~ (8) + WRITE_BYTE (off + 0xc) target + WRITE_BYTE (off + 0xd) target_count + WRITE_SHORT (off + 0xe) range + WRITE_SHORT (off + 0x10) required_level + WRITE_LONG (off + 0x12) speed + WRITE_SHORT (off + 0x26) projectile + END END - END -BUT_ONLY - -INCLUDE ~tomeandblood/lib/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 = ~W~ -END - -COPY_EXISTING ~d5msorc.2da~ ~override/d5msorcX.2da~ - -COPY ~tomeandblood/data/multi_sorcerers/d5lernwi.bam~ ~override~ - -COPY ~tomeandblood/data/multi_sorcerers/d5msorc.itm~ ~override~ // learn spells .itm - SAY NAME1 @17021 - SAY NAME2 @17021 - SAY UNIDENTIFIED_DESC @17022 - SAY IDENTIFIED_DESC @17022 - LPF ALTER_ITEM_HEADER INT_VAR target = 7 speed = 0 STR_VAR icon = ~d5lernwi~ END - -OUTER_INNER_PATCH ~1~ BEGIN - WRITE_BYTE 0 0x09 - READ_ASCII 0 tab (1) // 0x09, tab - WRITE_BYTE 0 0x0d - READ_ASCII 0 mnl (1) // 0x0d, Mac -END -LAF ~ADD_ITEM_TOOLTIPS~ STR_VAR item = EVAL ~%learn_res%~ tooltips = ~@17021~ END - -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5msor1.spl~ - SAY NAME1 @17050 - SAY UNIDENTIFIED_DESC @17050 - WRITE_SHORT 0x1c 4 - LPF ALTER_SPELL_HEADER INT_VAR target = 5 location = 4 STR_VAR icon = ~d5lernwi~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 143 target = 1 parameter1 = 14 timing = 9 STR_VAR resource = ~d5msorc~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (2 << 24) parameter2 = (115 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = ~d5msor1~ END - -COPY ~tomeandblood/lib/d5_base.spl~ ~override/d5msor2.spl~ - SAY NAME1 @17050 - SAY UNIDENTIFIED_DESC @17050 - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5msor1~ END - -COPY ~tomeandblood/lib/d5_marker.d5~ ~override/d5__wiz_learn.d5~ - END -END // end define function //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// diff --git a/TomeAndBlood/lib/semi_spont/SEQUENCER_MENU.tpa b/TomeAndBlood/lib/semi_spont/SEQUENCER_MENU.tpa new file mode 100644 index 0000000..dbbca74 --- /dev/null +++ b/TomeAndBlood/lib/semi_spont/SEQUENCER_MENU.tpa @@ -0,0 +1,618 @@ + + // UI-based Spell Learning tool for Sorcerers/Shamans + // v0.60 + + // This function is designed to implement a UI-based Spell selection system, as an alternative to dialog-based Spell Selection, utilizing + // the Sequencer/Contingency spell selection menu to learn arcane or divine spells. Innate abilities "can" be learned this way as well, + // but cannot currently be tracked, and are thus not supported. + + // Changes it makes to UI.MENU are kept to an absolute minimum, to reduce the chances of incompatibility, but any UI mod that + // outright replaces UI.MENU will obviously not be compatible. + + // The function requires a 7-character filename and creates the following files:
    + // - '%filename%.SPL' - Usable at-will innate ability to access spell menu. + // - '%filename%D.SPL' - Sequencer activation subspell, activated automatically. + // - '%filename%X.EFF' - Sequencer creation EFF + // - '%filename%X.2DA' - Primary spell list, identical in form to the spell lists for Opcode 214 (Select Spell). + // If specified, the function will automatically populate the list with appropriate "default" spells (SPPR/SPWI), based on HIDESPL.2DA and the + // specified exclusion flag. Spells may be manually appended to the list as desired, and spell level is automatically detected and filtered by the UI. + // - '%filename%G.EFF', '%filename%.CRE', '%filename%.BCS' - Created only if using GLOBAL/LOCALS variables option, EFF summons CRE, CRE runs BCS. + + // All spells that can be learned will require an "L" suffixed subspell, using the same spellbook Icon and containing a single opcode 171 effect + // referencing the main spell. These will be created automatically for SPWI/SPPR spells added to the primary spell list by the function. + // The function call is as such: + // -------------------------------------------------------------------------------------------------------------------------------------------------------------- + // INCLUDE ~%filepath%/SEQUENCER_MENU.TPA~ + // LAF CREATE_SEQUENCER_MENU + // INT_VAR + // tip = stringRef + // String Reference from dialog.tlk, this is the Instructions displayed in the Sequencer Screen + // name = stringRef + // String Reference from dialog.tlk, this is the name of the ability used to open the Sequencer Menu + // desc = stringRef + // String Reference from dialog.tlk, this is the description for the ability used to open the Sequencer Menu + // class = value + // 1 for arcane, else divine, doesn't matter if using custom spell lists. + // maxlevel = value + // If non-zero, only spells up to this level will be automatically added to the primary spell list. + // If zero, no spells will be added (to add them manually or use custom mutlilists). + // If omitted, default maximum is used (9 for arcane, 7 for divine). + // exclude = value + // If any exclusion flags at offset 0x1e of a spell match this value, it will be excluded from the primary spell list. + // multilist = boolean + // If non-zero, function assumes that primary spell list is instead a list of other 2da files each with their own spell lists, all of which will be made available. + // Intended for School/Sphere systems, so that each school/sphere can have it's own list, while kits would just have a list of those lists as needed. + // Such sub-lists 'must' have an accompanying spell of the same name. + // If "Sphere1.2da" is a list of spells, "Sphere1.spl" must exist as a spell file, though it can be an otherwise empty file. + // column = value + // for use with custom spelllists, column of file to use. + // alignment = boolean + // If non-zero, function enforces that spell selection should respect alignment restrictions (currently only if they are provided by an external source). + // global = value + // If non-zero, function will read known spells in LOCALS and GLOBAL variables. Activating ability will take up to 1 second before menu pops up while variables are set. + // If 1, Subspells to learn spells will need to be setup manually, since this mode is only intended for spells that cannot be "known" in the normal manner. + // If 2, subspells are still created as normal. + // If the spells LOCALS variable is set to 1, it will be considered "known" and count towards the known spell limit. + // If the spells LOCALS variable is set to 2, it will be considered "known" but not count towards the known spell limit. + // The LOCALS/GLOBAL variable for each spell is it's RESREF. + // + // STR_VAR + // resref = ~filename~ + // 7-character or less filename for Spell Selection ability + // icon = ~filename~ + // Icon for Spell Selection ability + // spelltable = ~filename~ + // 2DA table (no extension) for Known Spells, defaults to SPLSRCKN(.2DA) or SPLSHMKN(.2DA) if not specified. + // If used, SPLSRCKN.2DA and/or SPLSHMKN.2DA will be cloned as SPLSRCKN_BACKUP.2DA and SPLSHMKN_BACKUP.2DA for future referencing, + // while the main files are zeroed out so that normal spell selection is disabled. + // The specified 2DA File must exist in game. + // spelllist = ~filename~ + // 2da file with custom spell list, only spells in this file will be added, still subject to maxlevel. + // First column can contain either IDS label or RESREF of a spell + // Other columns contain either '1' (yes) or '0' (no). + // title = ~string~ + // String to display in main "Title" slot of Sequencer Screen, added to appropriate "L_%EE_LANGUAGE%.LUA" file. + // label = ~string~ + // String to display in sub "Title" slot of Sequencer Screen, added to appropriate "L_%EE_LANGUAGE%.LUA" file. + // attribute = ~value/string~ + // 1, STR, STRENGTH, 2, DEX, DEXTERITY, 3, CON, CONSTITUTION, 4, INT, INTELLIGENCE, 5, WIS, WISDOM, 6, CHA, CHR, CHARISMA + // Is not case sensitive. Omit if not needed. + // attrtable = ~filename~ + // 2DA table (no extension) with bonus/penalty to Known spells based on specified attribute. + // Format is identical to the priests bonus wisdom spell table, MXSPLWIS.2DA. + // Table can contain postive and negative values. A sufficiently large penalty can be used to prevent selecting spells at the specified attribute score. + // The specified 2DA File must exist in game. + // custom = ~lua function~ + // Specifying this variable will install the core functions and assign 'custom' to the 'resref'. All other fields are ignored. + // No other files are created, no other entries are added. + // subspell = ~character~ + // Default = ~L~ + // Subspells for each learnable spell will be created, appended with this character (SPPR101.SPL -> SPPR101L.SPL) + // Must be a single character, must not already be in use by spells (A,B,C,D,F,P are not permiited) + // blacklist = ~variable name~ + // Array ~%blacklist%~ will be scanned over for IDS spell labels as well as spell resrefs. + // All valid spells listed will be ommitted from the auto-generated spell lists. + // No function when using pre-built spell lists. + // END + // -------------------------------------------------------------------------------------------------------------------------------------------------------------- + // The following code will mimic the default sorcerer/shaman spell options (provided proper tra references): + // -------------------------------------------------------------------------------------------------------------------------------------------------------------- + // OUTER_SPRINT title @293 OUTER_SPRINT action @294 + // LAF CREATE_SEQUENCER_MENU + // INT_VAR class = 2 maxlevel = 7 exclude = 0x80000000 tip = RESOLVE_STR_REF (@295) name = RESOLVE_STR_REF (@293) desc = RESOLVE_STR_REF (@293) + // STR_VAR resref = ~SPLSHMK~ icon = ~SPPR316B~ title action attribute = ~~ attrtable = ~~ + // END + // OUTER_SPRINT title @290 OUTER_SPRINT action @291 + // LAF CREATE_SEQUENCER_MENU + // INT_VAR class = 1 maxlevel = 9 exclude = 0x00004000 tip = RESOLVE_STR_REF (@292) name = RESOLVE_STR_REF (@290) desc = RESOLVE_STR_REF (@290) + // STR_VAR resref = ~SPLSRCK~ icon = ~SPPR316B~ title action attribute = ~~ attrtable = ~~ + // END + // -------------------------------------------------------------------------------------------------------------------------------------------------------------- + // The following is optional code to flag a spell that is on the list of available choices has been given for "free", not counting against their known limit. + // Apply (w/ Timing Mode 9) the EFF file to the creature when the spell is gained, to prevent it from counting against their spell limit. + // "SPELL_RES" should be the resref of this "bonus" spell. "%resref%" should be the same string that was passed to the CREATE_SEQUENCER_MENU function. + // -------------------------------------------------------------------------------------------------------------------------------------------------------------- + // APPEND ~M_SQLIST.LUA~ ~mageBookStrings['%resref%'].title = mageBookStrings['%resref%X'].title~ + // CREATE EFF ~(unique)~ WRITE_LONG 0x10 256 WRITE_LONG 0x2c 100 WRITE_ASCII 0x30 ~SPELL_RES~ WRITE_LONG 0x60 1 WRITE_ASCIIE 0x94 ~%resref%~ + // -------------------------------------------------------------------------------------------------------------------------------------------------------------- + + DEFINE_ACTION_FUNCTION SETUP_SEQUENCER_MENU BEGIN + OUTER_SET version = 60 OUTER_SET current = 0 + PRINT ~Running CREATE_SEQUENCER_MENU version#: 0.%version%~ + ACTION_IF !FILE_EXISTS_IN_GAME ~M_SQLIST.LUA~ BEGIN + COPY_EXISTING ~BGEE.LUA~ ~override\M_SQLIST.LUA~ DELETE_BYTES 0 SOURCE_SIZE APPEND ~M_SQLIST.LUA~ ~SequencerMenu = {}~ + END + ACTION_IF FILE_EXISTS_IN_GAME ~M_SQTOOL.LUA~ BEGIN + COPY_EXISTING ~M_SQTOOL.LUA~ override REPLACE_EVALUATE ~[%WNL%^]\-\-SEQUENCER_MENU_VERSION:\([0-9]+\)[%WNL%]~ BEGIN SET current = MATCH1 END ~%MATCH0%~ BUT_ONLY + END ELSE BEGIN + COPY_EXISTING ~UI.MENU~ override + REPLACE_TEXTUALLY ~function[ %TAB%]+filterContingencyMageSpells()~ ~function Redirect_filterContingencyMageSpells()~ + REPLACE_TEXTUALLY ~function[ %TAB%]+magePageInfo()~ ~function Redirect_magePageInfo()~ + REPLACE_TEXTUALLY ~mageBookEnabled[ %TAB%]+==[ %TAB%]+true~ ~((mageBookEnabled == true) or (bookMode == 1))~ + REPLACE_TEXTUALLY ~mageBookEnabled[ %TAB%]+==[ %TAB%]+false~ ~mageBookEnabled == false and bookMode == 0~ + REPLACE_TEXTUALLY ~value\.castableCount[ %TAB%]+=[ %TAB%]+v\.castableCount~ ~value.castableCount = v.castableCount + value.level = v.level~ +<<<<<<<< .../inlined.bam +>>>>>>>> + OUTER_SPRINT bam ~434D414220203156000007AE93ED9C78551373DF4A4FC71458D9247F924A05B4E34B68469B09B04ED909B36C6D34D934D376CB429B498DB4A69B69B5A46927497487483F505B42987E5378463EA38E8C3A0F883900753E0A0661D17D4707C46619D054195828207F67AC9C70384FF8CBECEF9D9ECE73F7BDD9CF67BDEDF8E3EB76FB6A112B602805CAB2900047C69E01158E1336140AA3EB5801AA8156504D67450A02D65A89350029C53286C7137B5C54055027E89DCE1F895CEF2BDB0D00DACF4F43CEFA9F9017F91C8E01793D5E03BA9E4E17DD8EC70F3BD9B98506DFC3D03615752BD8C55C6E8D531873403942AA180AF5BBA184BF9BC4E19FC1F870FB89285803F05ED7803E52260BFFB7DEE27FF451CCF02F6F89DDC126BB5CE0DFD2D2A6C1AFB45150EBDA361B0ABE33B3047CA5D2E1F741E4FA1207C06E10FC704BEFA64C12E50AFB5C2521E7CBCA0B835A14EB3C2417D707C41647E2A2A0C6DFB7F09B057FBC5D587BEDF437A095F673BC1BDD34EC114B2E4F848C45DF987D5A81292B3DDE0E8257B841987B9696B6EA0963FA74879C2F1A3017055DC702DA1D73075E635F7D0F346812C25750C0E56095EFDE701AE82E5941DF35C68EC16821EBCCB541EFB5B788FD0A077955418090699ED6065FB121FC612121EA7DA812FCDE6C611757546C1EE04FED077ED5DAEC12DEA077412912D3B3040B7FAB6C603763065D82587452A0F39691D1819D3EE3E0DB9CA8C185E1701BFBFA7047E39B9A094CAF7DC73F34EA2EC0C0AF75E8827EC78B1026F161595067C46E4F0639C7C716FC87CD09E10DFE3130FFC12DAEC5379FF69DB526B3DDCE3071D1A5C2566EC308B8B460EDD6284AD6D6DBA936AB73978F68634228FBA92AB532B6F586265429D7FB1D1D91CBBF018D9D56B6528FB41D0CB90BA9D03D4DC86DF84760A6EADE6751C0104C47A36BAD3B061A39D730DDB4BB1BAF7DB51A7BE66747A7A42148E74A297BC91B0DAEAFB9BE1EB566CBBF6681C907945CF23E91B62334998F7DB4ECA2C68CCBBFBEA06433D7B758B123643F3DB45CED060FAC314E1DE178458B11BB776B81B1FAC347111E2C44E196C22D16CD649AC48C5C617D3189631E302BD8889A152A85A2A247D2A6747522D60E9D89F12346649A8650D64DFD262A22684C592CB2E6247530C7D189CD9B618CE1890BA42B0061990DDAE29967319CD9BCC94B29F927A8C9AC4EAF5EE807F705D2954B615219E6769D9673BCF98DC25ACD9AE31F75198454A7ABEBEE0B817A4CCCCE0820A74899E927466BA8C99C4256BD8306946845491F6FCE5E643D2593D279A6EFF6CD4CBA57AB9DAB556508D96BAAD248164CAFF21051A7BCD49B18A6C362D08A652AB493CED74773E3C2853D32050BA9D76B43B69DB3BCB1B01DF76D13B4FC076D679AA3B945928ACE422E92D5AB995F14ECD9CF02C920DB49678E46DBBD7EAA56D4A91618B8231B98A20A9E79629F131DAFC5F46B9BA7D443DA5DD6D31D6E2C51F027E592CE6502962CB852737C27597A36EF308F4E7A573A572698B0783CC72AC31BA8B9BCA3F7B1E777163442F9DA6371938A374AE5A34E3889CED72305FD8A97B848B441D8B9397A43886E9D3FD63134C8EE0AF45F50762B2689A42E9E7165BA5A7641796428A5089E6D82E1962260EC6A3CBCB0B1DCEAF4C01388CB738C43AD08DBA3A54DA43711BA20587D5438BFC06A21906A921328DB477CE0EC62E98FB67A8694215D48C8FA0171453E7AB5A56D8CDD8BC65AB701D9996FFD7EB12373FCE7FFA38A192E2A0DBD31CF54D8468AEF8FDF7E7149D36621A14DFAD54A755D71524AC97E4CDFAD751C00E621B248C15C6D3FF63FC50000BE8D~ + COPY ~.../inlined.bam~ ~override\M_SQMENU.BAM~ + INSERT_BYTES 0 0x528 + FOR (i = 0; i < 0x528; i += 4) BEGIN + INNER_PATCH ~%bam%~ BEGIN READ_ASCII (i * 2) long (8) END + WRITE_LONG i EVAL ~0x%long%~ + END + DELETE_BYTES 0x526 2 + CREATE SPL ~M_SQMENU~ WRITE_ASCII 0x3a ~M_SQMENU~ + COPY_EXISTING ~BGEE.LUA~ ~override\M_SQMENU.LUA~ DELETE_BYTES 0 SOURCE_SIZE + END + ACTION_IF (!FILE_EXISTS_IN_GAME ~M_SQTOOL.LUA~) OR (current < version) BEGIN + COPY_EXISTING ~BGEE.LUA~ ~override\M_SQTOOL.LUA~ DELETE_BYTES 0 SOURCE_SIZE + APPEND ~M_SQTOOL.LUA~ ~~~~~--SEQUENCER_MENU_VERSION:%version% + function magePageInfo() + local text = '' + if bookMode == 1 then + if type(SequencerMenu[contingencyResRef]) == 'function' then + if SequencerMenuKnown == nil then; SequencerMenuKnown = 0; end + if SequencerMenuTotal == nil then; SequencerMenuTotal = 0; end + text = t("SPELLS_LABEL") .. " :" .. SequencerMenuKnown .. "/" .. SequencerMenuTotal + end + else + text = Redirect_magePageInfo() + end + return text + end + function filterContingencyMageSpells() + bookSpells = Redirect_filterContingencyMageSpells() + if type(SequencerMenu[contingencyResRef]) == 'function' then + SequencerMenu[contingencyResRef]() + else + SequencerMenu['DEFAULT']() + end + return bookSpells + end + SequencerMenu['DEFAULT'] = function() + local temp = {} + for k,v in pairs (bookSpells) do + if v.level == %currentLevel% - 1 then + table.insert(temp, v) + end + end + bookSpells = temp + end~~~~~ + APPEND ~M_SQTOOL.LUA~ ~~~~~ + function SequencerMenuSpellsKnown(multi,spelltable,abilFunc,abil,alignment,postfix,global) + if postfix == nil then + postfix = 'L' + end + local temp = {}; local unknown = {}; local known = 0; local num = 0; local mod = 0; + if multi ~= 0 then + if mageScreen:SpellSwappedInContingency(contingencyResRef) then + local SwapTable = contingencySwapTable + for k,v in pairs (SwapTable) do + if mageScreen:SpellSwappedInContingency(v.resref) then + for x,y in pairs (contingencySwapTable) do + if y.level == %currentLevel% then + if global then + if (Infinity_GetScriptVarInt(y.resref) == nil) or (Infinity_GetScriptVarInt(y.resref) == 0) then + unknown[y.resref] = y + elseif Infinity_GetScriptVarInt(y.resref) == 1 then + known = known + 1 + end + else + unknown[y.resref] = y + end + end + end + end + end + end + else + if mageScreen:SpellSwappedInContingency(contingencyResRef) then + for k,v in pairs (contingencySwapTable) do + if v.level == %currentLevel% then + if global then + if (Infinity_GetScriptVarInt(v.resref) == nil) or (Infinity_GetScriptVarInt(v.resref) == 0) then + unknown[v.resref] = v + elseif Infinity_GetScriptVarInt(v.resref) == 1 then + known = known + 1 + end + else + unknown[v.resref] = v + end + end + end + end + end + local length = string.len(contingencyResRef) + local contResBase = string.sub(contingencyResRef,1,length-1) + if characters[id].sequencerSpells then + for k,v in ipairs(characters[id].sequencerSpells) do + if v.resref == contResBase then + for x,y in ipairs(v.spells) do + unknown[y.resref] = nil + end + end + end + end + if characters[id].priestSpells[%currentLevel%] ~= nil then + for k,v in pairs (characters[id].priestSpells[%currentLevel%]) do + if unknown[v.resref] ~= nil then + unknown[v.resref] = nil + known = known + 1 + end + end + end + if characters[id].mageSpells[%currentLevel%] ~= nil then + for k,v in pairs (characters[id].mageSpells[%currentLevel%]) do + if unknown[v.resref] ~= nil then + unknown[v.resref] = nil + known = known + 1 + end + end + end + if alignment and (SequencerMenuAlignment ~= nil) then + local alignment = characters[id].alignment + local restrict = 0 + if alignment == (0xf000000 + 902) then alignment = 0x3 + elseif alignment == (0xf000000 + 903) then alignment = 0x5 + elseif alignment == (0xf000000 + 904) then alignment = 0x9 + elseif alignment == (0xf000000 + 1081) then alignment = 0x12 + elseif alignment == (0xf000000 + 1082) then alignment = 0x14 + elseif alignment == (0xf000000 + 1083) then alignment = 0x18 + elseif alignment == (0xf000000 + 902) then alignment = 0x22 + elseif alignment == (0xf000000 + 902) then alignment = 0x24 + elseif alignment == (0xf000000 + 902) then alignment = 0x30 + end + for k,v in pairs (unknown) do + restrict = SequencerMenuAlignment(v.resref) + for i=0,7,1 do + if restrict / 2^i > 0 and alignment / 2^i > 0 then + unknown[v.resref] = nil + i = 7 + else + restrict = restrict % 2^i + alignment = alignment % 2^i + end + end + end + end + num = SequencerMenu[spelltable]() + if type(SequencerMenu[abilFunc]) == 'function' then + mod = SequencerMenu[abilFunc](abil) + end + for k,v in pairs (unknown) do; table.insert(temp, v); end + table.sort(temp,function(a,b) return a.resref < b.resref end) + for k,v in ipairs (temp) do + if known < num + mod then + v.resref = v.resref .. postfix + else + v.resref = {} + end + end + SequencerMenuKnown = known + if num + mod > 0 then + SequencerMenuTotal = num + mod + else + SequencerMenuTotal = 0 + end + return temp + end~~~~~ + END + END + DEFINE_ACTION_FUNCTION SEQUENCER_MENU_ATTRIBUTE_TABLE STR_VAR attribute = ~~ attrtable = ~~ RET abil BEGIN + ACTION_TO_UPPER attribute + ACTION_MATCH ~%attribute%~ WITH + 1 ~1~ ~STR~ ~STRENGTH~ BEGIN OUTER_SPRINT abil ~str~ END + 2 ~2~ ~DEX~ ~DEXTERITY~ BEGIN OUTER_SPRINT abil ~dex~ END + 3 ~3~ ~CON~ ~CONSTITUTION~ BEGIN OUTER_SPRINT abil ~con~ END + 4 ~4~ ~INT~ ~INTELLIGENCE~ BEGIN OUTER_SPRINT abil ~int~ END + 5 ~5~ ~WIS~ ~WISDOM~ BEGIN OUTER_SPRINT abil ~wis~ END + 6 ~6~ ~CHA~ ~CHR~ ~CHARISMA~ BEGIN OUTER_SPRINT abil ~cha~ END + ~~ BEGIN OUTER_SET abil = 0 END + DEFAULT OUTER_SET abil = 0 WARN ~Ability Score %attribute% is invalid, no Ability score check will be added~ + END + ACTION_IF !IS_AN_INT abil BEGIN + ACTION_IF !FILE_EXISTS_IN_GAME ~%attrtable%.2DA~ BEGIN + WARN ~Attribute Table (%attrtable%.2DA) does not exist in game, no Ability score check will be added.~ + END ELSE BEGIN + OUTER_SPRINT abilVal ~string.gsub(characters[id].attr[abil].base, '/.*', '')~ + COPY_EXISTING ~%attrtable%.2DA~ override + COUNT_2DA_COLS cols READ_2DA_ENTRIES_NOW ~READ~ cols + TEXT_SPRINT else1 ~~ + TEXT_SPRINT text ~local abilVal = %abilVal%%WNL%%TAB%%TAB%abilVal = tonumber(abilVal)%WNL%%TAB%%TAB%~ + FOR (i = 1; i < cols; ++i) BEGIN + TEXT_SPRINT text ~~~~~%text%%else1%if %currentLevel% == %i% and abilVal >~~~~~ + FOR (j = 0; j < READ; ++j) BEGIN + READ_2DA_ENTRY_FORMER ~READ~ j i value + // PATCH_IF value > 0 BEGIN + READ_2DA_ENTRY_FORMER ~READ~ j 0 level --level + SET j = READ SET old = value - 1 + TEXT_SPRINT text ~~~~~%text% %level% then%WNL%%TAB%%TAB%%TAB%~~~~~ + // END + END + TEXT_SPRINT else2 ~~ + SET base = old + FOR (j = 0; j < READ; ++j) BEGIN + READ_2DA_ENTRY_FORMER ~READ~ j i value + PATCH_IF old < value BEGIN + READ_2DA_ENTRY_FORMER ~READ~ j 0 level + // PATCH_IF old > 0 BEGIN + TEXT_SPRINT text ~~~~~%text%%else2%if abilVal < %level% then; num = %old%;~~~~~ + TEXT_SPRINT else2 ~ else~ + // END + SET old = value + END + END + TEXT_SPRINT text ~~~~~%text% else; num = %value% end%WNL%%TAB%%TAB%~~~~~ + TEXT_SPRINT else1 ~else~ + END + TEXT_SPRINT text ~~~~~%text%end~~~~~ + TEXT_SPRINT abilityScore ~%text%~ + BUT_ONLY + COPY_EXISTING ~M_SQMENU.LUA~ override + REPLACE_TEXTUALLY ~~~~~~SequencerMenu\['%attrtable%'\] = function(abil)[.%WNL%]- \-\-\[SEQUENCER_MENU_ATTRIBUTE_TABLE END\]~~~~~ + ~~~~~ + SequencerMenu['%attrtable%'] = function(abil) + local num = 0; %abilityScore% + return num + end --[SEQUENCER_MENU_ATTRIBUTE_TABLE END]~~~~~ + IF ~SequencerMenu\['%attrtable%'\] = function(abil)~ + APPEND ~M_SQMENU.LUA~ ~~~~~ + SequencerMenu['%attrtable%'] = function(abil) + local num = 0; %abilityScore% + return num + end --[SEQUENCER_MENU_ATTRIBUTE_TABLE END]~~~~~ + UNLESS ~SequencerMenu\['%attrtable%'\] = function(abil)~ + END + END + END + DEFINE_ACTION_FUNCTION SEQUENCER_MENU_KNOWN_SPL_TABLE STR_VAR spelltable = ~~ BEGIN + COPY_EXISTING ~%spelltable%.2DA~ override + COUNT_2DA_COLS cols READ_2DA_ENTRIES_NOW ~READ~ cols + TEXT_SPRINT else1 ~~ TEXT_SPRINT text ~~ + FOR (i = 1; i < cols; ++i) BEGIN + SET old = 0 + TEXT_SPRINT text ~~~~~%text%%else1%if %currentLevel% == %i% and level >~~~~~ + FOR (j = 0; j < READ; ++j) BEGIN + READ_2DA_ENTRY_FORMER ~READ~ j i value + PATCH_IF value > 0 BEGIN + READ_2DA_ENTRY_FORMER ~READ~ j 0 level --level + SET j = READ SET old = value - 1 + TEXT_SPRINT text ~~~~~%text% %level% then%WNL%%TAB%%TAB%%TAB%~~~~~ + END + END + TEXT_SPRINT else2 ~~ + FOR (j = 0; j < READ; ++j) BEGIN + READ_2DA_ENTRY_FORMER ~READ~ j i value + PATCH_IF old < value BEGIN + READ_2DA_ENTRY_FORMER ~READ~ j 0 level +// PATCH_IF old > 0 BEGIN + TEXT_SPRINT text ~~~~~%text%%else2%if level < %level% then; num = %old%;~~~~~ + TEXT_SPRINT else2 ~ else~ +// END + SET old = value + END + END + PATCH_IF old = 0 BEGIN + TEXT_SPRINT text ~~~~~%text% 0 then; num = 0~~~~~ + END + TEXT_SPRINT text ~~~~~%text% else; num = %value% end%WNL%%TAB%%TAB%~~~~~ + TEXT_SPRINT else1 ~else~ + END + TEXT_SPRINT text ~~~~~%text%end~~~~~ + TEXT_SPRINT progression ~%text%~ + BUT_ONLY + APPEND ~M_SQMENU.LUA~ ~~~~~ + SequencerMenu['%spelltable%'] = function() + local num = 0; local level = characters[id].level.current + %progression% + return num + end --[SEQUENCER_MENU_KNOWN_SPL_TABLE END]~~~~~ + END + DEFINE_ACTION_FUNCTION CREATE_SEQUENCER_MENU + INT_VAR class = 1 exclude = 0 maxlevel = ~-1~ multilist = 0 tip = ~-1~ name = ~-1~ desc = ~-1~ column = 1 alignment = 0 global = 0 + STR_VAR resref = ~~ icon = ~~ title = ~~ action = ~~ spelltable = ~~ spelllist = ~~ attribute = ~~ attrtable = ~~ custom = ~~ subspell = ~L~ blacklist = ~~ + BEGIN + ACTION_IF GAME_IS ~iwdee~ BEGIN OUTER_SPRINT currentLevel ~contingencySpellLevel~ END ELSE BEGIN OUTER_SPRINT currentLevel ~currentSpellLevel~ END + OUTER_SPRINT $ EVAL ~%blacklist%~(~-1~) ~DEFAULT~ + ACTION_TO_UPPER resref ACTION_TO_UPPER spelltable ACTION_TO_UPPER spelllist ACTION_TO_UPPER attribute ACTION_TO_UPPER attrtable ACTION_TO_UPPER subspell + LAF SETUP_SEQUENCER_MENU END + ACTION_IF ! (~%custom%~ STRING_EQUAL ~~) BEGIN + APPEND ~M_SQMENU.LUA~ ~~~~~SequencerMenu['%resref%'] = %WNL%%custom%~~~~~ + END ELSE BEGIN + LAF SEQUENCER_MENU_ATTRIBUTE_TABLE STR_VAR attribute attrtable RET abil END + <<<<<<<< .../inlined.2da +2DA V1.0 +**** + ResRef Type>>>>>>>> + ACTION_IF STRING_LENGTH ~%resref%~ > 7 BEGIN FAIL ~Resource filename (%resref%) cannot be more than 7 characters long.~ END + APPEND ~M_SQLIST.LUA~ ~mageBookStrings['%resref%X'] = {tip = %tip%, title = '%resref%_SEQUENCER_TITLE', action = "%resref%_SEQUENCER_LABEL"}~ + APPEND ~L_%EE_LANGUAGE%.LUA~ ~uiStrings['%resref%_SEQUENCER_TITLE'] = "%title%"~ + APPEND ~L_%EE_LANGUAGE%.LUA~ ~uiStrings['%resref%_SEQUENCER_LABEL'] = "%action%"~ + ACTION_IF FILE_EXISTS_IN_GAME ~%spelltable%.2da~ AND maxlevel = ~-1~ BEGIN OUTER_SET maxlevel = 9 END + PRINT ~%subspell%~ + ACTION_MATCH ~%subspell%~ WITH + 1 2 3 4 5 6 7 8 9 0 ~G~ ~H~ ~I~ ~J~ ~K~ ~L~ ~M~ ~N~ ~O~ ~Q~ ~R~ ~S~ ~T~ ~U~ ~V~ ~W~ ~X~ ~Y~ ~Z~ BEGIN OUTER_SPRINT postfix ~%subspell%~ END + DEFAULT + WARN ~Invalid subspell extension, defaulting to 'L'.~ + OUTER_SPRINT postfix ~L~ + END + ACTION_IF class = 1 BEGIN + OUTER_SPRINT prefix ~SPWI~ + ACTION_IF (maxlevel > 9) OR (maxlevel < 0) BEGIN OUTER_SET maxlevel = 9 END + ACTION_IF !(~%spelltable%~ STRING_EQUAL ~~) AND !FILE_EXISTS_IN_GAME ~%spelltable%.2da~ BEGIN + WARN ~Spelltable (%spelltable%.2DA) does not exist in game, using class default (SPLSRCKN.2DA).~ + OUTER_SPRINT spelltable ~~ + END + ACTION_IF ~%spelltable%~ STRING_EQUAL ~~ BEGIN + OUTER_SPRINT spelltable ~SPLSRCKN_BACKUP~ + ACTION_IF !FILE_EXISTS_IN_GAME ~SPLSRCKN_BACKUP.2da~ BEGIN + COPY_EXISTING ~SPLSRCKN.2DA~ ~override\SPLSRCKN_BACKUP.2da~ + COPY_EXISTING ~SPLSRCKN.2DA~ override + COUNT_2DA_COLS cols COUNT_2DA_ROWS cols rows + FOR (i = 0; i < rows; ++i) BEGIN FOR (j = 1; j < cols; ++j) BEGIN SET_2DA_ENTRY_LATER ~SET_SPLSRCKN~ i j 0 END END + SET_2DA_ENTRIES_NOW ~SET_SPLSRCKN~ cols + BUT_ONLY + END + END + END ELSE BEGIN + OUTER_SPRINT prefix ~SPPR~ + ACTION_IF (maxlevel > 7) OR (maxlevel < 0) BEGIN OUTER_SET maxlevel = 7 END + ACTION_IF !(~%spelltable%~ STRING_EQUAL ~~) AND !FILE_EXISTS_IN_GAME ~%spelltable%.2da~ BEGIN + WARN ~Spelltable (%spelltable%.2DA) does not exist in game, using class default (SPLSHMKN.2DA).~ + OUTER_SPRINT spelltable ~~ + END + ACTION_IF ~%spelltable%~ STRING_EQUAL ~~ BEGIN + OUTER_SPRINT spelltable ~SPLSHMKN_BACKUP~ + ACTION_IF !FILE_EXISTS_IN_GAME ~SPLSHMKN_BACKUP.2da~ BEGIN + COPY_EXISTING ~SPLSHMKN.2DA~ ~override\SPLSHMKN_BACKUP.2da~ + COPY_EXISTING ~SPLSHMKN.2DA~ override + COUNT_2DA_COLS cols COUNT_2DA_ROWS cols rows + FOR (i = 0; i < rows; ++i) BEGIN FOR (j = 1; j < cols; ++j) BEGIN SET_2DA_ENTRY_LATER ~SET_SPLSHMKN~ i j 0 END END + SET_2DA_ENTRIES_NOW ~SET_SPLSHMKN~ cols + BUT_ONLY + END + END + END + LAF SEQUENCER_MENU_KNOWN_SPL_TABLE STR_VAR spelltable END + COPY ~.../inlined.2da~ ~override/%resref%X.2da~ + ACTION_IF global BEGIN + CREATE SPL ~%resref%~ + WRITE_LONG NAME1 name WRITE_LONG UNIDENTIFIED_DESC desc WRITE_LONG 0x18 0x0201c000 + WRITE_LONG 0x34 1 WRITE_SHORT 0x1c 4 WRITE_SHORT 0x68 1 WRITE_LONG 0x6a (0x72 + 0x28) INSERT_BYTES 0x72 0x28 + LPF ALTER_SPELL_HEADER INT_VAR location = 4 projectile = 47 target = 7 min_level = 1 STR_VAR icon END + LPF ADD_SPELL_CFEFFECT INT_VAR opcode = 171 target = 1 STR_VAR resource = EVAL ~%resref%~ END + LPF ADD_SPELL_CFEFFECT INT_VAR opcode = 172 target = 1 STR_VAR resource = EVAL ~%resref%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 258 target = 1 STR_VAR resource = EVAL ~%resref%X~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 parameter2 = 2 target = 1 timing = 1 STR_VAR resource = EVAL ~%resref%G~ END + CREATE SPL ~%resref%G~ + WRITE_LONG 0x34 1 WRITE_SHORT 0x1c 4 WRITE_SHORT 0x68 1 WRITE_LONG 0x6a (0x72 + 0x28) INSERT_BYTES 0x72 0x28 + LPF ALTER_SPELL_HEADER INT_VAR location = 4 projectile = 47 target = 7 min_level = 1 STR_VAR icon END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 STR_VAR resource = EVAL ~%resref%X~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 9 parameter2 = 2 STR_VAR resource = EVAL ~%resref%X~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 9 parameter2 = 1 STR_VAR resource = EVAL ~%resref%D~ END + CREATE EFF ~%resref%G~ WRITE_LONG 0x10 67 WRITE_SHORT 0x2c 100 WRITE_ASCIIE 0x30 ~%resref%G~ WRITE_ASCIIE 0x70 ~none~ + CREATE CRE ~%resref%G~ WRITE_LONG NAME1 ~-1~ WRITE_LONG NAME2 ~-1~ WRITE_LONG 0x20 0x600010 WRITE_SHORT 0x24 1 WRITE_SHORT 0x26 1 + WRITE_BYTE 0x33 1 WRITE_BYTE 0x7e 255 WRITE_LONG 0x54 0x14141414 WRITE_BYTE 0x58 0x14 + WRITE_LONG 0x234 0x010101 WRITE_LONG 0x238 0x19190019 WRITE_LONG 0x23c 0x14191919 WRITE_ASCIIE 0x248 ~%resref%G~ + LPF ADD_CRE_EFFECT INT_VAR opcode = 287 timing = 9 END + LPF ADD_CRE_EFFECT INT_VAR opcode = 100 parameter2 = 2 timing = 9 END + LPF ADD_CRE_EFFECT INT_VAR opcode = 101 parameter2 = 12 timing = 9 END + LPF ADD_CRE_EFFECT INT_VAR opcode = 208 parameter2 = 1 timing = 9 END + LPF ADD_CRE_EFFECT INT_VAR opcode = 315 parameter2 = 1 timing = 9 END + LPF ADD_CRE_EFFECT INT_VAR opcode = 367 parameter2 = 1 timing = 9 END + <<<<<<<< .../%resref%G.baf + %script%>>>>>>>> + OUTER_SPRINT script ~~ + END ELSE BEGIN + CREATE SPL ~%resref%~ + WRITE_LONG NAME1 name WRITE_LONG UNIDENTIFIED_DESC desc WRITE_LONG 0x18 0x0201c000 + WRITE_LONG 0x34 1 WRITE_SHORT 0x1c 4 WRITE_SHORT 0x68 1 WRITE_LONG 0x6a (0x72 + 0x28) INSERT_BYTES 0x72 0x28 + LPF ALTER_SPELL_HEADER INT_VAR location = 4 projectile = 47 target = 7 min_level = 1 STR_VAR icon END + LPF ADD_SPELL_CFEFFECT INT_VAR opcode = 171 target = 1 STR_VAR resource = EVAL ~%resref%~ END + LPF ADD_SPELL_CFEFFECT INT_VAR opcode = 172 target = 1 STR_VAR resource = EVAL ~%resref%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 258 target = 1 STR_VAR resource = EVAL ~%resref%X~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 STR_VAR resource = EVAL ~%resref%X~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 9 parameter2 = 2 STR_VAR resource = EVAL ~%resref%X~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 9 parameter2 = 1 STR_VAR resource = EVAL ~%resref%D~ END + END + CREATE SPL ~%resref%D~ WRITE_LONG 0x34 1 WRITE_SHORT 0x68 1 WRITE_LONG 0x6a (0x72 + 0x28) INSERT_BYTES 0x72 0x28 WRITE_SHORT 0x98 47 + LPF ADD_SPELL_EFFECT INT_VAR opcode = 258 target = 2 STR_VAR resource = EVAL ~%resref%X~ END + CREATE EFF ~%resref%X~ WRITE_LONG 0x10 257 WRITE_LONG 0x1c 9 WRITE_LONG 0x20 1 WRITE_SHORT 0x2c 100 WRITE_ASCIIE 0x94 ~%resref%X~ + COPY_EXISTING ~HIDESPL.2DA~ override + COUNT_2DA_COLS cols READ_2DA_ENTRIES_NOW ~READ_HIDESPL~ cols + FOR (i = 0; i < READ_HIDESPL; ++i) BEGIN + READ_2DA_ENTRY_FORMER ~READ_HIDESPL~ i 1 value + READ_2DA_ENTRY_FORMER ~READ_HIDESPL~ i 0 res + TEXT_SPRINT $hidden(~%res%~) ~%value%~ + END + BUT_ONLY + ACTION_PHP_EACH EVAL ~%blacklist%~ AS index => label BEGIN + OUTER_SPRINT spell_res EVAL ~%label%~ + ACTION_IF !FILE_EXISTS_IN_GAME ~%label%.spl~ BEGIN + ACTION_IF FILE_CONTAINS_EVALUATED (~SPELL.IDS~ ~[ %TAB%]%label%[ %TAB%%WNL%$]~) BEGIN + LAF RES_NUM_OF_SPELL_NAME STR_VAR spell_name = EVAL ~%label%~ RET spell_res END + END + END + ACTION_IF FILE_EXISTS_IN_GAME ~%spell_res%.spl~ BEGIN + OUTER_SPRINT $hidden(~%spell_res%~) ~1~ + END + END + ACTION_IF ~%spelllist%~ STRING_EQUAL ~~ BEGIN + OUTER_FOR (i = 1; i <= maxlevel; ++i) BEGIN + COPY_EXISTING_REGEXP ~^\(%prefix%%i%\([0-4][1-9]\|10\|20\|30\|40\)\)\.spl$~ ~override/\1%postfix%.spl~ + PATCH_IF (!VARIABLE_IS_SET $hidden(~%SOURCE_RES%~)) OR ($hidden(~%SOURCE_RES%~) STRING_EQUAL ~0~) BEGIN + PATCH_IF !FILE_EXISTS_IN_GAME ~%DEST_FILE%~ BEGIN + WRITE_LONG 0x18 0 LPF ALTER_SPELL_HEADER INT_VAR range = 32767 projectile = 1 END LPF DELETE_EFFECT END + PATCH_IF global != 1 BEGIN LPF ADD_SPELL_EFFECT INT_VAR opcode = 171 target = 1 STR_VAR resource = EVAL ~%SOURCE_RES%~ END END + PATCH_IF global = 1 BEGIN LPF ADD_SPELL_EFFECT INT_VAR opcode = 309 target = 1 parameter1 = 1 timing = 9 STR_VAR resource = EVAL ~%SOURCE_RES%~ END END + END + READ_LONG 0x1e flag READ_LONG 0x34 level + PATCH_IF level > 0 AND level <= maxlevel BEGIN + PATCH_IF (flag BAND exclude) = 0 BEGIN + INNER_ACTION BEGIN + APPEND ~%resref%X.2DA~ ~Default %SOURCE_RES% 3~ + ACTION_IF global BEGIN + OUTER_SPRINT spell_res ~%SOURCE_RES%~ + COPY_EXISTING ~%resref%.spl~ override LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 265 target = 1 timing = 9 STR_VAR resource = EVAL ~%spell_res%~ END + OUTER_SPRINT script ~%script%%WNL%IF%WNL%NextTriggerObject(LastSummonerOf(Myself))%WNL%Global("%spell_res%","LOCALS",%global%)%WNL%THEN%WNL%RESPONSE #100 + SetGlobal("%spell_res%","GLOBAL",%global%)%WNL%Continue()%WNL%END~ + END + END + END + END + END + BUT_ONLY + END + END ELSE BEGIN + COPY_EXISTING ~%spelllist%.2da~ override + COUNT_2DA_COLS cols + READ_2DA_ENTRIES_NOW READ cols + BUT_ONLY + ACTION_IF column < cols BEGIN + OUTER_FOR (i = 0; i < READ; ++i) BEGIN + OUTER_SPRINT value EVAL ~%READ_%i%_%column%%~ + ACTION_IF ~%value%~ STRING_EQUAL ~1~ BEGIN + OUTER_SPRINT label EVAL ~%READ_%i%_0%~ + OUTER_SPRINT spell_res ~%label%~ + ACTION_IF !FILE_EXISTS_IN_GAME ~%label%.spl~ BEGIN + ACTION_IF FILE_CONTAINS_EVALUATED (~SPELL.IDS~ ~[ %TAB%]%label%[ %TAB%%WNL%$]~) BEGIN + LAF RES_NUM_OF_SPELL_NAME STR_VAR spell_name = EVAL ~%label%~ RET spell_res END + END + END + ACTION_IF FILE_EXISTS_IN_GAME ~%spell_res%.spl~ BEGIN + COPY_EXISTING ~%spell_res%.spl~ ~override\%spell_res%%postfix%.spl~ + PATCH_IF !FILE_EXISTS_IN_GAME ~%spell_res%%postfix%.spl~ BEGIN + WRITE_LONG 0x18 0 LPF ALTER_SPELL_HEADER INT_VAR range = 32767 projectile = 1 END LPF DELETE_EFFECT END + PATCH_IF global != 1 BEGIN LPF ADD_SPELL_EFFECT INT_VAR opcode = 171 target = 1 STR_VAR resource = EVAL ~%spell_res%~ END END + PATCH_IF global = 1 BEGIN LPF ADD_SPELL_EFFECT INT_VAR opcode = 309 target = 1 parameter1 = 1 timing = 9 STR_VAR resource = EVAL ~%spell_res%~ END END + END + READ_LONG 0x34 level + PATCH_IF level > 0 AND level <= maxlevel BEGIN + INNER_ACTION BEGIN + APPEND ~%resref%X.2DA~ ~Default %spell_res% 3~ + ACTION_IF global BEGIN + COPY_EXISTING ~%resref%.spl~ override LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 265 target = 1 timing = 9 STR_VAR resource = EVAL ~%spell_res%~ END + OUTER_SPRINT script ~%script%%WNL%IF%WNL%NextTriggerObject(LastSummonerOf(Myself))%WNL%Global("%spell_res%","LOCALS",%global%)%WNL%THEN%WNL%RESPONSE #100 + SetGlobal("%spell_res%","GLOBAL",%global%)%WNL%Continue()%WNL%END~ + END + END + END + BUT_ONLY + END ELSE BEGIN + ACTION_IF multilist = 1 BEGIN + APPEND ~%resref%X.2DA~ ~2DALIST %spell_res% 3~ + END + END + END + END + END + END + ACTION_IF global BEGIN + OUTER_SPRINT script ~%script%%WNL%IF%WNL%True()%WNL%THEN%WNL%RESPONSE #100%WNL%ActionOverride(LastSummonerOf(Myself),ReallyForceSpellRES("%resref%G",Myself))%WNL%DestroySelf()%WNL%END~ + COMPILE EVAL ~.../%resref%G.baf~ + END + APPEND ~M_SQMENU.LUA~ ~~~~~SequencerMenu['%resref%X'] = function(); bookSpells = SequencerMenuSpellsKnown(%multilist%,'%spelltable%','%attrtable%','%abil%',%alignment%,'%postfix%',%global%); end~~~~~ + END + END + \ No newline at end of file diff --git a/TomeAndBlood/lib/semi_spont/d5lernwi.bam b/TomeAndBlood/lib/semi_spont/d5lernwi.bam new file mode 100644 index 0000000000000000000000000000000000000000..213d2d2b0830f6659f851415b102a226155a1c02 GIT binary patch literal 3132 zcmeHHKTI2E9Q_#xP($0)knqpV;o>^Rb-@NqLhLhv=F;F|h)Hp|Ivkt{<`RsJV{8X% zdM@|XF6Lr`6e(FEu|#5t#Ddf;kyt8asnjJymP%PFb?M%P{?0ZDNF6G5YQ>$N-uu1x zzE8fhKMxMLTfNrS)-ouAMgX{|paP&3Z{>1SKv%tHXPfWmIf-7^qiW`INOMUNX- zv;rT_2-IHG9D_N6V^GuR;TkV$FEa*SdJMQ8)Cf2FZuH%>4;X|Sb2sJ;GNUl)1JnyEu%Qxcg@4{2DLRj z8u?aE77J99$!fCl=gQUPtcT~r&1`>VRd8lCm%Lplv{*VjFZT?Jx2jcDN&a(BGtVba zY2qYzXStYnI&7oY`4!1uUfCbI$(}Y$aiY$;nj`T-e#Yjw;Nj<%qB9~@T_wI#siMet ziE|o~B`Kvq*)D&IOn$%e|U@ z4efV%Hw(FGm|^&ZsieRL?KNuu?Mq)tvnopdUcQwogHKTFdiCg z;L`H+8YvVE7si}JiwVi1_D=){JZ$3b-Bk-^cll+hkhk<+?U{>9_V*H=2{GmtmL}r^ z%_Fm7E?3CUv~&$$<&s8ih>iH-K0$~Iq=C<`lWe}Y+~o9_`R+k+PKeEgSz#gO)r@Rp z$;M{!`C1(PWmOf;8$q5A#qW4#lJ{yxvOi>V>%|yaY^u8Sg3%IWeGwAAxl9ZeAup}x zrQ)ZDMrLbjX`JXZ{v{#i36T0)BCoGybH#@TXt_~i^bV1r`ZQ7AGp!-Aw4Oao0gP^| zidvdqiJziw2qB$eeQoV<>q5zBYGqVZGAIc4^EzrEEk>mD+ts)~)iF9-LnV1ySF4U> zq9T!x><;k0%`qD2Qn~yMDWSSsPRaL6zr4~WAJW5<6JLfc-Tti1+2wR@Gj()(=;*&P z@pU9c>NN(@%gI^!{;?RWBR(OLz9(@S^*Pr@dS&y?lb3pIES^fmq)6DmxRF~UrPp?B plSu3v$rs4xG%-l5;E#Et6OoY@niSV44wXCq$5uL5V>T2q9n+R1V}Sh|5wK PTugm~{ezsLDo`l^78?-S literal 0 HcmV?d00001 diff --git a/TomeAndBlood/lib/semi_spont/d5msorc.spl b/TomeAndBlood/lib/semi_spont/d5msorc.spl new file mode 100755 index 0000000000000000000000000000000000000000..472ba6920e9048eedc675456c8d7db2f453c6b56 GIT binary patch literal 202 zcmWFz@KFdeR8ZI`!N^cQZ3ct0V{p8$fiVLE10xd)ki-TUfr5+-!2!-bmPQ6ns46x= z%|R9|0;`_|6=Gyyf#@}~bYf+Y1DXT^Y+#ZR%ma~(49*OU5Gk+>50Fe@a541__78Ff Hi=Yz#SCJ6T literal 0 HcmV?d00001 diff --git a/TomeAndBlood/lib/semi_spontaneous zspla from 172.tpa b/TomeAndBlood/lib/semi_spontaneous zspla from 172.tpa deleted file mode 100755 index e265c37..0000000 --- a/TomeAndBlood/lib/semi_spontaneous zspla from 172.tpa +++ /dev/null @@ -1,3224 +0,0 @@ - -// v5.8 - targeting fix - - -/* -the way it works: -- d5zprp gives access to spellbook, disables casting, and sets prep spellstate -- zz000 is applied in CLAB table; - -- sets fatigue to 1 and c - -- permanently sets repeating spell, zlots -- zlots checks for NO semi state, then casts zzini - -- zzini does all initialization stuff: - --- sets semi state (several 177s checking for class) - --- casts z0slt - --- casts z206 - --- casts znoqk - --- 206 vs. zz000 - --- casts zprpb - --- gives zprp - --- sets fatigue to 0 after 6 second delay -- zlots checks for fatigue = 0, then casts zlotf -- if no prep state, zlotf casts zrfrsh - -- zrfrsh removes spellbook access, casts zsplz -- if yes prep state, zlotf casts zlotr - -- zlotr summons zlotr.cre - -- zlotr.cre runs zlotr.bcs - -- zlotr.bcs gives chosen spells and casts zprpd - -- zprpd restores spellcasting, casts zsplz -- zsplz gives innate spells according to your casting slots and semi state -*/ - - -DEFINE_ACTION_FUNCTION semi_spontaneous_casting INT_VAR include_arcane = 0 include_divine = 0 BEGIN - - -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5__semi_spont.d5~) BEGIN - - -//disable quickspell buttons__________________________________________________________ -// -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5znoqk.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 144 target = 1 parameter2 = 3 timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 144 target = 1 parameter2 = 4 timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 144 target = 1 parameter2 = 5 timing = 9 END - - -//semi spont spellstates______________________________________________________________ -// -ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_SEMI_ARCANE~)) BEGIN - COPY_EXISTING ~splstate.ids~ ~override~ - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW rows cols - FOR (row = 1; row < rows; ++row) BEGIN - READ_2DA_ENTRY_FORMER rows row 1 ~state_name~ - READ_2DA_ENTRY_FORMER rows row 0 ~state_ind~ - PATCH_IF (~%state_name%~ STRING_EQUAL_CASE ~D5_SEMI_ARCANE~) BEGIN - SET semi_spont_arcane = %state_ind% - END - END - BUT_ONLY -END - -ACTION_IF !(VARIABLE_IS_SET %semi_spont_arcane%) BEGIN - LAF d5_resolve_state STR_VAR new_state_id = ~D5_SEMI_ARCANE~ RET new_state_ind END - OUTER_SET semi_spont_arcane = %new_state_ind% -END - -ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_SEMI_DIVINE~)) BEGIN - COPY_EXISTING ~splstate.ids~ ~override~ - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW rows cols - FOR (row = 1; row < rows; ++row) BEGIN - READ_2DA_ENTRY_FORMER rows row 1 ~state_name~ - READ_2DA_ENTRY_FORMER rows row 0 ~state_ind~ - PATCH_IF (~%state_name%~ STRING_EQUAL_CASE ~D5_SEMI_DIVINE~) BEGIN - SET semi_spont_divine = %state_ind% - END - END - BUT_ONLY -END - -ACTION_IF !(VARIABLE_IS_SET %semi_spont_divine%) BEGIN - LAF d5_resolve_state STR_VAR new_state_id = ~D5_SEMI_DIVINE~ RET new_state_ind END - OUTER_SET semi_spont_divine = %new_state_ind% -END - - -//prepared spells spellstate__________________________________________________________ -// -ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_SPL_PREP~)) BEGIN - COPY_EXISTING ~splstate.ids~ ~override~ - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW rows cols - FOR (row = 1; row < rows; ++row) BEGIN - READ_2DA_ENTRY_FORMER rows row 1 ~state_name~ - READ_2DA_ENTRY_FORMER rows row 0 ~state_ind~ - PATCH_IF (~%state_name%~ STRING_EQUAL_CASE ~D5_SPL_PREP~) BEGIN - SET prepared_spells_state = %state_ind% - END - END - BUT_ONLY -END - -ACTION_IF !(VARIABLE_IS_SET %prepared_spells_state%) BEGIN - LAF d5_resolve_state STR_VAR new_state_id = ~D5_SPL_PREP~ RET new_state_ind END - OUTER_SET prepared_spells_state = %new_state_ind% -END - - -//add spell slot stat checks to SPLPROT______________________________________________ -// -APPEND ~splprot.2da~ ~D5_WIZ_1_7%TAB%108%TAB%-1%TAB%7~ UNLESS ~D5_WIZ_1_7~ -APPEND ~splprot.2da~ ~D5_WIZ=1_7%TAB%108%TAB%-1%TAB%8~ UNLESS ~D5_WIZ=1_7~ -APPEND ~splprot.2da~ ~D5_WIZ_8_9%TAB%109%TAB%-1%TAB%7~ UNLESS ~D5_WIZ_8_9~ -APPEND ~splprot.2da~ ~D5_WIZ=8_9%TAB%109%TAB%-1%TAB%8~ UNLESS ~D5_WIZ=8_9~ -APPEND ~splprot.2da~ ~D5_DIV_1_7%TAB%134%TAB%-1%TAB%7~ UNLESS ~D5_DIV_1_7~ -APPEND ~splprot.2da~ ~D5_DIV=1_7%TAB%134%TAB%-1%TAB%8~ UNLESS ~D5_DIV=1_7~ -APPEND ~splprot.2da~ ~D5_FATIGUE_0%TAB%30%TAB%0%TAB%1~ UNLESS ~D5_FATIGUE_0~ -APPEND ~splprot.2da~ ~D5_PREP_SPLZ%TAB%0x112%TAB%%prepared_spells_state%%TAB%1~ UNLESS ~D5_PREP_SPLZ~ -APPEND ~splprot.2da~ ~D5_NOT_PREP%TAB%0x112%TAB%%prepared_spells_state%%TAB%5~ UNLESS ~D5_NOT_PREP~ -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_WIZ_1_7~) BEGIN - SET fake_sorc_slots_1_7 = %row% - END - PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_WIZ=1_7~) BEGIN - SET fake_sorc_equal_1_7 = %row% - END - PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_WIZ_8_9~) BEGIN - SET fake_sorc_slots_8_9 = %row% - END - PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_WIZ=8_9~) BEGIN - SET fake_sorc_equal_8_9 = %row% - END - PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_DIV_1_7~) BEGIN - SET fake_sham_slots_1_7 = %row% - END - PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_DIV=1_7~) BEGIN - SET fake_sham_equal_1_7 = %row% - END - PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_FATIGUE_0~) BEGIN - SET fatigue_zero = %row% - END - PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_PREP_SPLZ~) BEGIN - SET prep_spells_row = %row% - END - PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_NOT_PREP~) BEGIN - SET not_prep_row = %row% - END - PATCH_IF ~%stat%~ STRING_EQUAL_CASE ~D5_KIT_IS~ BEGIN - SET kit_is_row = %row% - END - END -BUT_ONLY - - -//remove all mage spell slots_________________________________________________________ -// -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z17wz.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 42 target = 1 parameter1 = (0 - 1) parameter2 = 127 timing = 9 END - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z89wz.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 42 target = 1 parameter1 = (0 - 1) parameter2 = 384 timing = 9 END - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z17dv.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 62 target = 1 parameter1 = (0 - 1) parameter2 = 127 timing = 9 END - -// this is for... what? to eliminate kitted mage bonus slots? -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z0slt.spl~ - PATCH_IF (MOD_IS_INSTALLED ~TomeAndBlood.tp2~ ~62~) BEGIN // level 1 cantrips - LPF ADD_SPELL_EFFECT INT_VAR opcode = 42 target = 1 parameter1 = (0 - 1) parameter2 = 510 /*126*/ timing = 9 END // should cover lvl 8-9 spls too - END - PATCH_IF !(MOD_IS_INSTALLED ~TomeAndBlood.tp2~ ~62~) BEGIN // level 1 cantrips - LPF ADD_SPELL_EFFECT INT_VAR opcode = 42 target = 1 parameter1 = (0 - 1) parameter2 = 511 /*127*/ timing = 9 END // should cover lvl 8-9 spls too - END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 1 STR_VAR resource = ~d5z0slt~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = 0 parameter2 = %kit_is_row% timing = 0 duration = 1 STR_VAR resource = ~d5z0slt~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = 16384 parameter2 = %kit_is_row% timing = 0 duration = 1 STR_VAR resource = ~d5z0slt~ END - - -/* I think this is only applied once, no need for 2nd copy -COPY_EXISTING ~d5z0slt.spl~ ~override/d5z1slt.spl~ - LPF ALTER_EFFECT INT_VAR match_opcode = 321 STR_VAR match_resource = ~d500slt~ resource = ~d501slt~ END -*/ - -// what is this one vv for...? L1Cantrips -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z2slt.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 42 parameter1 = (0 - 1) parameter2 = 2 target = 1 timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 1 STR_VAR resource = ~d5z2slt~ END - -// here are spells for use with TnB/SoB abil score bonus slots -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zislt.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 42 target = 1 parameter1 = (0 - 1) parameter2 = 127 timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 1 STR_VAR resource = ~d5zislt~ END - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zjslt.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 42 target = 1 parameter1 = (0 - 1) parameter2 = 127 timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 1 STR_VAR resource = ~d5zjslt~ END - - -//create advance copies of some spells________________________________________________ -// -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zz206.spl~ - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zz172.spl~ - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zz145.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 145 target = 1 parameter2 = 0 timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 145 target = 1 parameter2 = 1 timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5zspld~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5zspla~ END - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z0spl.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~SPWI908~ END - PATCH_IF !(MOD_IS_INSTALLED ~TomeAndBlood.tp2~ ~16~) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = ~SPWI110~ END - END - PATCH_IF !(MOD_IS_INSTALLED ~TomeAndBlood.tp2~ ~55~) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~SPWI420~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~SPWI710~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~SPWI809~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~SPWI617~ END - END - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot1a.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot1b.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot1c.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot1d.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot2a.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot2b.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot2c.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot2d.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot3a.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot3b.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot3c.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot3d.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot4a.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot4b.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot4c.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot4d.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot5a.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot5b.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot5c.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot5d.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot6a.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot6b.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot6c.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot6d.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot7a.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot7b.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot7c.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot7d.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot8a.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot8b.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot8c.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot8d.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot9a.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot9b.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot9c.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwot9d.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot1a.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot1b.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot1c.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot1d.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot2a.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot2b.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot2c.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot2d.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot3a.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot3b.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot3c.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot3d.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot4a.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot4b.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot4c.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot4d.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot5a.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot5b.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot5c.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot5d.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot6a.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot6b.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot6c.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot6d.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot7a.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot7b.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot7c.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zdot7d.spl~ - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zspld.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 4) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot1a~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 4) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot1b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 4) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot1c~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 4) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot1d~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 8) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot2a~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 8) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot2b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 8) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot2c~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 8) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot2d~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 12) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot3a~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 12) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot3b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 12) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot3c~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 12) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot3d~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 16) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot4a~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 16) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot4b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 16) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot4c~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 16) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot4d~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 20) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot5a~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 20) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot5b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 20) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot5c~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 20) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot5d~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 24) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot6a~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 24) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot6b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 24) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot6c~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 24) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot6d~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 28) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot7a~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 28) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot7b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 28) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot7c~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 28) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5zdot7d~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 0 duration = 1 STR_VAR resource = ~d5zspld~ END - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zspla.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 4) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot1a~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 4) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot1b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 4) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot1c~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 4) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot1d~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 8) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot2a~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 8) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot2b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 8) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot2c~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 8) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot2d~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 12) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot3a~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 12) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot3b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 12) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot3c~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 12) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot3d~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 16) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot4a~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 16) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot4b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 16) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot4c~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 16) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot4d~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 20) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot5a~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 20) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot5b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 20) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot5c~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 20) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot5d~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 24) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot6a~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 24) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot6b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 24) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot6c~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 24) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot6d~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 28) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot7a~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 28) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot7b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 28) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot7c~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 28) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5zwot7d~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 24) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5zwot8a~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 24) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5zwot8b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 24) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5zwot8c~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 24) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5zwot8d~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 28) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5zwot9a~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 28) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5zwot9b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 28) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5zwot9c~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 28) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5zwot9d~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 0 duration = 1 STR_VAR resource = ~d5zspla~ END - -//assign stats for spell slots to each spell level____________________________________ -// -// arcane level 1 = 108 << 4 -// arcane level 2 = 108 << 8 -// arcane level 3 = 108 << 12 -// arcane level 4 = 108 << 16 -// arcane level 5 = 108 << 20 -// arcane level 6 = 108 << 24 -// arcane level 7 = 108 << 28 -// arcane level 8 = 109 << 24 -// arcane level 9 = 109 << 28 -// divine level 1 = 134 << 4 -// divine level 2 = 134 << 8 -// divine level 3 = 134 << 12 -// divine level 4 = 134 << 16 -// divine level 5 = 134 << 20 -// divine level 6 = 134 << 24 -// divine level 7 = 134 << 28 -// - -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src1a.spl~) BEGIN - ACTION_FOR_EACH let IN ~a~ BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src1%let%.spl~ - SAY NAME1 @21991 - SAY UNIDENTIFIED_DESC @21991 - LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src1%let%~ END - END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src2a.spl~) BEGIN - ACTION_FOR_EACH let IN ~a~ BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src2%let%.spl~ - SAY NAME1 @21992 - SAY UNIDENTIFIED_DESC @21992 - LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src2%let%~ END - END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src3a.spl~) BEGIN - ACTION_FOR_EACH let IN ~a~ BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src3%let%.spl~ - SAY NAME1 @21993 - SAY UNIDENTIFIED_DESC @21993 - LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src3%let%~ END - END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src4a.spl~) BEGIN - ACTION_FOR_EACH let IN ~a~ BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src4%let%.spl~ - SAY NAME1 @21994 - SAY UNIDENTIFIED_DESC @21994 - LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src4%let%~ END - END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src5a.spl~) BEGIN - ACTION_FOR_EACH let IN ~a~ BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src5%let%.spl~ - SAY NAME1 @21995 - SAY UNIDENTIFIED_DESC @21995 - LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 20) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src5%let%~ END - END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src6a.spl~) BEGIN - ACTION_FOR_EACH let IN ~a~ BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src6%let%.spl~ - SAY NAME1 @21996 - SAY UNIDENTIFIED_DESC @21996 - LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 24) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src6%let%~ END - END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src7a.spl~) BEGIN - ACTION_FOR_EACH let IN ~a~ BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src7%let%.spl~ - SAY NAME1 @21997 - SAY UNIDENTIFIED_DESC @21997 - LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 28) parameter2 = (108 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src7%let%~ END - END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src8a.spl~) BEGIN - ACTION_FOR_EACH let IN ~a~ BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src8%let%.spl~ - SAY NAME1 @21989 - SAY UNIDENTIFIED_DESC @21989 - LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 24) parameter2 = (109 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src8%let%~ END - END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src9a.spl~) BEGIN - ACTION_FOR_EACH let IN ~a~ BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src9%let%.spl~ - SAY NAME1 @21990 - SAY UNIDENTIFIED_DESC @21990 - LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 28) parameter2 = (109 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src9%let%~ END - END -END - -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm1a.spl~) BEGIN - ACTION_FOR_EACH let IN ~a~ BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm1%let%.spl~ - SAY NAME1 @21991 - SAY UNIDENTIFIED_DESC @21991 - LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 4) parameter2 = (134 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5shm1%let%~ END - END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm2a.spl~) BEGIN - ACTION_FOR_EACH let IN ~a~ BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm2%let%.spl~ - SAY NAME1 @21992 - SAY UNIDENTIFIED_DESC @21992 - LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 8) parameter2 = (134 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5shm2%let%~ END - END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm3a.spl~) BEGIN - ACTION_FOR_EACH let IN ~a~ BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm3%let%.spl~ - SAY NAME1 @21993 - SAY UNIDENTIFIED_DESC @21993 - LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 12) parameter2 = (134 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5shm3%let%~ END - END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm4a.spl~) BEGIN - ACTION_FOR_EACH let IN ~a~ BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm4%let%.spl~ - SAY NAME1 @21994 - SAY UNIDENTIFIED_DESC @21994 - LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 16) parameter2 = (134 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5shm4%let%~ END - END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm5a.spl~) BEGIN - ACTION_FOR_EACH let IN ~a~ BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm5%let%.spl~ - SAY NAME1 @21995 - SAY UNIDENTIFIED_DESC @21995 - LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 20) parameter2 = (134 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5shm5%let%~ END - END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm6a.spl~) BEGIN - ACTION_FOR_EACH let IN ~a~ BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm6%let%.spl~ - SAY NAME1 @21996 - SAY UNIDENTIFIED_DESC @21996 - LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 24) parameter2 = (134 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5shm6%let%~ END - END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm7a.spl~) BEGIN - ACTION_FOR_EACH let IN ~a~ BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm7%let%.spl~ - SAY NAME1 @21997 - SAY UNIDENTIFIED_DESC @21997 - LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 28) parameter2 = (134 + (0x10000 * 1)) timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5shm7%let%~ END - END -END - -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src-1.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src-1.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 4) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src-2.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src-2.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 8) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src-3.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src-3.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 12) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src-4.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src-4.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 16) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src-5.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src-5.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 20) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src-6.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src-6.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 24) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src-7.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src-7.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 28) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src-8.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src-8.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 24) parameter2 = (109 + (0x10000 * 1)) timing = 1 END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src-9.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src-9.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 28) parameter2 = (109 + (0x10000 * 1)) timing = 1 END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm-1.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm-1.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 4) parameter2 = (134 + (0x10000 * 1)) timing = 1 END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm-2.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm-2.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 8) parameter2 = (134 + (0x10000 * 1)) timing = 1 END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm-3.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm-3.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 12) parameter2 = (134 + (0x10000 * 1)) timing = 1 END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm-4.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm-4.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 16) parameter2 = (134 + (0x10000 * 1)) timing = 1 END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm-5.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm-5.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 20) parameter2 = (134 + (0x10000 * 1)) timing = 1 END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm-6.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm-6.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 24) parameter2 = (134 + (0x10000 * 1)) timing = 1 END -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm-7.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm-7.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 28) parameter2 = (134 + (0x10000 * 1)) timing = 1 END -END - - -// 'prepare spells' spell_____________________________________________________________ -// -OUTER_SET prep_message = RESOLVE_STR_REF(~Memorized spells may be now changed. Spellcasting is disabled until the next full rest.~) -COPY ~%MOD_FOLDER%/lib/semi_spont/d5zwtch.bam~ ~override~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5zprep.bam~ ~override~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5zgren.bam~ ~override~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zprp.spl~ - SAY NAME1 ~Change Prepared Spells~ - SAY UNIDENTIFIED_DESC ~Spell Preparation - -This ability allows the you to prepare a new set of spells for the next day. Upon using the ability, preparation slots will become available in your spellbook, and spellcasting will be disabled. After filling any available preparation slots, you must rest for 8 hours. Upon waking, spellcasting will be re-enabled, and you will be unable to modify the contents of your preparation slots until the next time this ability is used. -~ - WRITE_ASCII 0x3a ~d5zgren~ #8 - LPF ALTER_SPELL_HEADER INT_VAR target = 7 STR_VAR icon = ~d5zgren~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5z17wz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5z89wz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5z17dv~ END -// LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter1 = 0 parameter2 = 1 timing = 1 STR_VAR resource = ~d5zz145~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter1 = 0 parameter2 = 1 timing = 1 STR_VAR resource = ~d5zz206~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter1 = 0 parameter2 = 1 timing = 1 STR_VAR resource = ~d5zprp1~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 139 target = 1 parameter1 = %prep_message% timing = 1 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 duration = 0 STR_VAR resource = ~d5zz172a~ END - -/* -// ***** what is this vv for?? - answer: game-start initialization - edit - not really though -COPY_EXISTING ~d5zprp.spl~ ~override/d5zprpb.spl~ - LPF DELETE_EFFECT INT_VAR match_opcode = 139 END -*/ - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zprp1.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 328 target = 1 special = 1 parameter2 = %prepared_spells_state% timing = 9 END - - -//daily spell slot refresh____________________________________________________________ -// -COPY ~%MOD_FOLDER%/lib/semi_spont/d5zcast.bam~ ~override~ - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zlotz.spl~ - SAY NAME1 ~initialize 5E spellcasting~ - SAY UNIDENTIFIED_DESC ~initialize 5E spellcasting~ - LPF ALTER_SPELL_HEADER INT_VAR target = 7 STR_VAR icon = ~d5zcast~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = ~d5zlots~ END - -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5zlots.eff~) BEGIN - CREATE EFF ~d5zlots~ - WRITE_LONG 0x10 232 - WRITE_LONG 0x14 1 - WRITE_LONG 0x1c 0 - WRITE_LONG 0x20 20 - WRITE_LONG 0x24 9 - WRITE_SHORT 0x2c 100 - WRITE_ASCII 0x30 ~d5zlots~ #8 - WRITE_LONG 0x48 102 -END - -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5zlots.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zlots.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 111 timing = 1 STR_VAR resource = ~d5zz001~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 0 parameter2 = %fatigue_zero% timing = 1 STR_VAR resource = ~d5zlotf~ END -END - -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5zlotf.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zlotf.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 111 timing = 1 STR_VAR resource = ~d5zz010~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 111 timing = 1 STR_VAR resource = ~d5zz020~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 0 parameter2 = %prep_spells_row% timing = 1 STR_VAR resource = ~d5zlotr~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 0 parameter2 = %not_prep_row% timing = 1 STR_VAR resource = ~d5zrfrsh~ END -END - -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5zlotr.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zlotr.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter1 = 0 parameter2 = 2 timing = 0 duration = 12 STR_VAR resource = ~d5zlotr~ END -END - -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5zlotr.eff~) BEGIN - CREATE EFF ~d5zlotr~ - WRITE_LONG 0x10 67 - WRITE_LONG 0x14 1 - WRITE_LONG 0x28 12 - WRITE_SHORT 0x2c 100 - WRITE_ASCII 0x30 ~d5zlotr~ #8 - WRITE_ASCII 0x70 ~shskull~ #8 -END - -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5zlotr.cre~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5zlotr.cre~ ~override~ - WRITE_ASCII 0x248 ~D5ZLOTR~ #8 -END - - -// spell to simply refresh spell slots________________________________________________ -// -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5zrfrsh.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zrfrsh.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 93 target = 1 parameter1 = 1 parameter2 = 1 timing = 1 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 1 STR_VAR resource = ~d5zz145~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 1 STR_VAR resource = ~d5src-1~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 1 STR_VAR resource = ~d5src-2~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 1 STR_VAR resource = ~d5src-3~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 1 STR_VAR resource = ~d5src-4~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 1 STR_VAR resource = ~d5src-5~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 1 STR_VAR resource = ~d5src-6~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 1 STR_VAR resource = ~d5src-7~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 1 STR_VAR resource = ~d5src-8~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 1 STR_VAR resource = ~d5src-9~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 1 STR_VAR resource = ~d5shm-1~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 1 STR_VAR resource = ~d5shm-2~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 1 STR_VAR resource = ~d5shm-3~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 1 STR_VAR resource = ~d5shm-4~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 1 STR_VAR resource = ~d5shm-5~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 1 STR_VAR resource = ~d5shm-6~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 1 STR_VAR resource = ~d5shm-7~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 duration = 0 STR_VAR resource = ~d5zz172~ END -// LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5zsplz~ END -// LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END -// LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END -END - - -// spell to set prepped spells and refresh slots______________________________________ -// -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5zprpd.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zprpd.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 93 target = 1 parameter1 = 1 parameter2 = 1 timing = 1 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z17dv~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z17dv~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z17dv~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z17dv~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z17dv~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z17dv~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z17dv~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z17dv~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z17dv~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z17dv~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z17dv~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z17dv~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z17wz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z17wz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z17wz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z17wz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z17wz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z17wz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z17wz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z17wz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z17wz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z17wz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z17wz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z17wz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z89wz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z89wz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z89wz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z89wz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z89wz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z89wz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z89wz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z89wz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z89wz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = ~d5z89wz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5zprp1~ END -// LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5zz145~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5src-1~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5src-2~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5src-3~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5src-4~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5src-5~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5src-6~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5src-7~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5src-8~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5src-9~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5shm-1~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5shm-2~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5shm-3~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5shm-4~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5shm-5~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5shm-6~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5shm-7~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 279 target = 1 parameter2 = 2 timing = 9 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 duration = 0 STR_VAR resource = ~d5zz172a~ END -// LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5zsplz~ END -// LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END -// LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END -END - - -// 5E system initialization___________________________________________________________ -// -// put this zz000 in the clab tables -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5zz000.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zz000.spl~ - SAY NAME1 ~initialize 5E spellcasting~ - SAY UNIDENTIFIED_DESC ~initialize 5E spellcasting~ - LPF ALTER_SPELL_HEADER INT_VAR target = 7 STR_VAR icon = ~d5zcast~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 93 target = 1 parameter1 = 1 parameter2 = 1 timing = 1 END -// LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5zlotz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = ~d5zlots~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = 19 parameter2 = 105 timing = 9 STR_VAR resource = ~d5zz000~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = 2 parameter2 = 112 timing = 9 STR_VAR resource = ~d5zz000~ END -END - -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5zz001.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zz001.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 111 timing = 1 STR_VAR resource = ~d5zzini~ END -END - -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5zzini.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zzini.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 1 parameter2 = 105 timing = 1 STR_VAR resource = ~d5z0slt~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5zz206~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5znoqk~ END -// PATCH_IF (MOD_IS_INSTALLED ~tomeandblood.tp2~ ~62~) BEGIN -// LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5z2slt~ END -// END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5zz000~ END -// LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5zprpb~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter1 = 0 parameter2 = 1 timing = 1 STR_VAR resource = ~d5zprp1~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 171 target = 1 timing = 9 STR_VAR resource = ~d5zprp~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 93 target = 1 parameter1 = 0 parameter2 = 1 timing = 4 duration = 4 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5zzini~ END -END - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zz010.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 3 parameter2 = 105 timing = 1 STR_VAR resource = ~d5zsttd~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 6 parameter2 = 105 timing = 1 STR_VAR resource = ~d5zsttd~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 8 parameter2 = 105 timing = 1 STR_VAR resource = ~d5zsttd~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 11 parameter2 = 105 timing = 1 STR_VAR resource = ~d5zsttd~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 12 parameter2 = 105 timing = 1 STR_VAR resource = ~d5zsttd~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 14 parameter2 = 105 timing = 1 STR_VAR resource = ~d5zsttd~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 15 parameter2 = 105 timing = 1 STR_VAR resource = ~d5zsttd~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 16 parameter2 = 105 timing = 1 STR_VAR resource = ~d5zsttd~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 17 parameter2 = 105 timing = 1 STR_VAR resource = ~d5zsttd~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 18 parameter2 = 105 timing = 1 STR_VAR resource = ~d5zsttd~ END - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zz020.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 1 parameter2 = 105 timing = 1 STR_VAR resource = ~d5zstta~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 5 parameter2 = 105 timing = 1 STR_VAR resource = ~d5zstta~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 7 parameter2 = 105 timing = 1 STR_VAR resource = ~d5zstta~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 10 parameter2 = 105 timing = 1 STR_VAR resource = ~d5zstta~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 13 parameter2 = 105 timing = 1 STR_VAR resource = ~d5zstta~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 14 parameter2 = 105 timing = 1 STR_VAR resource = ~d5zstta~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 17 parameter2 = 105 timing = 1 STR_VAR resource = ~d5zstta~ END - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zsttd.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 328 target = 1 special = 1 parameter2 = %semi_spont_divine% timing = 9 END - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zstta.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 328 target = 1 special = 1 parameter2 = %semi_spont_arcane% timing = 9 END - - -// generate zclons.2da________________________________________________________________ -// -<<<<<<<< d5/d5zclons.2da -2DA V1.0 -IND - MEM CAST TYPE PROCESSED -100 # # # # ->>>>>>>> - -COPY ~d5/d5zclons.2da~ ~override/d5zclons.2da~ - -// 206/blocking spell = d5zb[ind] -// 171/granting .eff = d5ze[ind] -// 321/learning spell = d5zl[ind] -// 146/innate spell = d5zi[ind] - - -//remove wiz bonus slots______________________________________________________________ -// -ACTION_IF (FILE_EXISTS_IN_GAME ~d5absp1.spl~) BEGIN - COPY_EXISTING ~d5absp1.spl~ ~override~ - LPF DELETE_EFFECT INT_VAR match_opcode = 177 STR_VAR match_resource = ~d5abspw~ END - BUT_ONLY -END - -ACTION_IF (FILE_EXISTS_IN_GAME ~d5abspw.spl~) BEGIN - COPY_EXISTING ~d5abspw.spl~ ~override~ - LPF DELETE_EFFECT END - BUT_ONLY -END - -//fix burning hands targeting_______________________________________________________ -// -COPY_EXISTING ~spwi103.spl~ ~override~ - READ_LONG 0x08 burning_hands_strref -BUT_ONLY - -ACTION_IF (IS_AN_INT %burning_hands_strref%) BEGIN - COPY_EXISTING_REGEXP GLOB ~^.+\.spl$~ ~override~ - PATCH_IF (%SOURCE_SIZE% > 0x71) BEGIN - SET burning_change = 0 - READ_LONG 0x08 name - PATCH_IF (name = burning_hands_strref) BEGIN - GET_OFFSET_ARRAY ab_array SPL_V10_HEADERS - PHP_EACH ab_array AS int => ab_off BEGIN - PATCH_IF (burning_change = 0) BEGIN - READ_BYTE (ab_off + 0x0c) target - PATCH_IF target = 5 BEGIN - SET burning_change = 1 - END - END - END - PATCH_IF (burning_change = 1) BEGIN - LPF ALTER_SPELL_HEADER INT_VAR target = 1 END - LPF ALTER_EFFECT INT_VAR match_opcode = 148 opcode = 146 target = 2 STR_VAR match_resource = ~spwi103~ END - WRITE_BYTE 0x1b (THIS BOR 1) - END - END - END - BUT_ONLY -END - - -//fix black pits 2___________________________________________________________________ -// -COPY_EXISTING ~ohbantim.spl~ override - LPF ALTER_EFFECT INT_VAR match_opcode = 144 match_parameter2 = 13 opcode = 145 parameter2 = 3 END -IF_EXISTS BUT_ONLY - -// change BP1 to allow innates too -// EDIT - don't need to! - -//____________________________________________________________________________________ - - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_marker.d5~ ~override/d5__semi_spont.d5~ - - -END // end marker file check - - -ACTION_IF (include_divine = 1) BEGIN - LAF semi_divine_spells END -END - -ACTION_IF (include_arcane = 1) BEGIN - LAF semi_arcane_spells END -END - -LAF process_semi_spells END - - -END // end define function - - -//__________________________________________________________________________________ -//__________________________________________________________________________________ - - -DEFINE_ACTION_FUNCTION process_semi_spells BEGIN - -ACTION_IF (FILE_EXISTS_IN_GAME ~5E_casting_settings.ini~) BEGIN - INCLUDE ~override/5E_casting_settings.ini~ -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~5E_casting_settings.ini~) BEGIN - INCLUDE ~%MOD_FOLDER%/lib/semi_spont/5E_casting_settings.ini~ -END - -LAM 5E_casting_settings - -ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_SEMI_ARCANE~)) BEGIN - COPY_EXISTING ~splstate.ids~ ~override~ - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW rows cols - FOR (row = 1; row < rows; ++row) BEGIN - READ_2DA_ENTRY_FORMER rows row 1 ~state_name~ - READ_2DA_ENTRY_FORMER rows row 0 ~state_ind~ - PATCH_IF (~%state_name%~ STRING_EQUAL_CASE ~D5_SEMI_ARCANE~) BEGIN - SET semi_spont_arcane = %state_ind% - END - END - BUT_ONLY -END - -ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_SEMI_DIVINE~)) BEGIN - COPY_EXISTING ~splstate.ids~ ~override~ - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW rows cols - FOR (row = 1; row < rows; ++row) BEGIN - READ_2DA_ENTRY_FORMER rows row 1 ~state_name~ - READ_2DA_ENTRY_FORMER rows row 0 ~state_ind~ - PATCH_IF (~%state_name%~ STRING_EQUAL_CASE ~D5_SEMI_DIVINE~) BEGIN - SET semi_spont_divine = %state_ind% - END - END - BUT_ONLY -END - -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5zlotr.bcs~) BEGIN -<<<<<<<>>>>>>> - - COPY ~d5/inline_script.baf~ ~weidu_external/d5_semi_cast/d5zlotr.baf~ - -<<<<<<<>>>>>>> - - COPY ~d5/inline_script_end.baf~ ~weidu_external/d5_semi_cast/d5z_end.baf~ - -END - -COPY_EXISTING ~d5zclons.2da~ ~override~ - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW ~r2en_zclons~ cols - FOR (row = 0; row < r2en_zclons; ++row) BEGIN - READ_2DA_ENTRY_FORMER ~r2en_zclons~ row 0 z_ind - READ_2DA_ENTRY_FORMER ~r2en_zclons~ row 1 mem_spell - READ_2DA_ENTRY_FORMER ~r2en_zclons~ row 2 cast_spell - READ_2DA_ENTRY_FORMER ~r2en_zclons~ row 3 spell_type - READ_2DA_ENTRY_FORMER ~r2en_zclons~ row 4 spell_proc - SPRINT innate_spell ~d5z%z_ind%i~ - SPRINT give_spell ~d5z%z_ind%g~ - SPRINT block_spell ~d5z%z_ind%b~ - SPRINT learn_spell ~d5z%z_ind%l~ - PATCH_IF (z_ind > 100) AND (~%spell_proc%~ STRING_EQUAL_CASE ~no~) BEGIN - INNER_ACTION BEGIN - COPY_EXISTING ~%mem_spell%.spl~ ~override~ - READ_LONG 0x34 level - IF_EXISTS BUT_ONLY -// create innate spell - COPY_EXISTING ~%cast_spell%.spl~ ~override/%innate_spell%.spl~ - WRITE_SHORT 0x1c 4 - LPF ALTER_SPELL_HEADER INT_VAR location = 2 END - READ_LONG 0x64 abil_offset - READ_SHORT 0x68 abil_number - READ_BYTE (%abil_offset% + 0x0c) abil_target - READ_SHORT (%abil_offset% + 0x0e) abil_range - READ_LONG 0x6a eff_offset - WHILE (%abil_number% > 0) BEGIN - SET abil_number = (%abil_number% - 1) - WRITE_SHORT (%abil_offset% + 0x26 + (0x28 * %abil_number%)) 1 - END - READ_BYTE (%eff_offset% + 0x02) eff_target - LPF DELETE_EFFECT INT_VAR match_probability2 = 0 END - PATCH_IF (%abil_target% = 4) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 148 target = 1 power = 0 parameter1 = 0 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%cast_spell%~ END - PATCH_IF (%abil_range% < 35) BEGIN - PATCH_IF (%abil_range% > 4) BEGIN - LPF ALTER_SPELL_HEADER INT_VAR range = (%abil_range% - 3) END - END - PATCH_IF (%abil_range% < 5) BEGIN - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END // might need to carve out exceptions, e.g. burning hands - END - END - END - ELSE BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 2 power = 0 parameter2 = 1 timing = 9 STR_VAR resource = EVAL ~%cast_spell%~ END - END -// exempt lvl 1 if lv1 1 cantrips - PATCH_IF (~%spell_type%~ STRING_EQUAL_CASE ~arcane~) BEGIN - PATCH_IF (MOD_IS_INSTALLED ~tomeandblood.tp2~ ~62~) BEGIN - PATCH_IF (%level% > 1) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5src-%level%~ END - END - END - PATCH_IF !(MOD_IS_INSTALLED ~tomeandblood.tp2~ ~62~) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5src-%level%~ END - END - END - PATCH_IF (~%spell_type%~ STRING_EQUAL_CASE ~divine~) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5shm-%level%~ END - END - PATCH_IF (lose_spell_on_interrupt = 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END -// LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 9 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END -// LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 9 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - END - PATCH_IF (lose_spell_on_interrupt = 1) BEGIN - LPF ADD_SPELL_CFEFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END -// LPF ADD_SPELL_CFEFFECT INT_VAR opcode = 326 target = 9 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END -// LPF ADD_SPELL_CFEFFECT INT_VAR opcode = 326 target = 9 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - END -// make spells adding the innate spell - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/%give_spell%.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 171 target = 1 timing = 9 STR_VAR resource = EVAL ~%innate_spell%~ END -// make 206 spells preventing the add spell - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/%block_spell%.spl~ - WRITE_SHORT 0x1c 4 - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~%give_spell%~ END -// add 206 spells to CLAB spell - COPY_EXISTING ~d5zz206.spl~ ~override~ - LPF DELETE_EFFECT INT_VAR match_opcode = 146 STR_VAR match_resource = EVAL ~%block_spell%~ END - LPF DELETE_EFFECT INT_VAR match_opcode = 321 STR_VAR match_resource = EVAL ~%block_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%block_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~%block_spell%~ END -// make learn spells canceling the 206 - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/%learn_spell%.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~%block_spell%~ END -// LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~%block_spell%~ END -// add 172 to zz172 - COPY_EXISTING ~d5zz172.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~%innate_spell%~ END -// generate slot#x spells - ACTION_IF (~%spell_type%~ STRING_EQUAL_CASE ~arcane~) BEGIN - ACTION_IF (FILE_EXISTS_IN_GAME ~d5zwot%level%a.spl~) BEGIN - COPY_EXISTING ~d5zwot%level%a.spl~ ~override~ - LPF DELETE_EFFECT INT_VAR match_opcode = 146 STR_VAR match_resource = EVAL ~%give_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - COPY_EXISTING ~d5zwot%level%b.spl~ ~override~ - LPF DELETE_EFFECT INT_VAR match_opcode = 146 STR_VAR match_resource = EVAL ~%give_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - COPY_EXISTING ~d5zwot%level%c.spl~ ~override~ - LPF DELETE_EFFECT INT_VAR match_opcode = 146 STR_VAR match_resource = EVAL ~%give_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - COPY_EXISTING ~d5zwot%level%d.spl~ ~override~ - LPF DELETE_EFFECT INT_VAR match_opcode = 146 STR_VAR match_resource = EVAL ~%give_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - END - END - ACTION_IF (~%spell_type%~ STRING_EQUAL_CASE ~divine~) BEGIN - ACTION_IF (FILE_EXISTS_IN_GAME ~d5zdot%level%a.spl~) BEGIN - COPY_EXISTING ~d5zdot%level%a.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - COPY_EXISTING ~d5zdot%level%b.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - COPY_EXISTING ~d5zdot%level%c.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - COPY_EXISTING ~d5zdot%level%d.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END - END - END - APPEND_OUTER ~weidu_external/d5_semi_cast/d5zlotr.baf~ ~ -IF - TriggerOverride(LastSummonerOf(Myself),HaveSpellRES("%mem_spell%")) -THEN - RESPONSE #100 - ActionOverride(LastSummonerOf(Myself),ApplySpellRes("%learn_spell%",Myself)) - Continue() -END -~ - END - SET_2DA_ENTRY row 4 cols ~yes~ - END - END -BUT_ONLY - - -// compile script_____________________________________________________________________ -// -ACTION_IF (FILE_EXISTS_IN_GAME ~d5zlotr.bcs~) BEGIN - DELETE ~override/d5zlotr.bcs~ -END - -COMPILE ~weidu_external/d5_semi_cast/d5zlotr.baf~ - -EXTEND_BOTTOM ~d5zlotr.bcs~ ~weidu_external/d5_semi_cast/d5z_end.baf~ - -// finalize zz172_____________________________________________________________________ -// -COPY_EXISTING ~d5zz172.spl~ ~override/d5zz172a.spl~ - LPF DELETE_EFFECT - -COPY_EXISTING ~d5zz172.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 9 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 9 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - - -END // end define function - - -//__________________________________________________________________________________ -//__________________________________________________________________________________ - - -DEFINE_ACTION_FUNCTION semi_divine_spells BEGIN - -// ***** check if cast spell already there... if so use same ind - -ACTION_IF (FILE_EXISTS_IN_GAME ~d5zclons.2da~) BEGIN - - OUTER_SET high_ind = 99 - COPY_EXISTING ~d5zclons.2da~ ~override~ - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW ~r2en_zclons~ cols - FOR (row = 0; row < r2en_zclons; ++row) BEGIN - READ_2DA_ENTRY_FORMER ~r2en_zclons~ row 0 this_ind - PATCH_IF (this_ind > high_ind) BEGIN - SET high_ind = this_ind - END - END - BUT_ONLY - - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5__spheres.d5~) BEGIN - COPY_EXISTING_REGEXP ~^[Ss][Pp][Pp][Rr][1-7]\([0-4][0-9]\|50\)\.spl$~ ~override~ - SET spl_ind = 0 - INNER_ACTION BEGIN - ACTION_IF (FILE_CONTAINS_EVALUATED (~d5zclons.2da~ ~%SOURCE_RES%~)) BEGIN - COPY_EXISTING ~d5zclons.2da~ ~override~ - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW ~r2en_zclons~ cols - FOR (row = 0; row < r2en_zclons; ++row) BEGIN - READ_2DA_ENTRY_FORMER ~r2en_zclons~ row 0 prev_ind - READ_2DA_ENTRY_FORMER ~r2en_zclons~ row 2 cast_spell - PATCH_IF (~%SOURCE_RES%~ 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 ~d5zclons.2da~ ~%spl_ind% %SOURCE_RES% %SOURCE_RES% divine no ~ UNLESS ~%SOURCE_RES% %SOURCE_RES%~ - END - BUT_ONLY - END // end no FnP - - ACTION_IF (FILE_EXISTS_IN_GAME ~d5__spheres.d5~) BEGIN - COPY_EXISTING ~d5fnplst.2da~ ~override~ - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW ~r2en_fnplst~ cols - FOR (row = 0; row < r2en_fnplst; ++row) BEGIN - READ_2DA_ENTRY_FORMER ~r2en_fnplst~ row 0 real_spell - READ_2DA_ENTRY_FORMER ~r2en_fnplst~ row 1 major_spell - READ_2DA_ENTRY_FORMER ~r2en_fnplst~ row 2 minor_spell - READ_2DA_ENTRY_FORMER ~r2en_fnplst~ row 3 focus_spell - SET spl_ind = 0 - INNER_ACTION BEGIN - COPY_EXISTING ~d5zclons.2da~ ~override~ - COUNT_2DA_COLS cols - COUNT_2DA_ROWS cols rows - READ_2DA_ENTRY (rows - 1) 0 cols last_ind - BUT_ONLY - ACTION_IF (FILE_CONTAINS_EVALUATED (~d5zclons.2da~ ~%real_spell%~)) BEGIN - COPY_EXISTING ~d5zclons.2da~ ~override~ - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW ~r2en_zclons~ cols - READ_2DA_ENTRY (r2en_zclons - 1) 0 cols last_ind - FOR (row = 0; row < r2en_zclons; ++row) BEGIN - READ_2DA_ENTRY_FORMER ~r2en_zclons~ row 0 prev_ind - READ_2DA_ENTRY_FORMER ~r2en_zclons~ row 2 cast_spell - PATCH_IF (~%real_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 ~d5zclons.2da~ ~%spl_ind% %major_spell% %real_spell% divine no ~ UNLESS ~%major_spell% %real_spell%~ -// APPEND ~d5zclons.2da~ ~%spl_ind% %focus_spell% %real_spell% divine no ~ UNLESS ~%focus_spell% %real_spell%~ - ACTION_IF !(~%minor_spell%~ STRING_EQUAL_CASE ~%major_spell%~) BEGIN - ACTION_IF !(~%minor_spell%~ STRING_EQUAL_CASE ~****~) BEGIN - APPEND ~d5zclons.2da~ ~%spl_ind% %minor_spell% %real_spell% divine no ~ UNLESS ~%minor_spell% %real_spell%~ - END - END - END - END - BUT_ONLY - END // end FnP - -END - -END // end function - - -//__________________________________________________________________________________ -//__________________________________________________________________________________ - - -DEFINE_ACTION_FUNCTION semi_arcane_spells BEGIN - -ACTION_IF (FILE_EXISTS_IN_GAME ~d5zclons.2da~) BEGIN - - OUTER_SET high_ind = 99 - COPY_EXISTING ~d5zclons.2da~ ~override~ - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW ~r2en_zclons~ cols - FOR (row = 0; row < r2en_zclons; ++row) BEGIN - READ_2DA_ENTRY_FORMER ~r2en_zclons~ row 0 this_ind - PATCH_IF (this_ind > high_ind) BEGIN - SET high_ind = this_ind - END - END - BUT_ONLY - - COPY_EXISTING ~d5zclons.2da~ ~override~ - COUNT_2DA_COLS cols - COUNT_2DA_ROWS cols rows - READ_2DA_ENTRY (rows - 1) 0 cols last_ind - BUT_ONLY - - OUTER_SET scroll_spell_ind = 0 - OUTER_SPRINT $scroll_spells(~spell~) ~0~ // ~%scroll_spell_ind%~ - COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~ - READ_BYTE 0x2f current ELSE 0 - READ_BYTE 0x2b current2 ELSE 0 - READ_LONG 0x64 headoffset ELSE 0 - READ_SHORT 0x68 headcount ELSE 0 - READ_LONG 0x6a effectsoffset ELSE 0 - haslearn = 0 - hascast = 0 -// PATCH_IF (headcount > 1) BEGIN - FOR (headcyc = 0; headcyc < headcount ; headcyc = headcyc + 1) BEGIN - thishead = 0 - READ_SHORT (headoffset + (headcyc * 0x38) + 0x1e) effcount ELSE 0 - READ_SHORT (headoffset + (headcyc * 0x38) + 0x20) effectsindex ELSE 0 - FOR (effcyc = 0; effcyc < effcount; effcyc = effcyc + 1) BEGIN - READ_SHORT (effectsoffset + (effectsindex + effcyc)* 0x30) opcode ELSE 0 - PATCH_IF (opcode = 0x93) AND (thishead = 0) BEGIN - READ_ASCII (effectsoffset + 0x14 + (effectsindex + effcyc)* 0x30) resref_learn ELSE 0 - INNER_PATCH_FILE ~%resref_learn%.spl~ BEGIN - READ_SHORT 0x1c type - END - PATCH_IF (type = 1) BEGIN // arcane spell scroll - thishead = 1 - haslearn = 1 - END - END - PATCH_IF ((opcode = 0x92) OR (opcode = 0x94)) AND (thishead = 0) BEGIN - READ_ASCII (effectsoffset + 0x14 + (effectsindex + effcyc)* 0x30) resref_cast ELSE 0 - INNER_PATCH_FILE ~%resref_cast%.spl~ BEGIN - READ_SHORT 0x1c type - END - PATCH_IF (type = 1) BEGIN // arcane spell scroll - thishead = 1 - hascast = 1 - END - END - END - END -// END // end has >1 headers - PATCH_IF (haslearn = 1) AND (hascast = 1) AND (~%resref_cast%~ STRING_EQUAL_CASE ~%resref_learn%~) BEGIN - SPRINT $scroll_spells(~%resref_learn%~) ~1~ // ~%scroll_spell_ind%~ - SET ++scroll_spell_ind - END - BUT_ONLY - - ACTION_FOR_EACH hla IN - ~spwi920~ - ~spwi921~ - ~spwi922~ - ~spwi923~ - ~spwi924~ - ~spwi925~ - ~TG#DRGB~ - ~TG#CLEA~ - ~TG#BONU~ - ~TG#DTHF~ - ~TG#AEGI~ - ~TG#FORS~ - ~LI#SCRB~ BEGIN - ACTION_IF (FILE_EXISTS_IN_GAME ~%hla%.spl~) BEGIN - COPY_EXISTING ~%hla%.spl~ ~override~ - READ_SHORT 0x1c spell_type - PATCH_IF (spell_type = 1) BEGIN - SPRINT $scroll_spells(~%hla%~) ~1~ - END - IF_EXISTS BUT_ONLY - END - END - - ACTION_PHP_EACH scroll_spells AS arcane_spell => ind BEGIN - ACTION_IF (%ind% > 0) BEGIN - OUTER_SET spl_ind = 0 - ACTION_IF (FILE_CONTAINS_EVALUATED (~d5zclons.2da~ ~%arcane_spell%~)) BEGIN - COPY_EXISTING ~d5zclons.2da~ ~override~ - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW ~r2en_zclons~ cols - FOR (row = 0; row < r2en_zclons; ++row) BEGIN - READ_2DA_ENTRY_FORMER ~r2en_zclons~ row 0 prev_ind - READ_2DA_ENTRY_FORMER ~r2en_zclons~ row 2 cast_spell - PATCH_IF (~%arcane_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 ~d5zclons.2da~ ~%spl_ind% %arcane_spell% %arcane_spell% arcane no ~ UNLESS ~%arcane_spell% %arcane_spell%~ - END - END - -END - -END // end function - - -//__________________________________________________________________________________ -//__________________________________________________________________________________ - - -DEFINE_ACTION_FUNCTION add_semi_spells STR_VAR new_spell = ~x~ cast_spell = ~x~ spell_type = ~x~ BEGIN - -// add them to zclons.2da - -ACTION_IF (FILE_EXISTS_IN_GAME ~d5zclons.2da~) BEGIN - - COPY_EXISTING ~d5zclons.2da~ ~override~ - COUNT_2DA_COLS cols - COUNT_2DA_ROWS cols rows - READ_2DA_ENTRY (rows - 1) 0 cols last_ind - BUT_ONLY - OUTER_SET spl_ind = (last_ind + 1) - - APPEND ~d5zclons.2da~ ~%spl_ind% %new_spell% %cast_spell% %spell_type% no ~ UNLESS ~%new_spell% %cast_spell%~ - -END - -// then just re-run the 'process spells' function -// wait no better to do that manually - -//LAF process_semi_spells END - -END // end function - - -//__________________________________________________________________________________ -//__________________________________________________________________________________ - - -DEFINE_ACTION_FUNCTION free_cast_spells STR_VAR free_spell = ~~ list_spell = ~~ BEGIN - -ACTION_IF (FILE_CONTAINS_EVALUATED (~d5zclons.2da~ ~%free_spell%~)) BEGIN - ACTION_IF !(FILE_EXISTS_IN_GAME ~%list_spell%.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/%list_spell%.spl~ - END - COPY_EXISTING ~d5zclons.2da~ ~override~ - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW ~r2en_zclons~ cols - SET free_spell_ind = 0 - FOR (row = 0; row < r2en_zclons; ++row) BEGIN - READ_2DA_ENTRY_FORMER ~r2en_zclons~ row 1 mem_spell - READ_2DA_ENTRY_FORMER ~r2en_zclons~ row 0 z_ind - PATCH_IF (~%mem_spell%~ STRING_EQUAL_CASE ~%free_spell%~) BEGIN - SET free_spell_ind = z_ind - END - END - BUT_ONLY - ACTION_IF (free_spell_ind > 0) BEGIN - COPY_EXISTING ~%list_spell%.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z%free_spell_ind%b~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5z%free_spell_ind%b~ END - BUT_ONLY - END -END - -END // end function - - -//__________________________________________________________________________________ -//__________________________________________________________________________________ - - -DEFINE_ACTION_FUNCTION free_known_spells STR_VAR free_spell = ~~ list_spell = ~~ BEGIN - -/* -ACTION_IF (FILE_CONTAINS_EVALUATED (~d5zclons.2da~ ~%free_spell%~)) BEGIN - COPY_EXISTING ~d5zclons.2da~ ~override~ - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW ~r2en_zclons~ cols - FOR (row = 0; row < r2en_zclons; ++row) BEGIN - READ_2DA_ENTRY_FORMER ~r2en_zclons~ row 1 mem_spell - READ_2DA_ENTRY_FORMER ~r2en_zclons~ row 0 z_ind - PATCH_IF (~%mem_spell%~ STRING_EQUAL_CASE ~%free_spell%~) BEGIN - SET free_spell_ind = z_ind - END - END - BUT_ONLY -*/ - ACTION_IF !(FILE_EXISTS_IN_GAME ~%list_spell%.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/%list_spell%.spl~ - END - COPY_EXISTING ~%list_spell%.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 171 target = 1 timing = 1 STR_VAR resource = EVAL ~%free_spell%~ END - BUT_ONLY -//END - -END // end function - - -//__________________________________________________________________________________ -//__________________________________________________________________________________ - - -DEFINE_ACTION_FUNCTION find_zclons_spell STR_VAR spell_to_find = ~~ RET zclons_ind spell_to_cast type_of_spell BEGIN - -COPY_EXISTING ~d5zclons.2da~ ~override~ - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW ~r2en_zclons~ cols - FOR (row = 0; row < r2en_zclons; ++row) BEGIN - READ_2DA_ENTRY_FORMER ~r2en_zclons~ row 0 z_ind - READ_2DA_ENTRY_FORMER ~r2en_zclons~ row 1 mem_spell - READ_2DA_ENTRY_FORMER ~r2en_zclons~ row 2 cast_spell - READ_2DA_ENTRY_FORMER ~r2en_zclons~ row 3 spell_type - READ_2DA_ENTRY_FORMER ~r2en_zclons~ row 4 spell_proc - PATCH_IF (~%mem_spell%~ STRING_EQUAL_CASE ~%spell_to_find%~) BEGIN - SET zclons_ind = %z_ind% - SPRINT spell_to_cast ~%cast_spell%~ - SPRINT type_of_spell ~%spell_type%~ - END - END -BUT_ONLY - -END // end function - - -//__________________________________________________________________________________ -//__________________________________________________________________________________ - - -DEFINE_PATCH_FUNCTION divine_casting_slots STR_VAR table_spl = ~~ BEGIN - -// PATCH function - copy .2da table, run this - - INNER_ACTION BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5__slt.spl~ ~override/%table_spl%.spl~ - END - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW r2en_table cols - FOR (row = 0; row < r2en_table; ++row) BEGIN - PATCH_IF (cols > 1) BEGIN - READ_2DA_ENTRY_FORMER r2en_table row 1 level_1 - END - PATCH_IF (cols > 2) BEGIN - READ_2DA_ENTRY_FORMER r2en_table row 2 level_2 - END - PATCH_IF (cols > 3) BEGIN - READ_2DA_ENTRY_FORMER r2en_table row 3 level_3 - END - PATCH_IF (cols > 4) BEGIN - READ_2DA_ENTRY_FORMER r2en_table row 4 level_4 - END - PATCH_IF (cols > 5) BEGIN - READ_2DA_ENTRY_FORMER r2en_table row 5 level_5 - END - PATCH_IF (cols > 6) BEGIN - READ_2DA_ENTRY_FORMER r2en_table row 6 level_6 - END - PATCH_IF (cols > 7) BEGIN - READ_2DA_ENTRY_FORMER r2en_table row 7 level_7 - END - INNER_ACTION BEGIN - COPY_EXISTING ~%table_spl%.spl~ ~override~ - PATCH_IF (VARIABLE_IS_SET %level_1%) BEGIN - PATCH_IF (IS_AN_INT %level_1%) AND (%level_1% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_1% << 4) parameter2 = (134 + (0x10000 * 1)) timing = 0 duration = 126144000 END - END - END - PATCH_IF (VARIABLE_IS_SET %level_2%) BEGIN - PATCH_IF (IS_AN_INT %level_2%) AND (%level_2% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_2% << 8) parameter2 = (134 + (0x10000 * 1)) timing = 0 duration = 126144000 END - END - END - PATCH_IF (VARIABLE_IS_SET %level_3%) BEGIN - PATCH_IF (IS_AN_INT %level_3%) AND (%level_3% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_3% << 12) parameter2 = (134 + (0x10000 * 1)) timing = 0 duration = 126144000 END - END - END - PATCH_IF (VARIABLE_IS_SET %level_4%) BEGIN - PATCH_IF (IS_AN_INT %level_4%) AND (%level_4% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_4% << 16) parameter2 = (134 + (0x10000 * 1)) timing = 0 duration = 126144000 END - END - END - PATCH_IF (VARIABLE_IS_SET %level_5%) BEGIN - PATCH_IF (IS_AN_INT %level_5%) AND (%level_5% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_5% << 20) parameter2 = (134 + (0x10000 * 1)) timing = 0 duration = 126144000 END - END - END - PATCH_IF (VARIABLE_IS_SET %level_6%) BEGIN - PATCH_IF (IS_AN_INT %level_6%) AND (%level_6% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_6% << 24) parameter2 = (134 + (0x10000 * 1)) timing = 0 duration = 126144000 END - END - END - PATCH_IF (VARIABLE_IS_SET %level_7%) BEGIN - PATCH_IF (IS_AN_INT %level_7%) AND (%level_7% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_7% << 28) parameter2 = (134 + (0x10000 * 1)) timing = 0 duration = 126144000 END - END - END - IF_EXISTS BUT_ONLY - END - END - INNER_ACTION BEGIN - COPY_EXISTING ~%table_spl%.spl~ ~override~ -// LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 0 duration = 1 STR_VAR resource = EVAL ~%table_spl%~ END - FOR (header = 1 ; header < 40; ++header) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%header% + 1) insert_point = 0 opcode = 321 target = 1 timing = 1 STR_VAR resource = EVAL ~%table_spl%~ END - LPF ADD_SPELL_EFFECT INT_VAR header = (%header% + 1) opcode = 146 target = 1 parameter1 = 0 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END - END - END - -END // end function - - -//__________________________________________________________________________________ -//__________________________________________________________________________________ - - -DEFINE_PATCH_FUNCTION arcane_casting_slots STR_VAR table_spl = ~~ BEGIN - -// PATCH function - copy .2da table, run this - - INNER_ACTION BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5__slt.spl~ ~override/%table_spl%.spl~ - END - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW r2en_table cols - FOR (row = 0; row < r2en_table; ++row) BEGIN - PATCH_IF (cols > 1) BEGIN - READ_2DA_ENTRY_FORMER r2en_table row 1 level_1 - END - PATCH_IF (cols > 2) BEGIN - READ_2DA_ENTRY_FORMER r2en_table row 2 level_2 - END - PATCH_IF (cols > 3) BEGIN - READ_2DA_ENTRY_FORMER r2en_table row 3 level_3 - END - PATCH_IF (cols > 4) BEGIN - READ_2DA_ENTRY_FORMER r2en_table row 4 level_4 - END - PATCH_IF (cols > 5) BEGIN - READ_2DA_ENTRY_FORMER r2en_table row 5 level_5 - END - PATCH_IF (cols > 6) BEGIN - READ_2DA_ENTRY_FORMER r2en_table row 6 level_6 - END - PATCH_IF (cols > 7) BEGIN - READ_2DA_ENTRY_FORMER r2en_table row 7 level_7 - END - PATCH_IF (cols > 8) BEGIN - READ_2DA_ENTRY_FORMER r2en_table row 8 level_8 - END - PATCH_IF (cols > 9) BEGIN - READ_2DA_ENTRY_FORMER r2en_table row 9 level_9 - END - INNER_ACTION BEGIN - COPY_EXISTING ~%table_spl%.spl~ ~override~ - PATCH_IF (VARIABLE_IS_SET %level_1%) BEGIN - PATCH_IF (IS_AN_INT %level_1%) AND (%level_1% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_1% << 4) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END - END - END - PATCH_IF (VARIABLE_IS_SET %level_2%) BEGIN - PATCH_IF (IS_AN_INT %level_2%) AND (%level_2% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_2% << 8) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END - END - END - PATCH_IF (VARIABLE_IS_SET %level_3%) BEGIN - PATCH_IF (IS_AN_INT %level_3%) AND (%level_3% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_3% << 12) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END - END - END - PATCH_IF (VARIABLE_IS_SET %level_4%) BEGIN - PATCH_IF (IS_AN_INT %level_4%) AND (%level_4% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_4% << 16) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END - END - END - PATCH_IF (VARIABLE_IS_SET %level_5%) BEGIN - PATCH_IF (IS_AN_INT %level_5%) AND (%level_5% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_5% << 20) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END - END - END - PATCH_IF (VARIABLE_IS_SET %level_6%) BEGIN - PATCH_IF (IS_AN_INT %level_6%) AND (%level_6% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_6% << 24) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END - END - END - PATCH_IF (VARIABLE_IS_SET %level_7%) BEGIN - PATCH_IF (IS_AN_INT %level_7%) AND (%level_7% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_7% << 28) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END - END - END - PATCH_IF (VARIABLE_IS_SET %level_8%) BEGIN - PATCH_IF (IS_AN_INT %level_8%) AND (%level_8% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_8% << 24) parameter2 = (109 + (0x10000 * 1)) timing = 0 duration = 126144000 END - END - END - PATCH_IF (VARIABLE_IS_SET %level_9%) BEGIN - PATCH_IF (IS_AN_INT %level_9%) AND (%level_9% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_9% << 28) parameter2 = (109 + (0x10000 * 1)) timing = 0 duration = 126144000 END - END - END - IF_EXISTS BUT_ONLY - END - END - INNER_ACTION BEGIN - COPY_EXISTING ~%table_spl%.spl~ ~override~ -// LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 0 duration = 1 STR_VAR resource = EVAL ~%table_spl%~ END - FOR (header = 1 ; header < 40; ++header) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%header% + 1) insert_point = 0 opcode = 321 target = 1 timing = 1 STR_VAR resource = EVAL ~%table_spl%~ END - LPF ADD_SPELL_EFFECT INT_VAR header = (%header% + 1) opcode = 146 target = 1 parameter1 = 0 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - END - END - -END // end function - - -//__________________________________________________________________________________ -//__________________________________________________________________________________ - - -DEFINE_ACTION_MACRO semi_int_slots BEGIN - -ACTION_IF (FILE_EXISTS_IN_GAME ~5E_casting_settings.ini~) BEGIN - INCLUDE ~override/5E_casting_settings.ini~ -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~5E_casting_settings.ini~) BEGIN - INCLUDE ~%MOD_FOLDER%/lib/semi_spont/5E_casting_settings.ini~ -END - -LAM 5E_casting_settings - -ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_SEMI_ARCANE~)) BEGIN - COPY_EXISTING ~splstate.ids~ ~override~ - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW rows cols - FOR (row = 1; row < rows; ++row) BEGIN - READ_2DA_ENTRY_FORMER rows row 1 ~state_name~ - READ_2DA_ENTRY_FORMER rows row 0 ~state_ind~ - PATCH_IF (~%state_name%~ STRING_EQUAL_CASE ~D5_SEMI_ARCANE~) BEGIN - SET semi_spont_arcane = %state_ind% - END - END - BUT_ONLY -END -ACTION_IF !(VARIABLE_IS_SET %semi_spont_arcane%) BEGIN - LAF d5_resolve_state STR_VAR new_state_id = ~D5_SEMI_ARCANE~ RET new_state_ind END - OUTER_SET semi_spont_arcane = %new_state_ind% -END - -ACTION_DEFINE_ASSOCIATIVE_ARRAY int_nums_lets BEGIN - 13 => 1a - 14 => 1b - 15 => 2a - 16 => 2b - 17 => 3a - 18 => 3b - 19 => 4a - 20 => 4b - 21 => 5a - 22 => 5b - 23 => 6a - 24 => 6b - 25 => 7a -END - -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5__semi_int.d5~) BEGIN - -// stat-based bonus spells____________________________________________________________ -// -/* -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5nabsw.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5nabsw.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5absp1~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5absp1~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5abspw~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5abspw~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intwl~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intwm~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intwn~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intwo~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intwp~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intwq~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intwr~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intws~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intwt~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intwu~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intwv~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intww~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intwx~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intwy~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrsl~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrsm~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrsn~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrso~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrsp~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrsq~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrsr~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrss~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrst~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrsu~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrsv~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrsw~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrsx~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrsy~ END -END -*/ - -ACTION_IF (int_bonus_mem_slots = 0) BEGIN - COPY_EXISTING ~d5zzini.spl~ ~override~ -// LPF ADD_SPELL_EFFECT INT_VAR insert_point = 1 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5nabsw~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 1 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5absp1~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 1 opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5absp1~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 1 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5abspw~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 1 opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5abspw~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 1 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5absp2~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 1 opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5absp2~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 1 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5abspb~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 1 opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5abspb~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 1 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5zislt~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 1 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5zjslt~ END -END - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5intbz.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 42 parameter1 = (0 - 1) parameter2 = 127 target = 1 timing = 9 END - -//OUTER_SET string = RESOLVE_STR_REF(~something is happening...~) - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5intb1a.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - PATCH_IF !(MOD_IS_INSTALLED ~tomeandblood.tp2~ ~62~) BEGIN // L1 cantrips - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 1 END - END -// LPF ADD_SPELL_EFFECT INT_VAR opcode = 139 target = 1 parameter1 = %string% timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5intb1b.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - PATCH_IF !(MOD_IS_INSTALLED ~tomeandblood.tp2~ ~62~) BEGIN // L1 cantrips - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 1 END - END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5intb2a.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5intb2b.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5intb3a.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5intb3b.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5intb4a.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5intb4b.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5intb5a.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 20) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5intb5b.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 20) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5intb6a.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 24) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5intb6b.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 24) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5intb7a.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 28) parameter2 = (108 + (0x10000 * 1)) timing = 1 END - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zintz.spl~ - PHP_EACH int_nums_lets AS int => slot BEGIN - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %int% parameter2 = 128 timing = 1 STR_VAR resource = EVAL ~d5intb%slot%~ END - END - PHP_EACH int_nums_lets AS int => slot BEGIN - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 1 STR_VAR resource = EVAL ~d5intb%slot%~ END - END -IF_EXISTS BUT_ONLY - -COPY_EXISTING ~d5zlotf.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5zintz~ END -IF_EXISTS BUT_ONLY - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_marker.d5~ ~override/d5__semi_int.d5~ - -END - -// ***** ^^ the above only needs to be done once ^^___________________________________ - -END // end define function - - -//__________________________________________________________________________________ -//__________________________________________________________________________________ - - -DEFINE_ACTION_MACRO semi_cha_slots BEGIN - -/* -APPEND ~splprot.2da~ ~D5_CHR_SLOTS%TAB%42%TAB%-1%TAB%1~ UNLESS ~D5_CHR_SLOTS~ - -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_CHR_SLOTS~ BEGIN - SET chr_slots = %row% - END - END -BUT_ONLY -*/ - -ACTION_DEFINE_ASSOCIATIVE_ARRAY cha_nums_lets BEGIN - 13 => 1a - 14 => 1b - 15 => 2a - 16 => 2c - 17 => 2b - 18 => 3a - 19 => 3c - 20 => 3b - 21 => 4a - 22 => 4c - 23 => 4b - 24 => 5a -END - -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5__semi_cha.d5~) BEGIN - -// stat-based bonus spells____________________________________________________________ -// -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5nabsw.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5nabsw.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5absp1~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5absp1~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5abspw~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5abspw~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intwl~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intwm~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intwn~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intwo~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intwp~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intwq~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intwr~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intws~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intwt~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intwu~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intwv~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intww~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intwx~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5intwy~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrsl~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrsm~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrsn~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrso~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrsp~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrsq~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrsr~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrss~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrst~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrsu~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrsv~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrsw~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrsx~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5chrsy~ END -END - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5chasz.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 42 parameter1 = (0 - 1) parameter2 = 31 target = 1 timing = 9 END - -//OUTER_SET string = RESOLVE_STR_REF(~something is happening...~) - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5chas1a.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - PATCH_IF !(MOD_IS_INSTALLED ~tomeandblood.tp2~ ~62~) BEGIN // L1 cantrips - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 1 END - END -// LPF ADD_SPELL_EFFECT INT_VAR opcode = 139 target = 1 parameter1 = %string% timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5chas1b.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - PATCH_IF !(MOD_IS_INSTALLED ~tomeandblood.tp2~ ~62~) BEGIN // L1 cantrips - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 1 END - END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5chas2a.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5chas2c.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 191 target = 1 parameter1 = 1 parameter2 = 0 timing = 0 duration = 126144000 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5chas2b.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5chas3a.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5chas3c.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 191 target = 1 parameter1 = 2 parameter2 = 0 timing = 0 duration = 126144000 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5chas3b.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5chas4a.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5chas4c.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 191 target = 1 parameter1 = 3 parameter2 = 0 timing = 0 duration = 126144000 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5chas4b.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5chas5a.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 20) parameter2 = (108 + (0x10000 * 1)) timing = 1 END - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5cham1a.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = 1 timing = 0 duration = 126144000 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5cham1b.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = 2 timing = 0 duration = 126144000 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5cham2a.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = 3 timing = 0 duration = 126144000 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5cham2c.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 191 target = 1 parameter1 = 1 parameter2 = 0 timing = 0 duration = 126144000 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5cham2b.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = 4 timing = 0 duration = 126144000 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5cham3a.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = 5 timing = 0 duration = 126144000 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5cham3c.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 191 target = 1 parameter1 = 2 parameter2 = 0 timing = 0 duration = 126144000 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5cham3b.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = 6 timing = 0 duration = 126144000 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5cham4a.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = 7 timing = 0 duration = 126144000 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5cham4c.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 191 target = 1 parameter1 = 3 parameter2 = 0 timing = 0 duration = 126144000 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5cham4b.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = 8 timing = 0 duration = 126144000 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5cham5a.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 95 target = 1 parameter1 = 9 timing = 0 duration = 126144000 END - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_marker.d5~ ~override/d5__semi_cha.d5~ - -END - -// ***** ^^ the above only needs to be done once ^^___________________________________ - -END // end define function - - -//__________________________________________________________________________________ -//__________________________________________________________________________________ - - -DEFINE_ACTION_MACRO semi_wis_slots BEGIN - -ACTION_IF (FILE_EXISTS_IN_GAME ~5E_casting_settings.ini~) BEGIN - INCLUDE ~override/5E_casting_settings.ini~ -END -ACTION_IF !(FILE_EXISTS_IN_GAME ~5E_casting_settings.ini~) BEGIN - INCLUDE ~%MOD_FOLDER%/lib/semi_spont/5E_casting_settings.ini~ -END - -LAM 5E_casting_settings - -ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_SEMI_DIVINE~)) BEGIN - COPY_EXISTING ~splstate.ids~ ~override~ - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW rows cols - FOR (row = 1; row < rows; ++row) BEGIN - READ_2DA_ENTRY_FORMER rows row 1 ~state_name~ - READ_2DA_ENTRY_FORMER rows row 0 ~state_ind~ - PATCH_IF (~%state_name%~ STRING_EQUAL_CASE ~D5_SEMI_DIVINE~) BEGIN - SET semi_spont_divine = %state_ind% - END - END - BUT_ONLY -END -ACTION_IF !(VARIABLE_IS_SET %semi_spont_divine%) BEGIN - LAF d5_resolve_state STR_VAR new_state_id = ~D5_SEMI_DIVINE~ RET new_state_ind END - OUTER_SET semi_spont_divine = %new_state_ind% -END - -ACTION_DEFINE_ASSOCIATIVE_ARRAY wis_nums_lets BEGIN - 13 => 1a - 14 => 1b - 15 => 2a - 16 => 2b - 17 => 3a - 18 => 3b - 19 => 4a - 20 => 4b - 21 => 5a - 22 => 5b - 23 => 6a - 24 => 6b - 25 => 7a -END - -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5__semi_wis.d5~) BEGIN - -// stat-based bonus spells____________________________________________________________ -// - -//OUTER_SET string = RESOLVE_STR_REF(~something is happening...~) - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5wisb1a.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 4) parameter2 = (134 + (0x10000 * 1)) timing = 1 END -// LPF ADD_SPELL_EFFECT INT_VAR opcode = 139 target = 1 parameter1 = %string% timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5wisb1b.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 4) parameter2 = (134 + (0x10000 * 1)) timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5wisb2a.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 8) parameter2 = (134 + (0x10000 * 1)) timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5wisb2b.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 8) parameter2 = (134 + (0x10000 * 1)) timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5wisb3a.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 12) parameter2 = (134 + (0x10000 * 1)) timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5wisb3b.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 12) parameter2 = (134 + (0x10000 * 1)) timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5wisb4a.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 16) parameter2 = (134 + (0x10000 * 1)) timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5wisb4b.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 16) parameter2 = (134 + (0x10000 * 1)) timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5wisb5a.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 20) parameter2 = (134 + (0x10000 * 1)) timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5wisb5b.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 20) parameter2 = (134 + (0x10000 * 1)) timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5wisb6a.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 24) parameter2 = (134 + (0x10000 * 1)) timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5wisb6b.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 24) parameter2 = (134 + (0x10000 * 1)) timing = 1 END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5wisb7a.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 28) parameter2 = (134 + (0x10000 * 1)) timing = 1 END - -COPY_EXISTING ~d5shfrsh.spl~ ~override~ - PHP_EACH wis_nums_lets AS wis => slot BEGIN - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %wis% parameter2 = 128 timing = 1 STR_VAR resource = EVAL ~d5wisb%slot%~ END - END - PHP_EACH wis_nums_lets AS wis => slot BEGIN - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 1 STR_VAR resource = EVAL ~d5wisb%slot%~ END - END -IF_EXISTS BUT_ONLY - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zwisz.spl~ - PHP_EACH int_nums_lets AS wis => slot BEGIN - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %int% parameter2 = 128 timing = 1 STR_VAR resource = EVAL ~d5wisb%slot%~ END - END - PHP_EACH int_nums_lets AS wis => slot BEGIN - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 1 STR_VAR resource = EVAL ~d5wisb%slot%~ END - END -IF_EXISTS BUT_ONLY - -COPY_EXISTING ~d5zlotf.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5zwisz~ END -IF_EXISTS BUT_ONLY - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_marker.d5~ ~override/d5__semi_wis.d5~ - -END - -// ***** ^^ the above only needs to be done once ^^___________________________________ - -END // end define function - - -//__________________________________________________________________________________ -//__________________________________________________________________________________ - - -//MAKE ARCANE +SPELL SLOT ITEMS WORK_________________________________________________ -// -// ***** -// set all +slot items to just +1 per level for consistency -// change Evermemory: give 1x/day ability to restore all 1st-level slots -// ...(in non-IR bgee, sod, iwdee) -// ...(Wondrous Recall + 321 d5src-1) -// ...(ring08.itm) -// likewise for Kontik's ring (for 1st- and 2nd-level slots) in iwdee -// ...(ringkon.itm) -// ring of acuity needs desc patch in non-IR bgee, sod, bg2ee -// ...(ring40.itm) -// ...(REPLACE_TEXTUALLY ~2 extra~ ~1 extra~) - -DEFINE_ACTION_FUNCTION arcane_spont_items BEGIN - -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_WIZ_1_7~) BEGIN - SET fake_sorc_slots_1_7 = %row% - END - PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_WIZ=1_7~) BEGIN - SET fake_sorc_equal_1_7 = %row% - END - PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_WIZ_8_9~) BEGIN - SET fake_sorc_slots_8_9 = %row% - END - PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_WIZ=8_9~) BEGIN - SET fake_sorc_equal_8_9 = %row% - END - PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_DIV_1_7~) BEGIN - SET fake_sham_slots_1_7 = %row% - END - PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_DIV=1_7~) BEGIN - SET fake_sham_equal_1_7 = %row% - END - PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_FATIGUE_0~) BEGIN - SET fatigue_zero = %row% - END - PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_PREP_SPLZ~) BEGIN - SET prep_spells_row = %row% - END - PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_NOT_PREP~) BEGIN - SET not_prep_row = %row% - END - END -BUT_ONLY - - -//wizard +slot items__________________________________________________________________ -// -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5__arcane_slot_items.d5~) BEGIN - -ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_MULTI_SORC~)) BEGIN - COPY_EXISTING ~splstate.ids~ ~override~ - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW rows cols - FOR (row = 1; row < rows; ++row) BEGIN - READ_2DA_ENTRY_FORMER rows row 1 ~state_name~ - READ_2DA_ENTRY_FORMER rows row 0 ~state_ind~ - PATCH_IF (~%state_name%~ STRING_EQUAL_CASE ~D5_MULTI_SORC~) BEGIN - SET multi_sorc_state = %state_ind% - END - END - BUT_ONLY -END -ACTION_IF !(VARIABLE_IS_SET %multi_sorc_state%) BEGIN - LAF d5_resolve_state STR_VAR new_state_id = ~D5_MULTI_SORC~ RET new_state_ind END - OUTER_SET multi_sorc_state = %new_state_ind% -END - -ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_SEMI_ARCANE~)) BEGIN - COPY_EXISTING ~splstate.ids~ ~override~ - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW rows cols - FOR (row = 1; row < rows; ++row) BEGIN - READ_2DA_ENTRY_FORMER rows row 1 ~state_name~ - READ_2DA_ENTRY_FORMER rows row 0 ~state_ind~ - PATCH_IF (~%state_name%~ STRING_EQUAL_CASE ~D5_SEMI_ARCANE~) BEGIN - SET semi_spont_arcane = %state_ind% - END - END - BUT_ONLY -END -ACTION_IF !(VARIABLE_IS_SET %semi_spont_arcane%) BEGIN - LAF d5_resolve_state STR_VAR new_state_id = ~D5_SEMI_ARCANE~ RET new_state_ind END - OUTER_SET semi_spont_arcane = %new_state_ind% -END - -ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_SEMI_DIVINE~)) BEGIN - COPY_EXISTING ~splstate.ids~ ~override~ - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW rows cols - FOR (row = 1; row < rows; ++row) BEGIN - READ_2DA_ENTRY_FORMER rows row 1 ~state_name~ - READ_2DA_ENTRY_FORMER rows row 0 ~state_ind~ - PATCH_IF (~%state_name%~ STRING_EQUAL_CASE ~D5_SEMI_DIVINE~) BEGIN - SET semi_spont_divine = %state_ind% - END - END - BUT_ONLY -END -ACTION_IF !(VARIABLE_IS_SET %semi_spont_divine%) BEGIN - LAF d5_resolve_state STR_VAR new_state_id = ~D5_SEMI_DIVINE~ RET new_state_ind END - OUTER_SET semi_spont_divine = %new_state_ind% -END - -OUTER_SET generic_ind = 1 -OUTER_SET mageslot_item_ind = 1 -OUTER_TEXT_SPRINT $mage_slot_items(~0~ ~0~ ~0~ ~0~) ~item~ -COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ override - SET slot_item = 0 - PATCH_IF SOURCE_SIZE > 0x72 BEGIN - GET_OFFSET_ARRAY glob_fx ITM_V10_GEN_EFFECTS - PHP_EACH glob_fx AS idx => off BEGIN - PATCH_IF SHORT_AT off == 42 BEGIN - SET slot_item = 1 - READ_LONG off + 0x04 param1 ELSE 0 - READ_LONG off + 0x08 param2 ELSE 0 - FOR (spell_level = 1; spell_level < 10; ++spell_level) BEGIN - PATCH_IF param2 & (2 ** (spell_level - 1)) BEGIN - TEXT_SPRINT $mage_slot_items(~%generic_ind%~ ~%mageslot_item_ind%~ ~%spell_level%~ ~%param1%~) ~%SOURCE_RES%~ - SET ++generic_ind - END - END - PATCH_IF param2 == 0 BEGIN - TEXT_SPRINT $mage_slot_items(~%generic_ind%~ ~%mageslot_item_ind%~ ~%param1%~ ~99~) ~%SOURCE_RES%~ - SET ++generic_ind - END - END // ELSE - PATCH_IF SHORT_AT off == 177 /* || SHORT_AT off == 326 */ BEGIN - READ_ASCII off + 0x14 eff_res (8) NULL - INNER_PATCH_FILE ~%eff_res%.EFF~ BEGIN - PATCH_IF LONG_AT 0x010 == 42 BEGIN - SET slot_item = 1 - READ_LONG 0x1c param1 ELSE 0 - READ_LONG 0x20 param2 ELSE 0 - FOR (spell_level = 1; spell_level < 10; ++spell_level) BEGIN - PATCH_IF param2 & (2 ** (spell_level - 1)) BEGIN - TEXT_SPRINT $mage_slot_items(~%generic_ind%~ ~%mageslot_item_ind%~ ~%spell_level%~ ~%param1%~) ~%SOURCE_RES%~ - SET ++generic_ind - END - END - PATCH_IF param2 == 0 BEGIN - TEXT_SPRINT $mage_slot_items(~%generic_ind%~ ~%mageslot_item_ind%~ ~%param1%~ ~99~) ~%SOURCE_RES%~ - SET ++generic_ind - END - END - END - END - END - END - PATCH_IF slot_item = 1 BEGIN - SET ++mageslot_item_ind - END -BUT_ONLY - -/* -ACTION_PHP_EACH mage_slot_items AS ind => slot_item BEGIN - PRINT ~%ind% %ind_1% %ind_2% %ind_3% %slot_item%~ -END -*/ - -ACTION_PHP_EACH mage_slot_items AS ind => slot_item BEGIN - ACTION_IF (%ind% > 0) BEGIN - PRINT ~%ind% %ind_1% %ind_2% %ind_3% %slot_item%~ - ACTION_IF (%ind_3% < 99) BEGIN - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z#%ind_1%%ind_2%.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z#%ind_1%%ind_2%.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - PATCH_IF (%ind_2% = 1) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 1 duration = 0 END - END - PATCH_IF (%ind_2% = 2) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 1 duration = 0 END - END - PATCH_IF (%ind_2% = 3) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 1 duration = 0 END - END - PATCH_IF (%ind_2% = 4) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 1 duration = 0 END - END - PATCH_IF (%ind_2% = 5) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 20) parameter2 = (108 + (0x10000 * 1)) timing = 1 duration = 0 END - END - PATCH_IF (%ind_2% = 6) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 24) parameter2 = (108 + (0x10000 * 1)) timing = 1 duration = 0 END - END - PATCH_IF (%ind_2% = 7) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 28) parameter2 = (108 + (0x10000 * 1)) timing = 1 duration = 0 END - END - PATCH_IF (%ind_2% = 8) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 24) parameter2 = (109 + (0x10000 * 1)) timing = 1 duration = 0 END - END - PATCH_IF (%ind_2% = 9) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 28) parameter2 = (109 + (0x10000 * 1)) timing = 1 duration = 0 END - END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%%ind_2%~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%%ind_2%~ END - END - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z_%ind_1%%ind_2%.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z_%ind_1%%ind_2%.spl~ - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z#%ind_1%%ind_2%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5ssplz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%%ind_2%~ END - END -// COPY_EXISTING ~d5b_000.spl~ ~override~ -// LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%%ind_2%~ END -// IF_EXISTS BUT_ONLY - COPY_EXISTING ~d5zlots.spl~ ~override~ - ~d5sslot.spl~ ~override~ - PATCH_IF (%ind_2% = 1) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 4) parameter2 = %fake_sorc_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%%ind_2%~ END - END - PATCH_IF (%ind_2% = 2) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 8) parameter2 = %fake_sorc_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%%ind_2%~ END - END - PATCH_IF (%ind_2% = 3) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 12) parameter2 = %fake_sorc_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%%ind_2%~ END - END - PATCH_IF (%ind_2% = 4) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 16) parameter2 = %fake_sorc_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%%ind_2%~ END - END - PATCH_IF (%ind_2% = 5) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 20) parameter2 = %fake_sorc_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%%ind_2%~ END - END - PATCH_IF (%ind_2% = 6) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 24) parameter2 = %fake_sorc_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%%ind_2%~ END - END - PATCH_IF (%ind_2% = 7) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 28) parameter2 = %fake_sorc_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%%ind_2%~ END - END - PATCH_IF (%ind_2% = 8) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 24) parameter2 = %fake_sorc_equal_8_9% timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%%ind_2%~ END - END - PATCH_IF (%ind_2% = 9) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 28) parameter2 = %fake_sorc_equal_8_9% timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%%ind_2%~ END - END - IF_EXISTS BUT_ONLY - COPY_EXISTING ~%slot_item%.itm~ ~override~ - LPF ALTER_EFFECT INT_VAR match_opcode = 42 parameter1 = 1 END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%%ind_2%~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%%ind_2%~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%%ind_2%~ END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z#%ind_1%%ind_2%~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%%ind_2%~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 2 STR_VAR resource = EVAL ~d5z_%ind_1%%ind_2%~ END - IF_EXISTS BUT_ONLY - END // end if not spell-doubling - ACTION_IF (%ind_3% = 99) BEGIN - ACTION_IF (~%slot_item%~ STRING_EQUAL_CASE ~ring08~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/ring08.itm~ ~override~ - SAY NAME2 ~Ring of Wizardry: Evermemory~ - SAY IDENTIFIED_DESC ~Ring of Wizardry: Evermemory -Long ago, a grand wizard from Amn was rumored to have defied Mystra's limitations on the magical arts. Legends spoke of this wizard being able to cast spells without the limitation of memorization. In the end, it was found that his powers stemmed from the several magical rings that he had made for himself. His proclaimed "everlasting memory" was a hoax, though his rings continue to be one of the most sought-after items in the realms. - -STATISTICS: - -Equipped abilities: -– Once per day, can refresh all 1st-level wizard spells - -Weight: 0~ - END - ACTION_IF (~%slot_item%~ STRING_EQUAL_CASE ~ringkon~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/ringkon.itm~ ~override~ - SAY NAME2 ~Kontik's Ring of Wizardry~ - SAY IDENTIFIED_DESC ~Kontik, a powerful wizard in the service of Auril, claimed this ring from a defeated enemy wizard, Nill the Infernal. An archmage who specialized in fire magic, Nill created the ring over a period of five years. The powerful item aided Nill in his far-ranging travels. Unfortunately for Nill, it did not protect him from Kontik's powerful minions and spells. It is constructed of an extremely unusual grayish-white metal called tungsten. - -STATISTICS: - -Equipped abilities: -– Once per day, can refresh all 1st- and 2nd-level wizard spells - -Combat abilities: -– All cold damage inflicted by the character is increased by 15% - -Weight: 0~ - END - ACTION_IF (%ind_2% > 0) BEGIN - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z#%ind_1%1.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z#%ind_1%1.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 1 duration = 0 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%1~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%1~ END - END - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z_%ind_1%1.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z_%ind_1%1.spl~ - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z#%ind_1%1~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5ssplz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%1~ END - END - COPY_EXISTING ~d5zlots.spl~ ~override~ - ~d5sslot.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 4) parameter2 = %fake_sorc_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%1~ END - IF_EXISTS BUT_ONLY - COPY_EXISTING ~%slot_item%.itm~ ~override~ - LPF CLONE_EFFECT INT_VAR match_opcode = 42 match_parameter2 = 0 parameter1 = 1 parameter2 = 1 END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%1~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%1~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%1~ END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%1~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 2 STR_VAR resource = EVAL ~d5z_%ind_1%1~ END - IF_EXISTS BUT_ONLY - END - ACTION_IF (%ind_2% > 1) BEGIN - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z#%ind_1%2.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z#%ind_1%2.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 1 duration = 0 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%2~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%2~ END - END - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z_%ind_1%2.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z_%ind_1%2.spl~ - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z#%ind_1%2~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5ssplz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%2~ END - END - COPY_EXISTING ~d5zlots.spl~ ~override~ - ~d5sslot.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 8) parameter2 = %fake_sorc_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%2~ END - IF_EXISTS BUT_ONLY - COPY_EXISTING ~%slot_item%.itm~ ~override~ - LPF CLONE_EFFECT INT_VAR match_opcode = 42 match_parameter2 = 0 parameter1 = 1 parameter2 = 2 END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%2~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%2~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%2~ END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%2~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 2 STR_VAR resource = EVAL ~d5z_%ind_1%2~ END - IF_EXISTS BUT_ONLY - END - ACTION_IF (%ind_2% > 2) BEGIN - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z#%ind_1%3.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z#%ind_1%3.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 1 duration = 0 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%3~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%3~ END - END - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z_%ind_1%3.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z_%ind_1%3.spl~ - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z#%ind_1%3~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5ssplz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%3~ END - END - COPY_EXISTING ~d5zlots.spl~ ~override~ - ~d5sslot.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 12) parameter2 = %fake_sorc_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%3~ END - IF_EXISTS BUT_ONLY - COPY_EXISTING ~%slot_item%.itm~ ~override~ - LPF CLONE_EFFECT INT_VAR match_opcode = 42 match_parameter2 = 0 parameter1 = 1 parameter2 = 4 END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%3~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%3~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%3~ END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%3~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 2 STR_VAR resource = EVAL ~d5z_%ind_1%3~ END - IF_EXISTS BUT_ONLY - END - ACTION_IF (%ind_2% > 3) BEGIN - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z#%ind_1%4.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z#%ind_1%4.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 1 duration = 0 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%4~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%4~ END - END - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z_%ind_1%4.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z_%ind_1%4.spl~ - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z#%ind_1%4~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5ssplz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%4~ END - END - COPY_EXISTING ~d5zlots.spl~ ~override~ - ~d5sslot.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 16) parameter2 = %fake_sorc_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%4~ END - IF_EXISTS BUT_ONLY - COPY_EXISTING ~%slot_item%.itm~ ~override~ - LPF CLONE_EFFECT INT_VAR match_opcode = 42 match_parameter2 = 0 parameter1 = 1 parameter2 = 8 END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%4~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%4~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%4~ END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%4~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 2 STR_VAR resource = EVAL ~d5z_%ind_1%4~ END - IF_EXISTS BUT_ONLY - END - ACTION_IF (%ind_2% > 4) BEGIN - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z#%ind_1%5.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z#%ind_1%5.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 20) parameter2 = (108 + (0x10000 * 1)) timing = 1 duration = 0 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%5~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%5~ END - END - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z_%ind_1%5.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z_%ind_1%5.spl~ - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z#%ind_1%5~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5ssplz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%5~ END - END - COPY_EXISTING ~d5zlots.spl~ ~override~ - ~d5sslot.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 20) parameter2 = %fake_sorc_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%5~ END - IF_EXISTS BUT_ONLY - COPY_EXISTING ~%slot_item%.itm~ ~override~ - LPF CLONE_EFFECT INT_VAR match_opcode = 42 match_parameter2 = 0 parameter1 = 1 parameter2 = 16 END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%5~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%5~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%5~ END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%5~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 2 STR_VAR resource = EVAL ~d5z_%ind_1%5~ END - IF_EXISTS BUT_ONLY - END - ACTION_IF (%ind_2% > 5) BEGIN - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z#%ind_1%6.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z#%ind_1%6.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 24) parameter2 = (108 + (0x10000 * 1)) timing = 1 duration = 0 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%6~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%6~ END - END - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z_%ind_1%6.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z_%ind_1%6.spl~ - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z#%ind_1%6~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5ssplz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%6~ END - END - COPY_EXISTING ~d5zlots.spl~ ~override~ - ~d5sslot.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 24) parameter2 = %fake_sorc_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%6~ END - IF_EXISTS BUT_ONLY - COPY_EXISTING ~%slot_item%.itm~ ~override~ - LPF CLONE_EFFECT INT_VAR match_opcode = 42 match_parameter2 = 0 parameter1 = 1 parameter2 = 32 END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%6~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%6~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%6~ END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%6~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 2 STR_VAR resource = EVAL ~d5z_%ind_1%6~ END - IF_EXISTS BUT_ONLY - END - ACTION_IF (%ind_2% > 6) BEGIN - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z#%ind_1%7.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z#%ind_1%7.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 28) parameter2 = (108 + (0x10000 * 1)) timing = 1 duration = 0 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%7~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%7~ END - END - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z_%ind_1%7.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z_%ind_1%7.spl~ - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z#%ind_1%7~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5ssplz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%7~ END - END - COPY_EXISTING ~d5zlots.spl~ ~override~ - ~d5sslot.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 28) parameter2 = %fake_sorc_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%7~ END - IF_EXISTS BUT_ONLY - COPY_EXISTING ~%slot_item%.itm~ ~override~ - LPF CLONE_EFFECT INT_VAR match_opcode = 42 match_parameter2 = 0 parameter1 = 1 parameter2 = 64 END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%7~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%7~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%7~ END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%7~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 2 STR_VAR resource = EVAL ~d5z_%ind_1%7~ END - IF_EXISTS BUT_ONLY - END - ACTION_IF (%ind_2% > 7) BEGIN - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z#%ind_1%8.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z#%ind_1%8.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 24) parameter2 = (109 + (0x10000 * 1)) timing = 1 duration = 0 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%8~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%8~ END - END - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z_%ind_1%8.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z_%ind_1%8.spl~ - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z#%ind_1%8~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5ssplz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%8~ END - END - COPY_EXISTING ~d5zlots.spl~ ~override~ - ~d5sslot.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 24) parameter2 = %fake_sorc_equal_8_9% timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%8~ END - IF_EXISTS BUT_ONLY - COPY_EXISTING ~%slot_item%.itm~ ~override~ - LPF CLONE_EFFECT INT_VAR match_opcode = 42 match_parameter2 = 0 parameter1 = 1 parameter2 = 128 END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%8~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%8~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%8~ END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%8~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 2 STR_VAR resource = EVAL ~d5z_%ind_1%8~ END - IF_EXISTS BUT_ONLY - END - ACTION_IF (%ind_2% > 8) BEGIN - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z#%ind_1%9.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z#%ind_1%9.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 28) parameter2 = (109 + (0x10000 * 1)) timing = 1 duration = 0 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%9~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%9~ END - END - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z_%ind_1%9.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z_%ind_1%9.spl~ - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z#%ind_1%9~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5ssplz~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%9~ END - END - COPY_EXISTING ~d5zlots.spl~ ~override~ - ~d5sslot.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 28) parameter2 = %fake_sorc_equal_8_9% timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%9~ END - IF_EXISTS BUT_ONLY - COPY_EXISTING ~%slot_item%.itm~ ~override~ - LPF CLONE_EFFECT INT_VAR match_opcode = 42 match_parameter2 = 0 parameter1 = 1 parameter2 = 256 END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%9~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%9~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%9~ END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%9~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 2 STR_VAR resource = EVAL ~d5z_%ind_1%9~ END - IF_EXISTS BUT_ONLY - END - COPY_EXISTING ~%slot_item%.itm~ ~override~ - LPF DELETE_EFFECT INT_VAR match_opcode = 42 match_parameter2 = 0 END - IF_EXISTS BUT_ONLY - END // end if spell-doubling - COPY_EXISTING ~%slot_item%.itm~ ~override~ -// LPF DELETE_EFFECT INT_VAR match_opcode = 321 STR_VAR resource = ~d5z_000~ END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5z_000~ END - LPF DELETE_EFFECT INT_VAR match_opcode = 326 STR_VAR match_resource = ~d5zz172~ END - LPF DELETE_EFFECT INT_VAR match_opcode = 326 STR_VAR match_resource = ~d5zspld~ END - LPF DELETE_EFFECT INT_VAR match_opcode = 326 STR_VAR match_resource = ~d5zspla~ END - LPF DELETE_EFFECT INT_VAR match_opcode = 326 STR_VAR match_resource = ~d5ssplz~ END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = (0 - 1) opcode = 146 target = 1 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5zsplz~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = (0 - 1) opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5zz172~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = (0 - 1) opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = (0 - 1) opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = (0 - 1) opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5ssplz~ END - IF_EXISTS BUT_ONLY - END -END - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_marker.d5~ ~override/d5__arcane_slot_items.d5~ - -END - -END // end define function - - -//__________________________________________________________________________________ -//__________________________________________________________________________________ - - -//MAKE DIVINE +SPELL SLOT ITEMS WORK_________________________________________________ -// -DEFINE_ACTION_FUNCTION divine_spont_items BEGIN - -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_WIZ_1_7~) BEGIN - SET fake_sorc_slots_1_7 = %row% - END - PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_WIZ=1_7~) BEGIN - SET fake_sorc_equal_1_7 = %row% - END - PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_WIZ_8_9~) BEGIN - SET fake_sorc_slots_8_9 = %row% - END - PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_WIZ=8_9~) BEGIN - SET fake_sorc_equal_8_9 = %row% - END - PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_DIV_1_7~) BEGIN - SET fake_sham_slots_1_7 = %row% - END - PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_DIV=1_7~) BEGIN - SET fake_sham_equal_1_7 = %row% - END - PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_FATIGUE_0~) BEGIN - SET fatigue_zero = %row% - END - PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_PREP_SPLZ~) BEGIN - SET prep_spells_row = %row% - END - PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_NOT_PREP~) BEGIN - SET not_prep_row = %row% - END - END -BUT_ONLY - - -//priest +slot items__________________________________________________________________ -// -ACTION_IF !(FILE_EXISTS_IN_GAME ~d5__divine_slot_items.d5~) BEGIN - -ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_SEMI_DIVINE~)) BEGIN - COPY_EXISTING ~splstate.ids~ ~override~ - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW rows cols - FOR (row = 1; row < rows; ++row) BEGIN - READ_2DA_ENTRY_FORMER rows row 1 ~state_name~ - READ_2DA_ENTRY_FORMER rows row 0 ~state_ind~ - PATCH_IF (~%state_name%~ STRING_EQUAL_CASE ~D5_SEMI_DIVINE~) BEGIN - SET semi_spont_divine = %state_ind% - END - END - BUT_ONLY -END -ACTION_IF !(VARIABLE_IS_SET %semi_spont_divine%) BEGIN - LAF d5_resolve_state STR_VAR new_state_id = ~D5_SEMI_DIVINE~ RET new_state_ind END - OUTER_SET semi_spont_divine = %new_state_ind% -END - -ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_SEMI_ARCANE~)) BEGIN - COPY_EXISTING ~splstate.ids~ ~override~ - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW rows cols - FOR (row = 1; row < rows; ++row) BEGIN - READ_2DA_ENTRY_FORMER rows row 1 ~state_name~ - READ_2DA_ENTRY_FORMER rows row 0 ~state_ind~ - PATCH_IF (~%state_name%~ STRING_EQUAL_CASE ~D5_SEMI_ARCANE~) BEGIN - SET semi_spont_arcane = %state_ind% - END - END - BUT_ONLY -END -ACTION_IF !(VARIABLE_IS_SET %semi_spont_arcane%) BEGIN - LAF d5_resolve_state STR_VAR new_state_id = ~D5_SEMI_ARCANE~ RET new_state_ind END - OUTER_SET semi_spont_arcane = %new_state_ind% -END - -OUTER_SET generic_ind = 1 -OUTER_SET priestslot_item_ind = 1 -OUTER_TEXT_SPRINT $priest_slot_items(~0~ ~0~ ~0~ ~0~) ~item~ -COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ override - SET slot_item = 0 - PATCH_IF SOURCE_SIZE > 0x72 BEGIN - GET_OFFSET_ARRAY glob_fx ITM_V10_GEN_EFFECTS - PHP_EACH glob_fx AS idx => off BEGIN - PATCH_IF SHORT_AT off == 62 BEGIN - SET slot_item = 1 - READ_LONG off + 0x04 param1 ELSE 0 - READ_LONG off + 0x08 param2 ELSE 0 - FOR (spell_level = 1; spell_level < 8; ++spell_level) BEGIN - PATCH_IF param2 & (2 ** (spell_level - 1)) BEGIN - TEXT_SPRINT $priest_slot_items(~%generic_ind%~ ~%priestslot_item_ind%~ ~%spell_level%~ ~%param1%~) ~%SOURCE_RES%~ - SET ++generic_ind - END - END - PATCH_IF param2 == 0 BEGIN - TEXT_SPRINT $priest_slot_items(~%generic_ind%~ ~%priestslot_item_ind%~ ~%param1%~ ~99~) ~%SOURCE_RES%~ - SET ++generic_ind - END - END // ELSE - PATCH_IF SHORT_AT off == 177 /* || SHORT_AT off == 326 */ BEGIN - READ_ASCII off + 0x14 eff_res (8) NULL - INNER_PATCH_FILE ~%eff_res%.EFF~ BEGIN - PATCH_IF LONG_AT 0x010 == 62 BEGIN - SET slot_item = 1 - READ_LONG 0x1c param1 ELSE 0 - READ_LONG 0x20 param2 ELSE 0 - FOR (spell_level = 1; spell_level < 8; ++spell_level) BEGIN - PATCH_IF param2 & (2 ** (spell_level - 1)) BEGIN - TEXT_SPRINT $priest_slot_items(~%generic_ind%~ ~%priestslot_item_ind%~ ~%spell_level%~ ~%param1%~) ~%SOURCE_RES%~ - SET ++generic_ind - END - END - PATCH_IF param2 == 0 BEGIN - TEXT_SPRINT $priest_slot_items(~%generic_ind%~ ~%priestslot_item_ind%~ ~%param1%~ ~99~) ~%SOURCE_RES%~ - SET ++generic_ind - END - END - END - END - END - END - PATCH_IF slot_item = 1 BEGIN - SET ++priestslot_item_ind - END -BUT_ONLY - -ACTION_PHP_EACH priest_slot_items AS ind => slot_item BEGIN - ACTION_IF (%ind% > 0) BEGIN - PRINT ~%ind% %ind_1% %ind_2% %ind_3% %slot_item%~ - ACTION_IF (%ind_3% < 99) BEGIN - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z!%ind_1%%ind_2%.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z!%ind_1%%ind_2%.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - PATCH_IF (%ind_2% = 1) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 4) parameter2 = (134 + (0x10000 * 1)) timing = 1 duration = 0 END - END - PATCH_IF (%ind_2% = 2) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 8) parameter2 = (134 + (0x10000 * 1)) timing = 1 duration = 0 END - END - PATCH_IF (%ind_2% = 3) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 12) parameter2 = (134 + (0x10000 * 1)) timing = 1 duration = 0 END - END - PATCH_IF (%ind_2% = 4) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 16) parameter2 = (134 + (0x10000 * 1)) timing = 1 duration = 0 END - END - PATCH_IF (%ind_2% = 5) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 20) parameter2 = (134 + (0x10000 * 1)) timing = 1 duration = 0 END - END - PATCH_IF (%ind_2% = 6) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 24) parameter2 = (134 + (0x10000 * 1)) timing = 1 duration = 0 END - END - PATCH_IF (%ind_2% = 7) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 28) parameter2 = (134 + (0x10000 * 1)) timing = 1 duration = 0 END - END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z!%ind_1%%ind_2%~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z-%ind_1%%ind_2%~ END - END - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z-%ind_1%%ind_2%.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z-%ind_1%%ind_2%.spl~ - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z!%ind_1%%ind_2%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%%ind_2%~ END - END -// COPY_EXISTING ~d5b_000.spl~ ~override~ -// LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%%ind_2%~ END -// IF_EXISTS BUT_ONLY - COPY_EXISTING ~d5zlots.spl~ ~override~ - PATCH_IF (%ind_2% = 1) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 4) parameter2 = %fake_sham_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%%ind_2%~ END - END - PATCH_IF (%ind_2% = 2) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 8) parameter2 = %fake_sham_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%%ind_2%~ END - END - PATCH_IF (%ind_2% = 3) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 12) parameter2 = %fake_sham_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%%ind_2%~ END - END - PATCH_IF (%ind_2% = 4) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 16) parameter2 = %fake_sham_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%%ind_2%~ END - END - PATCH_IF (%ind_2% = 5) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 20) parameter2 = %fake_sham_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%%ind_2%~ END - END - PATCH_IF (%ind_2% = 6) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 24) parameter2 = %fake_sham_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%%ind_2%~ END - END - PATCH_IF (%ind_2% = 7) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 28) parameter2 = %fake_sham_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%%ind_2%~ END - END - PATCH_IF (%ind_2% = 8) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 24) parameter2 = %fake_sham_equal_8_9% timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%%ind_2%~ END - END - PATCH_IF (%ind_2% = 9) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 28) parameter2 = %fake_sham_equal_8_9% timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%%ind_2%~ END - END - IF_EXISTS BUT_ONLY - COPY_EXISTING ~%slot_item%.itm~ ~override~ - LPF ALTER_EFFECT INT_VAR match_opcode = 62 parameter1 = 1 END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z!%ind_1%%ind_2%~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z!%ind_1%%ind_2%~ END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z!%ind_1%%ind_2%~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z-%ind_1%%ind_2%~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 2 STR_VAR resource = EVAL ~d5z-%ind_1%%ind_2%~ END - IF_EXISTS BUT_ONLY - END // end if not spell-doubling - ACTION_IF (%ind_3% = 99) BEGIN - ACTION_IF (%ind_2% > 0) BEGIN - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z!%ind_1%1.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z!%ind_1%1.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 4) parameter2 = (134 + (0x10000 * 1)) timing = 1 duration = 0 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z!%ind_1%1~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z-%ind_1%1~ END - END - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z-%ind_1%1.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z-%ind_1%1.spl~ - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z!%ind_1%1~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%1~ END - END - COPY_EXISTING ~d5zlots.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 4) parameter2 = %fake_sham_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%1~ END - IF_EXISTS BUT_ONLY - COPY_EXISTING ~%slot_item%.itm~ ~override~ - LPF CLONE_EFFECT INT_VAR match_opcode = 62 match_parameter2 = 0 parameter1 = 1 parameter2 = 1 END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z!%ind_1%1~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z!%ind_1%1~ END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z-%ind_1%1~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 2 STR_VAR resource = EVAL ~d5z-%ind_1%1~ END - IF_EXISTS BUT_ONLY - END - ACTION_IF (%ind_2% > 1) BEGIN - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z!%ind_1%2.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z!%ind_1%2.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 8) parameter2 = (134 + (0x10000 * 1)) timing = 1 duration = 0 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z!%ind_1%2~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z-%ind_1%2~ END - END - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z-%ind_1%2.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z-%ind_1%2.spl~ - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z!%ind_1%2~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%2~ END - END - COPY_EXISTING ~d5zlots.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 8) parameter2 = %fake_sham_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%2~ END - IF_EXISTS BUT_ONLY - COPY_EXISTING ~%slot_item%.itm~ ~override~ - LPF CLONE_EFFECT INT_VAR match_opcode = 62 match_parameter2 = 0 parameter1 = 1 parameter2 = 2 END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z!%ind_1%2~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z!%ind_1%2~ END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z-%ind_1%2~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 2 STR_VAR resource = EVAL ~d5z-%ind_1%2~ END - IF_EXISTS BUT_ONLY - END - ACTION_IF (%ind_2% > 2) BEGIN - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z!%ind_1%3.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z!%ind_1%3.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 12) parameter2 = (134 + (0x10000 * 1)) timing = 1 duration = 0 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z!%ind_1%3~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z-%ind_1%3~ END - END - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z-%ind_1%3.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z-%ind_1%3.spl~ - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z!%ind_1%3~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%3~ END - END - COPY_EXISTING ~d5zlots.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 12) parameter2 = %fake_sham_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%3~ END - IF_EXISTS BUT_ONLY - COPY_EXISTING ~%slot_item%.itm~ ~override~ - LPF CLONE_EFFECT INT_VAR match_opcode = 62 match_parameter2 = 0 parameter1 = 1 parameter2 = 4 END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z!%ind_1%3~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z!%ind_1%3~ END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z-%ind_1%3~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 2 STR_VAR resource = EVAL ~d5z-%ind_1%3~ END - IF_EXISTS BUT_ONLY - END - ACTION_IF (%ind_2% > 3) BEGIN - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z!%ind_1%4.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z!%ind_1%4.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 16) parameter2 = (134 + (0x10000 * 1)) timing = 1 duration = 0 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z!%ind_1%4~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z-%ind_1%4~ END - END - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z-%ind_1%4.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z-%ind_1%4.spl~ - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z!%ind_1%4~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%4~ END - END - COPY_EXISTING ~d5zlots.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 16) parameter2 = %fake_sham_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%4~ END - IF_EXISTS BUT_ONLY - COPY_EXISTING ~%slot_item%.itm~ ~override~ - LPF CLONE_EFFECT INT_VAR match_opcode = 62 match_parameter2 = 0 parameter1 = 1 parameter2 = 8 END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z!%ind_1%4~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z!%ind_1%4~ END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z-%ind_1%4~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 2 STR_VAR resource = EVAL ~d5z-%ind_1%4~ END - IF_EXISTS BUT_ONLY - END - ACTION_IF (%ind_2% > 4) BEGIN - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z!%ind_1%5.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z!%ind_1%5.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 20) parameter2 = (134 + (0x10000 * 1)) timing = 1 duration = 0 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z!%ind_1%5~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z-%ind_1%5~ END - END - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z-%ind_1%5.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z-%ind_1%5.spl~ - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z!%ind_1%5~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%5~ END - END - COPY_EXISTING ~d5zlots.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 20) parameter2 = %fake_sham_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%5~ END - IF_EXISTS BUT_ONLY - COPY_EXISTING ~%slot_item%.itm~ ~override~ - LPF CLONE_EFFECT INT_VAR match_opcode = 62 match_parameter2 = 0 parameter1 = 1 parameter2 = 16 END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z!%ind_1%5~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z!%ind_1%5~ END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z-%ind_1%5~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 2 STR_VAR resource = EVAL ~d5z-%ind_1%5~ END - IF_EXISTS BUT_ONLY - END - ACTION_IF (%ind_2% > 5) BEGIN - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z!%ind_1%6.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z!%ind_1%6.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 24) parameter2 = (134 + (0x10000 * 1)) timing = 1 duration = 0 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z!%ind_1%6~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z-%ind_1%6~ END - END - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z-%ind_1%6.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z-%ind_1%6.spl~ - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z!%ind_1%6~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%6~ END - END - COPY_EXISTING ~d5zlots.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 24) parameter2 = %fake_sham_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%6~ END - IF_EXISTS BUT_ONLY - COPY_EXISTING ~%slot_item%.itm~ ~override~ - LPF CLONE_EFFECT INT_VAR match_opcode = 62 match_parameter2 = 0 parameter1 = 1 parameter2 = 32 END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z!%ind_1%6~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z!%ind_1%6~ END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z-%ind_1%6~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 2 STR_VAR resource = EVAL ~d5z-%ind_1%6~ END - IF_EXISTS BUT_ONLY - END - ACTION_IF (%ind_2% > 6) BEGIN - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z!%ind_1%7.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z!%ind_1%7.spl~ - LPF ALTER_SPELL_HEADER INT_VAR target = 5 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 28) parameter2 = (134 + (0x10000 * 1)) timing = 1 duration = 0 END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z!%ind_1%7~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z-%ind_1%7~ END - END - ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z-%ind_1%7.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z-%ind_1%7.spl~ - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z!%ind_1%7~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%7~ END - END - COPY_EXISTING ~d5zlots.spl~ ~override~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (15 << 28) parameter2 = %fake_sham_equal_1_7% timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%7~ END - IF_EXISTS BUT_ONLY - COPY_EXISTING ~%slot_item%.itm~ ~override~ - LPF CLONE_EFFECT INT_VAR match_opcode = 62 match_parameter2 = 0 parameter1 = 1 parameter2 = 64 END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z!%ind_1%7~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z!%ind_1%7~ END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z-%ind_1%7~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 2 STR_VAR resource = EVAL ~d5z-%ind_1%7~ END - IF_EXISTS BUT_ONLY - END - COPY_EXISTING ~%slot_item%.itm~ ~override~ - LPF DELETE_EFFECT INT_VAR match_opcode = 62 match_parameter2 = 0 END - IF_EXISTS BUT_ONLY - END // end if spell-doubling - COPY_EXISTING ~%slot_item%.itm~ ~override~ -// LPF DELETE_EFFECT INT_VAR match_opcode = 321 STR_VAR resource = ~d5b_000~ END -// LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5b_000~ END - LPF DELETE_EFFECT INT_VAR match_opcode = 326 STR_VAR match_resource = ~d5zz172~ END - LPF DELETE_EFFECT INT_VAR match_opcode = 326 STR_VAR match_resource = ~d5zspld~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = (0 - 1) opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = (0 - 1) opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END - IF_EXISTS BUT_ONLY - END -END - - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_marker.d5~ ~override/d5__divine_slot_items.d5~ - -END - -END // end define function - - diff --git a/TomeAndBlood/lib/semi_spontaneous.tpa b/TomeAndBlood/lib/semi_spontaneous.tpa index 1ad4212..0c8a313 100755 --- a/TomeAndBlood/lib/semi_spontaneous.tpa +++ b/TomeAndBlood/lib/semi_spontaneous.tpa @@ -1,42 +1,81 @@ -// v6.1 - armor fix +// v7 - with sorcerer casting functions -/* -the way it works: -- d5zprp gives access to spellbook, disables casting, and sets prep spellstate -- zz000 is applied in CLAB table; - -- sets fatigue to 1 and c - -- permanently sets repeating spell, zlots -- zlots checks for NO semi state, then casts zzini - -- zzini does all initialization stuff: - --- sets semi state (several 177s checking for class) - --- casts z0slt - --- casts z206 - --- casts znoqk - --- 206 vs. zz000 - --- casts zprpb - --- gives zprp - --- sets fatigue to 0 after 6 second delay -- zlots checks for fatigue = 0, then casts zlotf -- if no prep state, zlotf casts zrfrsh - -- zrfrsh removes spellbook access, casts zsplz -- if yes prep state, zlotf casts zlotr - -- zlotr summons zlotr.cre - -- zlotr.cre runs zlotr.bcs - -- zlotr.bcs gives chosen spells and casts zprpd - -- zprpd restores spellcasting, casts zsplz -- zsplz gives innate spells according to your casting slots and semi state -*/ - +DEFINE_PATCH_FUNCTION ~TRA2STR~ // given tra reference, returns string + STR_VAR tra = ~~ // e.g. ~@123~ + RET str +BEGIN + PATCH_IF ((~%tra%~ STRING_MATCHES_REGEXP ~@-?[0-9]+~) == 0) BEGIN + INNER_ACTION BEGIN + <<<<<<<< .../inlined/mi_tra2str.tph + OUTER_SPRINT str %tra% + >>>>>>>> + COPY - ~.../inlined/mi_tra2str.tph~ ~.../inlined/mi_tra2str.tph~ + EVALUATE_BUFFER + REINCLUDE ~.../inlined/mi_tra2str.tph~ + END + END + ELSE BEGIN + TEXT_SPRINT str ~%tra%~ + END +END -/* +DEFINE_ACTION_FUNCTION ~ADD_ITEM_TOOLTIPS~ + STR_VAR item = ~~ // e.g. ~sw1h01~ + tooltips = ~~ // e.g. ~@123 @124 6620~, takes combination of tra refs and strrefs for as many abilities as you need to specify +BEGIN + ACTION_IF (STRING_LENGTH ~%item%~ > 0) BEGIN + // generate our row to add to tooltip.2da + OUTER_TEXT_SPRINT row ~%item%~ + OUTER_PATCH ~ %tooltips%~ BEGIN // extract our tooltips from the tooltips string + REPLACE_EVALUATE ~[ %tab%]+\(@?-?[0-9]+\)~ BEGIN + PATCH_IF ((~%MATCH1%~ STRING_MATCHES_REGEXP ~@-?[0-9]+~) == 0) BEGIN // tra ref + // look up string for given tra reference + LAUNCH_PATCH_FUNCTION ~TRA2STR~ STR_VAR tra = EVALUATE_BUFFER ~%MATCH1%~ RET str = str END + // use REPLACE to get a strref for our new string + INNER_PATCH ~0~ BEGIN + REPLACE ~0~ ~%str%~ + READ_2DA_ENTRY 0 0 1 strref + END + TEXT_SPRINT row ~%row% %strref%~ // add to our row + END + ELSE BEGIN // strref + TEXT_SPRINT row ~%row% %MATCH1%~ // add to our row + END + END ~~ + END + + COPY_EXISTING ~tooltip.2da~ ~override~ + REPLACE_TEXTUALLY ~^[ %tab%]*%item%[ %tab%].*~ ~~ // remove previous row for this item if it exists + COUNT_2DA_ROWS 1 num_rows + INSERT_2DA_ROW num_rows 1 ~%row%~ // insert our row at the end + + // ensure all rows have -1 entries in unused columns + REPLACE_TEXTUALLY ~^[ %tab%]*0?[ %tab%]*1[ %tab%]+2[ %tab%]+3.*~ ~~ // remove column labels for now + COUNT_2DA_COLS num_cols + TEXT_SPRINT entries ~~ + TEXT_SPRINT col_labels ~~ + FOR (i = 1; i < (num_cols - 1); i += 1) BEGIN // for each number of columns less than there should be + TEXT_SPRINT entries ~%entries%[ %tab%]+[0-9-]+~ // generate regexp to detect this many columns + TEXT_SPRINT empties ~~ + FOR (j = (num_cols - 1); j > i; j -= 1) BEGIN // generate -1 entries for the number of missing columns + TEXT_SPRINT empties ~%empties% -1~ + END + REPLACE_TEXTUALLY ~^\([ %tab%]*[^ %tab%]+%entries%\)[ %tab%]*[%mnl%]?$~ ~\1%empties%~ // add -1 entries to all rows with this many missing columns + TEXT_SPRINT col_labels ~%col_labels% %i%~ // generate fresh column labels + END + INSERT_2DA_ROW 2 1 ~%col_labels% %i%~ // re-add column labels, with last entry where i == (num_cols - 1) + PRETTY_PRINT_2DA + REPLACE_TEXTUALLY ~2DA +~ ~2DA ~ + + END +END -***** need to make armor disable arcane casting (unless cast-in-armor mod is there), and not block spell prep, and correctly apply casting speed penalties - ...(that last can be done in YARAS) +//__________________________________________________________________________________ +//__________________________________________________________________________________ -*/ DEFINE_ACTION_FUNCTION semi_spontaneous_casting INT_VAR include_arcane = 0 include_divine = 0 BEGIN @@ -47,11 +86,12 @@ ACTION_IF !(FILE_EXISTS_IN_GAME ~d5__semi_spont.d5~) BEGIN //disable quickspell buttons__________________________________________________________ // -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5znoqk.spl~ +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5znoqk.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5znoqk.spl~ LPF ADD_SPELL_EFFECT INT_VAR opcode = 144 target = 1 parameter2 = 3 timing = 9 END LPF ADD_SPELL_EFFECT INT_VAR opcode = 144 target = 1 parameter2 = 4 timing = 9 END LPF ADD_SPELL_EFFECT INT_VAR opcode = 144 target = 1 parameter2 = 5 timing = 9 END - +END //semi spont spellstates______________________________________________________________ // @@ -170,28 +210,30 @@ BUT_ONLY //remove all mage spell slots_________________________________________________________ // -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z17wz.spl~ +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z17wz.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z17wz.spl~ LPF ADD_SPELL_EFFECT INT_VAR opcode = 42 target = 1 parameter1 = (0 - 1) parameter2 = 127 timing = 9 END +END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z89wz.spl~ +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z89wz.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z89wz.spl~ LPF ADD_SPELL_EFFECT INT_VAR opcode = 42 target = 1 parameter1 = (0 - 1) parameter2 = 384 timing = 9 END - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z17dv.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 62 target = 1 parameter1 = (0 - 1) parameter2 = 127 timing = 9 END +END // this is for... what? // to eliminate kitted mage bonus slots -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z0slt.spl~ +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z0slt.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z0slt.spl~ PATCH_IF (MOD_IS_INSTALLED ~TomeAndBlood.tp2~ ~62~) BEGIN // level 1 cantrips - LPF ADD_SPELL_EFFECT INT_VAR opcode = 42 target = 1 parameter1 = (0 - 1) parameter2 = 510 /*126*/ timing = 9 END // should cover lvl 8-9 spls too + LPF ADD_SPELL_EFFECT INT_VAR opcode = 42 target = 1 parameter1 = (0 - 1) parameter2 = 510 /*126*/ timing = 9 END // cover all lvls 1-9 spls END PATCH_IF !(MOD_IS_INSTALLED ~TomeAndBlood.tp2~ ~62~) BEGIN // level 1 cantrips - LPF ADD_SPELL_EFFECT INT_VAR opcode = 42 target = 1 parameter1 = (0 - 1) parameter2 = 511 /*127*/ timing = 9 END // should cover lvl 8-9 spls too + LPF ADD_SPELL_EFFECT INT_VAR opcode = 42 target = 1 parameter1 = (0 - 1) parameter2 = 511 /*127*/ timing = 9 END // cover all lvls 1-9 spls END LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 1 STR_VAR resource = ~d5z0slt~ END LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = 0 parameter2 = %kit_is_row% timing = 0 duration = 1 STR_VAR resource = ~d5z0slt~ END LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = 16384 parameter2 = %kit_is_row% timing = 0 duration = 1 STR_VAR resource = ~d5z0slt~ END - +END /* I think this is only applied once, no need for 2nd copy COPY_EXISTING ~d5z0slt.spl~ ~override/d5z1slt.spl~ @@ -199,19 +241,25 @@ COPY_EXISTING ~d5z0slt.spl~ ~override/d5z1slt.spl~ */ // what is this one vv for...? L1Cantrips -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z2slt.spl~ +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z2slt.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z2slt.spl~ LPF ALTER_SPELL_HEADER INT_VAR target = 5 END LPF ADD_SPELL_EFFECT INT_VAR opcode = 42 parameter1 = (0 - 1) parameter2 = 2 target = 1 timing = 9 END LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 1 STR_VAR resource = ~d5z2slt~ END +END // here are spells for use with TnB/SoB abil score bonus slots -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zislt.spl~ +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5zislt.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zislt.spl~ LPF ADD_SPELL_EFFECT INT_VAR opcode = 42 target = 1 parameter1 = (0 - 1) parameter2 = 127 timing = 9 END LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 1 STR_VAR resource = ~d5zislt~ END +END -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zjslt.spl~ +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5zjslt.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zjslt.spl~ LPF ADD_SPELL_EFFECT INT_VAR opcode = 42 target = 1 parameter1 = (0 - 1) parameter2 = 127 timing = 9 END LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 1 STR_VAR resource = ~d5zjslt~ END +END //create advance copies of some spells________________________________________________ @@ -219,7 +267,6 @@ COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zjslt.spl~ COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zz206.spl~ COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zz172.spl~ -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zw172.spl~ COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zz145.spl~ LPF ADD_SPELL_EFFECT INT_VAR opcode = 145 target = 1 parameter2 = 0 timing = 9 END @@ -399,8 +446,8 @@ COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zspla.spl~ ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src1a.spl~) BEGIN ACTION_FOR_EACH let IN ~a~ BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src1%let%.spl~ - SAY NAME1 @21991 - SAY UNIDENTIFIED_DESC @21991 + SAY NAME1 ~Extra first level spell slot~ + SAY UNIDENTIFIED_DESC ~Extra first level spell slot~ LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src1%let%~ END @@ -409,8 +456,8 @@ END ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src2a.spl~) BEGIN ACTION_FOR_EACH let IN ~a~ BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src2%let%.spl~ - SAY NAME1 @21992 - SAY UNIDENTIFIED_DESC @21992 + SAY NAME1 ~Extra second level spell slot~ + SAY UNIDENTIFIED_DESC ~Extra second level spell slot~ LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 9 END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src2%let%~ END @@ -419,8 +466,8 @@ END ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src3a.spl~) BEGIN ACTION_FOR_EACH let IN ~a~ BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src3%let%.spl~ - SAY NAME1 @21993 - SAY UNIDENTIFIED_DESC @21993 + SAY NAME1 ~Extra third level spell slot~ + SAY UNIDENTIFIED_DESC ~Extra third level spell slot~ LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 9 END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src3%let%~ END @@ -429,8 +476,8 @@ END ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src4a.spl~) BEGIN ACTION_FOR_EACH let IN ~a~ BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src4%let%.spl~ - SAY NAME1 @21994 - SAY UNIDENTIFIED_DESC @21994 + SAY NAME1 ~Extra fourth level spell slot~ + SAY UNIDENTIFIED_DESC ~Extra fourth level spell slot~ LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 9 END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src4%let%~ END @@ -439,8 +486,8 @@ END ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src5a.spl~) BEGIN ACTION_FOR_EACH let IN ~a~ BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src5%let%.spl~ - SAY NAME1 @21995 - SAY UNIDENTIFIED_DESC @21995 + SAY NAME1 ~Extra fifth level spell slot~ + SAY UNIDENTIFIED_DESC ~Extra fifth level spell slot~ LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 20) parameter2 = (108 + (0x10000 * 1)) timing = 9 END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src5%let%~ END @@ -449,8 +496,8 @@ END ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src6a.spl~) BEGIN ACTION_FOR_EACH let IN ~a~ BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src6%let%.spl~ - SAY NAME1 @21996 - SAY UNIDENTIFIED_DESC @21996 + SAY NAME1 ~Extra sixth level spell slot~ + SAY UNIDENTIFIED_DESC ~Extra sixth level spell slot~ LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 24) parameter2 = (108 + (0x10000 * 1)) timing = 9 END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src6%let%~ END @@ -459,8 +506,8 @@ END ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src7a.spl~) BEGIN ACTION_FOR_EACH let IN ~a~ BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src7%let%.spl~ - SAY NAME1 @21997 - SAY UNIDENTIFIED_DESC @21997 + SAY NAME1 ~Extra seventh level spell slot~ + SAY UNIDENTIFIED_DESC ~Extra seventh level spell slot~ LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 28) parameter2 = (108 + (0x10000 * 1)) timing = 9 END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src7%let%~ END @@ -469,8 +516,8 @@ END ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src8a.spl~) BEGIN ACTION_FOR_EACH let IN ~a~ BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src8%let%.spl~ - SAY NAME1 @21989 - SAY UNIDENTIFIED_DESC @21989 + SAY NAME1 ~Extra eighth level spell slot~ + SAY UNIDENTIFIED_DESC ~Extra eighth level spell slot~ LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 24) parameter2 = (109 + (0x10000 * 1)) timing = 9 END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src8%let%~ END @@ -479,8 +526,8 @@ END ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src9a.spl~) BEGIN ACTION_FOR_EACH let IN ~a~ BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src9%let%.spl~ - SAY NAME1 @21990 - SAY UNIDENTIFIED_DESC @21990 + SAY NAME1 ~Extra ninth level spell slot~ + SAY UNIDENTIFIED_DESC ~Extra ninth level spell slot~ LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 28) parameter2 = (109 + (0x10000 * 1)) timing = 9 END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src9%let%~ END @@ -490,8 +537,8 @@ END ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm1a.spl~) BEGIN ACTION_FOR_EACH let IN ~a~ BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm1%let%.spl~ - SAY NAME1 @21991 - SAY UNIDENTIFIED_DESC @21991 + SAY NAME1 ~Extra first level spell slot~ + SAY UNIDENTIFIED_DESC ~Extra first level spell slot~ LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 4) parameter2 = (134 + (0x10000 * 1)) timing = 9 END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5shm1%let%~ END @@ -500,8 +547,8 @@ END ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm2a.spl~) BEGIN ACTION_FOR_EACH let IN ~a~ BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm2%let%.spl~ - SAY NAME1 @21992 - SAY UNIDENTIFIED_DESC @21992 + SAY NAME1 ~Extra second level spell slot~ + SAY UNIDENTIFIED_DESC ~Extra second level spell slot~ LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 8) parameter2 = (134 + (0x10000 * 1)) timing = 9 END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5shm2%let%~ END @@ -510,8 +557,8 @@ END ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm3a.spl~) BEGIN ACTION_FOR_EACH let IN ~a~ BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm3%let%.spl~ - SAY NAME1 @21993 - SAY UNIDENTIFIED_DESC @21993 + SAY NAME1 ~Extra third level spell slot~ + SAY UNIDENTIFIED_DESC ~Extra third level spell slot~ LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 12) parameter2 = (134 + (0x10000 * 1)) timing = 9 END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5shm3%let%~ END @@ -520,8 +567,8 @@ END ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm4a.spl~) BEGIN ACTION_FOR_EACH let IN ~a~ BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm4%let%.spl~ - SAY NAME1 @21994 - SAY UNIDENTIFIED_DESC @21994 + SAY NAME1 ~Extra fourth level spell slot~ + SAY UNIDENTIFIED_DESC~Extra fourth level spell slot~ LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 16) parameter2 = (134 + (0x10000 * 1)) timing = 9 END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5shm4%let%~ END @@ -530,8 +577,8 @@ END ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm5a.spl~) BEGIN ACTION_FOR_EACH let IN ~a~ BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm5%let%.spl~ - SAY NAME1 @21995 - SAY UNIDENTIFIED_DESC @21995 + SAY NAME1 ~Extra fifth level spell slot~ + SAY UNIDENTIFIED_DESC ~Extra fifth level spell slot~ LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 20) parameter2 = (134 + (0x10000 * 1)) timing = 9 END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5shm5%let%~ END @@ -540,8 +587,8 @@ END ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm6a.spl~) BEGIN ACTION_FOR_EACH let IN ~a~ BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm6%let%.spl~ - SAY NAME1 @21996 - SAY UNIDENTIFIED_DESC @21996 + SAY NAME1 ~Extra sixth level spell slot~ + SAY UNIDENTIFIED_DESC ~Extra sixth level spell slot~ LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 24) parameter2 = (134 + (0x10000 * 1)) timing = 9 END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5shm6%let%~ END @@ -550,8 +597,8 @@ END ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm7a.spl~) BEGIN ACTION_FOR_EACH let IN ~a~ BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm7%let%.spl~ - SAY NAME1 @21997 - SAY UNIDENTIFIED_DESC @21997 + SAY NAME1 ~Extra seventh level spell slot~ + SAY UNIDENTIFIED_DESC ~Extra seventh level spell slot~ LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 28) parameter2 = (134 + (0x10000 * 1)) timing = 9 END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5shm7%let%~ END @@ -653,6 +700,9 @@ COPY_EXISTING ~d5zprp.spl~ ~override/d5zprpb.spl~ LPF DELETE_EFFECT INT_VAR match_opcode = 139 END */ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zprp0.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 171 target = 1 timing = 9 STR_VAR resource = ~d5zprp~ END + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zprp1.spl~ LPF ADD_SPELL_EFFECT INT_VAR opcode = 328 target = 1 special = 1 parameter2 = %prepared_spells_state% timing = 9 END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 0 duration = 126144000 STR_VAR resource = ~d5zarmr~ END @@ -815,6 +865,7 @@ END // 5E system initialization___________________________________________________________ // +/* ACTION_IF (FILE_EXISTS_IN_GAME ~qdtnb_mcsrc.qd~) BEGIN COPY_EXISTING ~kit.ids~ ~override~ COUNT_2DA_COLS cols @@ -836,6 +887,7 @@ ACTION_IF (FILE_EXISTS_IN_GAME ~qdtnb_mcsrc.qd~) BEGIN END BUT_ONLY END +*/ // put this zz000 in the clab tables ACTION_IF !(FILE_EXISTS_IN_GAME ~d5zz000.spl~) BEGIN @@ -846,8 +898,10 @@ ACTION_IF !(FILE_EXISTS_IN_GAME ~d5zz000.spl~) BEGIN LPF ADD_SPELL_EFFECT INT_VAR opcode = 93 target = 1 parameter1 = 1 parameter2 = 1 timing = 1 END // LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5zlotz~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = ~d5zlots~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 0 duration = 1 STR_VAR resource = ~d5xxini~ END // LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 0 duration = 1 STR_VAR resource = ~d5zz000~ END LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = 19 parameter2 = 105 timing = 9 STR_VAR resource = ~d5zz000~ END +/* PATCH_IF (VARIABLE_IS_SET %fighter_sorcerer_code%) BEGIN LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = %fighter_sorcerer_code% parameter2 = %kit_is_row% timing = 9 STR_VAR resource = ~d5zz000~ END END @@ -857,6 +911,7 @@ ACTION_IF !(FILE_EXISTS_IN_GAME ~d5zz000.spl~) BEGIN PATCH_IF (VARIABLE_IS_SET %sorcerer_thief_code%) BEGIN LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = %sorcerer_thief_code% parameter2 = %kit_is_row% timing = 9 STR_VAR resource = ~d5zz000~ END END +*/ LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = 2 parameter2 = 112 timing = 9 STR_VAR resource = ~d5zz000~ END END @@ -878,7 +933,7 @@ ACTION_IF !(FILE_EXISTS_IN_GAME ~d5zzini.spl~) BEGIN // LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5zz000~ END // LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5zprpb~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter1 = 0 parameter2 = 1 timing = 1 STR_VAR resource = ~d5zprp1~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 171 target = 1 timing = 9 STR_VAR resource = ~d5zprp~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter1 = 0 parameter2 = 1 timing = 1 STR_VAR resource = ~d5zprp0~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 93 target = 1 parameter1 = 0 parameter2 = 1 timing = 4 duration = 4 END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5zzini~ END END @@ -918,14 +973,14 @@ COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zstta.spl~ <<<<<<<< d5/d5zclons.2da 2DA V1.0 IND - MEM CAST TYPE PROCESSED -100 # # # # + MEM CAST TYPE PROCESSED +100 # # # # >>>>>>>> COPY ~d5/d5zclons.2da~ ~override/d5zclons.2da~ // 206/blocking spell = d5zb[ind] -// 171/granting .eff = d5ze[ind] +// 171/granting .eff = d5zg[ind] // 321/learning spell = d5zl[ind] // 146/innate spell = d5zi[ind] @@ -976,9 +1031,89 @@ ACTION_IF (IS_AN_INT %burning_hands_strref%) BEGIN END +//fix black pits 2___________________________________________________________________ +// +COPY_EXISTING ~ohbantim.spl~ override + LPF ALTER_EFFECT INT_VAR match_opcode = 144 match_parameter2 = 13 opcode = 145 parameter2 = 3 END +IF_EXISTS BUT_ONLY + +// change BP1 to allow innates too +// EDIT - don't need to! + +//____________________________________________________________________________________ + + +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_marker.d5~ ~override/d5__semi_spont.d5~ + + +END // end marker file check + + +LAF semi_armor_casting END + +ACTION_IF (include_divine = 1) BEGIN + LAF semi_divine_spells END +END + +ACTION_IF (include_arcane = 1) BEGIN + LAF semi_arcane_spells END +END + +LAF process_semi_spells END + + +END // end define function + + +//__________________________________________________________________________________ +//__________________________________________________________________________________ + + +DEFINE_ACTION_FUNCTION semi_armor_casting BEGIN + +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5__semi_armor.d5~) BEGIN + + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zw172.spl~ + + ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_SEMI_ARCANE~)) BEGIN + COPY_EXISTING ~splstate.ids~ ~override~ + COUNT_2DA_COLS cols + READ_2DA_ENTRIES_NOW rows cols + FOR (row = 1; row < rows; ++row) BEGIN + READ_2DA_ENTRY_FORMER rows row 1 ~state_name~ + READ_2DA_ENTRY_FORMER rows row 0 ~state_ind~ + PATCH_IF (~%state_name%~ STRING_EQUAL_CASE ~D5_SEMI_ARCANE~) BEGIN + SET semi_spont_arcane = %state_ind% + END + END + BUT_ONLY + END + ACTION_IF !(VARIABLE_IS_SET %semi_spont_arcane%) BEGIN + LAF d5_resolve_state STR_VAR new_state_id = ~D5_SEMI_ARCANE~ RET new_state_ind END + OUTER_SET semi_spont_arcane = %new_state_ind% + END + + ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_SEMI_SORC~)) BEGIN + COPY_EXISTING ~splstate.ids~ ~override~ + COUNT_2DA_COLS cols + READ_2DA_ENTRIES_NOW rows cols + FOR (row = 1; row < rows; ++row) BEGIN + READ_2DA_ENTRY_FORMER rows row 1 ~state_name~ + READ_2DA_ENTRY_FORMER rows row 0 ~state_ind~ + PATCH_IF (~%state_name%~ STRING_EQUAL_CASE ~D5_SEMI_SORC~) BEGIN + SET semi_sorc_state = %state_ind% + END + END + BUT_ONLY + END + ACTION_IF !(VARIABLE_IS_SET %semi_sorc_state%) BEGIN + LAF d5_resolve_state STR_VAR new_state_id = ~D5_SEMI_SORC~ RET new_state_ind END + OUTER_SET semi_sorc_state = %new_state_ind% + END + // modify armors' 145 effects_________________________________________________________ // -CREATE EFF ~d5zncast~ // disable wizard casting + CREATE EFF ~d5zncast~ // disable wizard casting WRITE_LONG 0x10 145 WRITE_LONG 0x14 1 WRITE_LONG 0x20 0 @@ -987,7 +1122,7 @@ CREATE EFF ~d5zncast~ // disable wizard casting WRITE_LONG 0x90 1 WRITE_ASCII 0x94 ~D5ZNCAST~ #8 -CREATE EFF ~d5zarm1l~ + CREATE EFF ~d5zarm1l~ WRITE_LONG 0x10 232 WRITE_LONG 0x14 1 WRITE_LONG 0x1c 0 @@ -999,7 +1134,7 @@ CREATE EFF ~d5zarm1l~ WRITE_LONG 0x90 1 WRITE_ASCII 0x94 ~D5ZARM1L~ #8 -CREATE EFF ~d5zarm1c~ + CREATE EFF ~d5zarm1c~ WRITE_LONG 0x10 232 WRITE_LONG 0x14 1 WRITE_LONG 0x1c 0 @@ -1011,7 +1146,7 @@ CREATE EFF ~d5zarm1c~ WRITE_LONG 0x90 1 WRITE_ASCII 0x94 ~D5ZARM1C~ #8 -CREATE EFF ~d5zarm1p~ + CREATE EFF ~d5zarm1p~ WRITE_LONG 0x10 232 WRITE_LONG 0x14 1 WRITE_LONG 0x1c 0 @@ -1023,11 +1158,11 @@ CREATE EFF ~d5zarm1p~ WRITE_LONG 0x90 1 WRITE_ASCII 0x94 ~D5ZARM1P~ #8 -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zarm1.spl~ - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 4 duration = 7 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 111 timing = 0 duration = 1 STR_VAR resource = ~d5zarm1~ END + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zarm1.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 7 STR_VAR resource = ~d5zspla~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 7 STR_VAR resource = ~d5xspls~ END -CREATE EFF ~d5zarm2l~ + CREATE EFF ~d5zarm2l~ WRITE_LONG 0x10 206 WRITE_LONG 0x14 1 WRITE_LONG 0x1c 0 @@ -1037,7 +1172,7 @@ CREATE EFF ~d5zarm2l~ WRITE_LONG 0x90 1 WRITE_ASCII 0x94 ~D5ZARM2L~ #8 -CREATE EFF ~d5zarm2c~ + CREATE EFF ~d5zarm2c~ WRITE_LONG 0x10 206 WRITE_LONG 0x14 1 WRITE_LONG 0x1c 0 @@ -1047,7 +1182,7 @@ CREATE EFF ~d5zarm2c~ WRITE_LONG 0x90 1 WRITE_ASCII 0x94 ~D5ZARM2C~ #8 -CREATE EFF ~d5zarm2p~ + CREATE EFF ~d5zarm2p~ WRITE_LONG 0x10 206 WRITE_LONG 0x14 1 WRITE_LONG 0x1c 0 @@ -1057,7 +1192,69 @@ CREATE EFF ~d5zarm2p~ WRITE_LONG 0x90 1 WRITE_ASCII 0x94 ~D5ZARM2P~ #8 -COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~ + CREATE EFF ~d5zarm3l~ + WRITE_LONG 0x10 206 + WRITE_LONG 0x14 1 + WRITE_LONG 0x1c 0 + WRITE_LONG 0x24 2 + WRITE_SHORT 0x2c 100 + WRITE_ASCII 0x30 ~d5xspls~ #8 + WRITE_LONG 0x90 1 + WRITE_ASCII 0x94 ~D5ZARM3L~ #8 + + CREATE EFF ~d5zarm3c~ + WRITE_LONG 0x10 206 + WRITE_LONG 0x14 1 + WRITE_LONG 0x1c 0 + WRITE_LONG 0x24 2 + WRITE_SHORT 0x2c 100 + WRITE_ASCII 0x30 ~d5xspls~ #8 + WRITE_LONG 0x90 1 + WRITE_ASCII 0x94 ~D5ZARM3C~ #8 + + CREATE EFF ~d5zarm3p~ + WRITE_LONG 0x10 206 + WRITE_LONG 0x14 1 + WRITE_LONG 0x1c 0 + WRITE_LONG 0x24 2 + WRITE_SHORT 0x2c 100 + WRITE_ASCII 0x30 ~d5xspls~ #8 + WRITE_LONG 0x90 1 + WRITE_ASCII 0x94 ~D5ZARM3P~ #8 + +/* + CREATE EFF ~d5zarm4l~ + WRITE_LONG 0x10 206 + WRITE_LONG 0x14 1 + WRITE_LONG 0x1c 0 + WRITE_LONG 0x24 2 + WRITE_SHORT 0x2c 100 + WRITE_ASCII 0x30 ~d5msplz~ #8 // manasorc... eventually change this to xsplm + WRITE_LONG 0x90 1 + WRITE_ASCII 0x94 ~D5ZARM4L~ #8 + + CREATE EFF ~d5zarm4c~ + WRITE_LONG 0x10 206 + WRITE_LONG 0x14 1 + WRITE_LONG 0x1c 0 + WRITE_LONG 0x24 2 + WRITE_SHORT 0x2c 100 + WRITE_ASCII 0x30 ~d5msplz~ #8 // manasorc... eventually change this to xsplm + WRITE_LONG 0x90 1 + WRITE_ASCII 0x94 ~D5ZARM4C~ #8 + + CREATE EFF ~d5zarm4p~ + WRITE_LONG 0x10 206 + WRITE_LONG 0x14 1 + WRITE_LONG 0x1c 0 + WRITE_LONG 0x24 2 + WRITE_SHORT 0x2c 100 + WRITE_ASCII 0x30 ~d5msplz~ #8 // manasorc... eventually change this to xsplm + WRITE_LONG 0x90 1 + WRITE_ASCII 0x94 ~D5ZARM4P~ #8 +*/ + + COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~ PATCH_IF (SOURCE_SIZE > 0x71) BEGIN READ_SHORT 0x1c type PATCH_IF (type = 2) BEGIN @@ -1066,6 +1263,8 @@ COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~ READ_LONG 0x22 appearance PATCH_IF (appearance = 16690) BEGIN // leather appearance LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 177 target = 1 parameter1 = 0 parameter2 = 2 timing = 2 STR_VAR resource = ~d5zarm2l~ END + LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 177 target = 1 parameter1 = 0 parameter2 = 2 timing = 2 STR_VAR resource = ~d5zarm3l~ END +// LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 177 target = 1 parameter1 = 0 parameter2 = 2 timing = 2 STR_VAR resource = ~d5zarm4l~ END LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 177 target = 1 parameter1 = 1 parameter2 = 5 timing = 2 STR_VAR resource = ~d5zarm1l~ END LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 177 target = 1 parameter1 = 5 parameter2 = 5 timing = 2 STR_VAR resource = ~d5zarm1l~ END LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 177 target = 1 parameter1 = 19 parameter2 = 5 timing = 2 STR_VAR resource = ~d5zarm1l~ END @@ -1082,6 +1281,8 @@ COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~ END PATCH_IF (appearance = 16691) BEGIN // chain appearance LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 177 target = 1 parameter1 = 0 parameter2 = 2 timing = 2 STR_VAR resource = ~d5zarm2c~ END + LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 177 target = 1 parameter1 = 0 parameter2 = 2 timing = 2 STR_VAR resource = ~d5zarm3c~ END +// LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 177 target = 1 parameter1 = 0 parameter2 = 2 timing = 2 STR_VAR resource = ~d5zarm4c~ END LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 177 target = 1 parameter1 = 1 parameter2 = 5 timing = 2 STR_VAR resource = ~d5zarm1c~ END LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 177 target = 1 parameter1 = 5 parameter2 = 5 timing = 2 STR_VAR resource = ~d5zarm1c~ END LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 177 target = 1 parameter1 = 19 parameter2 = 5 timing = 2 STR_VAR resource = ~d5zarm1c~ END @@ -1098,6 +1299,8 @@ COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~ END PATCH_IF (appearance = 16692) BEGIN // plate appearance LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 177 target = 1 parameter1 = 0 parameter2 = 2 timing = 2 STR_VAR resource = ~d5zarm2p~ END + LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 177 target = 1 parameter1 = 0 parameter2 = 2 timing = 2 STR_VAR resource = ~d5zarm3p~ END +// LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 177 target = 1 parameter1 = 0 parameter2 = 2 timing = 2 STR_VAR resource = ~d5zarm4p~ END LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 177 target = 1 parameter1 = 1 parameter2 = 5 timing = 2 STR_VAR resource = ~d5zarm1p~ END LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 177 target = 1 parameter1 = 5 parameter2 = 5 timing = 2 STR_VAR resource = ~d5zarm1p~ END LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 177 target = 1 parameter1 = 19 parameter2 = 5 timing = 2 STR_VAR resource = ~d5zarm1p~ END @@ -1114,31 +1317,34 @@ COPY_EXISTING_REGEXP GLOB ~^.+\.itm$~ ~override~ END END END -BUT_ONLY + BUT_ONLY -ACTION_IF (MOD_IS_INSTALLED ~tomeandblood.tp2~ ~48~) BEGIN + ACTION_IF (MOD_IS_INSTALLED ~tomeandblood.tp2~ ~48~) BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5zbarm.spl~ LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5zw172l~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5zarm1l~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5zarm2l~ END APPEND ~clabba01.2da~ ~CAST_LEAT AP_D5ZBARM **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ UNLESS ~AP_D5ZBARM~ - COPY_EXISTING ~kitlist.2da~ ~override~ - COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW ~r2en_kitlist~ 10 - FOR (row = 2; row < r2en_kitlist; row += 1) BEGIN - READ_2DA_ENTRY_FORMER ~r2en_kitlist~ row 1 kit_name - READ_2DA_ENTRY_FORMER ~r2en_kitlist~ row 5 kit_table - READ_2DA_ENTRY_FORMER ~r2en_kitlist~ row 8 class_num - READ_2DA_ENTRY_FORMER ~r2en_kitlist~ row 9 kit_ids - PATCH_IF (class_num = 5) BEGIN - PATCH_IF !(~%kit_name%~ STRING_MATCHES_REGEXP ~C0SA+~ = 0) BEGIN - INNER_ACTION BEGIN - APPEND ~%kit_table%.2da~ ~CAST_LEAT AP_D5ZBARM **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ UNLESS ~AP_D5ZBARM~ - END + COPY_EXISTING ~kitlist.2da~ ~override~ + COUNT_2DA_COLS cols + READ_2DA_ENTRIES_NOW ~r2en_kitlist~ 10 + FOR (row = 2; row < r2en_kitlist; row += 1) BEGIN + READ_2DA_ENTRY_FORMER ~r2en_kitlist~ row 1 kit_name + READ_2DA_ENTRY_FORMER ~r2en_kitlist~ row 5 kit_table + READ_2DA_ENTRY_FORMER ~r2en_kitlist~ row 8 class_num + READ_2DA_ENTRY_FORMER ~r2en_kitlist~ row 9 kit_ids + PATCH_IF (class_num = 5) BEGIN + PATCH_IF !(~%kit_name%~ STRING_MATCHES_REGEXP ~C0SA+~ = 0) BEGIN + INNER_ACTION BEGIN + APPEND ~%kit_table%.2da~ ~CAST_LEAT AP_D5ZBARM **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** **** ~ UNLESS ~AP_D5ZBARM~ + END + END END - END - END -BUT_ONLY + END + BUT_ONLY + END + + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_marker.d5~ ~override/d5__semi_armor.d5~ END @@ -1164,36 +1370,6 @@ h// no no no! just change 145 effects in armors to 144 effects! // ...also, need to make sure YARAS casting speed penalties apply to arcane spells (only) */ - -//fix black pits 2___________________________________________________________________ -// -COPY_EXISTING ~ohbantim.spl~ override - LPF ALTER_EFFECT INT_VAR match_opcode = 144 match_parameter2 = 13 opcode = 145 parameter2 = 3 END -IF_EXISTS BUT_ONLY - -// change BP1 to allow innates too -// EDIT - don't need to! - -//____________________________________________________________________________________ - - -COPY ~%MOD_FOLDER%/lib/semi_spont/d5_marker.d5~ ~override/d5__semi_spont.d5~ - - -END // end marker file check - - -ACTION_IF (include_divine = 1) BEGIN - LAF semi_divine_spells END -END - -ACTION_IF (include_arcane = 1) BEGIN - LAF semi_arcane_spells END -END - -LAF process_semi_spells END - - END // end define function @@ -1281,6 +1457,8 @@ COPY_EXISTING ~d5zclons.2da~ ~override~ IF_EXISTS BUT_ONLY // create innate spell COPY_EXISTING ~%cast_spell%.spl~ ~override/%innate_spell%.spl~ + SAY NAME1 ~~ +// SAY UNIDENTIFIED_DESC ~~ WRITE_SHORT 0x1c 4 LPF ALTER_SPELL_HEADER INT_VAR location = 2 END READ_LONG 0x64 abil_offset @@ -1357,8 +1535,9 @@ COPY_EXISTING ~d5zclons.2da~ ~override~ COPY_EXISTING ~d5zz172.spl~ ~override~ LPF ADD_SPELL_EFFECT INT_VAR /*insert_point = 0*/ opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~%innate_spell%~ END // conditionally add 172 to zw172 - use to remove spells upon equipping armor - ACTION_IF (~%spell_type%~ STRING_EQUAL_CASE ~arcane~) BEGIN + ACTION_IF (~%spell_type%~ STRING_EQUAL_CASE ~arcane~) AND (FILE_EXISTS_IN_GAME ~d5zw172.spl~) BEGIN COPY_EXISTING ~d5zw172.spl~ ~override~ + LPF DELETE_EFFECT INT_VAR match_opcode = 172 STR_VAR match_resource = EVAL ~%innate_spell%~ END LPF ADD_SPELL_EFFECT INT_VAR /*insert_point = 0*/ opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~%innate_spell%~ END END // generate slot#x spells @@ -1428,13 +1607,14 @@ END BUT_ONLY -COPY_EXISTING ~d5zw172.spl~ ~override/d5zw172l.spl~ - PATCH_IF (MOD_IS_INSTALLED ~tomeandblood.tp2~ ~48~) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = 5 parameter2 = 105 timing = 0 duration = 1 STR_VAR resource = ~d5zw172l~ END - END -COPY_EXISTING ~d5zw172.spl~ ~override/d5zw172c.spl~ -COPY_EXISTING ~d5zw172.spl~ ~override/d5zw172p.spl~ - +ACTION_IF (FILE_EXISTS_IN_GAME ~d5zw172.spl~) BEGIN + COPY_EXISTING ~d5zw172.spl~ ~override/d5zw172l.spl~ + PATCH_IF (MOD_IS_INSTALLED ~tomeandblood.tp2~ ~48~) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = 5 parameter2 = 105 timing = 0 duration = 1 STR_VAR resource = ~d5zw172l~ END + END + COPY_EXISTING ~d5zw172.spl~ ~override/d5zw172c.spl~ + COPY_EXISTING ~d5zw172.spl~ ~override/d5zw172p.spl~ +END // compile script_____________________________________________________________________ // @@ -1678,7 +1858,54 @@ ACTION_IF (FILE_EXISTS_IN_GAME ~d5zclons.2da~) BEGIN APPEND ~d5zclons.2da~ ~%spl_ind% %arcane_spell% %arcane_spell% arcane no ~ UNLESS ~%arcane_spell% %arcane_spell%~ END END + +/* don't think I really need to do this + 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 (~d5zclons.2da~ ~%sorc_spell%~)) BEGIN + COPY_EXISTING ~d5zclons.2da~ ~override~ + COUNT_2DA_COLS cols + READ_2DA_ENTRIES_NOW ~r2en_zclons~ cols + FOR (row = 0; row < r2en_zclons; ++row) BEGIN + READ_2DA_ENTRY_FORMER ~r2en_zclons~ row 0 prev_ind + READ_2DA_ENTRY_FORMER ~r2en_zclons~ 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 ~d5zclons.2da~ ~%spl_ind% %sorc_spell% %sorc_spell% arcane no ~ UNLESS ~%sorc_spell% %sorc_spell%~ + END + END +*/ + END END // end function @@ -1807,7 +2034,7 @@ END // end function //__________________________________________________________________________________ -DEFINE_PATCH_FUNCTION divine_casting_slots STR_VAR table_spl = ~~ BEGIN +DEFINE_PATCH_FUNCTION arcane_casting_slots STR_VAR table_spl = ~~ BEGIN // PATCH function - copy .2da table, run this @@ -1815,10 +2042,10 @@ DEFINE_PATCH_FUNCTION divine_casting_slots STR_VAR table_spl = ~~ BEGIN INNER_ACTION BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5__slt.spl~ ~override/%table_spl%.spl~ - WRITE_SHORT 0x1c 2 + WRITE_SHORT 0x1c 1 ACTION_IF !(FILE_EXISTS_IN_GAME ~%table_spl%z.spl~) BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/%table_spl%z.spl~ - WRITE_SHORT 0x1c 2 + WRITE_SHORT 0x1c 1 LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%table_spl%~ END END END @@ -1846,26 +2073,329 @@ DEFINE_PATCH_FUNCTION divine_casting_slots STR_VAR table_spl = ~~ BEGIN PATCH_IF (cols > 7) BEGIN READ_2DA_ENTRY_FORMER r2en_table row 7 level_7 END + PATCH_IF (cols > 8) BEGIN + READ_2DA_ENTRY_FORMER r2en_table row 8 level_8 + END + PATCH_IF (cols > 9) BEGIN + READ_2DA_ENTRY_FORMER r2en_table row 9 level_9 + END INNER_ACTION BEGIN COPY_EXISTING ~%table_spl%.spl~ ~override~ PATCH_IF (VARIABLE_IS_SET %level_1%) BEGIN PATCH_IF (IS_AN_INT %level_1%) AND (%level_1% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_1% << 4) parameter2 = (134 + (0x10000 * 1)) timing = 0 duration = 126144000 END + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_1% << 4) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END END END PATCH_IF (VARIABLE_IS_SET %level_2%) BEGIN PATCH_IF (IS_AN_INT %level_2%) AND (%level_2% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_2% << 8) parameter2 = (134 + (0x10000 * 1)) timing = 0 duration = 126144000 END + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_2% << 8) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END END END PATCH_IF (VARIABLE_IS_SET %level_3%) BEGIN PATCH_IF (IS_AN_INT %level_3%) AND (%level_3% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_3% << 12) parameter2 = (134 + (0x10000 * 1)) timing = 0 duration = 126144000 END + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_3% << 12) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END END END PATCH_IF (VARIABLE_IS_SET %level_4%) BEGIN PATCH_IF (IS_AN_INT %level_4%) AND (%level_4% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_4% << 16) parameter2 = (134 + (0x10000 * 1)) timing = 0 duration = 126144000 END + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_4% << 16) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END + END + END + PATCH_IF (VARIABLE_IS_SET %level_5%) BEGIN + PATCH_IF (IS_AN_INT %level_5%) AND (%level_5% > 0) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_5% << 20) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END + END + END + PATCH_IF (VARIABLE_IS_SET %level_6%) BEGIN + PATCH_IF (IS_AN_INT %level_6%) AND (%level_6% > 0) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_6% << 24) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END + END + END + PATCH_IF (VARIABLE_IS_SET %level_7%) BEGIN + PATCH_IF (IS_AN_INT %level_7%) AND (%level_7% > 0) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_7% << 28) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END + END + END + PATCH_IF (VARIABLE_IS_SET %level_8%) BEGIN + PATCH_IF (IS_AN_INT %level_8%) AND (%level_8% > 0) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_8% << 24) parameter2 = (109 + (0x10000 * 1)) timing = 0 duration = 126144000 END + END + END + PATCH_IF (VARIABLE_IS_SET %level_9%) BEGIN + PATCH_IF (IS_AN_INT %level_9%) AND (%level_9% > 0) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_9% << 28) parameter2 = (109 + (0x10000 * 1)) timing = 0 duration = 126144000 END + END + END + IF_EXISTS BUT_ONLY + END + END + INNER_ACTION BEGIN + ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_SEMI_ARCANE~)) BEGIN + COPY_EXISTING ~splstate.ids~ ~override~ + COUNT_2DA_COLS cols + READ_2DA_ENTRIES_NOW rows cols + FOR (row = 1; row < rows; ++row) BEGIN + READ_2DA_ENTRY_FORMER rows row 1 ~state_name~ + READ_2DA_ENTRY_FORMER rows row 0 ~state_ind~ + PATCH_IF (~%state_name%~ STRING_EQUAL_CASE ~D5_SEMI_ARCANE~) BEGIN + SET semi_spont_arcane = %state_ind% + END + END + BUT_ONLY + END + ACTION_IF !(VARIABLE_IS_SET %semi_spont_arcane%) BEGIN + LAF d5_resolve_state STR_VAR new_state_id = ~D5_SEMI_ARCANE~ RET new_state_ind END + OUTER_SET semi_spont_arcane = %new_state_ind% + END + ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_SEMI_SORC~)) BEGIN + COPY_EXISTING ~splstate.ids~ ~override~ + COUNT_2DA_COLS cols + READ_2DA_ENTRIES_NOW rows cols + FOR (row = 1; row < rows; ++row) BEGIN + READ_2DA_ENTRY_FORMER rows row 1 ~state_name~ + READ_2DA_ENTRY_FORMER rows row 0 ~state_ind~ + PATCH_IF (~%state_name%~ STRING_EQUAL_CASE ~D5_SEMI_SORC~) BEGIN + SET semi_sorc_state = %state_ind% + END + END + BUT_ONLY + END + ACTION_IF !(VARIABLE_IS_SET %semi_sorc_state%) BEGIN + LAF d5_resolve_state STR_VAR new_state_id = ~D5_SEMI_SORC~ RET new_state_ind END + OUTER_SET semi_sorc_state = %new_state_ind% + END + COPY_EXISTING ~%table_spl%.spl~ ~override~ +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 0 duration = 1 STR_VAR resource = EVAL ~%table_spl%~ END + FOR (header = 1 ; header < 40; ++header) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = %header% /*(%header% + 1)*/ insert_point = 0 opcode = 321 target = 1 timing = 1 STR_VAR resource = EVAL ~%table_spl%~ END +// LPF ADD_SPELL_EFFECT INT_VAR header = %header% /*(%header% + 1)*/ opcode = 146 target = 1 parameter1 = 0 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END + PATCH_IF (VARIABLE_IS_SET %semi_spont_arcane%) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = %header% /*(%header% + 1)*/ opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END + END + PATCH_IF (VARIABLE_IS_SET %semi_sorc_state%) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = %header% /*(%header% + 1)*/ opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xspls~ END + END + END + END + +END // end function + + +//__________________________________________________________________________________ +//__________________________________________________________________________________ + + +DEFINE_ACTION_FUNCTION arcane_casting_slots STR_VAR slot_table = ~mxsplwiz~ table_spl = ~~ BEGIN + +// PATCH function - copy .2da table, run this + +// limit table_spl to 7 letters!!! + + ACTION_IF (FILE_EXISTS_IN_GAME ~%slot_table%.2da~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5__slt.spl~ ~override/%table_spl%.spl~ + WRITE_SHORT 0x1c 1 + ACTION_IF !(FILE_EXISTS_IN_GAME ~%table_spl%z.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/%table_spl%z.spl~ + WRITE_SHORT 0x1c 1 + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%table_spl%~ END + END + COPY_EXISTING ~%slot_table%.2da~ ~override~ + COUNT_2DA_COLS cols + READ_2DA_ENTRIES_NOW r2en_table cols + FOR (row = 0; row < r2en_table; ++row) BEGIN + PATCH_IF (cols > 1) BEGIN + READ_2DA_ENTRY_FORMER r2en_table row 1 level_1 + END + PATCH_IF (cols > 2) BEGIN + READ_2DA_ENTRY_FORMER r2en_table row 2 level_2 + END + PATCH_IF (cols > 3) BEGIN + READ_2DA_ENTRY_FORMER r2en_table row 3 level_3 + END + PATCH_IF (cols > 4) BEGIN + READ_2DA_ENTRY_FORMER r2en_table row 4 level_4 + END + PATCH_IF (cols > 5) BEGIN + READ_2DA_ENTRY_FORMER r2en_table row 5 level_5 + END + PATCH_IF (cols > 6) BEGIN + READ_2DA_ENTRY_FORMER r2en_table row 6 level_6 + END + PATCH_IF (cols > 7) BEGIN + READ_2DA_ENTRY_FORMER r2en_table row 7 level_7 + END + PATCH_IF (cols > 8) BEGIN + READ_2DA_ENTRY_FORMER r2en_table row 8 level_8 + END + PATCH_IF (cols > 9) BEGIN + READ_2DA_ENTRY_FORMER r2en_table row 9 level_9 + END + INNER_ACTION BEGIN + COPY_EXISTING ~%table_spl%.spl~ ~override~ + PATCH_IF (VARIABLE_IS_SET %level_1%) BEGIN + PATCH_IF (IS_AN_INT %level_1%) AND (%level_1% > 0) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_1% << 4) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END + END + END + PATCH_IF (VARIABLE_IS_SET %level_2%) BEGIN + PATCH_IF (IS_AN_INT %level_2%) AND (%level_2% > 0) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_2% << 8) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END + END + END + PATCH_IF (VARIABLE_IS_SET %level_3%) BEGIN + PATCH_IF (IS_AN_INT %level_3%) AND (%level_3% > 0) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_3% << 12) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END + END + END + PATCH_IF (VARIABLE_IS_SET %level_4%) BEGIN + PATCH_IF (IS_AN_INT %level_4%) AND (%level_4% > 0) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_4% << 16) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END + END + END + PATCH_IF (VARIABLE_IS_SET %level_5%) BEGIN + PATCH_IF (IS_AN_INT %level_5%) AND (%level_5% > 0) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_5% << 20) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END + END + END + PATCH_IF (VARIABLE_IS_SET %level_6%) BEGIN + PATCH_IF (IS_AN_INT %level_6%) AND (%level_6% > 0) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_6% << 24) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END + END + END + PATCH_IF (VARIABLE_IS_SET %level_7%) BEGIN + PATCH_IF (IS_AN_INT %level_7%) AND (%level_7% > 0) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_7% << 28) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END + END + END + PATCH_IF (VARIABLE_IS_SET %level_8%) BEGIN + PATCH_IF (IS_AN_INT %level_8%) AND (%level_8% > 0) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_8% << 24) parameter2 = (109 + (0x10000 * 1)) timing = 0 duration = 126144000 END + END + END + PATCH_IF (VARIABLE_IS_SET %level_9%) BEGIN + PATCH_IF (IS_AN_INT %level_9%) AND (%level_9% > 0) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_9% << 28) parameter2 = (109 + (0x10000 * 1)) timing = 0 duration = 126144000 END + END + END + IF_EXISTS BUT_ONLY + END + END + BUT_ONLY + ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_SEMI_ARCANE~)) BEGIN + COPY_EXISTING ~splstate.ids~ ~override~ + COUNT_2DA_COLS cols + READ_2DA_ENTRIES_NOW rows cols + FOR (row = 1; row < rows; ++row) BEGIN + READ_2DA_ENTRY_FORMER rows row 1 ~state_name~ + READ_2DA_ENTRY_FORMER rows row 0 ~state_ind~ + PATCH_IF (~%state_name%~ STRING_EQUAL_CASE ~D5_SEMI_ARCANE~) BEGIN + SET semi_spont_arcane = %state_ind% + END + END + BUT_ONLY + END + ACTION_IF !(VARIABLE_IS_SET %semi_spont_arcane%) BEGIN + LAF d5_resolve_state STR_VAR new_state_id = ~D5_SEMI_ARCANE~ RET new_state_ind END + OUTER_SET semi_spont_arcane = %new_state_ind% + END + ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_SEMI_SORC~)) BEGIN + COPY_EXISTING ~splstate.ids~ ~override~ + COUNT_2DA_COLS cols + READ_2DA_ENTRIES_NOW rows cols + FOR (row = 1; row < rows; ++row) BEGIN + READ_2DA_ENTRY_FORMER rows row 1 ~state_name~ + READ_2DA_ENTRY_FORMER rows row 0 ~state_ind~ + PATCH_IF (~%state_name%~ STRING_EQUAL_CASE ~D5_SEMI_SORC~) BEGIN + SET semi_sorc_state = %state_ind% + END + END + BUT_ONLY + END + ACTION_IF !(VARIABLE_IS_SET %semi_sorc_state%) BEGIN + LAF d5_resolve_state STR_VAR new_state_id = ~D5_SEMI_SORC~ RET new_state_ind END + OUTER_SET semi_sorc_state = %new_state_ind% + END + COPY_EXISTING ~%table_spl%.spl~ ~override~ +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 0 duration = 1 STR_VAR resource = EVAL ~%table_spl%~ END + FOR (spl_header = 1 ; spl_header < 40; ++spl_header) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = %spl_header% /*(%spl_header% + 1)*/ insert_point = 0 opcode = 321 target = 1 timing = 1 STR_VAR resource = EVAL ~%table_spl%~ END +// LPF ADD_SPELL_EFFECT INT_VAR header = %spl_header% /*(%spl_header% + 1)*/ opcode = 146 target = 1 parameter1 = 0 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END + PATCH_IF (VARIABLE_IS_SET %semi_spont_arcane%) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = %spl_header% /*(%spl_header% + 1)*/ opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END + END + PATCH_IF (VARIABLE_IS_SET %semi_sorc_state%) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = %spl_header% /*(%spl_header% + 1)*/ opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xspls~ END + END + END + BUT_ONLY + END + +END // end function + + +//__________________________________________________________________________________ +//__________________________________________________________________________________ + + +DEFINE_PATCH_FUNCTION divine_casting_slots STR_VAR table_spl = ~~ BEGIN + +// PATCH function - copy .2da table, run this + +// limit table_spl to 7 letters!!! + + INNER_ACTION BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5__slt.spl~ ~override/%table_spl%.spl~ + WRITE_SHORT 0x1c 2 + ACTION_IF !(FILE_EXISTS_IN_GAME ~%table_spl%z.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/%table_spl%z.spl~ + WRITE_SHORT 0x1c 2 + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%table_spl%~ END + END + END + COUNT_2DA_COLS cols + READ_2DA_ENTRIES_NOW r2en_table cols + FOR (row = 0; row < r2en_table; ++row) BEGIN + PATCH_IF (cols > 1) BEGIN + READ_2DA_ENTRY_FORMER r2en_table row 1 level_1 + END + PATCH_IF (cols > 2) BEGIN + READ_2DA_ENTRY_FORMER r2en_table row 2 level_2 + END + PATCH_IF (cols > 3) BEGIN + READ_2DA_ENTRY_FORMER r2en_table row 3 level_3 + END + PATCH_IF (cols > 4) BEGIN + READ_2DA_ENTRY_FORMER r2en_table row 4 level_4 + END + PATCH_IF (cols > 5) BEGIN + READ_2DA_ENTRY_FORMER r2en_table row 5 level_5 + END + PATCH_IF (cols > 6) BEGIN + READ_2DA_ENTRY_FORMER r2en_table row 6 level_6 + END + PATCH_IF (cols > 7) BEGIN + READ_2DA_ENTRY_FORMER r2en_table row 7 level_7 + END + INNER_ACTION BEGIN + COPY_EXISTING ~%table_spl%.spl~ ~override~ + PATCH_IF (VARIABLE_IS_SET %level_1%) BEGIN + PATCH_IF (IS_AN_INT %level_1%) AND (%level_1% > 0) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_1% << 4) parameter2 = (134 + (0x10000 * 1)) timing = 0 duration = 126144000 END + END + END + PATCH_IF (VARIABLE_IS_SET %level_2%) BEGIN + PATCH_IF (IS_AN_INT %level_2%) AND (%level_2% > 0) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_2% << 8) parameter2 = (134 + (0x10000 * 1)) timing = 0 duration = 126144000 END + END + END + PATCH_IF (VARIABLE_IS_SET %level_3%) BEGIN + PATCH_IF (IS_AN_INT %level_3%) AND (%level_3% > 0) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_3% << 12) parameter2 = (134 + (0x10000 * 1)) timing = 0 duration = 126144000 END + END + END + PATCH_IF (VARIABLE_IS_SET %level_4%) BEGIN + PATCH_IF (IS_AN_INT %level_4%) AND (%level_4% > 0) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_4% << 16) parameter2 = (134 + (0x10000 * 1)) timing = 0 duration = 126144000 END END END PATCH_IF (VARIABLE_IS_SET %level_5%) BEGIN @@ -1887,126 +2417,1923 @@ DEFINE_PATCH_FUNCTION divine_casting_slots STR_VAR table_spl = ~~ BEGIN END END INNER_ACTION BEGIN + ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_SEMI_DIVINE~)) BEGIN + COPY_EXISTING ~splstate.ids~ ~override~ + COUNT_2DA_COLS cols + READ_2DA_ENTRIES_NOW rows cols + FOR (row = 1; row < rows; ++row) BEGIN + READ_2DA_ENTRY_FORMER rows row 1 ~state_name~ + READ_2DA_ENTRY_FORMER rows row 0 ~state_ind~ + PATCH_IF (~%state_name%~ STRING_EQUAL_CASE ~D5_SEMI_DIVINE~) BEGIN + SET semi_spont_divine = %state_ind% + END + END + BUT_ONLY + END +/* + ACTION_IF !(VARIABLE_IS_SET %semi_spont_divine%) BEGIN + LAF d5_resolve_state STR_VAR new_state_id = ~D5_SEMI_DIVINE~ RET new_state_ind END + OUTER_SET semi_spont_divine = %new_state_ind% + END +*/ COPY_EXISTING ~%table_spl%.spl~ ~override~ // LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 0 duration = 1 STR_VAR resource = EVAL ~%table_spl%~ END FOR (header = 1 ; header < 40; ++header) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%header% + 1) insert_point = 0 opcode = 321 target = 1 timing = 1 STR_VAR resource = EVAL ~%table_spl%~ END - LPF ADD_SPELL_EFFECT INT_VAR header = (%header% + 1) opcode = 146 target = 1 parameter1 = 0 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END + LPF ADD_SPELL_EFFECT INT_VAR header = %header% /*(%header% + 1)*/ insert_point = 0 opcode = 321 target = 1 timing = 1 STR_VAR resource = EVAL ~%table_spl%~ END +// LPF ADD_SPELL_EFFECT INT_VAR header = %header% /*(%header% + 1)*/ opcode = 146 target = 1 parameter1 = 0 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END + PATCH_IF (VARIABLE_IS_SET %semi_spont_divine%) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = %header% /*(%header% + 1)*/ opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END + END + END + END + +END // end function + + +//__________________________________________________________________________________ +//__________________________________________________________________________________ + + +DEFINE_ACTION_FUNCTION divine_casting_slots STR_VAR slot_table = ~mxsplprs~ table_spl = ~~ BEGIN + +// PATCH function - copy .2da table, run this + +// limit table_spl to 7 letters!!! + + ACTION_IF (FILE_EXISTS_IN_GAME ~%slot_table%.2da~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5__slt.spl~ ~override/%table_spl%.spl~ + WRITE_SHORT 0x1c 2 + ACTION_IF !(FILE_EXISTS_IN_GAME ~%table_spl%z.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/%table_spl%z.spl~ + WRITE_SHORT 0x1c 2 + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%table_spl%~ END + END + COPY_EXISTING ~%slot_table%.2da~ ~override~ + COUNT_2DA_COLS cols + READ_2DA_ENTRIES_NOW r2en_table cols + FOR (row = 0; row < r2en_table; ++row) BEGIN + PATCH_IF (cols > 1) BEGIN + READ_2DA_ENTRY_FORMER r2en_table row 1 level_1 + END + PATCH_IF (cols > 2) BEGIN + READ_2DA_ENTRY_FORMER r2en_table row 2 level_2 + END + PATCH_IF (cols > 3) BEGIN + READ_2DA_ENTRY_FORMER r2en_table row 3 level_3 + END + PATCH_IF (cols > 4) BEGIN + READ_2DA_ENTRY_FORMER r2en_table row 4 level_4 + END + PATCH_IF (cols > 5) BEGIN + READ_2DA_ENTRY_FORMER r2en_table row 5 level_5 + END + PATCH_IF (cols > 6) BEGIN + READ_2DA_ENTRY_FORMER r2en_table row 6 level_6 + END + PATCH_IF (cols > 7) BEGIN + READ_2DA_ENTRY_FORMER r2en_table row 7 level_7 + END + INNER_ACTION BEGIN + COPY_EXISTING ~%table_spl%.spl~ ~override~ + PATCH_IF (VARIABLE_IS_SET %level_1%) BEGIN + PATCH_IF (IS_AN_INT %level_1%) AND (%level_1% > 0) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_1% << 4) parameter2 = (134 + (0x10000 * 1)) timing = 0 duration = 126144000 END + END + END + PATCH_IF (VARIABLE_IS_SET %level_2%) BEGIN + PATCH_IF (IS_AN_INT %level_2%) AND (%level_2% > 0) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_2% << 8) parameter2 = (134 + (0x10000 * 1)) timing = 0 duration = 126144000 END + END + END + PATCH_IF (VARIABLE_IS_SET %level_3%) BEGIN + PATCH_IF (IS_AN_INT %level_3%) AND (%level_3% > 0) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_3% << 12) parameter2 = (134 + (0x10000 * 1)) timing = 0 duration = 126144000 END + END + END + PATCH_IF (VARIABLE_IS_SET %level_4%) BEGIN + PATCH_IF (IS_AN_INT %level_4%) AND (%level_4% > 0) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_4% << 16) parameter2 = (134 + (0x10000 * 1)) timing = 0 duration = 126144000 END + END + END + PATCH_IF (VARIABLE_IS_SET %level_5%) BEGIN + PATCH_IF (IS_AN_INT %level_5%) AND (%level_5% > 0) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_5% << 20) parameter2 = (134 + (0x10000 * 1)) timing = 0 duration = 126144000 END + END + END + PATCH_IF (VARIABLE_IS_SET %level_6%) BEGIN + PATCH_IF (IS_AN_INT %level_6%) AND (%level_6% > 0) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_6% << 24) parameter2 = (134 + (0x10000 * 1)) timing = 0 duration = 126144000 END + END + END + PATCH_IF (VARIABLE_IS_SET %level_7%) BEGIN + PATCH_IF (IS_AN_INT %level_7%) AND (%level_7% > 0) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_7% << 28) parameter2 = (134 + (0x10000 * 1)) timing = 0 duration = 126144000 END + END + END + IF_EXISTS BUT_ONLY + END + END + BUT_ONLY + ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_SEMI_DIVINE~)) BEGIN + COPY_EXISTING ~splstate.ids~ ~override~ + COUNT_2DA_COLS cols + READ_2DA_ENTRIES_NOW rows cols + FOR (row = 1; row < rows; ++row) BEGIN + READ_2DA_ENTRY_FORMER rows row 1 ~state_name~ + READ_2DA_ENTRY_FORMER rows row 0 ~state_ind~ + PATCH_IF (~%state_name%~ STRING_EQUAL_CASE ~D5_SEMI_DIVINE~) BEGIN + SET semi_spont_divine = %state_ind% + END + END + BUT_ONLY + END + ACTION_IF !(VARIABLE_IS_SET %semi_spont_divine%) BEGIN + LAF d5_resolve_state STR_VAR new_state_id = ~D5_SEMI_DIVINE~ RET new_state_ind END + OUTER_SET semi_spont_divine = %new_state_ind% + END + COPY_EXISTING ~%table_spl%.spl~ ~override~ +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 0 duration = 1 STR_VAR resource = EVAL ~%table_spl%~ END + FOR (spl_header = 1 ; spl_header < 40; ++spl_header) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = %spl_header% /*(%spl_header% + 1)*/ insert_point = 0 opcode = 321 target = 1 timing = 1 STR_VAR resource = EVAL ~%table_spl%~ END +// LPF ADD_SPELL_EFFECT INT_VAR header = %spl_header% /*(%spl_header% + 1)*/ opcode = 146 target = 1 parameter1 = 0 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END + PATCH_IF (VARIABLE_IS_SET %semi_spont_divine%) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR header = %spl_header% /*(%spl_header% + 1)*/ opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END + END + END + BUT_ONLY + END + +END // end function + + +//__________________________________________________________________________________ +//__________________________________________________________________________________ + + +DEFINE_ACTION_FUNCTION sorcerer_spell_learning STR_VAR menu_suffix = ~W~ BEGIN + + +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5__sorc_learning.d5~) BEGIN + +// sorcerer spell system legend +// +<<<<<<<< d5/d5xsorc.2da +2DA V1.0 +**** + ResRef Type>>>>>>>> + COPY ~d5/d5xsorc.2da~ ~override/d5xsorc.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 ~d5xsorc.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 + ACTION_IF !(FILE_EXISTS_IN_GAME ~%mem_spell%%menu_suffix%.spl~) BEGIN + 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 + 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 = ~d5xsorc~ + spelllist = ~d5xsorc~ + spelltable = ~QD_SPLSRCKN~ + icon = ~spcl919b~ + title = ~Spell Selection~ + label = ~Select a spell to learn~ + subspell = EVAL ~%menu_suffix%~ + END + + COPY_EXISTING ~d5xsorc.2da~ ~override/d5xsorcX.2da~ + + COPY ~%MOD_FOLDER%/lib/semi_spont/d5lernwi.bam~ ~override~ + + COPY ~%MOD_FOLDER%/lib/semi_spont/d5xsorc.itm~ ~override~ // learn spells .itm + SAY NAME1 ~Arcane Spell Knowledge~ + SAY NAME2 ~Arcane Spell Knowledge~ + SAY UNIDENTIFIED_DESC ~Arcane Spell Knowledge~ + SAY IDENTIFIED_DESC ~Arcane Spell Knowledge~ + LPF ALTER_ITEM_HEADER INT_VAR target = 7 speed = 0 STR_VAR icon = ~d5lernwi~ END + + OUTER_INNER_PATCH ~1~ BEGIN + WRITE_BYTE 0 0x09 + READ_ASCII 0 tab (1) // 0x09, tab + WRITE_BYTE 0 0x0d + READ_ASCII 0 mnl (1) // 0x0d, Mac + END + LAF ~ADD_ITEM_TOOLTIPS~ STR_VAR item = ~d5xsorc~ tooltips = ~Spell Knowledge~ END + + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xsor1.spl~ + SAY NAME1 ~Initialize sorcerer spell-learning~ + SAY UNIDENTIFIED_DESC ~~ + WRITE_SHORT 0x1c 4 + LPF ALTER_SPELL_HEADER INT_VAR target = 5 location = 4 STR_VAR icon = ~d5lernwi~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 143 target = 1 parameter1 = 14 timing = 9 STR_VAR resource = ~d5xsorc~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (2 << 24) parameter2 = (115 + (0x10000 * 1)) timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = ~d5xsor1~ END + + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xsor2.spl~ + SAY NAME1 ~Initialize sorcerer spell-learning~ + SAY UNIDENTIFIED_DESC ~~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5xsor1~ END + + + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_marker.d5~ ~override/d5__sorc_learning.d5~ + +END // end marker file check + + +END // end define function + + +//__________________________________________________________________________________ +//__________________________________________________________________________________ + + +DEFINE_ACTION_FUNCTION semi_sorcerer_casting STR_VAR sorc_suffix = ~w~ BEGIN +// suffix must match the one in the menu function + + +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5__semi_sorc_casting.d5~) BEGIN + +//disable quickspells and scroll learning____________________________________________ +// +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5xnoqk.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xnoqk.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 144 target = 1 parameter2 = 3 timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 144 target = 1 parameter2 = 4 timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 144 target = 1 parameter2 = 5 timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 101 target = 1 parameter2 = 147 timing = 9 END +END + + +//add spell slot stat checks to SPLPROT______________________________________________ +// +APPEND ~splprot.2da~ ~D5_WIZ_1_7%TAB%108%TAB%-1%TAB%7~ UNLESS ~D5_WIZ_1_7~ +APPEND ~splprot.2da~ ~D5_WIZ=1_7%TAB%108%TAB%-1%TAB%8~ UNLESS ~D5_WIZ=1_7~ +APPEND ~splprot.2da~ ~D5_WIZ_8_9%TAB%109%TAB%-1%TAB%7~ UNLESS ~D5_WIZ_8_9~ +APPEND ~splprot.2da~ ~D5_WIZ=8_9%TAB%109%TAB%-1%TAB%8~ UNLESS ~D5_WIZ=8_9~ +APPEND ~splprot.2da~ ~D5_FATIGUE_0%TAB%30%TAB%0%TAB%1~ UNLESS ~D5_FATIGUE_0~ +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_WIZ_1_7~) BEGIN + SET fake_sorc_slots_1_7 = %row% + END + PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_WIZ=1_7~) BEGIN + SET fake_sorc_equal_1_7 = %row% + END + PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_WIZ_8_9~) BEGIN + SET fake_sorc_slots_8_9 = %row% + END + PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_WIZ=8_9~) BEGIN + SET fake_sorc_equal_8_9 = %row% + END + PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_FATIGUE_0~) BEGIN + SET fatigue_zero = %row% + END + PATCH_IF ~%stat%~ STRING_EQUAL_CASE ~D5_KIT_IS~ BEGIN + SET kit_is_row = %row% + END + END +BUT_ONLY + +ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_SEMI_SORC~)) BEGIN + COPY_EXISTING ~splstate.ids~ ~override~ + COUNT_2DA_COLS cols + READ_2DA_ENTRIES_NOW rows cols + FOR (row = 1; row < rows; ++row) BEGIN + READ_2DA_ENTRY_FORMER rows row 1 ~state_name~ + READ_2DA_ENTRY_FORMER rows row 0 ~state_ind~ + PATCH_IF (~%state_name%~ STRING_EQUAL_CASE ~D5_SEMI_SORC~) BEGIN + SET semi_sorc_state = %state_ind% + END + END + BUT_ONLY +END + +ACTION_IF !(VARIABLE_IS_SET %semi_sorc_state%) BEGIN + LAF d5_resolve_state STR_VAR new_state_id = ~D5_SEMI_SORC~ RET new_state_ind END + OUTER_SET semi_sorc_state = %new_state_ind% +END + + +//remove all mage spell slots_________________________________________________________ +// +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5x0slt.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5x0slt.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 42 target = 1 parameter1 = (0 - 1) parameter2 = 511 timing = 9 END + BUT_ONLY +END + + +//create advance copies of some spells________________________________________________ +// +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xx206.spl~ + +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xx172.spl~ + +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5x0spl.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~SPWI908~ END + PATCH_IF !(MOD_IS_INSTALLED ~TomeAndBlood.tp2~ ~16~) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = ~SPWI110~ END + END + PATCH_IF !(MOD_IS_INSTALLED ~TomeAndBlood.tp2~ ~55~) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~SPWI420~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~SPWI710~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~SPWI809~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~SPWI617~ END + END + +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot1a.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot1b.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot1c.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot1d.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot2a.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot2b.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot2c.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot2d.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot3a.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot3b.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot3c.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot3d.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot4a.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot4b.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot4c.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot4d.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot5a.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot5b.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot5c.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot5d.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot6a.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot6b.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot6c.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot6d.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot7a.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot7b.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot7c.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot7d.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot8a.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot8b.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot8c.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot8d.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot9a.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot9b.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot9c.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xwot9d.spl~ + +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xspls.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 4) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot1a~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 4) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot1b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 4) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot1c~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 4) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot1d~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 8) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot2a~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 8) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot2b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 8) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot2c~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 8) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot2d~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 12) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot3a~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 12) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot3b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 12) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot3c~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 12) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot3d~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 16) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot4a~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 16) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot4b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 16) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot4c~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 16) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot4d~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 20) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot5a~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 20) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot5b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 20) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot5c~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 20) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot5d~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 24) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot6a~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 24) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot6b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 24) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot6c~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 24) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot6d~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 28) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot7a~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 28) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot7b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 28) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot7c~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 28) parameter2 = %fake_sorc_slots_1_7% timing = 1 STR_VAR resource = ~d5xwot7d~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 24) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5xwot8a~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 24) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5xwot8b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 24) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5xwot8c~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 24) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5xwot8d~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 28) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5xwot9a~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 28) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5xwot9b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 28) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5xwot9c~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 28) parameter2 = %fake_sorc_slots_8_9% timing = 1 STR_VAR resource = ~d5xwot9d~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 0 duration = 1 STR_VAR resource = ~d5xspls~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 318 insert_point = 0 target = 1 parameter1 = %semi_sorc_state% parameter2 = 111 timing = 0 duration = 1 STR_VAR resource = ~d5xspls~ END + +//assign stats for spell slots to each spell level____________________________________ +// +// arcane level 1 = 108 << 4 +// arcane level 2 = 108 << 8 +// arcane level 3 = 108 << 12 +// arcane level 4 = 108 << 16 +// arcane level 5 = 108 << 20 +// arcane level 6 = 108 << 24 +// arcane level 7 = 108 << 28 +// arcane level 8 = 109 << 24 +// arcane level 9 = 109 << 28 +// + +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src1a.spl~) BEGIN + ACTION_FOR_EACH let IN ~a~ BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src1%let%.spl~ + SAY NAME1 @21991 + SAY UNIDENTIFIED_DESC @21991 + LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 4) parameter2 = (108 + (0x10000 * 1)) timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src1%let%~ END + END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src2a.spl~) BEGIN + ACTION_FOR_EACH let IN ~a~ BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src2%let%.spl~ + SAY NAME1 @21992 + SAY UNIDENTIFIED_DESC @21992 + LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 8) parameter2 = (108 + (0x10000 * 1)) timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src2%let%~ END + END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src3a.spl~) BEGIN + ACTION_FOR_EACH let IN ~a~ BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src3%let%.spl~ + SAY NAME1 @21993 + SAY UNIDENTIFIED_DESC @21993 + LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 12) parameter2 = (108 + (0x10000 * 1)) timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src3%let%~ END + END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src4a.spl~) BEGIN + ACTION_FOR_EACH let IN ~a~ BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src4%let%.spl~ + SAY NAME1 @21994 + SAY UNIDENTIFIED_DESC @21994 + LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 16) parameter2 = (108 + (0x10000 * 1)) timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src4%let%~ END + END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src5a.spl~) BEGIN + ACTION_FOR_EACH let IN ~a~ BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src5%let%.spl~ + SAY NAME1 @21995 + SAY UNIDENTIFIED_DESC @21995 + LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 20) parameter2 = (108 + (0x10000 * 1)) timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src5%let%~ END + END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src6a.spl~) BEGIN + ACTION_FOR_EACH let IN ~a~ BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src6%let%.spl~ + SAY NAME1 @21996 + SAY UNIDENTIFIED_DESC @21996 + LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 24) parameter2 = (108 + (0x10000 * 1)) timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src6%let%~ END + END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src7a.spl~) BEGIN + ACTION_FOR_EACH let IN ~a~ BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src7%let%.spl~ + SAY NAME1 @21997 + SAY UNIDENTIFIED_DESC @21997 + LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 28) parameter2 = (108 + (0x10000 * 1)) timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src7%let%~ END + END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src8a.spl~) BEGIN + ACTION_FOR_EACH let IN ~a~ BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src8%let%.spl~ + SAY NAME1 @21989 + SAY UNIDENTIFIED_DESC @21989 + LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 24) parameter2 = (109 + (0x10000 * 1)) timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src8%let%~ END + END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src9a.spl~) BEGIN + ACTION_FOR_EACH let IN ~a~ BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src9%let%.spl~ + SAY NAME1 @21990 + SAY UNIDENTIFIED_DESC @21990 + LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 28) parameter2 = (109 + (0x10000 * 1)) timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5src9%let%~ END + END +END + +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src-1.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src-1.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 4) parameter2 = (108 + (0x10000 * 1)) timing = 1 END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src-2.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src-2.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 8) parameter2 = (108 + (0x10000 * 1)) timing = 1 END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src-3.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src-3.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 12) parameter2 = (108 + (0x10000 * 1)) timing = 1 END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src-4.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src-4.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 16) parameter2 = (108 + (0x10000 * 1)) timing = 1 END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src-5.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src-5.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 20) parameter2 = (108 + (0x10000 * 1)) timing = 1 END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src-6.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src-6.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 24) parameter2 = (108 + (0x10000 * 1)) timing = 1 END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src-7.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src-7.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 28) parameter2 = (108 + (0x10000 * 1)) timing = 1 END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src-8.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src-8.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 24) parameter2 = (109 + (0x10000 * 1)) timing = 1 END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5src-9.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5src-9.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 28) parameter2 = (109 + (0x10000 * 1)) timing = 1 END +END + + +//daily spell slot refresh____________________________________________________________ +// +COPY ~%MOD_FOLDER%/lib/semi_spont/d5zcast.bam~ ~override~ + +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xlotz.spl~ + SAY NAME1 ~initialize 5E spellcasting~ + SAY UNIDENTIFIED_DESC ~initialize 5E spellcasting~ + LPF ALTER_SPELL_HEADER INT_VAR target = 7 STR_VAR icon = ~d5zcast~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = ~d5xlots~ END + +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5xlots.eff~) BEGIN + CREATE EFF ~d5xlots~ + WRITE_LONG 0x10 232 + WRITE_LONG 0x14 1 + WRITE_LONG 0x1c 0 + WRITE_LONG 0x20 20 + WRITE_LONG 0x24 9 + WRITE_SHORT 0x2c 100 + WRITE_ASCII 0x30 ~d5xlots~ #8 + WRITE_LONG 0x48 102 +END + +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5xlots.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xlots.spl~ + LPF ALTER_SPELL_HEADER INT_VAR target = 5 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 111 timing = 1 STR_VAR resource = ~d5xx001~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 0 parameter2 = %fatigue_zero% timing = 1 STR_VAR resource = ~d5xlotf~ END +END + +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5xx001.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xx001.spl~ + LPF ALTER_SPELL_HEADER INT_VAR target = 5 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 111 timing = 1 STR_VAR resource = ~d5xxini~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 111 timing = 1 STR_VAR resource = ~d5xstts~ END +END + +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5xstts.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xstts.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 328 target = 1 special = 1 parameter2 = %semi_sorc_state% timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 0 duration = 1 STR_VAR resource = ~d5xstts~ END +END + +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5xlotf.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xlotf.spl~ + LPF ALTER_SPELL_HEADER INT_VAR target = 5 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5xnfsh~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = ~d5xrfsh~ END +END + +ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5xrfsh.spl~ BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xrfsh.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 93 target = 1 parameter1 = 1 parameter2 = 1 timing = 1 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 duration = 0 STR_VAR resource = ~d5xx172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5zz145~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5src-1~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5src-2~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5src-3~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5src-4~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5src-5~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5src-6~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5src-7~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5src-8~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5src-9~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xspls~ END +END + +ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5xnfsh.spl~ BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xnfsh.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 0 duration = 18 STR_VAR resource = ~d5xrfsh~ END +END + +// put this xx000 in the clab tables +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5xx000.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xx000.spl~ + LPF ALTER_SPELL_HEADER INT_VAR target = 5 END + SAY NAME1 ~Initialize sorcerer spellcasting~ + SAY UNIDENTIFIED_DESC ~Initialize sorcerer spellcasting~ + LPF ALTER_SPELL_HEADER INT_VAR target = 7 STR_VAR icon = ~d5zcast~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 93 target = 1 parameter1 = 1 parameter2 = 1 timing = 1 END +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5xlotz~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = ~d5xlots~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 0 duration = 1 STR_VAR resource = ~d5zzini~ END +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 0 duration = 1 STR_VAR resource = ~d5xx000~ END + LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = 19 parameter2 = 105 timing = 9 STR_VAR resource = ~d5xx000~ END + LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = 2 parameter2 = 112 timing = 9 STR_VAR resource = ~d5xx000~ END +END + +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5xxini.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5xxini.spl~ + LPF ALTER_SPELL_HEADER INT_VAR target = 5 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5xx206~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5xnoqk~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5x0spl~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5x0slt~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5x0slt~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5x0slt~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5x0slt~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5x0slt~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5x0slt~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5x0slt~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5x0slt~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5x0slt~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5x0slt~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5x0slt~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5x0slt~ END + PATCH_IF (FILE_EXISTS_IN_GAME ~d5xsor1.spl~) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5xsor1~ END + END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 316 target = 1 timing = 1 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5zncast~ END +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 93 target = 1 parameter1 = 0 parameter2 = 1 timing = 4 duration = 4 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 4 duration = 3 STR_VAR resource = ~d5xlotf~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5xxini~ END +END + + +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_marker.d5~ ~override/d5__semi_sorc_casting.d5~ + + +//fix burning hands targeting_______________________________________________________ +// +COPY_EXISTING ~spwi103.spl~ ~override~ + READ_LONG 0x08 burning_hands_strref +BUT_ONLY + +ACTION_IF (IS_AN_INT %burning_hands_strref%) BEGIN + COPY_EXISTING_REGEXP GLOB ~^.+\.spl$~ ~override~ + PATCH_IF (%SOURCE_SIZE% > 0x71) BEGIN + SET burning_change = 0 + READ_LONG 0x08 name + PATCH_IF (name = burning_hands_strref) BEGIN + GET_OFFSET_ARRAY ab_array SPL_V10_HEADERS + PHP_EACH ab_array AS int => ab_off BEGIN + PATCH_IF (burning_change = 0) BEGIN + READ_BYTE (ab_off + 0x0c) target + PATCH_IF target = 5 BEGIN + SET burning_change = 1 + END + END + END + PATCH_IF (burning_change = 1) BEGIN + LPF ALTER_SPELL_HEADER INT_VAR target = 1 END + LPF ALTER_EFFECT INT_VAR match_opcode = 148 opcode = 146 target = 2 STR_VAR match_resource = ~spwi103~ END + WRITE_BYTE 0x1b (THIS BOR 1) + END + END + END + BUT_ONLY +END + +//fix black pits 2___________________________________________________________________ +// +COPY_EXISTING ~ohbantim.spl~ override + LPF ALTER_EFFECT INT_VAR match_opcode = 144 match_parameter2 = 13 opcode = 145 parameter2 = 3 END +IF_EXISTS BUT_ONLY + +// change BP1 to allow innates too +// EDIT - don't need to! +//__________________________________________________________________________________ + + +END // end marker file check + + +// casting system______________________________________________________________________ +// +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 + READ_2DA_ENTRY_FORMER ~r2en_xclons~ row 2 cast_spell + READ_2DA_ENTRY_FORMER ~r2en_xclons~ row 3 spell_type + READ_2DA_ENTRY_FORMER ~r2en_xclons~ row 4 spell_proc + PATCH_IF (x_ind > 100) AND (~%spell_proc%~ STRING_EQUAL_CASE ~no~) BEGIN + SPRINT innate_spell ~d5x%x_ind%i~ + SPRINT give_spell ~d5x%x_ind%g~ + SPRINT block_spell ~d5x%x_ind%b~ + SPRINT learn_spell ~d5x%x_ind%l~ + SPRINT switch_spell ~d5x%x_ind%h~ + SPRINT switch_subspell ~d5x%x_ind%w~ + INNER_ACTION BEGIN + COPY_EXISTING ~%mem_spell%.spl~ ~override~ + READ_LONG 0x34 level + IF_EXISTS BUT_ONLY +// create innate spell + COPY_EXISTING ~%cast_spell%.spl~ ~override/%innate_spell%.spl~ + SAY NAME1 ~~ +// SAY UNIDENTIFIED_DESC ~~ + WRITE_SHORT 0x1c 4 + LPF ALTER_SPELL_HEADER INT_VAR location = 2 END + READ_LONG 0x64 abil_offset + READ_SHORT 0x68 abil_number + READ_BYTE (%abil_offset% + 0x0c) abil_target + READ_SHORT (%abil_offset% + 0x0e) abil_range + READ_LONG 0x6a eff_offset + WHILE (%abil_number% > 0) BEGIN + SET abil_number = (%abil_number% - 1) + WRITE_SHORT (%abil_offset% + 0x26 + (0x28 * %abil_number%)) 1 + END + READ_BYTE (%eff_offset% + 0x02) eff_target + LPF DELETE_EFFECT INT_VAR match_probability2 = 0 END + PATCH_IF (%abil_target% = 4) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 148 target = 1 power = 0 parameter1 = 0 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%cast_spell%~ END + PATCH_IF (%abil_range% < 35) BEGIN + PATCH_IF (%abil_range% > 4) BEGIN + LPF ALTER_SPELL_HEADER INT_VAR range = (%abil_range% - 3) END + END + PATCH_IF (%abil_range% < 5) BEGIN + LPF ALTER_SPELL_HEADER INT_VAR target = 5 END // might need to carve out exceptions, e.g. burning hands + END + END + END + ELSE BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 2 power = 0 parameter2 = 1 timing = 9 STR_VAR resource = EVAL ~%cast_spell%~ END + END +// exempt lvl 1 if lv1 1 cantrips + PATCH_IF (lose_spell_on_interrupt = 0) BEGIN + PATCH_IF (MOD_IS_INSTALLED ~tomeandblood.tp2~ ~62~) BEGIN + PATCH_IF (%level% > 1) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5src-%level%~ END + END + END + PATCH_IF !(MOD_IS_INSTALLED ~tomeandblood.tp2~ ~62~) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5src-%level%~ END + END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 duration = 0 STR_VAR resource = ~d5xx172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xspls~ END +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5xspls~ END + END + PATCH_IF (lose_spell_on_interrupt = 1) BEGIN + PATCH_IF (MOD_IS_INSTALLED ~tomeandblood.tp2~ ~62~) BEGIN + PATCH_IF (%level% > 1) BEGIN + LPF ADD_SPELL_CFEFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5src-%level%~ END + END + END + PATCH_IF !(MOD_IS_INSTALLED ~tomeandblood.tp2~ ~62~) BEGIN + LPF ADD_SPELL_CFEFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5src-%level%~ END + END + LPF ADD_SPELL_CFEFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 duration = 0 STR_VAR resource = ~d5xx172~ END + LPF ADD_SPELL_CFEFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xspls~ END +// LPF ADD_SPELL_CFEFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5xspls~ END + END +// make spells adding the innate spell + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/%give_spell%.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 171 target = 1 timing = 9 STR_VAR resource = EVAL ~%innate_spell%~ END +// make 206 spells preventing the .EFF + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/%block_spell%.spl~ + WRITE_SHORT 0x1c 4 + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~%give_spell%~ END +// add 206 spells to CLAB spell + COPY_EXISTING ~d5xx206.spl~ ~override~ + LPF DELETE_EFFECT INT_VAR match_opcode = 146 STR_VAR match_resource = EVAL ~%block_spell%~ END + LPF DELETE_EFFECT INT_VAR match_opcode = 321 STR_VAR match_resource = EVAL ~%block_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%block_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~%block_spell%~ END +// make learn spells canceling the 206 + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/%learn_spell%.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~%block_spell%~ END +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~%block_spell%~ END +// add 172 to zz172 + COPY_EXISTING ~d5xx172.spl~ ~override~ + LPF ADD_SPELL_EFFECT INT_VAR /*insert_point = 0*/ opcode = 172 target = 1 timing = 1 STR_VAR resource = EVAL ~%innate_spell%~ END +// learn from seq menu + ACTION_IF (FILE_EXISTS_IN_GAME ~%cast_spell%%sorc_suffix%.spl~) BEGIN + COPY_EXISTING ~%cast_spell%%sorc_suffix%.spl~ ~override~ +// LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 171 target = 1 timing = 9 STR_VAR resource = EVAL ~%mem_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = EVAL ~%learn_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5xx172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xspls~ END + END +// enable spell switching + ACTION_IF (FILE_EXISTS_IN_GAME ~%switch_spell%.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/%switch_subspell%.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 1 STR_VAR resource = EVAL ~%learn_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%block_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5xx172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xspls~ END + COPY_EXISTING ~%switch_spell%.spl~ ~override~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~%switch_subspell%~ END + BUT_ONLY + END +// conditionally add 172 to zw172 - use to remove spells upon equipping armor + ACTION_IF (FILE_EXISTS_IN_GAME ~d5zw172.spl~) BEGIN + COPY_EXISTING ~d5zw172.spl~ ~override~ + LPF DELETE_EFFECT INT_VAR match_opcode = 172 STR_VAR match_resource = EVAL ~%innate_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR /*insert_point = 0*/ opcode = 172 target = 1 timing = 9 STR_VAR resource = EVAL ~%innate_spell%~ END + END +// remove all known spells after chargen + COPY_EXISTING ~d5x0spl.spl~ ~override~ + LPF DELETE_EFFECT INT_VAR match_opcode = 172 STR_VAR match_resource = EVAL ~%cast_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 1 STR_VAR resource = EVAL ~%cast_spell%~ END + IF_EXISTS +// generate slot#x spells + ACTION_IF (FILE_EXISTS_IN_GAME ~d5xwot%level%a.spl~) BEGIN + COPY_EXISTING ~d5xwot%level%a.spl~ ~override~ + LPF DELETE_EFFECT INT_VAR match_opcode = 146 STR_VAR match_resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + END + ACTION_IF (FILE_EXISTS_IN_GAME ~d5xwot%level%a.spl~) BEGIN + COPY_EXISTING ~d5xwot%level%b.spl~ ~override~ + LPF DELETE_EFFECT INT_VAR match_opcode = 146 STR_VAR match_resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + END + ACTION_IF (FILE_EXISTS_IN_GAME ~d5xwot%level%a.spl~) BEGIN + COPY_EXISTING ~d5xwot%level%c.spl~ ~override~ + LPF DELETE_EFFECT INT_VAR match_opcode = 146 STR_VAR match_resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + END + ACTION_IF (FILE_EXISTS_IN_GAME ~d5xwot%level%a.spl~) BEGIN + COPY_EXISTING ~d5xwot%level%d.spl~ ~override~ + LPF DELETE_EFFECT INT_VAR match_opcode = 146 STR_VAR match_resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + END + END + SET_2DA_ENTRY row 4 cols ~yes~ + END + END +BUT_ONLY + +ACTION_IF (FILE_EXISTS_IN_GAME ~d5zw172.spl~) BEGIN + COPY_EXISTING ~d5zw172.spl~ ~override/d5zw172l.spl~ + PATCH_IF (MOD_IS_INSTALLED ~tomeandblood.tp2~ ~48~) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = 5 parameter2 = 105 timing = 0 duration = 1 STR_VAR resource = ~d5zw172l~ END + END + COPY_EXISTING ~d5zw172.spl~ ~override/d5zw172c.spl~ + COPY_EXISTING ~d5zw172.spl~ ~override/d5zw172p.spl~ +END + + +END // end define function + + +//__________________________________________________________________________________ +//__________________________________________________________________________________ + + +DEFINE_ACTION_FUNCTION divine_spell_learning STR_VAR menu_suffix = ~W~ BEGIN + + +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5__cler_learning.d5~) BEGIN + +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5_shmkn.2da~) BEGIN + COPY_EXISTING ~splshmkn.2da~ ~override/d5_shmkn.2da~ +END + +// divine spont spell system legend +// +<<<<<<<< d5/d5ycler.2da +2DA V1.0 +**** + ResRef Type>>>>>>>> + COPY ~d5/d5ycler.2da~ ~override/d5ycler.2da~ + + ACTION_IF !(FILE_EXISTS_IN_GAME ~d5yclons.2da~) BEGIN +<<<<<<<< d5/d5yclons.2da +2DA V1.0 +IND + MEM CAST TYPE PROCESSED +100 # # # # +>>>>>>>> + COPY ~d5/d5yclons.2da~ ~override/d5yclons.2da~ +END + +//ACTION_IF (FILE_EXISTS_IN_GAME ~d5yclons.2da~) BEGIN + + OUTER_SET high_ind = 99 + COPY_EXISTING ~d5yclons.2da~ ~override~ + COUNT_2DA_COLS cols + READ_2DA_ENTRIES_NOW ~r2en_yclons~ cols + FOR (row = 0; row < r2en_yclons; ++row) BEGIN + READ_2DA_ENTRY_FORMER ~r2en_yclons~ row 0 this_ind + PATCH_IF (this_ind > high_ind) BEGIN + SET high_ind = this_ind + END + END + BUT_ONLY + + COPY_EXISTING ~d5yclons.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 0x21 ok_cleric + READ_LONG 0x34 spell_level + PATCH_IF (~%SOURCE_RES%~ STRING_MATCHES_REGEXP ~[Ss][Pp][Pp][Rr][1-9][0-5][0-9]$~ = 0) && (spell_type = 2) && ((%ok_cleric% BOR 0b10111111) = 0b10111111) BEGIN + SNPRINT (0 - 3) spell_num ~%SOURCE_RES%~ + SET go = 1 + PATCH_IF (go = 1) && !(FILE_CONTAINS_EVALUATED (~hidespl.2da~ ~%SOURCE_RES%~)) BEGIN + SPRINT $cleric_spells(~%SOURCE_RES%~) ~1~ + END + END + END + BUT_ONLY + + ACTION_PHP_EACH cleric_spells AS cler_spell => ind BEGIN + ACTION_IF (%ind% > 0) BEGIN + OUTER_SET spl_ind = 0 + ACTION_IF (FILE_CONTAINS_EVALUATED (~d5yclons.2da~ ~%cler_spell%~)) BEGIN + COPY_EXISTING ~d5yclons.2da~ ~override~ + COUNT_2DA_COLS cols + READ_2DA_ENTRIES_NOW ~r2en_yclons~ cols + FOR (row = 0; row < r2en_yclons; ++row) BEGIN + READ_2DA_ENTRY_FORMER ~r2en_yclons~ row 0 prev_ind + READ_2DA_ENTRY_FORMER ~r2en_yclons~ row 2 cast_spell + PATCH_IF (~%cler_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 ~d5ycler.2da~ ~cleric %cler_spell% 3~ + APPEND ~d5yclons.2da~ ~%spl_ind% %cler_spell% %cler_spell% cleric no ~ UNLESS ~%cler_spell% %cler_spell%~ + END + END + + COPY_EXISTING ~d5yclons.2da~ ~override~ + COUNT_2DA_COLS cols + READ_2DA_ENTRIES_NOW ~r2en_yclons~ cols + FOR (row = 0; row < r2en_yclons; ++row) BEGIN + READ_2DA_ENTRY_FORMER ~r2en_yclons~ row 0 x_ind + READ_2DA_ENTRY_FORMER ~r2en_yclons~ 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 + ACTION_IF !(FILE_EXISTS_IN_GAME ~%mem_spell%%menu_suffix%.spl~) BEGIN + 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 + 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 = ~d5ycler~ + spelllist = ~d5ycler~ + spelltable = ~d5_shmkn~ + icon = ~spcl919b~ + title = ~Spell Selection~ + label = ~Select a spell to learn~ + subspell = EVAL ~%menu_suffix%~ + END + + COPY_EXISTING ~d5ycler.2da~ ~override/d5yclerX.2da~ + + COPY ~%MOD_FOLDER%/lib/semi_spont/d5lernwi.bam~ ~override~ + + COPY ~%MOD_FOLDER%/lib/semi_spont/d5ycler.itm~ ~override~ // learn spells .itm + SAY NAME1 ~Cleric Spell Learning~ + SAY NAME2 ~Cleric Spell Learning~ + SAY UNIDENTIFIED_DESC ~Cleric Spell Learning~ + SAY IDENTIFIED_DESC ~Cleric Spell Learning~ + LPF ALTER_ITEM_HEADER INT_VAR target = 7 speed = 0 STR_VAR icon = ~d5lernwi~ END + + OUTER_INNER_PATCH ~1~ BEGIN + WRITE_BYTE 0 0x09 + READ_ASCII 0 tab (1) // 0x09, tab + WRITE_BYTE 0 0x0d + READ_ASCII 0 mnl (1) // 0x0d, Mac + END + LAF ~ADD_ITEM_TOOLTIPS~ STR_VAR item = ~d5ycler~ tooltips = ~Spell Knowledge~ END + + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ycle1.spl~ + SAY NAME1 ~Initialize innate spell learning~ + SAY UNIDENTIFIED_DESC ~~ + WRITE_SHORT 0x1c 4 + LPF ALTER_SPELL_HEADER INT_VAR target = 5 location = 4 STR_VAR icon = ~d5lernwi~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 143 target = 1 parameter1 = 14 timing = 9 STR_VAR resource = ~d5ycler~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (2 << 24) parameter2 = (115 + (0x10000 * 1)) timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = ~d5ycle1~ END + + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ycle2.spl~ + SAY NAME1 ~Initialize innate spell learning~ + SAY UNIDENTIFIED_DESC ~~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5ycle1~ END + + + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_marker.d5~ ~override/d5__cler_learning.d5~ + +END // end marker file check + + +END // end define function + + +//__________________________________________________________________________________ +//__________________________________________________________________________________ + + +DEFINE_ACTION_FUNCTION shaman_spell_learning STR_VAR menu_suffix = ~W~ BEGIN + + +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5__sham_learning.d5~) BEGIN + +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5_shmkn.2da~) BEGIN + COPY_EXISTING ~splshmkn.2da~ ~override/d5_shmkn.2da~ +END + +// shaman spell system legend +// +<<<<<<<< d5/d5ysham.2da +2DA V1.0 +**** + ResRef Type>>>>>>>> + COPY ~d5/d5ysham.2da~ ~override/d5ysham.2da~ + + ACTION_IF !(FILE_EXISTS_IN_GAME ~d5yclons.2da~) BEGIN +<<<<<<<< d5/d5yclons.2da +2DA V1.0 +IND + MEM CAST TYPE PROCESSED +100 # # # # +>>>>>>>> + COPY ~d5/d5yclons.2da~ ~override/d5yclons.2da~ +END + +//ACTION_IF (FILE_EXISTS_IN_GAME ~d5yclons.2da~) BEGIN + + OUTER_SET high_ind = 99 + COPY_EXISTING ~d5yclons.2da~ ~override~ + COUNT_2DA_COLS cols + READ_2DA_ENTRIES_NOW ~r2en_yclons~ cols + FOR (row = 0; row < r2en_yclons; ++row) BEGIN + READ_2DA_ENTRY_FORMER ~r2en_yclons~ row 0 this_ind + PATCH_IF (this_ind > high_ind) BEGIN + SET high_ind = this_ind + END + END + BUT_ONLY + + COPY_EXISTING ~d5yclons.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 0x21 ok_druid + READ_LONG 0x34 spell_level + PATCH_IF (~%SOURCE_RES%~ STRING_MATCHES_REGEXP ~[Ss][Pp][Pp][Rr][1-9][0-5][0-9]$~ = 0) && (spell_type = 2) && ((%ok_druid% BOR 0b01111111) = 0b01111111) BEGIN + SNPRINT (0 - 3) spell_num ~%SOURCE_RES%~ + SET go = 1 + PATCH_IF (go = 1) && !(FILE_CONTAINS_EVALUATED (~hidespl.2da~ ~%SOURCE_RES%~)) BEGIN + SPRINT $druid_spells(~%SOURCE_RES%~) ~1~ + END + END + END + BUT_ONLY + + ACTION_PHP_EACH druid_spells AS druid_spell => ind BEGIN + ACTION_IF (%ind% > 0) BEGIN + OUTER_SET spl_ind = 0 + ACTION_IF (FILE_CONTAINS_EVALUATED (~d5yclons.2da~ ~%sorc_spell%~)) BEGIN + COPY_EXISTING ~d5yclons.2da~ ~override~ + COUNT_2DA_COLS cols + READ_2DA_ENTRIES_NOW ~r2en_yclons~ cols + FOR (row = 0; row < r2en_yclons; ++row) BEGIN + READ_2DA_ENTRY_FORMER ~r2en_yclons~ row 0 prev_ind + READ_2DA_ENTRY_FORMER ~r2en_yclons~ row 2 cast_spell + PATCH_IF (~%druid_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 ~d5ysham.2da~ ~druid %druid_spell% 3~ + APPEND ~d5yclons.2da~ ~%spl_ind% %druid_spell% %druid_spell% arcane no ~ UNLESS ~%druid_spell% %druid_spell%~ + END + END + + COPY_EXISTING ~d5yclons.2da~ ~override~ + COUNT_2DA_COLS cols + READ_2DA_ENTRIES_NOW ~r2en_yclons~ cols + FOR (row = 0; row < r2en_yclons; ++row) BEGIN + READ_2DA_ENTRY_FORMER ~r2en_yclons~ row 0 x_ind + READ_2DA_ENTRY_FORMER ~r2en_yclons~ 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 + ACTION_IF !(FILE_EXISTS_IN_GAME ~%mem_spell%%menu_suffix%.spl~) BEGIN + 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 + 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 = ~d5ysham~ + spelllist = ~d5ysham~ + spelltable = ~d5_shmkn~ + icon = ~spcl919b~ + title = ~Spell Selection~ + label = ~Select a spell to learn~ + subspell = EVAL ~%menu_suffix%~ + END + + COPY_EXISTING ~d5ysham.2da~ ~override/d5yshamX.2da~ + + COPY ~%MOD_FOLDER%/lib/semi_spont/d5lernwi.bam~ ~override~ + + COPY ~%MOD_FOLDER%/lib/semi_spont/d5ysham.itm~ ~override~ // learn spells .itm + SAY NAME1 ~Druid Spell Learning~ + SAY NAME2 ~Druid Spell Learning~ + SAY UNIDENTIFIED_DESC ~Druid Spell Learning~ + SAY IDENTIFIED_DESC ~Druid Spell Learning~ + LPF ALTER_ITEM_HEADER INT_VAR target = 7 speed = 0 STR_VAR icon = ~d5lernwi~ END + + OUTER_INNER_PATCH ~1~ BEGIN + WRITE_BYTE 0 0x09 + READ_ASCII 0 tab (1) // 0x09, tab + WRITE_BYTE 0 0x0d + READ_ASCII 0 mnl (1) // 0x0d, Mac + END + LAF ~ADD_ITEM_TOOLTIPS~ STR_VAR item = ~d5ysham~ tooltips = ~Spell Knowledge~ END + + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5yshm1.spl~ + SAY NAME1 ~Initialize shaman spell learning~ + SAY UNIDENTIFIED_DESC ~~ + WRITE_SHORT 0x1c 4 + LPF ALTER_SPELL_HEADER INT_VAR target = 5 location = 4 STR_VAR icon = ~d5lernwi~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 143 target = 1 parameter1 = 14 timing = 9 STR_VAR resource = ~d5ysham~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (2 << 24) parameter2 = (115 + (0x10000 * 1)) timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 9 STR_VAR resource = ~d5yshm1~ END + + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5yshm2.spl~ + SAY NAME1 ~Initialize sorcerer spell-learning~ + SAY UNIDENTIFIED_DESC ~~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5yshm1~ END + + + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_marker.d5~ ~override/d5__sham_learning.d5~ + +END // end marker file check + + +END // end define function + + +//__________________________________________________________________________________ +//__________________________________________________________________________________ + + +DEFINE_ACTION_FUNCTION semi_shaman_casting STR_VAR sham_suffix = ~w~ BEGIN +// suffix must match the one in the menu function + + +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5__semi_sham_casting.d5~) BEGIN + +//disable quickspells and scroll learning____________________________________________ +// +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5ynoqk.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ynoqk.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 144 target = 1 parameter2 = 3 timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 144 target = 1 parameter2 = 4 timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 144 target = 1 parameter2 = 5 timing = 9 END +END + + +//add spell slot stat checks to SPLPROT______________________________________________ +// +APPEND ~splprot.2da~ ~D5_DIV_1_7%TAB%134%TAB%-1%TAB%7~ UNLESS ~D5_DIV_1_7~ +APPEND ~splprot.2da~ ~D5_DIV=1_7%TAB%134%TAB%-1%TAB%8~ UNLESS ~D5_DIV=1_7~ +APPEND ~splprot.2da~ ~D5_FATIGUE_0%TAB%30%TAB%0%TAB%1~ UNLESS ~D5_FATIGUE_0~ +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_DIV_1_7~) BEGIN + SET fake_sham_slots_1_7 = %row% + END + PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_DIV=1_7~) BEGIN + SET fake_sham_equal_1_7 = %row% + END + PATCH_IF (~%stat%~ STRING_EQUAL_CASE ~D5_FATIGUE_0~) BEGIN + SET fatigue_zero = %row% + END + PATCH_IF ~%stat%~ STRING_EQUAL_CASE ~D5_KIT_IS~ BEGIN + SET kit_is_row = %row% + END + END +BUT_ONLY + +ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_SEMI_SHAM~)) BEGIN + COPY_EXISTING ~splstate.ids~ ~override~ + COUNT_2DA_COLS cols + READ_2DA_ENTRIES_NOW rows cols + FOR (row = 1; row < rows; ++row) BEGIN + READ_2DA_ENTRY_FORMER rows row 1 ~state_name~ + READ_2DA_ENTRY_FORMER rows row 0 ~state_ind~ + PATCH_IF (~%state_name%~ STRING_EQUAL_CASE ~D5_SEMI_SHAM~) BEGIN + SET semi_sham_state = %state_ind% + END + END + BUT_ONLY +END + +ACTION_IF !(VARIABLE_IS_SET %semi_sham_state%) BEGIN + LAF d5_resolve_state STR_VAR new_state_id = ~D5_SEMI_SHAM~ RET new_state_ind END + OUTER_SET semi_sham_state = %new_state_ind% +END + + +//remove all mage spell slots_________________________________________________________ +// +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5y0slt.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5y0slt.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 62 target = 1 parameter1 = (0 - 1) parameter2 = 127 timing = 9 END + BUT_ONLY +END + + +//create advance copies of some spells________________________________________________ +// +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5yy206.spl~ + +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5yy172.spl~ + +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5y0spl.spl~ + +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot1a.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot1b.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot1c.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot1d.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot2a.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot2b.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot2c.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot2d.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot3a.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot3b.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot3c.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot3d.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot4a.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot4b.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot4c.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot4d.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot5a.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot5b.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot5c.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot5d.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot6a.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot6b.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot6c.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot6d.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot7a.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot7b.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot7c.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot7d.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot8a.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot8b.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot8c.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot8d.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot9a.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot9b.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot9c.spl~ +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ydot9d.spl~ + +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5yspld.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 4) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot1a~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 4) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot1b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 4) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot1c~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 4) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot1d~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 8) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot2a~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 8) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot2b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 8) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot2c~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 8) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot2d~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 12) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot3a~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 12) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot3b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 12) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot3c~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 12) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot3d~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 16) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot4a~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 16) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot4b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 16) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot4c~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 16) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot4d~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 20) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot5a~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 20) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot5b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 20) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot5c~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 20) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot5d~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 24) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot6a~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 24) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot6b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 24) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot6c~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 24) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot6d~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (1 << 28) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot7a~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (2 << 28) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot7b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (4 << 28) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot7c~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = (8 << 28) parameter2 = %fake_sham_slots_1_7% timing = 1 STR_VAR resource = ~d5ydot7d~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 0 duration = 1 STR_VAR resource = ~d5yspld~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 318 insert_point = 0 target = 1 parameter1 = %semi_sham_state% parameter2 = 111 timing = 0 duration = 1 STR_VAR resource = ~d5yspld~ END + +//assign stats for spell slots to each spell level____________________________________ +// +// divine level 1 = 134 << 4 +// divine level 2 = 134 << 8 +// divine level 3 = 134 << 12 +// divine level 4 = 134 << 16 +// divine level 5 = 134 << 20 +// divine level 6 = 134 << 24 +// divine level 7 = 134 << 28 +// + +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm1a.spl~) BEGIN + ACTION_FOR_EACH let IN ~a~ BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm1%let%.spl~ + SAY NAME1 ~Extra first level spell slot~ + SAY UNIDENTIFIED_DESC ~Extra first level spell slot~ + LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 4) parameter2 = (134 + (0x10000 * 1)) timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5shm1%let%~ END + END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm2a.spl~) BEGIN + ACTION_FOR_EACH let IN ~a~ BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm2%let%.spl~ + SAY NAME1 ~Extra second level spell slot~ + SAY UNIDENTIFIED_DESC ~Extra second level spell slot~ + LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 8) parameter2 = (134 + (0x10000 * 1)) timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5shm2%let%~ END + END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm3a.spl~) BEGIN + ACTION_FOR_EACH let IN ~a~ BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm3%let%.spl~ + SAY NAME1 ~Extra third level spell slot~ + SAY UNIDENTIFIED_DESC ~Extra third level spell slot~ + LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 12) parameter2 = (134 + (0x10000 * 1)) timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5shm3%let%~ END + END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm4a.spl~) BEGIN + ACTION_FOR_EACH let IN ~a~ BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm4%let%.spl~ + SAY NAME1 ~Extra fourth level spell slot~ + SAY UNIDENTIFIED_DESC~Extra fourth level spell slot~ + LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 16) parameter2 = (134 + (0x10000 * 1)) timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5shm4%let%~ END + END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm5a.spl~) BEGIN + ACTION_FOR_EACH let IN ~a~ BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm5%let%.spl~ + SAY NAME1 ~Extra fifth level spell slot~ + SAY UNIDENTIFIED_DESC ~Extra fifth level spell slot~ + LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 20) parameter2 = (134 + (0x10000 * 1)) timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5shm5%let%~ END + END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm6a.spl~) BEGIN + ACTION_FOR_EACH let IN ~a~ BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm6%let%.spl~ + SAY NAME1 ~Extra sixth level spell slot~ + SAY UNIDENTIFIED_DESC ~Extra sixth level spell slot~ + LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 24) parameter2 = (134 + (0x10000 * 1)) timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5shm6%let%~ END + END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm7a.spl~) BEGIN + ACTION_FOR_EACH let IN ~a~ BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm7%let%.spl~ + SAY NAME1 ~Extra seventh level spell slot~ + SAY UNIDENTIFIED_DESC ~Extra seventh level spell slot~ + LPF ALTER_SPELL_HEADER INT_VAR target = 5 STR_VAR icon = ~spcl919b~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = (1 << 28) parameter2 = (134 + (0x10000 * 1)) timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~d5shm7%let%~ END + END +END + +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm-1.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm-1.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 4) parameter2 = (134 + (0x10000 * 1)) timing = 1 END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm-2.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm-2.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 8) parameter2 = (134 + (0x10000 * 1)) timing = 1 END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm-3.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm-3.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 12) parameter2 = (134 + (0x10000 * 1)) timing = 1 END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm-4.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm-4.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 16) parameter2 = (134 + (0x10000 * 1)) timing = 1 END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm-5.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm-5.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 20) parameter2 = (134 + (0x10000 * 1)) timing = 1 END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm-6.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm-6.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 24) parameter2 = (134 + (0x10000 * 1)) timing = 1 END +END +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5shm-7.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5shm-7.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 233 target = 1 parameter1 = ((0 - 1) << 28) parameter2 = (134 + (0x10000 * 1)) timing = 1 END +END + + +//daily spell slot refresh____________________________________________________________ +// +COPY ~%MOD_FOLDER%/lib/semi_spont/d5zcast.bam~ ~override~ + +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ylotz.spl~ + SAY NAME1 ~initialize 5E spellcasting~ + SAY UNIDENTIFIED_DESC ~initialize 5E spellcasting~ + LPF ALTER_SPELL_HEADER INT_VAR target = 7 STR_VAR icon = ~d5zcast~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = ~d5ylots~ END + +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5ylots.eff~) BEGIN + CREATE EFF ~d5ylots~ + WRITE_LONG 0x10 232 + WRITE_LONG 0x14 1 + WRITE_LONG 0x1c 0 + WRITE_LONG 0x20 20 + WRITE_LONG 0x24 9 + WRITE_SHORT 0x2c 100 + WRITE_ASCII 0x30 ~d5ylots~ #8 + WRITE_LONG 0x48 102 +END + +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5ylots.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ylots.spl~ + LPF ALTER_SPELL_HEADER INT_VAR target = 5 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 111 timing = 1 STR_VAR resource = ~d5yy001~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = 0 parameter2 = %fatigue_zero% timing = 1 STR_VAR resource = ~d5ylotf~ END +END + +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5yy001.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5yy001.spl~ + LPF ALTER_SPELL_HEADER INT_VAR target = 5 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 111 timing = 1 STR_VAR resource = ~d5yyini~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 111 timing = 1 STR_VAR resource = ~d5ysttd~ END +END + +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5ysttd.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ysttd.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 328 target = 1 special = 1 parameter2 = %semi_sham_state% timing = 9 END + LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 0 duration = 1 STR_VAR resource = ~d5ysttd~ END +END + +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5ylotf.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ylotf.spl~ + LPF ALTER_SPELL_HEADER INT_VAR target = 5 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5ynfsh~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 1 STR_VAR resource = ~d5yrfsh~ END +END + +ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5yrfsh.spl~ BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5yrfsh.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 93 target = 1 parameter1 = 1 parameter2 = 1 timing = 1 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 duration = 0 STR_VAR resource = ~d5yy172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5shm-1~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5shm-2~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5shm-3~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5shm-4~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5shm-5~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5shm-6~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5shm-7~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5shm-8~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5shm-9~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5yspld~ END +END + +ACTION_IF NOT FILE_EXISTS_IN_GAME ~d5ynfsh.spl~ BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5ynfsh.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 0 duration = 18 STR_VAR resource = ~d5yrfsh~ END +END + +// put this xx000 in the clab tables +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5yy000.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5yy000.spl~ + LPF ALTER_SPELL_HEADER INT_VAR target = 5 END + SAY NAME1 ~Initialize shaman-style spellcasting~ + SAY UNIDENTIFIED_DESC ~Initialize shaman-style spellcasting~ + LPF ALTER_SPELL_HEADER INT_VAR target = 7 STR_VAR icon = ~d5zcast~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 93 target = 1 parameter1 = 1 parameter2 = 1 timing = 1 END +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5ylotz~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 177 target = 1 parameter2 = 2 timing = 9 STR_VAR resource = ~d5ylots~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 0 duration = 1 STR_VAR resource = ~d5zzini~ END +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 0 duration = 1 STR_VAR resource = ~d5yy000~ END + LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = 21 parameter2 = 105 timing = 9 STR_VAR resource = ~d5yy000~ END + LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 1 parameter1 = 2 parameter2 = 112 timing = 9 STR_VAR resource = ~d5yy000~ END +END + +ACTION_IF !(FILE_EXISTS_IN_GAME ~d5yyini.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5yyini.spl~ + LPF ALTER_SPELL_HEADER INT_VAR target = 5 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5yy206~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5ynoqk~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5y0spl~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5y0slt~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5y0slt~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5y0slt~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5y0slt~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5y0slt~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5y0slt~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5y0slt~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5y0slt~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5y0slt~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5y0slt~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5y0slt~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5y0slt~ END + PATCH_IF !(FILE_EXISTS_IN_GAME ~d5__spheres.d5~) BEGIN + PATCH_IF (FILE_EXISTS_IN_GAME ~d5mycle1.spl~) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5ycle1~ END END - END + PATCH_IF (FILE_EXISTS_IN_GAME ~d5myshm1.spl~) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = ~d5yshm1~ END + END + END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 316 target = 1 timing = 1 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5zncast~ END +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 93 target = 1 parameter1 = 0 parameter2 = 1 timing = 4 duration = 4 END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 4 duration = 3 STR_VAR resource = ~d5ylotf~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = ~d5yyini~ END +END -END // end function +COPY ~%MOD_FOLDER%/lib/semi_spont/d5_marker.d5~ ~override/d5__semi_sham_casting.d5~ -//__________________________________________________________________________________ -//__________________________________________________________________________________ +//fix black pits 2___________________________________________________________________ +// +COPY_EXISTING ~ohbantim.spl~ override + LPF ALTER_EFFECT INT_VAR match_opcode = 144 match_parameter2 = 13 opcode = 145 parameter2 = 3 END +IF_EXISTS BUT_ONLY -DEFINE_PATCH_FUNCTION arcane_casting_slots STR_VAR table_spl = ~~ BEGIN +// change BP1 to allow innates too +// EDIT - don't need to! +//__________________________________________________________________________________ -// PATCH function - copy .2da table, run this -// limit table_spl to 7 letters!!! +END // end marker file check - INNER_ACTION BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5__slt.spl~ ~override/%table_spl%.spl~ - WRITE_SHORT 0x1c 1 - ACTION_IF !(FILE_EXISTS_IN_GAME ~%table_spl%z.spl~) BEGIN - COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/%table_spl%z.spl~ - WRITE_SHORT 0x1c 1 - LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%table_spl%~ END - END - END + +// casting system______________________________________________________________________ +// +COPY_EXISTING ~d5yclons.2da~ ~override~ COUNT_2DA_COLS cols - READ_2DA_ENTRIES_NOW r2en_table cols - FOR (row = 0; row < r2en_table; ++row) BEGIN - PATCH_IF (cols > 1) BEGIN - READ_2DA_ENTRY_FORMER r2en_table row 1 level_1 - END - PATCH_IF (cols > 2) BEGIN - READ_2DA_ENTRY_FORMER r2en_table row 2 level_2 - END - PATCH_IF (cols > 3) BEGIN - READ_2DA_ENTRY_FORMER r2en_table row 3 level_3 - END - PATCH_IF (cols > 4) BEGIN - READ_2DA_ENTRY_FORMER r2en_table row 4 level_4 - END - PATCH_IF (cols > 5) BEGIN - READ_2DA_ENTRY_FORMER r2en_table row 5 level_5 - END - PATCH_IF (cols > 6) BEGIN - READ_2DA_ENTRY_FORMER r2en_table row 6 level_6 - END - PATCH_IF (cols > 7) BEGIN - READ_2DA_ENTRY_FORMER r2en_table row 7 level_7 - END - PATCH_IF (cols > 8) BEGIN - READ_2DA_ENTRY_FORMER r2en_table row 8 level_8 - END - PATCH_IF (cols > 9) BEGIN - READ_2DA_ENTRY_FORMER r2en_table row 9 level_9 - END - INNER_ACTION BEGIN - COPY_EXISTING ~%table_spl%.spl~ ~override~ - PATCH_IF (VARIABLE_IS_SET %level_1%) BEGIN - PATCH_IF (IS_AN_INT %level_1%) AND (%level_1% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_1% << 4) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END - END - END - PATCH_IF (VARIABLE_IS_SET %level_2%) BEGIN - PATCH_IF (IS_AN_INT %level_2%) AND (%level_2% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_2% << 8) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END - END - END - PATCH_IF (VARIABLE_IS_SET %level_3%) BEGIN - PATCH_IF (IS_AN_INT %level_3%) AND (%level_3% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_3% << 12) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END - END - END - PATCH_IF (VARIABLE_IS_SET %level_4%) BEGIN - PATCH_IF (IS_AN_INT %level_4%) AND (%level_4% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_4% << 16) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END - END - END - PATCH_IF (VARIABLE_IS_SET %level_5%) BEGIN - PATCH_IF (IS_AN_INT %level_5%) AND (%level_5% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_5% << 20) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END - END - END - PATCH_IF (VARIABLE_IS_SET %level_6%) BEGIN - PATCH_IF (IS_AN_INT %level_6%) AND (%level_6% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_6% << 24) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END - END - END - PATCH_IF (VARIABLE_IS_SET %level_7%) BEGIN - PATCH_IF (IS_AN_INT %level_7%) AND (%level_7% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_7% << 28) parameter2 = (108 + (0x10000 * 1)) timing = 0 duration = 126144000 END - END - END - PATCH_IF (VARIABLE_IS_SET %level_8%) BEGIN - PATCH_IF (IS_AN_INT %level_8%) AND (%level_8% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_8% << 24) parameter2 = (109 + (0x10000 * 1)) timing = 0 duration = 126144000 END - END - END - PATCH_IF (VARIABLE_IS_SET %level_9%) BEGIN - PATCH_IF (IS_AN_INT %level_9%) AND (%level_9% > 0) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = (%row% + 1) opcode = 233 target = 1 parameter1 = (%level_9% << 28) parameter2 = (109 + (0x10000 * 1)) timing = 0 duration = 126144000 END - END - END - IF_EXISTS BUT_ONLY - END - END - INNER_ACTION BEGIN - COPY_EXISTING ~%table_spl%.spl~ ~override~ -// LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 0 duration = 1 STR_VAR resource = EVAL ~%table_spl%~ END - FOR (header = 1 ; header < 40; ++header) BEGIN - LPF ADD_SPELL_EFFECT INT_VAR header = %header% /*(%header% + 1)*/ insert_point = 0 opcode = 321 target = 1 timing = 1 STR_VAR resource = EVAL ~%table_spl%~ END - LPF ADD_SPELL_EFFECT INT_VAR header = %header% /*(%header% + 1)*/ opcode = 146 target = 1 parameter1 = 0 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END + READ_2DA_ENTRIES_NOW ~r2en_yclons~ cols + FOR (row = 0; row < r2en_yclons; ++row) BEGIN + READ_2DA_ENTRY_FORMER ~r2en_yclons~ row 0 x_ind + READ_2DA_ENTRY_FORMER ~r2en_yclons~ row 1 mem_spell + READ_2DA_ENTRY_FORMER ~r2en_yclons~ row 2 cast_spell + READ_2DA_ENTRY_FORMER ~r2en_yclons~ row 3 spell_type + READ_2DA_ENTRY_FORMER ~r2en_yclons~ row 4 spell_proc + PATCH_IF (x_ind > 100) AND (~%spell_proc%~ STRING_EQUAL_CASE ~no~) BEGIN + SPRINT innate_spell ~d5y%x_ind%i~ + SPRINT give_spell ~d5y%x_ind%g~ + SPRINT block_spell ~d5y%x_ind%b~ + SPRINT learn_spell ~d5y%x_ind%l~ + SPRINT switch_spell ~d5y%x_ind%h~ + SPRINT switch_subspell ~d5y%x_ind%w~ + INNER_ACTION BEGIN + COPY_EXISTING ~%mem_spell%.spl~ ~override~ + READ_LONG 0x34 level + IF_EXISTS BUT_ONLY +// create innate spell + COPY_EXISTING ~%cast_spell%.spl~ ~override/%innate_spell%.spl~ + SAY NAME1 ~~ +// SAY UNIDENTIFIED_DESC ~~ + WRITE_SHORT 0x1c 4 + LPF ALTER_SPELL_HEADER INT_VAR location = 2 END + READ_LONG 0x64 abil_offset + READ_SHORT 0x68 abil_number + READ_BYTE (%abil_offset% + 0x0c) abil_target + READ_SHORT (%abil_offset% + 0x0e) abil_range + READ_LONG 0x6a eff_offset + WHILE (%abil_number% > 0) BEGIN + SET abil_number = (%abil_number% - 1) + WRITE_SHORT (%abil_offset% + 0x26 + (0x28 * %abil_number%)) 1 + END + READ_BYTE (%eff_offset% + 0x02) eff_target + LPF DELETE_EFFECT INT_VAR match_probability2 = 0 END + PATCH_IF (%abil_target% = 4) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 148 target = 1 power = 0 parameter1 = 0 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%cast_spell%~ END + PATCH_IF (%abil_range% < 35) BEGIN + PATCH_IF (%abil_range% > 4) BEGIN + LPF ALTER_SPELL_HEADER INT_VAR range = (%abil_range% - 3) END + END + PATCH_IF (%abil_range% < 5) BEGIN + LPF ALTER_SPELL_HEADER INT_VAR target = 5 END // might need to carve out exceptions, e.g. burning hands + END + END + END + ELSE BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 2 power = 0 parameter2 = 1 timing = 9 STR_VAR resource = EVAL ~%cast_spell%~ END + END +// exempt lvl 1 if lv1 1 cantrips + PATCH_IF (lose_spell_on_interrupt = 0) BEGIN + PATCH_IF (MOD_IS_INSTALLED ~tomeandblood.tp2~ ~62~) BEGIN + PATCH_IF (%level% > 1) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5shm-%level%~ END + END + END + PATCH_IF !(MOD_IS_INSTALLED ~tomeandblood.tp2~ ~62~) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5shm-%level%~ END + END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 duration = 0 STR_VAR resource = ~d5yy172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5yspld~ END +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5yspld~ END + END + PATCH_IF (lose_spell_on_interrupt = 1) BEGIN + PATCH_IF (MOD_IS_INSTALLED ~tomeandblood.tp2~ ~62~) BEGIN + PATCH_IF (%level% > 1) BEGIN + LPF ADD_SPELL_CFEFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5shm-%level%~ END + END + END + PATCH_IF !(MOD_IS_INSTALLED ~tomeandblood.tp2~ ~62~) BEGIN + LPF ADD_SPELL_CFEFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5shm-%level%~ END + END + LPF ADD_SPELL_CFEFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 duration = 0 STR_VAR resource = ~d5yy172~ END + LPF ADD_SPELL_CFEFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5yspld~ END +// LPF ADD_SPELL_CFEFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5yspld~ END + END +// make spells adding the innate spell + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/%give_spell%.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 171 target = 1 timing = 9 STR_VAR resource = EVAL ~%innate_spell%~ END +// make 206 spells preventing the .EFF + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/%block_spell%.spl~ + WRITE_SHORT 0x1c 4 + LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~%give_spell%~ END +// add 206 spells to CLAB spell + COPY_EXISTING ~d5yy206.spl~ ~override~ + LPF DELETE_EFFECT INT_VAR match_opcode = 146 STR_VAR match_resource = EVAL ~%block_spell%~ END + LPF DELETE_EFFECT INT_VAR match_opcode = 321 STR_VAR match_resource = EVAL ~%block_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%block_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~%block_spell%~ END +// make learn spells canceling the 206 + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/%learn_spell%.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~%block_spell%~ END +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 9 STR_VAR resource = EVAL ~%block_spell%~ END +// add 172 to yy172 + COPY_EXISTING ~d5yy172.spl~ ~override~ + LPF ADD_SPELL_EFFECT INT_VAR /*insert_point = 0*/ opcode = 172 target = 1 timing = 1 STR_VAR resource = EVAL ~%innate_spell%~ END +// learn from seq menu + ACTION_IF (FILE_EXISTS_IN_GAME ~%cast_spell%%sorc_suffix%.spl~) BEGIN + COPY_EXISTING ~%cast_spell%%sorc_suffix%.spl~ ~override~ +// LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 171 target = 1 timing = 9 STR_VAR resource = EVAL ~%mem_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = EVAL ~%learn_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5yy172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5yspld~ END + END +// enable spell switching + ACTION_IF (FILE_EXISTS_IN_GAME ~%switch_spell%.spl~) BEGIN + COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/%switch_subspell%.spl~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 target = 1 timing = 1 STR_VAR resource = EVAL ~%learn_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%block_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5yy172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5yspld~ END + COPY_EXISTING ~%switch_spell%.spl~ ~override~ + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~%switch_subspell%~ END + BUT_ONLY + END +// remove all known spells after chargen + COPY_EXISTING ~d5y0spl.spl~ ~override~ + LPF DELETE_EFFECT INT_VAR match_opcode = 172 STR_VAR match_resource = EVAL ~%cast_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 172 target = 1 timing = 1 STR_VAR resource = EVAL ~%cast_spell%~ END + IF_EXISTS +// generate slot#x spells + ACTION_IF (FILE_EXISTS_IN_GAME ~d5ydot%level%a.spl~) BEGIN + COPY_EXISTING ~d5ydot%level%a.spl~ ~override~ + LPF DELETE_EFFECT INT_VAR match_opcode = 146 STR_VAR match_resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + END + ACTION_IF (FILE_EXISTS_IN_GAME ~d5ydot%level%a.spl~) BEGIN + COPY_EXISTING ~d5ydot%level%b.spl~ ~override~ + LPF DELETE_EFFECT INT_VAR match_opcode = 146 STR_VAR match_resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + END + ACTION_IF (FILE_EXISTS_IN_GAME ~d5ydot%level%a.spl~) BEGIN + COPY_EXISTING ~d5ydot%level%c.spl~ ~override~ + LPF DELETE_EFFECT INT_VAR match_opcode = 146 STR_VAR match_resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + END + ACTION_IF (FILE_EXISTS_IN_GAME ~d5ydot%level%a.spl~) BEGIN + COPY_EXISTING ~d5ydot%level%d.spl~ ~override~ + LPF DELETE_EFFECT INT_VAR match_opcode = 146 STR_VAR match_resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~%give_spell%~ END + END END + SET_2DA_ENTRY row 4 cols ~yes~ + END END +BUT_ONLY -END // end function + +END // end define function //__________________________________________________________________________________ @@ -2556,14 +4883,14 @@ ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_MULTI_SORC~)) BEGIN READ_2DA_ENTRY_FORMER rows row 1 ~state_name~ READ_2DA_ENTRY_FORMER rows row 0 ~state_ind~ PATCH_IF (~%state_name%~ STRING_EQUAL_CASE ~D5_MULTI_SORC~) BEGIN - SET multi_sorc_state = %state_ind% + SET semi_sorc_state = %state_ind% END END BUT_ONLY END -ACTION_IF !(VARIABLE_IS_SET %multi_sorc_state%) BEGIN +ACTION_IF !(VARIABLE_IS_SET %semi_sorc_state%) BEGIN LAF d5_resolve_state STR_VAR new_state_id = ~D5_MULTI_SORC~ RET new_state_ind END - OUTER_SET multi_sorc_state = %new_state_ind% + OUTER_SET semi_sorc_state = %new_state_ind% END ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_SEMI_ARCANE~)) BEGIN @@ -2699,9 +5026,10 @@ ACTION_PHP_EACH mage_slot_items AS ind => slot_item BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z_%ind_1%%ind_2%.spl~ LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z#%ind_1%%ind_2%~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xx172~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5ssplz~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xspls~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%%ind_2%~ END END // COPY_EXISTING ~d5b_000.spl~ ~override~ @@ -2740,7 +5068,7 @@ ACTION_PHP_EACH mage_slot_items AS ind => slot_item BEGIN COPY_EXISTING ~%slot_item%.itm~ ~override~ LPF ALTER_EFFECT INT_VAR match_opcode = 42 parameter1 = 1 END // LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%%ind_2%~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%%ind_2%~ END + LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%%ind_2%~ END LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%%ind_2%~ END // LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z#%ind_1%%ind_2%~ END LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%%ind_2%~ END @@ -2789,9 +5117,10 @@ Weight: 0~ COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z_%ind_1%1.spl~ LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z#%ind_1%1~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xx172~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5ssplz~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xspls~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%1~ END END COPY_EXISTING ~d5zlots.spl~ ~override~ @@ -2801,7 +5130,7 @@ Weight: 0~ COPY_EXISTING ~%slot_item%.itm~ ~override~ LPF CLONE_EFFECT INT_VAR match_opcode = 42 match_parameter2 = 0 parameter1 = 1 parameter2 = 1 END // LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%1~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%1~ END + LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%1~ END LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%1~ END // LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%1~ END LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 2 STR_VAR resource = EVAL ~d5z_%ind_1%1~ END @@ -2819,9 +5148,10 @@ Weight: 0~ COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z_%ind_1%2.spl~ LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z#%ind_1%2~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xx172~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5ssplz~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xspls~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%2~ END END COPY_EXISTING ~d5zlots.spl~ ~override~ @@ -2831,7 +5161,7 @@ Weight: 0~ COPY_EXISTING ~%slot_item%.itm~ ~override~ LPF CLONE_EFFECT INT_VAR match_opcode = 42 match_parameter2 = 0 parameter1 = 1 parameter2 = 2 END // LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%2~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%2~ END + LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%2~ END LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%2~ END // LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%2~ END LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 2 STR_VAR resource = EVAL ~d5z_%ind_1%2~ END @@ -2849,9 +5179,10 @@ Weight: 0~ COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z_%ind_1%3.spl~ LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z#%ind_1%3~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xx172~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5ssplz~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xspls~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%3~ END END COPY_EXISTING ~d5zlots.spl~ ~override~ @@ -2861,7 +5192,7 @@ Weight: 0~ COPY_EXISTING ~%slot_item%.itm~ ~override~ LPF CLONE_EFFECT INT_VAR match_opcode = 42 match_parameter2 = 0 parameter1 = 1 parameter2 = 4 END // LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%3~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%3~ END + LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%3~ END LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%3~ END // LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%3~ END LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 2 STR_VAR resource = EVAL ~d5z_%ind_1%3~ END @@ -2879,9 +5210,10 @@ Weight: 0~ COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z_%ind_1%4.spl~ LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z#%ind_1%4~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xx172~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5ssplz~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xspls~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%4~ END END COPY_EXISTING ~d5zlots.spl~ ~override~ @@ -2891,7 +5223,7 @@ Weight: 0~ COPY_EXISTING ~%slot_item%.itm~ ~override~ LPF CLONE_EFFECT INT_VAR match_opcode = 42 match_parameter2 = 0 parameter1 = 1 parameter2 = 8 END // LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%4~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%4~ END + LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%4~ END LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%4~ END // LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%4~ END LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 2 STR_VAR resource = EVAL ~d5z_%ind_1%4~ END @@ -2909,9 +5241,10 @@ Weight: 0~ COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z_%ind_1%5.spl~ LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z#%ind_1%5~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xx172~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5ssplz~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xspls~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%5~ END END COPY_EXISTING ~d5zlots.spl~ ~override~ @@ -2921,7 +5254,7 @@ Weight: 0~ COPY_EXISTING ~%slot_item%.itm~ ~override~ LPF CLONE_EFFECT INT_VAR match_opcode = 42 match_parameter2 = 0 parameter1 = 1 parameter2 = 16 END // LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%5~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%5~ END + LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%5~ END LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%5~ END // LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%5~ END LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 2 STR_VAR resource = EVAL ~d5z_%ind_1%5~ END @@ -2939,9 +5272,10 @@ Weight: 0~ COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z_%ind_1%6.spl~ LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z#%ind_1%6~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xx172~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5ssplz~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xspls~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%6~ END END COPY_EXISTING ~d5zlots.spl~ ~override~ @@ -2951,7 +5285,7 @@ Weight: 0~ COPY_EXISTING ~%slot_item%.itm~ ~override~ LPF CLONE_EFFECT INT_VAR match_opcode = 42 match_parameter2 = 0 parameter1 = 1 parameter2 = 32 END // LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%6~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%6~ END + LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%6~ END LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%6~ END // LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%6~ END LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 2 STR_VAR resource = EVAL ~d5z_%ind_1%6~ END @@ -2969,9 +5303,10 @@ Weight: 0~ COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z_%ind_1%7.spl~ LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z#%ind_1%7~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xx172~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5ssplz~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xspls~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%7~ END END COPY_EXISTING ~d5zlots.spl~ ~override~ @@ -2981,7 +5316,7 @@ Weight: 0~ COPY_EXISTING ~%slot_item%.itm~ ~override~ LPF CLONE_EFFECT INT_VAR match_opcode = 42 match_parameter2 = 0 parameter1 = 1 parameter2 = 64 END // LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%7~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%7~ END + LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%7~ END LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%7~ END // LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%7~ END LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 2 STR_VAR resource = EVAL ~d5z_%ind_1%7~ END @@ -2999,9 +5334,10 @@ Weight: 0~ COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z_%ind_1%8.spl~ LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z#%ind_1%8~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xx172~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5ssplz~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xspls~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%8~ END END COPY_EXISTING ~d5zlots.spl~ ~override~ @@ -3011,7 +5347,7 @@ Weight: 0~ COPY_EXISTING ~%slot_item%.itm~ ~override~ LPF CLONE_EFFECT INT_VAR match_opcode = 42 match_parameter2 = 0 parameter1 = 1 parameter2 = 128 END // LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%8~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%8~ END + LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%8~ END LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%8~ END // LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%8~ END LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 2 STR_VAR resource = EVAL ~d5z_%ind_1%8~ END @@ -3029,9 +5365,10 @@ Weight: 0~ COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z_%ind_1%9.spl~ LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z#%ind_1%9~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xx172~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5ssplz~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xspls~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z_%ind_1%9~ END END COPY_EXISTING ~d5zlots.spl~ ~override~ @@ -3041,7 +5378,7 @@ Weight: 0~ COPY_EXISTING ~%slot_item%.itm~ ~override~ LPF CLONE_EFFECT INT_VAR match_opcode = 42 match_parameter2 = 0 parameter1 = 1 parameter2 = 256 END // LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 146 target = 1 parameter2 = 1 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%9~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%9~ END + LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%9~ END LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 STR_VAR resource = EVAL ~d5z#%ind_1%9~ END // LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z_%ind_1%9~ END LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 206 target = 1 parameter1 = (0 - 1) timing = 2 STR_VAR resource = EVAL ~d5z_%ind_1%9~ END @@ -3050,9 +5387,11 @@ Weight: 0~ */ COPY_EXISTING ~%slot_item%.itm~ ~override~ LPF DELETE_EFFECT INT_VAR match_opcode = 42 match_parameter2 = 0 END - LPF ADD_ITEM_EFFECT INT_VAR type = 3 opcode = 146 target = 1 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END - LPF ADD_ITEM_EFFECT INT_VAR type = 3 opcode = 146 target = 1 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END - LPF ADD_ITEM_EFFECT INT_VAR type = 3 opcode = 146 target = 1 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END + LPF ADD_ITEM_EFFECT INT_VAR type = 3 opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END + LPF ADD_ITEM_EFFECT INT_VAR type = 3 opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xx172~ END + LPF ADD_ITEM_EFFECT INT_VAR type = 3 opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END + LPF ADD_ITEM_EFFECT INT_VAR type = 3 opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END + LPF ADD_ITEM_EFFECT INT_VAR type = 3 opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xspls~ END IF_EXISTS BUT_ONLY END // end if spell-doubling @@ -3060,14 +5399,16 @@ Weight: 0~ // LPF DELETE_EFFECT INT_VAR match_opcode = 321 STR_VAR resource = ~d5z_000~ END // LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5z_000~ END LPF DELETE_EFFECT INT_VAR match_opcode = 326 STR_VAR match_resource = ~d5zz172~ END + LPF DELETE_EFFECT INT_VAR match_opcode = 326 STR_VAR match_resource = ~d5xx172~ END LPF DELETE_EFFECT INT_VAR match_opcode = 326 STR_VAR match_resource = ~d5zspld~ END LPF DELETE_EFFECT INT_VAR match_opcode = 326 STR_VAR match_resource = ~d5zspla~ END - LPF DELETE_EFFECT INT_VAR match_opcode = 326 STR_VAR match_resource = ~d5ssplz~ END + LPF DELETE_EFFECT INT_VAR match_opcode = 326 STR_VAR match_resource = ~d5xspls~ END // LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = (0 - 1) opcode = 146 target = 1 parameter2 = 1 timing = 4 duration = 1 STR_VAR resource = ~d5zsplz~ END LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = (0 - 1) opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5zz172~ END + LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = (0 - 1) opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5xx172~ END LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = (0 - 1) opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = (0 - 1) opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = (0 - 1) opcode = 326 target = 1 parameter1 = %multi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5ssplz~ END + LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = (0 - 1) opcode = 326 target = 1 parameter1 = %semi_sorc_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5xspls~ END IF_EXISTS BUT_ONLY END END @@ -3163,6 +5504,26 @@ ACTION_IF !(VARIABLE_IS_SET %semi_spont_arcane%) BEGIN OUTER_SET semi_spont_arcane = %new_state_ind% END +ACTION_IF (FILE_CONTAINS_EVALUATED (~splstate.ids~ ~D5_SEMI_SHAM~)) BEGIN + COPY_EXISTING ~splstate.ids~ ~override~ + COUNT_2DA_COLS cols + READ_2DA_ENTRIES_NOW rows cols + FOR (row = 1; row < rows; ++row) BEGIN + READ_2DA_ENTRY_FORMER rows row 1 ~state_name~ + READ_2DA_ENTRY_FORMER rows row 0 ~state_ind~ + PATCH_IF (~%state_name%~ STRING_EQUAL_CASE ~D5_SEMI_SHAM~) BEGIN + SET semi_sham_state = %state_ind% + END + END + BUT_ONLY +END +ACTION_IF !(VARIABLE_IS_SET %semi_sham_state%) BEGIN + LAF d5_resolve_state STR_VAR new_state_id = ~D5_SEMI_SHAM~ RET new_state_ind END + OUTER_SET semi_sham_state = %new_state_ind% +END + +// ***** add shamclers from fnp below + OUTER_SET generic_ind = 1 OUTER_SET priestslot_item_ind = 1 OUTER_TEXT_SPRINT $priest_slot_items(~0~ ~0~ ~0~ ~0~) ~item~ @@ -3247,9 +5608,17 @@ ACTION_PHP_EACH priest_slot_items AS ind => slot_item BEGIN ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z-%ind_1%%ind_2%.spl~) BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z-%ind_1%%ind_2%.spl~ LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z!%ind_1%%ind_2%~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5zz172~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END +// PATCH_IF (FILE_EXISTS_IN_GAME ~d5yspld.spl~) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5yy172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5yspld~ END +// END +// PATCH_IF (FILE_EXISTS_IN_GAME ~d5shplz.spl~) BEGIN +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5sh172~ END +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5shplz~ END +// END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%%ind_2%~ END END // COPY_EXISTING ~d5b_000.spl~ ~override~ @@ -3305,9 +5674,17 @@ ACTION_PHP_EACH priest_slot_items AS ind => slot_item BEGIN ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z-%ind_1%1.spl~) BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z-%ind_1%1.spl~ LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z!%ind_1%1~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5zz172~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END +// PATCH_IF (FILE_EXISTS_IN_GAME ~d5yspld.spl~) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5yy172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5yspld~ END +// END +// PATCH_IF (FILE_EXISTS_IN_GAME ~d5shplz.spl~) BEGIN +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5sh172~ END +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5shplz~ END +// END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%1~ END END COPY_EXISTING ~d5zlots.spl~ ~override~ @@ -3332,9 +5709,17 @@ ACTION_PHP_EACH priest_slot_items AS ind => slot_item BEGIN ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z-%ind_1%2.spl~) BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z-%ind_1%2.spl~ LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z!%ind_1%2~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5zz172~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END +// PATCH_IF (FILE_EXISTS_IN_GAME ~d5yspld.spl~) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5yy172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5yspld~ END +// END +// PATCH_IF (FILE_EXISTS_IN_GAME ~d5shplz.spl~) BEGIN +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5sh172~ END +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5shplz~ END +// END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%2~ END END COPY_EXISTING ~d5zlots.spl~ ~override~ @@ -3359,9 +5744,17 @@ ACTION_PHP_EACH priest_slot_items AS ind => slot_item BEGIN ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z-%ind_1%3.spl~) BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z-%ind_1%3.spl~ LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z!%ind_1%3~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5zz172~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END +// PATCH_IF (FILE_EXISTS_IN_GAME ~d5yspld.spl~) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5yy172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5yspld~ END +// END +// PATCH_IF (FILE_EXISTS_IN_GAME ~d5shplz.spl~) BEGIN +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5sh172~ END +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5shplz~ END +// END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%3~ END END COPY_EXISTING ~d5zlots.spl~ ~override~ @@ -3386,9 +5779,17 @@ ACTION_PHP_EACH priest_slot_items AS ind => slot_item BEGIN ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z-%ind_1%4.spl~) BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z-%ind_1%4.spl~ LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z!%ind_1%4~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5zz172~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END +// PATCH_IF (FILE_EXISTS_IN_GAME ~d5yspld.spl~) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5yy172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5yspld~ END +// END +// PATCH_IF (FILE_EXISTS_IN_GAME ~d5shplz.spl~) BEGIN +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5sh172~ END +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5shplz~ END +// END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%4~ END END COPY_EXISTING ~d5zlots.spl~ ~override~ @@ -3413,9 +5814,17 @@ ACTION_PHP_EACH priest_slot_items AS ind => slot_item BEGIN ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z-%ind_1%5.spl~) BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z-%ind_1%5.spl~ LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z!%ind_1%5~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5zz172~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END +// PATCH_IF (FILE_EXISTS_IN_GAME ~d5yspld.spl~) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5yy172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5yspld~ END +// END +// PATCH_IF (FILE_EXISTS_IN_GAME ~d5shplz.spl~) BEGIN +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5sh172~ END +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5shplz~ END +// END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%5~ END END COPY_EXISTING ~d5zlots.spl~ ~override~ @@ -3440,9 +5849,17 @@ ACTION_PHP_EACH priest_slot_items AS ind => slot_item BEGIN ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z-%ind_1%6.spl~) BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z-%ind_1%6.spl~ LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z!%ind_1%6~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5zz172~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END +// PATCH_IF (FILE_EXISTS_IN_GAME ~d5yspld.spl~) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5yy172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5yspld~ END +// END +// PATCH_IF (FILE_EXISTS_IN_GAME ~d5shplz.spl~) BEGIN +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5sh172~ END +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5shplz~ END +// END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%6~ END END COPY_EXISTING ~d5zlots.spl~ ~override~ @@ -3467,9 +5884,17 @@ ACTION_PHP_EACH priest_slot_items AS ind => slot_item BEGIN ACTION_IF !(FILE_EXISTS_IN_GAME ~d5z-%ind_1%7.spl~) BEGIN COPY ~%MOD_FOLDER%/lib/semi_spont/d5_base.spl~ ~override/d5z-%ind_1%7.spl~ LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = EVAL ~d5z!%ind_1%7~ END - LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5zz172~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_spont_arcane% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspla~ END +// PATCH_IF (FILE_EXISTS_IN_GAME ~d5yspld.spl~) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5yy172~ END + LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5yspld~ END +// END +// PATCH_IF (FILE_EXISTS_IN_GAME ~d5shplz.spl~) BEGIN +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5sh172~ END +// LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5shplz~ END +// END LPF ADD_SPELL_EFFECT INT_VAR opcode = 206 target = 1 parameter1 = (0 - 1) timing = 1 STR_VAR resource = EVAL ~d5z-%ind_1%7~ END END COPY_EXISTING ~d5zlots.spl~ ~override~ @@ -3492,8 +5917,16 @@ ACTION_PHP_EACH priest_slot_items AS ind => slot_item BEGIN // LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = 0 opcode = 321 target = 1 timing = 9 STR_VAR resource = ~d5b_000~ END LPF DELETE_EFFECT INT_VAR match_opcode = 326 STR_VAR match_resource = ~d5zz172~ END LPF DELETE_EFFECT INT_VAR match_opcode = 326 STR_VAR match_resource = ~d5zspld~ END - LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = (0 - 1) opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zz172~ END + LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = (0 - 1) opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5zz172~ END LPF ADD_ITEM_EQEFFECT INT_VAR insert_point = (0 - 1) opcode = 326 target = 1 parameter1 = %semi_spont_divine% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5zspld~ END +// PATCH_IF (FILE_EXISTS_IN_GAME ~d5yspld.spl~) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR insert_point = (0 - 1) opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5yy172~ END + LPF ADD_SPELL_EFFECT INT_VAR insert_point = (0 - 1) opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5yspld~ END +// END +// PATCH_IF (FILE_EXISTS_IN_GAME ~d5shplz.spl~) BEGIN +// LPF ADD_SPELL_EFFECT INT_VAR insert_point = (0 - 1) opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 1 duration = 0 STR_VAR resource = ~d5sh172~ END +// LPF ADD_SPELL_EFFECT INT_VAR insert_point = (0 - 1) opcode = 326 target = 1 parameter1 = %semi_sham_state% parameter2 = 110 timing = 4 duration = 1 STR_VAR resource = ~d5shplz~ END +// END IF_EXISTS BUT_ONLY END END diff --git a/TomeAndBlood/qd_tnb_settings.ini b/TomeAndBlood/qd_tnb_settings.ini index e8dd66a..34f9aa7 100644 --- a/TomeAndBlood/qd_tnb_settings.ini +++ b/TomeAndBlood/qd_tnb_settings.ini @@ -11,7 +11,12 @@ DEFINE_ACTION_MACRO identify_spell_level BEGIN - OUTER_SET identify_level = 1 // change to whichever spell level you want Identify to be at + OUTER_SET identify_level = 1 // change to whichever spell level you want Identify to be at END +DEFINE_ACTION_MACRO sorcerer_learning_suffix BEGIN + + OUTER_SPRINT sorcerer_learn_suffix ~w~ // change to whichever spell level you want Identify to be at + +END