Bot.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #pragma once
  2. #include "../NPC.h"
  3. #include <set>
  4. struct TradeItemInfo;
  5. class Bot : public NPC {
  6. public:
  7. Bot();
  8. ~Bot();
  9. int32 BotID; // DB id
  10. int32 BotIndex; // Bot id with its owner (player)
  11. bool IsBot() { return true; }
  12. void GiveItem(int32 item_id);
  13. void GiveItem(Item* item);
  14. void RemoveItem(Item* item);
  15. void TradeItemAdded(Item* item);
  16. void AddItemToTrade(int8 slot);
  17. bool CheckTradeItems(map<int8, TradeItemInfo>* list);
  18. void FinishTrade();
  19. void GetNewSpells();
  20. map<int32, int8>* GetBotSpells() { return &dd_spells; }
  21. bool ShowHelm;
  22. bool ShowCloak;
  23. bool CanTaunt;
  24. Entity* GetCombatTarget();
  25. void SetCombatTarget(int32 target) { combat_target = target; }
  26. Spell* SelectSpellToCast(float distance);
  27. void MessageGroup(string msg);
  28. void SetRecast(Spell* spell, int32 time);
  29. bool ShouldMelee();
  30. Spell* GetNextBuffSpell(Spawn* target = 0) { return GetBuffSpell(); }
  31. Spell* GetHealSpell();
  32. Spell* GetRezSpell();
  33. void SetMainTank(Entity* tank) { main_tank = tank; }
  34. void Camp(bool immediate=false);
  35. void ChangeLevel(int16 old_level, int16 new_level);
  36. bool IsCamping() { return camping; }
  37. bool IsImmediateCamp() { return immediate_camp; }
  38. void Begin_Camp();
  39. private:
  40. bool CanEquipItem(Item* item);
  41. bool IsSpellReady(Spell* spell);
  42. Spell* GetTauntSpell();
  43. Spell* GetDetauntSpell();
  44. Spell* GetHoTWardSpell();
  45. Spell* GetDebuffSpell();
  46. Spell* GetCombatBuffSpell();
  47. Spell* GetDoTSpell();
  48. Spell* GetDDSpell();
  49. Spell* GetBuffSpell();
  50. Spell* GetCureSpell();
  51. int8 GetHealThreshold();
  52. set<int8> trading_slots;
  53. int32 combat_target;
  54. Entity* main_tank;
  55. map<int32, int8> bot_spells;
  56. map<int32, int8> dd_spells;
  57. map<int32, int8> dot_spells;
  58. map<int32, int8> heal_spells;
  59. map<int32, int8> hot_ward_spells;
  60. map<int32, int8> debuff_spells;
  61. map<int32, int8> buff_spells;
  62. map<int32, int8> combat_buff_spells;
  63. map<int32, int8> taunt_spells;
  64. map<int32, int8> detaunt_spells;
  65. map<int32, int8> rez_spells;
  66. map<int32, int8> cure_spells;
  67. // First int32 = spell id (change to timer id later), second int32 is time the spell is available to cast again
  68. map<int32, int32> recast_times;
  69. std::atomic<bool> camping;
  70. std::atomic<bool> immediate_camp;
  71. };