1 | /* |
1 | /* |
2 | * static char *rcsid_resurrection_c = |
2 | * static char *rcsid_resurrection_c = |
3 | * "$Id: resurrection.C,v 1.3 2006/08/30 16:30:37 root Exp $"; |
3 | * "$Id: resurrection.C,v 1.4 2006/09/03 00:18:42 root Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
66 | if (spell->race) { |
66 | if (spell->race) { |
67 | treasurelist *tl = find_treasurelist(spell->race); |
67 | treasurelist *tl = find_treasurelist(spell->race); |
68 | treasure *t; |
68 | treasure *t; |
69 | int value; |
69 | int value; |
70 | if (!tl) { |
70 | if (!tl) { |
71 | LOG(llevError,"resurrect_player: race set to %s, but no treasurelist of that name!\n", spell->race); |
71 | LOG(llevError,"resurrect_player: race set to %s, but no treasurelist of that name!\n", &spell->race); |
72 | return 0; |
72 | return 0; |
73 | } |
73 | } |
74 | value = RANDOM() % tl->total_chance; |
74 | value = RANDOM() % tl->total_chance; |
75 | for (t=tl->items; t; t=t->next) { |
75 | for (t=tl->items; t; t=t->next) { |
76 | value -= t->chance; |
76 | value -= t->chance; |
77 | if (value<0) break; |
77 | if (value<0) break; |
78 | } |
78 | } |
79 | if (!t) { |
79 | if (!t) { |
80 | LOG(llevError,"resurrect_player: got null treasure from treasurelist %s!\n", spell->race); |
80 | LOG(llevError,"resurrect_player: got null treasure from treasurelist %s!\n", &spell->race); |
81 | return 0; |
81 | return 0; |
82 | } |
82 | } |
83 | race = t->item->name; |
83 | race = t->item->name; |
84 | } |
84 | } |
85 | |
85 | |
… | |
… | |
116 | |
116 | |
117 | while (!feof(deadplayer)) { |
117 | while (!feof(deadplayer)) { |
118 | fgets(buf,255,deadplayer); |
118 | fgets(buf,255,deadplayer); |
119 | sscanf(buf,"%s",buf2); |
119 | sscanf(buf,"%s",buf2); |
120 | if( ! (strcmp(buf2,"exp"))) { |
120 | if( ! (strcmp(buf2,"exp"))) { |
121 | #ifndef WIN32 |
121 | long long exp_; |
122 | sscanf(buf,"%s %lld",buf2,&exp); |
122 | sscanf(buf,"%s %lld",buf2,&exp_); exp = exp_; |
123 | #else |
|
|
124 | sscanf(buf,"%s %I64d",buf2,&exp); |
|
|
125 | #endif |
|
|
126 | if (spell->stats.exp) { |
123 | if (spell->stats.exp) { |
127 | exp-=exp/spell->stats.exp; |
124 | exp-=exp/spell->stats.exp; |
128 | #ifndef WIN32 |
|
|
129 | sprintf(buf,"exp %lld\n",exp); |
125 | sprintf(buf,"exp %lld\n",exp_); exp = exp_; |
130 | #else |
|
|
131 | sprintf(buf,"exp %I64d\n",exp); |
|
|
132 | #endif |
|
|
133 | } |
126 | } |
134 | } |
127 | } |
135 | if(! (strcmp(buf2,"Con"))) { |
128 | if(! (strcmp(buf2,"Con"))) { |
136 | sscanf(buf,"%s %d",buf2,&Con); |
129 | sscanf(buf,"%s %d",buf2,&Con); |
137 | Con -= spell->stats.Con; |
130 | Con -= spell->stats.Con; |
… | |
… | |
169 | |
162 | |
170 | clevel = caster_level(caster, spell); |
163 | clevel = caster_level(caster, spell); |
171 | |
164 | |
172 | if (spell->last_heal) { |
165 | if (spell->last_heal) { |
173 | if (!arg) { |
166 | if (!arg) { |
174 | new_draw_info_format(NDI_UNIQUE, 0,op,"Cast %s on who?", spell->name); |
167 | new_draw_info_format(NDI_UNIQUE, 0,op,"Cast %s on who?", &spell->name); |
175 | return 0; |
168 | return 0; |
176 | } |
169 | } |
177 | strcpy(name_to_resurrect, arg); |
170 | strcpy(name_to_resurrect, arg); |
178 | temp = NULL; |
171 | temp = NULL; |
179 | } else { |
172 | } else { |
… | |
… | |
250 | char filename[MAX_BUF]; |
243 | char filename[MAX_BUF]; |
251 | char newname[MAX_BUF]; |
244 | char newname[MAX_BUF]; |
252 | char path[MAX_BUF]; |
245 | char path[MAX_BUF]; |
253 | |
246 | |
254 | /* set up our paths/strings... */ |
247 | /* set up our paths/strings... */ |
255 | sprintf(path,"%s/%s/%s/%s",settings.localdir,settings.playerdir,op->name, |
248 | sprintf(path,"%s/%s/%s/%s",settings.localdir,settings.playerdir,&op->name, &op->name); |
256 | op->name); |
|
|
257 | |
249 | |
258 | strcpy(filename,path); |
250 | strcpy(filename,path); |
259 | strcat(filename,".pl"); |
251 | strcat(filename,".pl"); |
260 | strcpy(newname,filename); |
252 | strcpy(newname,filename); |
261 | strcat(newname,".dead"); |
253 | strcat(newname,".dead"); |