OregonCore  revision fb2a440-git
Your Favourite TBC server
AuctionHouseBot.h
Go to the documentation of this file.
1 /*
2  * This file is part of the OregonCore Project. See AUTHORS file for Copyright information
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the
6  * Free Software Foundation; either version 2 of the License, or (at your
7  * option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef AUCTION_HOUSE_BOT_H
19 #define AUCTION_HOUSE_BOT_H
20 
21 #include "World.h"
22 #include "ObjectMgr.h"
23 #include "Config/Config.h"
24 #include "ItemPrototype.h"
25 #include "Utilities/Util.h"
26 
27 #define AHB_GREY 0
28 #define AHB_WHITE 1
29 #define AHB_GREEN 2
30 #define AHB_BLUE 3
31 #define AHB_PURPLE 4
32 #define AHB_ORANGE 5
33 #define AHB_YELLOW 6
34 #define AHB_MAX_QUALITY 6
35 #define AHB_GREY_TG 0
36 #define AHB_WHITE_TG 1
37 #define AHB_GREEN_TG 2
38 #define AHB_BLUE_TG 3
39 #define AHB_PURPLE_TG 4
40 #define AHB_ORANGE_TG 5
41 #define AHB_YELLOW_TG 6
42 #define AHB_GREY_I 7
43 #define AHB_WHITE_I 8
44 #define AHB_GREEN_I 9
45 #define AHB_BLUE_I 10
46 #define AHB_PURPLE_I 11
47 #define AHB_ORANGE_I 12
48 #define AHB_YELLOW_I 13
49 
50 class AHBConfig
51 {
52  private:
106 
116 
131 
139 
147 
148  std::set<uint32> ignoreItemsIds;
149 
150  public:
152  {
153  AHID = ahid;
154  switch (ahid)
155  {
156  case 2:
157  AHFID = 55;
158  break;
159  case 6:
160  AHFID = 29;
161  break;
162  case 7:
163  AHFID = 120;
164  break;
165  default:
166  AHFID = 120;
167  break;
168  }
169  }
171  {
172  }
174  {
175  return AHID;
176  }
178  {
179  return AHFID;
180  }
182  {
183  minItems = value;
184  }
186  {
187  if ((minItems == 0) && (maxItems))
188  return maxItems;
189  else if ((maxItems) && (minItems > maxItems))
190  return maxItems;
191  else
192  return minItems;
193  }
195  {
196  maxItems = value;
197  }
199  {
200  return maxItems;
201  }
202  void SetPercentages(uint32 greytg, uint32 whitetg, uint32 greentg, uint32 bluetg, uint32 purpletg, uint32 orangetg, uint32 yellowtg, uint32 greyi, uint32 whitei, uint32 greeni, uint32 bluei, uint32 purplei, uint32 orangei, uint32 yellowi)
203  {
204  uint32 totalPercent = greytg + whitetg + greentg + bluetg + purpletg + orangetg + yellowtg + greyi + whitei + greeni + bluei + purplei + orangei + yellowi;
205 
206  if (totalPercent == 0)
207  maxItems = 0;
208  else if (totalPercent != 100)
209  {
210  greytg = 0;
211  whitetg = 27;
212  greentg = 12;
213  bluetg = 10;
214  purpletg = 1;
215  orangetg = 0;
216  yellowtg = 0;
217  greyi = 0;
218  whitei = 10;
219  greeni = 30;
220  bluei = 8;
221  purplei = 2;
222  orangei = 0;
223  yellowi = 0;
224  }
225  percentGreyTradeGoods = greytg;
226  percentWhiteTradeGoods = whitetg;
227  percentGreenTradeGoods = greentg;
228  percentBlueTradeGoods = bluetg;
229  percentPurpleTradeGoods = purpletg;
230  percentOrangeTradeGoods = orangetg;
231  percentYellowTradeGoods = yellowtg;
232  percentGreyItems = greyi;
233  percentWhiteItems = whitei;
234  percentGreenItems = greeni;
235  percentBlueItems = bluei;
236  percentPurpleItems = purplei;
237  percentOrangeItems = orangei;
238  percentYellowItems = yellowi;
240  }
242  {
243  switch (color)
244  {
245  case AHB_GREY_TG:
246  return percentGreyTradeGoods;
247  break;
248  case AHB_WHITE_TG:
249  return percentWhiteTradeGoods;
250  break;
251  case AHB_GREEN_TG:
252  return percentGreenTradeGoods;
253  break;
254  case AHB_BLUE_TG:
255  return percentBlueTradeGoods;
256  break;
257  case AHB_PURPLE_TG:
259  break;
260  case AHB_ORANGE_TG:
262  break;
263  case AHB_YELLOW_TG:
265  break;
266  case AHB_GREY_I:
267  return percentGreyItems;
268  break;
269  case AHB_WHITE_I:
270  return percentWhiteItems;
271  break;
272  case AHB_GREEN_I:
273  return percentGreenItems;
274  break;
275  case AHB_BLUE_I:
276  return percentBlueItems;
277  break;
278  case AHB_PURPLE_I:
279  return percentPurpleItems;
280  break;
281  case AHB_ORANGE_I:
282  return percentOrangeItems;
283  break;
284  case AHB_YELLOW_I:
285  return percentYellowItems;
286  break;
287  default:
288  return 0;
289  break;
290  }
291  }
293  {
294  switch (color)
295  {
296  case AHB_GREY:
297  minPriceGrey = value;
298  break;
299  case AHB_WHITE:
300  minPriceWhite = value;
301  break;
302  case AHB_GREEN:
303  minPriceGreen = value;
304  break;
305  case AHB_BLUE:
306  minPriceBlue = value;
307  break;
308  case AHB_PURPLE:
309  minPricePurple = value;
310  break;
311  case AHB_ORANGE:
312  minPriceOrange = value;
313  break;
314  case AHB_YELLOW:
315  minPriceYellow = value;
316  break;
317  default:
318  break;
319  }
320  }
322  {
323  switch (color)
324  {
325  case AHB_GREY:
326  {
327  if (minPriceGrey == 0)
328  return 100;
329  else if (minPriceGrey > maxPriceGrey)
330  return maxPriceGrey;
331  else
332  return minPriceGrey;
333  break;
334  }
335  case AHB_WHITE:
336  {
337  if (minPriceWhite == 0)
338  return 150;
339  else if (minPriceWhite > maxPriceWhite)
340  return maxPriceWhite;
341  else
342  return minPriceWhite;
343  break;
344  }
345  case AHB_GREEN:
346  {
347  if (minPriceGreen == 0)
348  return 200;
349  else if (minPriceGreen > maxPriceGreen)
350  return maxPriceGreen;
351  else
352  return minPriceGreen;
353  break;
354  }
355  case AHB_BLUE:
356  {
357  if (minPriceBlue == 0)
358  return 250;
359  else if (minPriceBlue > maxPriceBlue)
360  return maxPriceBlue;
361  else
362  return minPriceBlue;
363  break;
364  }
365  case AHB_PURPLE:
366  {
367  if (minPricePurple == 0)
368  return 300;
369  else if (minPricePurple > maxPricePurple)
370  return maxPricePurple;
371  else
372  return minPricePurple;
373  break;
374  }
375  case AHB_ORANGE:
376  {
377  if (minPriceOrange == 0)
378  return 400;
379  else if (minPriceOrange > maxPriceOrange)
380  return maxPriceOrange;
381  else
382  return minPriceOrange;
383  break;
384  }
385  case AHB_YELLOW:
386  {
387  if (minPriceYellow == 0)
388  return 500;
389  else if (minPriceYellow > maxPriceYellow)
390  return maxPriceYellow;
391  else
392  return minPriceYellow;
393  break;
394  }
395  default:
396  {
397  return 0;
398  break;
399  }
400  }
401  }
403  {
404  switch (color)
405  {
406  case AHB_GREY:
407  maxPriceGrey = value;
408  break;
409  case AHB_WHITE:
410  maxPriceWhite = value;
411  break;
412  case AHB_GREEN:
413  maxPriceGreen = value;
414  break;
415  case AHB_BLUE:
416  maxPriceBlue = value;
417  break;
418  case AHB_PURPLE:
419  maxPricePurple = value;
420  break;
421  case AHB_ORANGE:
422  maxPriceOrange = value;
423  break;
424  case AHB_YELLOW:
425  maxPriceYellow = value;
426  break;
427  default:
428  break;
429  }
430  }
432  {
433  switch (color)
434  {
435  case AHB_GREY:
436  {
437  if (maxPriceGrey == 0)
438  return 150;
439  else
440  return maxPriceGrey;
441  break;
442  }
443  case AHB_WHITE:
444  {
445  if (maxPriceWhite == 0)
446  return 250;
447  else
448  return maxPriceWhite;
449  break;
450  }
451  case AHB_GREEN:
452  {
453  if (maxPriceGreen == 0)
454  return 300;
455  else
456  return maxPriceGreen;
457  break;
458  }
459  case AHB_BLUE:
460  {
461  if (maxPriceBlue == 0)
462  return 350;
463  else
464  return maxPriceBlue;
465  break;
466  }
467  case AHB_PURPLE:
468  {
469  if (maxPricePurple == 0)
470  return 450;
471  else
472  return maxPricePurple;
473  break;
474  }
475  case AHB_ORANGE:
476  {
477  if (maxPriceOrange == 0)
478  return 550;
479  else
480  return maxPriceOrange;
481  break;
482  }
483  case AHB_YELLOW:
484  {
485  if (maxPriceYellow == 0)
486  return 650;
487  else
488  return maxPriceYellow;
489  break;
490  }
491  default:
492  {
493  return 0;
494  break;
495  }
496  }
497  }
499  {
500  switch (color)
501  {
502  case AHB_GREY:
503  minBidPriceGrey = value;
504  break;
505  case AHB_WHITE:
506  minBidPriceWhite = value;
507  break;
508  case AHB_GREEN:
509  minBidPriceGreen = value;
510  break;
511  case AHB_BLUE:
512  minBidPriceBlue = value;
513  break;
514  case AHB_PURPLE:
515  minBidPricePurple = value;
516  break;
517  case AHB_ORANGE:
518  minBidPriceOrange = value;
519  break;
520  case AHB_YELLOW:
521  minBidPriceYellow = value;
522  break;
523  default:
524  break;
525  }
526  }
528  {
529  switch (color)
530  {
531  case AHB_GREY:
532  {
533  if (minBidPriceGrey > 100)
534  return 100;
535  else
536  return minBidPriceGrey;
537  break;
538  }
539  case AHB_WHITE:
540  {
541  if (minBidPriceWhite > 100)
542  return 100;
543  else
544  return minBidPriceWhite;
545  break;
546  }
547  case AHB_GREEN:
548  {
549  if (minBidPriceGreen > 100)
550  return 100;
551  else
552  return minBidPriceGreen;
553  break;
554  }
555  case AHB_BLUE:
556  {
557  if (minBidPriceBlue > 100)
558  return 100;
559  else
560  return minBidPriceBlue;
561  break;
562  }
563  case AHB_PURPLE:
564  {
565  if (minBidPricePurple > 100)
566  return 100;
567  else
568  return minBidPricePurple;
569  break;
570  }
571  case AHB_ORANGE:
572  {
573  if (minBidPriceOrange > 100)
574  return 100;
575  else
576  return minBidPriceOrange;
577  break;
578  }
579  case AHB_YELLOW:
580  {
581  if (minBidPriceYellow > 100)
582  return 100;
583  else
584  return minBidPriceYellow;
585  break;
586  }
587  default:
588  {
589  return 0;
590  break;
591  }
592  }
593  }
595  {
596  switch (color)
597  {
598  case AHB_GREY:
599  maxBidPriceGrey = value;
600  break;
601  case AHB_WHITE:
602  maxBidPriceWhite = value;
603  break;
604  case AHB_GREEN:
605  maxBidPriceGreen = value;
606  break;
607  case AHB_BLUE:
608  maxBidPriceBlue = value;
609  break;
610  case AHB_PURPLE:
611  maxBidPricePurple = value;
612  break;
613  case AHB_ORANGE:
614  maxBidPriceOrange = value;
615  break;
616  case AHB_YELLOW:
617  maxBidPriceYellow = value;
618  break;
619  default:
620  break;
621  }
622  }
624  {
625  switch (color)
626  {
627  case AHB_GREY:
628  {
629  if (maxBidPriceGrey > 100)
630  return 100;
631  else
632  return maxBidPriceGrey;
633  break;
634  }
635  case AHB_WHITE:
636  {
637  if (maxBidPriceWhite > 100)
638  return 100;
639  else
640  return maxBidPriceWhite;
641  break;
642  }
643  case AHB_GREEN:
644  {
645  if (maxBidPriceGreen > 100)
646  return 100;
647  else
648  return maxBidPriceGreen;
649  break;
650  }
651  case AHB_BLUE:
652  {
653  if (maxBidPriceBlue > 100)
654  return 100;
655  else
656  return maxBidPriceBlue;
657  break;
658  }
659  case AHB_PURPLE:
660  {
661  if (maxBidPricePurple > 100)
662  return 100;
663  else
664  return maxBidPricePurple;
665  break;
666  }
667  case AHB_ORANGE:
668  {
669  if (maxBidPriceOrange > 100)
670  return 100;
671  else
672  return maxBidPriceOrange;
673  break;
674  }
675  case AHB_YELLOW:
676  {
677  if (maxBidPriceYellow > 100)
678  return 100;
679  else
680  return maxBidPriceYellow;
681  break;
682  }
683  default:
684  {
685  return 0;
686  break;
687  }
688  }
689  }
691  {
692  switch (color)
693  {
694  case AHB_GREY:
695  maxStackGrey = value;
696  break;
697  case AHB_WHITE:
698  maxStackWhite = value;
699  break;
700  case AHB_GREEN:
701  maxStackGreen = value;
702  break;
703  case AHB_BLUE:
704  maxStackBlue = value;
705  break;
706  case AHB_PURPLE:
707  maxStackPurple = value;
708  break;
709  case AHB_ORANGE:
710  maxStackOrange = value;
711  break;
712  case AHB_YELLOW:
713  maxStackYellow = value;
714  break;
715  default:
716  break;
717  }
718  }
720  {
721  switch (color)
722  {
723  case AHB_GREY:
724  {
725  return maxStackGrey;
726  break;
727  }
728  case AHB_WHITE:
729  {
730  return maxStackWhite;
731  break;
732  }
733  case AHB_GREEN:
734  {
735  return maxStackGreen;
736  break;
737  }
738  case AHB_BLUE:
739  {
740  return maxStackBlue;
741  break;
742  }
743  case AHB_PURPLE:
744  {
745  return maxStackPurple;
746  break;
747  }
748  case AHB_ORANGE:
749  {
750  return maxStackOrange;
751  break;
752  }
753  case AHB_YELLOW:
754  {
755  return maxStackYellow;
756  break;
757  }
758  default:
759  {
760  return 0;
761  break;
762  }
763  }
764  }
766  {
767  switch (color)
768  {
769  case AHB_GREY:
770  buyerPriceGrey = value;
771  break;
772  case AHB_WHITE:
773  buyerPriceWhite = value;
774  break;
775  case AHB_GREEN:
776  buyerPriceGreen = value;
777  break;
778  case AHB_BLUE:
779  buyerPriceBlue = value;
780  break;
781  case AHB_PURPLE:
782  buyerPricePurple = value;
783  break;
784  case AHB_ORANGE:
785  buyerPriceOrange = value;
786  break;
787  case AHB_YELLOW:
788  buyerPriceYellow = value;
789  break;
790  default:
791  break;
792  }
793  }
795  {
796  switch (color)
797  {
798  case AHB_GREY:
799  return buyerPriceGrey;
800  break;
801  case AHB_WHITE:
802  return buyerPriceWhite;
803  break;
804  case AHB_GREEN:
805  return buyerPriceGreen;
806  break;
807  case AHB_BLUE:
808  return buyerPriceBlue;
809  break;
810  case AHB_PURPLE:
811  return buyerPricePurple;
812  break;
813  case AHB_ORANGE:
814  return buyerPriceOrange;
815  break;
816  case AHB_YELLOW:
817  return buyerPriceYellow;
818  break;
819  default:
820  return 0;
821  break;
822  }
823  }
825  {
826  buyerBiddingInterval = value;
827  }
829  {
830  return buyerBiddingInterval;
831  }
833  {
834  greytgp = (uint32) (((double)percentGreyTradeGoods / 100.0) * maxItems);
835  whitetgp = (uint32) (((double)percentWhiteTradeGoods / 100.0) * maxItems);
836  greentgp = (uint32) (((double)percentGreenTradeGoods / 100.0) * maxItems);
837  bluetgp = (uint32) (((double)percentBlueTradeGoods / 100.0) * maxItems);
838  purpletgp = (uint32) (((double)percentPurpleTradeGoods / 100.0) * maxItems);
839  orangetgp = (uint32) (((double)percentOrangeTradeGoods / 100.0) * maxItems);
840  yellowtgp = (uint32) (((double)percentYellowTradeGoods / 100.0) * maxItems);
841  greyip = (uint32) (((double)percentGreyItems / 100.0) * maxItems);
842  whiteip = (uint32) (((double)percentWhiteItems / 100.0) * maxItems);
843  greenip = (uint32) (((double)percentGreenItems / 100.0) * maxItems);
844  blueip = (uint32) (((double)percentBlueItems / 100.0) * maxItems);
845  purpleip = (uint32) (((double)percentPurpleItems / 100.0) * maxItems);
846  orangeip = (uint32) (((double)percentOrangeItems / 100.0) * maxItems);
847  yellowip = (uint32) (((double)percentYellowItems / 100.0) * maxItems);
848  uint32 total = greytgp + whitetgp + greentgp + bluetgp + purpletgp + orangetgp + yellowtgp + greyip + whiteip + greenip + blueip + purpleip + orangeip + yellowip;
849  int32 diff = (maxItems - total);
850  if (diff < 0)
851  {
852  if ((whiteip - diff) > 0)
853  whiteip -= diff;
854  else if ((greenip - diff) > 0)
855  greenip -= diff;
856  }
857  else if (diff > 0)
858  whiteip += diff;
859  }
861  {
862  switch (color)
863  {
864  case AHB_GREY_TG:
865  return greytgp;
866  break;
867  case AHB_WHITE_TG:
868  return whitetgp;
869  break;
870  case AHB_GREEN_TG:
871  return greentgp;
872  break;
873  case AHB_BLUE_TG:
874  return bluetgp;
875  break;
876  case AHB_PURPLE_TG:
877  return purpletgp;
878  break;
879  case AHB_ORANGE_TG:
880  return orangetgp;
881  break;
882  case AHB_YELLOW_TG:
883  return yellowtgp;
884  break;
885  case AHB_GREY_I:
886  return greyip;
887  break;
888  case AHB_WHITE_I:
889  return whiteip;
890  break;
891  case AHB_GREEN_I:
892  return greenip;
893  break;
894  case AHB_BLUE_I:
895  return blueip;
896  break;
897  case AHB_PURPLE_I:
898  return purpleip;
899  break;
900  case AHB_ORANGE_I:
901  return orangeip;
902  break;
903  case AHB_YELLOW_I:
904  return yellowip;
905  break;
906  default:
907  return 0;
908  break;
909  }
910  }
911 
912  void DecItemCounts(uint32 Class, uint32 Quality)
913  {
914  switch (Class)
915  {
917  DecItemCounts(Quality);
918  break;
919  default:
920  DecItemCounts(Quality + 7);
921  break;
922  }
923  }
924 
925  void DecItemCounts(uint32 color)
926  {
927  switch (color)
928  {
929  case AHB_GREY_TG:
930  --greyTGoods;
931  break;
932  case AHB_WHITE_TG:
933  --whiteTGoods;
934  break;
935  case AHB_GREEN_TG:
936  --greenTGoods;
937  break;
938  case AHB_BLUE_TG:
939  --blueTGoods;
940  break;
941  case AHB_PURPLE_TG:
942  --purpleTGoods;
943  break;
944  case AHB_ORANGE_TG:
945  --orangeTGoods;
946  break;
947  case AHB_YELLOW_TG:
948  --yellowTGoods;
949  break;
950  case AHB_GREY_I:
951  --greyItems;
952  break;
953  case AHB_WHITE_I:
954  --whiteItems;
955  break;
956  case AHB_GREEN_I:
957  --greenItems;
958  break;
959  case AHB_BLUE_I:
960  --blueItems;
961  break;
962  case AHB_PURPLE_I:
963  --purpleItems;
964  break;
965  case AHB_ORANGE_I:
966  --orangeItems;
967  break;
968  case AHB_YELLOW_I:
969  --yellowItems;
970  break;
971  default:
972  break;
973  }
974  }
975 
976  void IncItemCounts(uint32 Class, uint32 Quality)
977  {
978  switch (Class)
979  {
981  IncItemCounts(Quality);
982  break;
983  default:
984  IncItemCounts(Quality + 7);
985  break;
986  }
987  }
988 
989  void IncItemCounts(uint32 color)
990  {
991  switch (color)
992  {
993  case AHB_GREY_TG:
994  ++greyTGoods;
995  break;
996  case AHB_WHITE_TG:
997  ++whiteTGoods;
998  break;
999  case AHB_GREEN_TG:
1000  ++greenTGoods;
1001  break;
1002  case AHB_BLUE_TG:
1003  ++blueTGoods;
1004  break;
1005  case AHB_PURPLE_TG:
1006  ++purpleTGoods;
1007  break;
1008  case AHB_ORANGE_TG:
1009  ++orangeTGoods;
1010  break;
1011  case AHB_YELLOW_TG:
1012  ++yellowTGoods;
1013  break;
1014  case AHB_GREY_I:
1015  ++greyItems;
1016  break;
1017  case AHB_WHITE_I:
1018  ++whiteItems;
1019  break;
1020  case AHB_GREEN_I:
1021  ++greenItems;
1022  break;
1023  case AHB_BLUE_I:
1024  ++blueItems;
1025  break;
1026  case AHB_PURPLE_I:
1027  ++purpleItems;
1028  break;
1029  case AHB_ORANGE_I:
1030  ++orangeItems;
1031  break;
1032  case AHB_YELLOW_I:
1033  ++yellowItems;
1034  break;
1035  default:
1036  break;
1037  }
1038  }
1039 
1041  {
1042  greyTGoods = 0;
1043  whiteTGoods = 0;
1044  greenTGoods = 0;
1045  blueTGoods = 0;
1046  purpleTGoods = 0;
1047  orangeTGoods = 0;
1048  yellowTGoods = 0;
1049 
1050  greyItems = 0;
1051  whiteItems = 0;
1052  greenItems = 0;
1053  blueItems = 0;
1054  purpleItems = 0;
1055  orangeItems = 0;
1056  yellowItems = 0;
1057  }
1058 
1060  {
1061  return (
1062  greyTGoods +
1063  whiteTGoods +
1064  greenTGoods +
1065  blueTGoods +
1066  purpleTGoods +
1067  orangeTGoods +
1068  yellowTGoods +
1069 
1070  greyItems +
1071  whiteItems +
1072  greenItems +
1073  blueItems +
1074  purpleItems +
1075  orangeItems +
1076  yellowItems);
1077  }
1078 
1080  {
1081  switch (color)
1082  {
1083  case AHB_GREY_TG:
1084  return greyTGoods;
1085  break;
1086  case AHB_WHITE_TG:
1087  return whiteTGoods;
1088  break;
1089  case AHB_GREEN_TG:
1090  return greenTGoods;
1091  break;
1092  case AHB_BLUE_TG:
1093  return blueTGoods;
1094  break;
1095  case AHB_PURPLE_TG:
1096  return purpleTGoods;
1097  break;
1098  case AHB_ORANGE_TG:
1099  return orangeTGoods;
1100  break;
1101  case AHB_YELLOW_TG:
1102  return yellowTGoods;
1103  break;
1104  case AHB_GREY_I:
1105  return greyItems;
1106  break;
1107  case AHB_WHITE_I:
1108  return whiteItems;
1109  break;
1110  case AHB_GREEN_I:
1111  return greenItems;
1112  break;
1113  case AHB_BLUE_I:
1114  return blueItems;
1115  break;
1116  case AHB_PURPLE_I:
1117  return purpleItems;
1118  break;
1119  case AHB_ORANGE_I:
1120  return orangeItems;
1121  break;
1122  case AHB_YELLOW_I:
1123  return yellowItems;
1124  break;
1125  default:
1126  return 0;
1127  break;
1128  }
1129  }
1131  {
1132  buyerBidsPerInterval = value;
1133  }
1135  {
1136  return buyerBidsPerInterval;
1137  }
1138  void IgnoreItemsIds(const std::string& idsString)
1139  {
1140  const Tokens& ids = StrSplit(idsString, " ,");
1141  ignoreItemsIds.clear();
1142 
1143  for (Tokens::const_iterator it = ids.begin(); it != ids.end(); it++)
1144  if (uint32 id = atoi(it->c_str()))
1145  if (sObjectMgr.GetItemTemplate(id))
1146  ignoreItemsIds.insert(id);
1147  }
1148  bool IsIgnoringItem(uint32 id) const
1149  {
1150  return ignoreItemsIds.find(id) != ignoreItemsIds.end();
1151  }
1153  {
1154  }
1155 };
1157 {
1158  private:
1159 
1162 
1164  bool AHBBuyer;
1167 
1171 
1172  //Begin Filters
1173 
1178  bool Loot_TGs;
1180 
1181  bool No_Bind;
1186 
1196 
1208 
1225 
1226  //End Filters
1227 
1231 
1232  time_t _lastrun_a;
1233  time_t _lastrun_h;
1234  time_t _lastrun_n;
1235 
1237  {
1238  return a <= b ? a : b;
1239  };
1240  void addNewAuctions(Player* AHBplayer, AHBConfig* config);
1241  void addNewAuctionBuyerBotBid(Player* AHBplayer, AHBConfig* config, WorldSession* session);
1242 
1243  public:
1244  AuctionHouseBot();
1245  ~AuctionHouseBot();
1246  void Update();
1247  void Initialize();
1248  void LoadValues(AHBConfig*);
1249  void DecrementItemCounts(AuctionEntry* ah, uint32 item_template);
1250  void IncrementItemCounts(AuctionEntry* ah);
1251  void Commands(uint32, uint32, uint32, char*);
1253  {
1254  return AHBplayerGUID;
1255  };
1256 };
1257 
1258 #define auctionbot Oregon::Singleton<AuctionHouseBot>::Instance()
1259 
1260 #endif
1261 
uint32 DisableTGsAboveReqSkillRank
uint32 maxPriceBlue
#define AHB_YELLOW_TG
uint32 percentGreenTradeGoods
uint32 GetBiddingInterval()
uint32 GetBuyerPrice(uint32 color)
#define AHB_ORANGE_TG
uint32 maxStackGrey
uint32 maxStackBlue
#define AHB_PURPLE
uint32 minItems
std::set< uint32 > ignoreItemsIds
uint32 GetMaxItems()
uint32 yellowItems
uint32 minBidPriceYellow
uint32 maxPriceWhite
uint32 maxBidPricePurple
#define AHB_PURPLE_I
uint32 percentGreyItems
std::vector< std::string > Tokens
Definition: Util.h:26
uint32 maxPriceOrange
uint32 percentYellowTradeGoods
uint32 buyerPriceYellow
uint32 purpletgp
uint32 GetAHFID()
void SetMaxItems(uint32 value)
uint32 greyTGoods
#define AHB_WHITE_TG
uint32 GetItemCounts(uint32 color)
uint32 minPriceGrey
uint32 DisableTGsAboveReqLevel
uint32 whiteItems
uint32 orangetgp
uint32 purpleip
void SetMinItems(uint32 value)
void SetPercentages(uint32 greytg, uint32 whitetg, uint32 greentg, uint32 bluetg, uint32 purpletg, uint32 orangetg, uint32 yellowtg, uint32 greyi, uint32 whitei, uint32 greeni, uint32 bluei, uint32 purplei, uint32 orangei, uint32 yellowi)
uint32 DisableTGsBelowReqSkillRank
uint32 DisableItemsBelowGUID
void SetMinPrice(uint32 color, uint32 value)
bool DisableBOP_Or_Quest_NoReqLevel
uint32 yellowtgp
void DecItemCounts(uint32 color)
uint32 minPriceGreen
void SetBuyerPrice(uint32 color, uint32 value)
#define AHB_ORANGE
uint32 maxPriceGrey
uint32 DisableItemsAboveReqSkillRank
uint32 minBidPriceGrey
Tokens StrSplit(const std::string &src, const std::string &sep)
Definition: Util.cpp:58
ACE_INT32 int32
Definition: Define.h:67
uint32 minBidPriceBlue
uint32 buyerPriceOrange
uint32 percentGreyTradeGoods
void IncItemCounts(uint32 Class, uint32 Quality)
uint32 buyerPriceWhite
AHBConfig NeutralConfig
uint32 maxBidPriceWhite
uint32 DisableItemsBelowLevel
#define AHB_GREEN
uint32 maxPricePurple
uint32 whitetgp
uint32 maxBidPriceGrey
uint32 orangeTGoods
#define sObjectMgr
Definition: ObjectMgr.h:1285
uint32 buyerPriceGreen
#define AHB_GREEN_I
uint32 bluetgp
#define AHB_ORANGE_I
uint32 minBidPriceWhite
uint32 maxBidPriceOrange
void IncItemCounts(uint32 color)
#define AHB_BLUE_TG
uint32 minPriceBlue
uint32 GetMinBidPrice(uint32 color)
uint32 maxBidPriceGreen
uint32 minBidPriceOrange
uint32 whiteip
uint32 GetBidsPerInterval()
void SetBiddingInterval(uint32 value)
uint32 maxStackOrange
uint32 minValue(uint32 a, uint32 b)
uint32 maxStackPurple
uint32 GetPercentages(uint32 color)
uint32 purpleItems
uint32 purpleTGoods
uint32 orangeItems
#define AHB_GREY_TG
#define AHB_WHITE_I
uint32 AHFID
uint32 GetMaxStack(uint32 color)
#define AHB_GREY_I
void IgnoreItemsIds(const std::string &idsString)
void SetMaxStack(uint32 color, uint32 value)
uint32 GetAHBplayerGUID()
uint32 percentPurpleItems
uint32 maxStackYellow
void ResetItemCounts()
void SetBidsPerInterval(uint32 value)
void DecItemCounts(uint32 Class, uint32 Quality)
etc mysql my cnf *Then change max_allowed_packet to a bigger value
uint32 greenTGoods
AHBConfig AllianceConfig
uint32 GetMinPrice(uint32 color)
uint32 DisableItemsAboveLevel
uint32 minPriceYellow
uint32 DisableItemsBelowReqSkillRank
uint32 orangeip
uint32 maxPriceGreen
bool IsIgnoringItem(uint32 id) const
uint32 minBidPriceGreen
uint32 percentOrangeTradeGoods
uint32 percentPurpleTradeGoods
uint32 GetPercents(uint32 color)
void SetMaxBidPrice(uint32 color, uint32 value)
uint32 percentWhiteTradeGoods
uint32 percentYellowItems
uint32 buyerPriceGrey
uint32 maxPriceYellow
uint32 percentGreenItems
uint32 percentWhiteItems
#define AHB_BLUE
uint32 GetMinItems()
uint32 buyerBiddingInterval
uint32 buyerBidsPerInterval
uint32 TotalItemCounts()
uint32 buyerPriceBlue
uint32 GetAHID()
uint32 greentgp
uint32 DisableItemsBelowReqLevel
void SetMaxPrice(uint32 color, uint32 value)
uint32 greenItems
#define AHB_YELLOW
uint32 maxItems
uint32 yellowTGoods
uint32 percentBlueTradeGoods
uint32 GetMaxPrice(uint32 color)
uint32 blueTGoods
void CalculatePercents()
uint32 greenip
#define AHB_YELLOW_I
uint32 GetMaxBidPrice(uint32 color)
uint32 minPricePurple
#define AHB_BLUE_I
#define AHB_GREY
uint32 buyerPricePurple
uint32 blueItems
uint32 maxBidPriceYellow
uint32 minBidPricePurple
uint32 maxStackGreen
uint32 DisableItemsAboveGUID
uint32 percentBlueItems
#define AHB_WHITE
#define AHB_PURPLE_TG
uint32 DisableItemsAboveReqLevel
ACE_UINT32 uint32
Definition: Define.h:71
uint32 greyItems
uint32 yellowip
#define AHB_GREEN_TG
uint32 minPriceWhite
AHBConfig(uint32 ahid)
uint32 greytgp
uint32 DisableTGsBelowReqLevel
void SetMinBidPrice(uint32 color, uint32 value)
uint32 maxStackWhite
uint32 maxBidPriceBlue
Definition: Player.h:922
uint32 minPriceOrange
uint32 percentOrangeItems
uint32 whiteTGoods