Atrinik Server  4.0
Functions
spell_effect.c File Reference
#include <global.h>
#include <arch.h>
#include <player.h>
#include <object.h>
#include <disease.h>

Go to the source code of this file.

Functions

void cast_magic_storm (object *op, object *tmp, int lvl)
 
int recharge (object *op)
 
int cast_create_food (object *op, object *caster, int dir, const char *stringarg)
 
int cast_wor (object *op, object *caster)
 
void cast_destruction (object *op, object *caster, int dam)
 
int cast_heal_around (object *op, int level, int type)
 
int cast_heal (object *op, object *caster, int level, object *target, int spell_type)
 
int cast_change_attr (object *op, object *caster, object *target, int spell_type)
 
int cast_remove_depletion (object *op, object *target)
 
int remove_curse (object *op, object *target, int type, int src)
 
int do_cast_identify (object *tmp, object *op, int mode, int *done, int level)
 
int cast_identify (object *op, int level, object *single_ob, int mode)
 
int cast_consecrate (object *op)
 
int finger_of_death (object *op, object *target)
 
int cast_cause_disease (object *op, object *caster, int dir, struct archetype *disease_arch, int type)
 
int cast_transform_wealth (object *op)
 

Detailed Description

Various spell effects.

Definition in file spell_effect.c.

Function Documentation

int cast_cause_disease ( object op,
object caster,
int  dir,
struct archetype disease_arch,
int  type 
)

Let's try to infect something.

Parameters
opWho is casting.
casterWhat object is casting.
dirCast direction.
disease_archArchetype of the disease.
typeID of the spell.
Return values
0No one caught anything.
1At least one living was affected.

Definition at line 1156 of file spell_effect.c.

int cast_change_attr ( object op,
object caster,
object target,
int  spell_type 
)

Cast some stat-improving spell.

Parameters
opWho is casting.
casterWhat is casting.
targetTarget of the caster; who is receiving the spell.
spell_typeID of the spell.
Return values
0Spell failed.
1Spell was successful.

Definition at line 638 of file spell_effect.c.

int cast_consecrate ( object op)

A spell to make an altar your god's.

Parameters
opWho is casting.
Return values
0No consecration happened.
1An altar was consecrated.

Definition at line 1035 of file spell_effect.c.

int cast_create_food ( object op,
object caster,
int  dir,
const char *  stringarg 
)

Create food.

Allows the choice of what sort of food object to make. If stringarg is NULL, it will create food dependent on level.

Parameters
opWho is casting.
casterWhat is casting.
dirCasting direction.
stringargOptional parameter specifying what kind of items to create.
Return values
0No food created.
1Food was created.
Todo:
Looping the global arch table is not an ideal case in terms of performance...

Definition at line 138 of file spell_effect.c.

void cast_destruction ( object op,
object caster,
int  dam 
)

Hit all enemies around the caster.

Parameters
opWho is casting.
casterWhat object is casting.
damBase damage to do.
attacktypeAttacktype.

Definition at line 259 of file spell_effect.c.

int cast_heal ( object op,
object caster,
int  level,
object target,
int  spell_type 
)

Heals something.

Parameters
opWho is casting.
casterObject that is casting.
levelLevel of the skill.
targetTarget.
spell_typeID of the spell.

Definition at line 404 of file spell_effect.c.

int cast_heal_around ( object op,
int  level,
int  type 
)

Cast an area of effect healing spell.

Parameters
opObject.
levelLevel of the spell being cast.
typeID of the spell.
Returns
1 on success, 0 on failure.

Definition at line 326 of file spell_effect.c.

int cast_identify ( object op,
int  level,
object single_ob,
int  mode 
)

Cast identify spell.

Parameters
opObject receiving the spell effects.
levelLevel of the identification.
single_obIf set, and mode is IDENTIFY_MARKED, only this object will be identified, otherwise contents of this object. If NULL, the inventory of 'op' will be identified.
modeOne of Identify modes.
Returns
Number of objects identified.

Definition at line 997 of file spell_effect.c.

void cast_magic_storm ( object op,
object tmp,
int  lvl 
)

This is really used mostly for spell fumbles at the like.

Parameters
opWhat is casting this.
tmpObject to propagate.
lvlHow nasty should the propagation be.

Definition at line 45 of file spell_effect.c.

int cast_remove_depletion ( object op,
object target 
)

Cast remove depletion spell.

Parameters
opObject casting this.
targetTarget.
Returns
0 on failure or if there's no depletion, number of stats cured otherwise.

Definition at line 759 of file spell_effect.c.

int cast_transform_wealth ( object op)

Transform wealth spell.

Parameters
opWho is casting.
Returns
1 on success, 0 otherwise.

Definition at line 1272 of file spell_effect.c.

int cast_wor ( object op,
object caster 
)

Word of recall causes the player to return 'home'.

We put a force into the player object, so that there is a time delay effect.

Parameters
opWho is casting.
casterWhat is casting.
Returns
1 on success, 0 otherwise.

Definition at line 211 of file spell_effect.c.

int do_cast_identify ( object tmp,
object op,
int  mode,
int *  done,
int  level 
)

Actually identify an object when casting identify.

Parameters
tmpWhat to identify.
opWho is receiving the spell effect.
modeOne of Identify modes.
[out]doneContains the number of objects identified so far.
levelMaximum level of items we can identify.
Returns
1 if we can keep identifying items, 0 otherwise.

Definition at line 945 of file spell_effect.c.

int finger_of_death ( object op,
object target 
)

Finger of death spell.

If target is undead, the spell will restore target to max health instead of damaging it.

Parameters
opCaster.
targetTarget.
Returns
1.

Definition at line 1108 of file spell_effect.c.

int recharge ( object op)

Recharge wands.

Parameters
opWho is casting.
Return values
0Nothing happened.
1Wand was recharged, or destroyed.

Definition at line 71 of file spell_effect.c.

int remove_curse ( object op,
object target,
int  type,
int  src 
)

Cast remove curse or remove damnation.

Parameters
opCaster object.
targetTarget.
typeID of the spell.
srcWhere the spell comes from.
Returns
0 on failure / no cursed items, number of objects uncursed otherwise.

Definition at line 848 of file spell_effect.c.