Go to the documentation of this file.
53 FILE *deadplayer, *liveplayer;
60 const char *race = NULL;
71 LOG(
llevError,
"resurrect_player: race set to %s, but no treasurelist of that name!\n",
spell->race);
81 LOG(
llevError,
"resurrect_player: got null treasure from treasurelist %s!\n",
spell->race);
90 strcpy(newname,
path);
91 strcat(newname,
".pl");
93 strcpy(oldname, newname);
94 strcat(oldname,
".dead");
96 if (!(deadplayer = fopen(oldname,
"r"))) {
98 "The soul of %s cannot be reached.",
103 if (!access(newname, 0)) {
105 "The soul of %s has already been reborn!",
112 if (liveplayer == NULL) {
114 "The soul of %s cannot be re-embodied at the moment.",
120 while (!feof(deadplayer)) {
121 if ( fgets(
buf, 255, deadplayer) == NULL )
break;
122 sscanf(
buf,
"%s", buf2);
123 if (!(strcmp(buf2,
"exp"))) {
124 sscanf(
buf,
"%s %" FMT64, buf2, &exp);
125 if (
spell->stats.exp) {
126 exp -= exp/
spell->stats.exp;
127 snprintf(
buf,
sizeof(
buf),
"exp %" FMT64 "\n", exp);
130 if (!(strcmp(buf2,
"Con"))) {
131 sscanf(
buf,
"%s %d", buf2, &
Con);
135 snprintf(
buf,
sizeof(
buf),
"Con %d\n",
Con);
137 if (race && !strcmp(buf2,
"race")) {
138 snprintf(
buf,
sizeof(
buf),
"race %s\n", race);
140 fputs(
buf, liveplayer);
144 "The soul of %s cannot be re-embodied at the moment.",
183 char name_to_resurrect[
MAX_BUF];
184 char *corpse_account = NULL;
185 int leveldead = 25, mflags, clevel;
188 int spell_success = 0;
192 if (
spell->last_heal) {
199 safe_strncpy(name_to_resurrect, arg,
sizeof(name_to_resurrect));
223 "You need a body for this spell.");
231 if (corpse_account) strcpy(corpse_account,
temp->slaying);
243 leveldead =
temp->level;
249 if (
spell->randomitems) {
252 for (
t =
spell->randomitems->items;
t;
t =
t->next) {
261 free(corpse_account);
262 return spell_success;
283 chance += levelcaster-leveldead;
286 if (chance >
rndm(0, 19))
308 strcat(newname,
".dead");
310 if (rename(
filename, newname) != 0) {
311 LOG(
llevError,
"Cannot rename dead player's file %s into %s: %s\n",
filename, newname, strerror(errno));
316 LOG(
llevError,
"Could not edit the account to indicate permanent death for %s!\n",
op->name);
void LOG(LogLevel logLevel, const char *format,...)
int make_perma_dead(object *op)
int of_close(OutputFile *of)
FILE * of_open(OutputFile *of, const char *fname)
arch
DIALOGCHECK MINARGS 1 MAXARGS 1
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...) PRINTF_ARGS(6
treasurelist * find_treasurelist(const char *name)
void dead_player(object *op)
int cast_raise_dead_spell(object *op, object *caster, object *spell, int dir, const char *arg)
#define MSG_TYPE_SPELL_SUCCESS
static event_registration m
void object_free_drop_inventory(object *ob)
short freearr_y[SIZEOFFREE]
a copper bar weighs and has a value of
int unmake_perma_dead(char *account, char *player)
with a maximum of six This is not so if you are wearing plate you receive no benefit Armour is additive with all the supplementry forms of which means that it lasts until the next semi permanent spell effect is cast upon the character spell
int caster_level(const object *caster, const object *spell)
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
pluglist shows those as well as a short text describing each the list will simply appear empty The keyword for the Python plugin is Python plugout< keyword > Unloads a given identified by its _keyword_ So if you want to unload the Python you need to do plugout Python plugin< libname > Loads a given whose _filename_ is libname So in the case of you d have to do a plugin cfpython so Note that all filenames are relative to the default plugin path(SHARE/plugins). Console messages. ----------------- When Crossfire starts
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
static int resurrection_fails(int levelcaster, int leveldead)
#define MSG_TYPE_SPELL_FAILURE
int get_map_flags(mapstruct *oldmap, mapstruct **newmap, int16_t x, int16_t y, int16_t *nx, int16_t *ny)
archetype * find_archetype(const char *name)
int summon_hostile_monsters(object *op, int n, const char *monstername)
object * arch_to_object(archetype *at)
void object_remove(object *op)
static int resurrect_player(object *op, char *playername, object *spell, char *accountname)
int rndm(int min, int max)
short freearr_x[SIZEOFFREE]