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

Comparing deliantra/server/server/rune.C (file contents):
Revision 1.19 by root, Fri Feb 2 22:49:11 2007 UTC vs.
Revision 1.21 by root, Sun Mar 11 02:12:45 2007 UTC

56 56
57 nx = op->x + freearr_x[dir]; 57 nx = op->x + freearr_x[dir];
58 ny = op->y + freearr_y[dir]; 58 ny = op->y + freearr_y[dir];
59 m = op->map; 59 m = op->map;
60 60
61 if (get_map_flags (m, &m, nx, ny, &nx, &ny) && (P_OUT_OF_MAP | P_SAFE | P_NO_MAGIC | P_NO_CLERIC)) 61 if (get_map_flags (m, &m, nx, ny, &nx, &ny) & (P_OUT_OF_MAP | P_SAFE | P_NO_MAGIC | P_NO_CLERIC))
62 { 62 {
63 new_draw_info (NDI_UNIQUE, 0, op, "Can't make a rune there!"); 63 new_draw_info (NDI_UNIQUE, 0, op, "Can't make a rune there!");
64 return 0; 64 return 0;
65 } 65 }
66 66
68 if (tmp->type == RUNE) 68 if (tmp->type == RUNE)
69 break; 69 break;
70 70
71 if (tmp) 71 if (tmp)
72 { 72 {
73 new_draw_info (NDI_UNIQUE, 0, op, "You can't write a rune there."); 73 new_draw_info (NDI_UNIQUE, 0, op, "You can't write a rune on top of another rune.");
74 return 0; 74 return 0;
75 } 75 }
76 76
77 if (spell->other_arch) 77 if (spell->other_arch)
78 rune_spell = arch_to_object (spell->other_arch); 78 rune_spell = arch_to_object (spell->other_arch);
90 return 0; 90 return 0;
91 } 91 }
92 92
93 rune_spell = NULL; 93 rune_spell = NULL;
94 for (tmp = op->inv; tmp; tmp = tmp->below) 94 for (tmp = op->inv; tmp; tmp = tmp->below)
95 {
96 if (tmp->type == SPELL) 95 if (tmp->type == SPELL)
97 { 96 {
98 ms = item_matched_string (op, tmp, runename); 97 ms = item_matched_string (op, tmp, runename);
99 if (ms > bestmatch) 98 if (ms > bestmatch)
100 { 99 {
101 bestmatch = ms; 100 bestmatch = ms;
102 rune_spell = tmp; 101 rune_spell = tmp;
103 } 102 }
104 } 103 }
105 }
106 104
107 if (!rune_spell) 105 if (!rune_spell)
108 { 106 {
109 new_draw_info_format (NDI_UNIQUE, 0, op, "You don't know any spell named %s", runename); 107 new_draw_info_format (NDI_UNIQUE, 0, op, "You don't know any spell named %s", runename);
110 return 0; 108 return 0;
114 { 112 {
115 new_draw_info_format (NDI_UNIQUE, 0, op, "You can't cast %s with %s", &rune_spell->name, &spell->name); 113 new_draw_info_format (NDI_UNIQUE, 0, op, "You can't cast %s with %s", &rune_spell->name, &spell->name);
116 return 0; 114 return 0;
117 } 115 }
118 116
119 if (caster->path_denied & spell->path_attuned) 117 if (caster->path_denied & spell->path_attuned && !caster->flag [FLAG_WIZCAST])
120 { 118 {
121 new_draw_info_format (NDI_UNIQUE, 0, op, "%s belongs to a spell path denied to you.", &rune_spell->name); 119 new_draw_info_format (NDI_UNIQUE, 0, op, "%s belongs to a spell path denied to you.", &rune_spell->name);
122 return 0; 120 return 0;
123 } 121 }
124 122
125 if (caster_level (caster, rune_spell) < rune_spell->level) 123 if (caster_level (caster, rune_spell) < rune_spell->level && !caster->flag [FLAG_WIZCAST])
126 { 124 {
127 new_draw_info_format (NDI_UNIQUE, 0, op, "%s is beyond your ability to cast!", &rune_spell->name); 125 new_draw_info_format (NDI_UNIQUE, 0, op, "%s is beyond your ability to cast!", &rune_spell->name);
128 return 0; 126 return 0;
129 } 127 }
130 128
412{ 410{
413 if (where == NULL) 411 if (where == NULL)
414 return 0; 412 return 0;
415 413
416 object *tmp = get_archetype ("runedet"); 414 object *tmp = get_archetype ("runedet");
417 tmp->face = &new_faces[GET_ANIMATION (trap, 0)]; 415 tmp->face = GET_ANIMATION (trap, 0);
418 tmp->insert_at (where, 0); 416 tmp->insert_at (where, 0);
419 417
420 return 1; 418 return 1;
421} 419}
422 420

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines