Migrate to 5e saving throws

This commit is contained in:
kinther 2025-10-03 19:38:42 -07:00
parent 19682f5b58
commit 7c9e1ea2fd
16 changed files with 297 additions and 788 deletions

View file

@ -141,14 +141,14 @@ int prac_params[4][NUM_CLASSES] = {
struct guild_info_type guild_info[] = {
/* Midgaard */
{ CLASS_SORCEROR, 3017, SOUTH },
{ CLASS_SORCEROR, 3017, SOUTH },
{ CLASS_CLERIC, 3004, NORTH },
{ CLASS_THIEF, 3027, EAST },
{ CLASS_FIGHTER, 3021, EAST },
{ CLASS_BARBARIAN, 3021, EAST },
{ CLASS_RANGER, 3021, EAST },
{ CLASS_BARD, 3021, EAST },
{ CLASS_DRUID, 3021, EAST },
{ CLASS_DRUID, 3021, EAST },
/* Brass Dragon */
{ -999 /* all */ , 5065, WEST },
@ -157,550 +157,19 @@ struct guild_info_type guild_info[] = {
{ -1, NOWHERE, -1}
};
/* Saving throws for : MCTW : PARA, ROD, PETRI, BREATH, SPELL. Levels 0-40. Do
* not forget to change extern declaration in magic.c if you add to this. */
byte saving_throws(int class_num, int type, int level)
{
/* 5e system saving throws per class*/
bool has_save_proficiency(int class_num, int ability) {
switch (class_num) {
case CLASS_SORCEROR:
switch (type) {
case SAVING_PARA: /* Paralyzation */
switch (level) {
case 0: return 90;
case 1: return 70;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for mage paralyzation saving throw.");
break;
}
case SAVING_ROD: /* Rods */
switch (level) {
case 0: return 90;
case 1: return 55;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for mage rod saving throw.");
break;
}
case SAVING_PETRI: /* Petrification */
switch (level) {
case 0: return 90;
case 1: return 65;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for mage petrification saving throw.");
break;
}
case SAVING_BREATH: /* Breath weapons */
switch (level) {
case 0: return 90;
case 1: return 75;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for mage breath saving throw.");
break;
}
case SAVING_SPELL: /* Generic spells */
switch (level) {
case 0: return 90;
case 1: return 60;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for mage spell saving throw.");
break;
}
default:
log("SYSERR: Invalid saving throw type.");
break;
}
break;
case CLASS_CLERIC:
switch (type) {
case SAVING_PARA: /* Paralyzation */
switch (level) {
case 0: return 90;
case 1: return 60;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for cleric paralyzation saving throw.");
break;
}
case SAVING_ROD: /* Rods */
switch (level) {
case 0: return 90;
case 1: return 70;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for cleric rod saving throw.");
break;
}
case SAVING_PETRI: /* Petrification */
switch (level) {
case 0: return 90;
case 1: return 65;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for cleric petrification saving throw.");
break;
}
case SAVING_BREATH: /* Breath weapons */
switch (level) {
case 0: return 90;
case 1: return 80;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for cleric breath saving throw.");
break;
}
case SAVING_SPELL: /* Generic spells */
switch (level) {
case 0: return 90;
case 1: return 75;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for cleric spell saving throw.");
break;
}
default:
log("SYSERR: Invalid saving throw type.");
break;
}
break;
case CLASS_THIEF:
switch (type) {
case SAVING_PARA: /* Paralyzation */
switch (level) {
case 0: return 90;
case 1: return 65;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for thief paralyzation saving throw.");
break;
}
case SAVING_ROD: /* Rods */
switch (level) {
case 0: return 90;
case 1: return 70;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for thief rod saving throw.");
break;
}
case SAVING_PETRI: /* Petrification */
switch (level) {
case 0: return 90;
case 1: return 60;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for thief petrification saving throw.");
break;
}
case SAVING_BREATH: /* Breath weapons */
switch (level) {
case 0: return 90;
case 1: return 80;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for thief breath saving throw.");
break;
}
case SAVING_SPELL: /* Generic spells */
switch (level) {
case 0: return 90;
case 1: return 75;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for thief spell saving throw.");
break;
}
default:
log("SYSERR: Invalid saving throw type.");
break;
}
break;
case CLASS_FIGHTER:
switch (type) {
case SAVING_PARA: /* Paralyzation */
switch (level) {
case 0: return 90;
case 1: return 70;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for fighter paralyzation saving throw.");
break;
}
case SAVING_ROD: /* Rods */
switch (level) {
case 0: return 90;
case 1: return 80;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for fighter rod saving throw.");
break;
}
case SAVING_PETRI: /* Petrification */
switch (level) {
case 0: return 90;
case 1: return 75;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for fighter petrification saving throw.");
break;
}
case SAVING_BREATH: /* Breath weapons */
switch (level) {
case 0: return 90;
case 1: return 85;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for fighter breath saving throw.");
break;
}
case SAVING_SPELL: /* Generic spells */
switch (level) {
case 0: return 90;
case 1: return 85;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for fighter spell saving throw.");
break;
}
default:
log("SYSERR: Invalid saving throw type.");
break;
}
case CLASS_BARBARIAN:
switch (type) {
case SAVING_PARA: /* Paralyzation */
switch (level) {
case 0: return 80;
case 1: return 60;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for barbarian paralyzation saving throw.");
break;
}
case SAVING_ROD: /* Rods */
switch (level) {
case 0: return 90;
case 1: return 80;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for barbarian rod saving throw.");
break;
}
case SAVING_PETRI: /* Petrification */
switch (level) {
case 0: return 70;
case 1: return 65;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for barbarian petrification saving throw.");
break;
}
case SAVING_BREATH: /* Breath weapons */
switch (level) {
case 0: return 90;
case 1: return 85;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for barbarian breath saving throw.");
break;
}
case SAVING_SPELL: /* Generic spells */
switch (level) {
case 0: return 90;
case 1: return 85;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for barbarian spell saving throw.");
break;
}
default:
log("SYSERR: Invalid saving throw type.");
break;
}
break;
case CLASS_RANGER:
switch (type) {
case SAVING_PARA: /* Paralyzation */
switch (level) {
case 0: return 75;
case 1: return 70;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for ranger paralyzation saving throw.");
break;
}
case SAVING_ROD: /* Rods */
switch (level) {
case 0: return 85;
case 1: return 80;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for ranger rod saving throw.");
break;
}
case SAVING_PETRI: /* Petrification */
switch (level) {
case 0: return 80;
case 1: return 75;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for ranger petrification saving throw.");
break;
}
case SAVING_BREATH: /* Breath weapons */
switch (level) {
case 0: return 90;
case 1: return 85;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for ranger breath saving throw.");
break;
}
case SAVING_SPELL: /* Generic spells */
switch (level) {
case 0: return 90;
case 1: return 85;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for ranger spell saving throw.");
break;
}
default:
log("SYSERR: Invalid saving throw type.");
break;
}
break;
case CLASS_BARD:
switch (type) {
case SAVING_PARA: /* Paralyzation */
switch (level) {
case 0: return 90;
case 1: return 70;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for bard paralyzation saving throw.");
break;
}
case SAVING_ROD: /* Rods */
switch (level) {
case 0: return 85;
case 1: return 80;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for bard rod saving throw.");
break;
}
case SAVING_PETRI: /* Petrification */
switch (level) {
case 0: return 85;
case 1: return 75;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for bard petrification saving throw.");
break;
}
case SAVING_BREATH: /* Breath weapons */
switch (level) {
case 0: return 85;
case 1: return 85;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for bard breath saving throw.");
break;
}
case SAVING_SPELL: /* Generic spells */
switch (level) {
case 0: return 85;
case 1: return 80;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for bard spell saving throw.");
break;
}
default:
log("SYSERR: Invalid saving throw type.");
break;
}
break;
case CLASS_DRUID:
switch (type) {
case SAVING_PARA: /* Paralyzation */
switch (level) {
case 0: return 75;
case 1: return 70;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for druid paralyzation saving throw.");
break;
}
case SAVING_ROD: /* Rods */
switch (level) {
case 0: return 80;
case 1: return 80;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for druid rod saving throw.");
break;
}
case SAVING_PETRI: /* Petrification */
switch (level) {
case 0: return 90;
case 1: return 75;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for druid petrification saving throw.");
break;
}
case SAVING_BREATH: /* Breath weapons */
switch (level) {
case 0: return 90;
case 1: return 85;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for druid breath saving throw.");
break;
}
case SAVING_SPELL: /* Generic spells */
switch (level) {
case 0: return 85;
case 1: return 80;
case 2: return 0;
case 3: return 0;
case 4: return 0;
case 5: return 0;
default:
log("SYSERR: Missing level for druid spell saving throw.");
break;
}
default:
log("SYSERR: Invalid saving throw type.");
break;
}
break;
case CLASS_SORCEROR: return (ability == ABIL_CON || ability == ABIL_CHA);
case CLASS_CLERIC: return (ability == ABIL_WIS || ability == ABIL_CHA);
case CLASS_THIEF: return (ability == ABIL_DEX || ability == ABIL_INT);
case CLASS_FIGHTER: return (ability == ABIL_STR || ability == ABIL_CON);
case CLASS_BARBARIAN: return (ability == ABIL_STR || ability == ABIL_CON);
case CLASS_RANGER: return (ability == ABIL_STR || ability == ABIL_DEX);
case CLASS_BARD: return (ability == ABIL_DEX || ability == ABIL_CHA);
case CLASS_DRUID: return (ability == ABIL_INT || ability == ABIL_WIS);
default: return FALSE;
}
/* Should not get here unless something is wrong. */
return 100;
}
/* Roll the 6 stats for a character... each stat is made of the sum of the best