/
roa/
roa/lib/boards/
roa/lib/config/
roa/lib/edits/
roa/lib/help/
roa/lib/misc/
roa/lib/plrobjs/
roa/lib/quests/
roa/lib/socials/
roa/lib/www/
roa/lib/www/LEDSign/
roa/lib/www/LEDSign/fonts/
roa/lib/www/LEDSign/scripts/
roa/src/s_inc/
roa/src/sclient/
roa/src/sclient/binary/
roa/src/sclient/text/
roa/src/util/
/************************************************************************
	Realms of Aurealis 		James Rhone aka Vall of RoA

magic.h					Protos, structures, defines for
					much of the RoA magic system.

		******** Heavily modified and expanded ********
		******** 100% Completely Original Code ********
		*** BE AWARE OF ALL RIGHTS AND RESERVATIONS ***
		******** Heavily modified and expanded ********
		******** 100% Completely Original Code ********
		        All rights reserved henceforth. 

    Please note that no guarantees are associated with any code from
Realms of Aurealis.  All code which has been released to the general
public has been done so with an 'as is' pretense.  RoA is based on both
Diku and CircleMUD and ALL licenses from both *MUST* be adhered to as well
as the RoA license.   *** Read, Learn, Understand, Improve ***
*************************************************************************/
#ifndef ROA_MAGIC_H
#define ROA_MAGIC_H

// magical functions in nature
int manause(chdata *ch, int spl);
BOOL saves_spell(chdata *ch, int spell);
BOOL check_truce(chdata *ch, chdata *vict);
struct room_affect_type *spell_affects_room(int room, int spell);
BOOL char_affects_room(chdata *ch, int spell);
struct room_affect_type *char_spell_affects_room(chdata *ch, int spell, int room);
void char_spell_affect_from_room(chdata *ch, int spell, int room);
void do_cast_spell(int spell, chdata *ch, char *arg, int type, 
		   chdata *vict, obdata *ob);
void affect_to_room(int room, struct room_affect_type *af);
void spell_affect_from_room(int spell, int room); // roomact.c
int get_spell_min_level(chdata *ch, int spell);

// From sparse.c
int SpellDamage(CharData *ch, CharData *victim, int dam, int spell, BOOL rgdls);

///////////////////////////////////////////////////////
// for General skills and dialects...
///////////////////////////////////////////////////////
#define LANG_COMMON		   	0
#define LANG_ELVEN		   	1
#define LANG_ORCISH		   	2
#define LANG_OGRE		   	3
#define LANG_DROW		   	4
#define LANG_DWARVEN		   	5
#define LANG_IXISH		   	6
#define LANG_DRAGON		   	7
// MAX_DIALECTS is 8 or LANG_DRAGON - 1

#define GSKILL_RUNIC			8
// all GSKILLS must lie below MAX_GSKILLS

// for GSKILL_FLAGS
#define G_DIALECT		(1 << 0)

// GSKILL_RCFLAGS are defined as general RCFLAGS in defines.h


