Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.33 KB | None | 0 0
  1. diff --git a/playerbot/PlayerbotFactory.cpp b/playerbot/PlayerbotFactory.cpp
  2. index 06ca251..bc31f58 100644
  3. --- a/playerbot/PlayerbotFactory.cpp
  4. +++ b/playerbot/PlayerbotFactory.cpp
  5. @@ -1094,15 +1094,25 @@ void PlayerbotFactory::InitAvailableSpells()
  6. TrainerSpellState state = bot->GetTrainerSpellState(tSpell, reqLevel);
  7. if (state != TRAINER_SPELL_GREEN)
  8. continue;
  9. -
  10. +#ifdef MANGOS
  11. + SpellEntry const* proto = sSpellStore.LookupEntry(tSpell->spell);
  12. +#endif
  13. +#ifdef CMANGOS
  14. SpellEntry const* proto = sSpellTemplate.LookupEntry<SpellEntry>(tSpell->spell);
  15. +#endif
  16. +
  17. if (!proto)
  18. continue;
  19.  
  20. Spell* spell = new Spell(bot, proto, false);
  21. SpellCastTargets targets;
  22. targets.setUnitTarget(bot);
  23. +#ifdef MANGOS
  24. + spell->prepare(&targets);
  25. +#endif
  26. +#ifdef CMANGOS
  27. spell->SpellStart(&targets);
  28. +#endif
  29. }
  30. }
  31. }
  32. diff --git a/playerbot/RandomPlayerbotMgr.cpp b/playerbot/RandomPlayerbotMgr.cpp
  33. index b4cec44..ef516b0 100644
  34. --- a/playerbot/RandomPlayerbotMgr.cpp
  35. +++ b/playerbot/RandomPlayerbotMgr.cpp
  36. @@ -466,7 +466,12 @@ void RandomPlayerbotMgr::PrepareTeleportCache()
  37.  
  38. sLog.outBasic("Preparing RPG teleport caches for %d factions...", sFactionTemplateStore.GetNumRows());
  39. BarGoLink bar(rpgCacheSize);
  40. +#ifdef MANGOS
  41. + results = WorldDatabase.PQuery("SELECT map, position_x, position_y, position_z, t.FactionAlliance, t.Name "
  42. +#endif
  43. +#ifdef CMANGOS
  44. results = WorldDatabase.PQuery("SELECT map, position_x, position_y, position_z, t.Faction, t.Name "
  45. +#endif
  46. "from creature c inner join creature_template t on c.id = t.entry "
  47. "where t.NpcFlags & %u <> 0",
  48. UNIT_NPC_FLAG_INNKEEPER);
  49. @@ -1176,8 +1181,14 @@ void RandomPlayerbotMgr::ChangeStrategy(Player* player)
  50.  
  51. void RandomPlayerbotMgr::RandomTeleportForRpg(Player* bot)
  52. {
  53. +#ifdef MANGOS
  54. + sLog.outDetail("Random teleporting bot %s for RPG (%d locations available)", bot->GetName(), rpgLocsCache[bot->getFactionTemplateEntry()->ID].size());
  55. + RandomTeleport(bot, rpgLocsCache[bot->getFactionTemplateEntry()->ID]);
  56. +#endif
  57. +#ifdef CMANGOS
  58. sLog.outDetail("Random teleporting bot %s for RPG (%d locations available)", bot->GetName(), rpgLocsCache[bot->GetFactionTemplateEntry()->ID].size());
  59. RandomTeleport(bot, rpgLocsCache[bot->GetFactionTemplateEntry()->ID]);
  60. +#endif
  61. }
  62.  
  63. void RandomPlayerbotMgr::Remove(Player* bot)
  64. diff --git a/playerbot/strategy/actions/MovementActions.cpp b/playerbot/strategy/actions/MovementActions.cpp
  65. index 1a4c996..bf07030 100644
  66. --- a/playerbot/strategy/actions/MovementActions.cpp
  67. +++ b/playerbot/strategy/actions/MovementActions.cpp
  68. @@ -98,7 +98,7 @@ bool MovementAction::MoveTo(uint32 mapId, float x, float y, float z, bool idle)
  69. return true;
  70. }
  71.  
  72. - ai->TellMasterNoFacing("No need to move");
  73. +/* ai->TellMasterNoFacing("No need to move"); */
  74. return false;
  75. }
  76.  
  77. diff --git a/playerbot/strategy/actions/TellReputationAction.cpp b/playerbot/strategy/actions/TellReputationAction.cpp
  78. index 40e955c..1bcaebf 100644
  79. --- a/playerbot/strategy/actions/TellReputationAction.cpp
  80. +++ b/playerbot/strategy/actions/TellReputationAction.cpp
  81. @@ -18,8 +18,12 @@ bool TellReputationAction::Execute(Event event)
  82. Unit* unit = master->GetMap()->GetUnit(selection);
  83. if (!unit)
  84. return false;
  85. -
  86. +#ifdef MANGOS
  87. + const FactionTemplateEntry *factionTemplate = unit->getFactionTemplateEntry();
  88. +#endif
  89. +#ifdef CMANGOS
  90. const FactionTemplateEntry *factionTemplate = unit->GetFactionTemplateEntry();
  91. +#endif
  92. uint32 faction = factionTemplate->faction;
  93. const FactionEntry* entry = sFactionStore.LookupEntry
  94. #ifdef CMANGOS
  95. diff --git a/playerbot/strategy/actions/WhoAction.cpp b/playerbot/strategy/actions/WhoAction.cpp
  96. index 4e19131..1e397ea 100644
  97. --- a/playerbot/strategy/actions/WhoAction.cpp
  98. +++ b/playerbot/strategy/actions/WhoAction.cpp
  99. @@ -89,7 +89,12 @@ string WhoAction::QuerySkill(string text)
  100. string skillName = chat->formatSkill(skill);
  101. uint32 spellId = AI_VALUE2(uint32, "spell id", skillName);
  102. uint16 value = bot->GetSkillValue(skill);
  103. +#ifdef MANGOS
  104. + uint16 maxSkill = bot->GetMaxSkillValue(skill);
  105. +#endif
  106. +#ifdef CMANGOS
  107. uint16 maxSkill = bot->GetSkillMax(skill);
  108. +#endif
  109. ObjectGuid guid = bot->GetObjectGuid();
  110. string data = "0";
  111. out << "|cFFFFFF00|Htrade:" << spellId << ":" << value << ":" << maxSkill << ":"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement