|
Crossfire Server
1.75.0
|
Resurrection / raise dead related code. More...
#include "global.h"#include <errno.h>#include <stdlib.h>#include <string.h>#include "output_file.h"#include "sproto.h"#include "spells.h"Go to the source code of this file.
Functions | |
| int | cast_raise_dead_spell (object *op, object *caster, object *spell, int dir, const char *arg) |
| This handles the raise dead / resurrection spells. More... | |
| void | dead_player (object *op) |
| Kill a player on a permanent death server with resurrection. More... | |
| static int | resurrect_player (object *op, char *playername, object *spell, char *accountname) |
| Resurrect a player. More... | |
| static int | resurrection_fails (int levelcaster, int leveldead) |
| Will the resurrection succeed? More... | |
Resurrection / raise dead related code.
This is used on servers with permanent death on.
Definition in file resurrection.cpp.
| int cast_raise_dead_spell | ( | object * | op, |
| object * | caster, | ||
| object * | spell, | ||
| int | dir, | ||
| const char * | arg | ||
| ) |
This handles the raise dead / resurrection spells.
So try to revive a player.
| op | who is doing the resurrecting. |
| caster | what is casting the spell (op or a scroll/rod). |
| spell | spell object. |
| dir | direction the spell is cast. |
| arg | name of the player to revive. |
| 0 | spell had no effect, or player couldn't revive. |
| 1 | player revived, or some nasty things happened. |
Definition at line 181 of file resurrection.cpp.
References arch_to_object(), CALLOC, caster_level(), CORPSE, draw_ext_info(), draw_ext_info_format(), find_archetype(), FOR_MAP_FINISH, FOR_MAP_PREPARE, freearr_x, freearr_y, get_map_flags(), treasure::item, treasurelist::items, object::last_heal, object::level, m, object::map, MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, object::name, archetype::name, NDI_UNIQUE, treasure::next, treasure::nrof, object_free_drop_inventory(), object_insert_in_map_at(), object_remove(), P_OUT_OF_MAP, object::randomitems, resurrect_player(), resurrection_fails(), safe_strncpy, object::slaying, summon_hostile_monsters(), object::x, and object::y.
Referenced by cast_spell().
| void dead_player | ( | object * | op | ) |
Kill a player on a permanent death server with resurrection.
| op | player to kill. |
Definition at line 297 of file resurrection.cpp.
References llevError, Settings::localdir, LOG(), make_perma_dead(), MAX_BUF, object::name, Settings::playerdir, and settings.
Referenced by kill_player_permadeath().
|
static |
Resurrect a player.
This may change the player's race, or reduce experience.
| op | who is resurrecting. |
| playername | the name of the player to resurrect. |
| spell | spell that was used to resurrect. |
| accountname | the account the resurrected player belongs to |
| 0 | resurrection failed. |
| 1 | playername is living again. |
Definition at line 52 of file resurrection.cpp.
References buf, treasure::chance, living::Con, draw_ext_info_format(), living::exp, find_treasurelist(), FMT64, treasure::item, treasurelist::items, llevError, Settings::localdir, LOG(), MAX_BUF, MSG_TYPE_SPELL, MSG_TYPE_SPELL_FAILURE, MSG_TYPE_SPELL_SUCCESS, archetype::name, NDI_UNIQUE, treasure::next, of_close(), of_open(), Settings::playerdir, object::race, RANDOM, settings, object::stats, treasurelist::total_chance, and unmake_perma_dead().
Referenced by cast_raise_dead_spell().
|
static |
Will the resurrection succeed?
Rules:
| levelcaster | level at which the spell is cast. |
| leveldead | dead player's level. |
Definition at line 280 of file resurrection.cpp.
References chance(), and rndm().
Referenced by cast_raise_dead_spell().