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
  #2  
Old 09-19-2002, 09:49 AM
Trumpcard
Demi-God
 
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
Default

Thats a blob... Have to play with it a bit... Here's how we did it in php with EqTreasures.. Dont know if the item format changed enough to screw this up, you basically need to look through the item struct in the code to figure out what is where in the packed field.


# 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);
}
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 05:00 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