///////////////////////////////////////////////////////
// for Regular SKILLS/SPELLS... skill_names and such...
///////////////////////////////////////////////////////
#define TYPE_UNDEFINED               	-1
#define TYPE_REGARDLESS              	 0 // used for damage regardless 
#define SKILL_ZERO              	 0 // used for placeholder 
#define SPELL_ARMOR                  	 1 
#define SPELL_TELEPORT               	 2 
#define SPELL_BLESS                  	 3 
#define SPELL_BLINDNESS              	 4 
#define SPELL_BURNING_HANDS          	 5 
#define SPELL_CALL_LIGHTNING         	 6
#define SPELL_CHARM_PERSON           	 7 
#define SPELL_CHILL_TOUCH            	 8 
// SPELL_CLONE changed to SPELL_KNOCK 4/20/98 -jtrhone
#define SPELL_KNOCK                  	 9 
#define SPELL_COLOUR_SPRAY           	10 
#define SPELL_CONTROL_WEATHER        	11 
#define SPELL_CREATE_FOOD            	12 
#define SPELL_CREATE_WATER           	13 
#define SPELL_CURE_BLIND             	14 
#define SPELL_CURE_CRITIC            	15 
#define SPELL_CURE_LIGHT             	16 
#define SPELL_CURSE                  	17 
#define SPELL_DETECT_EVIL            	18 
#define SPELL_DETECT_INVISIBLE       	19 
#define SPELL_DETECT_MAGIC           	20 
#define SPELL_DETECT_POISON          	21 
#define SPELL_DISPEL_EVIL            	22 
#define SPELL_EARTHQUAKE             	23 
#define SPELL_ENCHANT_WEAPON         	24 
#define SPELL_ENERGY_DRAIN           	25 
#define SPELL_FIREFLASH               	26 
#define SPELL_HARM                   	27 
#define SPELL_HEAL                   	28 
#define SPELL_INVISIBLE              	29 
#define SPELL_LIGHTNING_BOLT         	30 
#define SPELL_LOCATE_OBJECT          	31 
#define SPELL_MAGIC_MISSILE          	32 
#define SPELL_POISON                 	33 
#define SPELL_PROTECT_FROM_EVIL      	34 
#define SPELL_REMOVE_CURSE           	35 
#define SPELL_SANCTUARY              	36 
#define SPELL_SHOCKING_GRASP         	37 
#define SPELL_SLEEP                  	38 
#define SPELL_STRENGTH               	39 
#define SPELL_SUMMON                 	40 
#define SPELL_FIRESTORM          	41 
#define SPELL_WORD_OF_RECALL         	42 
#define SPELL_REMOVE_POISON          	43 
#define SPELL_SENSE_LIFE             	44 
#define SPELL_FEAR 		     	45
#define SPELL_HASTE		     	46
#define SPELL_SLOW		     	47
#define SPELL_MIRRORIMAGE            	48
#define SPELL_WINGS		     	49
#define SPELL_GILLS		     	50
#define SPELL_P_HEAL                 	51
#define SPELL_IMPLOSION		     	52
#define SPELL_GATEWAY		     	53
#define SPELL_IDENTIFY               	54
#define SPELL_ICE_SHAFT		     	55
/* for unique song numbers */
#define SPELL_SONG_BOG		     	56
#define SPELL_SONG_BAAN		     	57
#define SPELL_SONG_AMITAR	     	58
#define SPELL_SONG_SOUL		     	59
#define SPELL_SONG_BALM		     	60
#define SPELL_PROTECT_FROM_GOOD		61
#define SPELL_STONE_SKIN		62
#define SPELL_HOLD_PERSON		63
#define SPELL_CALM		        64
#define SPELL_ILLUMINATE	        65
#define SPELL_PROTECT_UNDEAD		66
#define SPELL_LOCATE_BEING		67
#define SPELL_VIEW_HIDDEN		68
#define SPELL_SILENCE			69
#define SPELL_FIREWALL			70
#define SPELL_ICEWALL			71
#define SPELL_TYPHOON			72
#define SPELL_VOID			73
#define SPELL_GASCLOUD			74
#define SPELL_BLINDWALL			75
#define SPELL_CONFUSION			76
#define SPELL_SWARM			77
#define SPELL_RETRIEVE_CORPSE		78
#define SPELL_MINDTRAP			79
#define SKILL_NOTRACK		        80
#define SKILL_SNEAK                     81 
#define SKILL_STEAL                     82 
#define SKILL_HIDE                      83 
#define SKILL_BACKSTAB                  84
#define SKILL_PICK_LOCK                 85 
#define SKILL_FIRST_AID		        86
#define SKILL_DUAL		        87
#define SKILL_CIRCLE		        88
#define SPELL_RECHARGE			89
#define SPELL_SHOWEROFLIFE		90
#define SPELL_CURSED_GROUNDS		91
#define SPELL_ABSOLUTE_WARD		92
#define SPELL_CIRCLE_OF_WARDING		93
#define SPELL_WALLOFFOG			94
#define SKILL_BLINDSTRIKE		95
#define SKILL_JAMLOCK			96
#define SKILL_POISONBLADE		97
#define SKILL_FORTIFY		        98
#define SKILL_GRAPPLE		        99
#define SKILL_SHIELDBLOCK	        100
#define SKILL_KICK                      101
#define SKILL_BASH                      102 
#define SKILL_RESCUE                    103 
#define SKILL_DOUBLE  		        104
#define SKILL_TRIPLE		        105
#define SKILL_DISARM		        106
#define SKILL_STUNTOUCH		        107
#define SKILL_HURL                      108
/* shaman stuff sorta prolly */
#define SKILL_PURGE		   	109
#define SKILL_PARRY		   	110
#define SKILL_DODGE		   	111
#define SKILL_ELUSION		   	112
#define SKILL_FORTITUDE		   	113
#define SKILL_SP_STRENGTH	   	114
#define SKILL_PROTECTION	   	115
#define SKILL_TRUESIGHT 	   	116
#define SKILL_EAGLE_EYES	   	117
#define SKILL_SNAKE_FIRE	   	118
#define SKILL_ENDURANCE		   	119
#define SKILL_HEAL		   	120
#define SKILL_LOCATION		   	121
#define SKILL_TRUCE		   	122
#define SKILL_FANG		   	123
#define SKILL_CROW		   	124
#define SKILL_CLAWS		   	125
#define SKILL_WOLF		   	126
#define SKILL_STONE		   	127
#define SKILL_DETECTTRAP		128
#define SKILL_DETECTSNARE		129
#define SKILL_REMOVETRAP		130
#define SKILL_REMOVESNARE		131
#define SKILL_DARTTRAP	  		132
#define SKILL_POISONTRAP  		133
#define SKILL_FIRETRAP  		134
#define SKILL_LIGHTNINGTRAP  		135
#define SKILL_EAVESDROP  		136
#define SKILL_BREW 	 		137
#define SKILL_TPOISON 	 		138
#define SKILL_SEALEXIT 	 		139
/* ranger skills */
#define SKILL_FORAGE		   	140
#define SKILL_HEALWOUNDS	   	141
#define SKILL_DIVINE		   	142
#define SKILL_SKIN		   	143
#define SKILL_FILET		   	144
#define SKILL_BEFRIEND		   	145
#define SKILL_CAMOUFLAGE	   	146
#define SKILL_WHIRLWIND		   	147
#define SKILL_SILENTWALK	   	148
#define SKILL_SWEEP		   	149
#define SKILL_WAR_ENDURANCE	   	150
#define SKILL_REDIRECT		   	151
#define SKILL_FENGAGE		   	152
#define SKILL_CALL_WILDLIFE	   	153
#define SKILL_BECOME		   	154
#define SKILL_PRESENCE		   	155
#define SPELL_FOREST_SIGHT         	156
#define SKILL_TREK		   	157
#define SKILL_CREATE_TORCH	   	158
#define SPELL_POISON_DART	   	159
#define SKILL_SING		   	160
#define SKILL_PLAY		   	161
#define SKILL_CRAFT		   	162
// more rangers...
#define SKILL_TRAILBLAZE	   	163
#define SPELL_EARTHDARTS	   	164
#define SPELL_SPIRITLEAVES	   	165
#define SPELL_ENTANGLE 		   	166
#define SPELL_BARKSKIN 		   	167
#define SPELL_SPIRITBALM 	   	168
#define SPELL_SPIRITSHOCK 	   	169
/* monk begin here */
#define SKILL_AURA		   	170
#define SKILL_SENSE		   	171
#define SKILL_ROLL		   	172
#define SKILL_SNARL		   	173
#define SKILL_RAZOR		   	174
#define SKILL_LEVITATE		   	175
#define SKILL_OM		   	176
#define SKILL_MOK		   	177
#define SKILL_IRON		   	178
#define SKILL_LEAP		   	179
#define SKILL_FLIP		   	180
#define SKILL_TURTLE		   	181
#define SKILL_WA		   	182
#define SKILL_TRANCE		   	183
#define SKILL_STONE_FINGER	   	184
#define SKILL_FIST		   	185
#define SKILL_HASTEN		   	186
#define SKILL_CLEANSE		   	187
#define SKILL_IRONHAND		   	188
// miscellaneous
#define SKILL_CRIPPLE		   	189
#define SKILL_SUBDUE		   	190
// continue with more ranger stuff
#define SKILL_MEDITATE		   	191
#define SPELL_FORESTEYES	   	192
#define SPELL_ENSNARE		   	193
#define SPELL_OCCLUSION		   	194
#define SPELL_CAMPFIRE		   	195
#define SKILL_CYCLONE		   	196
#define SPELL_SPIRITSHIELD	   	197
// some more misc
#define SPELL_AREA_OF_RETURN	   	198
#define SPELL_RETURN		   	199
#define SPELL_PROJECT		   	200
// Druid stuff. 03/31/98 -callahan
#define SPELL_FOREST_EMBRACE		201
#define SPELL_OBSCURE_PASSING		202
#define SPELL_TREESKIN			203
#define SPELL_KNOW_ALIGNMENT		204
#define SPELL_PROTECT_FROM_POISON	205
#define SPELL_NATURE_COMMUNION		206
#define SPELL_PROTECT_FROM_FIRE		207
#define SPELL_PROTECT_FROM_COLD		208
#define SPELL_PROTECT_FROM_DRAGON	209
#define SPELL_ANIMAL_SUMMONING		210
#define SPELL_WATER_WALK		211
#define SPELL_NATURES_CALTROPS		212
#define SPELL_FOREST_WARRIOR		213
#define SPELL_TONGUES			214
#define SPELL_WALL_BRAMBLES		215
#define SPELL_ANIMATE_DEAD		216
#define SPELL_AIR_WALK			217
#define SPELL_TRUE_SEEING		218
#define SPELL_THORNSTORM		219
#define SPELL_FIRE_SERVANT		220
#define SPELL_WALL_FIRE			221
#define SPELL_EARTH_SERVANT		222
#define SPELL_HOLD_ANIMAL		223
#define SPELL_ROCK_TO_MUD		224
#define SPELL_SHAPECHANGE		225
#define SPELL_WOODBRITTLE		226
#define SPELL_INSECT_DEATH		227
#define SKILL_SETSNARE			228
#define SKILL_LOWSTRIKE			229
#define SKILL_BLADEDANCE		230
#define SKILL_SHADOWWALK		231
#define SKILL_SIDESTEP			232
#define SKILL_DISEMBOWEL		233
#define SKILL_DETECTSECRET		234
#define SKILL_TUMBLE			235
#define SKILL_OBSCURE			236
#define SKILL_HAMSTRING			237
#define SKILL_ASSASSINATE		238
#define SKILL_DOORBASH			239
#define SPELL_ARMOR_GOLEM		240
#define SPELL_FORCEFUL_WIND		241
#define SPELL_CHAIN_LIGHTNING		242
#define SPELL_FIREBALL			243

// non traditionals start here...
#define SPELL_FIRE_BREATH          	250
#define SPELL_GAS_BREATH           	251
#define SPELL_FROST_BREATH         	252
#define SPELL_ACID_BREATH          	253
#define SPELL_LIGHTNING_BREATH     	254

/* we'll stop at MAX_SKILLS , 1 - MAX_SKILLS-1 tis the size of the skill array */

/* other damage types above and beyond skills */
// updated numbers and associated messages in message file
#define TYPE_SUFFERING               	1500

#define TYPE_HIT                     	2000
#define TYPE_BLUDGEON                	2001
#define TYPE_PIERCE                  	2002
#define TYPE_BACKSTAB                	TYPE_PIERCE 
#define TYPE_SLASH                   	2003
#define TYPE_BLAST		     	2004
#define TYPE_WHIP                    	2005  
#define TYPE_NO_BS_PIERCE	   	2006
#define TYPE_CLAW                    	2007 
#define TYPE_BITE                    	2008
#define TYPE_STING                   	2009 
#define TYPE_CRUSH                   	2010
#define TYPE_BDEFINED		     	2011

/* for saving throws -roa */
#define SV_HEAT		0
#define SV_COLD		1
#define SV_MAGIC	2
#define SV_POISON	3
#define SV_BREATH	4

#define TAR_IGNORE        (1 << 0)
#define TAR_CHAR_ROOM     (1 << 1)
#define TAR_CHAR_WORLD    (1 << 2)
#define TAR_FIGHT_SELF    (1 << 3)
#define TAR_FIGHT_VICT    (1 << 4)
#define TAR_SELF_ONLY     (1 << 5)
/* Only a check, use with ei. TAR_CHAR_ROOM */
#define TAR_SELF_NONO     (1 << 6)
#define TAR_OBJ_INV       (1 << 7)
#define TAR_OBJ_ROOM      (1 << 8)
#define TAR_OBJ_WORLD     (1 << 9)
#define TAR_OBJ_EQUIP     (1 << 10)

// 10-28-96, new spell types for bitvector first 10 are for how
// 10 - 30 will be other flags, primarily type flags, like S_MAGIC_MANA
// S_MAGIC_FIRE, S_POISON, S_BREATH_FIRE, etc -roa
#define S_VIOLENT	(1 << 0)
#define S_CASTABLE	(1 << 1)
#define S_POTION	(1 << 2)
#define S_SCROLL	(1 << 3)
#define S_STAFF		(1 << 4)
#define S_WAND		(1 << 5)

#define S_HEAT		(1 << 10)
#define S_COLD		(1 << 11)
#define S_MAGIC		(1 << 12)
#define S_POISON	(1 << 13)
#define S_BREATH	(1 << 14)
#define S_SUMMON	(1 << 15)

