|
From: <lpa...@us...> - 2023-12-05 22:36:32
|
Revision: 10015
http://sourceforge.net/p/planeshift/code/10015
Author: lpancallo
Date: 2023-12-05 22:36:31 +0000 (Tue, 05 Dec 2023)
Log Message:
-----------
Added min faction
List NPC by Faction
Added tribe recipe
added achievements under stats
Modified Paths:
--------------
www/webconsole-new/global.css
www/webconsole-new/index.php
www/webconsole-new/npcs/createnpc.php
www/webconsole-new/npcs/npc_details.php
www/webconsole-new/npcs/npcmain.php
www/webconsole-new/quests/listquests.php
www/webconsole-new/statistics/statsmain.php
www/webconsole-new/tribes/tribe_details.php
Added Paths:
-----------
www/webconsole-new/npcs/listnpcfactions.php
www/webconsole-new/statistics/achievements_array.php
www/webconsole-new/statistics/liststats_achievements.php
Modified: www/webconsole-new/global.css
===================================================================
--- www/webconsole-new/global.css 2022-10-21 20:00:14 UTC (rev 10014)
+++ www/webconsole-new/global.css 2023-12-05 22:36:31 UTC (rev 10015)
@@ -220,3 +220,23 @@
.red{
color:red;
}
+
+/* Tooltip text */
+.tooltip .tooltiptext {
+ visibility: hidden;
+ width: 120px;
+ background-color: black;
+ color: #fff;
+ text-align: center;
+ padding: 5px 0;
+ border-radius: 6px;
+
+ /* Position the tooltip text - see examples below! */
+ position: absolute;
+ z-index: 1;
+}
+
+/* Show the tooltip text when you mouse over the tooltip container */
+.tooltip:hover .tooltiptext {
+ visibility: visible;
+}
Modified: www/webconsole-new/index.php
===================================================================
--- www/webconsole-new/index.php 2022-10-21 20:00:14 UTC (rev 10014)
+++ www/webconsole-new/index.php 2023-12-05 22:36:31 UTC (rev 10015)
@@ -347,6 +347,12 @@
npcmain();
editmerchant();
break;
+ case 'listnpcfactions':
+ include('./npcs/npcmain.php');
+ include('./npcs/listnpcfactions.php');
+ npcmain();
+ listnpcfactions();
+ break;
case 'listtrainer':
include('./npcs/npcmain.php');
include('./npcs/listtrainer.php');
@@ -859,6 +865,12 @@
statsmain();
liststats_charstats();
break;
+ case 'liststats_achievements':
+ include('./statistics/statsmain.php');
+ include('./statistics/liststats_achievements.php');
+ statsmain();
+ liststats_achievements();
+ break;
case 'assets':
include('./assets/assetsmain.php');
assetsmain();
Modified: www/webconsole-new/npcs/createnpc.php
===================================================================
--- www/webconsole-new/npcs/createnpc.php 2022-10-21 20:00:14 UTC (rev 10014)
+++ www/webconsole-new/npcs/createnpc.php 2023-12-05 22:36:31 UTC (rev 10015)
@@ -13,11 +13,14 @@
$fields = array('NPC Master' => 'npc_master_id', 'Name' => 'npcname', 'Last Name' => 'lastname', 'Description' => 'description', 'Race' => 'race', 'Stats' => 'stats', 'HP' => 'hp', 'Sector' => 'sector', 'Position' => 'position', 'Spawn Rule' => 'spawn', 'Weapon' => 'weapon', 'Behavior' => 'behavior', 'Skill Rank' => 'skill_value', 'Exp' => 'exp');
foreach($fields as $name => $field)
{
- if(!isset($_POST[$field]) || $_POST[$field] === '')
- {
- echo '<p class="error">You have to fill the "'.$name.'" field, too.</p>';
- $doit = false;
- break;
+ // allow empty weapon, behaviour and region
+ if ($name != 'Weapon' && $name != 'Behavior' && $name != 'Skill Rank') {
+ if(!isset($_POST[$field]) || $_POST[$field] === '')
+ {
+ echo '<p class="error">You have to fill the "'.$name.'" field, too.</p>';
+ $doit = false;
+ break;
+ }
}
}
@@ -84,7 +87,7 @@
$sql = "INSERT INTO character_skills VALUES ($newnpcid, $skill, 0, 0, $skill_value)";
mysql_query2($sql);
}
- if ($region != -1 || $behavior != 'None')
+ if ($region != -1 || $behavior != '')
{
$sql = "INSERT INTO sc_npc_definitions (char_id, name, npctype, region, console_debug) VALUES ($newnpcid, '".escapeSqlString($npcname)."','".escapeSqlString($behavior)."','".escapeSqlString($region)."','N')";
mysql_query2($sql);
@@ -106,10 +109,10 @@
echo '<tr><td>Sector: </td><td>'.DrawSelectBox('sectorid', PrepSelect('sectorid'), 'sector', (isset($_POST['sector']) ? $_POST['sector'] : '')).'</td></tr>';
echo '<tr><td>X,Y,Z,Rot: </td><td><input type="text" name="position" value="'.(isset($_POST['position']) ? htmlentities($_POST['position']) : '0,0,0,0').'" /></td></tr>';
echo '<tr><td>Spawn Rule: </td><td>'.DrawSelectBox('spawn', PrepSelect('spawn'), 'spawn', (isset($_POST['spawn']) ? $_POST['spawn'] : '')).'</td></tr>';
- echo '<tr><td>Weapon: </td><td>'.DrawSelectBox('weapon', PrepSelect('weapon'), 'weapon', (isset($_POST['weapon']) ? $_POST['weapon'] : -1)).'</td></tr>';
+ echo '<tr><td>Weapon: </td><td>'.DrawSelectBox('weapon', PrepSelect('weapon'), 'weapon', (isset($_POST['weapon']) ? $_POST['weapon'] : -1), true).'</td></tr>';
echo '<tr><td>Weapon Skill Rank: </td><td><input type="text" name="skill_value" size="8" value="'.(isset($_POST['skill_value']) ? htmlentities($_POST['skill_value']) : '').'" /></td></tr>';
- echo '<tr><td>Behavior: </td><td>'.DrawSelectBox('behaviour', PrepSelect('behaviour'), 'behavior', (isset($_POST['behavior']) ? $_POST['behavior'] : '')).'</td></tr>';
- echo '<tr><td>Region: </td><td>'.DrawSelectBox('b_region', PrepSelect('b_region'), 'region', (isset($_POST['region']) ? $_POST['region'] : '')).'</td></tr>';
+ echo '<tr><td>Behavior: </td><td>'.DrawSelectBox('behaviour', PrepSelect('behaviour'), 'behavior', (isset($_POST['behavior']) ? $_POST['behavior'] : ''), true).'</td></tr>';
+ echo '<tr><td>Region: </td><td>'.DrawSelectBox('b_region', PrepSelect('b_region'), 'region', (isset($_POST['region']) ? $_POST['region'] : ''), true).'</td></tr>';
echo '<tr><td>Exp: </td><td><input type="text" name="exp" size="5" value="'.(isset($_POST['exp']) ? htmlentities($_POST['exp']) : '').'" /></td></tr>';
echo '<tr><td><input type="submit" name="submit" value="Create NPC" /></td><td><input type="reset" value="Reset" /></td></tr>';
echo '</table></form>';
Added: www/webconsole-new/npcs/listnpcfactions.php
===================================================================
--- www/webconsole-new/npcs/listnpcfactions.php (rev 0)
+++ www/webconsole-new/npcs/listnpcfactions.php 2023-12-05 22:36:31 UTC (rev 10015)
@@ -0,0 +1,93 @@
+<?php
+function listnpcfactions()
+{
+ if (!checkaccess('npcs', 'read'))
+ {
+ echo '<p class="error">You are not authorized to use these functions</p>';
+ return;
+ }
+
+ echo '<h1>List of NPCs divided by faction and sector</h1>';
+ $query = "select c.id, f.faction_name, sname, cname, c.lastname, cf.value from character_factions cf, factions f, (
+SELECT c.id, c.name as cname, c.lastname, s.name as sname from characters c, sectors s where s.id=c.loc_sector_id and c.character_type='1' and c.npc_impervious_ind = 'Y' order by s.name) as c where f.id = cf.faction_id and c.id = cf.character_id order by faction_name";
+ $result = mysql_query2($query);
+ $list_ids1 = "";
+ if (sqlNumRows($result) > 0)
+ {
+ echo '<table border="1">';
+ echo '<th>Faction Name</th><th>Sector Name</th><th>Name</th><th>Faction value</th>';
+ while ($row = fetchSqlAssoc($result))
+ {
+ echo '<tr>';
+ echo '<td>'.$row['faction_name'].'</td>';
+ echo '<td>'.$row['sname'].'</td>';
+ echo '<td><a href="./index.php?do=npc_details&sub=main&npc_id='.$row['id'].'">'.$row['cname'].' '.$row['lastname'].'</a></td>';
+ echo '<td>'.$row['value'].'</td>';
+ echo '</tr>';
+ $list_ids1 = $list_ids1 . ", " . $row['id'];
+ }
+ echo '</table>';
+ }
+ else
+ {
+ echo '</table>';
+ echo '<p class="error">No NPCs Found</p>';
+ }
+ echo "<br>IDs for export:".$list_ids1;
+
+ echo '<h1>List of NPCs with a faction (but attackable, this is an exception)</h1>';
+
+ $query = "select c.id, f.faction_name, sname, cname, c.lastname, cf.value from character_factions cf, factions f, (
+SELECT c.id, c.name as cname, c.lastname, s.name as sname from characters c, sectors s where s.id=c.loc_sector_id and c.character_type='1' and c.npc_impervious_ind = 'N' order by s.name) as c where f.id = cf.faction_id and c.id = cf.character_id order by faction_name";
+ $result = mysql_query2($query);
+ $list_ids1 = "";
+ if (sqlNumRows($result) > 0)
+ {
+ echo '<table border="1">';
+ echo '<th>Faction Name</th><th>Sector Name</th><th>Name</th><th>Faction value</th>';
+ while ($row = fetchSqlAssoc($result))
+ {
+ echo '<tr>';
+ echo '<td>'.$row['faction_name'].'</td>';
+ echo '<td>'.$row['sname'].'</td>';
+ echo '<td><a href="./index.php?do=npc_details&sub=main&npc_id='.$row['id'].'">'.$row['cname'].' '.$row['lastname'].'</a></td>';
+ echo '<td>'.$row['value'].'</td>';
+ echo '</tr>';
+ $list_ids1 = $list_ids1 . ", " . $row['id'];
+ }
+ echo '</table>';
+ }
+ else
+ {
+ echo '</table>';
+ echo '<p class="error">No NPCs Found</p>';
+ }
+
+ echo "<br>IDs for export:".$list_ids1;
+
+ echo '<h1>List of NPCs without a faction</h1>';
+
+ $query = "select c.id, sname, cname, c.lastname, cf.value from (SELECT c.id, c.name as cname, c.lastname, s.name as sname from characters c, sectors s where s.id=c.loc_sector_id and c.character_type='1' and c.npc_impervious_ind = 'Y' order by s.name) as c
+left join character_factions cf on c.id = cf.character_id where value is null order by sname";
+
+ $result = mysql_query2($query);
+ if (sqlNumRows($result) > 0)
+ {
+ echo '<table border="1">';
+ echo '<th>Sector Name</th><th>Name</th>';
+ while ($row = fetchSqlAssoc($result))
+ {
+ echo '<tr>';
+ echo '<td>'.$row['sname'].'</td>';
+ echo '<td><a href="./index.php?do=npc_details&sub=main&npc_id='.$row['id'].'">'.$row['cname'].' '.$row['lastname'].'</a></td>';
+ echo '</tr>';
+ }
+ echo '</table>';
+ }
+ else
+ {
+ echo '</table>';
+ echo '<p class="error">No NPCs Found</p>';
+ }
+}
+?>
Property changes on: www/webconsole-new/npcs/listnpcfactions.php
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: www/webconsole-new/npcs/npc_details.php
===================================================================
--- www/webconsole-new/npcs/npc_details.php 2022-10-21 20:00:14 UTC (rev 10014)
+++ www/webconsole-new/npcs/npc_details.php 2023-12-05 22:36:31 UTC (rev 10015)
@@ -130,7 +130,7 @@
$query = "SELECT npctype, region FROM sc_npc_definitions WHERE char_id='$id'";
$r2 = mysql_query2($query);
$row2 = fetchSqlAssoc($r2);
- echo '<tr><td>Behaviour/Region</td><td>'.DrawSelectBox('behaviour', $Behaviours, 'sc_npctype', $row2['npctype']).'/'.DrawSelectBox('b_region', $B_Regions, 'sc_region', $row2['region'], true).'</td></tr>';
+ echo '<tr><td>Behaviour/Region</td><td>'.DrawSelectBox('behaviour', $Behaviours, 'sc_npctype', $row2['npctype'], true).'/'.DrawSelectBox('b_region', $B_Regions, 'sc_region', $row2['region'], true).'</td></tr>';
}
echo '<tr><td colspan="2"><input type="hidden" name="char_type" value="'.$row['character_type'].'" /><input type="submit" name="commit" value="update" /></td></tr>';
echo '</table></form>';
@@ -706,7 +706,12 @@
$item_quality = escapeSqlString($_POST['item_quality']);
$inst_id = escapeSqlString($_POST['id']);
$query = "UPDATE item_instances SET stack_count='$stack_count', item_quality='$item_quality', crafted_quality='$item_quality' WHERE id='$inst_id'";
+ }else if ($_POST['commit'] == 'Faction'){
+ $min_faction = escapeSqlString($_POST['min_faction']);
+ $inst_id = escapeSqlString($_POST['id']);
+ $query = "UPDATE item_instances SET min_faction='$min_faction' WHERE id='$inst_id'";
}
+
unset($_POST);
$result = mysql_query2($query);
echo '<p class="error">Update Successful</p>';
@@ -718,13 +723,13 @@
echo 'receives its inventory from that master.</p>'."\n";
return;
}
- $query = "SELECT i.id, i.location_in_parent, i.stack_count, i.item_name, i.item_quality, i.item_stats_id_standard, s.name, s.valid_slots FROM item_instances AS i LEFT JOIN item_stats as s ON s.id=i.item_stats_id_standard WHERE i.char_id_owner='$id' ORDER BY s.name";
+ $query = "SELECT i.id, i.location_in_parent, i.stack_count, i.item_name, i.item_quality, i.item_stats_id_standard, i.min_faction, s.name, s.valid_slots FROM item_instances AS i LEFT JOIN item_stats as s ON s.id=i.item_stats_id_standard WHERE i.char_id_owner='$id' ORDER BY s.name";
$result = mysql_query2($query);
if (sqlNumRows($result) > 0){
- echo '<table border="1"><tr><th>Item</th><th>Location</th><th>Count/Quality</th><th>Functions</th></tr>'."\n";
+ echo '<table border="1"><tr><th>Item</th><th>Location</th><th>Count/Quality</th><th>Min Faction</th><th>Functions</th></tr>'."\n";
while ($row = fetchSqlAssoc($result)){
echo '<tr>';
- echo '<td>'.$row['name'];
+ echo '<td class="tooltip">'.$row['name'].'<span class="tooltiptext">Stats ID: '.$row['item_stats_id_standard'].' Instance ID: '.$row['id'].'</span>';
if ($row['item_name'] != null && trim($row['item_name']) != '')
{
echo ' (Renamed to "'.htmlentities($row['item_name']).'")';
@@ -731,12 +736,19 @@
}
echo '</td>'."\n";
echo '<td>'.LocationToString($row['location_in_parent']).'</td>'."\n";
+ // Count and quality
echo '<td><form action="./index.php?do=npc_details&npc_id='.$id.'&sub=items" method="post"><div>'."\n";
echo '<input type="text" name="stack_count" value="'.$row['stack_count'].'" size="3"/>'."\n";
echo '<input type="text" name="item_quality" value="'.$row['item_quality'].'" size="3"/><input type="hidden" name="id" value="'.$row['id'].'"/>'."\n";
echo '<input type="submit" name="commit" value="Update"/></div></form></td>'."\n";
+ // Min faction
echo '<td><form action="./index.php?do=npc_details&npc_id='.$id.'&sub=items" method="post"><div>'."\n";
+ echo '<input type="text" name="min_faction" value="'.$row['min_faction'].'" size="3"/>'."\n";
echo '<input type="hidden" name="id" value="'.$row['id'].'"/>'."\n";
+ echo '<input type="submit" name="commit" value="Faction"/></div></form></td>'."\n";
+ // functions like change location
+ echo '<td><form action="./index.php?do=npc_details&npc_id='.$id.'&sub=items" method="post"><div>'."\n";
+ echo '<input type="hidden" name="id" value="'.$row['id'].'"/>'."\n";
echo '<input type="submit" name="commit" value="Remove" /><br/>'."\n";
echo '<input type="submit" name="commit" value="Change Location" />'."\n";
echo '<select name="slot">';
Modified: www/webconsole-new/npcs/npcmain.php
===================================================================
--- www/webconsole-new/npcs/npcmain.php 2022-10-21 20:00:14 UTC (rev 10014)
+++ www/webconsole-new/npcs/npcmain.php 2023-12-05 22:36:31 UTC (rev 10015)
@@ -21,6 +21,7 @@
echo '<hr/>'."\n";
echo '<a href="./index.php?do=listtrainer">List Trainers</a> <br/>'."\n";
echo '<a href="./index.php?do=listmerchant">List Merchants</a> <br/>'."\n";
+ echo '<a href="./index.php?do=listnpcfactions">List NPC by faction</a> <br/>'."\n";
echo '<a href="./index.php?do=listspawn">List Spawn Rules</a> <br/>'."\n";
echo '<a href="./index.php?do=listloot">List Loot Rules</a> <br/>'."\n";
echo '<hr/>';
Modified: www/webconsole-new/quests/listquests.php
===================================================================
--- www/webconsole-new/quests/listquests.php 2022-10-21 20:00:14 UTC (rev 10014)
+++ www/webconsole-new/quests/listquests.php 2023-12-05 22:36:31 UTC (rev 10015)
@@ -348,7 +348,7 @@
}
else
{ // we want to skip this check only if an ID is specified, otherwise, we check for this to avoid the script parsing 20000 clackers and the like.
- $query .=' AND racegender_id<22';
+ $query .=' AND npc_impervious_ind = "Y"';
}
if (isset($_GET['sort']))
{
Added: www/webconsole-new/statistics/achievements_array.php
===================================================================
--- www/webconsole-new/statistics/achievements_array.php (rev 0)
+++ www/webconsole-new/statistics/achievements_array.php 2023-12-05 22:36:31 UTC (rev 10015)
@@ -0,0 +1,171 @@
+<?php
+$achievements = array(
+'1' => array('category' => 'PlaneShift Loyal Fan','name' => 'Played Atomic Blue Release!', 'description' => 'This character was part of the first ever release of PlaneShift called Atomic Blue (before March 2003)!', 'count' => '0'),
+'2' => array('category' => 'PlaneShift Loyal Fan','name' => 'Played Molecular Blue Release!', 'description' => 'This character was part of the second release of PlaneShift called Molecular Blue (before December 2004)!', 'count' => '0'),
+'5' => array('category' => 'PlaneShift Loyal Fan','name' => 'Played Steel Blue Release!', 'description' => 'This character was part of the fourth release of PlaneShift called Steel Blue!(before December 2009)', 'count' => '0'),
+'4' => array('category' => 'PlaneShift Loyal Fan','name' => 'Played Crystal Blue Late Release!', 'description' => 'This character was part of the third release of PlaneShift called Crystal Blue! (before March 2008)', 'count' => '0'),
+'3' => array('category' => 'PlaneShift Loyal Fan','name' => 'Played Crystal Blue Early Release!', 'description' => 'This character was part of the early days of PlaneShift\'s third release of called Crystal Blue! (before July 2006)', 'count' => '0'),
+'6' => array('category' => 'PlaneShift Loyal Fan','name' => 'Played Arcane Chrysalis Release!', 'description' => 'This character was part of the fifth release of PlaneShift called Arcane Chrysalis!', 'count' => '0'),
+'7' => array('category' => 'PlaneShift Loyal Fan','name' => 'Played Unreal Blue Release!', 'description' => 'This character was part of the sixth release of PlaneShift called Unreal Blue!', 'count' => '0'),
+'20' => array('category' => 'PlaneShift Loyal Fan','name' => 'Visitor of Hydlaa', 'description' => 'Visited Yliakum for more than 100 hours.', 'count' => '0'),
+'21' => array('category' => 'PlaneShift Loyal Fan','name' => 'Citizen of Hydlaa', 'description' => 'Visited Yliakum for more than 300 hours.', 'count' => '0'),
+'22' => array('category' => 'PlaneShift Loyal Fan','name' => 'Journeyman of Yliakum', 'description' => 'Visited Yliakum for more than 600 hours.', 'count' => '0'),
+'23' => array('category' => 'PlaneShift Loyal Fan','name' => 'Explorer of Yliakum', 'description' => 'Visited Yliakum for more than 1000 hours.', 'count' => '0'),
+'24' => array('category' => 'PlaneShift Loyal Fan','name' => 'Yliakum is my home!', 'description' => 'Visited Yliakum for more than 2500 hours.', 'count' => '0'),
+'10' => array('category' => 'Quests','name' => 'Quest Novice', 'description' => 'Successfully completed 20 quests.', 'count' => '0'),
+'11' => array('category' => 'Quests','name' => 'Quest Initiate', 'description' => 'Successfully completed 50 quests.', 'count' => '0'),
+'12' => array('category' => 'Quests','name' => 'Quest Addict', 'description' => 'Successfully completed 100 quests.', 'count' => '0'),
+'13' => array('category' => 'Quests','name' => 'Quest Veteran', 'description' => 'Successfully completed 200 quests.', 'count' => '0'),
+'14' => array('category' => 'Quests','name' => 'Quest Master', 'description' => 'Successfully completed 300 quests.', 'count' => '0'),
+'15' => array('category' => 'Quests','name' => 'Quest Grandmaster', 'description' => 'Successfully completed 400 quests.', 'count' => '0'),
+'40' => array('category' => 'Magic','name' => 'Crystal Way Master', 'description' => 'Unveiled the secrets of the Crystal Way achieving Master status.', 'count' => '0'),
+'41' => array('category' => 'Magic','name' => 'Azure Way Master', 'description' => 'Unveiled the secrets of the Azure Way achieving Master status.', 'count' => '0'),
+'42' => array('category' => 'Magic','name' => 'Blue Way Master', 'description' => 'Unveiled the secrets of the Blue Way achieving Master status.', 'count' => '0'),
+'43' => array('category' => 'Magic','name' => 'Red Way Master', 'description' => 'Unveiled the secrets of the Red Way achieving Master status.', 'count' => '0'),
+'44' => array('category' => 'Magic','name' => 'Brown Way Master', 'description' => 'Unveiled the secrets of the Brown Way achieving Master status.', 'count' => '0'),
+'45' => array('category' => 'Magic','name' => 'Dark Way Master', 'description' => 'Unveiled the secrets of the Dark Way achieving Master status.', 'count' => '0'),
+'46' => array('category' => 'Magic','name' => 'It\'s magic!', 'description' => 'Obtain 5 different glyphs', 'count' => '0'),
+'47' => array('category' => 'Magic','name' => 'Glyph Researcher', 'description' => 'Obtain 15 different glyphs', 'count' => '0'),
+'48' => array('category' => 'Magic','name' => 'Glyph Collector', 'description' => 'Obtain 30 different glyphs', 'count' => '0'),
+'184' => array('category' => 'Magic','name' => 'Glyph Eclectic', 'description' => 'Obtain 40 different glyphs', 'count' => '0'),
+'60' => array('category' => 'Events','name' => 'Event Novice', 'description' => 'Attended 5 roleplay events.', 'count' => '0'),
+'61' => array('category' => 'Events','name' => 'Event Initiate', 'description' => 'Attended 10 roleplay events.', 'count' => '0'),
+'62' => array('category' => 'Events','name' => 'Event Addict', 'description' => 'Attended 25 roleplay events.', 'count' => '0'),
+'63' => array('category' => 'Events','name' => 'Event Veteran', 'description' => 'Attended 50 roleplay events.', 'count' => '0'),
+'64' => array('category' => 'Events','name' => 'Event Master', 'description' => 'Attended 100 roleplay events.', 'count' => '0'),
+'50' => array('category' => 'Exploration','name' => 'Visited all four cities', 'description' => 'Has visited hydlaa, amdeneir, gugrontid and ojaveda.', 'count' => '0'),
+'51' => array('category' => 'Exploration','name' => 'Eagle Bronzedoors', 'description' => 'Find the bronzedoors', 'count' => '0'),
+'52' => array('category' => 'Exploration','name' => 'Afterlife', 'description' => 'Visit the Death Realm', 'count' => '0'),
+'53' => array('category' => 'Exploration','name' => 'The next level', 'description' => 'Visit the Winch', 'count' => '0'),
+'54' => array('category' => 'Exploration','name' => 'Metal alliance', 'description' => 'Speak with three blacksmiths', 'count' => '0'),
+'55' => array('category' => 'Exploration','name' => 'Trader of goods', 'description' => 'Speak with ten merchants', 'count' => '0'),
+'189' => array('category' => 'Exploration','name' => 'I buy it all!', 'description' => 'Speak with fifteen merchants', 'count' => '0'),
+'56' => array('category' => 'Exploration','name' => 'Expensive discussions', 'description' => 'Speak with five bankers', 'count' => '0'),
+'190' => array('category' => 'Exploration','name' => 'Money talks', 'description' => 'Speak with ten bankers', 'count' => '0'),
+'57' => array('category' => 'Exploration','name' => 'Learning adept', 'description' => 'Speak with ten trainers', 'count' => '0'),
+'191' => array('category' => 'Exploration','name' => 'Majestic listener', 'description' => 'Speak with twenty trainers', 'count' => '0'),
+'58' => array('category' => 'Exploration','name' => 'To the sky!', 'description' => 'Have your first ride on pterosaur', 'count' => '0'),
+'59' => array('category' => 'Exploration','name' => 'Speed friend', 'description' => 'Own a mount', 'count' => '0'),
+'70' => array('category' => 'Exploration','name' => 'A new family member', 'description' => 'Own a familiar', 'count' => '0'),
+'71' => array('category' => 'Exploration','name' => 'Gathering forces', 'description' => 'Create a guild', 'count' => '0'),
+'72' => array('category' => 'Exploration','name' => 'Strength in numbers', 'description' => 'Have your guild reach 20 members', 'count' => '0'),
+'188' => array('category' => 'Exploration','name' => 'No one missing', 'description' => 'Have your guild reach 50 members', 'count' => '0'),
+'73' => array('category' => 'Exploration','name' => 'We are one', 'description' => 'Establish an alliance between two guilds with at least 20 members', 'count' => '0'),
+'74' => array('category' => 'Factions','name' => 'Hero', 'description' => 'Achieve Hero title in Order of the Keen Edge', 'count' => '0'),
+'75' => array('category' => 'Factions','name' => 'Titan', 'description' => 'Achieve Titan title in War Smiters', 'count' => '0'),
+'76' => array('category' => 'Factions','name' => 'Ballista', 'description' => 'Achieve the Ballista title in Rangers of the Dome', 'count' => '0'),
+'77' => array('category' => 'Factions','name' => 'Axe Grandmaster', 'description' => 'Achieve Axe Grandmaster in The Indomitables', 'count' => '0'),
+'78' => array('category' => 'Factions','name' => 'Divine Magister', 'description' => 'Achieve Divine Magister in Azure Order', 'count' => '0'),
+'79' => array('category' => 'Factions','name' => 'Supreme Thaumathurgist ', 'description' => 'Achieve Supreme Thaumathurgist in Blue Order', 'count' => '0'),
+'80' => array('category' => 'Factions','name' => 'Illustrious Earth Warden', 'description' => 'Achieve Illustrious Earth Warden in Brown Order', 'count' => '0'),
+'81' => array('category' => 'Factions','name' => 'Grand Master Theurgist', 'description' => 'Achieve Grand Master Theurgist in Crystal Order', 'count' => '0'),
+'82' => array('category' => 'Factions','name' => 'Imperator', 'description' => 'Achieve Imperator in Dark Order', 'count' => '0'),
+'83' => array('category' => 'Factions','name' => 'Mercurial Pyromancer', 'description' => 'Achieve Mercurial Pyromancer in Red Order', 'count' => '0'),
+'84' => array('category' => 'Factions','name' => 'The Chosen', 'description' => 'Achieve The Chosen in Cabal of Whispers', 'count' => '0'),
+'85' => array('category' => 'Factions','name' => 'Talad\'s Light', 'description' => 'Achieve Talad\'s Light in Conclave of the Glyphs', 'count' => '0'),
+'86' => array('category' => 'Factions','name' => 'Laanx\'s Iron Hand', 'description' => 'Achieve Laanx\'s Iron Hand in Iron Hand', 'count' => '0'),
+'87' => array('category' => 'Factions','name' => 'Supreme Void', 'description' => 'Achieve Supreme Void in Keepers of the Veil', 'count' => '0'),
+'88' => array('category' => 'Factions','name' => 'Prophet', 'description' => 'Achieve Prophet in Seeds of Wildwood', 'count' => '0'),
+'89' => array('category' => 'Factions','name' => 'Venerable Muse ', 'description' => 'Achieve Venerable Muse in Fine Arts and Craft', 'count' => '0'),
+'90' => array('category' => 'Factions','name' => 'Civilization Forger', 'description' => 'Achieve Civilization Forger in Essential Trail', 'count' => '0'),
+'91' => array('category' => 'Factions','name' => 'Finest Spoon', 'description' => 'Achieve Finest Spoon in Culinary Disciplines', 'count' => '0'),
+'92' => array('category' => 'Factions','name' => 'Velvet Glove', 'description' => 'Achieve Velvet Glove in Weavers Tree', 'count' => '0'),
+'93' => array('category' => 'Factions','name' => 'Savant', 'description' => 'Achieve Savant in Applied Knowledge', 'count' => '0'),
+'94' => array('category' => 'Factions','name' => 'Prodigious Creator', 'description' => 'Achieve Prodigious Creator in The Eternal Forge', 'count' => '0'),
+'95' => array('category' => 'Factions','name' => 'Nature\'s Chosen', 'description' => 'Achieve Nature\'s Chosen in The Caretakers', 'count' => '0'),
+'96' => array('category' => 'Factions','name' => 'Octarchial Counsellor', 'description' => 'Achieve Octarchial Counsellor in Octarchy', 'count' => '0'),
+'97' => array('category' => 'Factions','name' => 'Mastermind', 'description' => 'Achieve Mastermind in The 13 Wards', 'count' => '0'),
+'98' => array('category' => 'Combat','name' => 'A special weapon', 'description' => 'Find a weapon with a modifier', 'count' => '0'),
+'99' => array('category' => 'Combat','name' => 'A very special weapon', 'description' => 'Find a weapon with two modifiers', 'count' => '0'),
+'100' => array('category' => 'Combat','name' => 'It has it all', 'description' => 'Find a weapon with three modifiers', 'count' => '0'),
+'101' => array('category' => 'Combat','name' => 'Tigrain-Steel', 'description' => 'Find a weapon with Tigrain-Steel modifier', 'count' => '0'),
+'102' => array('category' => 'Combat','name' => 'Masterwork', 'description' => 'Find a weapon with Masterwork modifier', 'count' => '0'),
+'103' => array('category' => 'Combat','name' => 'Laanx\'s Wrath', 'description' => 'Find a weapon with of Laanx\'s Wrath modifier', 'count' => '0'),
+'104' => array('category' => 'Combat','name' => 'All covered', 'description' => 'Equip 1 of each piece of armor', 'count' => '0'),
+'105' => array('category' => 'Combat','name' => 'A nice set', 'description' => 'Equip three pieces of enchanted armor', 'count' => '0'),
+'106' => array('category' => 'Combat','name' => 'A luxury set', 'description' => 'Equip six pieces of enchanted armor', 'count' => '0'),
+'107' => array('category' => 'Combat','name' => 'Xalpalock Vanquisher', 'description' => 'Defeat the grand atrocity Xalpalock in the Stone Labyrinth', 'count' => '0'),
+'108' => array('category' => 'Combat','name' => 'Stalg\'s Demise', 'description' => 'Defeat Stalg', 'count' => '0'),
+'109' => array('category' => 'Combat','name' => 'Blackroot Deforester', 'description' => 'Defeat Blackroot', 'count' => '0'),
+'192' => array('category' => 'Combat','name' => 'One less claw', 'description' => 'Defeat the last-one standing maulberlord One-Claw on his territory', 'count' => '0'),
+'193' => array('category' => 'Combat','name' => 'Zlatac\'s Doom', 'description' => 'Defeat the crowed riverling Zlatac in his realm', 'count' => '0'),
+'194' => array('category' => 'Combat','name' => 'Nefas Dur\'s Downfall', 'description' => 'Defeat Nefas Dur the necromancer in his refuge', 'count' => '0'),
+'195' => array('category' => 'Combat','name' => 'Marangma\'s Bane', 'description' => 'Defeat the great spider Marangma in her lair', 'count' => '0'),
+'196' => array('category' => 'Combat','name' => 'Toxic Clacker Chaser', 'description' => 'Track and defeat the Toxic Clacker in his domain', 'count' => '0'),
+'110' => array('category' => 'Combat','name' => 'Melee', 'description' => 'TDB', 'count' => '0'),
+'112' => array('category' => 'Sword','name' => 'Rare Sword', 'description' => 'Find a Sword with 0.1% rarity', 'count' => '0'),
+'113' => array('category' => 'Sword','name' => 'Unique Sword', 'description' => 'Find a Sword with 0.01% rarity', 'count' => '0'),
+'115' => array('category' => 'Knives','name' => 'Rare Knife', 'description' => 'Find a Knife or Dagger with 0.1% rarity', 'count' => '0'),
+'116' => array('category' => 'Knives','name' => 'Unique Knife', 'description' => 'Find a Knife or Dagger with 0.01% rarity', 'count' => '0'),
+'118' => array('category' => 'Axe','name' => 'Rare Axe', 'description' => 'Find an Axe with 0.1% rarity', 'count' => '0'),
+'119' => array('category' => 'Axe','name' => 'Unique Axe', 'description' => 'Find an Axe with 0.01% rarity', 'count' => '0'),
+'121' => array('category' => 'Mace','name' => 'Rare Mace', 'description' => 'Find a Mace or Hammer with 0.1% rarity', 'count' => '0'),
+'122' => array('category' => 'Mace','name' => 'Unique Mace', 'description' => 'Find a Mace or Hammer with 0.01% rarity', 'count' => '0'),
+'124' => array('category' => 'Polearm','name' => 'Rare Polearm', 'description' => 'Find a Polearm or Spear with 0.1% rarity', 'count' => '0'),
+'125' => array('category' => 'Polearm','name' => 'Unique Polearm', 'description' => 'Find a Polearm or Spear with 0.01% rarity', 'count' => '0'),
+'127' => array('category' => 'Ranged','name' => 'Rare Ranged', 'description' => 'Find a Bow or Crossbow with 0.1% rarity', 'count' => '0'),
+'128' => array('category' => 'Ranged','name' => 'Unique Ranged', 'description' => 'Find a Bow or Crossbow with 0.01% rarity', 'count' => '0'),
+'129' => array('category' => 'Armor','name' => 'Shield Handling', 'description' => 'TDB', 'count' => '0'),
+'130' => array('category' => 'Armor','name' => 'Light Armor', 'description' => 'TDB', 'count' => '0'),
+'131' => array('category' => 'Armor','name' => 'Medium Armor', 'description' => 'TDB', 'count' => '0'),
+'132' => array('category' => 'Armor','name' => 'Heavy Armor', 'description' => 'TDB', 'count' => '0'),
+'133' => array('category' => 'Crafting','name' => 'Trusted blacksmith', 'description' => 'Repair an armor with value of 50000 or more', 'count' => '0'),
+'134' => array('category' => 'Crafting','name' => 'Trusted weaponsmith', 'description' => 'Repair a weapon with value of 50000 or more', 'count' => '0'),
+'135' => array('category' => 'Crafting','name' => 'Starting your business', 'description' => 'Craft your first item', 'count' => '0'),
+'136' => array('category' => 'Crafting','name' => 'Getting known', 'description' => 'Craft an item with 100 quality or more', 'count' => '0'),
+'137' => array('category' => 'Crafting','name' => 'Precious items', 'description' => 'Craft an item with 200 quality or more', 'count' => '0'),
+'138' => array('category' => 'Crafting','name' => 'Masterpiece', 'description' => 'Craft an item with 300 quality', 'count' => '0'),
+'139' => array('category' => 'Mining','name' => 'Miner expertise', 'description' => 'Mine 3 different base ore', 'count' => '0'),
+'197' => array('category' => 'Mining','name' => 'Land cartographer', 'description' => 'Mine 10 different ore', 'count' => '0'),
+'141' => array('category' => 'Mining','name' => 'Here it is!', 'description' => 'Mine any ore of 150 quality', 'count' => '0'),
+'142' => array('category' => 'Mining','name' => 'For the experts', 'description' => 'Mine any ore of 250 quality', 'count' => '0'),
+'143' => array('category' => 'Mining','name' => 'The great coal finding', 'description' => 'Mine coal of 300 quality', 'count' => '0'),
+'144' => array('category' => 'Mining','name' => 'Nature explorer', 'description' => 'Harvest 10 different plant types', 'count' => '0'),
+'198' => array('category' => 'Mining','name' => 'A beautiful bouquet', 'description' => 'Harvest 20 different plant types', 'count' => '0'),
+'145' => array('category' => 'Mining','name' => 'Quality matters', 'description' => 'Harvest any plant with 150 quality', 'count' => '0'),
+'146' => array('category' => 'Mining','name' => 'Only the finest', 'description' => 'Harvest any plant with 250 quality', 'count' => '0'),
+'147' => array('category' => 'Fishing','name' => 'It\'s a catch!', 'description' => 'Catch your first fish', 'count' => '0'),
+'148' => array('category' => 'Fishing','name' => 'A new finding', 'description' => 'Catch 6 different types of fishes', 'count' => '0'),
+'149' => array('category' => 'Fishing','name' => 'A happy belly', 'description' => 'Catch 12 different types of fishes', 'count' => '0'),
+'199' => array('category' => 'Fishing','name' => 'Above average', 'description' => 'Catch any fish with 150 quality', 'count' => '0'),
+'200' => array('category' => 'Fishing','name' => 'Exquisite taste', 'description' => 'Catch any fish with 250 quality', 'count' => '0'),
+'150' => array('category' => 'Cooking','name' => 'Honey delicacy', 'description' => 'Cook a Fried Honey Nut Dough', 'count' => '0'),
+'151' => array('category' => 'Cooking','name' => 'Sweet, sweet pie', 'description' => 'Cook a Fried Apple Hand Pie', 'count' => '0'),
+'152' => array('category' => 'Cooking','name' => 'Succulent Stew', 'description' => 'Cook a Cheesy Succulent Stew', 'count' => '0'),
+'153' => array('category' => 'Cooking','name' => 'Delicious fish soup', 'description' => 'Cook a Crayfish And Kartoffel Soup', 'count' => '0'),
+'154' => array('category' => 'Alchemy','name' => 'Like a rock', 'description' => 'Create a Major Potion of Ynnwn\'s Toughness', 'count' => '0'),
+'155' => array('category' => 'Alchemy','name' => 'Its raining crystals', 'description' => 'Create a Major Potion of Water Crystal and Air Affinity', 'count' => '0'),
+'156' => array('category' => 'Alchemy','name' => 'Grounded and on fire!', 'description' => 'Create a Major Potion of Fire Dark and Earth Affinity', 'count' => '0'),
+'157' => array('category' => 'Alchemy','name' => 'Spellcasting continuum', 'description' => 'Create a Greater Potion of Mana', 'count' => '0'),
+'158' => array('category' => 'Alchemy','name' => 'Universal Panacea', 'description' => 'Create a Universal Panacea', 'count' => '0'),
+'159' => array('category' => 'Alchemy','name' => 'Tasty minerals', 'description' => 'Craft a Big Blue Gold Steak', 'count' => '0'),
+'160' => array('category' => 'Alchemy','name' => 'Gems delight', 'description' => 'Craft a Brassed Delightful Sauce', 'count' => '0'),
+'161' => array('category' => 'Herbal','name' => 'Unexpected drink', 'description' => 'Brew a Nicinela Tea', 'count' => '0'),
+'162' => array('category' => 'Herbal','name' => 'Benevolent mix', 'description' => 'Create a Red Mangrove Poultice', 'count' => '0'),
+'163' => array('category' => 'Herbal','name' => 'Lavender solution', 'description' => 'Create a Glaboria Salve', 'count' => '0'),
+'164' => array('category' => 'Brewing','name' => 'Cheers!', 'description' => 'Brew a Stout Beer Keg', 'count' => '0'),
+'165' => array('category' => 'Brewing','name' => 'This one is on me!', 'description' => 'Brew a Terevan Cider Keg', 'count' => '0'),
+'166' => array('category' => 'Brewing','name' => 'Party time', 'description' => 'Craft a Terevan Wine Barrel', 'count' => '0'),
+'167' => array('category' => 'Blacksmith','name' => 'Magical gems', 'description' => 'Enchant a Diamond Crystal', 'count' => '0'),
+'168' => array('category' => 'Blacksmith','name' => 'Enchanted Armor', 'description' => 'Enchant a Plate Mail Torso Armor', 'count' => '0'),
+'169' => array('category' => 'Blacksmith','name' => 'Enchanted Weapon', 'description' => 'Enchant a Platinum Steel Claymore', 'count' => '0'),
+'170' => array('category' => 'Blacksmith','name' => 'Protective magic', 'description' => 'Enchant a Radiant Shield', 'count' => '0'),
+'171' => array('category' => 'Blacksmith','name' => 'Defending our cities', 'description' => 'Craft a Chain Mail Torso Armor', 'count' => '0'),
+'172' => array('category' => 'Blacksmith','name' => 'For the glory!', 'description' => 'Craft a Steel Plate Helm', 'count' => '0'),
+'173' => array('category' => 'Blacksmith','name' => 'Try to hit me now', 'description' => 'Craft a Wheel Shield', 'count' => '0'),
+'174' => array('category' => 'Blacksmith','name' => 'Two handed perfection', 'description' => 'Craft a Claymore', 'count' => '0'),
+'175' => array('category' => 'Blacksmith','name' => 'Double cut', 'description' => 'Craft a Reinforced Battle Axe', 'count' => '0'),
+'176' => array('category' => 'Blacksmith','name' => 'To war!', 'description' => 'Craft a Platinum Steel Warhammer', 'count' => '0'),
+'177' => array('category' => 'Blacksmith','name' => 'Slice and dice', 'description' => 'Craft a Platinum Steel Broadsword', 'count' => '0'),
+'178' => array('category' => 'Blacksmith','name' => 'Shiny metals', 'description' => 'Craft a Gold Stock', 'count' => '0'),
+'179' => array('category' => 'Blacksmith','name' => 'Lumium expert', 'description' => 'Craft a Lumium Stock', 'count' => '0'),
+'180' => array('category' => 'Leatherworking','name' => 'Military fashion', 'description' => 'Craft a pair of Leather Gloves', 'count' => '0'),
+'181' => array('category' => 'Leatherworking','name' => 'Confortable armor', 'description' => 'Craft a Leather Torso Armor', 'count' => '0'),
+'182' => array('category' => 'BowMaking','name' => 'Grace and precision', 'description' => 'Craft a Dermorian Composite Bow', 'count' => '0'),
+'183' => array('category' => 'BowMaking','name' => 'Power and strength', 'description' => 'Craft a Stonehammer Compound Bow', 'count' => '0'),
+'185' => array('category' => 'Jewelry','name' => 'It\'s love!', 'description' => 'Craft a Golden Ring', 'count' => '0'),
+'186' => array('category' => 'Jewelry','name' => 'A golden pair', 'description' => 'Craft Gold Ruby Bracers', 'count' => '0'),
+'187' => array('category' => 'Jewelry','name' => 'A diamond is forever', 'description' => 'Craft a Platinum Diamond Necklace', 'count' => '0')
+
+);
+?>
\ No newline at end of file
Property changes on: www/webconsole-new/statistics/achievements_array.php
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: www/webconsole-new/statistics/liststats_achievements.php
===================================================================
--- www/webconsole-new/statistics/liststats_achievements.php (rev 0)
+++ www/webconsole-new/statistics/liststats_achievements.php 2023-12-05 22:36:31 UTC (rev 10015)
@@ -0,0 +1,70 @@
+<?php
+
+function liststats_achievements()
+{
+ include('./graphfunctions.php');
+ include('achievements_array.php');
+ if(checkaccess('statistics', 'read'))
+ {
+ $filter = 10;
+ $psversion = "psu";
+ $filterSQL = "";
+ if ( isset($_POST['filter']) && $_POST['filter']!="") {
+ $filter = escapeSqlString($_POST['filter']);
+ $filterSQL = " and DATE(c.creation_time) > '".$filter."'";
+ }
+
+ ?>
+ <form action="./index.php?do=liststats_achievements" method="post"><br/>
+ <input name="filter" value="">
+ <?php
+ echo "Filter by character creation date (YYYY-MM-DD): <br/>";
+ echo "<br/><input type=\"submit\" name=\"Filter\" value=\"Filter\"/></form>";
+ if ($filterSQL != "")
+ echo '<p class="header">Achievements with filter: '.$filter.'</p>';
+ else
+ echo '<p class="header">Achievements</p>';
+
+ $sql = "select achievement_id,count(achievement_id) c from character_achievements ca, characters c where ca.character_id = c.id ".$filterSQL." group by achievement_id order by achievement_id asc";
+ $query = mysql_query2($sql);
+
+ $localAchieve = $achievements;
+
+ if(sqlNumRows($query) < 1)
+ {
+ echo '<p class="error">No data found! Try changing the filter</p>';
+ } else
+
+ // fill up the local achievemement array with the counts extracted from the db
+ while($result = fetchSqlAssoc($query))
+ {
+ $id = $result['achievement_id'];
+ $count = $result['c'];
+ // set the count
+ $localAchieve[$id]['count'] = $count;
+ }
+
+ echo "<table>";
+ echo "<th>ID</th><th>Category</th><th>Name</th><th>Description</th><th>Count</th>";
+
+ foreach ($localAchieve as $id => $entry)
+ {
+ //$id = $entry['id'];
+ $category = $entry['category'];
+ $name = $entry['name'];
+ $description = $entry['description'];
+ $count = $entry['count'];
+
+ echo "<tr><td>".$id."</td><td>".$category."</td><td>".$name."</td><td>".$description."</td><td>".$count."</td></tr>";
+ }
+ echo "</table>";
+
+
+ }
+ else
+ {
+ echo '<p class="error">You are not authorized to use these functions</p>';
+ }
+}
+
+?>
Property changes on: www/webconsole-new/statistics/liststats_achievements.php
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: www/webconsole-new/statistics/statsmain.php
===================================================================
--- www/webconsole-new/statistics/statsmain.php 2022-10-21 20:00:14 UTC (rev 10014)
+++ www/webconsole-new/statistics/statsmain.php 2023-12-05 22:36:31 UTC (rev 10015)
@@ -23,6 +23,7 @@
echo '<a href="./index.php?do=liststats_charstats&groupid=14">Skill: Crystal Way</a> <br/>';
echo '<a href="./index.php?do=liststats_charstats&groupid=15">Skill: Melee</a> <br/>';
echo '<a href="./index.php?do=liststats_charstats&groupid=16">Char Money</a> <br/>';
+ echo '<a href="./index.php?do=liststats_achievements">Achievements</a> <br/>';
echo '<a href="./index.php?do=listquests&mode=hiercount&countstatus=C">Completed Quests (* !!)</a> <br/>';
echo '<a href="./index.php?do=listquests&mode=hiercount&countstatus=A">Pending Quests(* !!)</a> <br/>';
Modified: www/webconsole-new/tribes/tribe_details.php
===================================================================
--- www/webconsole-new/tribes/tribe_details.php 2022-10-21 20:00:14 UTC (rev 10014)
+++ www/webconsole-new/tribes/tribe_details.php 2023-12-05 22:36:31 UTC (rev 10015)
@@ -36,6 +36,7 @@
echo '<a href="'.$uri_string.'&sub=knowledge">Knowledge</a><br/>'."\n";
echo '<a href="'.$uri_string.'&sub=memories">Memories</a><br/>'."\n";
echo '<a href="'.$uri_string.'&sub=resources">Resources</a><br/>'."\n";
+ echo '<a href="'.$uri_string.'&sub=recipes">Recipes</a><br/>'."\n";
echo '</div><div class="main_npc">'."\n";
if (isset($_GET['sub']))
{
@@ -59,6 +60,9 @@
case 'resources':
tribeResources();
break;
+ case 'recipes':
+ tribeRecipes();
+ break;
default:
echo '<p class="error">Please Select an Action</p>';
}
@@ -732,4 +736,191 @@
}
}
+$buildingList = array();
+$reservedSpots = array();
+
+function tribeRecipes()
+{
+ // find main recipe
+ $id = escapeSqlString($_GET['tribe_id']);
+ $query = "SELECT * FROM tribes WHERE id='$id'";
+ $result = mysql_query2($query);
+ $row = fetchSqlAssoc($result);
+
+ $mainRecipe = $row['tribal_recipe'];
+ $query = "SELECT * FROM tribe_recipes WHERE id='$mainRecipe'";
+ $result = mysql_query2($query);
+ $row2 = fetchSqlAssoc($result);
+
+ echo '<form action="./index.php?do=tribe_details&sub=recipes&tribe_id='.$id.'" method="post">';
+ $showall = false;
+ if (isset($_POST['showall']))
+ {
+ $showall = true;
+ echo '<input type="checkbox" id="showall" name="showall" value="showall" checked><label for="vehicle1"> Show Verbose Info</label> ';
+ }
+ else
+ echo '<input type="checkbox" id="showall" name="showall" value="showall"><label for="vehicle1"> Show Verbose Info</label> ';
+
+ echo '<input type="submit" name="commit" value="Refresh" /></form>';
+
+ echo "<h2>Main recipe:</h2> ".$row2['name']." (" .$row['tribal_recipe']. ") <br> ";
+ $algorithm = $row2['algorithm'];
+ echo $algorithm;
+
+ echo "<h2>Recipes:</h2>";
+ // we parse only algorithm as main tribe recipe cannot have any requirements
+ recurseParseRecipe($row2['name'],1, array(), $showall);
+ //recurseParseRecipe("Peaceful Gobble Evolve Tribe",1, array(), $showall);
+
+ global $buildingList, $reservedSpots;
+
+ // list reserved spots
+ echo "<br><br><h2>Reserved Spots:</h2>";
+ foreach($reservedSpots as $spot)
+ {
+ echo $spot."<br>";
+ }
+
+ // list buildings
+ echo "<h2>Buildings:</h2>";
+ foreach( $buildingList as $building)
+ {
+ if (in_array($building, $reservedSpots))
+ echo $building."<br>";
+ else
+ echo $building." <span style='color:red;'> -> ERROR NOT FOUND IN RESERVE SPOTS!</span><br>";
+ }
+ echo "<br><br>";
+
+}
+
+function recurseParseRecipe($recipe, $level, $alreadyVisited, $showall)
+{
+ global $buildingList, $reservedSpots;
+
+ $prefix = str_repeat("...",$level);
+
+ // stop recursion if we already visited
+ if (in_array($recipe, $alreadyVisited))
+ {
+ if ($showall)
+ echo $prefix.$recipe." ALREADY VISITED, STOPPING. <br>";
+ return;
+ }
+ // store all the recipe we already visited in this chain, so we can detect a recursion and stop.
+ $localArrayVisited = $alreadyVisited;
+ array_push($localArrayVisited,$recipe);
+
+ echo $prefix."<b>".$recipe."</b><br>";
+ $query = "SELECT * FROM tribe_recipes WHERE name='$recipe'";
+ $result = mysql_query2($query);
+
+ while ($row = fetchSqlAssoc($result))
+ {
+ $algorithm = $row['algorithm'];
+
+ // check all loadRecipe
+ $recipes = array();
+ while (strlen($algorithm))
+ {
+ $pos = stripos($algorithm,"loadRecipe");
+ if ($pos == 0)
+ $algorithm="";
+ else
+ {
+ // extract all loadRecipe
+ $newrecipe = containedText($algorithm, $pos);
+ $end = stripos($algorithm,")",$pos);
+ //echo $newrecipe. "<br>";
+ // if recipe contains a comma, split it
+ $comma = stripos($newrecipe,",");
+ if ($comma)
+ {
+ $newrecipe = substr($newrecipe,0,$comma);
+ //echo "cleaned:". $newrecipe. "<br>";
+ }
+ array_push($recipes, $newrecipe);
+ $algorithm = substr($algorithm, $end);
+ }
+ }
+ foreach ($recipes as $subrecipe)
+ {
+ //echo "SUB: ".$subrecipe;
+ recurseParseRecipe($subrecipe, $level+1, $localArrayVisited, $showall);
+ echo "<hr>";
+ }
+
+ //echo "...Requirements: ".$row['requirements']."<br>";
+ $requirements = $row['requirements'];
+ $tokArray = explode(";", $requirements);
+ foreach ( $tokArray as $tokReq )
+ {
+ // analyze if this requirement has children: tribesman, resource, building
+ $pos1 = stripos($tokReq,"tribesman(");
+ $pos2 = stripos($tokReq,"resource(");
+ $pos3 = stripos($tokReq,"building(");
+ if ($pos1 !== false || $pos2 !== false || $pos3 !== false)
+ {
+ echo $prefix."Requirement=$tokReq<br />";
+ $validStr = containedText($tokReq, $pos);
+ $pieces = explode(",",$validStr);
+ if (count($pieces)>1)
+ {
+ // store building for later use
+ if ($pos3 !== false && !in_array($pieces[0],$buildingList))
+ array_push($buildingList,$pieces[0]);
+
+ //echo $prefix.$pieces[2]."<br>";
+ recurseParseRecipe($pieces[2], $level+1, $localArrayVisited, $showall);
+ }
+ } else
+ {
+ if ($showall)
+ echo $prefix."Requirement=$tokReq<br />";
+ }
+ }
+
+ //echo "...Algorithm: ".$row['algorithm']."<br><br>";
+ $tokArray = explode(";", $row['algorithm']);
+ foreach ( $tokArray as $tokAlg )
+ {
+ // analyze if this algorithm has children: locateResource
+ $pos4 = stripos($tokAlg,"locateResource(");
+ if ($pos4 !== false)
+ {
+ echo $prefix."Algorithm=$tokAlg<br />";
+ $validStr = containedText($tokAlg, $pos);
+ $pieces = explode(",",$validStr);
+ if (count($pieces)>1)
+ {
+ //echo $prefix.$pieces[2]."<br>";
+ recurseParseRecipe($pieces[1], $level+1, $localArrayVisited, $showall);
+ }
+ } else
+ {
+ if ($showall)
+ echo $prefix."Algorithm=$tokAlg<br />";
+ }
+ // analyze if this algorithm has children: reserveSpot
+ $pos4 = stripos($tokAlg,"reserveSpot(");
+ if ($pos4 !== false)
+ {
+ $spots = containedText($tokAlg, 0);
+ $tokArray = explode(",", $spots);
+ array_push($reservedSpots,$tokArray[3]);
+ }
+ }
+ }
+}
+
+function containedText ($text, $offset)
+{
+ $start = stripos($text,"(",$offset);
+ $end = stripos($text,")",$offset);
+ $newrecipe = substr($text,$start+1,$end-$start-1);
+ return $newrecipe;
+}
+
+
?>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|