From c82d127bcaa6008af7c8dd1de6e164cc304e2f3a Mon Sep 17 00:00:00 2001 From: Zimmermann Gyula Date: Thu, 19 Jan 2023 20:25:30 +0100 Subject: [PATCH] Add Grant Ranger spell slots to Cleric-Rangers. --- zgtweaks/english/setup.tra | 1 + zgtweaks/library/multiclassrangerslots.tpa | 88 +++++++++++++++++++++ zgtweaks/rcslots/zgtcr.spl | Bin 0 -> 154 bytes zgtweaks/rcslots/zgtrl1.eff | Bin 0 -> 272 bytes zgtweaks/rcslots/zgtrl2.eff | Bin 0 -> 272 bytes zgtweaks/rcslots/zgtrl3.eff | Bin 0 -> 272 bytes zgtweaks/rcslots/zgtrl4.eff | Bin 0 -> 272 bytes zgtweaks/rcslots/zgtrl5.eff | Bin 0 -> 272 bytes zgtweaks/rcslots/zgtrl6.eff | Bin 0 -> 272 bytes zgtweaks/rcslots/zgtrl7.eff | Bin 0 -> 272 bytes zgtweaks/zgtweaks.tp2 | 6 ++ 11 files changed, 95 insertions(+) create mode 100644 zgtweaks/library/multiclassrangerslots.tpa create mode 100644 zgtweaks/rcslots/zgtcr.spl create mode 100644 zgtweaks/rcslots/zgtrl1.eff create mode 100644 zgtweaks/rcslots/zgtrl2.eff create mode 100644 zgtweaks/rcslots/zgtrl3.eff create mode 100644 zgtweaks/rcslots/zgtrl4.eff create mode 100644 zgtweaks/rcslots/zgtrl5.eff create mode 100644 zgtweaks/rcslots/zgtrl6.eff create mode 100644 zgtweaks/rcslots/zgtrl7.eff diff --git a/zgtweaks/english/setup.tra b/zgtweaks/english/setup.tra index 1bfe4a9..a4c22fa 100644 --- a/zgtweaks/english/setup.tra +++ b/zgtweaks/english/setup.tra @@ -9,6 +9,7 @@ @7 = ~Add random arcane spell scrolls to divine casters up until their highest memorized level - 4~ @100 = ~Mixed PnP-BG wisdom-based bonus spells table~ +@101 = ~Grant Ranger spell slots to Cleric-Ranger multiclasses~ @1000 = ~This component can only be installed on the Enhanced Edition version of the games.~ @1001 = ~This component can only be installed on the Enhanced Edition and original Baldur's Gate II version of the games.~ diff --git a/zgtweaks/library/multiclassrangerslots.tpa b/zgtweaks/library/multiclassrangerslots.tpa new file mode 100644 index 0000000..9808a58 --- /dev/null +++ b/zgtweaks/library/multiclassrangerslots.tpa @@ -0,0 +1,88 @@ +WITH_SCOPE BEGIN + APPEND ~clabrn01.2da~ ~ZG_CR_RANGER_SPELLSLOTS AP_ZGTCR1 AP_ZGTCR2 AP_ZGTCR3 AP_ZGTCR4 AP_ZGTCR5 AP_ZGTCR6 AP_ZGTCR7 AP_ZGTCR8 AP_ZGTCR9 AP_ZGTCR10 AP_ZGTCR11 AP_ZGTCR12 AP_ZGTCR13 AP_ZGTCR14 AP_ZGTCR15 AP_ZGTCR16 AP_ZGTCR17 AP_ZGTCR18 AP_ZGTCR19 AP_ZGTCR20 AP_ZGTCR21 AP_ZGTCR22 AP_ZGTCR23 AP_ZGTCR24 AP_ZGTCR25 AP_ZGTCR26 AP_ZGTCR27 AP_ZGTCR28 AP_ZGTCR29 AP_ZGTCR30 AP_ZGTCR31 AP_ZGTCR32 AP_ZGTCR33 AP_ZGTCR34 AP_ZGTCR35 AP_ZGTCR36 AP_ZGTCR37 AP_ZGTCR38 AP_ZGTCR39 AP_ZGTCR40 AP_ZGTCR41 AP_ZGTCR42 AP_ZGTCR43 AP_ZGTCR44 AP_ZGTCR45 AP_ZGTCR46 AP_ZGTCR47 AP_ZGTCR48 AP_ZGTCR49 AP_ZGTCR50~ + + COPY_EXISTING ~clabrn01.2da~ ~override~ + // Ensure all table rows have valid number of columns. + // Missing headers are padded by column indices. Missing content is padded by default value. + SET num_added = 0 + COUNT_2DA_COLS num_cols + READ_2DA_ENTRIES_NOW table 1 + READ_2DA_ENTRY_FORMER table 1 0 default + FOR (row = 0; row < table; ++row) BEGIN + READ_2DA_ENTRY_FORMER table row 0 line + FOR (col = 1; col < num_cols && VARIABLE_IS_SET $table(~%row%~ ~%col%~); ++col) BEGIN + READ_2DA_ENTRY_FORMER table row col v + TEXT_SPRINT line ~%line% %v%~ + END + // fill in missing data + PATCH_IF (row = 2) BEGIN // header + FOR (; col < num_cols - 1; ++col) BEGIN + TEXT_SPRINT line ~%line% %col%~ + SET num_added += 1 + END + END ELSE PATCH_IF (row > 2) BEGIN // content + FOR (; col < num_cols; ++col) BEGIN + TEXT_SPRINT line ~%line% %default%~ + SET num_added += 1 + END + END + TEXT_SPRINT $lines(~%row%~) ~%line%%LNL%~ + SET $lines(~%row%~ ~size~) = STRING_LENGTH $lines(~%row%~) + END + + // write normalized table to buffer + PATCH_IF (num_added > 0) BEGIN + DELETE_BYTES 0 BUFFER_LENGTH + FOR (row = 0 pos = 0; row < table; ++row) BEGIN + SET size = $lines(~%row%~ ~size~) + INSERT_BYTES pos size + WRITE_ASCIIE pos $lines(~%row%~) (size) + SET pos += size + END + END + PRETTY_PRINT_2DA + BUT_ONLY + + OUTER_FOR (index = 1; index < 51; ++index) BEGIN + COPY ~zgtweaks\rcslots\zgtcr.spl~ ~override/zgtcr%index%.spl~ + END + + COPY ~zgtweaks\rcslots\zgtrl1.eff~ ~override~ + COPY ~zgtweaks\rcslots\zgtrl2.eff~ ~override~ + COPY ~zgtweaks\rcslots\zgtrl3.eff~ ~override~ + COPY ~zgtweaks\rcslots\zgtrl4.eff~ ~override~ + COPY ~zgtweaks\rcslots\zgtrl5.eff~ ~override~ + COPY ~zgtweaks\rcslots\zgtrl6.eff~ ~override~ + COPY ~zgtweaks\rcslots\zgtrl7.eff~ ~override~ + + OUTER_SET level1 = 0 + OUTER_SET level2 = 0 + OUTER_SET level3 = 0 + OUTER_SET level4 = 0 + OUTER_SET level5 = 0 + OUTER_SET level6 = 0 + OUTER_SET level7 = 0 + + COPY_EXISTING ~mxsplran.2da~ ~override~ + COUNT_2DA_COLS colcount + COUNT_2DA_ROWS colcount rowcount + FOR (row=0; row < rowcount; ++row) BEGIN + READ_2DA_ENTRY row 0 colcount level + FOR (col=1; col < colcount; ++col) BEGIN + READ_2DA_ENTRY row col colcount target + SPRINT levelcol ~level%col%~ + SPRINT effname ~zgtrl%col%~ + SPRINT spellname ~zgtcr%level%.spl~ + INNER_ACTION BEGIN + COPY_EXISTING ~%spellname%~ ~override~ + SET current = (EVAL ~%%levelcol%%~) + FOR (; current < target; ++current) BEGIN + LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 177 target = 1 timing = 9 resist_dispel = 0 power = 0 parameter1 = 18 parameter2 = 5 STR_VAR resource = EVAL ~%effname%~ END + END + SET EVAL ~%levelcol%~ = current + BUT_ONLY + END + END + END + BUT_ONLY +END \ No newline at end of file diff --git a/zgtweaks/rcslots/zgtcr.spl b/zgtweaks/rcslots/zgtcr.spl new file mode 100644 index 0000000000000000000000000000000000000000..4e887f8e3590aa8e7c9f5b3a29b9ed0c9e5c22c7 GIT binary patch literal 154 zcmWFz@KFdeR8aU21ohKqFu=h91|}9b2a~~wDFhb5Fb61F1jLLCv!FT{84%_&0>vRF Lv4LeFY=|fTahDGd literal 0 HcmV?d00001 diff --git a/zgtweaks/rcslots/zgtrl1.eff b/zgtweaks/rcslots/zgtrl1.eff new file mode 100644 index 0000000000000000000000000000000000000000..131a86b070fd18d7adea29ab5062fd878b71e987 GIT binary patch literal 272 tcmZ>Db5jU2(lc;{(sm3C42(bw0w5ZMIYAsCNP$pPCI6!Vsv1s)VF2;a6iomC literal 0 HcmV?d00001 diff --git a/zgtweaks/rcslots/zgtrl2.eff b/zgtweaks/rcslots/zgtrl2.eff new file mode 100644 index 0000000000000000000000000000000000000000..728c4d313d8af4ed0db91114072e8dab0916065a GIT binary patch literal 272 ucmZ>Db5jU2(lc;{(sm3C42(bw0w9_Rh&e$VAV`5wR3-nT0je5KhG78mz!XjZ literal 0 HcmV?d00001 diff --git a/zgtweaks/rcslots/zgtrl3.eff b/zgtweaks/rcslots/zgtrl3.eff new file mode 100644 index 0000000000000000000000000000000000000000..2f2f6fad0a32588aaddcfbe25d83404560a3c980 GIT binary patch literal 272 ucmZ>Db5jU2(lc;{(sm3C42(bw0w9_Nh&e$VAV`5wR3-nT0je5KhG78opcGI5 literal 0 HcmV?d00001 diff --git a/zgtweaks/rcslots/zgtrl4.eff b/zgtweaks/rcslots/zgtrl4.eff new file mode 100644 index 0000000000000000000000000000000000000000..b93d6ab7f115c6738fbe8465101fb1f6df3769fa GIT binary patch literal 272 ucmZ>Db5jU2(lc;{(sm3C42(bw0w9_Lh&e$VAV`5wR3-nT0je5KhG78sU=&mU literal 0 HcmV?d00001 diff --git a/zgtweaks/rcslots/zgtrl5.eff b/zgtweaks/rcslots/zgtrl5.eff new file mode 100644 index 0000000000000000000000000000000000000000..57c345f3e595e907aca0e6b859cd07f31ca99790 GIT binary patch literal 272 ucmZ>Db5jU2(lc;{(sm3C42(bw0w7udh&e$VAV`5wR3-nT0je5KhG78z;1pZ{ literal 0 HcmV?d00001 diff --git a/zgtweaks/rcslots/zgtrl6.eff b/zgtweaks/rcslots/zgtrl6.eff new file mode 100644 index 0000000000000000000000000000000000000000..78c4237805ccbf735eaf10cc06cb39472fa6b930 GIT binary patch literal 272 ucmZ>Db5jU2(lc;{(sm3C42(bw0w7ueh&h261X3UrRmuNofU1U*VHf}o?-XnR literal 0 HcmV?d00001 diff --git a/zgtweaks/rcslots/zgtrl7.eff b/zgtweaks/rcslots/zgtrl7.eff new file mode 100644 index 0000000000000000000000000000000000000000..38244bc1f84078129bd0a3f9e4d68e27b9dc3a21 GIT binary patch literal 272 ucmZ>Db5jU2(lc;{(sm3C42(bw0wCG}h&h261X3UrRmuNofU1U*VHf}`?-Yyx literal 0 HcmV?d00001 diff --git a/zgtweaks/zgtweaks.tp2 b/zgtweaks/zgtweaks.tp2 index bf1dab6..62e2bad 100644 --- a/zgtweaks/zgtweaks.tp2 +++ b/zgtweaks/zgtweaks.tp2 @@ -313,6 +313,12 @@ DESIGNATED 100 COPY ~%MOD_FOLDER%/2da/mxsplwis.2da~ ~override~ +BEGIN @101 +LABEL ZG-MULTICLASS-RANGER-SLOTS +DESIGNATED 101 + + INCLUDE ~zgtweaks\library\multiclassrangerslots.tpa~ + BEGIN @1010 LABEL ZG-IWD2-WORGS DESIGNATED 1000