$page_stats = getPageInfo("bugs", $curr_page, $curr_size, $_GET['sort'], "status != 0"); if ($bugs) { foreach ($bugs as $key => $value) { $body->set($key, $value); } foreach ($page_stats as $key => $value) { $body->set($key, $value); } } else { $body->set('page', 0); $body->set('pages', 0); } break; case 5: // Delete Bug check_authorization(); delete_bugs(); header("Location: index.php?editor=server&action=4"); exit; case 6: // Preview Hackers check_admin_authorization(); $breadcrumbs .= " >> Hackers"; $javascript = new Template("templates/server/js.tmpl.php"); $curr_page = isset($_GET['page']) ? $_GET['page'] : $default_page; $curr_size = isset($_GET['size']) ? $_GET['size'] : $default_size; $curr_sort = isset($_GET['sort']) ? $columns1[$_GET['sort']] : $columns1[$default_sort]; if ($_GET['filter'] == 'on') { $filter = build_filter(); } $body = new Template("templates/server/hackers.tmpl.php");
function add_taskset() { check_authorization(); global $mysql; $id = $_POST['id']; $taskid = $_POST['taskid']; $query = "INSERT INTO tasksets values ({$id},{$taskid})"; $mysql->query_no_result($query); }
function magelo_import() { check_authorization(); global $mysql, $npcid, $perl_path; $insert = $_POST['spawngroupinsert']; $limit = $_POST['limit']; $heading = $_POST['heading']; $respawntime = $_POST['respawntime']; $spawnlimit = $_POST['spawnlimit']; $mincoord = $_POST['mincoord']; $maxcoord = $_POST['maxcoord']; $forcedz = $_POST['forcedz']; $output = array(); $output = exec("perl {$perl_path}/Coords.pl {$npcid} {$insert} {$limit} {$spawnlimit} {$heading} {$respawntime} {$mincoord} {$maxcoord} {$forcedz} 2>&1"); logPerl($output); }
function delete_zone() { check_authorization(); global $mysql, $zoneid; $query = "DELETE FROM zone WHERE id={$zoneid}"; $mysql->query_no_result($query); }
function move_copy_lootdrop_item() { check_authorization(); global $mysql; $ldid = $_GET['ldid']; $itemid = $_GET['itemid']; $equip = $_POST['equip_item']; $charges = $_POST['charges']; $chance = $_POST['chance']; $minlevel = $_POST['minlevel']; $maxlevel = $_POST['maxlevel']; $multiplier = $_POST['multiplier']; $new_ldid = $_POST['movetolootdrop']; $move_copy_item = $_POST['move_copy_item']; if ($move_copy_item == 0) { $query1 = "DELETE FROM lootdrop_entries WHERE lootdrop_id='{$ldid}' AND item_id='{$itemid}'"; $mysql->query_no_result($query1); $query2 = "INSERT INTO lootdrop_entries SET lootdrop_id={$new_ldid}, item_id={$itemid}, equip_item={$equip}, item_charges={$charges}, chance={$chance}, minlevel={$minlevel}, maxlevel={$maxlevel}, multiplier={$multiplier}"; $mysql->query_no_result($query2); } if ($move_copy_item == 1) { $query = "INSERT INTO lootdrop_entries SET lootdrop_id={$new_ldid}, item_id={$itemid}, equip_item={$equip}, item_charges={$charges}, chance={$chance}, minlevel={$minlevel}, maxlevel={$maxlevel}, multiplier={$multiplier}"; $mysql->query_no_result($query); } }
function delete_emote() { check_authorization(); global $mysql, $npcid; $id = $_GET['id']; $emoteid = $_GET['emoteid']; $query = "DELETE FROM npc_emotes WHERE id={$id}"; $mysql->query_no_result($query); $query = "SELECT count(*) AS emotecount FROM npc_emotes WHERE emoteid={$emoteid}"; $result = $mysql->query_assoc($query); $count = $result['emotecount']; if ($count == 0) { $query = "UPDATE npc_types SET emoteid=0 WHERE emoteid={$emoteid}"; $mysql->query_no_result($query); } if ($count != 0) { return $emoteid; } else { return 0; } }
function change_spellset_byclass() { check_authorization(); global $mysql, $npcid, $z; $zid = getZoneID($z); $min_id = $zid * 1000 - 1; $max_id = $zid * 1000 + 1000; $id = $_GET['id']; $npcclass = $_POST['npcclass']; $updateall = $_POST['updateall']; if ($updateall == 0) { $query = "UPDATE npc_types SET npc_spells_id={$id} WHERE class = {$npcclass} AND id > {$min_id} AND id < {$max_id} AND npc_spells_id = 0"; $mysql->query_no_result($query); } if ($updateall == 1) { $query = "UPDATE npc_types SET npc_spells_id={$id} WHERE class = {$npcclass} AND id > {$min_id} AND id < {$max_id}"; $mysql->query_no_result($query); } }
function npcs_using_faction($value) { check_authorization(); global $mysql, $fid; if ($value == 1) { $query = "SELECT nt.id AS npcid, nt.name AS npcname, nfe.npc_value AS factionvalue from npc_types nt\n INNER JOIN npc_faction_entries nfe ON nfe.npc_faction_id = nt.npc_faction_id\n WHERE nfe.faction_id = {$fid} AND nfe.npc_faction_id in (SELECT npc_faction_id from npc_faction_entries where value > 0 and faction_id = {$fid}) GROUP by nt.id ORDER by nt.name"; } if ($value == 2) { $query = "SELECT nt.id AS npcid, nt.name AS npcname, nfe.npc_value AS factionvalue from npc_types nt\n INNER JOIN npc_faction_entries nfe ON nfe.npc_faction_id = nt.npc_faction_id\n WHERE nfe.faction_id = {$fid} AND nfe.npc_faction_id in (SELECT npc_faction_id from npc_faction_entries where value < 0 and faction_id = {$fid}) GROUP by nt.id ORDER by nt.name"; } if ($value == 3) { $query = "SELECT nt.id AS npcid, nt.name AS npcname, nfe.npc_value AS factionvalue from npc_types nt\n INNER JOIN npc_faction_entries nfe ON nfe.npc_faction_id = nt.npc_faction_id\n WHERE nfe.faction_id = {$fid} AND nfe.npc_faction_id in (SELECT npc_faction_id from npc_faction_entries where value = 0 and faction_id = {$fid}) GROUP by nt.id ORDER by nt.name"; } $results = $mysql->query_mult_assoc($query); return $results; }
function get_new_id() { check_authorization(); global $mysql; $query = "SELECT MAX(id) as tid FROM tradeskill_recipe"; $result = $mysql->query_assoc($query); $nrec = $result['tid']; return $nrec; }
function merchantlist_npcid() { check_authorization(); global $mysql, $npcid; $mid = $_GET['mid']; $query = "SELECT COUNT(*) AS npc_count FROM npc_types WHERE merchant_id={$mid} AND id != {$npcid}"; $result = $mysql->query_assoc($query); $count = $result['npc_count']; if ($count == 0) { $query = "UPDATE npc_types set merchant_id={$npcid} WHERE id={$npcid}"; $mysql->query_no_result($query); $query = "UPDATE merchantlist set merchantid={$npcid} WHERE merchantid={$mid}"; $mysql->query_no_result($query); } }