Long case statements w/crafting system

Okay, so I am working out a crafting system b/c I don’t want to use the default HoTU one.

Basically, its going to be 1) you dont need the feats but 2) you need the skills/class levels.

The way Im considering taking a stab at it is: use container stations with convo on close. Most of it will be simple if making nonmagical gear, put bar of iron/bar of steel/planks of oak, etc in correct table. Theoretically, on close, a conversation will begin. Using conditionals, a tree will show depending on the contents inside and your skill/class level (and race for things like mithril or adamantine).

So, I’m not that experienced with using case statements - and this is a situation that really is going to need case statements. My scripting is getting pretty proficient but I have generally avoided making scripts that are huge enough to need case statements so I am a newb with them. I know default scripts I can look to as an example but I was hoping for some tips/pointers in this regard.

The options for non-magical crafting will be small for each kind of station: forge, woodworking table, loom, tanner’s workshop. The exception to this will be gnome tinkering workshops but Ill cross that bridge later. I am totally skipping the little mid by-products like iron rings, steel axe head, leather patches or whatnot. Just the raw materials, because it makes more sense in this fashion.

If the character has enough skill, they can make masterwork. If they can make masterwork it can be enchanted. Here’s where the potentiality of case statements get much larger despite conversation conditionals.

In order to control crafting of magic items, I dont have an xp cost or even necessarily a gold cost unless you buy certain things. Like, you can buy base wands or rods or staves to enchant from NPC witches, alchemists, and druids respectively. In this regard, its expensive since wands are priced to be level 5 items. But only druids can craft staves, only wizards can make rods, and only sorcerers can craft wands. The setting has a background in like, historical ‘magic’ lore. The wands are not just made of bone, theres also yew, sandalwood, and ash wands. Its for role-play immersion.

Anyway, so to further control construction of magic items - you need ‘materia’ - no, this isnt ripped off of Final Fantasy, its a term from historical alchemy. So, like Im using the treasure table system (CTG) to have certain things drop from certain creatures. Elementals will drop essences, undead will drop stuff, you can find yew branches or herbs in debris in forests. These will all be pretty worthless in most cases to vendors but they will be materia to magic-using crafters.

So, you can see how the case statements will be pretty large. Ive spent the whole day going over what spells characters can craft with. Clerics and druids can just make things at altars, while Wizards and Sorcerers need an alchemists forge and the appropriate scroll. Scribe scroll will be disabled. I’m going to make the items they can craft in the treasure tables as well.

So, to make an item, they need the masterwork weapon or armor, or the potion bottle, or wand/rod/staff. Then they need the materia - in some cases more than one type, or multiple of the same materia, or both. In the case of wizards, sorcerers and harper scouts - they also will need the spell scroll, which will have to either be a drop or purchased from a vendor. Not all spells are used to make wands, and they only go to 5th level. Potions only go to 3rd level and not everything can make a potion. Rods and Staves are more limited, based on the strongest spell they cast - so they have more components but there are less of them. The magical arms and armor are going to be a bit wacky but I’m coming up with the full list of materia from the spell lists of Cleric, Druid, Sorc/Wiz and what those can make. And thats what arms and armor will be based on.

There are going to be a lot of essences, like for example - here are the lists for outsider essences and undead essences:

Undeath essences:
Minor: skeleton finger, zombie flesh, ghoul tooth, ghast finger, allip essence, haunt essence
Medium: wight skin, shadow essence, zombie lord flesh, tyrantfog zombie flesh
Greater: Spectre essence, Wraith essence, Vampire fang, Lich skull, Revenant finger

Outsider essences
Minor: wisp essence, imp tooth, quasit stinger, tiefling horn, Hellhound tooth
Medium: Slaad tongue, Fenhound/Shadow Mastiff tooth, Formian stinger, Nightmare horseshoe
Greater: Devil horn, Demon horn, Archon feather, Deva feather

