Skip to content

[HELP] Cloak of Mirroring - restore original behavior

AndreaColomboAndreaColombo Member Posts: 5,530
Hello.

I would like to restore the original behavior the Cloak of Mirroring had in Shadows of Amn, where it actually reflected hostile single-target spells back at the caster (along with a fancy animation that showed the mirroring effect with the spell being bounced back.)

Unfortunately I no longer possess a ToB-free copy of the game so I cannot back and check how the item was set up originally. Is anybody able to check and let me know?

Comments

  • jmerryjmerry Member Posts: 3,881
    I can't say how it was originally done, but reflecting spells would be done with opcode 197 in the current version of the game. See, for example, the cloak of reflection or the shield of Balduran.

    So in order to reflect single-target spells, you'd have to go through the list of spells you want to reflect and find what projectiles they use, then apply a 197 effect for each of those projectiles. Presumably, instead of the current immunity to all spells of the "offensive damage" type.
  • AndreaColomboAndreaColombo Member Posts: 5,530
    edited April 2021
    Thank you, @jmerry .

    It looks like the original used opcode 203 to reflect spells back to the caster.

    The EE cloak is using opcode 205 plus protection from 15 individual spells.

    I could replace opcode 205 with 203 and protection from those spells to reflection of their projectiles.

    My WeiDU is very rusty; would something like this work?
    ACTION_IF (FILE_EXISTS_IN_GAME ~clck26.itm~) THEN BEGIN
    COPY_EXISTING ~clck26.itm~ ~override~
    PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN // protects against invalid files
    	WRITE_ASCII 0x72 ~203~		// replace opcode 205 with 203
    	WRITE_ASCII 0xa2 ~197~ 	// replace opcode 206 with 197
    		WRITE_ASCII 0xaa ~81~	// set projectile 81 for opcode 197
      END
      BUT_ONLY_IF_IT_CHANGES
      END
    

    EDIT: perhaps this is better
    ACTION_IF (FILE_EXISTS_IN_GAME ~clck26.itm~) THEN BEGIN
    COPY_EXISTING ~clck26.itm~ ~override~
    LPF ALTER_ITEM_EFFECT
    INT_VAR
    check_globals = 0
    match_opcode = 203
    END
    BUT_ONLY
    END
    

    Just not sure I'm doing it right. In CLCK26.ITM, Effect 0 is opcode 205, which I want to replace with 203. Will this code do it?

    If yes, I can then change the number if check_globals and match all others to 197 and add the projectile within INT_VAR too.
  • jmerryjmerry Member Posts: 3,881
    I don't know. Try it. Or just edit the item file directly in NI for testing purposes. I'm not aware of anything that currently uses opcode 203, so there's no guarantee it would work at all in the EE.

    Also, note that many of the spells with specific protection are also covered in the general protection; I don't know how that would go if you double-reflected spells. And the "offensive damage" type includes area spells like Fireball and Incendiary Cloud which shouldn't be reflected.
  • AndreaColomboAndreaColombo Member Posts: 5,530
    jmerry wrote: »
    And the "offensive damage" type includes area spells like Fireball and Incendiary Cloud which shouldn't be reflected.

    You sure about that, though?

    I think the original Cloak of Mirroring actually did reflect those too, so if I were to restore it to its original form, that would be the intended behavior.

    Perhaps I won't need the other effects then. I'll see if I can clear them.
  • jmerryjmerry Member Posts: 3,881
    Am I sure about that? Of course not. I only started playing the game two or three years ago, and I've never had anything but the EE.

    And I wasn't quite correct in the examples I gave. Some of the spells on the list of specific protections, like Call Lightning and Holy Smite, have the "Offensive Damage" type. Others, like Cloudkill and Incendiary Cloud, don't. If you're going to clear them, examine them individually.
  • sarevok57sarevok57 Member Posts: 6,002
    jmerry wrote: »
    And the "offensive damage" type includes area spells like Fireball and Incendiary Cloud which shouldn't be reflected.

    You sure about that, though?

    I think the original Cloak of Mirroring actually did reflect those too, so if I were to restore it to its original form, that would be the intended behavior.

    Perhaps I won't need the other effects then. I'll see if I can clear them.

    you are correct, any offensive damaging spell that was directly cast upon a user of the cloak of mirrors would have it's spell reflected back, back in the SoA days, i remember one time i summoned in 6 of them and had 6 wizard cast a bunch of magic missiles, melfs acid arrows and lightning bolts at each other, just to see them infinitely bounce back and forth for all eternity

    good times :)
Sign In or Register to comment.