#define S_DIALECT	(1 << 20)
#define S_NPCONLY	(1 << 21)

#define FLAG_SPELL(spl, flags)   (SET_BIT(spell_info[(spl)].spell_bits,(flags)))
#define UNFLAG_SPELL(spl, flags) (REMOVE_BIT(spell_info[(spl)].spell_bits,(flags)))
#define SPELL_FLAGGED(spl, flag) (IS_SET(spell_info[(spl)].spell_bits,(flag)))

// return types from spell funcs  2/27/98 -jtrhone
#define SPELL_NORMAL	0
#define SPELL_FAILED	1
#define SPELL_SUCCESS	2

/* NOTE, this info struct now points to the actual SPELL functions
   we dont have ACAST anymore... spell functions assigned in 
   spell_parser.c */
struct spell_info_type 
{
   // function this spell calls
   // update the functions to return an int... so we can send failure messages
   // if need be, or other types... 2/27/98 -jtrhone
   int	(*spell_pointer) (chdata *ch,char *arg, chdata *victim, obdata *obj);

   byte minimum_position;  /* Position for caster / performer */
   ubyte min_usesmana;     /* Amount of mana used by a spell  */
   sh_int beats;           /* Heartbeats until ready for next */
   sh_int targets;    /* See below for use with TAR_XXX  */

   char *wear_off;	// this spells/skills wearoff message
                        // now assigned in sparse.c during bootup...

   // new bitvector for spells, will contain all the info on them
   // even the violent bits/cast/wand/etc/etc eases things a bit
   long spell_bits;    
};

// spell types... spells can be cast from the following...
#define SPELL_TYPE_SPELL   0
#define SPELL_TYPE_POTION  1
#define SPELL_TYPE_WAND    2
#define SPELL_TYPE_STAFF   3
#define SPELL_TYPE_SCROLL  4

// now, define all the protos...
#define ASPELL(spellname) int spellname(chdata *ch, char *arg, chdata *victim, obdata *obj)

ASPELL(spell_fireflash);
ASPELL(spell_chain_lightning);
ASPELL(spell_forceful_wind);
ASPELL(spell_armor_golem);
ASPELL(spell_animate_dead);
ASPELL(spell_magic_missile);
ASPELL(spell_chill_touch);
ASPELL(spell_burning_hands);
ASPELL(spell_shocking_grasp);
ASPELL(spell_lightning_bolt);
ASPELL(spell_colour_spray);
ASPELL(spell_energy_drain);
ASPELL(spell_fireball);
ASPELL(spell_earthquake);
ASPELL(spell_dispel_evil);
ASPELL(spell_call_lightning);
ASPELL(spell_harm);
ASPELL(spell_armor);
ASPELL(spell_teleport);
ASPELL(spell_bless);
ASPELL(spell_blindness);
ASPELL(spell_knock);
ASPELL(spell_control_weather);
ASPELL(spell_create_food);
ASPELL(spell_create_water);
ASPELL(spell_cure_blind);
ASPELL(spell_cure_critic);
ASPELL(spell_cure_light);
ASPELL(spell_curse);
ASPELL(spell_detect_evil);
ASPELL(spell_detect_invisibility);
ASPELL(spell_detect_magic);
ASPELL(spell_detect_poison);
ASPELL(spell_enchant_weapon);
ASPELL(spell_heal);
ASPELL(spell_invisibility);
ASPELL(spell_locate_object);
ASPELL(spell_poison);
ASPELL(spell_protection_from_evil);
ASPELL(spell_protection_from_good);
ASPELL(spell_remove_curse);
ASPELL(spell_remove_poison);
ASPELL(spell_sanctuary);
ASPELL(spell_sleep);
ASPELL(spell_strength);
ASPELL(spell_firestorm);
ASPELL(spell_word_of_recall);
ASPELL(spell_summon);
ASPELL(spell_gateway);
ASPELL(spell_charm_person);
ASPELL(spell_sense_life);
ASPELL(spell_identify);
ASPELL(spell_fire_breath);
ASPELL(spell_frost_breath);
ASPELL(spell_acid_breath);
ASPELL(spell_gas_breath);
ASPELL(spell_lightning_breath);
ASPELL(spell_haste);
ASPELL(spell_mirror_image);
ASPELL(spell_wings);
ASPELL(spell_gills);
ASPELL(spell_power_heal);
ASPELL(spell_implosion);
ASPELL(spell_ice_shaft);
ASPELL(spell_stone_skin);
ASPELL(spell_hold_person);
ASPELL(spell_calm);
ASPELL(spell_illuminate);
ASPELL(spell_protect_undead);
ASPELL(spell_locate_being);
ASPELL(spell_view_hidden);
ASPELL(spell_silence);
ASPELL(spell_firewall);
ASPELL(spell_icewall);
ASPELL(spell_typhoon);
ASPELL(spell_void);
ASPELL(spell_gascloud);
ASPELL(spell_blindwall);
ASPELL(spell_confusion);
ASPELL(spell_swarm);
ASPELL(spell_retrieve_corpse);
ASPELL(spell_mindtrap);
ASPELL(spell_recharge);
ASPELL(spell_shower_of_life);
ASPELL(spell_cursed_grounds);
ASPELL(spell_absolute_ward);
ASPELL(spell_circle_of_warding);
ASPELL(spell_walloffog);
ASPELL(spell_poison_dart);
ASPELL(spell_forest_sight);
ASPELL(spell_earthdarts);
ASPELL(spell_spiritleaves);
ASPELL(spell_entangle);
ASPELL(spell_barkskin);
ASPELL(spell_spiritbalm);
ASPELL(spell_spiritshock);
ASPELL(spell_foresteyes);
ASPELL(spell_ensnare);
ASPELL(spell_occlusion);
ASPELL(spell_campfire);
ASPELL(spell_spiritshield);
ASPELL(spell_area_of_return);
ASPELL(spell_return);
ASPELL(spell_project);

// For Druids. 03/31/98 -callahan
ASPELL(spell_forest_embrace);
ASPELL(spell_obscure_passing);
ASPELL(spell_treeskin);
ASPELL(spell_know_alignment);
ASPELL(spell_protection_from_poison);
ASPELL(spell_nature_communion);
ASPELL(spell_protection_from_fire);
ASPELL(spell_protection_from_cold);
ASPELL(spell_protection_from_dragons);
ASPELL(spell_animal_summoning);
ASPELL(spell_water_walk);
ASPELL(spell_natures_caltrops);
ASPELL(spell_forest_warrior);
ASPELL(spell_tongues);
ASPELL(spell_wall_of_brambles);
ASPELL(spell_air_walk);
ASPELL(spell_true_seeing);
ASPELL(spell_thornstorm);
ASPELL(spell_fire_servant);
ASPELL(spell_wall_of_fire);
ASPELL(spell_earth_servant);
ASPELL(spell_hold_animal);
ASPELL(spell_rock_to_mud);
ASPELL(spell_shapechange);
ASPELL(spell_woodbrittle);
ASPELL(spell_insect_death);
ASPELL(spell_knock);

#endif /* ROA_MAGIC_H */