ERROR: MarketExplorer

A place to submit .patch fixes for the DOL SVN

Moderator: Developer Team

ERROR: MarketExplorer

Postby Urza » Fri Aug 27, 2010 6:13 am

Hi,
i get this error message if i click on market explorer search window:
Code: Select all
08:08:33,897 - [3] - ERROR - DOL.Database.Connection.DataConnection - ExecuteSelect: "SELECT `Inventory_ID`, `OwnerID`, `OwnerLot`, `ITemplate_Id`, `UTemplate_Id`, `IsCrafted`, `Creator`, `SlotPosition`, `Count`, `SellPrice`, `Experience`, `Color`, `Emblem`, `Extension`, `Condition`, `Durability`, `PoisonSpellID`, `PoisonMaxCharges`, `PoisonCharges`, `Charges`, `Charges1`, `Cooldown` FROM `Inventory` WHERE SlotPosition >= 1500 AND OwnerLot != 0  AND (Level >= \'0\' AND Level <= \'52\')"

System.ArgumentOutOfRangeException: Der Index und die Länge müssen sich auf eine Position in der Zeichenfolge beziehen.
Parametername: length
   bei System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
   bei MySql.Data.MySqlClient.MySqlTokenizer.NextParameter()
   bei MySql.Data.MySqlClient.Statement.InternalBindParameters(String sql, MySqlParameterCollection parameters, MySqlPacket packet)
   bei MySql.Data.MySqlClient.Statement.BindParameters()
   bei MySql.Data.MySqlClient.PreparableStatement.Execute()
   bei MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   bei MySql.Data.MySqlClient.MySqlCommand.ExecuteReader()
   bei DOL.Database.Connection.DataConnection.ExecuteSelect(String sqlcommand, QueryCallback callback, IsolationLevel isolation)
08:08:34,087 - [3] - ERROR - DOL.GS.PacketHandler.PacketProcessor - Error while processing packet (handler=DOL.GS.PacketHandler.Client.v168.PlayerMarketSearchRequestHandler  client: Version1105 pakLib:DOL.GS.PacketHandler.PacketLib1105 type:LabyrinthOfTheMinotaur(LabyrinthOfTheMinotaur) addons:bit4, bit5, Foundations, NewFrontiers state:Playing IP:127.0.0.1:55706 session:1 acc:admin char:Lotte class:40)
System.ArgumentOutOfRangeException: Der Index und die Länge müssen sich auf eine Position in der Zeichenfolge beziehen.
Parametername: length
   bei System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
   bei MySql.Data.MySqlClient.MySqlTokenizer.NextParameter()
   bei MySql.Data.MySqlClient.Statement.InternalBindParameters(String sql, MySqlParameterCollection parameters, MySqlPacket packet)
   bei MySql.Data.MySqlClient.Statement.BindParameters()
   bei MySql.Data.MySqlClient.PreparableStatement.Execute()
   bei MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   bei MySql.Data.MySqlClient.MySqlCommand.ExecuteReader()
   bei DOL.Database.Connection.DataConnection.ExecuteSelect(String sqlcommand, QueryCallback callback, IsolationLevel isolation)
   bei DOL.Database.Handlers.MySQLObjectDatabase.SelectObjectsImpl[TObject](String whereClause, IsolationLevel isolation)
   bei DOL.Database.ObjectDatabase.SelectObjects[TObject](String whereExpression, IsolationLevel isolation)
   bei DOL.Database.ObjectDatabase.SelectObjects[TObject](String whereExpression)
   bei DOL.GS.PacketHandler.Client.v168.PlayerMarketSearchRequestHandler.HandlePacket(GameClient client, GSPacketIn packet)
   bei DOL.GS.PacketHandler.PacketProcessor.HandlePacket(GSPacketIn packet)


Can anybody help me?

greetings urza
User avatar
Urza
Developer
 
Posts: 671
Joined: Sun Jan 23, 2005 11:15 am
Website: http://www.juwesch.eu
Location: Germany/Delitzsch

Re: ERROR: MarketExplorer

Postby Graveen » Fri Aug 27, 2010 8:29 am

Can you translate the error message ? :)
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: ERROR: MarketExplorer

Postby Tinantiol » Fri Aug 27, 2010 12:46 pm

Der Index und die Länge müssen sich auf eine Position in der Zeichenfolge beziehen.

The index and length must refer to a position in the string.
Drydruid Druid 10l4 (Deira off)
Driwyth Shadowblade 9l6 (Deira Off)
Dryinfiwyth Infiltrator 5l6 (Deira off)

Drywyth Cleric 11l7 (Eden)
Dryywyth Druid 11l7 (Eden)
Dryywyyth Bard 11l7 (Eden)
Dryywyith Shaman 11l7 (Eden)
http://genesis-daoc.forums-free.com/
Tinantiol
DOL Devotee
 
Posts: 380
Joined: Sat May 09, 2009 10:33 am
Website: http://genesis-daoc.forums-free.com/
Location: Gaeta, Italy

Re: ERROR: MarketExplorer

Postby Tolakram » Fri Aug 27, 2010 12:52 pm

The issue is those fields are no longer in the inventory table. I had to do a massive re-write of Storm's market explorer for the new inventory system. It involves caching all of the items (since it needs to combine inventory with either itemtemplate or itemunique) and searching through them.
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: ERROR: MarketExplorer

Postby Graveen » Fri Aug 27, 2010 1:18 pm

i also see a problem in the log: Level is an int and is surrounded by escaped single quotes, i think this is what is issueing the error message.
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: ERROR: MarketExplorer

Postby Urza » Fri Aug 27, 2010 6:10 pm

Hi,
thanks for your answers but what can I do?

Greetings Urza
User avatar
Urza
Developer
 
Posts: 671
Joined: Sun Jan 23, 2005 11:15 am
Website: http://www.juwesch.eu
Location: Germany/Delitzsch

Re: ERROR: MarketExplorer

Postby elcotek » Fri Aug 27, 2010 6:51 pm

Hello :wink:


Here my Patch for Market Exploer with sell fix based on first patch :

for Dol Revision (revision 2544)
The code need more work on Item stats displaying and an other metode for AllowAdd on Inventory.
Code: Select all
 Index: trunk/DOLDatabase/Tables/Inventory.cs
