source: aowow/includes/allnpcs.php

Last change on this file was 170, checked in by maron, 16 years ago
  • Property svn:executable set to *
File size: 1.9 KB
Line 
1<?php
2
3// Для списка creatureinfo()
4$npc_cols[0] = array('name', 'subname', 'minlevel', 'maxlevel', 'type', 'rank', 'A','H');
5$npc_cols[1] = array('subname', 'minlevel', 'maxlevel', 'type', 'rank', 'minhealth', 'maxhealth', 'minmana', 'maxmana', 'mingold', 'maxgold', 'lootid', 'spell1', 'spell2', 'spell3', 'spell4', 'A', 'H', 'mindmg', 'maxdmg', 'attackpower', 'armor');
6
7// Функция информации о создании
8function creatureinfo2(&$Row)
9{
10 // Номер создания
11 $creature['entry'] = $Row['entry'];
12 // Имя создания
13 $creature['name'] = !empty($Row['name_loc'])?$Row['name_loc']:$Row['name'];
14 // Подимя создания
15 $creature['subname'] = !empty($Row['subname_loc'])?$Row['subname_loc']:$Row['subname'];
16 // Min/Max уровни
17 $creature['minlevel'] = $Row['minlevel'];
18 $creature['maxlevel'] = $Row['maxlevel'];
19 // TODO: Месторасположение
20 // $creature['location'] = location($creature['entry'],'creature');
21 // TODO: Реакция на фракции
22 $creature['react'] = ($Row['A']).','.($Row['H']);
23 // Тип NPC
24 $creature['type'] = $Row['type'];
25 // Тег NPC
26 $creature['tag'] = str_normalize($Row['subname']);
27 // Ранг NPC
28 $creature['classification'] = $Row['rank'];
29 return $creature;
30}
31
32// Функция информации о создании
33function creatureinfo($id)
34{
35 global $DB;
36 global $npc_cols;
37 $row = $DB->selectRow('
38 SELECT ?#, c.entry
39 {
40 , l.name_loc'.$_SESSION['locale'].' as `name_loc`
41 , l.subname_loc'.$_SESSION['locale'].' as `subname_loc`
42 , ?
43 }
44 FROM ?_factiontemplate, creature_template c
45 {
46 LEFT JOIN (locales_creature l)
47 ON l.entry=c.entry AND ?
48 }
49 WHERE
50 c.entry=?d
51 AND factiontemplateID=faction_A
52 LIMIT 1
53 ',
54 $npc_cols[0],
55 ($_SESSION['locale']>0)? 1: DBSIMPLE_SKIP,
56 ($_SESSION['locale']>0)? 1: DBSIMPLE_SKIP,
57 $id
58 );
59 return creatureinfo2($row);
60}
61
62?>
Note: See TracBrowser for help on using the repository browser.