There are also going to be materia like kingsfoil herbs, meteoric ore, holy water, water from sylphic springs, and so on. I feel it will add a whole extra dimension of explorability so its worth it to take time out from building the module to make the crafting table conversation trees and the case statement scripts involved.

Honestly, I am not even sure how much case statements will be needed. Because what the character can craft should be determined by conditionals in the crafting station conversation tree. But since materia put in the station can produce multiple recipies depending on the skill of the crafter and their class/level race, I suppose it may become somewhat of a tangle? Im not sure if closing table/conversation is really the best way to implement this either.

In the interest of making this more clear, heres a snippet of some clerical spell wand combos with a few sidenotes on other items that can be resultinated:
CLERICAL ABJURATION (Ash/Meteoric Iron)

Level 1
Endure elements - lesser elemental essence (any)
Protection from alignment - cold iron
Remove fear - holy water

Level 2
Lesser dispel - adamantine ore
Resist elements - 4x lesser elemental essence (any)

Level 3
Dispel magic - 2x adamantine ore
Glyph of warding - holy symbol
Magic circle against alignment - 4x cold iron
Negative energy protection - holy water x4
Protection from elements - elemental essence (any) - used to make armor with elemental resistance of 5-15 like salamander armor or ankheg armor but elemental essences are specific.
Remove curse - wardstone (rock with hole in middle), scroll plus wardstones are used to craft + Will save items (+1 per wardstone)

Level 4
Dismissal - holy symbol, lesser outsider essence (any)
Freedom of movement - 4x holy mistletoe
Minor globe of invulnerability - 3x wardstone
Stoneskin - gargoyle skull, scroll used to craft Meteoritic Iron Breastplate, Half Plate, or Full Plate along with 3, 5, or 7 meteorite iron

Level 5
Energy buffer - greater elemental essence (any) - also used to craft elemental resistance armors of 20-30
Spell resistance - 4x adamantine ore - also used to craft items with spell resistance

Level 6 (staves and rods only)
Banishment - holy symbol, outsider essence (any) - rod of banishing
Greater dispelling - 6x adamatine ore - rod of disjunction

Level 8
Aura versus alignment - scroll used to make holy avenger (7xholy water, LG holy symbol, and major devil essence plus masterwork long sword or bastard sword) and templar full plate (same ingredients except masterwork full plate instead of sword) as well as blackguard full plate (3x major archon essence and masterwork full plate)

Level 9
Undeath’s Eternal Foe - scroll used in crafting bone ring @ woodworker’s table (craft armor 20 ranks) w/ lich skull as materia.

CLERICAL CONJURATION (Yew/Ancient Brass)

Level 1
Cure light wounds - trefoil herb
Mage armor - effigy doll (sold by witches or craftable with craft armor 1), steel ignot
Summon creature I - pennyroyal herb

Level 2
Cure moderate wounds - trefoil herb x3
Lesser restoration - holly leaves
Melf’s acid arrow - tongue of a cobra
Remove paralysis - ammonium crystals
Stinking cloud - brimstone
Summon creature II - truffle
Web - ettercap gland

Level 3
Cure serious wounds - kingsfoil herb
Remove disease - digitalis leaves
Summon creature III - devil’s trumpet flower

Level 4
Cure critical wounds - kingsfoil herb x4
Neutralize poison - nightshade seeds
Restoration - holly leaves x4
Summon creature IV - aconite flower

Like I said, I’m checking for advice, tips, and so on before I delve into this. I appreciate any help anyone can give me here. I know its an effort to help other people, especially with such a cumbersome ambition.

My advice would be: put your recipes into a 2da file. 2da files make lots of things much easier as they can replace large case/if constructs with much less code and it’s much easier to edit things (delete/modify/add recipes) in a 2da file than in case/if constructs.

2 Likes

I appreciate you taking the time to offer the advice. While I have had some small experience with 2da files in NWN mucking around with other people’s HAKs, it made me decide to make a module using no HAKs. I think I would rather get the experience with coding the case statements/conditionals. I’d rather stay on the rung of the ladder I am presently on rather than jump to one nearer the top.