Skip to content

#19973 Psionic Life Drain should not result in an uninjured caster losing hp from their new maximum

MusignyMusigny Member Posts: 1,027
edited February 2016 in BGII:EE Bugs (v1.3.2064)
@Gate70

A minor defect detected while modding (as opposed to playing) but unrelated to any mod.

Spin545.spl looks like a copy of the former spwi119 spell (Larloch's minor drain).

Whilst spwi119 and spin104 were modified by the G3 fixpack and BG2EE, spin545 was left unmodified.
It does not use a two phases casting like the other spells: cast the spell (with a projectile) with opcode 146 as the main effect which casts a second spell (projectileless) with the wanted effects (damage, modify max and current hitpoints). As a result there are weird effects such as directly and incorrectly modifying the health status (uninjured / barely etc...). I don't want to comment on how effect #18 is to be managed in general but here a 100% healthy creature casting the spell will move its status from uninjured to barely injured while actually increasing its hitpoints.
The caster is healed even if the target resisted the spell.
Moreover the original range is really short (like the former spwi119 range, 10 instead of more regular 30)

The unmodded game uses the spell in Watcher's Keep level 4 Githyankis sector. The Giths can cast it when reaching 50% of their healthpoints (which may help the phenomenon to go unnoticed).
Post edited by Gate70 on

Comments

  • Gate70Gate70 Member, Developer Posts: 3,871
    I've had a quick look via ForceSpell(NearestEnemyOf(Myself),PSIONIC_LIFE_DRAIN), details below. Will look in more detail when I get chance.

    Protagonist with 122hp.
    Minsc with 69hp.
    Jaheira with 51hp.

    Have Minsc use the spell on the protagonist;
    - Protagonist retains 122hp due to magic resistance.
    - Minsc with 75/80hp.
    - Protagonist lost 0hp
    - Minsc gained 6hp with his total hp raised by 11


    Have Jaheira use the spell on Minsc instead;
    - Jaheira with 57/59hp.
    - Minsc with 64/69hp.
    - Jaheira gained 6hp with her total raised by 8
    - Minsc lost 5hp
  • MusignyMusigny Member Posts: 1,027
    I will provide you with a more detail use case for the first point (health status report) - On Tuesday because I reached my BG testing saturation point :smile: - too much modding.
    I don't know how you guys at Beamdog are able to continuously test and qualify the game.

    Your own case illustrates the decorrelation between the target magic resistance and the restore HP. The variation between damage and restore hitpoints is due to the formula used for the two effects : constant + 1d6. There is also a point about the declared spell range but that's not the most important.
  • kjeronkjeron Member Posts: 2,367
    @Gate70
    Opcode 18 does not take dice values in the same manner as opcode 12 or 17. You can really see just how broken this opcode is if you recast it multiple times before the previous expires.
    With 1d6 + 4:
    Cast once - Caster gains 2d6 + 4 HP
    Cast again - Caster gains another 4d6 + 4 HP
    Cast again - Caster gains another 6d6 + 4 HP

    When non-zero dice values are set, they are doubled, and cumulative with the dice values of each active use. This only applies to the Maximum HP increase, Current HP is increased normally.

    Best seen by reversing the dice values: 6d1 + 4
    1st Cast - Caster gains 2 * (6d1) + 4 = +16
    2nd Cast - Caster gains 2 * (6d1 + 6d1) + 4 = +28, +44 total
    3rd Cast - Caster gains 2 * (6d1 + 6d1 + 6d1) + 4 = +40, +84 total
    4th Cast - Caster gains 2 * (6d1 + 6d1 + 6d1 + 6d1) + 4 = +52, +136 total

    Setting a negative dice size results in a maximum roll as if it were positive.
    Setting a negative dice number crashes.
  • CamDawgCamDawg Member, Developer Posts: 3,438
    @gate70
    Log two issues here. spin545 definitely needs the two-stage casting of LMD (and other fixes) and op 18 needs investigation w.r.t. double dice rolls.

    @kjeron
    Just to be thorough, what parameter2 value are you using in your testing, and what difficulty level?
  • kjeronkjeron Member Posts: 2,367
    CamDawg said:


    @kjeron
    Just to be thorough, what parameter2 value are you using in your testing, and what difficulty level?

    Core rules
    Parameter2 = 0, didn't change it
  • Gate70Gate70 Member, Developer Posts: 3,871
    OK, two tickets raised and hopefully got the gist of it from the scenarios below.

    #19973 Psionic Life Drain should not result in an uninjured caster losing hp from their new maximum
    Mentions two stage casting, hit points, magic resistance, casting range.

    #19974 Psionic Life Drain should not drain increasing amounts each time it is cast
    Opcode 18 dice rolls.
Sign In or Register to comment.