- Joined
- May 12, 2014
- Messages
- 105
- Reaction score
- 49
- First Language
- english
- Primarily Uses
Keep in mind that in order for this formula to work, I have to use Bobstah's Custom Stats plugin. It can be found here
x = Math.floor((Math.random() * 20) + 1); if (x >= a.luk) { Math.floor((Math.random() * a.def * a.agi) + a.atk * a.agi) + a.mat;} else if (x + a.mat + (a.str - 10) / 2 <= b.mdf + (b.dex - 10) /2) { 0; } else { Math.floor((Math.random() * a.def) + a.atk) + a.mat; } This is far more condensed then what it originally was lol. Anyways, the code above is a damage formula that gives you a dungeons and dragons type of damage output. To get everyone up to speed here, this is what each stat represents.
ATK = dice number.
DEF = dice size.
MAT = Attack Bonus
MDF = Armor Class
AGI = Crit modifier
LUK = Threat range.
STR / DEX / CON / WIS / INT / CHA are all just the base stats in dungeons and dragons (added in with Bob's plugin).
X is a hit roll with no modifiers. If X is within your threat range (somewhere between your LUK and 20) then the attack is a critical.
The critical formula adds dice to the damage based on whatever the modifier is. Going with a standard x2 modifier (so 2 agi essentially) means that the player rolls two dice for damage. Obviously this doesn't roll dice, so both def and atk is multiplied by the modifier. This brings the damage up to 2d8 with a sword, or 2-16 + attack bonus (mat) damage.
If the damage isn't critical then it checks to see if its either equal to, or greater than, the targets Armor class + their dexterity bonus. Getting the bonus numbers from dnd requires you to subtract 10 from your dexterity score and divide that number by two.
Everyone starts with a 10 in AC. If X meets or exceeds the AC then you land a hit and move on to damage. if not, the damage returned is 0.
This entire damage formula doesn't bypass the hit system built into MV, I just work around it. Everyone's hit is 100% and everyone's evade is 0%. So technically there is no chance for a miss, just for a damage return of 0 (simulating a miss).
The entire reason I didn't add in the Attack bonus to the hit roll in the beginning was due to criticals. In D&D you don't get a critical if you reach the threat range with your attack bonus. You have to roll naturally into your threat range. Though, this is letting you slide with an auto hit below a natural 20, which doesn't happen even if its in your threat range for a critical, but I'm taking a small liberty here. I could add in another condition to check between the threat and the natural 20 but its not really worth it unless I want some insane threat ranges (which wont happen).
Ok so this is the base formula I made for D&D style gameplay. I am welcome to any thoughts on it, or suggestions. In the mean time, I'm going to add parts to account for various modifiers, such as blind states giving you a reduced hit chance on your roll, bonuses for feats, etc. I hope to hear some great feedback from everyone! Thanks for reading this.
x = Math.floor((Math.random() * 20) + 1); if (x >= a.luk) { Math.floor((Math.random() * a.def * a.agi) + a.atk * a.agi) + a.mat;} else if (x + a.mat + (a.str - 10) / 2 <= b.mdf + (b.dex - 10) /2) { 0; } else { Math.floor((Math.random() * a.def) + a.atk) + a.mat; } This is far more condensed then what it originally was lol. Anyways, the code above is a damage formula that gives you a dungeons and dragons type of damage output. To get everyone up to speed here, this is what each stat represents.
ATK = dice number.
DEF = dice size.
MAT = Attack Bonus
MDF = Armor Class
AGI = Crit modifier
LUK = Threat range.
STR / DEX / CON / WIS / INT / CHA are all just the base stats in dungeons and dragons (added in with Bob's plugin).
X is a hit roll with no modifiers. If X is within your threat range (somewhere between your LUK and 20) then the attack is a critical.
The critical formula adds dice to the damage based on whatever the modifier is. Going with a standard x2 modifier (so 2 agi essentially) means that the player rolls two dice for damage. Obviously this doesn't roll dice, so both def and atk is multiplied by the modifier. This brings the damage up to 2d8 with a sword, or 2-16 + attack bonus (mat) damage.
If the damage isn't critical then it checks to see if its either equal to, or greater than, the targets Armor class + their dexterity bonus. Getting the bonus numbers from dnd requires you to subtract 10 from your dexterity score and divide that number by two.
Everyone starts with a 10 in AC. If X meets or exceeds the AC then you land a hit and move on to damage. if not, the damage returned is 0.
This entire damage formula doesn't bypass the hit system built into MV, I just work around it. Everyone's hit is 100% and everyone's evade is 0%. So technically there is no chance for a miss, just for a damage return of 0 (simulating a miss).
The entire reason I didn't add in the Attack bonus to the hit roll in the beginning was due to criticals. In D&D you don't get a critical if you reach the threat range with your attack bonus. You have to roll naturally into your threat range. Though, this is letting you slide with an auto hit below a natural 20, which doesn't happen even if its in your threat range for a critical, but I'm taking a small liberty here. I could add in another condition to check between the threat and the natural 20 but its not really worth it unless I want some insane threat ranges (which wont happen).
Ok so this is the base formula I made for D&D style gameplay. I am welcome to any thoughts on it, or suggestions. In the mean time, I'm going to add parts to account for various modifiers, such as blind states giving you a reduced hit chance on your roll, bonuses for feats, etc. I hope to hear some great feedback from everyone! Thanks for reading this.
Last edited by a moderator:


