Skip to content

[Bug] Rancor +1

OurQuestIsVainOurQuestIsVain Member Posts: 201
edited January 2013 in Fixed
Current Behavior - Dorn's sword Rancor +1 gains a +1 to hit bonus simply when it is in his quick weapon slot even if it isn't the weapon that kills an enemy.

Expected Behavior - Dorn's sword Rancor +1 should only gain +1 to hit when it is the weapon used to kill an enemy. Unless this is intentional in which case the item description needs to be changed.
Post edited by Jalily on

Comments

  • horredtheplaguehorredtheplague Member, Developer Posts: 186
    I think I tracked down the cause of this one. It's in DORN.bcs, the very last block. Currently it reads:

    IF
    !HasItemEquiped("SW2HD1",Myself)
    !Global("ohdornsw","LOCALS",0)
    THEN
    RESPONSE #100
    ApplySpellRES("OHDSW0",Myself)
    SetGlobal("ohdornsw","LOCALS",0)
    END
    It's the !HasItemEquiped() check that's causing it. Even if Dorn is not using the sword, it's in his weapon slot and thus HasItemEquiped() is true. The same conditional check rings true for items in your quickslots like potions. In this particular case, the best code line should be:
    !HasItemEquipedReal("SW2HD1",Myself)
    This not only checks if the item is "equipped" (always hated the IE script-spelling lol), it also checks if the item is currently in use. In a weapon's case, that means they're holding it and ready to swing.

    Note that the initial "buff" spell is not applied in the script, it DOES have to be applied by the sword with a CastSpellOnCondition(). I'm assuming the brand new Condition #12 = "I just killed some sap". The script is what shuts it down, or was supposed to shut it down. You can test this currently by taking Rancor +1 out of the weapon slot. Does the +1 bonus now vanish? If so, then it's that code line to blame, 99.5% guaranteed.
  • horredtheplaguehorredtheplague Member, Developer Posts: 186
    P.S: Devs--Does that make up for my false report on Morningstars? :)
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    registered
Sign In or Register to comment.