Magic System

Forum for discussing compliance of code.

Post Reply
dougnoel
Groundling
Posts: 86
Joined: Sat Jul 17, 2004 11:39 pm
Location: VA

Magic System

Post by dougnoel »

Avlis has begun implementation of a Spellhooking system to hook every single spell. Information on where to find these files and how to install them can be found here: http://www.avlis.org/devwiki/index.php/Magic_System. Information given to players on the updates can be found on the Avlis boards here: http://www.avlis.org/viewtopic.php?t=48332. (You can find the old thread here.) What follows are our reasons and goals for implementing this system. Hopefully this information will help you decide whether or not you wish to implement this system on your server(s).

1.) Removing visual effects for spells that do not have them in PnP.
This is something that was done quite a while ago. In addition to staying true to PnP, less visual effects means less lag for players with slower clients. Most of the visual effects removed were on buff spells. I have hooked these changes but have held off adding them until I can add in an On/Off switch for worlds that do not wish to use this feature.

2.) Changing spells for balance reasons.
Some of these changes were done in the past and are being ported over to the new system. Along with changes to true seeing, all death spells were changed to work with the Avlis death system.

3.) Adding in new functionality.
This includes implementing a new UMD System, spell sharing with familiars, new enchanting system, new metamagic feats, dynamic scrolls, potions, wands, rods and staves, IC-based restrictions on spellcasters and more.

After checking out the information in the links above, please post here if you have any further questions.

Doug
Avlis Systems Coder
Last edited by dougnoel on Wed Mar 02, 2005 10:04 am, edited 1 time in total.
Serpentax
Groundling
Posts: 144
Joined: Sun Feb 29, 2004 5:29 am
Location: Abyss 404
Contact:

Post by Serpentax »

1- i noticed a deity based system for clerics is being implemented..

to quote the avlis board
"When casting divine spells on Avlis, you must have a valid Avlis deity in your deity field to cast spells above 2nd level (3rd level as of version 1.4.) "
Does this mean only Avlis clerics will be able to cast above 3rd lvl ? or will the "valid list" include powers that have wider scale,
i can see this putting a very rapid stop to cleric players wandering the planes if it means a lvl 20 character is reduced to the spellcasting power of a lvl 5 one.

also, where would clerics of "near deities" stand like a cleric of Orcus or one of the Nine ? would they have no power outside their home plains ?
just wondering ...

2- Spellsharing with familiars ?
this "effects them too" does it work on spells that are normally caster only ?
if so i see serious abuse of that to tank up panthers or similar with self effecting spell..
stoneskined panther with elemental shield ? ICK

ps: spellhooks and the rest look nice, and the pnp true spells are definatly a good move :D[/quote]
Orleron
Multiverse Scholar
Posts: 1247
Joined: Mon Nov 10, 2003 11:15 am
Location: Avlis
Contact:

Post by Orleron »

The spell system will in fact do that, yes. It is in line with D&D rules for planar and planetary travel, which state that a deity's influence only extends throughout the crystal sphere where his home planet is, as well as the entirety of the outer planes. So yes, if you have Wee jas as your deity and you come to Avlis, you lose contact with that god and can only cast up to 3rd level. There are no equivalents, to your point about Orcus.

Will this make cleric travel to Avlis more difficult? Yep. However it will not make it impossible, because it is very easy to convert to an Avlis deity by talking to the priests at the local temple. There have been conversion conversations in place for a long time now.

The other thing you can do with this system is use it to deny spells to individual clerics on your own world if they have forsaken their deity or made it angry for plot reasons. Very handy for DM interaction.

Also, this is not a mandatory system, of course. It's here if you want it, and if you don't, that's fine too.
Avlis: http://www.avlis.org

"My name is Orleron...a dungeonmaster...two years ago I got shot through a game client...I'm in a distant part of the internet aboard these servers of escaped mental patients...my players. I've made enemies, stupid, and annoying...now all I want to do is make CoPaP a reality, to warn Earth...Look inward(to your monitor) and share the newbies I've seen..."
Orleron
Multiverse Scholar
Posts: 1247
Joined: Mon Nov 10, 2003 11:15 am
Location: Avlis
Contact:

Post by Orleron »

Btw, the system will also allow you to deny spells to individual mages if you wish to do so for plot reasons.
Avlis: http://www.avlis.org

"My name is Orleron...a dungeonmaster...two years ago I got shot through a game client...I'm in a distant part of the internet aboard these servers of escaped mental patients...my players. I've made enemies, stupid, and annoying...now all I want to do is make CoPaP a reality, to warn Earth...Look inward(to your monitor) and share the newbies I've seen..."
Arkonswrath
Ambassador: Hala
Posts: 447
Joined: Wed May 26, 2004 3:57 am