===================================================================
--- trunk/DOLDatabase/Tables/Inventory.cs   (revision 2544)
+++ trunk/DOLDatabase/Tables/Inventory.cs   (working copy)
@@ -269,7 +269,7 @@
       /// </summary>
       public InventoryItem()
       {
-         AllowAdd = false;
+         AllowAdd = true;
          m_ownerID = null;
          m_emblem = 0;
          m_count = 1;
Index: trunk/GameServer/packets/Client/168/DetailDisplayHandler.cs
===================================================================
--- trunk/GameServer/packets/Client/168/DetailDisplayHandler.cs   (revision 2544)
+++ trunk/GameServer/packets/Client/168/DetailDisplayHandler.cs   (working copy)
@@ -82,7 +82,7 @@
                      invItem = client.Player.Inventory.GetItem((eInventorySlot)objectID);
                      if (invItem == null)
                      {
-                        if (client.Player.ActiveConMerchant != null)
+                       if (client.Player.ActiveConMerchant != null)
                         {
                            GameConsignmentMerchant con = client.Player.ActiveConMerchant;
                            invItem = con.ConInventory[objectID];
Index: trunk/GameServer/packets/Client/168/PlayerMarketSearchRequestHandler.cs
===================================================================
--- trunk/GameServer/packets/Client/168/PlayerMarketSearchRequestHandler.cs   (revision 2544)
+++ trunk/GameServer/packets/Client/168/PlayerMarketSearchRequestHandler.cs   (working copy)
@@ -34,11 +34,13 @@
         /// Defines a logger for this class.
         /// </summary>
         private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-        public const string EXPLORER_LIST = "explorerList";
+        // public const string EXPLORER_LIST = "explorerList";
+        public static string EXPLORER_LIST = " SlotPosition >= 1500 ";
         public List<InventoryItem> ExplorerItems()
         {
             List<InventoryItem> list = new List<InventoryItem>();
-         var obj = GameServer.Database.SelectObjects<InventoryItem>("SlotPosition > '1499'");
+            //   var obj = GameServer.Database.SelectObjects<InventoryItem>("SlotPosition > '1499'");
+            var obj = GameServer.Database.SelectObjects<InventoryItem>(EXPLORER_LIST);
             foreach (InventoryItem itm in obj)
             {
                 list.Add(itm);
@@ -57,7 +59,8 @@
             int skill = (int)packet.ReadInt();
             int resist = (int)packet.ReadInt();
             int bonus = (int)packet.ReadInt();
-            int hp = (int)packet.ReadInt();
+            // int hp = (int)packet.ReadInt();
+            int value = (int)packet.ReadInt();
             int power = (int)packet.ReadInt();
             int proc = (int)packet.ReadInt();
             int qtyMin = (int)packet.ReadInt();
@@ -70,22 +73,19 @@
             byte page = (byte)packet.ReadByte();
             byte unk1 = (byte)packet.ReadByte();
             short unk2 = (short)packet.ReadShort();
-         if(client.Version >= GameClient.eClientVersion.Version198)
-         {
-            // Dunnerholl 2009-07-28 Version 1.98 introduced new options to Market search. 12 Bytes were added, but only 7 are in usage so far in my findings.
-            // update this, when packets change and keep in mind, that this code reflects only the 1.98 changes
-            byte armorType = page; // page is now used for the armorType (still has to be logged, i just checked that 2 means leather, 0 = standard
-            byte damageType = (byte)packet.ReadByte(); // 1=crush, 2=slash, 3=thrust
-            // 3 bytes unused
-            packet.Skip(3);
-            byte playerCrafted = (byte)packet.ReadByte(); // 1 = show only Player crafted, 0 = all
-            // 3 bytes unused
-            packet.Skip(3);
-            page = (byte)packet.ReadByte(); // page is now sent here
-            byte unknown = (byte)packet.ReadByte(); // always been 0xE5, if u page it is 0x4B, tested on alb only
-            byte unknown2 = (byte)packet.ReadByte(); //always been 0x12, if u page it is 0x7C, tested on alb only
-            byte unknown3 = (byte)packet.ReadByte(); //always been 0x00, if u page it is 0x1B, tested on alb only
-         }
+
+            byte armorType = page; // page is now used for the armorType (still has to be logged, i just checked that 2 means leather, 0 = standard
+            byte damageType = (byte)packet.ReadByte(); // 1=crush, 2=slash, 3=thrust
+            // 3 bytes unused
+            packet.Skip(3);
+            byte playerCrafted = (byte)packet.ReadByte(); // 1 = show only Player crafted, 0 = all
+            // 3 bytes unused
+            packet.Skip(3);
+            page = (byte)packet.ReadByte(); // page is now sent here
+            byte unknown = (byte)packet.ReadByte(); // always been 0xE5, if u page it is 0x4B, tested on alb only
+            byte unknown2 = (byte)packet.ReadByte(); //always been 0x12, if u page it is 0x7C, tested on alb only
+            byte unknown3 = (byte)packet.ReadByte(); //always been 0x00, if u page it is 0x1B, tested on alb only
+
             int requestedPage = (int)page;
 
             int firstSlot = 0 + (requestedPage * 20);
@@ -93,174 +93,527 @@
 
             StringBuilder sql = new StringBuilder();
 
-            sql.Append("SlotPosition >= 1500 AND OwnerLot != 0 ");
+            sql.Append(" SlotPosition >= 1500 ");
 
-            if (filter != null && filter != "")
-                sql.Append(" AND Name LIKE '%" + filter + "%'");
+            #region Price
+            if (priceMin > 0)
+                sql.Append(" AND (SellPrice >= " + priceMin + ") ");
+            if (priceMax > 0)
+                sql.Append(" AND (SellPrice <= " + priceMax + ") ");
+            #endregion
 
+            #region playerCrafted
+            if (playerCrafted == 1)
+                sql.Append(" AND IsCrafted = 1 ");
+            #endregion
 
-         #region Slot
-         if (slot != -1)
-         {
-            switch (slot)
-            {
-               case 0:
-                  sql.Append(" AND Item_Type = '22'");
-                  break;
-               case 1:
-                  sql.Append(" AND Item_Type = '23'");
-                  break;
-               case 2:
-                  sql.Append(" AND Item_Type = '21'");
-                  break;
-               case 3:
-                  sql.Append(" AND Item_Type = '28'");
-                  break;
-               case 4:
-                  sql.Append(" AND Item_Type = '27'");
-                  break;
-               case 5:
-                  sql.Append(" AND Item_Type = '25'");
-                  break;
-               case 6:
-                  sql.Append(" AND Item_Type IN (35, 36)");
-                  break;
-               case 7:
-                  sql.Append(" AND Item_Type IN (33, 34)");
-                  break;
-               case 8:
-                  sql.Append(" AND Item_Type = '32'");
-                  break;
-               case 9:
-                  sql.Append(" AND Item_Type = '29'");
-                  break;
-               case 10:
-                  sql.Append(" AND Item_Type = '26'");
-                  break;
-               case 11:
-                  sql.Append(" AND Item_Type = '24'");
-                  break;
-               case 12:
-                  sql.Append(" AND Item_Type IN (10, 11)");
-                  break;
-               case 13:
-                  sql.Append(" AND Object_Type = '42'");
-                  break;
-               case 14:
-                  sql.Append(" AND Item_Type = '12'");
-                  break;
-               case 15:
-                  sql.Append(" AND Item_Type = '13'");
-                  break;
-               case 16:
-                  sql.Append(" AND Item_Type = '11'");
-                  break;
-               case 17:
-                  sql.Append(" AND Object_Type = '45'");
-                  break;
-               case 18:
-                  sql.Append(" AND (Item_Type = '0' OR Object_Type = '0')");
-                  break;
-            }
-         }
-         #endregion
+            #region Slot
+            int slotDol1 = -1;
+            int slotDol2 = -1;
+            if (slot != -1)
+            {
+                switch (slot)
+                {
+                    case 0:
+                        //sql.Append(" AND Item_Type = '22'");
+                        slotDol1 = 22;
+                        slotDol2 = 22;
+                        break;
+                    case 1:
+                        //sql.Append(" AND Item_Type = '23'");
+                        slotDol1 = 23;
+                        slotDol2 = 23;
+                        break;
+                    case 2:
+                        //sql.Append(" AND Item_Type = '21'");
+                        slotDol1 = 21;
+                        slotDol2 = 21;
+                        break;
+                    case 3:
+                       
+                        slotDol1 = 28;
+                        slotDol2 = 28;
+                        break;
+                    case 4:
+                        //sql.Append(" AND Item_Type = '27'");
+                        slotDol1 = 29;
+                        slotDol2 = 29;
+                        break;
+                    case 5:
+                        slotDol1 = 25;
+                        slotDol2 = 25;
+                        break;
+                    case 6:
+                        slotDol1 = 35;
+                        slotDol2 = 36;
+                        break;
+                    case 7:
+                        slotDol1 = 33;
+                        slotDol2 = 34;
+                        break;
+                    case 8:
+                        slotDol1 = 33;
+                        slotDol2 = 34;
+                        break;
+                    case 9:
+                        slotDol1 = 32;
+                        slotDol2 = 32;
+                        break;
+                    case 10:
+                        slotDol1 = 29;
+                        slotDol2 = 29;
+                        break;
+                    case 11:
+                        slotDol1 = 26;
+                        slotDol2 = 26;
+                        break;
+                    case 12:
+                        slotDol1 = 24;
+                        slotDol2 = 24;
+                        break;
+                    case 13:
+                        slotDol1 = 42;
+                        slotDol2 = 42;
+                        break;
+                    case 14:
+                        slotDol1 = 12;
+                        slotDol2 = 12;
+                        break;
+                    case 15:
+                        slotDol1 = 13;
+                        slotDol2 = 13;
+                        break;
+                    case 16:
+                        slotDol1 = 11;
+                        slotDol2 = 11;
+                        break;
+                    case 17:
+                        slotDol1 = 45;
+                        slotDol2 = 45;
+                        break;
+                    case 18:
+                        slotDol1 = 0;
+                        slotDol2 = 0;
+                        break;
+                }
+            }
+            #endregion
 
-         #region Bonus
-         if (bonus > 0)
-            sql.Append(" AND (Bonus >= '" + bonus + "')");
-         #endregion
+            #region Bonus
+           
+            int bonusDol1 = 0;
+            int bonusDol2 = 0;
+            if (bonus > -1)
+            {
+                if (bonus == 0) bonusDol1 = 1;
+                if (bonus == 1) bonusDol1 = 3;
+                if (bonus == 2) bonusDol1 = 2;
+                if (bonus == 3) bonusDol1 = 4;
+                if (bonus == 4) bonusDol1 = 6;
+                if (bonus == 5) bonusDol1 = 7;
+                if (bonus == 6) bonusDol1 = 5;
+                if (bonus == 7) bonusDol1 = 8;
+                if (bonus == 8) bonusDol1 = 163;
+                if (bonus == 9) { bonusDol1 = 188; bonusDol2 = 200; }
+                if (bonus == 10) bonusDol1 = 9;
+                if (bonus == 11) bonusDol1 = 150;
+                if (bonus == 12) bonusDol1 = 199;
+                if (bonus == 13) bonusDol1 = 148;
+                if (bonus == 14) bonusDol1 = 191;
+                if (bonus == 15) bonusDol1 = 155;
+                if (bonus == 16) bonusDol1 = 188;
+                if (bonus == 17) { bonusDol1 = 201; bonusDol2 = 209; }
+                if (bonus == 18) bonusDol1 = 210;
+                if (bonus == 19) bonusDol1 = 216;
+                if (bonus == 20) { bonusDol1 = 179; bonusDol2 = 187; }
+            }
+            #endregion
 
-         #region Price
-         if (priceMax > 0 && priceMin < priceMax)
-            sql.Append(" AND (SellPrice >= '" + priceMin + "' AND SellPrice <= '" + priceMax + "')");
-         #endregion
+            #region Skill
 
-         #region Level
-         if (levelMax > 0 && levelMin < levelMax)
-            sql.Append(" AND (Level >= '" + levelMin + "' AND Level <= '" + levelMax + "')");
-         #endregion
+            // Thx Dry, Xa & Thor
+            int skillDol = 0;
+            if (skill > -1)
+            {
+                if (skill == 1) skillDol = 44; // TRANCHANT
+                if (skill == 2) skillDol = 50; // ESTOC
+                if (skill == 8) skillDol = 40; // PARADE
+                if (skill == 14) skillDol = 52; // EPEE
+                if (skill == 16) skillDol = 53; // MARTEAU
+                if (skill == 17) skillDol = 54; // AXE
+                if (skill == 18) skillDol = 55; // HACHE SENESTRE
+                if (skill == 19) skillDol = 49; // FURTIVITE
+                if (skill == 26) skillDol = 56; // LANCE
+                if (skill == 29) skillDol = 57; // REC0NSTITUTION
+                if (skill == 30) skillDol = 58; // AMELIORATION
+                if (skill == 33) skillDol = 25; // CONTONDANT
+                if (skill == 34) skillDol = 94; // APPAISEMENT
+                if (skill == 37) skillDol = 85; // Skill_Cave_Magic = 59 //MAGIE ABYSSAL
+                if (skill == 38) skillDol = 60; // TENEBRES
+                if (skill == 39) skillDol = 61; // AFFAIBLISSEMENT
+                if (skill == 42) skillDol = 62; // RUNES ODINS
+                if (skill == 43) skillDol = 43; // BOUCLIER
+                if (skill == 46) skillDol = 33; // ARME FLEXIBLE
+                if (skill == 47) skillDol = 48; // BATON
+                if (skill == 48) skillDol = 98; // INVOCATION
+                if (skill == 62) skillDol = 64; // LIEN ANIMAL
+                if (skill == 64) skillDol = 41; // ARMES D'HAST
+                if (skill == 65) skillDol = 20; // DEUX MAINS
+                if (skill == 66) skillDol = 32; // FEU
+                if (skill == 67) skillDol = 51; // AIR
+                if (skill == 68) skillDol = 34; // GLACE
+                if (skill == 69) skillDol = 29; // TERRE
+                if (skill == 70) skillDol = 65; // VOIE DU SOLEIL
+                if (skill == 71) skillDol = 37; // MANIPULATION
+                if (skill == 72) skillDol = 21; // ALTERATION
+                if (skill == 73) skillDol = 47; // SIMULACRE
+                if (skill == 74) skillDol = 38; // AME
+                if (skill == 75) skillDol = 66; // VOIE DU VIDE
+                if (skill == 76) skillDol = 67; // VOIE DE LA LUNE
+                if (skill == 77) skillDol = 28; // 2 ARMES
+                if (skill == 78) skillDol = 68; // ARC COMPOSITE
+                if (skill == 82) skillDol = 69; // CHANT DE GUERRE
+                if (skill == 83) skillDol = 30; // BENEDICTION
+                if (skill == 84) skillDol = 30; // BENEDICTION ... Oo ?
+                if (skill == 88) skillDol = 42; // GUERISON
+                if (skill == 89) skillDol = 45; // COLERE DIVINE
+                if (skill == 90) skillDol = 115; // ARCHERIE
+                if (skill == 91) skillDol = 24; // ARBALETE
+                if (skill == 97) skillDol = 22; // CANTIQUES
+                if (skill == 98) skillDol = 35; // INSTRUMENT
+                if (skill == 101) skillDol = 72; // LAMES
+                if (skill == 102) skillDol = 73; // MASSES
+                if (skill == 103) skillDol = 74; // PERFORANT
+                if (skill == 104) skillDol = 75; // GRANDE ARME
+                if (skill == 105) skillDol = 76; // EMPATHIE
+                if (skill == 106) skillDol = 77; // REGENERATION
+                if (skill == 107) skillDol = 78; // CROISSANCE
+                if (skill == 108) skillDol = 79; // SYMBIOSE
+                if (skill == 109) skillDol = 80; // MUSIQUE
+                if (skill == 110) skillDol = 81; // ART DE COMBAT
+                if (skill == 112) skillDol = 82; // LANCE CELTE
+                if (skill == 113) skillDol = 83; // ARC RECOURBE
+                if (skill == 114) skillDol = 84; // VAILLANCE
+                if (skill == 116) skillDol = 97; // ART DES FORET
+                if (skill == 117) skillDol = 31; // EMPOISONNER
+                if (skill == 118) skillDol = 23; // ATTAQUE SOURNOISE
+                if (skill == 120) skillDol = 27; // VISIO MORTIS
+                if (skill == 121) skillDol = 39; // DOLOR INFLICTUS
+                if (skill == 122) skillDol = 26; // SERVITOR MORTIS
+                if (skill == 123) skillDol = 46; // TOURMENTS D'AMES
+                if (skill == 124) skillDol = 92; // CONTACT
+                if (skill == 125) skillDol = 90; // FAUX
+                if (skill == 126) skillDol = 86; // ARMEE SQUEL.
+                if (skill == 127) skillDol = 89; // VOIE ARBOREAL
+                if (skill == 129) skillDol = 88; // VOIE SYLVESTRE
+                if (skill == 130) skillDol = 87; // VOIE DE VERDURE
+                if (skill == 50) skillDol = 63; // IRE DE THOR
+                if (skill == 133) skillDol = 105; // VOLONTE D'ODIN
+                if (skill == 134) skillDol = 114; // DEFENSE SPECTRALE
+                if (skill == 135) skillDol = 103; // LAMENTATION SEPULC
+                if (skill == 136) skillDol = 102; // CRI ETHERE
+                if (skill == 137) skillDol = 100; // MAITRISE DES OMBRES
+                if (skill == 138) skillDol = 101; // ETREINTE
+                if (skill == 139) skillDol = 99; // DEMENCE
+                if (skill == 140) skillDol = 108; // ARTIFICES
+                if (skill == 141) skillDol = 106; // SORTILEGES
+                if (skill == 142) skillDol = 107; // MALEFICES
+                if (skill == 300) skillDol = 164; // TOUTE COMP ARMES
+                if (skill == 303) skillDol = 163; // TOUTES LIGNE SORTS
+                if (skill == 147) skillDol = 110; // BANDAGES
+                if (skill == 148) skillDol = 109; // BATON DE KAN-LARESH
+            }
+            #endregion
 
-         #region Visual Effect
-         if (visual > 0)
-            sql.Append(" AND (Effect > '0')");
-         #endregion
+            #region Resist
+           
+            int resistDol = 0;
+            if (resist > -1)
+            {
+                if (resist == 8) resistDol = 17;
+                if (resist == 7) resistDol = 13;
+                if (resist == 6) resistDol = 19;
+                if (resist == 5) resistDol = 18;
+                if (resist == 4) resistDol = 16;
+                if (resist == 3) resistDol = 14;
+                if (resist == 2) resistDol = 15;
+                if (resist == 1) resistDol = 12;
+                if (resist == 0) resistDol = 11;
+            }
+            #endregion
 
-         #region Skill
-         if (skill > 0)
-         sql.Append(" AND (Bonus1Type = '" + skill + "' OR " +
-                        "Bonus2Type = '" + skill + "' OR " +
-                        "Bonus3Type = '" + skill + "' OR " +
-                        "Bonus4Type = '" + skill + "' OR " +
-                        "Bonus5Type = '" + skill + "' OR " +
-                        "Bonus6Type = '" + skill + "' OR " +
-                        "Bonus7Type = '" + skill + "' OR " +
-                        "Bonus8Type = '" + skill + "' OR " +
-                        "Bonus9Type = '" + skill + "' OR " +
-                        "Bonus10Type = '" + skill + "' OR " +
-                        "ExtraBonusType = '" + skill + "')");
-         #endregion
+            #region Proc
+            if (proc > 0)
+                client.Player.Out.SendMessage("PROC function list all objects that possess a proc without distinction ... repared soon.", eChatType.CT_Important, eChatLoc.CL_ChatWindow);
+           
+            #endregion
 
-         #region Resist
-         if(resist > 0)
-         sql.Append(" AND (Bonus1Type = '" + resist + "' OR " +
-                        "Bonus2Type = '" + resist + "' OR " +
-                        "Bonus3Type = '" + resist + "' OR " +
-                        "Bonus4Type = '" + resist + "' OR " +
-                        "Bonus5Type = '" + resist + "' OR " +
-                        "Bonus6Type = '" + resist + "' OR " +
-                        "Bonus7Type = '" + resist + "' OR " +
-                        "Bonus8Type = '" + resist + "' OR " +
-                        "Bonus9Type = '" + resist + "' OR " +
-                        "Bonus10Type = '" + resist + "' OR " +
-                        "ExtraBonusType = '" + resist + "')");
-         #endregion
+            string qryString = GameServer.Database.Escape(sql.ToString());
+            EXPLORER_LIST = String.Concat(qryString);
 
-         #region Health
-         if(hp > 0)
-         sql.Append(" AND (Bonus1Type = '" + eProperty.MaxHealth + "' AND Bonus1 >= '" + hp + "' OR " +
-                        "Bonus2Type = '" + eProperty.MaxHealth + "' AND Bonus2 >= '" + hp + "' OR " +
-                        "Bonus3Type = '" + eProperty.MaxHealth + "' AND Bonus3 >= '" + hp + "' OR " +
-                        "Bonus4Type = '" + eProperty.MaxHealth + "' AND Bonus4 >= '" + hp + "' OR " +
-                        "Bonus5Type = '" + eProperty.MaxHealth + "' AND Bonus5 >= '" + hp + "' OR " +
-                        "Bonus6Type = '" + eProperty.MaxHealth + "' AND Bonus6 >= '" + hp + "' OR " +
-                        "Bonus7Type = '" + eProperty.MaxHealth + "' AND Bonus7 >= '" + hp + "' OR " +
-                        "Bonus8Type = '" + eProperty.MaxHealth + "' AND Bonus8 >= '" + hp + "' OR " +
-                        "Bonus9Type = '" + eProperty.MaxHealth + "' AND Bonus9 >= '" + hp + "' OR " +
-                        "Bonus10Type = '" + eProperty.MaxHealth + "' AND Bonus10 >= '" + hp + "' OR " +
-                        "ExtraBonusType = '" + eProperty.MaxHealth + "' AND ExtraBonus >= '" + hp + "')");
-         #endregion
+            var items = GameServer.Database.SelectObjects<InventoryItem>(EXPLORER_LIST);
 
-         #region Power
-         if(power > 0)
-         sql.Append(" AND (Bonus1Type = '" + eProperty.MaxMana + "' AND Bonus1 >= '" + power + "' OR " +
-                        "Bonus2Type = '" + eProperty.MaxMana + "' AND Bonus2 >= '" + power + "' OR " +
-                        "Bonus3Type = '" + eProperty.MaxMana + "' AND Bonus3 >= '" + power + "' OR " +
-                        "Bonus4Type = '" + eProperty.MaxMana + "' AND Bonus4 >= '" + power + "' OR " +
-                        "Bonus5Type = '" + eProperty.MaxMana + "' AND Bonus5 >= '" + power + "' OR " +
-                        "Bonus6Type = '" + eProperty.MaxMana + "' AND Bonus6 >= '" + power + "' OR " +
-                        "Bonus7Type = '" + eProperty.MaxMana + "' AND Bonus7 >= '" + power + "' OR " +
-                        "Bonus8Type = '" + eProperty.MaxMana + "' AND Bonus8 >= '" + power + "' OR " +
-                        "Bonus9Type = '" + eProperty.MaxMana + "' AND Bonus9 >= '" + power + "' OR " +
-                        "Bonus10Type = '" + eProperty.MaxMana + "' AND Bonus10 >= '" + power + "' OR " +
-                        "ExtraBonusType = '" + eProperty.MaxMana + "' AND ExtraBonus >= '" + power + "')");
-         #endregion
+            if (filter == "" && proc == 0 && armorType == 0 && qtyMin == 0 && qtyMax == 100 && slot == -1 && bonus == -1 && damageType == 0 && levelMin == 0 && levelMax == 52 && visual == 0 && skill == -1 && resist == -1)//&& value == 0 && power == 0)
+            {
+                int itemsOnPage = page < (int)Math.Ceiling((double)items.Count / 20) ? 20 : items.Count % 20;
 
-         string qryString = GameServer.Database.Escape(sql.ToString());
+                if (itemsOnPage > items.Count)
+                    itemsOnPage = items.Count;
 
-            var items = GameServer.Database.SelectObjects<InventoryItem>(qryString);
-         int itemsOnPage = page < (int)Math.Ceiling((double)items.Count / 20) ? 20 : items.Count % 20;
-            if (itemsOnPage > 0)
+                if (itemsOnPage > 0)
+                {
+                    int pageCount = (int)Math.Ceiling((double)items.Count / 20) - 1;
+                    client.Player.Out.SendMarketExplorerWindow(items, (byte)page, (byte)pageCount);
+
+                    client.Player.Out.SendMessage(itemsOnPage.ToString() + " Results found for page " + (page + 1) + ".", eChatType.CT_Important, eChatLoc.CL_ChatWindow);
+                }
+                else
+                    client.Player.Out.SendMessage("No Items found", eChatType.CT_Important, eChatLoc.CL_ChatWindow);
+            }
+
+            if (filter != "" || proc > 0 || armorType != 0 || qtyMin != 0 || qtyMax != 100 || slot != -1 || bonus != -1 || damageType > 0 || levelMin > 0 || levelMax < 52 || visual > 0 || skill != -1 || resist != -1)
             {
-            int itemCount = items.Count;
-            int pageCount = (int)Math.Ceiling((double)itemCount / 20) - 1;
-            client.Player.Out.SendMarketExplorerWindow(items, page, (byte)pageCount);
-                client.Player.Out.SendMessage(itemsOnPage.ToString() + " Results found for page " + (page + 1) + ".", eChatType.CT_Important, eChatLoc.CL_ChatWindow);
-                client.Player.TempProperties.removeProperty(EXPLORER_LIST);
-            client.Player.TempProperties.setProperty(EXPLORER_LIST, items);
+                bool Xfilter, Xproc, XarmorType, XqtyMin, XqtyMax, Xslot, Xbonus, XdamageType, XlevelMin, XlevelMax, Xvisual, Xskill, Xresist = false;
+
+                List<ItemTemplate> listItem = new List<ItemTemplate>();
+                List<InventoryItem> list = new List<InventoryItem>();
+                string ID_NB;
+                int index = 0;
+
+                do
+                {
+                    ID_NB = items[index].ITemplate_Id;
+                    var itemt = GameServer.Database.SelectObjects<ItemTemplate>(" Id_nb LIKE \"" + ID_NB + "\" ");
+                    var itemu = GameServer.Database.SelectObjects<ItemUnique>(" Id_nb LIKE \"" + ID_NB + "\" ");
+                    if (itemt.Count > 0)
+                        listItem.Add(itemt[0]);
+                    if (itemu.Count > 0)
+                        listItem.Add(itemu[0]);
+                    index++;
+                    itemt = null;
+                    itemu = null;
+                }
+                while (index < items.Count);
+
+                index = 0;
+                do
+                {
+                    if (filter == "") Xfilter = true;
+                    else Xfilter = false;
+                    if (proc == 0) Xproc = true;
+                    else Xproc = false;
+                    if (armorType == 0) XarmorType = true;
+                    else XarmorType = false;
+                    if (qtyMin == 0) XqtyMin = true;
+                    else XqtyMin = false;
+                    if (qtyMax == 100) XqtyMax = true;
+                    else XqtyMax = false;
+                    if (slot == -1) Xslot = true;
+                    else Xslot = false;
+                    if (bonus == -1) Xbonus = true;
+                    else Xbonus = false;
+                    if (damageType == 0) XdamageType = true;
+                    else XdamageType = false;
+                    if (levelMin == 0) XlevelMin = true;
+                    else XlevelMin = false;
+                    if (levelMax == 52) XlevelMax = true;
+                    else XlevelMax = false;
+                    if (visual == 0) Xvisual = true;
+                    else Xvisual = false;
+                    if (skill == -1) Xskill = true;
+                    else Xskill = false;
+                    if (resist == -1) Xresist = true;
+                    else Xresist = false;
+
+                    if (!Xfilter)
+                    {
+                        string[] Xname = { listItem[index].Name };
+                        foreach (string X in Xname)
+                        {
+                            if (System.Text.RegularExpressions.Regex.IsMatch(X, filter, System.Text.RegularExpressions.RegexOptions.IgnoreCase))
+                                Xfilter = true;
+                        }
+                    }
+
+                    if (!Xproc)
+                    {
+                        if (listItem[index].ProcSpellID > 0 && listItem[index].ProcSpellID1 > 0)
+                            Xproc = true;
+                    }
+                    if (!XarmorType)
+                    {
+                        if (listItem[index].Object_Type == (armorType + 31))
+                            XarmorType = true;
+                    }
+                    if (!XqtyMin)
+                    {
+                        if (listItem[index].Quality >= qtyMin)
+                            XqtyMin = true;
+                    }
+                    if (!XqtyMax)
+                    {
+                        if (listItem[index].Quality <= qtyMax)
+                            XqtyMax = true;
+                    }
+
+                    if (!Xslot)
+                    {
+                        if (slotDol1 == 0 && (listItem[index].Object_Type == slotDol1 || listItem[index].Item_Type == slotDol1))
+                            Xslot = true;
+
+                        if ((slotDol1 == 42 || slotDol1 == 45) && listItem[index].Object_Type == slotDol1)
+                            Xslot = true;
+
+                        if (listItem[index].Item_Type == slotDol1 || listItem[index].Item_Type == slotDol2)
+                            Xslot = true;
+                    }
+
+                    if (!Xbonus)
+                    {
+                        if (bonusDol2 == 0)
+                        {
+                            if (listItem[index].Bonus1Type == bonusDol1 && listItem[index].Bonus1 >= value
+                         || listItem[index].Bonus2Type == bonusDol1 && listItem[index].Bonus2 >= value
+                             || listItem[index].Bonus3Type == bonusDol1 && listItem[index].Bonus3 >= value
+                             || listItem[index].Bonus4Type == bonusDol1 && listItem[index].Bonus4 >= value
+                             || listItem[index].Bonus5Type == bonusDol1 && listItem[index].Bonus5 >= value
+                             || listItem[index].Bonus6Type == bonusDol1 && listItem[index].Bonus6 >= value
+                             || listItem[index].Bonus7Type == bonusDol1 && listItem[index].Bonus7 >= value
+                             || listItem[index].Bonus8Type == bonusDol1 && listItem[index].Bonus8 >= value
+                             || listItem[index].Bonus9Type == bonusDol1 && listItem[index].Bonus9 >= value
+                             || listItem[index].Bonus10Type == bonusDol1 && listItem[index].Bonus10 >= value
+                             || listItem[index].ExtraBonusType == bonusDol1 && listItem[index].ExtraBonus >= value)
+                                Xbonus = true;
+                        }
+                        if (bonusDol2 > 0)
+                        {
+                            if (listItem[index].Bonus1Type == bonusDol1 && listItem[index].Bonus1Type <= bonusDol2 && listItem[index].Bonus1 >= value
+                             || listItem[index].Bonus2Type == bonusDol1 && listItem[index].Bonus2Type <= bonusDol2 && listItem[index].Bonus2 >= value
+                             || listItem[index].Bonus3Type == bonusDol1 && listItem[index].Bonus3Type <= bonusDol2 && listItem[index].Bonus3 >= value
+                             || listItem[index].Bonus4Type == bonusDol1 && listItem[index].Bonus4Type <= bonusDol2 && listItem[index].Bonus4 >= value
+                             || listItem[index].Bonus5Type == bonusDol1 && listItem[index].Bonus5Type <= bonusDol2 && listItem[index].Bonus5 >= value
+                             || listItem[index].Bonus6Type == bonusDol1 && listItem[index].Bonus6Type <= bonusDol2 && listItem[index].Bonus6 >= value
+                             || listItem[index].Bonus7Type == bonusDol1 && listItem[index].Bonus7Type <= bonusDol2 && listItem[index].Bonus7 >= value
+                             || listItem[index].Bonus8Type == bonusDol1 && listItem[index].Bonus8Type <= bonusDol2 && listItem[index].Bonus8 >= value
+                             || listItem[index].Bonus9Type == bonusDol1 && listItem[index].Bonus9Type <= bonusDol2 && listItem[index].Bonus9 >= value
+                             || listItem[index].Bonus10Type == bonusDol1 && listItem[index].Bonus10Type <= bonusDol2 && listItem[index].Bonus10 >= value
+                             || listItem[index].ExtraBonusType == bonusDol1 && listItem[index].ExtraBonusType <= bonusDol2 && listItem[index].ExtraBonus >= value)
+                                Xbonus = true;
+                        }
+                    }
+
+                    if (!XdamageType)
+                    {
+                        if (listItem[index].Type_Damage == damageType)
+                            XdamageType = true;
+                    }
+
+                    if (!XlevelMin)
+                    {
+                        if (listItem[index].Level >= levelMin)
+                            XlevelMin = true;
+                    }
+
+                    if (!XlevelMax)
+                    {
+                        if (listItem[index].Level <= levelMax)
+                            XlevelMax = true;
+                    }
+
+                    if (!Xvisual)
+                    {
+                        if (listItem[index].Effect > 0)
+                            Xvisual = true;
+                    }
+
+                    if (!Xskill)
+                    {
+                        if (listItem[index].Bonus1Type == skillDol && listItem[index].Bonus1 >= value
+                         || listItem[index].Bonus2Type == skillDol && listItem[index].Bonus2 >= value
+                         || listItem[index].Bonus3Type == skillDol && listItem[index].Bonus3 >= value
+                         || listItem[index].Bonus4Type == skillDol && listItem[index].Bonus4 >= value
+                         || listItem[index].Bonus5Type == skillDol && listItem[index].Bonus5 >= value
+                         || listItem[index].Bonus6Type == skillDol && listItem[index].Bonus6 >= value
+                         || listItem[index].Bonus7Type == skillDol && listItem[index].Bonus7 >= value
+                         || listItem[index].Bonus8Type == skillDol && listItem[index].Bonus8 >= value
+                         || listItem[index].Bonus9Type == skillDol && listItem[index].Bonus9 >= value
+                         || listItem[index].Bonus10Type == skillDol && listItem[index].Bonus10 >= value
+                         || listItem[index].ExtraBonusType == skillDol && listItem[index].ExtraBonus >= value)
+                            Xskill = true;
+                    }
+
+                    if (!Xresist)
+                    {
+                        if (listItem[index].Bonus1Type == resistDol && listItem[index].Bonus1 >= value
+                         || listItem[index].Bonus2Type == resistDol && listItem[index].Bonus2 >= value
+                         || listItem[index].Bonus3Type == resistDol && listItem[index].Bonus3 >= value
+                         || listItem[index].Bonus4Type == resistDol && listItem[index].Bonus4 >= value
+                         || listItem[index].Bonus5Type == resistDol && listItem[index].Bonus5 >= value
+                         || listItem[index].Bonus6Type == resistDol && listItem[index].Bonus6 >= value
+                         || listItem[index].Bonus7Type == resistDol && listItem[index].Bonus7 >= value
+                         || listItem[index].Bonus8Type == resistDol && listItem[index].Bonus8 >= value
+                         || listItem[index].Bonus9Type == resistDol && listItem[index].Bonus9 >= value
+                         || listItem[index].Bonus10Type == resistDol && listItem[index].Bonus10 >= value
+                         || listItem[index].ExtraBonusType == resistDol && listItem[index].ExtraBonus >= value)
+                            Xresist = true;
+                    }
+
+                    if (Xfilter && Xproc && XarmorType && XqtyMin && XqtyMax && Xslot && Xbonus && XdamageType && XlevelMin && XlevelMax && Xvisual && Xskill && Xresist)
+                        list.Add(items[index]);
+
+                    index++;
+                }
+                while (index < listItem.Count);
+
+                int ItemsOnPage = page < (int)Math.Ceiling((double)list.Count / 20) ? 20 : list.Count % 20;
+
+                if (ItemsOnPage > 0)
+                {
+                    int ItemCount = list.Count;
+                    int PageCount = (int)Math.Ceiling((double)ItemCount / 20) - 1;
+                    client.Player.Out.SendMarketExplorerWindow(list, (byte)page, (byte)PageCount);
+                    client.Player.Out.SendMessage(ItemsOnPage.ToString() + " Results found for page " + (page) + ".", eChatType.CT_Important, eChatLoc.CL_ChatWindow);
+                }
+                else
+                    client.Player.Out.SendMessage("No Items found", eChatType.CT_Important, eChatLoc.CL_ChatWindow);
             }
-            else
-                client.Player.Out.SendMessage("No Items found", eChatType.CT_Important, eChatLoc.CL_ChatWindow);
+            //log.Warn (" -------------------------------------- "  );
+            //log.Warn (" filter "+ filter );
+            //log.Warn (" slot "+ slot );
+            //log.Warn (" skill "+ skill );
+            //log.Warn (" resist "+ resist );
+            //log.Warn (" bonus "+ bonus );
+            //log.Warn (" value "+ value );
+            //log.Warn (" power "+ power );
+            //log.Warn (" proc "+ proc );
+            //log.Warn (" qtyMin "+ qtyMin );
+            //log.Warn (" qtyMax "+ qtyMax );
+            //log.Warn (" levelMin "+ levelMin );
+            //log.Warn (" levelMax "+ levelMax );
+            //log.Warn (" priceMin "+ priceMin );
+            //log.Warn (" priceMax "+ priceMax );
+            //log.Warn (" visual "+ visual );
+            //log.Warn (" page "+ page );
+            //log.Warn (" unk1 "+ unk1);
+            //log.Warn (" unk2 "+ unk2 );
+            //log.Warn (" armorType " + armorType);
+            //log.Warn (" damageType "+ damageType );
+            /*   //log.Warn (" unk3 "+ unk3 );
+                //log.Warn (" unk4 "+ unk4 );
+                //log.Warn (" unk5 "+ unk5 );
+            */
+            //log.Warn (" playerCrafted "+ playerCrafted );
+            /*   //log.Warn (" unk6 "+ unk6 );
+                //log.Warn (" unk7 "+ unk7 );
+                //log.Warn (" unk8 "+ unk8 );
+            */
+            //log.Warn (" unknown "+ unknown );
+            //log.Warn (" unknown2 "+ unknown2 );
+            //log.Warn (" unknown3 "+ unknown3 );   
+
+            //log.Warn (" ---------------------------------------- "  );
+
             return 1;
         }
     }
-}
\ No newline at end of file
+}
\ No newline at end of file
Index: trunk/GameServer/packets/Client/168/PlayerMoveItemRequestHandler.cs
===================================================================
--- trunk/GameServer/packets/Client/168/PlayerMoveItemRequestHandler.cs   (revision 2544)
+++ trunk/GameServer/packets/Client/168/PlayerMoveItemRequestHandler.cs   (working copy)
@@ -20,6 +20,7 @@
 using DOL.Database;
 using DOL.Events;
 using DOL.GS;
+using DOL.GS.PacketHandler;
 using System.Reflection;
 using log4net;
 using DOL.Language;
@@ -323,14 +324,21 @@
             if (!(client.Player.TargetObject is MarketExplorer))
                return 0;
 
-            var list = client.Player.TempProperties.getProperty<List<InventoryItem>>(PlayerMarketSearchRequestHandler.EXPLORER_LIST, null);
-            if (list == null)
-               return 0;
-
+            //var list = client.Player.TempProperties.getProperty<List<InventoryItem>>(PlayerMarketSearchRequestHandler.EXPLORER_LIST, null);
+            List<InventoryItem> list = new List<InventoryItem>();
+            var obj = GameServer.Database.SelectObjects<InventoryItem>(Client.v168.PlayerMarketSearchRequestHandler.EXPLORER_LIST);
+            foreach (InventoryItem itm in obj)
+            {
+               list.Add(itm);
+            }
+                if (list == null)
+                {
+                    return 0;
+                }
             var me = client.Player.TargetObject as MarketExplorer;
 
-            int itemnr = fromSlot - (int)eInventorySlot.MarketExplorerFirst;
-
+            //int itemnr = fromSlot - (int)eInventorySlot.MarketExplorerFirst;
+                int itemnr = (fromSlot + ((int)PacketLib168.MarketExplorerPage * 20)) - (int)eInventorySlot.MarketExplorerFirst;
             InventoryItem item = list[itemnr];
 
             me.BuyItem(item, client.Player);
Index: trunk/GameServer/packets/Client/168/PlayerSetMarketPrice.cs
===================================================================
--- trunk/GameServer/packets/Client/168/PlayerSetMarketPrice.cs   (revision 2544)
+++ trunk/GameServer/packets/Client/168/PlayerSetMarketPrice.cs   (working copy)
@@ -42,7 +42,8 @@
             ushort unk2 = packet.ReadShort();
             uint price = packet.ReadInt();
             GameConsignmentMerchant con = client.Player.ActiveConMerchant;
-            House house = HouseMgr.GetHouse(con.HouseNumber);
+            // House house = HouseMgr.GetHouse(con.HouseNumber);
+            House house = HouseMgr.GetHouseByPlayer(client.Player);//HouseMgr.GetHouse(con.HouseNumber);
             if (house == null)
                 return 0;
             if (!house.HasOwnerPermissions(client.Player))
@@ -55,13 +56,12 @@
                 GameServer.Database.SaveObject(item);
             }
             else
