HeroicOpDB.cpp 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. EQ2Emulator: Everquest II Server Emulator
  3. Copyright (C) 2007 EQ2EMulator Development Team (http://www.eq2emulator.net)
  4. This file is part of EQ2Emulator.
  5. EQ2Emulator is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 3 of the License, or
  8. (at your option) any later version.
  9. EQ2Emulator is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with EQ2Emulator. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #include "../WorldDatabase.h"
  17. #include "../../common/Log.h"
  18. #include "HeroicOp.h"
  19. extern MasterHeroicOPList master_ho_list;
  20. void WorldDatabase::LoadHOStarters() {
  21. Query query;
  22. MYSQL_ROW row;
  23. MYSQL_RES* result = query.RunQuery2(Q_SELECT, "SELECT `id`, `starter_class`, `starter_icon`, `ability1`, `ability2`, `ability3`, `ability4`, `ability5`, `ability6` FROM `heroic_ops` WHERE `ho_type`='Starter'");
  24. if (result && mysql_num_rows(result) > 0) {
  25. int32 count = 0;
  26. while ((row = mysql_fetch_row(result))) {
  27. HeroicOPStarter* starter = new HeroicOPStarter;
  28. starter->id = atoul(row[0]);
  29. starter->start_class = atoi(row[1]);
  30. starter->starter_icon = atoi(row[2]);
  31. starter->abilities[0] = atoi(row[3]);
  32. starter->abilities[1] = atoi(row[4]);
  33. starter->abilities[2] = atoi(row[5]);
  34. starter->abilities[3] = atoi(row[6]);
  35. starter->abilities[4] = atoi(row[7]);
  36. starter->abilities[5] = atoi(row[8]);
  37. master_ho_list.AddStarter(starter->start_class, starter);
  38. count++;
  39. }
  40. LogWrite(WORLD__INFO, 0, "World", "- Loaded %u starter chains", count);
  41. }
  42. }
  43. void WorldDatabase::LoadHOWheel() {
  44. Query query;
  45. MYSQL_ROW row;
  46. MYSQL_RES* result = query.RunQuery2(Q_SELECT, "SELECT `starter_link_id`, `chain_order`, `shift_icon`, `spell_id`, `chance`, `ability1`, `ability2`, `ability3`, `ability4`, `ability5`, `ability6` FROM `heroic_ops` WHERE `ho_type`='Wheel'");
  47. if (result && mysql_num_rows(result) > 0) {
  48. int32 count = 0;
  49. while ((row = mysql_fetch_row(result))) {
  50. HeroicOPWheel* wheel = new HeroicOPWheel;
  51. wheel->order = atoi(row[1]);
  52. wheel->shift_icon = atoi(row[2]);
  53. wheel->spell_id = atoul(row[3]);
  54. wheel->chance = atof(row[4]);
  55. wheel->abilities[0] = atoi(row[5]);
  56. wheel->abilities[1] = atoi(row[6]);
  57. wheel->abilities[2] = atoi(row[7]);
  58. wheel->abilities[3] = atoi(row[8]);
  59. wheel->abilities[4] = atoi(row[9]);
  60. wheel->abilities[5] = atoi(row[10]);
  61. master_ho_list.AddWheel(atoul(row[0]), wheel);
  62. count++;
  63. }
  64. LogWrite(WORLD__INFO, 0, "World", "- Loaded %u HO wheels", count);
  65. }
  66. }