-
Notifications
You must be signed in to change notification settings - Fork 26
/
spell.php
583 lines (552 loc) · 19.6 KB
/
spell.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
<?php
require_once('includes/allspells.php');
require_once('includes/allnpcs.php');
require_once('includes/allquests.php');
require_once('includes/allcomments.php');
$smarty->config_load($conf_file,'spell');
// номер спелла;
$id = $podrazdel;
if(!$spell = load_cache(13, intval($id)))
{
unset($spell);
// БД
global $DB;
// Таблица спеллов
global $allspells;
// Таблица вещей
global $allitems;
global $npc_cols;
// Данные об спелле:
$row = $DB->selectRow('
SELECT s.*, i.iconname
FROM ?_spell s, ?_spellicons i
WHERE
s.spellID=?
AND i.id = s.spellicon
',
$id
);
if ($row)
{
$spell = array();
// Номер спелла
$spell['entry'] = $row['spellID'];
// Имя спелла
$spell['name'] = $row['spellname'];
// Иконка спелла
//$spell['icon'] = $row['iconname'];
// Затраты маны на сспелл
if ($row['manacost'])
$spell['manacost'] = $row['manacost'];
elseif ($row['manacostpercent'])
$spell['manacost'] = $row['manacostpercent'].'% '.$smarty->get_config_vars('of_base');
// Уровень спелла
$spell['level'] = $row['levelspell'];
// Дальность
$RangeRow = $DB->selectRow('SELECT rangeMin, rangeMax, name from ?_spellrange where rangeID=? limit 1', $row['rangeID']);
$spell['range'] = '';
if (($RangeRow['rangeMin'] != $RangeRow['rangeMax']) and ($RangeRow['rangeMin'] != 0))
$spell['range'] = $RangeRow['rangeMin'].'-';
$spell['range'] .= $RangeRow['rangeMax'];
$spell['rangename'] = $RangeRow['name'];
// Время каста
$casttime = $DB->selectCell('SELECT base from ?_spellcasttimes where id=? limit 1', $row['spellcasttimesID']);
if ($casttime>0)
$spell['casttime'] = ($casttime/1000).' '.$smarty->get_config_vars('seconds');
else if($row['ChannelInterruptFlags'])
$spell['casttime'] = 'Channeled';
else
$spell['casttime'] = 'Instant';
// Cooldown
if ($row['cooldown']>0)
$spell['cooldown'] = $row['cooldown'] / 1000;
// Время действия спелла
$duration = $DB->selectCell('SELECT durationBase FROM ?_spellduration WHERE durationID=?d LIMIT 1', $row['durationID']);
if ($duration > 0)
$spell['duration'] = ($duration/1000).' '.$smarty->get_config_vars('seconds');
else
$spell['duration'] ='<span class="q0">n/a</span>';
// Школа спелла
$spell['school'] = $DB->selectCell('SELECT name FROM ?_resistances WHERE id=?d LIMIT 1', $row['resistancesID']);
// Тип диспела
if ($row['dispeltypeID'])
$spell['dispel'] = $DB->selectCell('SELECT name FROM ?_spelldispeltype WHERE id=?d LIMIT 1', $row['dispeltypeID']);
// Механика спелла
if ($row['mechanicID'])
$spell['mechanic'] = $DB->selectCell('SELECT name FROM ?_spellmechanic WHERE id=?d LIMIT 1', $row['mechanicID']);
// Информация о спелле
$spell['info'] = allspellsinfo2($row, 2);
// Инструменты
$spell['tools'] = array();
$i=0;
for ($j=1;$j<=2;$j++)
{
if ($row['tool'.$j])
{
$spell['tools'][$i] = array();
// Имя инструмента
$tool_row = $DB->selectRow('SELECT ?#, `name`, `quality` FROM item_template, ?_icons WHERE entry=?d AND id=displayid LIMIT 1', $item_cols[0], $row['tool'.$j]);
$spell['tools'][$i]['name'] = $tool_row['name'];
$spell['tools'][$i]['quality'] = $tool_row['quality'];
// ID инструмента
$spell['tools'][$i]['entry'] = $row['tool'.$j];
// Добавляем инструмент в таблицу вещей
allitemsinfo2($tool_row, 0);
$i++;
}
}
// Реагенты
$spell['reagents'] = array();
$i=0;
for ($j=1;$j<=8;$j++)
{
if ($row['reagent'.$j])
{
$spell['reagents'][$i] = array();
// Имя реагента
$reagentrow = $DB->selectRow('
SELECT c.?#, name
{ ,l.name_loc?d as `name_loc` }
FROM ?_icons, item_template c
{ LEFT JOIN (locales_item l) ON l.entry=c.entry AND ? }
WHERE
c.entry=?d
AND id=displayid
LIMIT 1
',
$item_cols[0],
($_SESSION['locale']>0)? $_SESSION['locale']: DBSIMPLE_SKIP,
($_SESSION['locale']>0)? 1: DBSIMPLE_SKIP,
$row['reagent'.$j]
);
$spell['reagents'][$i]['name'] = !empty($reagentrow['name_loc'])?$reagentrow['name_loc']:$reagentrow['name'];
$spell['reagents'][$i]['quality'] = $reagentrow['quality'];
// ID реагента
$spell['reagents'][$i]['entry'] = $row['reagent'.$j];
// Количество реагентов
$spell['reagents'][$i]['count'] = $row['reagentcount'.$j];
// Добавляем реагент в таблицу вещей
allitemsinfo2($reagentrow, 0);
$i++;
}
}
// Перебираем все эффекты:
$i=0;
$spell['effect'] = array();
// Btt - Buff TollTip
if ($row['buff'])
$spell['btt'] = spell_buff_render($row);
for ($j=1;$j<=3;$j++)
{
if($row['effect'.$j.'id'] > 0)
{
// Название эффекта
$spell['effect'][$i]['name'] = $spell_effect_names[$row['effect'.$j.'id']];
// Доп информация в имени
if ($row['effect'.$j.'MiscValue'])
{
switch ($row['effect'.$j.'id'])
{
// Если эффект - создание обекта, создаем информацию о нём
case 50: // "Summon Object" // 103 spells, OK
case 76: // "Summon Object (Wild)" // 173 spells, OK
//case 86: // "Activate Object" // 175 spells; wrong GOs, tiny ID; skipping
case 104: // "Summon Object (slot 1)" // 24 spells - traps, OK
//case 105: // "Summon Object (slot 2)" // 2 spells: 22996, 23005; wrong GOs; skipping
//case 106: // "Summon Object (slot 3)" // 0 spells; skipping
//case 107: // "Summon Object (slot 4)" // 0 spells; skipping
{
$spell['effect'][$i]['object'] = array();
$spell['effect'][$i]['object']['entry'] = $row['effect'.$j.'MiscValue'];
$spell['effect'][$i]['object']['name'] = $DB->selectCell("SELECT name FROM gameobject_template WHERE entry=? LIMIT 1", $spell['effect'][$i]['object']['entry']).' ('.$spell['effect'][$i]['object']['entry'].')';
break;
}
// скиллы
case 118: // "Require Skill"
{
$spell['effect'][$i]['name'] .= ' ('.$DB->selectCell('SELECT name FROM ?_skill WHERE skillID=? LIMIT 1', $row['effect'.$j.'MiscValue']).')';
break;
}
// ауры
case 6:
{
break;
}
// тотемы
case 75: // "Summon Totem"
case 87: // "Summon Totem (slot 1)"
case 88: // "Summon Totem (slot 2)"
case 89: // "Summon Totem (slot 3)"
case 90: // "Summon Totem (slot 4)"
{
$spell['effect'][$i]['name'] .= ' (<a href="?npc='.$row['effect'.$j.'MiscValue'].'">'.$row['effect'.$j.'MiscValue'].'</a>)';
break;
}
default:
{
$spell['effect'][$i]['name'] .= ' ('.$row['effect'.$j.'MiscValue'].')';
}
}
}
// Если просто урон школой - добавляем подпись школы
if ($row['effect'.$j.'id'] == 2 && $spell['school'])
$spell['effect'][$i]['name'] .= ' ('.$spell['school'].')';
// Радиус действия эффекта
if ($row['effect'.$j.'radius'])
$spell['effect'][$i]['radius'] = $DB->selectCell("SELECT radiusbase from ?_spellradius where radiusID=? limit 1", $row['effect'.$j.'radius']);
// Значение спелла (урон)
if ($row['effect'.$j.'BasePoints'] && !$row['effect'.$j.'itemtype'])
$spell['effect'][$i]['value'] = $row['effect'.$j.'BasePoints'] + 1;
// Интервал действия спелла
if ($row['effect'.$j.'Amplitude'] > 0)
$spell['effect'][$i]['interval'] = $row['effect'.$j.'Amplitude'] / 1000;
// Название ауры:
if ($row['effect'.$j.'Aura'] > 0 && IsSet($spell_aura_names[$row['effect'.$j.'Aura']]))
switch ($row['effect'.$j.'Aura'])
{
case 78: // "Mounted" - приписываем ссылку на нпс
case 56: // "Transform"
{
$spell['effect'][$i]['name'] .= ': '.$spell_aura_names[$row['effect'.$j.'Aura']].' (<a href="?npc='.$row['effect'.$j.'MiscValue'].'">'.$row['effect'.$j.'MiscValue'].'</a>)';
break;
}
default:
{
$spell['effect'][$i]['name'] .= ': '.$spell_aura_names[$row['effect'.$j.'Aura']];
if($row['effect'.$j.'MiscValue'] > 0)
$spell['effect'][$i]['name'] .= ' ('.$row['effect'.$j.'MiscValue'].')';
}
}
elseif ($row['effect'.$j.'Aura'] > 0)
$spell['effect'][$i]['name'] .= ': Unknown_Aura('.$row['effect'.$j.'Aura'].')';
// Создает вещь:
if (($row['effect'.$j.'id'] == 24))
{
$spell['effect'][$i]['item'] = array();
$spell['effect'][$i]['item']['entry'] = $row['effect'.$j.'itemtype'];
$tmpRow = $DB->selectRow('
SELECT c.?#, name
{ ,l.name_loc?d as `name_loc` }
FROM ?_icons, item_template c
{ LEFT JOIN (locales_item l) ON l.entry=c.entry AND ? }
WHERE
c.entry=?d
AND id=displayid
LIMIT 1
',
$item_cols[0],
($_SESSION['locale']>0)? $_SESSION['locale']: DBSIMPLE_SKIP,
($_SESSION['locale']>0)? 1: DBSIMPLE_SKIP,
$spell['effect'][$i]['item']['entry']
);
$spell['effect'][$i]['item']['name'] = $tmpRow['name'];
$spell['effect'][$i]['item']['quality'] = $tmpRow['quality'];
$spell['effect'][$i]['item']['count'] = $row['effect'.$j.'BasePoints'] + 1;
// Иконка итема, если спелл создает этот итем
if(!IsSet($spell['icon']))
$spell['icon'] = $tmpRow['iconname'];
allitemsinfo2($tmpRow, 0);
}
// Создает спелл
if ($row['effect'.$j.'triggerspell'] > 0)
{
$spell['effect'][$i]['spell'] = array();
$spell['effect'][$i]['spell']['entry'] = $row['effect'.$j.'triggerspell'];
$spell['effect'][$i]['spell']['name'] = $DB->selectCell('SELECT spellname FROM ?_spell WHERE spellID=?d LIMIT 1', $spell['effect'][$i]['spell']['entry']);
allspellsinfo($spell['effect'][$i]['spell']['entry']);
}
$i++;
}
}
if(!IsSet($spell['icon']))
$spell['icon'] = $row['iconname'];
// Спеллы с таким же названием
$seealso = $DB->select('
SELECT s.*, i.iconname
FROM ?_spell s, ?_spellicons i
WHERE
s.spellname=?
AND s.spellID!=?d
AND (
(s.effect1id=?d AND s.effect1id!=0)
OR (s.effect2id=?d AND s.effect2id!=0)
OR (s.effect3id=?d AND s.effect3id!=0)
)
AND i.id=s.spellicon
',
$spell['name'],
$spell['entry'],
$row['effect1id'],
$row['effect2id'],
$row['effect3id']
);
if ($seealso)
{
$spell['seealso'] = array();
foreach($seealso as $i => $row)
$spell['seealso'][] = spellinfo2($row);
unset ($seealso);
}
// Кто обучает этому спеллу
$spell['taughtbynpc'] = array();
// Список тренеров, обучающих нужному спеллу
$taughtbytrainers = $DB->select('
SELECT ?#, c.entry
{ , name_loc?d AS name_loc, subname_loc'.$_SESSION['locale'].' AS subname_loc }
FROM ?_factiontemplate, creature_template c
{ LEFT JOIN (locales_creature l) ON c.entry = l.entry AND ? }
WHERE
c.entry IN (SELECT entry FROM npc_trainer WHERE spell=?d)
AND factiontemplateID=faction
',
$npc_cols[0],
($_SESSION['locale']>0)? $_SESSION['locale']: DBSIMPLE_SKIP,
($_SESSION['locale']>0)? 1: DBSIMPLE_SKIP,
$spell['entry']
);
if ($taughtbytrainers)
{
foreach($taughtbytrainers as $i=>$npcrow)
$spell['taughtbynpc'][] = creatureinfo2($npcrow);
unset ($taughtbytrainers);
}
// Список книг/рецептов, просто обучающих спеллу
$spell['taughtbyitem'] = array();
$taughtbyitem = $DB->select('
SELECT ?#, c.entry
{ , name_loc?d AS name_loc }
FROM ?_icons, item_template c
{ LEFT JOIN (locales_item l) ON c.entry = l.entry AND ? }
WHERE
((spellid_2=?d)
AND (spelltrigger_2=6))
AND id=displayid
',
$item_cols[2],
($_SESSION['locale']>0)? $_SESSION['locale']: DBSIMPLE_SKIP,
($_SESSION['locale']>0)? 1: DBSIMPLE_SKIP,
$spell['entry']//, $spell['entry'], $spell['entry'], $spell['entry'], $spell['entry']
);
if ($taughtbyitem)
{
foreach($taughtbyitem as $i=>$itemrow)
$spell['taughtbyitem'][] = iteminfo2($itemrow, 0);
unset ($taughtbyitem);
}
// Список спеллов, обучающих этому спеллу:
$taughtbyspells = $DB->selectCol('
SELECT spellID
FROM ?_spell
WHERE
(effect1triggerspell=?d AND (effect1id=57 OR effect1id=36))
OR (effect2triggerspell=?d AND (effect2id=57 OR effect2id=36))
OR (effect3triggerspell=?d AND (effect3id=57 OR effect3id=36))
',
$spell['entry'], $spell['entry'], $spell['entry']
);
if ($taughtbyspells)
{
// Список петов, кастующих спелл, обучающий нужному спеллу
$taughtbypets = $DB->select('
SELECT ?#, c.entry
{ , name_loc?d AS name_loc, subname_loc'.$_SESSION['locale'].' AS subname_loc }
FROM ?_factiontemplate, creature_template c
{ LEFT JOIN (locales_creature l) ON c.entry = l.entry AND ? }
WHERE
c.entry IN (SELECT entry FROM petcreateinfo_spell WHERE (Spell1 IN (?a)) OR (Spell2 IN (?a)) OR (Spell3 IN (?a)) OR (Spell4 IN (?a)))
AND factiontemplateID=faction
',
$npc_cols[0],
($_SESSION['locale']>0)? $_SESSION['locale']: DBSIMPLE_SKIP,
($_SESSION['locale']>0)? 1: DBSIMPLE_SKIP,
$taughtbyspells, $taughtbyspells, $taughtbyspells, $taughtbyspells
);
// Перебираем этих петов
if ($taughtbypets)
{
foreach($taughtbypets as $i=>$petrow)
$spell['taughtbynpc'][] = creatureinfo2($petrow);
unset ($taughtbypets);
}
// Список квестов, наградой за которые является спелл, обучающий нужному спеллу
$taughtbyquest = $DB->select('
SELECT c.?#
{ , Title_loc?d AS Title_loc }
FROM quest_template c
{ LEFT JOIN (locales_quest l) ON c.entry = l.entry AND ? }
WHERE
RewSpell IN (?a) OR RewSpellCast IN (?a)
',
$quest_cols[2],
($_SESSION['locale']>0)? $_SESSION['locale']: DBSIMPLE_SKIP,
($_SESSION['locale']>0)? 1: DBSIMPLE_SKIP,
$taughtbyspells, $taughtbyspells
);
if ($taughtbyquest)
{
$spell['taughtbyquest'] = array();
foreach($taughtbyquest as $i=>$questrow)
$spell['taughtbyquest'][] = GetQuestInfo($questrow, 0xFFFFFF);
unset ($taughtbyquest);
}
// Список НПЦ, кастующих нужный спелл, бла-бла-бла
$taughtbytrainers = $DB->select('
SELECT ?#, c.entry
{ , name_loc?d AS name_loc, subname_loc'.$_SESSION['locale'].' AS subname_loc }
FROM ?_factiontemplate, creature_template c
{ LEFT JOIN (locales_creature l) ON c.entry = l.entry AND ? }
WHERE
c.entry IN (SELECT entry FROM npc_trainer WHERE spell in (?a))
AND factiontemplateID=faction
',
$npc_cols[0],
($_SESSION['locale']>0)? $_SESSION['locale']: DBSIMPLE_SKIP,
($_SESSION['locale']>0)? 1: DBSIMPLE_SKIP,
$taughtbyspells
);
if ($taughtbytrainers)
{
foreach($taughtbytrainers as $i=>$npcrow)
$spell['taughtbynpc'][] = creatureinfo2($npcrow);
unset ($taughtbytrainers);
}
// Список книг, кастующих спелл, обучающий нужному спеллу
$taughtbyitem = $DB->select('
SELECT ?#, c.entry
{ , name_loc?d AS name_loc }
FROM ?_icons, item_template c
{ LEFT JOIN (locales_item l) ON c.entry = l.entry AND ? }
WHERE
((spellid_1 IN (?a))
OR (spellid_2 IN (?a))
OR (spellid_3 IN (?a))
OR (spellid_4 IN (?a))
OR (spellid_5 IN (?a)))
AND id=displayid
',
$item_cols[2],
($_SESSION['locale']>0)? $_SESSION['locale']: DBSIMPLE_SKIP,
($_SESSION['locale']>0)? 1: DBSIMPLE_SKIP,
$taughtbyspells, $taughtbyspells, $taughtbyspells, $taughtbyspells, $taughtbyspells
);
if ($taughtbyitem)
{
foreach($taughtbyitem as $i=>$itemrow)
$spell['taughtbyitem'][] = iteminfo2($itemrow, 0);
unset ($taughtbyitem);
}
}
// Используется NPC:
$usedbynpc = $DB->select('
SELECT ?#, c.entry
{ , name_loc?d AS name_loc, subname_loc'.$_SESSION['locale'].' AS subname_loc }
FROM ?_factiontemplate, creature_template c
{ LEFT JOIN (locales_creature l) ON c.entry = l.entry AND ? }
WHERE
(spell1=?d
OR spell2=?d
OR spell3=?d
OR spell4=?d)
AND factiontemplateID=faction
',
$npc_cols[0],
($_SESSION['locale']>0)? $_SESSION['locale']: DBSIMPLE_SKIP,
($_SESSION['locale']>0)? 1: DBSIMPLE_SKIP,
$spell['entry'], $spell['entry'], $spell['entry'], $spell['entry']
);
if ($usedbynpc)
{
$spell['usedbynpc'] = array();
foreach($usedbynpc as $i=>$row)
$spell['usedbynpc'][] = creatureinfo2($row);
unset ($usedbynpc);
}
// Используется вещями:
$usedbyitem = $DB->select('
SELECT ?#, c.entry
{ , name_loc?d AS name_loc }
FROM ?_icons, item_template c
{ LEFT JOIN (locales_item l) ON c.entry = l.entry AND ? }
WHERE
(spellid_1=?d OR (spellid_2=?d AND spelltrigger_2!=6) OR spellid_3=?d OR spellid_4=?d OR spellid_5=?d)
AND id=displayID
',
$item_cols[2],
($_SESSION['locale']>0)? $_SESSION['locale']: DBSIMPLE_SKIP,
($_SESSION['locale']>0)? 1: DBSIMPLE_SKIP,
$spell['entry'], $spell['entry'], $spell['entry'], $spell['entry'], $spell['entry']
);
if ($usedbyitem)
{
$spell['usedbyitem'] = array();
foreach($usedbyitem as $i => $row)
$spell['usedbyitem'][] = iteminfo2($row, 0);
unset ($usedbyitem);
}
// Используется наборами вещей:
$usedbyitemset = $DB->select('
SELECT *
FROM ?_itemset
WHERE spell1=?d or spell2=?d or spell3=?d or spell4=?d or spell5=?d or spell6=?d or spell7=?d or spell8=?d
',
$spell['entry'], $spell['entry'], $spell['entry'], $spell['entry'], $spell['entry'], $spell['entry'], $spell['entry'], $spell['entry']
);
if ($usedbyitemset)
{
$spell['usedbyitemset'] = array();
foreach($usedbyitemset as $i => $row)
$spell['usedbyitemset'][] = itemsetinfo2($row);
unset ($usedbyitemset);
}
// Спелл - награда за квест
$questreward = $DB->select('
SELECT c.?#
{ , Title_loc?d AS Title_loc }
FROM quest_template c
{ LEFT JOIN (locales_quest l) ON c.entry = l.entry AND ? }
WHERE
RewSpell=?d
OR RewSpellCast=?d
',
$quest_cols[2],
($_SESSION['locale']>0)? $_SESSION['locale']: DBSIMPLE_SKIP,
($_SESSION['locale']>0)? 1: DBSIMPLE_SKIP,
$spell['entry'], $spell['entry']
);
if ($questreward)
{
$spell['questreward'] = array();
foreach($questreward as $i => $row)
$spell['questreward'][] = GetQuestInfo($row, 0xFFFFFF);
unset ($questreward);
}
// Проверяем на пустые массивы
if (!($spell['taughtbyitem']))
unset ($spell['taughtbyitem']);
if (!($spell['taughtbynpc']))
unset ($spell['taughtbynpc']);
$smarty->assign('spell', $spell);
save_cache(13, $spell['spellID'], $spell);
}
}
global $page;
$page = array(
'Mapper' => false,
'Book' => false,
'Title' => $spell['name'].' - '.$smarty->get_config_vars('Spells'),
'tab' => 0,
'type' => 6,
'typeid' => $spell['entry'],
'path' => '[0,1]'
);
$smarty->assign('page', $page);
// Комментарии
$smarty->assign('comments', getcomments($page['type'], $page['typeid']));
// Количество MySQL запросов
$smarty->assign('mysql', $DB->getStatistics());
if (count($allspells)>=0)
$smarty->assign('allspells',$allspells);
if (count($allitems)>=0)
$smarty->assign('allitems',$allitems);
$smarty->display('spell.tpl');
?>