-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathspell.php
More file actions
122 lines (105 loc) · 2.74 KB
/
spell.php
File metadata and controls
122 lines (105 loc) · 2.74 KB
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
<?php
$pagetitle = 'Spell Database';
$NEEDPUB = true;
require 'common.php';
$_GET['spell'] = preg_replace("/[^0-9]/", "", $_GET['spell'] );
if (!isset($_GET['spell']))
{
$tpl->message = 'No spell ID specified.';
$tpl->Execute(null);
exit;
}
$spell = $eoserv_spells->Get($_GET['spell']);
if (!$spell)
{
$tpl->message = 'Skill ID #'. $_GET['spell']. ' Does Not Exist';
$tpl->Execute(null);
exit;
}
$spell->image = 'spellimage/gif/' . (100 + $spell->icon) . '.gif';
if (!file_exists($spell->image)) $spell->image = null;
$desc = '"' . $spell->shout . '"';
$spell->desc = $desc;
$spell->damage = $spell->type == 1;
$spell->heal = $spell->type == 0;
$skillmasters = array();
$found = false;
foreach ($eoserv_trainers->Data() as $trainer)
{
$foundskill = false;
foreach ($trainer->skills as $skill)
{
if ($skill->id == $spell->id)
{
$foundskill = true;
$cost = $skill->cost;
$levelreq = $skill->levelreq;
$clasreq = $skill->clasreq;
$sk1 = $skill->sk1;
$sk2 = $skill->sk2;
$sk3 = $skill->sk3;
$sk4 = $skill->sk4;
$strreq = $skill->strreq;
$intlreq = $skill->intlreq;
$wisreq = $skill->wisreq;
$agireq = $skill->agireq;
$conreq = $skill->conreq;
$chareq = $skill->chareq;
$found = true;
}
}
if ($foundskill)
{
foreach ($eoserv_npcs->Data() as $npc)
{
if ($npc->type == 14 && $npc->shopid == $trainer->id)
{
$image = 'npcimage/gif/' . (61 + $npc->graphic * 40) . '.gif';
if (!file_exists($image)) $image = null;
$skillmasters[] = array(
'npcid' => $npc->id,
'npc' => $npc->name,
'cost' => $cost,
'levelreq' => $levelreq,
'clasreq' => $clasreq,
'clasreqname' => $eoserv_classes->Get($clasreq)->name,
'sk1' => $sk1,
'sk1name' => $eoserv_spells->Get($sk1)->name,
'sk2' => $sk2,
'sk2name' => $eoserv_spells->Get($sk2)->name,
'sk3' => $sk3,
'sk3name' => $eoserv_spells->Get($sk3)->name,
'sk4' => $sk4,
'sk4name' => $eoserv_spells->Get($sk4)->name,
'strreq' => $strreq,
'intreq' => $intlreq,
'wisreq' => $wisreq,
'agireq' => $agireq,
'conreq' => $conreq,
'chareq' => $chareq,
'image' => $image
);
}
}
}
}
$skillitems = array();
foreach ($eoserv_items->Data() as $item)
{
if ($item->type == 7 && $item->spec1 == $spell->id)
{
$image = 'itemimage/gif/' . (100 + $item->graphic * 2) . '.gif';
if (!file_exists($image)) $image = null;
$found = true;
$skillitems[] = array(
'itemid' => $item->id,
'name' => $item->name,
'graphic' => $image
);
}
}
$tpl->found = $found;
$tpl->spell = (array)$spell;
$tpl->masters = (count($skillmasters) == 0) ? null : $skillmasters;
$tpl->items = (count($skillitems) == 0) ? null : $skillitems;
$tpl->Execute('spell');