Chance to cast formula

General MajorMUD Discussion
Post Reply
User avatar
syntax
Site Admin
Posts: 553
Joined: Tue Jun 02, 2009 10:02 am

Chance to cast formula

Post by syntax »

Do we know what the actual formula is for chance to cast a spell? Something like character spellcasting + spell difficulty = cast %, with a maximum chance of 95%?


User avatar
BearFather
Posts: 668
Joined: Sun Feb 09, 2014 6:27 pm
Location: Portland, OR
Contact:

Re: Chance to cast formula

Post by BearFather »

That's how I remember it.

BTW nice to see someone digging into the info again.


User avatar
syntax
Site Admin
Posts: 553
Joined: Tue Jun 02, 2009 10:02 am

Re: Chance to cast formula

Post by syntax »

Code: Select all

If SPELL_DIFFICULTY >= 200 then
	chance_to_cast = 100
else
	chance_to_cast = CHAR_SPELLCASTING + SPELL_DIFFICULTY 
	if chance_to_cast > 98 then chance_to_cast = 98
endif


User avatar
BearFather
Posts: 668
Joined: Sun Feb 09, 2014 6:27 pm
Location: Portland, OR
Contact:

Re: Chance to cast formula

Post by BearFather »

Nice, thought cap was 97, and not 98. Also if the diff over 200, it makes the change 100? That doesn't sound right to me.


User avatar
syntax
Site Admin
Posts: 553
Joined: Tue Jun 02, 2009 10:02 am

Re: Chance to cast formula

Post by syntax »

BearFather wrote: Sun Mar 30, 2025 11:56 am Nice, thought cap was 97, and not 98. Also if the diff over 200, it makes the change 100? That doesn't sound right to me.
Remember that most difficulties are expressed in negative numbers, with more difficult more negative. This check is a positive value of 200 or more.
spellcastchance.png
As for the chance to cast, sometimes I have to double-take to make sure because of how the disassembly presents things. In this instance, the disassembly says that mmud generates a value between 0 and 100, which is actually 101 total numbers. The cap on chance to cast is 98. That's 99 possible numbers between 0 and 98 (technically, I think you can have a negative chance to cast). What I struggle to wrap my head around sometimes is deciding if there is a difference in number comparison to throw off the overall percentage by a point one way or the other.

ChatGPT assures me it's 98 possibilities to cast...
probability.png


Post Reply