Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Axis & Allies 1942 Online is now available in Early Access! Buy it on Steam. The FAQ is available.
New Premium Module: Tyrants of the Moonsea! Read More
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

[(BGEE, BG2) bug] Holy smite (0813)

CamDawgCamDawg Member, Developer Posts: 3,394
edited August 2012 in Fixed
By convention, BG2 spells cap at level 20. Holy Smite is capped at level 19, and had some mistargeted/mistimed effects when cast at levels 6 or 7.

Another ugly, old but functional patch.
// holy smite missing level 20 abilities, a few effects mistargeted and/or wrong duration at lev 6, 7
COPY_EXISTING ~sppr313.spl~ ~override~
READ_LONG 0x64 "abil_off"
READ_SHORT 0x68 "abil_num"
READ_LONG 0x6a "fx_off"
SET "orig_abil" = "%abil_num%"
SET "delta" = 0
SET "loops" = 0
SET "min_lev" = 0
WHILE ("%abil_num%" > 0) BEGIN // grabs last ability (lev 19) and does patching for lev 6, 7 abilities
SET "abil_num" = ("%abil_num%" - 1)
READ_SHORT ("%abil_off%" + 0x10 + (0x28 * "%abil_num%")) "level"
PATCH_IF ("%min_lev%" = 0) BEGIN
SET "min_lev" = "%level%" // sets min_lev to use last ability
END
PATCH_IF (("%level%" = 6) OR ("%level%" = 7)) BEGIN
READ_SHORT ("%abil_off%" + 0x1e + (0x28 * "%abil_num%")) "abil_fx_num"
READ_SHORT ("%abil_off%" + 0x20 + (0x28 * "%abil_num%")) "abil_fx_idx"
WHILE ("%abil_fx_num%" > 0) BEGIN
SET "abil_fx_num" = ("%abil_fx_num%" - 1)
READ_ASCII ("%fx_off%" + 0x14 + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%"))) "eff_file"
PATCH_IF ("%eff_file%" STRING_COMPARE_CASE "hitinvwa" = 0) BEGIN
WRITE_BYTE ("%fx_off%" + 0x0c + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%"))) 1 // instant/permanent
END ELSE
PATCH_IF ("%eff_file%" STRING_COMPARE_CASE "blind" = 0) BEGIN
WRITE_BYTE ("%fx_off%" + 0x0c + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%"))) 0 // instant/limited
WRITE_LONG ("%fx_off%" + 0x0e + (0x30 * ("%abil_fx_idx%" + "%abil_fx_num%"))) 6 // duration
END
END
END
END
PATCH_IF ("%min_lev%" < 20) BEGIN
INSERT_BYTES "%fx_off%" 0x28
SET "delta" = 1
READ_ASCII ("%fx_off%" - 0x28) "abil_clone" (0x28) // reads entire ability as block
READ_SHORT (("%fx_off%" - 0x28) + 0x1e) "abil_fx_num"
READ_SHORT (("%fx_off%" - 0x28) + 0x20) "abil_fx_idx"
END
WHILE ("%delta%" > "%loops%") BEGIN // this clones the lev 19 abilities to the lev 20 one
WRITE_EVALUATED_ASCII (("%fx_off%" + (0x28 * "%loops%")) ) "%abil_clone%"
WRITE_SHORT (("%fx_off%" + (0x28 * "%loops%")) + 0x10) ("%min_lev%" + 1 + "%loops%")
WRITE_SHORT (("%fx_off%" + (0x28 * "%loops%")) + 0x1e) "%abil_fx_num%"
WRITE_SHORT (("%fx_off%" + (0x28 * "%loops%")) + 0x20) ("%abil_fx_idx%" + (("%loops%" + 1) * "%abil_fx_num%"))
SET "loops" = ("%loops%" + 1)
END
WRITE_SHORT 0x68 ("%orig_abil%" + "%delta%")
SET "fx_off" = ("%fx_off%" + (0x28 * "%delta%"))
WRITE_LONG 0x6a "%fx_off%"
INSERT_BYTES ("%fx_off%" + (0x30 * ("%abil_fx_num%" + "%abil_fx_idx%"))) (0x30 * ("%delta%" * "%abil_fx_num%"))
WHILE ("%delta%" > 0) BEGIN
SET "loops" = "%abil_fx_num%"
WHILE ("%loops%" > 0) BEGIN
SET "loops" = ("%loops%" - 1)
READ_ASCII ("%fx_off%" + 0x00 + (0x30 * ("%loops%" + "%abil_fx_idx%"))) "clone" (0x30)
WRITE_EVALUATED_ASCII ("%fx_off%" + 0x00 + (0x30 * ("%loops%" + "%abil_fx_idx%")) + ("%delta%" * (0x30 * "%abil_fx_num%"))) "%clone%"
READ_ASCII ("%fx_off%" + 0x14 + (0x30 * ("%loops%" + "%abil_fx_idx%"))) "eff_again"
PATCH_IF ("%eff_again%" STRING_COMPARE_CASE "sp313l19" = 0) BEGIN
WRITE_ASCII ("%fx_off%" + 0x14 + (0x30 * ("%loops%" + "%abil_fx_idx%")) + ("%delta%" * (0x30 * "%abil_fx_num%"))) ~sp313l20~
END ELSE BEGIN
WRITE_EVALUATED_ASCII ("%fx_off%" + 0x14 + (0x30 * ("%loops%" + "%abil_fx_idx%")) + ("%delta%" * (0x30 * "%abil_fx_num%"))) "%eff_again%"
END
END
SET "delta" = ("%delta%" - 1)
END
BUT_ONLY_IF_IT_CHANGES

Post edited by Bhryaen on
AndreaColombo

Comments

Sign In or Register to comment.