9
3

GroundSpawn.h 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. #ifndef __EQ2_GroundSpawn__
  17. #define __EQ2_GroundSpawn__
  18. #include "Spawn.h"
  19. #include "client.h"
  20. #include "../common/Mutex.h"
  21. class GroundSpawn : public Spawn {
  22. public:
  23. GroundSpawn();
  24. virtual ~GroundSpawn();
  25. GroundSpawn* Copy(){
  26. GroundSpawn* new_spawn = new GroundSpawn();
  27. new_spawn->size = size;
  28. new_spawn->SetPrimaryCommands(&primary_command_list);
  29. new_spawn->SetSecondaryCommands(&secondary_command_list);
  30. new_spawn->database_id = database_id;
  31. new_spawn->primary_command_list_id = primary_command_list_id;
  32. new_spawn->secondary_command_list_id = secondary_command_list_id;
  33. memcpy(&new_spawn->appearance, &appearance, sizeof(AppearanceData));
  34. new_spawn->faction_id = faction_id;
  35. new_spawn->target = 0;
  36. new_spawn->SetTotalHP(GetTotalHP());
  37. new_spawn->SetTotalPower(GetTotalPower());
  38. new_spawn->SetHP(GetHP());
  39. new_spawn->SetPower(GetPower());
  40. new_spawn->SetNumberHarvests(number_harvests);
  41. new_spawn->SetAttemptsPerHarvest(num_attempts_per_harvest);
  42. new_spawn->SetGroundSpawnEntryID(groundspawn_id);
  43. new_spawn->SetCollectionSkill(collection_skill.c_str());
  44. SetQuestsRequired(new_spawn);
  45. new_spawn->forceMapCheck = forceMapCheck;
  46. new_spawn->SetOmittedByDBFlag(IsOmittedByDBFlag());
  47. return new_spawn;
  48. }
  49. bool IsGroundSpawn(){ return true; }
  50. EQ2Packet* serialize(Player* player, int16 version);
  51. int8 GetNumberHarvests();
  52. void SetNumberHarvests(int8 val);
  53. int8 GetAttemptsPerHarvest();
  54. void SetAttemptsPerHarvest(int8 val);
  55. int32 GetGroundSpawnEntryID();
  56. void SetGroundSpawnEntryID(int32 val);
  57. void ProcessHarvest(Client* client);
  58. void SetCollectionSkill(const char* val);
  59. const char* GetCollectionSkill();
  60. string GetHarvestMessageName(bool present_tense = false, bool failure = false);
  61. string GetHarvestSpellType();
  62. string GetHarvestSpellName();
  63. void HandleUse(Client* client, string type);
  64. private:
  65. int8 number_harvests;
  66. int8 num_attempts_per_harvest;
  67. int32 groundspawn_id;
  68. string collection_skill;
  69. Mutex MHarvest;
  70. Mutex MHarvestUse;
  71. };
  72. #endif