Skip to content

[Known #7323] Sunfire and the AI

GalactygonGalactygon Member, Developer Posts: 412
edited September 2014 in BGII:EE Bugs (v1.2.2030)
Observed behavior: Often Sunfire ends up inflicting damage to the caster without damaging the target when the AI attempts to use it by walking up to the target.

Expected behavior: Sunfire should not inflict any damage onto the caster regardless of use.

How to reproduce this: Either move to area AR5011 or CLUA 25SPELL.cre and then attack him. Eventually he will walk up to one of the party members and attempt a Sunfire. The Sunfire will then damage him and not the target.

Explanation: The projectile of sunfire is set to FIREBLNS.pro (Fireball Ignore Center). This means the target center of the explosion is not affected. This works fine when the target is self (when the player casts it), however the AI usually casts it on a hostile creature to make sure they get close enough to deal damage. Because of the nature of the projectile, what happens is that the target becomes the center of the explosion which is ignored while the caster suffers the effects of the spell.

Possible solution1: Change or create a new projectile that uses a 360 degree cone shape explosion guaranteeing that the caster is never hit, but the center of explosion is always at the caster (may or may not be intended depending on the AI). Attached is a modified version of FIREBLNS.pro, simply place it into the override folder. However it will not work like a fireball ignore center anymore if other .spl files use this .pro differently so I suggest making a new .pro file and have SPWI523 call that .pro file. The only weakness here is that smart players can easily outrun and move away from the caster as (s)he starts the spell, giving several seconds before the explosion goes off.

Possible solution2: introduce a new flag in the .pro file format, preferrably at 0x0000c (because it already has a "do not affect direct target") called "do not affect source" and use that bit in the .pro file to exclude the caster. I prefer this solution because it cannot be abused.
Post edited by Illydth on

Comments

  • MathsorcererMathsorcerer Member Posts: 3,037
    edited August 2014
    The problem isn't the spell; rather, the problem is with Lazarus' script. This block

    IF
    See(NearestEnemyOf(Myself))
    HaveSpell(WIZARD_SUN_FIRE) // SPWI523.SPL (Sunfire)
    THEN
    RESPONSE #100
    Spell(NearestEnemyOf(Myself),WIZARD_SUN_FIRE) // SPWI523.SPL (Sunfire)
    END

    should be

    IF
    See(NearestEnemyOf(Myself))
    Range(NearestEnemyOf(Myself),10)
    HaveSpell(WIZARD_SUN_FIRE) // SPWI523.SPL (Sunfire)
    THEN
    RESPONSE #100
    Spell(Myself,WIZARD_SUN_FIRE) // SPWI523.SPL (Sunfire)
    END


    I thought this got addressed once before, unless I am mistaken. That might have been more than a year ago, though.....
  • hook71hook71 Member, Developer Posts: 582
    The scripting issues with the Sunfire spell has been reported before and is in the bugtracker as issue 7323.
  • GalactygonGalactygon Member, Developer Posts: 412
    There might be mods that use the same behaviour Spell(NearestEnemyOf(Myself),WIZARD_SUN_FIRE) instead of Spell(Myself,WIZARD_SUN_FIRE) because it ensures the caster walks up close to NearestEnemyOf(Myself). Better foolproof the projectile imo.
  • CrevsDaakCrevsDaak Member Posts: 7,155
    Actually I'd recommend fixing both things, not just one or the other since both are 'wrong' in a complementary way...
  • Gate70Gate70 Member, Developer Posts: 3,871
    Going to mark this up as 7323, if mods use this behaviour that can be dealt with separately to the standard game.
    Thanks
Sign In or Register to comment.