Re: [NEWBIE] magic resistance && magic spheres

From: Dust (
Date: 06/07/01

Hey all,sorry if this is formatted improperly, im not on my computer... damn
power crisis.

Well, to add in magic resistence add in some new variables in structs.h,
actually an integer array of some size might be best to use... i dont have
any code to look at but add in :

Look for the structure for spells and add in a new int field, int type or
something and add in defines for this:
#define SPELL_FIRE    0

You will need to change all the spell definitions in spell_parser to reflect
this, just add on a , and then like SPELL_FIRE

int resistence[MAX_RESISTENCE+1];

in the main part of the pfile, like where name and such is stored.

Somewhere near the top throw in some defines like:
#define RESIST_FIRE    0
#define RESIST_AIR    1


I wish i had access to my code, i have all this stuff in but then in
spell_parser.c add a function like check_resistence(struct char_data
*victim, int initial_damage) {
 do some quick checking using some float variables, reduce damage
accordingly and return a new integer, final_damage;

Then inside of mag_damage, before the call to do damage to a person, have a
call for dam = check_resistence(vict, dam); like that...

You can do whatever you want with "spell spheres" (types), its up to you to
figure out if you want to do anything special. If you need more help email
me directly ( and will strive to get the code i use for
this :)

   | FAQ: |
   | Archives: |

This archive was generated by hypermail 2b30 : 12/05/01 PST