The Hysteria Project: Change Log

The Mobile Spell Casting System

  • An Overview:
      With the implementation of this new spell system it is now possible for mobiles to cast any and all spells and spell types a player can cast. This system is completely separate from the mortal spell system, however, and thus means that existing player spells are not automatically accessable to mobs. Rather, new spells must be written in to the mob spell system (mspell). To accommodate this, I have attempted to make the system extremely easy to add spells to, requiring minimal actual code for most spells, and, in most cases, no code additions to the actual casting function.
  • Spell Types:
      The system can handle the same four spell types as the mortal spell system. Combat spells (default spell type), Offensive (special attack spells), Healing or special spells and Area spells (type 1). At least one of each type of spell has been added and tested.
  • Adding Spells - The Spell Structure:
      Since currently few (10, as of this writing) spells currently exist for mobiles, I'm interested in pretty much any spell you'd like to add (within reason). I'd like to eventually have at least as many mspells as player spells. So, if you want to add an mspell, here's the struct and what you'll need to define, with each entry separated by comma:

      int lev
      int lag_to_vic
      int max_dam
      int min_dam
      int type
      Boolean drain
      char *txt
      char *utters

    • lev is, obviously, level. Only mobs at or above this level can cast this spell. A mobile's level is approximately equal to the mobile's hp divided by 100. The collector is 192, weary monks are 32 just to give you a range.
    • lag_to_vic: How much it will lag the victim. Default is 0.
    • max_dam / min_dam: High and low for damage. The spells can cast slightly higher than max_dam, based on the level of the player.
    • type: SP_COMBAT, SP_SPECIAL or SP_AREA.
    • drain: True or False. This is for spells like drain str or drain con. This will force a damage calculation with a hard max of max_dam. Default False.
    • txt is the format of the spell in the combat message.. e.g. the 'acidblast' in "Bob's acidblast rips the shizzle out of you!" Colors encouraged.
    • utters is what the mobile 'says' to cast the spell. E.g. the 'acidblast' in "Bob utters the words 'acidblast'." Again, colors welcome.
      If you're making a special or offensive spell, I'll need a decent description of what it's supposed to do, like.. cast sanctuary for 7 ticks or whatever.
  • A Sample Spell:
    • For example, this is the entry for the Mobile Acidblast spell:
      /* Mob Acidblast */
      { 50, 0, 500, 50, SP_COMBAT, False, "&+ra&*c&+Ri&*d blast"&*, "&+Yacidblast&*", }
      Writing a spell is that simple.
  • How It Works:
      When fighting, at the start of each round for a mobile, a check is performed to see if the mobile has the CanCast mflag. If it does, the mobile rolls. The roll has a 35% chance of being successful. If successful, the mobile rolls again to pick a spell. If the spell is not a combat spell, or if the mobile is not high enough level to cast that spell, it rolls again until it finds a spell that the mobile is capable of casting in battle and casts it on the player it is fighting. As a result, any mobile can cast spells. It simply needs the CanCast flag added in the zone file. And we don't have to worry about a level 10 player getting pasted by a low lev mob casting a 900 damage acidstorm.
  • General:

    Main

    Plans

    Discuss Ideas

    Mobile Spell System

    Hysteria's Guide to
    World Building


    Hystory:

    Edhadeya

    Corwin


    Change Log:

    November 2003

    December 2003

    January 2004

    February 2004

    March 2004

    April 2004

    May 2004

    November 2004

    December 2004

    January 2005

    February 2005

    March 2005

    April 2005



    Contact:
    hysteria at mephie dot ws.


    Credits

    This site designed specifically
    for Mozilla Firefox

    Get Firefox!


    Site contents and graphics copyright © 1996-2004
    The Hysteria Project, unless otherwise noted.
    Do not reproduce without permission.
    The Hysteria Project is a V-Meph Production.