-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathwow_alpha_area_triggers.php
236 lines (170 loc) · 5.29 KB
/
wow_alpha_area_triggers.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
<?php
/*
Author: X'Genesis Qhulut <[email protected]>
Date: August 2022
See LICENSE for license details.
*/
// AREA TRIGGERS
function areaTriggerTopLeft ($info)
{
global $id;
$row = $info ['row'];
$extras = $info ['extras'];
$limit = $info ['limit'];
comment ('SHORT LISTING OF FIELDS');
showOneThing (AREATRIGGER, 'ID',
$id, "", "name", $extras, $limit);
} // end of areaTriggerTopLeft
function areatriggerTopMiddle ($info)
{
global $id;
$row = $info ['row'];
comment ('AREA TRIGGER ON MAP');
$results = array ($row);
if ($row ['ContinentID'] == 0)
listSpawnPoints ($results, 'Area trigger - Eastern Kingdoms', AREATRIGGER,
'ID', 'X', 'Y', 'Z', 'ContinentID');
comment ('KALIMDOR');
if ($row ['ContinentID'] == 1)
listSpawnPoints ($results, 'Area trigger - Kalimdor', AREATRIGGER,
'ID', 'X', 'Y', 'Z', 'ContinentID');
comment ('END AREA TRIGGER ON MAP');
} // end of areatriggerTopMiddle
function areatriggerTopRight ($info)
{
global $id;
$row = $info ['row'];
comment ('AREA TRIGGER ON MAP');
$results = array ($row);
echo "<div class='caroussel__maps'>\n";
comment ('KALIMDOR');
if ($row ['ContinentID'] == 1)
showSpawnPoints ($results, 'Area trigger - Kalimdor', AREATRIGGER,
'ID', 'X', 'Y', 'Z', 'ContinentID');
comment ('EASTERN KINGDONS');
if ($row ['ContinentID'] == 0)
showSpawnPoints ($results, 'Area trigger - Eastern Kingdoms', AREATRIGGER,
'ID', 'X', 'Y', 'Z', 'ContinentID');
comment ('END AREA TRIGGER ON MAP');
endDiv ('caroussel__maps');
} // end of areatriggerTopRight
function showAreaTriggerQuest ()
{
global $id, $quests;
comment ('ITEM STARTS A QUEST');
$results = dbQueryParam ("SELECT quest FROM ".AREATRIGGER_QUEST_RELATION." WHERE id = ?", array ('i', &$id));
listItems ('Related quest', QUEST_TEMPLATE,
count ($results), $results,
function ($row) use ($quests)
{
listThing ($quests, $row ['quest'], 'show_quest');
} // end listing function
);
} // end of showAreaTriggerQuest
function showAreaTriggerTeleport ()
{
global $id, $quests;
global $listedItemsCount;
comment ('ITEM STARTS A QUEST');
$row = dbQueryOneParam ("SELECT * FROM ".AREATRIGGER_TELEPORT." WHERE id = ?", array ('i', &$id));
if ($row)
{
showOneThing (AREATRIGGER_TELEPORT, 'id', $id, "Teleport details", "name", array ());
$listedItemsCount++;
}
} // end of showAreaTriggerTeleport
function areaTriggerDetails ($info)
{
global $id;
$row = $info ['row'];
topSection ($info, function ($info) use ($id)
{
topLeft ($info, 'areatriggerTopLeft');
topMiddle ($info, 'areatriggerTopMiddle');
topRight ($info , 'areatriggerTopRight');
});
middleSection ($info, function ($info) use ($id)
{
global $listedItemsCount;
$listedItemsCount = 0;
showAreaTriggerQuest ();
showAreaTriggerTeleport ();
if ($listedItemsCount == 0)
middleDetails ($info, function ($info) use ($listedItemsCount)
{
showNoSpawnPoints ('Unused area trigger', 'This area trigger appears to be unused.');
});
});
} // end of areaTriggerDetails
function showOneAreaTrigger ()
{
global $id;
if (($id === false && !repositionSearch()) || !checkID ())
return;
// we need the game object info in this function
$row = dbQueryOneParam ("SELECT * FROM ".AREATRIGGER." WHERE ID = ?", array ('i', &$id));
if (!$row)
{
ShowWarning ("Area trigger $id is not on the database");
return;
} // end of not finding it
// this is the short summary fields
$limit = array (
'ID',
'ContinentID',
'X',
'Y',
'Z',
'Radius',
);
// stuff to be displayed differently
$extras = array ();
setTitle ("Area trigger $id");
// we pass this stuff around to the helper functions
$info = array ('row' => $row, 'extras' => $extras, 'limit' => $limit);
// ready to go! show the page info and work our way down into the sub-functions
pageContent ($info, 'Gameobject', "Area trigger $id", 'area_triggers', 'areaTriggerDetails', AREATRIGGER);
} // end of showOneAreaTrigger
function showAreaTriggersHelper ($tableName, $headingName)
{
$results = dbQueryParam ("SELECT * FROM " . AREATRIGGER, array ());
echo "<table class='table-rows'>\n";
echo "<thead>\n";
echo "<tr>\n";
th ('ID');
th ('ContinentID');
th ('X');
th ('Y');
th ('Z');
th ('Radius');
echo "</tr>\n";
echo "</thead>\n";
echo "<tbody>\n";
$td = function ($s) use (&$row) { tdx ($row [$s]); };
foreach ($results as $row)
{
$id = $row ['ID'];
echo "<tr>\n";
tdh ("<a href='?action=show_area_trigger&id=$id'>$id</a>");
$td ('ContinentID');
$td ('X');
$td ('Y');
$td ('Z');
$td ('Radius');
echo "</tr>\n";
}
echo "</table>\n";
} // end of showAreaTriggersHelper
function showAllAreaTriggers ($info)
{
setTitle ("Area triggers");
bottomSectionMany ($info, function ($info)
{
showAreaTriggersHelper (DBC_DBNAME, LIVE_DBC_DBNAME);
});
} // end of showAllAreaTriggers
function showAreaTriggers ()
{
pageContent (false, 'Area Triggers', 'Area triggers', 'whatever', 'showAllAreaTriggers', '');
} // end of showAreaTriggers
?>