-            {
-                client.Player.TempProperties.setProperty(NEW_PRICE, (int)price);
-            }
-
-            // another update required here,currently the player needs to reopen the window to see the price, thats why we msg him
-            client.Out.SendMessage("New price set! (open the merchant window again to see the price)", eChatType.CT_System, eChatLoc.CL_SystemWindow);
-            return 1;
-        }
+           
+       client.Out.SendMessage("New price set!", eChatType.CT_System, eChatLoc.CL_SystemWindow);
+            GameConsignmentMerchant consign = HouseMgr.GetConsignmentByHouseNumber((int)item.OwnerLot);
+         client.Out.SendInventoryItemsUpdate(consign.ConInventory, 0x06);
+         consign.Interact(client.Player);
+         return 1;
+       }
     }
 }
\ No newline at end of file
Index: trunk/GameServer/packets/Server/PacketLib168.cs
===================================================================
--- trunk/GameServer/packets/Server/PacketLib168.cs   (revision 2544)
+++ trunk/GameServer/packets/Server/PacketLib168.cs   (working copy)
@@ -2179,17 +2179,17 @@
       {
          IList spelllines = m_gameClient.Player.GetSpellLines();
          byte linenumber = 0;
-         // by stexx78 - Changed bool var name to isPureTank because hybrid are handled totally in SendUpdatePlayerSkills()
-         bool isPureTank = true;
+
+         bool isHybrid = true;
          if (m_gameClient.Player.CharacterClass.ClassType == eClassType.ListCaster)
-            isPureTank = false;
+            isHybrid = false;
 
          lock (spelllines.SyncRoot)
          {
             foreach (SpellLine line in spelllines)
             {
-               // For Puretank only send the advanced spell lines here
-               if (isPureTank && m_gameClient.Player.IsAdvancedSpellLine(line) == false)
+               // for hybrids only send the advanced spell lines here
+               if (isHybrid && m_gameClient.Player.IsAdvancedSpellLine(line) == false)
                   continue;
 
                // make a copy
@@ -3401,7 +3401,12 @@
             SendTCP(pak);
          }
       }
-
+        protected static byte m_marketexplorerpage;
+      public static byte MarketExplorerPage
+      {
+         get { return m_marketexplorerpage; }
+         set { m_marketexplorerpage = value; }
+      }
       public virtual void SendMarketExplorerWindow(IList<InventoryItem> items, byte page, byte maxpage)
       {
          using (var pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.MarketExplorerWindow)))
@@ -3413,17 +3418,24 @@
 
             InventoryItem item;
 
-            int lastindex = 19 + (page*20);
-            for (int index = 0 + (page*20); index < lastindex; index++)
-            {
+            int i = 0;
+            int index = 0;
+                int lastindex = 19 + (page*20);
+            //for (int index = 0 + (page*20); index < lastindex; index++)
+            if (page >= maxpage)
+               page = maxpage;
+            
+            do
+                {
                if (items[index] != null)
                {
-                  item = items[index];
-                  pak.WriteByte((byte) index);
-                  pak.WriteByte((byte) item.Level);
-                  int value1; // some object types use this field to display count
-                  int value2; // some object types use this field to display count
-                  switch (item.Object_Type)
+                  //item = items[index];
+               item = items[index + page*20];
+               pak.WriteByte((byte) index);
+               pak.WriteByte((byte) item.Level);
+               int value1 = 0; // some object types use this field to display count
+               int value2 = 0; // some object types use this field to display count
+               switch (item.Object_Type)
                   {
                      case (int) eObjectType.Arrow:
                      case (int) eObjectType.Bolt:
@@ -3495,7 +3507,15 @@
                         pak.WritePascalString(item.Name);
                   }
                }
-            }
+            i++;
+               index++;
+               
+               if (index + page*20 == items.Count )
+                  i = 20;
+                }
+            while (i < 20);
+            
+            m_marketexplorerpage = page;
 
             SendTCP(pak);
          }
