Advertisement
Heretiiik

Untitled

Nov 19th, 2015
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 3.52 KB | None | 0 0
  1. SELECT id, name, level, exp, playtime, empire, guild_name, rang
  2.               FROM (
  3.                 SELECT id, name, level, exp, playtime, empire, guild_name, @num := @num +1 AS rang
  4.                   FROM (
  5.                     SELECT player.id, player.name, player.level, player.exp, player.playtime, player_index.empire, guild.name AS guild_name, @num :=0
  6.                       FROM player.player
  7.                     LEFT JOIN player.player_index
  8.                       ON player_index.id = player.account_id
  9.                     LEFT JOIN player.guild_member
  10.                       ON guild_member.pid = player.id
  11.                     LEFT JOIN player.guild
  12.                       ON guild.id = guild_member.guild_id
  13.                     INNER JOIN account.account
  14.                       ON account.id=player.account_id
  15.                     WHERE player.name NOT LIKE '[%]%' AND account.status!='BLOCK' ".$filter."
  16.                     ORDER BY player.level DESC, player.playtime DESC, player.exp DESC, player.name DESC
  17.          
  18.                  ) AS t1
  19.        
  20.             ) AS t2
  21.      
  22.       WHERE name = ...;
  23. -------------------------------------------------------------------------
  24.  
  25. SELECT
  26.           itemshop.id AS uid,
  27.           itemshop.price AS price,
  28.           itemshop.visible AS visible,
  29.           itemshop.cat as category,
  30.           itemshop.qty AS qty,
  31.           itemshop.descr AS description,
  32.           itemdesc.`name` AS tname,
  33.           itemdesc.descr AS tdesc,
  34.           item_list.icon AS icon,
  35.           CONVERT (
  36.               item_proto.locale_name USING cp1250
  37.           ) AS lname,
  38.           item_proto.*
  39.         FROM
  40.           account.itemshop
  41.         LEFT JOIN player.itemdesc ON itemshop.vnum = itemdesc.vnum
  42.         LEFT JOIN player.item_list ON itemshop.vnum = item_list.vnum
  43.         LEFT JOIN player.item_proto ON itemshop.vnum = item_proto.vnum
  44.     ORDER BY IF(item_proto.limittype0=1, item_proto.limitvalue0, item_proto.limitvalue1) DESC;
  45.  
  46. pak za tím je ještě tahle kráska, která to znovu filtruje:
  47.             if ($args) {
  48.                 $fh = new FlagHelper($data->antiflag,EFlagSets::ItemAntiFlagSet);
  49.                 if ($args[0] == 0 && $data->wearflag == 1 && $data->type == 2) continue;
  50.                 if ($args[1] == 0 && $data->type == 28) continue;
  51.                 if ($args[2] == 0 && in_array($data->vnum,$mounts_id)) continue;
  52.                 if ($args[3] == 0 && in_array($data->vnum,$pet_id)) continue;
  53.                 if ($args[4] == 0 && $data->type == 10) continue;
  54.                 if ($args[5] == 0 && (in_array($data->type, $special_types) && !in_array($data->vnum,$mounts_id) && !in_array($data->vnum,$pet_id))) continue;
  55.                 if ($args[6] == 0 && $data->wearflag == 1 && $data->type == 2 && @!$fh->IsFlagged(EItemAntiFlag::ITEM_ANTIFLAG_WARRIOR)) continue;
  56.                 if ($args[7] == 0 && $data->wearflag == 1 && $data->type == 2 && @!$fh->IsFlagged(EItemAntiFlag::ITEM_ANTIFLAG_ASSASSIN)) continue;
  57.                 if ($args[8] == 0 && $data->wearflag == 1 && $data->type == 2 && @!$fh->IsFlagged(EItemAntiFlag::ITEM_ANTIFLAG_SHAMAN)) continue;
  58.                 if ($args[9] == 0 && $data->wearflag == 1 && $data->type == 2 && @!$fh->IsFlagged(EItemAntiFlag::ITEM_ANTIFLAG_SURA)) continue;
  59.                 if ( ($data->limittype0 == 1 && $data->limitvalue0 < $args[11]) || ($data->limittype1 == 1 && $data->limitvalue1 < $args[11])) continue;
  60.                 if ( ($data->limittype0 == 1 && $data->limitvalue0 > $args[12]) || ($data->limittype1 == 1 && $data->limitvalue1 > $args[12])) continue;
  61.  
  62.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement