Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::General > Archive::General Discussion

Archive::General Discussion Archive area for General Discussion's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 09-19-2002, 10:49 AM
Trumpcard
Demi-God
 
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
Default

Well depends on what you are doing with it.. If you want it to look decent, you need to format the output a little..

I just clipped a sample, heres the whole file...

<?
include ('db.php');
require('layout.php');
require('globalfunction.php');

printf("<body bgcolor=\"$BackgroundColor\" text=\"#FFFFFF\" link=\"#A7C4FF\" vlink=\"#A7C4FF\" alink=\"#A7C4FF\" topmargin=5 leftmargin=10>\n");

# Seperated Item Data fields to make code more readable and easy to made changes/additions to.

$StrF = "ascii(mid(raw_data,173,1)) as 'STR'";
$StaF="ascii(mid(raw_data,174,1)) as 'STA'";
$ChaF="ascii(mid(raw_data,175,1)) as 'CHA'";
$DexF="ascii(mid(raw_data,176,1)) as 'DEX'";
$IntF="ascii(mid(raw_data,177,1)) as 'INT'";
$AgiF="ascii(mid(raw_data,178,1)) as 'AGI'";
$WisF="ascii(mid(raw_data,179,1)) as 'WIS'";
$MRF="ascii(mid(raw_data,180,1)) as 'MAGIC'";
$FRF="ascii(mid(raw_data,181,1)) as 'FIRE'";
$CRF="ascii(mid(raw_data,182,1)) as 'COLD'";
$DRF="ascii(mid(raw_data,183,1)) as 'DISEASE'";
$PRF="ascii(mid(raw_data,184,1)) as 'POISON'";
$HPF="ascii(mid(raw_data,185,1)) as 'HP'";
$MANAF="ascii(mid(raw_data,186,1)) as 'MANA'";
$ACF="ascii(mid(raw_data,187,1)) as 'AC'";
$DelayF="ascii(mid(raw_data,191,1)) as 'DELAY'";
$DamageF="ascii(mid(raw_data,192,1)) as 'DAMAGE'";
$RangeF="ascii(mid(raw_data,194,1)) as 'RANGE'";
$WeightF="ord(mid(raw_data,126,1)) as 'WEIGHT'";
$NoDropF="ascii(mid(raw_data,128,1)) as 'NODROP'";
$MagicF="ascii(mid(raw_data,196,1)) as 'MAGICF'";
$SkillF="ascii(mid(raw_data,195,1)) as 'SKILL'";
$EffectF="((ascii(mid(raw_data,221,1))*1)+(ascii(m id(raw_data,222,1))*256)) as 'EFFECT'";
$EffectTypeF="ascii(mid(raw_data,220,1)) as 'EFFECTTYPE'";


$sql='select id,'.$StrF.','.$StaF.','.$ChaF.','.$DexF.','.$IntF .','.$AgiF.','.$WisF.','.$MRF.','.$FRF.','.$CRF.', '.$DRF.','.$PRF.','.$HPF.','.$MANAF.','.$ACF.','.$ DelayF.','.$DamageF.','.$WeightF.','.$RangeF.','.$ NoDropF.', '.$MagicF.', '.$SkillF.', '.$EffectF.','.$EffectTypeF.' from items where id=\''.$id.'\'';
$req = mysql_query($sql) or die('SQL Error !<br>'.$sql.'<br>'.mysql_error());

while($data = mysql_fetch_array($req))
{
$sql2 = 'select substring(raw_data,1,35) as \'name\', substring(raw_data,36,96) as \'lorename\' from items where id=\''.$id.'\'';
#$sql3 = 'select substring(raw_data,36,96) as \'lorename\' from items where id=\''.$id.'\'';
$req2 = mysql_query($sql2) or die('SQL Error !<br>'.$sql2.'<br>'.mysql_error());
$test = mysql_num_rows($req2) ;

while($data2 = mysql_fetch_array($req2))
{
$pos = strpos($data2['name'],00);
$name = substr($data2['name'],0,$pos);
$pos = strpos($data2['lorename'],00);
$lorename = substr($data2['lorename'],0,$pos);
}

if(isset($name) == FALSE ){
$name = "N/A";
}

echo '<table width="400" height="168" border="0" cellspacing="0" cellpadding="0" style="background-image: url(images/itemlore2-400.jpg)" bgcolor="#A79879" align="center">';

echo '<tr>';
echo ' <td width="400" height="8" colspan="3"><img src="images/dot.gif"></td>';
echo '</tr>';
echo ' <tr><td width="10" height="132"><img src="images/dot.gif"></td><td width="400" valign="top" class="itemshot"><b>';
echo ''.$name.'<br>';

if ($data['MAGICF'] == "1" | !$data['NODROP'])
{
if ($data['MAGICF'] == "1")
{
echo 'MAGIC ITEM';
}

if (!$data['NODROP']) {
echo ' NO DROP';
}

if ($name != $lorename) {
echo ' LORE';
}

echo '<br>';
}

#echo 'Slot: PRIMARY SECONDARY<br>';
#echo 'Skill: '.$data['SKILL'].' ';

if ($data['SKILL'] != '10')
{
echo 'Skill: ';
switch ($data['SKILL'])
{
case '0':
echo '1h slash&nbsp&nbsp&nbsp&nbsp&nbsp ';
break;
case '1':
echo '2h slash&nbsp&nbsp&nbsp&nbsp&nbsp ';
break;
case '2':
echo 'Piercing&nbsp&nbsp&nbsp&nbsp& nbsp';
break;
case '3':
echo '1h bash&nbsp&nbsp&nbsp&nbsp&nbsp' ;
break;
case '4':
echo '2h blunt&nbsp&nbsp&nbsp&nbsp&nbsp ';
case '5':
echo 'Range&nbsp&nbsp&nbsp&nbsp&nbs p';
case '7':
echo 'Thrown&nbsp&nbsp&nbsp&nbsp&nb sp';
case '23':
echo 'Wind Instrument';
case '24':
echo 'String Instrument';
case '25':
echo 'Brass Instrument';
case '26':
echo 'Percussion Instrument';
case '23':
echo '';
case '23':
echo '';
break;
default:
echo 'Unknown&nbsp&nbsp&nbsp&nbsp&n bsp';
}
}



if ($data['DAMAGE']) echo 'DMG: '.$data['DAMAGE'].'&nbsp&nbsp&nbsp';
if ($data['DELAY']) echo 'DELAY: '.$data['DELAY'].'<BR>';
if ($data['AC']) echo 'AC: '.$data['AC'].'<br>';

if ($data['STR']) echo 'STR: +'.$data['STR'].' ';
if ($data['STA']) echo 'STA: +'.$data['STA'].' ';
if ($data['CHA']) echo 'CHA: +'.$data['CHA'].' ';
if ($data['DEX']) echo 'DEX: +'.$data['DEX'].' ';
if ($data['INT']) echo 'INT: +'.$data['INT'].' ';
if ($data['AGI']) echo 'AGI: +'.$data['AGI'].' ';
if ($data['WIS']) echo 'WIS: +'.$data['WIS'].' ';

if ($data['MAGIC']) echo 'SV MAGIC: +'.$data['MAGIC'].' ';
if ($data['FIRE']) echo 'SV FIRE: +'.$data['FIRE'].' ';
if ($data['COLD']) echo 'SV COLD: +'.$data['COLD'].' ';
if ($data['DISEASE']) echo 'SV DISEASE: +'.$data['DISEASE'].' ';
if ($data['POISON']) echo 'SV POISON: +'.$data['POISON'].' ';
if ($data['HP']) echo 'HP: +'.$data['HP'].' ';

$WT=$data['WEIGHT'] * .1;
echo '<br>WT: '.$WT.' ';
echo ' Class: Soon ';
echo ' Race: Soon<br>';

if ($data['EFFECT'] != '65535')
{
echo ' Effect: '.$data['EFFECT'].' ';
echo ' Type: ';
switch ($data['EFFECTTYPE'])
{
case '0':
echo "Proc";
break;
case '1':
echo "Clickable";
break;
case '2':
echo "Latent";
break;
case '3':
echo "Clickable(expendable)";
break;
case '4':
echo "Clickable(worn)";
break;
case '5':
echo "Clickable(Class Check)";
break;
default:
echo "Proc";
}
}

echo '</b></td><td width="10"><img src="images/dot.gif"></td></tr>';
echo '</table>';

}
echo '</tr>';
echo '</table>';

mysql_close();
?>
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 08:39 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3