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

Comparing deliantra/server/server/c_wiz.C (file contents):
Revision 1.58 by root, Tue May 6 16:55:26 2008 UTC vs.
Revision 1.67 by root, Thu Jan 1 16:05:13 2009 UTC

281 return 0; 281 return 0;
282 } 282 }
283 283
284 pl->ob->player_goto (dummy->slaying, dummy->stats.hp, dummy->stats.sp);//TODO 284 pl->ob->player_goto (dummy->slaying, dummy->stats.hp, dummy->stats.sp);//TODO
285 dummy->destroy (); 285 dummy->destroy ();
286
286 new_draw_info (NDI_UNIQUE, 0, pl->ob, "You have been arrested."); 287 new_draw_info (NDI_UNIQUE, 0, pl->ob, "You have been arrested.");
287 new_draw_info (NDI_UNIQUE, 0, op, "OK."); 288 new_draw_info (NDI_UNIQUE, 0, op, "OK.");
288 LOG (llevInfo, "Player %s arrested by %s\n", &pl->ob->name, &op->name); 289 LOG (llevInfo, "Player %s arrested by %s\n", &pl->ob->name, &op->name);
289 return 1; 290 return 1;
290} 291}
450 { 451 {
451 art = find_artifactlist (at->type)->items; 452 art = find_artifactlist (at->type)->items;
452 453
453 while (art) 454 while (art)
454 { 455 {
455 if (!strcmp (art->item->name, cp)) 456 if (!strcmp (&art->item->name, cp))
456 break; 457 break;
457 458
458 art = art->next; 459 art = art->next;
459 } 460 }
460 461
888 new_draw_info (NDI_UNIQUE, 0, op, "Who?"); 889 new_draw_info (NDI_UNIQUE, 0, op, "Who?");
889 return 1; 890 return 1;
890 } 891 }
891 892
892 for_all_players (pl) 893 for_all_players (pl)
893 if (!strcmp (pl->ob->name, thing)) 894 if (!strcmp (&pl->ob->name, thing))
894 { 895 {
895 sprintf (buf, "Str : %-2d H.P. : %-4d MAX : %d", pl->ob->stats.Str, pl->ob->stats.hp, pl->ob->stats.maxhp); 896 sprintf (buf, "Str : %-2d H.P. : %-4d MAX : %d", pl->ob->stats.Str, pl->ob->stats.hp, pl->ob->stats.maxhp);
896 new_draw_info (NDI_UNIQUE, 0, op, buf); 897 new_draw_info (NDI_UNIQUE, 0, op, buf);
897 sprintf (buf, "Dex : %-2d S.P. : %-4d MAX : %d", pl->ob->stats.Dex, pl->ob->stats.sp, pl->ob->stats.maxsp); 898 sprintf (buf, "Dex : %-2d S.P. : %-4d MAX : %d", pl->ob->stats.Dex, pl->ob->stats.sp, pl->ob->stats.maxsp);
898 new_draw_info (NDI_UNIQUE, 0, op, buf); 899 new_draw_info (NDI_UNIQUE, 0, op, buf);
941 return 1; 942 return 1;
942 } 943 }
943 944
944 for_all_players (pl) 945 for_all_players (pl)
945 { 946 {
946 if (!strcmp (pl->ob->name, thing)) 947 if (!strcmp (&pl->ob->name, thing))
947 { 948 {
948 if (!strcmp ("str", thing2)) pl->ob->stats.Str = iii, pl->orig_stats.Str = iii; 949 if (!strcmp ("str", thing2)) pl->ob->stats.Str = iii, pl->orig_stats.Str = iii;
949 if (!strcmp ("dex", thing2)) pl->ob->stats.Dex = iii, pl->orig_stats.Dex = iii; 950 if (!strcmp ("dex", thing2)) pl->ob->stats.Dex = iii, pl->orig_stats.Dex = iii;
950 if (!strcmp ("con", thing2)) pl->ob->stats.Con = iii, pl->orig_stats.Con = iii; 951 if (!strcmp ("con", thing2)) pl->ob->stats.Con = iii, pl->orig_stats.Con = iii;
951 if (!strcmp ("wis", thing2)) pl->ob->stats.Wis = iii, pl->orig_stats.Wis = iii; 952 if (!strcmp ("wis", thing2)) pl->ob->stats.Wis = iii, pl->orig_stats.Wis = iii;
968command_nowiz (object *op, char *params) 969command_nowiz (object *op, char *params)
969{ /* 'nodm' is alias */ 970{ /* 'nodm' is alias */
970 CLEAR_FLAG (op, FLAG_WIZ); 971 CLEAR_FLAG (op, FLAG_WIZ);
971 CLEAR_FLAG (op, FLAG_WIZPASS); 972 CLEAR_FLAG (op, FLAG_WIZPASS);
972 CLEAR_FLAG (op, FLAG_WIZCAST); 973 CLEAR_FLAG (op, FLAG_WIZCAST);
974 CLEAR_FLAG (op, FLAG_WIZLOOK);
975 op->contr->do_los = 1;
973 976
974 if (op->contr->hidden) 977 if (op->contr->hidden)
975 { 978 {
976 new_draw_info (NDI_UNIQUE, 0, op, "You are no longer hidden from other players"); 979 new_draw_info (NDI_UNIQUE, 0, op, "You are no longer hidden from other players");
977 op->map->players++; 980 op->map->players++;
979 op->contr->hidden = 0; 982 op->contr->hidden = 0;
980 op->invisible = 1; 983 op->invisible = 1;
981 } 984 }
982 else 985 else
983 new_draw_info (NDI_UNIQUE | NDI_ALL | NDI_LT_GREEN, 1, NULL, "The Dungeon Master is gone.."); 986 new_draw_info (NDI_UNIQUE | NDI_ALL | NDI_LT_GREEN, 1, NULL, "The Dungeon Master is gone..");
987
984 return 1; 988 return 1;
985} 989}
986 990
987/** 991/**
988 * object *op is trying to become dm. 992 * object *op is trying to become dm.
1042 if (checkdm (op, op->name, (params ? params : "*"), op->contr->ns->host)) 1046 if (checkdm (op, op->name, (params ? params : "*"), op->contr->ns->host))
1043 { 1047 {
1044 SET_FLAG (op, FLAG_WIZ); 1048 SET_FLAG (op, FLAG_WIZ);
1045 SET_FLAG (op, FLAG_WIZPASS); 1049 SET_FLAG (op, FLAG_WIZPASS);
1046 SET_FLAG (op, FLAG_WIZCAST); 1050 SET_FLAG (op, FLAG_WIZCAST);
1051 SET_FLAG (op, FLAG_WIZLOOK);
1052 op->contr->do_los = 1;
1047 1053
1048 new_draw_info (NDI_UNIQUE, 0, op, "Ok, you are the Dungeon Master!"); 1054 new_draw_info (NDI_UNIQUE, 0, op, "Ok, you are the Dungeon Master!");
1049 /*
1050 * Remove setting flying here - that won't work, because next
1051 * fix_player() is called that will get cleared - proper solution
1052 * is probably something like a wiz_force which gives that and any
1053 * other desired abilities.
1054 */
1055 clear_los (op->contr);
1056 op->contr->write_buf[0] = '\0'; 1055 op->contr->write_buf[0] = '\0';
1057 1056
1058 if (!silent) 1057 if (!silent)
1059 new_draw_info (NDI_UNIQUE | NDI_ALL | NDI_LT_GREEN, 1, NULL, "The Dungeon Master has arrived!"); 1058 new_draw_info (NDI_UNIQUE | NDI_ALL | NDI_LT_GREEN, 1, NULL, "The Dungeon Master has arrived!");
1060 1059
1100 * Returns spell object (from archetypes) by name. 1099 * Returns spell object (from archetypes) by name.
1101 * Returns NULL if 0 or more than one spell matches. 1100 * Returns NULL if 0 or more than one spell matches.
1102 * Used for wizard's learn spell/prayer. 1101 * Used for wizard's learn spell/prayer.
1103 * 1102 *
1104 * op is the player issuing the command. 1103 * op is the player issuing the command.
1105 *
1106 * Ignores archetypes "spelldirect_xxx" since these archetypes are not used
1107 * anymore (but may still be present in some player's inventories and thus
1108 * cannot be removed). We have to ignore them here since they have the same
1109 * name than other "spell_xxx" archetypes and would always conflict.
1110 */ 1104 */
1111static object * 1105static object *
1112get_spell_by_name (object *op, const char *spell_name) 1106get_spell_by_name (object *op, shstr_cmp spell_name)
1113{ 1107{
1114 archetype *at; 1108 archetype *at;
1115 archetype *found; 1109 archetype *found;
1116 int conflict_found; 1110 int conflict_found;
1117 size_t spell_name_length; 1111 size_t spell_name_length;
1122 for_all_archetypes (at) 1116 for_all_archetypes (at)
1123 { 1117 {
1124 if (at->type != SPELL) 1118 if (at->type != SPELL)
1125 continue; 1119 continue;
1126 1120
1127 if (strncmp (at->archname, "spelldirect_", 12) == 0) 1121 if (at->object::name != spell_name)
1128 continue; 1122 continue;
1129 1123
1130 if (strcmp (at->object::name, spell_name) != 0)
1131 continue;
1132
1133 if (found != NULL) 1124 if (found)
1134 { 1125 {
1135 if (!conflict_found) 1126 if (!conflict_found)
1136 { 1127 {
1137 conflict_found = 1; 1128 conflict_found = 1;
1138 new_draw_info_format (NDI_UNIQUE, 0, op, "More than one archetype matches the spell name %s:", spell_name); 1129 new_draw_info_format (NDI_UNIQUE, 0, op, "More than one archetype matches the spell name %s:", &spell_name);
1139 new_draw_info_format (NDI_UNIQUE, 0, op, "- %s", &found->archname); 1130 new_draw_info_format (NDI_UNIQUE, 0, op, "- %s", &found->archname);
1140 } 1131 }
1141 1132
1142 new_draw_info_format (NDI_UNIQUE, 0, op, "- %s", &at->archname); 1133 new_draw_info_format (NDI_UNIQUE, 0, op, "- %s", &at->archname);
1143 continue; 1134 continue;
1172 if (found != NULL) 1163 if (found != NULL)
1173 { 1164 {
1174 if (!conflict_found) 1165 if (!conflict_found)
1175 { 1166 {
1176 conflict_found = 1; 1167 conflict_found = 1;
1177 new_draw_info_format (NDI_UNIQUE, 0, op, "More than one spell matches %s:", spell_name); 1168 new_draw_info_format (NDI_UNIQUE, 0, op, "More than one spell matches %s:", &spell_name);
1178 new_draw_info_format (NDI_UNIQUE, 0, op, "- %s", &found->object::name); 1169 new_draw_info_format (NDI_UNIQUE, 0, op, "- %s", &found->object::name);
1179 } 1170 }
1180 new_draw_info_format (NDI_UNIQUE, 0, op, "- %s", &at->object::name); 1171 new_draw_info_format (NDI_UNIQUE, 0, op, "- %s", &at->object::name);
1181 continue; 1172 continue;
1182 } 1173 }
1191 /* Return if exactly one archetype matches. */ 1182 /* Return if exactly one archetype matches. */
1192 if (found != NULL) 1183 if (found != NULL)
1193 return arch_to_object (found); 1184 return arch_to_object (found);
1194 1185
1195 /* No spell found: just print an error message. */ 1186 /* No spell found: just print an error message. */
1196 new_draw_info_format (NDI_UNIQUE, 0, op, "The spell %s does not exist.", spell_name); 1187 new_draw_info_format (NDI_UNIQUE, 0, op, "The spell %s does not exist.", &spell_name);
1197 return NULL; 1188 return NULL;
1198} 1189}
1199 1190
1200static int 1191static int
1201command_learn_spell_or_prayer (object *op, char *params, int special_prayer) 1192command_learn_spell_or_prayer (object *op, char *params, int special_prayer)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines