-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added component that applies improved Shamanic Dance behavior to avai…
…lable Shaman kits
- Loading branch information
Showing
9 changed files
with
178 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
// *** Installs component "Apply Shamanic Dance improvements to Shaman kits" *** | ||
|
||
// getting class id for Shaman | ||
COPY_EXISTING ~clastext.2da~ ~override~ | ||
LPF FIND_2DA_VALUE | ||
INT_VAR | ||
column = 1 | ||
search_column = 0 | ||
STR_VAR | ||
search_text = ~SHAMAN~ | ||
RET | ||
row | ||
value | ||
END | ||
BUT_ONLY | ||
|
||
ACTION_IF (IS_AN_INT ~value~ && value > 0) BEGIN | ||
OUTER_SET classID = value | ||
|
||
// getting CLAB files from available Shaman kits | ||
OUTER_SET kitlist = 0 | ||
COPY_EXISTING ~kitlist.2da~ ~override~ | ||
SET row = 0 | ||
WHILE (row >= 0) BEGIN | ||
LPF FIND_2DA_VALUE | ||
INT_VAR | ||
start_row = row | ||
column = 5 | ||
search_column = 8 | ||
STR_VAR | ||
search_text = EVAL ~%classID%~ | ||
RET | ||
row | ||
value | ||
END | ||
|
||
PATCH_IF (row >= 0) BEGIN | ||
PATCH_IF (FILE_EXISTS_IN_GAME ~%value%.2DA~) BEGIN | ||
TEXT_SPRINT EVAL ~kitlist_%kitlist%~ ~%value%~ | ||
SET kitlist += 1 | ||
END | ||
SET row += 1 | ||
END | ||
END | ||
BUT_ONLY | ||
|
||
// updating Shaman Dance behavior | ||
OUTER_FOR (idx = 0; idx < kitlist; ++idx) BEGIN | ||
OUTER_TEXT_SPRINT table_resref EVAL ~%kitlist_%idx%%~ | ||
COPY_EXISTING ~%table_resref%.2DA~ ~override~ | ||
COUNT_2DA_COLS numCols | ||
COUNT_2DA_ROWS numCols numRows | ||
// scanning CLAB table for AP_ entries | ||
FOR (row = 0; row < numRows; ++row) BEGIN | ||
TEXT_SPRINT spl_resref ~~ | ||
READ_2DA_ENTRY row 1 numCols value | ||
PATCH_IF (~%value%~ STRING_MATCHES_REGEXP ~AP_.*~ = 0) BEGIN | ||
INNER_PATCH_SAVE resref ~%value%~ BEGIN REPLACE_TEXTUALLY ~AP_~ ~~ END | ||
PATCH_IF (FILE_EXISTS_IN_GAME ~%resref%.SPL~) BEGIN | ||
INNER_ACTION BEGIN | ||
// scanning AP_ spell for "Change Bard Song" resref | ||
COPY_EXISTING ~%resref%.SPL~ ~override~ | ||
READ_LONG 0x64 ofsAbils | ||
READ_SHORT 0x68 numAbils | ||
READ_LONG 0x6a ofsFx | ||
READ_SHORT 0x6e firstFxGlobal | ||
READ_SHORT 0x70 numFxGlobal | ||
|
||
FOR (idxFx = 0; idxFx < numFxGlobal; ++idxFx) BEGIN | ||
SET ofs = ofsFx + (firstFxGlobal + idxFx) * 0x30 | ||
READ_SHORT ofs opcode | ||
PATCH_IF (opcode = 251) BEGIN // Change Bard Song | ||
READ_ASCII (ofs + 0x14) spl_resref (8) NULL | ||
SET idxFx = numFxGlobal | ||
END | ||
END | ||
|
||
PATCH_IF (~%spl_resref%~ STR_EQ ~~) BEGIN | ||
FOR (idxAbil = 0; idxAbil < numAbils; ++idxAbil) BEGIN | ||
SET ofs = ofsAbils + idxAbil * 0x28 | ||
READ_SHORT (ofs + 0x1e) numFx | ||
READ_SHORT (ofs + 0x20) firstFx | ||
FOR (idxFx = 0; idxFx < numFx; ++idxFx) BEGIN | ||
SET ofs2 = ofsFx + (firstFx + idxFx) * 0x30 | ||
READ_SHORT ofs2 opcode | ||
PATCH_IF (opcode = 251) BEGIN // Change Bard Song | ||
READ_ASCII (ofs2 + 0x14) spl_resref (8) NULL | ||
SET idxFx = numFx | ||
SET idxAbil = numAbils | ||
END | ||
END | ||
END | ||
END | ||
BUT_ONLY | ||
END | ||
END | ||
|
||
PATCH_IF (FILE_EXISTS_IN_GAME ~%spl_resref%.SPL~) BEGIN | ||
INNER_ACTION BEGIN | ||
// updating Shaman Dance behavior | ||
COPY_EXISTING ~%spl_resref%.SPL~ ~override~ | ||
LPF DELETE_SPELL_EFFECT | ||
INT_VAR opcode_to_delete = 363 // Movement rate check | ||
END | ||
BUT_ONLY | ||
END | ||
END | ||
END | ||
END | ||
BUT_ONLY | ||
END | ||
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters