# TobEx: 25

Current Behaviour:

Effect #58 “Dispel” incorrectly calculates the dispel chance nDispelChance += pEff->nSourceCreLevel x 10 - nDispelLevel

Expected Behaviour:

Effect #58 “Dispel” correctly calculates the dispel chance nDispelChance += (pEff->nSourceCreLevel - cDispelLevel) x 10

Revision:

Fix dispelLevel math to do the subtraction before multiply.

Effect #58 “Dispel” incorrectly calculates the dispel chance nDispelChance += pEff->nSourceCreLevel x 10 - nDispelLevel

Expected Behaviour:

Effect #58 “Dispel” correctly calculates the dispel chance nDispelChance += (pEff->nSourceCreLevel - cDispelLevel) x 10

Revision:

Fix dispelLevel math to do the subtraction before multiply.

Post edited by Bhryaen on

0

## Comments

1,102Tested by having a level 7 protagonist try to dispel the spells of a level 8 enemy. 0 % success rate (20 attempts) in vanilla ToB. 47.5 % success rate (80 attempts) in BGEE. The success rate is higher than expected, but manually casting spells is too tedious a way of examining the PRNG.

782I did a series of tests

in BG2EEwith a Sorcerer level 26 against Kangaxx the Lich level 27.On 50 attempts to dispel with Dispel Magic, 16 were successful (32%) 34 (68%) failed.

34By the way, thanks for taking the time to do this, very helpful as I'm also trying to get to the bottom of the Dispel Magic conundrum!

782