@@ -3569,9 +3589,9 @@
             pak.WriteByte((byte)Money.GetCopper(copper));
             pak.WriteByte((byte)Money.GetSilver(copper));
             pak.WriteShort((ushort)Money.GetGold(copper));
-            pak.WriteShort((ushort)Money.GetPlatinum(copper));
             pak.WriteShort((ushort)Money.GetMithril(copper));
-            SendTCP(pak);
+                pak.WriteShort((ushort)Money.GetPlatinum(copper)); // Bugfix for Platin is Platin for selled items!
+                SendTCP(pak);
          }
       }
 
 



I used it on Brotherland have Fun with it!
Market_explorer.patch
Market Explorer Patch for Revison 2544 based on first Patch with sell fix
(44.88 KiB) Downloaded 21 times
Brotherland Final RvR/PvE/ToA http://brotherland.phpbb8.de/
User avatar
elcotek
Server Representative
 
Posts: 177
Joined: Mon May 12, 2008 9:28 pm
Website: http://brotherland-2.de
Location: Germany

Re: ERROR: MarketExplorer

Postby Urza » Sat Aug 28, 2010 4:12 am

Hi elcotek,
thanks for your help.

greetings urza
User avatar
Urza
Developer
 
Posts: 671
Joined: Sun Jan 23, 2005 11:15 am
Website: http://www.juwesch.eu
Location: Germany/Delitzsch

