Atrinik Server 2.5
include/spells.h
Go to the documentation of this file.
00001 /************************************************************************
00002 *            Atrinik, a Multiplayer Online Role Playing Game            *
00003 *                                                                       *
00004 *    Copyright (C) 2009-2011 Alex Tokar and Atrinik Development Team    *
00005 *                                                                       *
00006 * Fork from Daimonin (Massive Multiplayer Online Role Playing Game)     *
00007 * and Crossfire (Multiplayer game for X-windows).                       *
00008 *                                                                       *
00009 * This program is free software; you can redistribute it and/or modify  *
00010 * it under the terms of the GNU General Public License as published by  *
00011 * the Free Software Foundation; either version 2 of the License, or     *
00012 * (at your option) any later version.                                   *
00013 *                                                                       *
00014 * This program is distributed in the hope that it will be useful,       *
00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00017 * GNU General Public License for more details.                          *
00018 *                                                                       *
00019 * You should have received a copy of the GNU General Public License     *
00020 * along with this program; if not, write to the Free Software           *
00021 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.             *
00022 *                                                                       *
00023 * The author can be reached at admin@atrinik.org                        *
00024 ************************************************************************/
00025 
00030 #ifndef SPELLS_H
00031 #define SPELLS_H
00032 
00033 extern int cleric_chance[];
00034 
00040 #define PATH_PROT       0x00000001
00041 
00042 #define PATH_FIRE       0x00000002
00043 
00044 #define PATH_FROST      0x00000004
00045 
00046 #define PATH_ELEC       0x00000008
00047 
00048 #define PATH_MISSILE    0x00000010
00049 
00050 #define PATH_SELF       0x00000020
00051 
00052 #define PATH_SUMMON     0x00000040
00053 
00054 #define PATH_ABJURE     0x00000080
00055 
00056 #define PATH_RESTORE    0x00000100
00057 
00058 #define PATH_DETONATE   0x00000200
00059 
00060 #define PATH_MIND       0x00000400
00061 
00062 #define PATH_CREATE     0x00000800
00063 
00064 #define PATH_TELE       0x00001000
00065 
00066 #define PATH_INFO       0x00002000
00067 
00068 #define PATH_TRANSMUTE  0x00004000
00069 
00070 #define PATH_TRANSFER   0x00008000
00071 
00072 #define PATH_TURNING    0x00010000
00073 
00074 #define PATH_WOUNDING   0x00020000
00075 
00076 #define PATH_DEATH      0x00040000
00077 
00078 #define PATH_LIGHT      0x00080000
00079 
00086 #define SPELL_USE_CAST   0x01
00087 
00088 #define SPELL_USE_BALM   0x02
00089 
00090 #define SPELL_USE_DUST   0x04
00091 
00092 #define SPELL_USE_SCROLL 0x08
00093 
00094 #define SPELL_USE_HORN   0x10
00095 
00096 #define SPELL_USE_WAND   0x20
00097 
00098 #define SPELL_USE_ROD    0x40
00099 
00100 #define SPELL_USE_POTION 0x80
00101 
00104 #define SPELL_USE_BOOK   0x100
00105 
00112 #define SPELL_TYPE_WIZARD  1
00113 
00114 #define SPELL_TYPE_PRIEST  2
00115 
00120 #define SPELL_TYPE_NROF    2
00121 
00128 #define SPELL_DESC_TOWN         0x01
00129 
00130 #define SPELL_DESC_DIRECTION    0x02
00131 
00132 #define SPELL_DESC_SELF         0x04
00133 
00134 #define SPELL_DESC_FRIENDLY     0x08
00135 
00136 #define SPELL_DESC_ENEMY        0x10
00137 
00140 typedef struct spell_struct
00141 {
00143     char name[BIG_NAME];
00144 
00146     int type;
00147 
00151     char *icon;
00152 
00154     char *description;
00155 
00157     int level;
00158 
00160     int sp;
00161 
00163     int time;
00164 
00166     int scrolls;
00167 
00169     int charges;
00170 
00172     int range;
00173 
00180     float value_mul;
00181 
00183     int bdam;
00184 
00186     int bdur;
00187 
00189     int ldam;
00190 
00192     int ldur;
00193 
00203     int spl;
00204 
00206     const char *sound;
00207 
00209     int spell_use;
00210 
00212     uint32 flags;
00213 
00215     uint32 path;
00216 
00218     char *archname;
00219 } spell_struct;
00220 
00222 #define SP_NO_SPELL -1
00223 
00234 enum spellnrs
00235 {
00236     SP_FIRESTORM,
00237     SP_ICESTORM,
00238     SP_MINOR_HEAL,
00239     SP_CURE_POISON,
00240     SP_CURE_DISEASE,
00241     SP_STRENGTH,
00242     SP_IDENTIFY,
00243     SP_ASTEROID,
00244     SP_FROST_NOVA,
00245     SP_REMOVE_CURSE,
00246     SP_REMOVE_DAMNATION,
00247     SP_CAUSE_LIGHT,
00248     SP_CONFUSION,
00249     SP_BULLET,
00250     SP_UNUSED1,
00251     SP_REMOVE_DEPLETION,
00252     SP_PROBE,
00253     SP_TOWN_PORTAL,
00254     SP_CREATE_FOOD,
00255     SP_WOR,
00256     SP_CHARGING,
00257     SP_GREATER_HEAL,
00258     SP_RESTORATION,
00259     SP_PROT_COLD,
00260     SP_PROT_FIRE,
00261     SP_PROT_ELEC,
00262     SP_PROT_POISON,
00263     SP_CONSECRATE,
00264     SP_FINGER_DEATH,
00265     SP_CAUSE_COLD,
00266     SP_CAUSE_FLU,
00267     SP_CAUSE_LEPROSY,
00268     SP_CAUSE_SMALLPOX,
00269     SP_CAUSE_PNEUMONIC_PLAGUE,
00270     SP_METEOR,
00271     SP_METEOR_SWARM,
00272     SP_POISON_FOG,
00273     SP_BULLET_SWARM,
00274     SP_BULLET_STORM,
00275     SP_DESTRUCTION,
00276     SP_BOMB,
00277     SP_CURE_CONFUSION,
00278     SP_TRANSFORM_WEALTH,
00279     SP_MAGIC_MISSILE,
00280     SP_RAIN_HEAL,
00281     SP_PARTY_HEAL,
00282     SP_FROSTBOLT,
00283     SP_FIREBOLT,
00284     SP_LIGHTNING,
00285     SP_FORKED_LIGHTNING,
00286     SP_NEGABOLT,
00287     SP_HOLYWORD
00288 };
00289 
00290 spell_struct spells[NROFREALSPELLS];
00291 
00293 #define PATH_SP_MULT(op, spell) (((op->path_attuned & spell->path) ? 0.8 : 1) * ((op->path_repelled & spell->path) ? 1.25 : 1))
00294 #define PATH_DMG_MULT(op, spell) (((op->path_attuned & spell->path) ? 1.25 : 1) * ((op->path_repelled & spell->path) ? 0.7 : 1))
00295 
00296 extern char *spellpathnames[NRSPELLPATHS];
00297 extern archetype *spellarch[NROFREALSPELLS];
00298 
00304 #define CAST_NORMAL 0
00305 
00306 #define CAST_WAND 1
00307 
00308 #define CAST_ROD 2
00309 
00310 #define CAST_HORN 3
00311 
00312 #define CAST_SCROLL 4
00313 
00314 #define CAST_POTION 5
00315 
00318 #define CAST_NPC 6
00319 
00323 #define TRANSFORM_WEALTH_SACRIFICE 0.80f
00324 
00326 #define SPELL_MISS_ROLL_MIN 20
00327 
00328 #define SPELL_MISS_ROLL_MAX 35
00329 
00330 #endif