This snippet is not necessarily complete or accurate, but should be used as a guide for adding memorization code and innate skills/spells to your mud. Memorization: Spells that are memorized are added to a linked list with a timer. When the spell has finished being memorized, the spell is removed from the linked list to an array of spells that are ready to cast. This system allows for multiple spell levels, and the level of a spell is set in the spello declaration in spell_parser.c This system supports added spell slots via equipment using object affections (similar to +con, -maxhit, etc). Innate spells/skills/affects: This system allows a character to use a spell or skill every X hours. When an innate ability is used, it is added to a linked list with a timer. When the timer expires, the spell may be cast or used again. add_innate_affects(d->character); should be called when the player enters a game (in interpreter.c) to add innate affects to a character(as opposed to innate abilities). If you have any questions email to strife@bb14.betterbox.net -Robert /*************************************************************************** * * * Updated for CWG-SunTzu by Zizazat Lazuras * * * * * ***************************************************************************/ As part of the D20 work I'm doing, I decided to update this snippet. The original documentation was very light, but the code itself is well commented. It will make it into the core CWG-D20 release, and will help to radically replace the skill/spell system we all know under the current Circle Code. It adds a few things as examples: * PRF_AUTOMEM - when this is turned on, you automatically get the spell just cast added to your memorize list. Sort of neat. * New Spell - Faerie Fire. A target light up by faerie fire should be slightly easier to hit. You might need to tweek the mag_points case for this spell. This spell is typically innate to Drow. * New Skill - Lay on Hands. This is a skill to heal small amounts of damage and is typically innate to Paladins. * All the spello defines in spell_parser.c have been changed, to replace the max mana cost of the spell, with the spell level. There are 10 spell levels under D20 rules, levels 0 - 9. I tried to make the spells in line as best I could with D20 spell levels for the same or similar effect. You may want to ajdust these (and the character level they are gained at in class.c) to suit your own game. * memorize spell, will add that spell to your memorization list. * stop spell, will remove spell from you memorization list. * forget spell, will remove a spell you are done memorizing. * memorize without any argument shows you the spells you have and are memorizing. It also shows how many spell slots for each castable spell level you have. * There are two new defines in utils.h, IS_ARCANE and IS_DIVINE. As of this patch they refer only to 1 class each, which are stock to CWG-SunTzu. However, they are ment to represent the two methods of spellcasting under the D20 rules. ARCANE spell casters now must memorize their spells via a spellbook. DIVINE spell casters still have direct casting via the mana system. You can expand either define to include other classes which you want to work in this way. (IE: Bards would presumably be ARCANE and Rangers would be DIVINE.) * Spellbooks work. If you are an ARCANE spell caster, you NEED to have a spellbook object, with the spell you are trying to memorize written in it. If you have several spellbooks with spells scattered across them, memorize will seach them all for the spell you are trying to memorize. * Scrolls work. If you have a spell memorized already, you can scribe it to the scroll, as long as the 1st spell slot of the scroll is less than 1. Scribed scrolls only contain 1 spell per scroll. the CWG-Core will be changing to reflect this also in future releases. * There is a fully functional scribe command. Syntax is: scribe (scroll|spellbook) spellname. At the moment you need to have the spell memorized in order to scribe it. In the future, I may make it so that you can scribe a spell into a spellbook if you have a scroll which contains the spell. Once the spell has been scribed, the spell will no longer be memorized. * When you look at a spellbook object, it will display all the spell names written in it, and how many pages they take up. * When you scribe a new scroll object, the short name of the object will be chanaged to: a scroll of 'spellname' * OEDIT has been modified to allow you to add/remove spells from a spellbook object, up to MAX_SPELLS number of spells. --Ziz (zizazat@hotmail.com)