Post by Arkonswrath »

Orleron wrote:The spell system will in fact do that, yes. It is in line with D&D rules for planar and planetary travel, which state that a deity's influence only extends throughout the crystal sphere where his home planet is, as well as the entirety of the outer planes.
Does this mean that if you have an Avlissian God, or an Outer Planes related God, that the Sphere of Influence of the Avlissian God extends into the Outer Plane/Death Plane and vice versa?
Sarrena
World Leader: Abyss404
Posts: 154
Joined: Tue Jun 15, 2004 7:38 pm
Contact:

Post by Sarrena »

Dont suppose you have a version of this with only options one and two active :)
World Leader : Abyss 404
dougnoel
Groundling
Posts: 86
Joined: Sat Jul 17, 2004 11:39 pm
Location: VA

Post by dougnoel »

Sarrena wrote:Dont suppose you have a version of this with only options one and two active :)
There are On/Off switches for all of these features, so yes. :) The switches can be found in avlis_spellhook, copap_magic_inc, copap_splchk_inc and x2_pc_umdcheck. You can also just delete x2_pc_umdcheck and that will remove the UMD and share spell functionality.

The share spell is a nice idea, but it has become one of my biggest headache as far as bugs.

The current version, 1.4.3, does not have the visual effects removed. I'm hoping to place those in 1.5 (the next version). I have actually held back on putting them in becuase there's no on/off switch for the visual effects - I just deleted the lines Aloro commented out. So I have to go back over the 30 or so spells and fix that.

Also, the implementation of the deity checking code requires a table containing all the deities that grant spells. The table is further broken down by class: cleric/druid/ranger/paladin/blackguard - but currently that's optional info.

I plan to include insturctions on the wiki page about how to turn on/off each feature and how to configure it for your worlds. The code is pretty well commented though, so it should be too hard to figure out how to turn things oof. If you do find something that doesn't have a switch, please let me know and I'll add it in. And if you tell me soon, I'll try and get it into the next version. :)

Another thing to keep in mind is if you have a custom version of a spell you like better, you have two options. The first is to replace the spellhooking code I have written for that spell. The second is to delete my code for that spell and use an existing custom script.

Say, for example, that you ahev a custom GMW script and find our nerfing of the spell to be too harsh. You can delete the GMW block, which is clearly defined, and your old script will take over. The one drawback to this option is you will not be able to take advantage of some of the features I am adding, such as multiple metamagic feats on one spell, elemental substitution, and correct level calculation for palemasters to name a few.
Sarrena
World Leader: Abyss404
Posts: 154
Joined: Tue Jun 15, 2004 7:38 pm
Contact:

Post by Sarrena »

How are you getting elemetnal sub too work and multi meta on spells?
World Leader : Abyss 404
dougnoel
Groundling
Posts: 86
Joined: Sat Jul 17, 2004 11:39 pm
Location: VA

Post by dougnoel »

Sarrena wrote:How are you getting elemetnal sub to work and multi meta on spells?
I've replaced the metamagic checks with unary checks that allow multiple metamagic feats to be stored in one integer. Then instead of an if-else statement, the statements are successive if statements.

The elemental substitution required the addition of code to switch the elemental damage and visual effects of all spells that can be affected. In the case of multiple elements being specified, there is an oreder of precedence which decides which element is dominant.

