Bot.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 RemoveItem(Item* item);
  14. void TradeItemAdded(Item* item);
  15. void AddItemToTrade(int8 slot);
  16. bool CheckTradeItems(map<int8, TradeItemInfo>* list);
  17. void FinishTrade();
  18. void GetNewSpells();
  19. map<int32, int8>* GetBotSpells() { return &dd_spells; }
  20. bool ShowHelm;
  21. bool ShowCloak;
  22. bool CanTaunt;
  23. Entity* GetCombatTarget();
  24. void SetCombatTarget(int32 target) { combat_target = target; }
  25. Spell* SelectSpellToCast(float distance);
  26. void MessageGroup(string msg);
  27. void SetRecast(Spell* spell, int32 time);
  28. bool ShouldMelee();
  29. Spell* GetNextBuffSpell() { return GetBuffSpell(); }
  30. Spell* GetHealSpell();
  31. Spell* GetRezSpell();
  32. void SetMainTank(Entity* tank) { main_tank = tank; }
  33. void Camp(bool immediate=false);
  34. void ChangeLevel(int16 old_level, int16 new_level);
  35. private:
  36. bool CanEquipItem(Item* item);
  37. bool IsSpellReady(Spell* spell);
  38. Spell* GetTauntSpell();
  39. Spell* GetDetauntSpell();
  40. Spell* GetHoTWardSpell();
  41. Spell* GetDebuffSpell();
  42. Spell* GetCombatBuffSpell();
  43. Spell* GetDoTSpell();
  44. Spell* GetDDSpell();
  45. Spell* GetBuffSpell();
  46. Spell* GetCureSpell();
  47. int8 GetHealThreshold();
  48. set<int8> trading_slots;
  49. int32 combat_target;
  50. Entity* main_tank;
  51. map<int32, int8> bot_spells;
  52. map<int32, int8> dd_spells;
  53. map<int32, int8> dot_spells;
  54. map<int32, int8> heal_spells;
  55. map<int32, int8> hot_ward_spells;
  56. map<int32, int8> debuff_spells;
  57. map<int32, int8> buff_spells;
  58. map<int32, int8> combat_buff_spells;
  59. map<int32, int8> taunt_spells;
  60. map<int32, int8> detaunt_spells;
  61. map<int32, int8> rez_spells;
  62. map<int32, int8> cure_spells;
  63. // First int32 = spell id (change to timer id later), second int32 is time the spell is available to cast again
  64. map<int32, int32> recast_times;
  65. };