Re: ERROR: MarketExplorer

Postby Graveen » Sat Aug 28, 2010 7:42 am

Thank you Elcotek, this is an heavy patch, i'll take time to review.
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: ERROR: MarketExplorer

Postby Graveen » Sun Sep 05, 2010 12:49 pm

Elcotek, can you light me on what this patch is doing ? thank you !
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: ERROR: MarketExplorer

Postby elcotek » Sun Sep 05, 2010 9:21 pm

Hello, :wink:
After you have patch you can all items from Consigment Merchants list for sell on an Maket Explorer.
You can all items search on market explorer and will list with prize and Housenumbers to buy.
1. you need new client versions with new explorer window to use it 1.101 + i think, i have testet with 1.102
2. you can't see Item Stats on market exploer yet
3. in the moment consigment Merchant save not in the unqueitem template
4. all items will list in the moment on and from all Realms
Brotherland Final RvR/PvE/ToA http://brotherland.phpbb8.de/
User avatar
elcotek
Server Representative
 
Posts: 177
Joined: Mon May 12, 2008 9:28 pm
Website: http://brotherland-2.de
Location: Germany

Re: ERROR: MarketExplorer

Postby Graveen » Mon Sep 27, 2010 5:49 pm

Ok, thank you. Hard to say if i 'll include it for now.
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: ERROR: MarketExplorer

Postby Tolakram » Mon Sep 27, 2010 5:50 pm

Hard to test since Storm has it's own custom market explorer and moveitem handler.
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: ERROR: MarketExplorer

Postby Graveen » Mon Sep 27, 2010 6:04 pm

Yes and the AllowAdd = true in Inventory constructor can lead to bugs.
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: ERROR: MarketExplorer

Postby Tolakram » Mon Sep 27, 2010 6:10 pm

The real solution for the Market Explorer is like I created for Storm. You need to create a MarketCache which holds all of the items on the market and search the cache rather than searching inventory directly. Once the items are in a memory cache then re-write all the search routines to look through the cache to find what's needed. On storm I have not finished all the search routines and we only support a few of the easier searches. Of course on Storm we have a Market and this isn't tied into housing at all.
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA


Return to “%s” DOL Code Contributions

Who is online

Users browsing this forum: No registered users and 1 guest