To actually use more than one metamagic effect, I have created metamagic rods. These rods are charged items and are intended to be gold sinks, costing a minimum of a few hundred gold/charge. Using a rod sets a local variable on the caster which is stripped the next time a spell is cast and added to the effects of that spell. If the metamagic effects are not compatible with that spell (or that spell hasn't been hooked yet) the charges are wasted.
dougnoel
Groundling
Posts: 86
Joined: Sat Jul 17, 2004 11:39 pm
Location: VA

Post by dougnoel »

Here's the new code used to set and check for additional metamagic feats.

Code: Select all

// Sets a local variable on the caster so that the next spell cast uses the
// metamagic feat passed.
void UseMetamagicFeat(object oCaster, int iMetaMagicFeat)
{
    SetLocalInt(oCaster, "SHS_MetamagicFeats", BitwiseSet(GetLocalInt(oCaster, "SHS_MetamagicFeats"), iMetaMagicFeat));
    if (DEBUG) SendMessageToPC(oCaster, "Meatmagic Feat Set: " + IntToString(GetLocalInt(oCaster, "SHS_MetamagicFeats")));
}


// Returns an int that contains all the metamagic feats used to cast a spell.
int SetMetamagicFeatsUsed(object oCaster, int iMetaMagicFeat)
{
    int iNewFeats = GetLocalInt(oCaster, "SHS_MetamagicFeats");
    if (DEBUG) SendMessageToPC(oCaster, "New Feats Recalled: " + IntToString(iNewFeats));
    int iReturn =  BitwiseSet(iNewFeats, iMetaMagicFeat);
    if (DEBUG) SendMessageToPC(oCaster, "SetMetamagicFeatsUsed() Returning Value: " + IntToString(iReturn));

    return iReturn;
}


// Takes iMetaMagic and does a bitwise compare to iFeat to determine whether or
// not iFeat was used when casting the spell.
int GetWasMetamagicFeatUsed(int iMetaMagic, int iFeat)
{
    // The bitwise compare allows us to determine whether or not multiple
    // Metamagic feats were used on the same spell.
    return BitwiseTest(iMetaMagic, iFeat);
}


// Does a bitwise test to determine whether or not iNumber has iValue bit set.
// Returns TRUE (1) or FALSE (0).
int BitwiseTest(int iNumber, int iValue)
{
    if ((iNumber & iValue) == iValue)
        return TRUE;
    else
        return FALSE;
}


// Takes the bits set in iValue and turns on those bits in iNumber.
// Returns new iNumber.
int BitwiseSet(int iNumber, int iValue)
{
    iNumber = iNumber | iValue;
    return iNumber;
}
Orleron
Multiverse Scholar
Posts: 1247
Joined: Mon Nov 10, 2003 11:15 am
Location: Avlis
Contact:

Post by Orleron »

An updated version of this system is here:

http://www.incarceri.com/wiki/index.php ... 020705.erf

If you use this system, feel free to go get the update.

Info on the fixes is in the link.
Avlis: http://www.avlis.org

"My name is Orleron...a dungeonmaster...two years ago I got shot through a game client...I'm in a distant part of the internet aboard these servers of escaped mental patients...my players. I've made enemies, stupid, and annoying...now all I want to do is make CoPaP a reality, to warn Earth...Look inward(to your monitor) and share the newbies I've seen..."
dougnoel
Groundling
Posts: 86
Joined: Sat Jul 17, 2004 11:39 pm
Location: VA

Post by dougnoel »

The wiki has moved and we have a new thread on spellhooking in the Avlis forums. I've edited my first post to contain this new information. I lefet the link to the old thread in as well. Also, I have decided (for the time being) not to retroactively add a witch to turn additional visual effects on/off. I may have a sub do this, but I deleted the VFX code for about 40 spells to reduce the number of variables used before I realized I could do scoping inside a switch statement. Anyway, if this is a big issue for anyone who uses/wnats to use this code, please let me know and I will get a sub on it. All other systems have switches.

Here is an updated link for Orl's previous post: http://www.avlis.org/devwiki/index.php/ ... 020705.erf.

Doug
Nob
Spelljammer
Posts: 216
Joined: Mon Nov 24, 2003 10:13 pm

Post by Nob »

Is there a list of spells already hooked to be added to the "delete these scripts" list?

And is deleting the scripts still necessary?
Mistcaller
Groundling
Posts: 137
Joined: Tue Nov 25, 2003 7:29 am
Location: Avlis Team - Tairis'nadur Team

Post by Mistcaller »

Deleting the custom scripts is required because they are outdated versions of the spells (before HotU or SoU) and they do not include the "hooking" command.
Which means that the system will use those spell versions, instead of the hooked ones.
dougnoel
Groundling
Posts: 86
Joined: Sat Jul 17, 2004 11:39 pm
Location: VA

Post by dougnoel »

Nob wrote:Is there a list of spells already hooked to be added to the "delete these scripts" list?
All the hooked spells as of 1.5 are listed on the player Wiki. You can find it here: http://avlis.org/wiki/.
Nob wrote:And is deleting the scripts still necessary?
You only need to delete scripts if your world has custom scripts. If you don't have custom scripts for spells, then this step is unecessary. But like Mist said, if you have old pre-spellhooking spell scripts, they will override spellhooking.
dougnoel
Groundling
Posts: 86
Joined: Sat Jul 17, 2004 11:39 pm
Location: VA

Post by dougnoel »

I have added two new pages to the Wiki to help people implement this system http://www.avlis.org/devwiki/index.php/Magic_System. The first is information on all scripts that should be deleted: http://www.avlis.org/devwiki/index.php/Shs:Old_Scripts. The second is information on how to set up vendors that come with the system and information on CoPaP-wide price balancing of these vendors: http://www.avlis.org/devwiki/index.php/ ... Up_Vendors.
Baron
Ambassador: Ithilla
Posts: 99
Joined: Fri Jan 07, 2005 10:34 am
Location: Somewhere over the rainbow
Contact:

Post by Baron »

dougnoel wrote:I have added two new pages to the Wiki to help people implement this system http://www.avlis.org/devwiki/index.php/Magic_System. The first is information on all scripts that should be deleted: http://www.avlis.org/devwiki/index.php/Shs:Old_Scripts. The second is information on how to set up vendors that come with the system and information on CoPaP-wide price balancing of these vendors: http://www.avlis.org/devwiki/index.php/ ... Up_Vendors.
tried reading those things you linked to - i got a password box and
Authorization Required
This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required
Ithilla will be coming on-line soon and we absolutely have to have these things in place...i may have an earlier version of the spellhooking in place but i have no idea if the required to be deleted scripts have been deleted or anything else.
The Lord's Prayer is 66 words, the Gettysburg Address is 286 words,there are 1,322 words in the Declaration of Independence, but government regulations on the sale of cabbage total 26,911 words.
dougnoel
Groundling
Posts: 86
Joined: Sat Jul 17, 2004 11:39 pm
Location: VA

Post by dougnoel »

Baron wrote:tried reading those things you linked to - i got a password box and
No problem. The login/password is in the CoPaP subcontractor forum. If you don't have access to that forum, apply and Orl will add you.

I've also updated the publis wiki with a full description of the system for the players.
Introduction

Also, feel free to update the Current Versions on Servers area and add your server if you're using this system.
Orleron
Multiverse Scholar
Posts: 1247
Joined: Mon Nov 10, 2003 11:15 am
Location: Avlis
Contact:

Post by Orleron »

Ithilla will actually have two currency systems, a gold one and a latinum one, but I digress. :)
Avlis: http://www.avlis.org

