ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/player.C
(Generate patch)

Comparing deliantra/server/server/player.C (file contents):
Revision 1.107 by root, Wed Mar 14 04:12:29 2007 UTC vs.
Revision 1.110 by root, Mon Apr 16 06:23:43 2007 UTC

124 continue; 124 continue;
125 125
126 if (*buf == '%') 126 if (*buf == '%')
127 { /* send one news */ 127 { /* send one news */
128 if (size > 0) 128 if (size > 0)
129 draw_ext_info_format (NDI_UNIQUE | NDI_GREEN, 0, op, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_NEWS, "INFORMATION: %s\n%s", "%s\n%s", subject, news); /*send previously read news */ 129 draw_ext_info_format (NDI_UNIQUE | NDI_GREEN, 0, op, MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_NEWS, "INFORMATION: %s\n%s", (char *)"%s\n%s", subject, news); /*send previously read news */
130 130
131 strcpy (subject, buf + 1); 131 strcpy (subject, buf + 1);
132 strip_endline (subject); 132 strip_endline (subject);
133 size = 0; 133 size = 0;
134 news[0] = '\0'; 134 news[0] = '\0';
144 size += strlen (buf); 144 size += strlen (buf);
145 } 145 }
146 } 146 }
147 147
148 draw_ext_info_format (NDI_UNIQUE | NDI_GREEN, 0, op, 148 draw_ext_info_format (NDI_UNIQUE | NDI_GREEN, 0, op,
149 MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_NEWS, "INFORMATION: %s\n%s\n", "%s\n%s", subject, news); 149 MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_NEWS, "INFORMATION: %s\n%s\n", (char *)"%s\n%s", subject, news);
150 close_and_delete (fp, comp); 150 close_and_delete (fp, comp);
151} 151}
152 152
153/* This loads the first map an puts the player on it. */ 153/* This loads the first map an puts the player on it. */
154static void 154static void
315player::player () 315player::player ()
316{ 316{
317 /* There are some elements we want initialised to non zero value - 317 /* There are some elements we want initialised to non zero value -
318 * we deal with that below this point. 318 * we deal with that below this point.
319 */ 319 */
320 outputs_sync = 16; /* Every 2 seconds */ 320 outputs_sync = 6; /* Every 2 seconds */
321 outputs_count = 8; /* Keeps present behaviour */ 321 outputs_count = 10; /* Keeps present behaviour */
322 unapply = unapply_nochoice; 322 unapply = unapply_nochoice;
323 323
324 savebed_map = first_map_path; /* Init. respawn position */ 324 savebed_map = first_map_path; /* Init. respawn position */
325 325
326 gen_sp_armour = 10; 326 gen_sp_armour = 10;
877 char buf[MAX_BUF]; 877 char buf[MAX_BUF];
878 878
879 /* this must before then initial items are given */ 879 /* this must before then initial items are given */
880 esrv_new_player (op->contr, op->weight + op->carrying); 880 esrv_new_player (op->contr, op->weight + op->carrying);
881 881
882 treasurelist *tl = find_treasurelist ("starting_wealth"); 882 treasurelist *tl = treasurelist::find ("starting_wealth");
883 if (tl) 883 if (tl)
884 create_treasure (tl, op, 0, 0, 0); 884 create_treasure (tl, op, 0, 0, 0);
885 885
886 INVOKE_PLAYER (BIRTH, op->contr); 886 INVOKE_PLAYER (BIRTH, op->contr);
887 INVOKE_PLAYER (LOGIN, op->contr); 887 INVOKE_PLAYER (LOGIN, op->contr);
2439 new_draw_info (NDI_UNIQUE, 0, op, "Your invisibility spell runs out."); 2439 new_draw_info (NDI_UNIQUE, 0, op, "Your invisibility spell runs out.");
2440 } 2440 }
2441 } 2441 }
2442 2442
2443 if (op->contr->outputs_sync) 2443 if (op->contr->outputs_sync)
2444 {
2445 for (i = 0; i < NUM_OUTPUT_BUFS; i++) 2444 for (i = 0; i < NUM_OUTPUT_BUFS; i++)
2446 if (op->contr->outputs[i].buf && (op->contr->outputs[i].first_update + op->contr->outputs_sync) < (uint16) pticks) 2445 if (op->contr->outputs[i].buf && (op->contr->outputs[i].first_update + op->contr->outputs_sync) < (uint16) pticks)
2447 flush_output_element (op, &op->contr->outputs[i]); 2446 flush_output_element (op, &op->contr->outputs[i]);
2448 }
2449 2447
2450 if (op->contr->ns->state == ST_PLAYING) 2448 if (op->contr->ns->state == ST_PLAYING)
2451 { 2449 {
2452 /* these next three if clauses make it possible to SLOW DOWN 2450 /* these next three if clauses make it possible to SLOW DOWN
2453 hp/grace/spellpoint regeneration. */ 2451 hp/grace/spellpoint regeneration. */
2909 op->stats.hp = op->stats.maxhp; 2907 op->stats.hp = op->stats.maxhp;
2910 op->stats.sp = MAX (op->stats.sp, op->stats.maxsp); 2908 op->stats.sp = MAX (op->stats.sp, op->stats.maxsp);
2911 op->stats.grace = MAX (op->stats.grace, op->stats.maxgrace); 2909 op->stats.grace = MAX (op->stats.grace, op->stats.maxgrace);
2912 2910
2913 /* 2911 /*
2914 * Check to see if the player is in a shop. IF so, then check to see if
2915 * the player has any unpaid items. If so, remove them and put them back 2912 * Check to see if the player has any unpaid items. If so, remove them
2916 * in the map. 2913 * and put them back in the map.
2917 */ 2914 */
2918
2919 if (is_in_shop (op))
2920 remove_unpaid_objects (op->inv, op); 2915 remove_unpaid_objects (op->inv, op);
2921 2916
2922 /****************************************/ 2917 /****************************************/
2923 /* */ 2918 /* */
2924 /* Move player to his current respawn- */ 2919 /* Move player to his current respawn- */
2925 /* position (usually last savebed) */ 2920 /* position (usually last savebed) */
3374 char buf[MAX_BUF]; /* tmp. string buffer */ 3369 char buf[MAX_BUF]; /* tmp. string buffer */
3375 int i = 0, j = 0; 3370 int i = 0, j = 0;
3376 3371
3377 /* get the appropriate treasurelist */ 3372 /* get the appropriate treasurelist */
3378 if (atnr == ATNR_FIRE) 3373 if (atnr == ATNR_FIRE)
3379 trlist = find_treasurelist ("dragon_ability_fire"); 3374 trlist = treasurelist::find ("dragon_ability_fire");
3380 else if (atnr == ATNR_COLD) 3375 else if (atnr == ATNR_COLD)
3381 trlist = find_treasurelist ("dragon_ability_cold"); 3376 trlist = treasurelist::find ("dragon_ability_cold");
3382 else if (atnr == ATNR_ELECTRICITY) 3377 else if (atnr == ATNR_ELECTRICITY)
3383 trlist = find_treasurelist ("dragon_ability_elec"); 3378 trlist = treasurelist::find ("dragon_ability_elec");
3384 else if (atnr == ATNR_POISON) 3379 else if (atnr == ATNR_POISON)
3385 trlist = find_treasurelist ("dragon_ability_poison"); 3380 trlist = treasurelist::find ("dragon_ability_poison");
3386 3381
3387 if (trlist == NULL || who->type != PLAYER) 3382 if (trlist == NULL || who->type != PLAYER)
3388 return; 3383 return;
3389 3384
3390 for (i = 0, tr = trlist->items; tr != NULL && i < level - 1; tr = tr->next, i++); 3385 for (i = 0, tr = trlist->items; tr != NULL && i < level - 1; tr = tr->next, i++);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines