avatar_4yew?

Как исправить ошибку warehouse_items в MU online и MMW

Автор 4yew?, 2011 Июль 24, 14:20

« назад - далее »

0 Пользователи и 1 гость просматривают эту тему.

Ключевые слова [SEO] mu onlinemmwошибкаwarehouse_itemsисправление ошибки

4yew?

atal error: Cannot redeclare warehouse_items() (previously declared in C:\xampp\htdocs\includes\Warehouse.php:2) in C:\xampp\htdocs\includes\Warehouse.php on line 147


На сайте стоит маркет, кузница, ну и инвинтарь.. В каком файле и что нужно изменить что бы не выбивало эту ошибку?

DJAKS

#1
постав нотепад и покажи что там за функции делаются на 147  линие

4yew?

Спойлер
         }
else ;
}
}
return $output;
}



function ItemInfo($_item) {

if (substr($_item,0,2)=='0x')
$_item   = substr($_item,2);

if ((strlen($_item)!=32) || (!ereg("(^[a-zA-Z0-9])",$_item)) || ($_item == 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'))
return false;
[свернуть]

ну это не 147 а 142 и до 150.

DJAKS

in C:\xampp\htdocs\includes\Warehouse.php on line 147
вот меня интересует имено эта строка

4yew?


Sweng


4yew?


Sweng

Версию бы мне, наверное проблема в том, что скрипт написан для версии более новых, посмотри у тебя в базе значение в таблице warehouse поле Items стоит varbinary 1200, что характерно для старых версий, а скрипт написан под 1920...Посмотри в базе и скажи...

4yew?

а скрипт написан под 1920.

стоит 1920, мне кто то когда то говорил что

Спойлер
такое пишет в Кузнице

Fatal error: Cannot redeclare warehouse_items() (previously declared in C:xampphtdocsincludesWarehouse.php:2) in C:xampphtdocsincludesWarehouse.php on line 147
[свернуть]

А тут пишет что мол функция warehouse_items() Уже была загружена.....

Sweng

Тогда стоит проверить верно ли ты установил данный мод на сайт... И если есть элементарные знания php проврить всё ли так...

cokpat

я не гуру прогер пхп но смею поправить.
Ошибка примерно перевдится таким макаром.
Невозможно переобъявить warehouse_items , так как уже было объявлено где то.

epmak

#11
ЦитироватьCannot redeclare warehouse_items()

:facepalm:
ответ прост: ищи где у тебя еще раз объвлена функция.
скорее всего 2 раза requie чтого-то там.
cokpat, ты единственный крут <3


Спойлер
г-да программисты....
[свернуть]

4yew?

Спойлер
<?php
function warehouse_items($account,$db_table,$mine=1) {
$il   = 32;
$itemformat = '[Name]<br><br><font color=b3b1b1>Durability</font><br>[Excellent]<br><font color=7e7f80>Serial: [sn]</font><br>';
$output = '';
mssql_query("
declare @items varbinary(1920);
set @items = (select [items] from [$db_table] where [AccountId]='".$account."');
print @items;
");
$current_items    = mssql_get_last_message();
$user_items   = substr($current_items,2);
$check   = '011111111';
$xx   = 0;
$yy   = 1;
$line   = 1;
$onn   = 0;
$i   = -1;
while($i<119) {
$i++;
if ($xx==8) {
$xx=1;
$yy++;
}
else
$xx++;

$TT   = substr($check,$xx,1);
if ((round($i/8)==$i/8)&&($i!=0))  {
$line++;
}

$l   = $i;
$item    = ItemInfo(substr($user_items,($il*$i), $il));

if (!$item['Y'])
$InsPosY=1;
else
$InsPosY=$item['Y'];

if (!$item['X'])
$InsPosX=1;
else {
$InsPosX   = $item['X'];
$xxx      = $xx;
$InsPosXX   = $InsPosX;
$InsPosYY   = $InsPosY;
while ($InsPosXX > 0) {
$check    = substr_replace($check,$InsPosYY,$xxx,1);
$InsPosXX= $InsPosXX-1;
$InsPosYY= $InsPosY+1;
$xxx++;
}
}

$item['name']    = addslashes($item['name']);
if ($TT>1)
$check   = substr_replace($check,$TT-1,$xx,1);

else {
unset($plusche,$rqs,$luck,$skill,$option,$exl);
if ($item['name']) {
if ($item['level']){
}
if($item['level']){
$item['level']=" +".$item['level'];
}
else
{
$item['level']=NULL;
}
if(!$item['level']){
if($item['opt']){
$item['level']=" +0";
}
}
$overlib   = @str_replace('[Name]','<span style=color:'.$item['color'].'>'.$item['name'].' '.$plusche.'</span>', addslashes($itemformat));
$item['name']=$item['name'].' '.$plusche;
$rqs='';
if ($item['str'])
$rqs.=$item['str'].' Strength required<br>';

if ($item['nrg'])
$rqs.=$item['nrg'].' Energy required<br>';

if ($item['cmd'])
$rqs.=$item['cmd'].' Command required<br>';

if ($item['agi'])
$rqs.=$item['agi'].' Agility required<br>';
if ((!@$item['luck']) && (!@$item['exl']) && (!@$item['skill']) && (!@$item['option']))
$addx='<br>';

$overlib   = str_replace('Durability', 'Durability: '.$item['dur'].'<br>', $overlib);
$overlib   = str_replace('Requirements', '<br><br>'.$rqs, $overlib);

if (@$item['opt']){
}
if (@$item['luck'])
$luck=$item['luck'];
if (@$item['sn'])
$overlib   = @str_replace('[sn]', $item['sn'], $overlib);
if (@$item['skill'])
$skill=$item['skill'];
$overlib   = @str_replace('[Skill]', $skill, $overlib);

if (@$item['exl'])
$exl='<font color=#486ecf>'.str_replace('^^','', $item['exl']).'</font>';

$overlib   = @str_replace('[Excellent]', $exl,$overlib);
if ($webshop['image']['whshow']) {
$value="";
} else {
$x   = 0;
$cl   = 0;
$iname   = explode(" ", $item['name']);
$value   = '';
while($x<count($iname)){
$cl   += strlen($iname[$x]);
if ($cl>=((2*$InsPosX)/$InsPosY*1.2)) {
if ($x!=0)
$value .=  "n";
$cl   = 0;
}
if (($cl!=0) && ($x!=0)) $value .=  " ";
$value    .=  $iname[$x];
$x++;
}
}





$item['name'] = stripslashes($item['name']);
$test_++;
$output    .=  "";

if($test_ == '3'){$output  .= "</tr><tr>";$test_= 0;
}

}
else ;
}
}
return $output;
}



function ItemInfo($_item) {

if (substr($_item,0,2)=='0x')
$_item   = substr($_item,2);

if ((strlen($_item)!=32) || (!ereg("(^[a-zA-Z0-9])",$_item)) || ($_item == 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'))
return false;
// Get the hex contents
$sy    = hexdec(substr($_item,0,2));    // Item ID
$iop    = hexdec(substr($_item,2,2));    // Item Level/Skill/Option Data
$iop_    = $iop;
$itemdur= hexdec(substr($_item,4,2));    // Item Durability
$serial   = substr($_item,6,8);      // Item SKey
$ioo    = hexdec(substr($_item,14,2));    // Item Excellent Info/ Option
$exc_ = $ioo;
$ac   = hexdec(substr($_item,16,2));    // Ancient data
$itt    = hexdec(substr($_item,18,2));    // Item Type
$itemtype = $itt/16;
// The ancient types with no set options
if ($ac==4)
$ac=5;
if ($ac==9)
$ac=10;
// Debug
switch ($itemtype) {
case 12:
$itemtype=14;
break;
case 13:
$itemtype=12;
break;
case 14:
$itemtype=13;
break;
}
// Skill Check
if ($iop<128)
$skill   = '';
else {
$skill   = "<font color=#486ecf>+Skill</font>";
$iop   = $iop-128;
}
// Item Level Check
$itemlevel   = floor($iop/8);
$iop      = $iop-$itemlevel*8;
// luck Check
if($iop<4)
$luck   = '';
else {
$luck   = "<font color=#486ecf><br>Luck(success rate jewel of soul +25%)<br>Luck(critical damage rate +5%)</font>";
$iop   = $iop-4;
}
// Excellent option check
if($ioo>=64)   { $iop+=4; $ioo+=-64; }
if($ioo<32)   { $iopx6=0; } else { $iopx6=1; $ioo+=-32; }
if($ioo<16)   { $iopx5=0; } else { $iopx5=1; $ioo+=-16; }
if($ioo<8)   { $iopx4=0; } else { $iopx4=1; $ioo+=-8; }
if($ioo<4)   { $iopx3=0; } else { $iopx3=1; $ioo+=-4; }
if($ioo<2)   { $iopx2=0; } else { $iopx2=1; $ioo+=-2; }
if($ioo<1)   { $iopx1=0; } else { $iopx1=1; $ioo+=-1; }

$fquery      = mssql_query("select * from [Webshop] where [id]=".$sy." and [type]=".$itemtype." and [stickLevel]=".$itemlevel);
if (mssql_num_rows($fquery)<1)
{
$fquery   = mssql_query("select * from [Webshop] where [id]=".$sy." and [type]=".$itemtype);
$nolevel= 0;
}
else
$nolevel=1;

$fresult   = mssql_fetch_array($fquery);
$iopxltype   = $fresult['ex_type'];
$itemname   = $fresult['name'];
// Case that item is not found -> stop the proccess
if (!$fresult)
return false;

$itemexl = "";
switch ($iopxltype) {
case 0 :
$op1   = 'Increase Mana per kill +8<br>';
$op2   = 'Increase hit points per kill +8<br>';
$op3   = 'Increase attacking(wizardly)speed+7<br>';
$op4   = 'Increase wizardly damage +2%<br>';
$op5   = 'Increase Damage +level/20<br>';
$op6   = 'Excellent Damage Rate +10%<br>';
$inf   = 'Additional Damage<br>';
break;
case 1:
$op1   = 'Increase Zen After Hunt +40%<br>';
$op2   = 'Defense success rate +10%<br>';
$op3   = 'Reflect damage +5%<br>';
$op4   = 'Damage Decrease +4%<br>';
$op5   = 'Increase MaxMana +4%<br>';
$op6   = 'Increase MaxHP +4%<br>';
$inf   = 'Additional Defense<br>';
$skill   = '';
break;
case 2:
$op1   = ' Increase HP<br>';
$op2   = ' Increase MP<br>';
$op3   = ' +Defense Ignore<br>';
$op4   = ' +Stamina Increase<br>';
$op5   = ' +Speed Increase<br>';
$op6   = '';
$inf   = 'Additional Damage<br>';
$skill   = '';
$nocolor= true;
case 4: // v0.9
$op1   = ' +115 HP<br>';
$op2   = ' +115 MP<br>';
$op3   = ' Ignore Enemy defense 3%<br>';
$op4   = ' +50 Max stamina<br>';
$op5   = ' Wizardly speed +7<br>';
$op6   = '';
$inf   = 'Additional Damage<br>';
$skill   = '';
$nocolor= true;
}
if ($iopx1==1)       $itemexl.='^^'.$op1;
if ($iopx2==1)       $itemexl.='^^'.$op2;
if ($iopx3==1)       $itemexl.='^^'.$op3;
if ($iopx4==1)       $itemexl.='^^'.$op4;
if ($iopx5==1)       $itemexl.='^^'.$op5;
if ($iopx6==1)       $itemexl.='^^'.$op6;

if ($fresult['optionType']==1) {
$itemoption= ($iop).'%';
$inf   = ' Automatic HP Recovery rate ';
} elseif ($fresult['optionType']==2) {
$itemoption= $iop*5;
$inf   = ' Additional Defense rate ';
}
else
$itemoption   = $iop*4;

$c      = '#000000'; // White -> Normal Item
if (($iop>1) || ($luck!='')) $c = '#8CB0EA';
if ($itemlevel>6) $c = '#F4CB3F';
$tipche      = 0;
if ($itemexl!='') {        // Green -> Excellent Item
$c   = '#2FF387';
$tipche   = 1;
}
if ($itemoption==0)
$itemoption   = '';
else
$itemoption    = "+".$itemoption;

if ($itemexl!='')
$incrall=20;

if ($fresult['cmd'])
$fresult['cmd']+=$incrall;

if ($fresult['str'])
$fresult['str']+=($itemlevel*7)+($itemoption*5)+$incrall;

if ($fresult['agi'])
$fresult['agi']+=($itemlevel*4)+$incrall;

// In case the item is ancient
if ($ac>0) {
$itemexl='';
$c= '#2347F3';
if ($itemoption)
$itemoption.='<font color =#2347F3><b>+'.$ac.' stamina</b></font>';
$tipche=2;
}
if (@$nocolor)    $c='#F4CB3F';

// Fenrir;
if (($fresult['type']==12) && ($fresult['id']==37))
{
$skill   = "<br>Plasma storm skill (Mana:50)";
$c   = "#8CB0EA";
if ($iopx1==1) {
$itemname.=" +Destroy ";
$itemoption="+Increase damage 10%";
}
elseif ($iopx2==1) {
$itemname.=" +Protect ";
$itemoption="+Absorb damage 10%";
}
elseif ($iopx3==1) {
$itemname="<font color=#F4CB3F>Golden Fenrir</font> ";
$itemoption="+Increase speed";
}
}
else
if ((@!$nocolor) &&($itemexl!='') && ($itemname)) $itemname = '<font color=green>Excellent <font color=green>'.$itemname.'</font>';

if ($nolevel==1)
$ilvl=0;
else
$ilvl=$itemlevel;
//For quest system
$output['iop'] = $iop_;
$output['exc_'] = $exc_;
// Item name
$output['name'] = $itemname;
// Item level
$output['level']= $ilvl;
// Item option level
$output['opt']   = $itemoption;
// Item excellent options
$output['exl']   = $itemexl;
// Item luck (two lines)
$output['luck']   = $luck;
// Item Skill
$output['skill']= $skill;
// Item Durability
$output['dur']   = $itemdur;
// Horizontal Slots The item takes
$output['X']   = $fresult['X'];
// Vertical Slots The item takes
$output['Y']   = $fresult['Y'];
// Requirements
$output['id'] = $fresult['id'];
$output['type'] = $fresult['type'];
$output['str']   = $fresult['str'];
$output['agi']   = $fresult['agi'];
$output['nrg']   = $fresult['nrg'];
$output['cmd']   = $fresult['cmd'];
$output['refund']= $fresult['cansellitem'];
// Item thumbnail link
$output['thumb']= ws_image($fresult['id'], $fresult['type'], $tipche, $itemlevel);
// Item title color
$output['color']= $c;
// Item s/n
$output['sn']   = $serial;

// Output the result array()
return $output;
}

function ws_image($theid,$type,$ExclAnci,$lvl=0) {
switch ($type) {
case 14:
$type=12;
break;
case 12:
$type=13;
break;
case 13:
$type=14;
break;
}
switch ($ExclAnci) {
case 1:   // Excellent item
$tnpl   = '10';
break;
case 2:   // Ancient item
$tnpl   = '01';
break;
default:// Normal Item
$tnpl   = '00';

}
$itype   = $type*16;
if ($theid>31) {
$nxt   ="F9";
$theid   +=-32;
}
else
$nxt   = "00";
if ($itype<128)  {
$tipaj = "00";
$theid += $itype;
} else {
$tipaj = "80";
$itype += -128;
$theid += $itype;
}
$itype   += $theid;
$itype   = sprintf("%02X",$itype,00);
$iid    = sprintf("%02X",$theid,00);

if (file_exists('Images/items/'.$tnpl.$itype.$tipaj.$nxt.'.gif'))
$output = 'Images/items/'.$tnpl.$itype.$tipaj.$nxt.'.gif';
else
$output = 'Images/items/00'.$itype.$tipaj.$nxt.'.gif';

$i   = $lvl+1;
while ($i>0) {
$i+=-1;
$il=sprintf("%02X", $i, 00);
if (file_exists('Images/items/'.$tnpl.$itype.$tipaj.$nxt.$il.'.gif')){
$output='Images/items/'.$tnpl.$itype.$tipaj.$nxt.$il.'.gif';
$i=0;
}

}
return $output;
}

function smartsearch($whbin,$itemX,$itemY) {

if (substr($whbin,0,2)=='0x') $whbin=substr($whbin,2);
$items    = str_repeat('0', 120);
$itemsm = str_repeat('1', 120);
$i   = 0;
while ($i<120) {
$_item   = substr($whbin,(32*$i), 32);
$type   = (hexdec(substr($_item,18,2))/16);
$type   = round($type);
switch ($type) {
case 12:
$type=14;
break;
case 13:
$type=12;
break;
case 14:
$type=13;
break;
}
$res   = mssql_fetch_row(mssql_query("select [X],[Y] from [Webshop] where [id]='".hexdec(substr($_item,0,2))."' and [type]='".$type."'"));
$y   = 0;
while($y<$res[1]) {
$y++;$x=0;
while($x<$res[0]) {
$items   = substr_replace($items, '1', ($i+$x)+(($y-1)*8), 1);
$x++;
}
}
$i++;
}
$y   = 0;
while($y<$itemY) {
$y++;$x=0;
while($x<$itemX) {
$x++;
$spacerq[$x+(8*($y-1))] = true;
}
}
$walked   = 0;
$i   = 0;
while($i<120) {
if (isset($spacerq[$i])) {
$itemsm   = substr_replace($itemsm, '0', $i-1, 1);
$last   = $i;
$walked++;
}
if ($walked==count($spacerq)) $i=119;
$i++;
}
$useforlength   = substr($itemsm,0,$last);
$findslotlikethis='^'.str_replace('++','+',str_replace('1','+[0-1]+', $useforlength));
$i=0;$nx=0;$ny=0;
while ($i<120) {
if ($nx==8) { $ny++; $nx=0; }
if ((eregi($findslotlikethis,substr($items, $i, strlen($useforlength)))) && ($itemX+$nx<9) && ($itemY+$ny<16))
return $i;
$i++;
$nx++;
}
return 1337;
}


function warehouse_items1($_account,$_mine=1) {
$_il   = 32;
$_itemformat ='<div align=center style='padding-left: 6px; padding-right:6px;font-family:arial;font-size: 10px;'><span style='font-weight:bold;font-size: 11px;'>[Name]</span>  Requirements  Durability [Skill] [Luck] [Excellent] [note]</span></div>';
$_output = '';
mssql_query("
declare @items varbinary(1920);
set @items = (select [items] from [warehouse] where [AccountId]='".$_account."');
print @items;
");
$_current_items    = mssql_get_last_message();
$_user_items   = substr($_current_items,2);
$_output .=  '<table cellpadding=0 cellspacing=0 style="height: 528px; border: 1px solid #FFFFFF;">';
$_check   = '011111111';
$_xx   = 0;
$_yy   = 1;
$_line   = 1;
$_onn   = 0;
$_i   = -1;
while($_i<119) {
$_i++;
if ($_xx==8) {
$_xx=1;
$_yy++;
}
else
$_xx++;

$_TT   = substr($_check,$_xx,1);
if ((round($_i/8)==$_i/8)&&($_i!=0))  {
$_output .=  "<tr>";
$_line++;
}

$_l   = $_i;
$_item    = ItemInfo1(substr($_user_items,($_il*$_i), $_il));

$_cursor      = 'pointer';
$__rnote      = "</font><br><div style='color: #FFFFC3'>".This_item_can_be_soldout_double_click_it_to_sell_it."</div>";
$_ondblclick   = 'onDblClick=document.location.href="?op=user&u=sell&sellitem=1&serial='.$_item['sn'].'"';

if (!$_item['Y'])
$_InsPosY=1;
else
$_InsPosY=$_item['Y'];

if (!$_item['X'])
$_InsPosX=1;
else {
$_InsPosX   = $_item['X'];
$_xxx      = $_xx;
$_InsPosXX   = $_InsPosX;
$_InsPosYY   = $_InsPosY;
while ($_InsPosXX > 0) {
$_check    = substr_replace($_check,$_InsPosYY,$_xxx,1);
$_InsPosXX= $_InsPosXX-1;
$_InsPosYY= $_InsPosY+1;
$_xxx++;
}
}

$_item['name']    = addslashes($_item['name']);
if ($_TT>1)
$_check   = substr_replace($_check,$_TT-1,$_xx,1);

else {
$_output .=  "<td align="center" class="itemblock" style="width: ".($_InsPosX*32)."px; height: ".($_InsPosY*32)."px; padding:0px;vertical-align: middle;" colspan="".$_InsPosX."" rowspan="".$_InsPosY.""";
unset($_plusche,$_rqs,$_luck,$_skill,$_option,$_exl);
if ($_item['name']) {
if ($_item['level'])
$_plusche = '+'.$_item['level'];

$_overlib   = @str_replace('[Name]','<span style=color:'.$_item['color'].'>'.$_item['name'].' '.$_plusche.'</span>', addslashes($_itemformat));
if ((!@$_item['luck']) && (!@$_item['exl']) && (!@$_item['skill']) && (!@$_item['option']))
$_addx='<br>';

$_overlib   = str_replace('Durability', $_item['dur'].' durability'.$_addx, $_overlib);
$_overlib   = str_replace('Requirements', '<br><br>'.$_rqs, $_overlib);

if (@$_item['opt'])
$_option='<br><font color=#9aadd5>'.$_item['opt'].'</font>';

if (@$_item['luck'])
$_luck='<br><font color=#9aadd5>'.$_item['luck'].'';
$_overlib   = @str_replace('[Luck]', $_luck.$_option.'</font>', $_overlib);

if (@$_item['skill'])
$_skill='<br><font color=#9aadd5>'.$_item['skill'].'</font>';
$_overlib   = @str_replace('[Skill]', $_skill, $_overlib);

if (@$_item['exl'])
$_exl='<font color=#8CB0EA>'.str_replace('^^','<br>', $_item['exl']);

$_overlib   = @str_replace('[Excellent]', $_exl,$_overlib);
$_overlib   = @str_replace('[note]', $__rnote,$_overlib);
$_output    .= "onClick="document.getElementById('ixa').value='".$_l."'" onmouseover="return overlib('".$_overlib."');" onmouseout="return nd();">";
if ('true') {
$_tipme='background-image: url('.$_item['thumb'].');background-position: center center; background-repeat: no-repeat;';
$_value="";
} else {
$_x   = 0;
$_cl   = 0;
$_iname   = explode(" ", $_item['name']);
$_value   = '';
while($_x<count($_iname)){
$_cl   += strlen($_iname[$_x]);
if ($_cl>=((2*$_InsPosX)/$_InsPosY*1.2)) {
if ($_x!=0)
$_value .=  "n";
$_cl   = 0;
}
if (($_cl!=0) && ($_x!=0)) $_value .=  " ";
$_value    .=  $_iname[$_x];
$_x++;
}
}
$_output    .=  "<input ".$_ondblclick." type="button" style="overflow: hidden; text-align: center; padding: 0px; border:0px; height: ".(32*$_InsPosY-$_InsPosY-1)."px; margin: 0; width:  ".(32*$_InsPosX)."px; font-size:9px; ".$_tipme."font-family: tahoma; font-variant: normal;color: ".$_item['color']."; font-weight:bold; border: 0px solid #000000;cursor: ".$_cursor."; vertical-align: middle;" value="".$_value."" readonly></td>";
}
else $_output .= ">&nbsp;</td>";
}
}
$_output .=  "</tr></table>";
return $_output;
}





function ItemInfo1($__item) {

if (substr($__item,0,2)=='0x')
$__item   = substr($__item,2);

if ((strlen($__item)!=32) || (!ereg("(^[a-zA-Z0-9])",$__item)) || ($__item == 'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'))
return false;
// Get the hex contents
$_sy    = hexdec(substr($__item,0,2));    // Item ID
$_iop    = hexdec(substr($__item,2,2));    // Item Level/Skill/Option Data
$_iop_    = $_iop;
$_itemdur= hexdec(substr($__item,4,2));    // Item Durability
$_serial   = substr($__item,6,8);      // Item SKey
$_ioo    = hexdec(substr($__item,14,2));    // Item Excellent Info/ Option
$_exc_ = $_ioo;
$_ac   = hexdec(substr($__item,16,2));    // Ancient data
$_itt    = hexdec(substr($__item,18,2));    // Item Type
$_itemtype = $_itt/16;
// The ancient types with no set options
if ($_ac==4)
$_ac=5;
if ($_ac==9)
$_ac=10;
// Debug
switch ($_itemtype) {
case 12:
$_itemtype=14;
break;
case 13:
$_itemtype=12;
break;
case 14:
$_itemtype=13;
break;
}
// Skill Check
if ($_iop<128)
$_skill   = '';
else {
$_skill   = "<font color=#486ecf>+Skill</font>";
$_iop   = $_iop-128;
}
// Item Level Check
$_itemlevel   = floor($_iop/8);
$_iop      = $_iop-$_itemlevel*8;
// luck Check
if($_iop<4)
$_luck   = '';
else {
$_luck   = "<font color=#486ecf>+Luck</font>";
$_iop   = $_iop-4;
}
// Excellent option check
if($_ioo>=64)   { $_iop+=4; $_ioo+=-64; }
if($_ioo<32)   { $_iopx6=0; } else { $_iopx6=1; $_ioo+=-32; }
if($_ioo<16)   { $_iopx5=0; } else { $_iopx5=1; $_ioo+=-16; }
if($_ioo<8)   { $_iopx4=0; } else { $_iopx4=1; $_ioo+=-8; }
if($_ioo<4)   { $_iopx3=0; } else { $_iopx3=1; $_ioo+=-4; }
if($_ioo<2)   { $_iopx2=0; } else { $_iopx2=1; $_ioo+=-2; }
if($_ioo<1)   { $_iopx1=0; } else { $_iopx1=1; $_ioo+=-1; }

$_fquery      = mssql_query("select * from [Webshop] where [id]=".$_sy." and [type]=".$_itemtype." and [stickLevel]=".$_itemlevel);
if (mssql_num_rows($_fquery)<1)
{
$_fquery   = mssql_query("select * from [Webshop] where [id]=".$_sy." and [type]=".$_itemtype);
$_nolevel= 0;
}
else
$_nolevel=1;

$_fresult   = mssql_fetch_array($_fquery);
$_iopxltype   = $_fresult['ex_type'];
$_itemname   = $_fresult['name'];
// Case that item is not found -> stop the proccess
if (!$_fresult)
return false;

$_itemexl = "";
switch ($_iopxltype) {
case 0 :
$_op1   = 'Increase Mana per kill +8';
$_op2   = 'Increase hit points per kill +8';
$_op3   = 'Increase attacking(wizardly)speed+7';
$_op4   = 'Increase wizardly damage +2%';
$_op5   = 'Increase Damage +level/20';
$_op6   = 'Excellent Damage Rate +10%';
$_inf   = 'Additional Damage';
break;
case 1:
$_op1   = 'Increase Zen After Hunt +40%';
$_op2   = 'Defense success rate +10%';
$_op3   = 'Reflect damage +5%';
$_op4   = 'Damage Decrease +4%';
$_op5   = 'Increase MaxMana +4%';
$_op6   = 'Increase MaxHP +4%';
$_inf   = 'Additional Defense';
$_skill   = '';
break;
case 2:
$_op1   = ' Increase HP';
$_op2   = ' Increase MP';
$_op3   = ' +Defense Ignore';
$_op4   = ' +Stamina Increase';
$_op5   = ' +Speed Increase';
$_op6   = '';
$_inf   = 'Additional Damage';
$_skill   = '';
$_nocolor= true;
case 4: // v0.9
$_op1   = ' +115 HP';
$_op2   = ' +115 MP';
$_op3   = ' Ignore Enemy defense 3%';
$_op4   = ' +50 Max stamina';
$_op5   = ' Wizardly speed +7';
$_op6   = '';
$_inf   = 'Additional Damage';
$_skill   = '';
$_nocolor= true;
}
if ($_iopx1==1)       $_itemexl.='^^'.$_op1;
if ($_iopx2==1)       $_itemexl.='^^'.$_op2;
if ($_iopx3==1)       $_itemexl.='^^'.$_op3;
if ($_iopx4==1)       $_itemexl.='^^'.$_op4;
if ($_iopx5==1)       $_itemexl.='^^'.$_op5;
if ($_iopx6==1)       $_itemexl.='^^'.$_op6;

if ($_fresult['optionType']==1) {
$_itemoption= ($_iop).'%';
$_inf   = ' Automatic HP Recovery rate ';
} elseif ($_fresult['optionType']==2) {
$_itemoption= $_iop*5;
$_inf   = ' Additional Defense rate ';
}
else
$_itemoption   = $_iop*4;

$_c      = '#FFFFFF'; // White -> Normal Item
if (($_iop>1) || ($_luck!='')) $_c = '#8CB0EA';
if ($_itemlevel>6) $_c = '#F4CB3F';
$_tipche      = 0;
if ($_itemexl!='') {        // Green -> Excellent Item
$_c   = '#2FF387';
$_tipche   = 1;
}
if ($_itemoption==0)
$_itemoption   = '';
else
$_itemoption    = "+".$_itemoption;

if ($_itemexl!='')
$_incrall=20;

if ($_fresult['cmd'])
$_fresult['cmd']+=$_incrall;

if ($_fresult['str'])
$_fresult['str']+=($_itemlevel*7)+($_itemoption*5)+$_incrall;

if ($_fresult['agi'])
$_fresult['agi']+=($_itemlevel*4)+$_incrall;

// In case the item is ancient
if ($_ac>0) {
$_itemexl='';
$_c= '#2347F3';
if ($_itemoption)
$_itemoption.='<font color =#2347F3><b>+'.$_ac.' stamina</b></font>';
$_tipche=2;
}
if (@$_nocolor)    $_c='#F4CB3F';

// Fenrir;
if (($_fresult['type']==12) && ($_fresult['id']==37))
{
$_skill   = "<br>Plasma storm skill (Mana:50)";
$_c   = "#8CB0EA";
if ($_iopx1==1) {
$_itemname.=" +Destroy ";
$_itemoption="+Increase damage 10%";
}
elseif ($_iopx2==1) {
$_itemname.=" +Protect ";
$_itemoption="+Absorb damage 10%";
}
elseif ($_iopx3==1) {
$_itemname="<font color=#F4CB3F>Golden Fenrir</font> ";
$_itemoption="+Increase speed";
}
}
else
if ((@!$_nocolor) &&($_itemexl!='') && ($_itemname)) $_itemname = '<font color=green>Exc. <font color=green>'.$_itemname.'</font>';

if ($_nolevel==1)
$_ilvl=0;
else
$_ilvl=$_itemlevel;
//For quest system
$_output['iop'] = $_iop_;
$_output['exc_'] = $_exc_;
// Item name
$_output['name'] = $_itemname;
// Item level
$_output['level']= $_ilvl;
// Item option level
$_output['opt']   = $_itemoption;
// Item excellent options
$_output['exl']   = $_itemexl;
// Item luck (two lines)
$_output['luck']   = $_luck;
// Item Skill
$_output['skill']= $_skill;
// Item Durability
$_output['dur']   = $_itemdur;
// Horizontal Slots The item takes
$_output['X']   = $_fresult['X'];
// Vertical Slots The item takes
$_output['Y']   = $_fresult['Y'];
// Requirements
$_output['id'] = $_fresult['id'];
$_output['type'] = $_fresult['type'];
$_output['str']   = $_fresult['str'];
$_output['agi']   = $_fresult['agi'];
$_output['nrg']   = $_fresult['nrg'];
$_output['cmd']   = $_fresult['cmd'];
$_output['refund']= $_fresult['cansellitem'];
// Item thumbnail link
$_output['thumb']= ws_image1($_fresult['id'], $_fresult['type'], $_tipche, $_itemlevel);
// Item title color
$_output['color']= $_c;
// Item s/n
$_output['sn']   = $_serial;

// Output the result array()
return $_output;
}


function ws_image1($_theid,$_type,$_ExclAnci,$_lvl=0) {
switch ($_type) {
case 14:
$_type=12;
break;
case 12:
$_type=13;
break;
case 13:
$_type=14;
break;
}
switch ($_ExclAnci) {
case 1:   // Excellent item
$_tnpl   = '10';
break;
case 2:   // Ancient item
$_tnpl   = '01';
break;
default:// Normal Item
$_tnpl   = '00';

}
$_itype   = $_type*16;
if ($_theid>31) {
$_nxt   ="F9";
$_theid   +=-32;
}
else
$_nxt   = "00";
if ($_itype<128)  {
$_tipaj = "00";
$_theid += $_itype;
} else {
$_tipaj = "80";
$_itype += -128;
$_theid += $_itype;
}
$_itype   += $_theid;
$_itype   = sprintf("%02X",$_itype,00);
$_iid    = sprintf("%02X",$_theid,00);

if (file_exists('Images/items/'.$_tnpl.$_itype.$_tipaj.$_nxt.'.gif'))
$_output = 'Images/items/'.$_tnpl.$_itype.$_tipaj.$_nxt.'.gif';
else
$_output = 'Images/items/00'.$_itype.$_tipaj.$_nxt.'.gif';

$_i   = $_lvl+1;
while ($_i>0) {
$_i+=-1;
$_il=sprintf("%02X", $_i, 00);
if (file_exists('Images/items/'.$_tnpl.$_itype.$_tipaj.$_nxt.$_il.'.gif')){
$_output='Images/items/'.$_tnpl.$_itype.$_tipaj.$_nxt.$_il.'.gif';
$_i=0;
}

}
return $_output;
}
?>
[свернуть]

вот файлик werehouse..
я не могу найти этого Леха..

epmak

ты не понял, у поищи по подключаемым файлам, те что в index.php или в страничке кузницы, макрета и т.п.
у тебя 2 раза где-то подключена Warehouse.php(я подозреваю), обычно в индексе подключают. но у тебя еще где-то в файлах она подключена. причем эти файлы "видит" индекс, отсюда он пишет, "ч0 мне выбрать, ты мне 2 раза определил функцию!!!рас-рас"

Похожие темы (5)