"My name is Orleron...a dungeonmaster...two years ago I got shot through a game client...I'm in a distant part of the internet aboard these servers of escaped mental patients...my players. I've made enemies, stupid, and annoying...now all I want to do is make CoPaP a reality, to warn Earth...Look inward(to your monitor) and share the newbies I've seen..."
teleri
World Leader: The Outlands
Posts: 497
Joined: Thu Jul 01, 2004 2:24 pm
Location: Sigil
Contact:

Post by teleri »

Added an entry for the Outlands to the "Current Versions on Servers" as well as a Section for non-avlis servers to place their status. (:
Cheers,
teleri

Building the Outlands one GateTown at a Time
[url=http://www.greatring.net][color=blue][u][b]The Outlands[/color][/u][/b][/url]
[url=http://www.diterlizzi.com/art/games/planescape/index.html][color=blue][u][b]The Look of PlaneScape[/color][/u][/b][/url]
Sarrena
World Leader: Abyss404
Posts: 154
Joined: Tue Jun 15, 2004 7:38 pm
Contact:

Post by Sarrena »

I'm working to add the avlis spell system into Abyss soon. Just tweaking a few things and it'll be rather lovely.

I'm also finishing up a new little set of summoning functions I hope to release in a week. for those interested.
World Leader : Abyss 404
dougnoel
Groundling
Posts: 86
Joined: Sat Jul 17, 2004 11:39 pm
Location: VA

Post by dougnoel »

ftp/shs_1_6_0_3.rar
ftp/includes_1_0_sm.rar OR includes_1_0.erf

This is version 1.6.0.3 of the spellhooking system. This is a full version, meaning previous versions are not needed to install this version.
For import into all modules. Import and overwrite all.

NOTE: There are a few new include files which I put in their own package because some people have some of them and may not want to overwrite them.

What it Contains/How To Install:
http://www.avlis.org/devwiki/index.php/ ... _6_0_3.erf
IAkrai
Noobie
Posts: 2
Joined: Mon Aug 16, 2004 11:29 am

Post by IAkrai »

Sorry for not posting earlier, i wanted to have a stable version first.
Spellhooking is now in version 1.7.2.2.
1.7.2.0 is a full version, you will need to take it and then patch up to 1.7.2.2
The rars are in the ftp, Systems/Spellhooking: shs_1_7_2_0.rar, shs_1_7_2_1.rar and shs_1_7_2_2.rar

Information about them are in:
http://www.avlis.org/devwiki/index.php/ ... _7_2_0.erf, http://www.avlis.org/devwiki/index.php/ ... _7_2_1.erf and http://www.avlis.org/devwiki/index.php/ ... _7_2_2.erf

You will need to overwrite all and recompile.
If you have any question feel free to ask :)
Post Reply