Skip to content

[(BGEE, BG2) bug] Hold Monster bugs

CamDawgCamDawg Member, Developer Posts: 3,438
edited September 2012 in Fixed
Hold Monster uses the swirly graphic over the head of its victims, but it disappears after one second. This is fixed, and we add the Hold portrait icon and the 'held' string to the battle text.
// hold monster swirly graphic craps out early; should also set icon and display 'held' string
COPY_EXISTING ~spwi507.spl~ ~override~
READ_LONG 0x64 "abil_off"
READ_SHORT 0x68 "abil_num"
READ_LONG 0x6a "fx_off"
SET "fx_delta" = 0
FOR (index = 0 ; index < abil_num ; index = index + 1 ) BEGIN // cycle thru abilities
READ_SHORT ("%abil_off%" + 0x10 + (0x28 * "%index%")) "min_lev"
PATCH_IF ("%min_lev%" = 1) THEN BEGIN
SET "min_lev" = 9
END
READ_SHORT ("%abil_off%" + 0x1e + (0x28 * "%index%")) "abil_fx_num"
WRITE_SHORT ("%abil_off%" + 0x1e + (0x28 * "%index%")) ("%abil_fx_num%" + 2)
READ_SHORT ("%abil_off%" + 0x20 + (0x28 * "%index%")) "abil_fx_idx"
SET "abil_fx_idx" = ("%abil_fx_idx%" + "%fx_delta%")
WRITE_SHORT ("%abil_off%" + 0x20 + (0x28 * "%index%")) "%abil_fx_idx%"
SET "fx_delta" = ("%fx_delta%" + 2)
// fix duration for swirly graphic while we're here, then clone the effect
FOR (index2 = 0 ; index2 < abil_fx_num ; index2 = index2 + 1) BEGIN
READ_SHORT ("%fx_off%" + (0x30 * ("%index2%" + "%abil_fx_idx%"))) "opcode"
PATCH_IF ("%opcode%" = 215) BEGIN
WRITE_LONG ("%fx_off%" + 0x0e + (0x30 * ("%index2%" + "%abil_fx_idx%"))) (6 * "%min_lev%")
READ_ASCII ("%fx_off%" + (0x30 * ("%index2%" + "%abil_fx_idx%"))) "clone" (48)
END
END
INSERT_BYTES ("%fx_off%" + (0x30 * "%abil_fx_idx%")) 0x30 // new effect
WRITE_ASCIIE ("%fx_off%" + (0x30 * "%abil_fx_idx%")) "%clone%" // use 215 effect as base
WRITE_SHORT ("%fx_off%" + (0x30 * "%abil_fx_idx%")) 142 // display portrait icon
WRITE_LONG ("%fx_off%" + 0x08 + (0x30 * "%abil_fx_idx%")) 13 // icon: held
INSERT_BYTES ("%fx_off%" + (0x30 * "%abil_fx_idx%")) 0x30 // new effect
WRITE_ASCIIE ("%fx_off%" + (0x30 * "%abil_fx_idx%")) "%clone%" // use 215 effect as base
WRITE_SHORT ("%fx_off%" + (0x30 * "%abil_fx_idx%")) 139 // display string
WRITE_LONG ("%fx_off%" + 0x04 + (0x30 * "%abil_fx_idx%")) 14102 // string: held
WRITE_BYTE ("%fx_off%" + 0x0c + (0x30 * "%abil_fx_idx%")) 1 // instant/permanent
WRITE_BYTE ("%fx_off%" + 0x0e + (0x30 * "%abil_fx_idx%")) 0 // duration
END
BUT_ONLY_IF_IT_CHANGES
Post edited by Bhryaen on
AndreaColombo

Comments

  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    Confirmed fixed - sloppy script
    Meh, SPMINDAT is now in resref fields of effects that shouldn't contain it (the string/icon effects)
  • BhryaenBhryaen Member Posts: 2,874
    Confirmed fixed:

    In-game it adds the SPMINDAT over the head of a xvart for the entire duration of the spell whether cast with a scroll or a memorized spell. Plus the display string "Held" shows up as well both ways. Not sure about the icon, but I'm not sure when a monster will be part of the party anyway.
Sign In or Register to comment.